csv_pirate 5.0.6.pre1 → 5.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -59,3 +59,5 @@ pkg
59
59
  *.gem
60
60
  *.sw?
61
61
  spec/csv/*
62
+
63
+ log
data/CHANGELOG CHANGED
@@ -1,4 +1,7 @@
1
- Version 5.0.5 2012-08-20
1
+ Version 5.0.6 2012-09-13
2
+ - Added back more support for pre v5 syntax with deprecation warnings. CsvPirate.new & create now work again. (Issue 2)
3
+
4
+ Version 5.0.6.pre1 2012-08-20
2
5
  - Updated to tests to latest rspec
3
6
  - Fixed specs to be able to run on other machines that don't have y cruft (like travis-ci!)
4
7
  - Moved railtie to it's own file
@@ -33,6 +33,18 @@ module CsvPirate
33
33
  ActiveRecord::Base.send(:extend, CsvPirate::PirateShip::ActMethods)
34
34
  end
35
35
  end
36
+
37
+ # Support the old (< v5.0.0) API
38
+ def self.new(*args)
39
+ warn "[DEPRECATION] \"CsvPirate.new\" is deprecated. Use \"CsvPirate::TheCapn.new\" instead. Called from: #{caller.first}"
40
+ CsvPirate::TheCapn.new(*args)
41
+ end
42
+
43
+ def self.create(*args)
44
+ warn "[DEPRECATION] \"CsvPirate.create\" is deprecated. Use \"CsvPirate::TheCapn.create\" instead. Called from: #{caller.first}"
45
+ CsvPirate::TheCapn.new(*args)
46
+ end
47
+
36
48
  end
37
49
 
38
50
  # Support the old (< v5.0.0) API
@@ -44,7 +56,7 @@ module NinthBit
44
56
  has_csv_pirate = ActMethods.instance_method(:has_csv_pirate_ship)
45
57
 
46
58
  define_method(:has_csv_pirate_ship) do |args|
47
- warn "[DEPRECATION] \"NinthBit::PirateShip::ActMethods\" module is deprecated. Use \"include CsvPirate::PirateShip::ActMethods\" instead. Called from: #{Kernel.caller.first}"
59
+ warn "[DEPRECATION] \"NinthBit::PirateShip::ActMethods\" module is deprecated. Use \"include CsvPirate::PirateShip::ActMethods\" instead. Called from: #{caller.first}"
48
60
  has_csv_pirate.bind(self).call(args)
49
61
  end
50
62
 
@@ -1,6 +1,6 @@
1
1
  module CsvPirate
2
2
 
3
- VERSION = "5.0.6.pre1"
3
+ VERSION = "5.0.6"
4
4
 
5
5
  VERSION_ARRAY = VERSION.split('.')
6
6
 
@@ -30,4 +30,28 @@ describe CsvPirate do
30
30
  end
31
31
  end
32
32
 
33
+ describe "#new" do
34
+ it "should support the old < v5 syntax" do
35
+ # Similar to example from the readme
36
+ CsvPirate.new({
37
+ :swag => [Struct.new(:first_name, :last_name, :birthday).new('Joe','Smith','12/24/1805')],
38
+ :waggoner => 'active_users_logged_in',
39
+ :booty => [:first_name, :last_name],
40
+ :chart => ['log','csv']
41
+ }).class.should == CsvPirate::TheCapn
42
+ end
43
+ end
44
+
45
+ describe "#create" do
46
+ it "should support the old < v5 syntax" do
47
+ # Similar to example from the readme
48
+ CsvPirate.create({
49
+ :swag => [Struct.new(:first_name, :last_name, :birthday).new('Joe','Smith','12/24/1805')],
50
+ :waggoner => 'active_users_logged_in',
51
+ :booty => [:first_name, :last_name],
52
+ :chart => ['log','csv']
53
+ }).class.should == CsvPirate::TheCapn
54
+ end
55
+ end
56
+
33
57
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csv_pirate
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.6.pre1
5
- prerelease: 6
4
+ version: 5.0.6
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Peter Boling
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-21 00:00:00.000000000 Z
12
+ date: 2012-09-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -182,3 +182,4 @@ test_files:
182
182
  - spec/spec_helper.rb
183
183
  - spec/support/glowing_gas_ball.rb
184
184
  - spec/support/star.rb
185
+ has_rdoc: