csv_pirate 4.0.4 → 4.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ Version 4.0.5 2010-02-02
2
+ - Fixed bug in check_booty
3
+ - Improved init scripts
4
+
1
5
  Version 4.0.4 2010-01-18
2
6
  - Fixed bug with find_or_create param to to_memory
3
7
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- :patch: 4
2
+ :patch: 5
3
3
  :major: 4
4
4
  :minor: 0
5
5
  :build:
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{csv_pirate}
8
- s.version = "4.0.4"
8
+ s.version = "4.0.5"
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{2010-01-18}
12
+ s.date = %q{2010-02-02}
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}
data/init.rb CHANGED
@@ -1 +1 @@
1
- require 'rails/init'
1
+ require File.dirname(__FILE__) + "/rails/init.rb"
@@ -55,7 +55,7 @@ module NinthBit
55
55
  # If you aren't using ActiveRecord (you are outside rails) then you must declare your :booty
56
56
  # If you are using ActiveRecord then you only want ot check for booty if the table exists so it won't fail pre-migration
57
57
  defined?(ActiveRecord) && ActiveRecord::Base.connected? ?
58
- ActiveRecord::Base.connection.tables.include?(self.table_name) :
58
+ self.respond_to?(:table_name) && ActiveRecord::Base.connection.tables.include?(self.table_name) :
59
59
  true
60
60
  end
61
61
 
@@ -1,19 +1,35 @@
1
- begin
2
- require 'rubygems'
3
- gem 'fastercsv'
4
- rescue LoadError
5
- "Unable to load dependencies: rubygems or fastercsv"
1
+ #We might have rails...
2
+ if defined?(Rails) && defined?(config) && config.respond_to?(:gems)
3
+
4
+ config.gem 'fastercsv', :lib => 'faster_csv', :version => '>=1.4.0'
5
+
6
+ require 'csv_pirate'
7
+ require 'ninth_bit/pirate_ship'
8
+
9
+ config.to_prepare do
10
+ # If you are using this on a vanilla Ruby class (no rails or active record) then extend your class like this:
11
+ # MyClass.send(:extend, NinthBit::PirateShip::ActMethods) if defined?(MyClass)
12
+ # Alternatively you can do this inside your class definition:
13
+ # class MyClass
14
+ # extend NinthBit::PirateShip::ActMethods
15
+ # end
16
+ # If you are using ActiveRecord then it is done for you :)
17
+ ActiveRecord::Base.send(:extend, NinthBit::PirateShip::ActMethods) if defined?(ActiveRecord)
18
+ end
19
+
20
+ #And we might not...
21
+ else
22
+
23
+ begin
24
+
25
+ require 'rubygems'
26
+ gem 'fastercsv', '>=1.4.0', :lib => 'faster_csv'
27
+ require 'csv_pirate'
28
+ require 'ninth_bit/pirate_ship'
29
+
30
+ rescue Gem::LoadError
31
+ puts "Install the fastercsv gem to enable CsvPirate"
32
+ end
33
+
6
34
  end
7
35
 
8
- require 'faster_csv' unless defined?(FasterCSV)
9
- require 'csv_pirate'
10
- require 'ninth_bit/pirate_ship'
11
-
12
- # If you are using this on a vanilla Ruby class (no rails or active record) then extend your class like this:
13
- # MyClass.send(:extend, NinthBit::PirateShip::ActMethods) if defined?(MyClass)
14
- # Alternatively you can do this inside your class definition:
15
- # class MyClass
16
- # extend NinthBit::PirateShip::ActMethods
17
- # end
18
- # If you are using ActiveRecord then it is done for you :)
19
- ActiveRecord::Base.send(:extend, NinthBit::PirateShip::ActMethods) if defined?(ActiveRecord)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csv_pirate
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.4
4
+ version: 4.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-18 00:00:00 -05:00
12
+ date: 2010-02-02 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency