{"number":60,"pull_request":{"number":60,"issue_url":"https://github.com/activewarehouse/activewarehouse-etl/issues/60","head":{"repo":{"master_branch":null,"name":"activewarehouse-etl","created_at":"2011-10-03T09:42:15Z","size":156,"clone_url":"https://github.com/smeyfroi/activewarehouse-etl.git","private":false,"updated_at":"2011-10-04T20:12:28Z","watchers":1,"ssh_url":"git@github.com:smeyfroi/activewarehouse-etl.git","url":"https://api.github.com/repos/smeyfroi/activewarehouse-etl","git_url":"git://github.com/smeyfroi/activewarehouse-etl.git","language":"Ruby","fork":true,"svn_url":"https://svn.github.com/smeyfroi/activewarehouse-etl","id":2503706,"pushed_at":"2011-10-03T10:08:07Z","open_issues":0,"homepage":"","description":"Extract-Transform-Load library from ActiveWarehouse","forks":0,"html_url":"https://github.com/smeyfroi/activewarehouse-etl","owner":{"avatar_url":"https://secure.gravatar.com/avatar/5eda043027a7252dd2a168d4f4896c91?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/smeyfroi","id":203996,"login":"smeyfroi"}},"label":"smeyfroi:master","sha":"84fe68aa5beba3aef3b1ab253f0acb9004316797","ref":"master","user":{"avatar_url":"https://secure.gravatar.com/avatar/5eda043027a7252dd2a168d4f4896c91?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/smeyfroi","id":203996,"login":"smeyfroi"}},"merged_by":{"avatar_url":"https://secure.gravatar.com/avatar/91eb330fb36d1e03c856574dfb77d2bc?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/thbar","id":10141,"login":"thbar"},"created_at":"2011-10-03T10:18:01Z","changed_files":4,"merged":true,"body":"A couple of changes:\r\n* a little change allows CSV Destinations to write a header line at the top of the output CSV.\r\n* little refactor pushes Destination#order_from_source nearer where it belongs in the source implementations themselves. Then for FileSource, the field order actually comes from the Parser.\r\n* then on top of those changes I've added a bit that makes specifying output fields optional for a csv_destination: it can find the order from the source.\r\n\r\nEnd result is that a simple pipeline that transforms from one CSV into another CSV can be specified with a .ctl like this (and without specifying all the fields):\r\n\r\n    require File.dirname(__FILE__) + \"/ifapps_encode_processor\"\r\n    \r\n    source :in, {\r\n        :file => \"t102.csv\",\r\n        :parser => :csv,\r\n        :skip_lines => 1,\r\n    }\r\n    \r\n    # ... transform and filter stuff in here\r\n    \r\n    destination :out, {\r\n        :type => :csv,\r\n        :file => \"t102-decoded.csv\",\r\n        :write_header => true,\r\n    }\r\n\r\n\r\nSorry there's no tests for these changes: I haven't got a DB set up to run the tests yet (we're doing NoSQL stuff over here).","comments":1,"title":"Tidy up CSV destination","additions":29,"diff_url":"https://github.com/activewarehouse/activewarehouse-etl/pull/60.diff","updated_at":"2011-10-09T08:27:48Z","url":"https://api.github.com/repos/activewarehouse/activewarehouse-etl/pulls/60","id":372019,"patch_url":"https://github.com/activewarehouse/activewarehouse-etl/pull/60.patch","mergeable":null,"merged_at":"2011-10-09T08:27:48Z","commits":2,"closed_at":"2011-10-09T08:27:48Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/5eda043027a7252dd2a168d4f4896c91?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/smeyfroi","id":203996,"login":"smeyfroi"},"deletions":12,"html_url":"https://github.com/activewarehouse/activewarehouse-etl/pull/60","base":{"repo":{"master_branch":null,"name":"activewarehouse-etl","created_at":"2010-02-12T20:02:33Z","size":208,"clone_url":"https://github.com/activewarehouse/activewarehouse-etl.git","private":false,"updated_at":"2011-10-09T08:27:48Z","watchers":25,"ssh_url":"git@github.com:activewarehouse/activewarehouse-etl.git","url":"https://api.github.com/repos/activewarehouse/activewarehouse-etl","git_url":"git://github.com/activewarehouse/activewarehouse-etl.git","language":"Ruby","fork":false,"svn_url":"https://svn.github.com/activewarehouse/activewarehouse-etl","id":515661,"pushed_at":"2011-10-09T08:27:48Z","open_issues":27,"homepage":"","description":"Extract-Transform-Load library from ActiveWarehouse","forks":40,"html_url":"https://github.com/activewarehouse/activewarehouse-etl","owner":{"avatar_url":"https://secure.gravatar.com/avatar/38ddcd8e1a56ff41bbd03db063082c57?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","url":"https://api.github.com/users/activewarehouse","id":832139,"login":"activewarehouse"}},"label":"activewarehouse:master","sha":"2f0aa35b2c633bf5f5a28fe1d654fa45f43f2a38","ref":"master","user":{"avatar_url":"https://secure.gravatar.com/avatar/38ddcd8e1a56ff41bbd03db063082c57?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","url":"https://api.github.com/users/activewarehouse","id":832139,"login":"activewarehouse"}},"state":"closed"},"action":"closed"}