csv_pirate 5.0.2 → 5.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.txt CHANGED
@@ -1,5 +1,11 @@
1
+ Version 5.0.4 2011-06-16
2
+ - File Cleanup
3
+
4
+ Version 5.0.3 2011-06-16
5
+ - Fixed Compatability with Rails 2
6
+
1
7
  Version 5.0.2 2011-06-16
2
- - Fixed Compatability with Rails
8
+ - Fixed Compatability with Rails 3
3
9
  - Added support, with deprecation warning, for pre-5.0.0 API.
4
10
 
5
11
  Version 5.0.0 2011-06-14
data/README.rdoc CHANGED
@@ -3,7 +3,7 @@
3
3
  Easily create CSVs of any data that can be derived from your models.
4
4
 
5
5
  CsvPirate is the easy way to create a CSV of essentially anything in Ruby, in full pirate regalia.
6
- It works better if you are wearing a tricorne! Now compatible with Ruby 1.8.7 & 1.9.2
6
+ It works better if you are wearing a tricorne! Now compatible with Ruby 1.8.7 & 1.9.2, and Rails 2 & 3!
7
7
 
8
8
  Everything in the source that depended on Rails extensions of Ruby classes has been refactored to work in pure Ruby!
9
9
 
@@ -54,7 +54,7 @@ Release Announcement:
54
54
  http://galtzo.blogspot.com/2009/03/csv-pirate.html
55
55
 
56
56
 
57
- == Install as a RubyGem
57
+ == Install as a RubyGem from source
58
58
 
59
59
  [sudo] gem install csv_pirate
60
60
 
@@ -65,15 +65,7 @@ Gem Using Git building from source:
65
65
  git clone git://github.com/pboling/csv_pirate.git
66
66
  cd csv_pirate
67
67
  gem build csv_pirate.gemspec
68
- sudo gem install csv_pirate-5.0.1.gem # (Or whatever version gets built)
69
-
70
- Then in your environment.rb (if you are just going to use it from the console, you can require it as needed there, and skip the config.gem):
71
-
72
- config.gem 'csv_pirate'
73
-
74
- Then cd to your rails app to optionally freeze the gem into your app (if you roll this way):
75
-
76
- rake gems:freeze GEM=csv_pirate
68
+ sudo gem install csv_pirate-5.0.4.gem # (Or whatever version gets built)
77
69
 
78
70
  == Install as a Plugin
79
71
 
@@ -83,11 +75,18 @@ Plugin using Git:
83
75
 
84
76
  == Install as a Git Submodule (plugin)
85
77
 
86
- git submodule add git://github.com/pboling/sanitize_email.git vendor/plugins/sanitize_email
78
+ git submodule add git://github.com/pboling/csv_pirate.git vendor/plugins/csv_pirate
87
79
 
88
80
  == Upgrading
89
81
 
90
- In older versions :chart was a string which indicated where you wanted to hide the loot (write the csv file)
82
+ From version prior to 5.0
83
+
84
+ NinthBit::PirateShip::ActMethods has been deprecated in favor of CsvPirate::PirateShip::ActMethods.
85
+ Old API still works for now.
86
+
87
+ From version prior to 4.0
88
+
89
+ :chart was a string which indicated where you wanted to hide the loot (write the csv file)
91
90
  Now it must be an array of directory names. So if you want your loot in "log/csv/pirates/model_name", then chart is:
92
91
  ['log','csv','pirates','model_name']
93
92
  CsvPirate ensures that whatever you choose as your chart exists in the filesystem, and creates the directories if need be.
@@ -120,7 +119,7 @@ with as many attributes as possible set equal to the data from the CSV.
120
119
  Since the defaults assume an active record class you need to override some of them:
121
120
 
122
121
  class Star
123
- extend NinthBit::PirateShip::ActMethods
122
+ extend CsvPirate::PirateShip::ActMethods
124
123
  has_csv_pirate_ship :booty => [:name, :distance, :spectral_type, {:name => :hash}, {:name => :next}, {:name => :upcase}, :star_vowels],
125
124
  :spyglasses => [:get_stars]
126
125
 
@@ -461,4 +460,4 @@ Thanks go to:
461
460
 
462
461
  ----------------------------------------------------------------------------------
463
462
  Author: Peter Boling, peter.boling at gmail dot com
464
- Copyright (c) 2009-2010 Peter H. Boling of 9thBit LLC, released under the MIT license. See LICENSE for details.
463
+ Copyright (c) 2009-2011 Peter H. Boling of 9thBit LLC, released under the MIT license. See LICENSE for details.
data/Rakefile CHANGED
@@ -38,6 +38,7 @@ It works better if you are wearing a tricorne!}
38
38
  "spec/spec_helpers/star.rb",
39
39
  "Rakefile",
40
40
  "Gemfile",
41
+ "init.rb",
41
42
  "LICENSE.txt",
42
43
  "CHANGELOG.txt",
43
44
  "VERSION.yml"]
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
+ :patch: 4
3
+ :build:
2
4
  :major: 5
3
5
  :minor: 0
4
- :patch: 2
5
- :build:
data/csv_pirate.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{csv_pirate}
8
- s.version = "5.0.2"
8
+ s.version = "5.0.4"
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"]
@@ -41,19 +41,22 @@ It works better if you are wearing a tricorne!}
41
41
  ]
42
42
  s.homepage = %q{http://github.com/pboling/csv_pirate}
43
43
  s.require_paths = ["lib"]
44
- s.rubygems_version = %q{1.7.2}
44
+ s.rubygems_version = %q{1.3.7}
45
45
  s.summary = %q{Easily create CSVs of any data that can be derived from instance methods on your classes.}
46
46
 
47
47
  if s.respond_to? :specification_version then
48
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
48
49
  s.specification_version = 3
49
50
 
50
51
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
52
+ s.add_runtime_dependency(%q<fastercsv>, [">= 1.4.0"])
51
53
  s.add_development_dependency(%q<rspec>, ["~> 2.6"])
52
54
  s.add_development_dependency(%q<shoulda>, [">= 0"])
53
55
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
54
56
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.2"])
55
57
  s.add_development_dependency(%q<rcov>, [">= 0"])
56
58
  else
59
+ s.add_dependency(%q<fastercsv>, [">= 1.4.0"])
57
60
  s.add_dependency(%q<rspec>, ["~> 2.6"])
58
61
  s.add_dependency(%q<shoulda>, [">= 0"])
59
62
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
@@ -61,6 +64,7 @@ It works better if you are wearing a tricorne!}
61
64
  s.add_dependency(%q<rcov>, [">= 0"])
62
65
  end
63
66
  else
67
+ s.add_dependency(%q<fastercsv>, [">= 1.4.0"])
64
68
  s.add_dependency(%q<rspec>, ["~> 2.6"])
65
69
  s.add_dependency(%q<shoulda>, [">= 0"])
66
70
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
data/lib/csv_pirate.rb CHANGED
@@ -16,27 +16,34 @@ else
16
16
  end
17
17
 
18
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
19
+ # If you are using this on a vanilla Ruby class (no rails or active record) then extend your class like this:
20
+ # MyClass.send(:extend, NinthBit::PirateShip::ActMethods) if defined?(MyClass)
21
+ # Alternatively you can do this inside your class definition:
22
+ # class MyClass
23
+ # extend NinthBit::PirateShip::ActMethods
24
+ # end
25
+ # If you are using ActiveRecord then it is done for you :)
23
26
 
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)
27
+ if defined?(Rails) && defined?(ActiveRecord)
28
+ if defined?(Rails::Railtie)
29
+ # namespace our plugin and inherit from Rails::Railtie
30
+ # to get our plugin into the initialization process
31
+ class Railtie < Rails::Railtie
32
+ # Add a to_prepare block which is executed once in production
33
+ # and before each request in development
34
+ config.to_prepare do
35
+ ActiveRecord::Base.send(:extend, CsvPirate::PirateShip::ActMethods)
36
+ end
37
+ end
38
+ else
39
+ if !defined?(Rake) && defined?(config) && config.respond_to?(:gems)
40
+ #Not sure if this is ever executed...
41
+ config.to_prepare do
42
+ ActiveRecord::Base.send(:extend, CsvPirate::PirateShip::ActMethods)
43
+ end
44
+ else
45
+ #This one cleans up that mess...
46
+ ActiveRecord::Base.send(:extend, CsvPirate::PirateShip::ActMethods)
40
47
  end
41
48
  end
42
49
  end
metadata CHANGED
@@ -1,8 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csv_pirate
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 5.0.2
4
+ hash: 63
5
+ prerelease: false
6
+ segments:
7
+ - 5
8
+ - 0
9
+ - 4
10
+ version: 5.0.4
6
11
  platform: ruby
7
12
  authors:
8
13
  - Peter Boling
