csv_pirate 5.0.1 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.txt CHANGED
@@ -1,5 +1,9 @@
1
+ Version 5.0.2 2011-06-16
2
+ - Fixed Compatability with Rails
3
+ - Added support, with deprecation warning, for pre-5.0.0 API.
4
+
1
5
  Version 5.0.0 2011-06-14
2
- - Added .txt extension to CHANGELOG and LINCENSE
6
+ - Added .txt extension to CHANGELOG and LICENSE
3
7
  - Improved dependency declarations in Gemfile (removed from Rakefile/gemspec)
4
8
 
5
9
  Version 5.0.0 2011-06-13
data/Gemfile CHANGED
@@ -1,8 +1,8 @@
1
1
  source :rubygems
2
2
 
3
3
  #FasterCSV became the built-in CSV library in Ruby 1.9, so is only required if using Ruby 1.8
4
- if RUBY_VERSION =~ /^1\.8\.\d{1}$/
5
- gem 'fastercsv', '~> 1.5'
4
+ if RUBY_VERSION =~ /^1\.8\.\d*/
5
+ gem 'fastercsv', '>= 1.4.0'
6
6
  end
7
7
 
8
8
  group :development do
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 5
3
3
  :minor: 0
4
- :patch: 1
4
+ :patch: 2
5
5
  :build:
data/csv_pirate.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{csv_pirate}
8
- s.version = "5.0.1"
8
+ s.version = "5.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Peter Boling"]
12
- s.date = %q{2011-06-15}
12
+ s.date = %q{2011-06-16}
13
13
  s.description = %q{CsvPirate is the easy way to create a CSV of essentially anything in Ruby, in full pirate regalia.
14
14
  It works better if you are wearing a tricorne!}
15
15
  s.email = %q{peter.boling@gmail.com}
@@ -1,6 +1,6 @@
1
1
  module CsvPirate
2
2
 
3
- @@conf = YAML::load( File.read( File.absolute_path('VERSION.yml') ) )
3
+ @@conf = YAML::load( File.read( File.join( File.dirname(__FILE__), '..', '..', 'VERSION.yml') ) )
4
4
 
5
5
  MAJOR = @@conf[:major]
6
6
  MINOR = @@conf[:minor]
data/lib/csv_pirate.rb CHANGED
@@ -15,10 +15,50 @@ else
15
15
  require 'faster_csv'
16
16
  end
17
17
 
18
+ module CsvPirate
19
+ if defined?(Rails::Railtie)
20
+ # namespace our plugin and inherit from Rails::Railtie
21
+ # to get our plugin into the initialization process
22
+ class Railtie < Rails::Railtie
23
+
24
+ # configure our plugin on boot. other extension points such
25
+ # as configuration, rake tasks, etc, are also available
26
+ #initializer "csv_pirate.initialize" do |app|
27
+ #end
28
+
29
+ # Add a to_prepare block which is executed once in production
30
+ # and before each request in development
31
+ config.to_prepare do
32
+ # If you are using this on a vanilla Ruby class (no rails or active record) then extend your class like this:
33
+ # MyClass.send(:extend, CsvPirate::PirateShip::ActMethods) if defined?(MyClass)
34
+ # Alternatively you can do this inside your class definition:
35
+ # class MyClass
36
+ # extend CsvPirate::PirateShip::ActMethods
37
+ # end
38
+ # If you are using ActiveRecord then it is done for you :)
39
+ ActiveRecord::Base.send(:extend, CsvPirate::PirateShip::ActMethods) if defined?(ActiveRecord)
40
+ end
41
+ end
42
+ end
43
+ end
44
+
18
45
  require 'csv_pirate/version.rb'
19
46
  require 'csv_pirate/the_capn.rb'
20
47
  require 'csv_pirate/pirate_ship.rb'
21
48
 
22
- module CsvPirate
23
-
49
+ # Support the old (< v5.0.0) API
50
+ module NinthBit
51
+ module PirateShip
52
+ module ActMethods
53
+ include CsvPirate::PirateShip::ActMethods
54
+
55
+ has_csv_pirate = ActMethods.instance_method(:has_csv_pirate_ship)
56
+
57
+ define_method(:has_csv_pirate_ship) do |args|
58
+ warn "[DEPRECATION] \"NinthBit::PirateShip::ActMethods\" module is deprecated. Use \"include CsvPirate::PirateShip::ActMethods\" instead. Called from: #{Kernel.caller.first}"
59
+ has_csv_pirate.bind(self).call(args)
60
+ end
61
+
62
+ end
63
+ end
24
64
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: csv_pirate
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 5.0.1
5
+ version: 5.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Peter Boling
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-06-15 00:00:00 Z
13
+ date: 2011-06-16 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -112,7 +112,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
112
  requirements:
113
113
  - - ">="
114
114
  - !ruby/object:Gem::Version
115
- hash: 2225901631909136480
115
+ hash: -214996772817946572
116
116
  segments:
117
117
  - 0
118
118
  version: "0"