@@ -10,63 +15,100 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2011-06-16 00:00:00 Z
18
+ date: 2011-06-16 00:00:00 -04:00
19
+ default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
22
+ type: :runtime
23
+ prerelease: false
24
+ name: fastercsv
25
+ version_requirements: &id001 !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ hash: 7
31
+ segments:
32
+ - 1
33
+ - 4
34
+ - 0
35
+ version: 1.4.0
36
+ requirement: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ type: :development
39
+ prerelease: false
16
40
  name: rspec
17
- requirement: &id001 !ruby/object:Gem::Requirement
41
+ version_requirements: &id002 !ruby/object:Gem::Requirement
18
42
  none: false
19
43
  requirements:
20
44
  - - ~>
21
45
  - !ruby/object:Gem::Version
46
+ hash: 15
47
+ segments:
48
+ - 2
49
+ - 6
22
50
  version: "2.6"
51
+ requirement: *id002
52
+ - !ruby/object:Gem::Dependency
23
53
  type: :development
24
54
  prerelease: false
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
55
  name: shoulda
28
- requirement: &id002 !ruby/object:Gem::Requirement
56
+ version_requirements: &id003 !ruby/object:Gem::Requirement
29
57
  none: false
30
58
  requirements:
31
59
  - - ">="
32
60
  - !ruby/object:Gem::Version
61
+ hash: 3
62
+ segments:
63
+ - 0
33
64
  version: "0"
65
+ requirement: *id003
66
+ - !ruby/object:Gem::Dependency
34
67
  type: :development
35
68
  prerelease: false
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
38
69
  name: bundler
39
- requirement: &id003 !ruby/object:Gem::Requirement
70
+ version_requirements: &id004 !ruby/object:Gem::Requirement
40
71
  none: false
41
72
  requirements:
42
73
  - - ~>
43
74
  - !ruby/object:Gem::Version
75
+ hash: 23
76
+ segments:
77
+ - 1
78
+ - 0
79
+ - 0
44
80
  version: 1.0.0
81
+ requirement: *id004
82
+ - !ruby/object:Gem::Dependency
45
83
  type: :development
46
84
  prerelease: false
47
- version_requirements: *id003
48
- - !ruby/object:Gem::Dependency
49
85
  name: jeweler
50
- requirement: &id004 !ruby/object:Gem::Requirement
86
+ version_requirements: &id005 !ruby/object:Gem::Requirement
51
87
  none: false
52
88
  requirements:
53
89
  - - ~>
54
90
  - !ruby/object:Gem::Version
91
+ hash: 11
92
+ segments:
93
+ - 1
94
+ - 6
95
+ - 2
55
96
  version: 1.6.2
97
+ requirement: *id005
98
+ - !ruby/object:Gem::Dependency
56
99
  type: :development
57
100
  prerelease: false
58
- version_requirements: *id004
59
- - !ruby/object:Gem::Dependency
60
101
  name: rcov
61
- requirement: &id005 !ruby/object:Gem::Requirement
102
+ version_requirements: &id006 !ruby/object:Gem::Requirement
62
103
  none: false
63
104
  requirements:
64
105
  - - ">="
65
106
  - !ruby/object:Gem::Version
107
+ hash: 3
108
+ segments:
109
+ - 0
66
110
  version: "0"
67
- type: :development
68
- prerelease: false
69
- version_requirements: *id005
111
+ requirement: *id006
70
112
  description: |-
71
113
  CsvPirate is the easy way to create a CSV of essentially anything in Ruby, in full pirate regalia.
72
114
  It works better if you are wearing a tricorne!
@@ -99,6 +141,7 @@ files:
99
141
  - spec/spec_helpers/star.rb
100
142
  - spec/the_capn_spec.rb
101
143
  - uninstall.rb
144
+ has_rdoc: true
102
145
  homepage: http://github.com/pboling/csv_pirate
103
146
  licenses: []
104
147
 
@@ -112,7 +155,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
155
  requirements:
113
156
  - - ">="
114
157
  - !ruby/object:Gem::Version
115
- hash: -214996772817946572
158
+ hash: 3
116
159
  segments:
117
160
  - 0
118
161
  version: "0"
@@ -121,11 +164,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
164
  requirements:
122
165
  - - ">="
123
166
  - !ruby/object:Gem::Version
167
+ hash: 3
168
+ segments:
169
+ - 0
124
170
  version: "0"
125
171
  requirements: []
126
172
 
127
173
  rubyforge_project:
128
- rubygems_version: 1.7.2
174
+ rubygems_version: 1.3.7
129
175
  signing_key:
130
176
  specification_version: 3
131
177
  summary: Easily create CSVs of any data that can be derived from instance methods on your classes.