csv_pirate 4.0.6 → 4.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ Version 4.0.7 2010-03-08
2
+ - Fixed bug preventing use with rake db: tasks (create, reset, etc)
3
+
4
+ Version 4.0.6 2010-02-12
5
+ - Fixed bug in init preventing use with rake
6
+
1
7
  Version 4.0.5 2010-02-02
2
8
  - Fixed bug in check_booty
3
9
  - Improved init scripts
@@ -421,6 +421,10 @@ This allows you to modify the csv_pirate object before creating the csv like thi
421
421
 
422
422
  The tests are run with rspec. The test suite is expanding. Currently there is ample coverage of basic functionality.
423
423
 
424
+ You will need these gems to run specs:
425
+
426
+ gem install jeweler cucumber test-unit rspec fastercsv
427
+
424
428
  To run tests cd to where ever you have csv_pirate installed, and do:
425
429
 
426
430
  rake spec
@@ -1,5 +1,5 @@
1
1
  ---
2
- :patch: 6
2
+ :patch: 10
3
3
  :major: 4
4
- :minor: 0
5
4
  :build:
5
+ :minor: 0
@@ -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.6"
8
+ s.version = "4.0.10"
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-02-12}
12
+ s.date = %q{2010-03-08}
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}
@@ -39,7 +39,7 @@ It works better if you are wearing a tricorne!}
39
39
  s.homepage = %q{http://github.com/pboling/csv_pirate}
40
40
  s.rdoc_options = ["--charset=UTF-8"]
41
41
  s.require_paths = ["lib"]
42
- s.rubygems_version = %q{1.3.5}
42
+ s.rubygems_version = %q{1.3.6}
43
43
  s.summary = %q{Easily create CSVs of any data that can be derived from instance methods on your classes.}
44
44
  s.test_files = [
45
45
  "spec/csv_pirate_spec.rb",
@@ -107,8 +107,9 @@ class CsvPirate
107
107
  @waggoner = args.first[:waggoner] || "#{self.grub || self.swag}"
108
108
  raise ArgumentError, ":waggoner is #{self.waggoner.inspect}, and must be a string at least one character long" if self.waggoner.nil? || self.waggoner.length < 1
109
109
 
110
+ # Not checking if empty here because PirateShip will send [] if the database is unavailable, to allow tasks like rake db:create to run
110
111
  @booty = args.first[:booty] || [] # would like to use Class#instance_variables for generic classes
111
- raise ArgumentError, ":booty is #{self.booty.inspect}, and must be an array of methods to call on a class for CSV data" if self.booty.nil? || !self.booty.is_a?(Array) || self.booty.empty?
112
+ raise ArgumentError, ":booty is #{self.booty.inspect}, and must be an array of methods to call on a class for CSV data" if self.booty.nil? || !self.booty.is_a?(Array)
112
113
 
113
114
  @chart = args.first[:chart] || ['log','csv']
114
115
  raise ArgumentError, ":chart is #{self.chart.inspect}, and must be an array of directory names, which will become the filepath for the csv file" if self.chart.nil? || !self.chart.is_a?(Array) || self.chart.empty?
@@ -54,10 +54,17 @@ module NinthBit
54
54
  def prevent_from_failing_pre_migration
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
- defined?(ActiveRecord) && ActiveRecord::Base.connected? ?
57
+ begin
58
+ defined?(ActiveRecord) && ActiveRecord::Base.connected? ?
58
59
  self.respond_to?(:table_name) && ActiveRecord::Base.connection.tables.include?(self.table_name) :
59
- true
60
- end
60
+ false
61
+ #The only error that occurs here is when ActiveRecord checks for the table but the database isn't setup yet.
62
+ #It was preventing rake db:create from working.
63
+ rescue
64
+ puts "csv_pirate: failed to connect to database, or table missing"
65
+ return false
66
+ end
67
+ end
61
68
 
62
69
  end
63
70
 
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csv_pirate
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.6
4
+ prerelease: false
5
+ segments:
6
+ - 4
7
+ - 0
8
+ - 10
9
+ version: 4.0.10
5
10
  platform: ruby
6
11
  authors:
7
12
  - Peter Boling
@@ -9,19 +14,21 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-02-12 00:00:00 -05:00
17
+ date: 2010-03-08 00:00:00 -05:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: fastercsv
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
23
29
  version: "0"
24
- version:
30
+ type: :runtime
31
+ version_requirements: *id001
25
32
  description: |-
26
33
  CsvPirate is the easy way to create a CSV of essentially anything in Ruby, in full pirate regalia.
27
34
  It works better if you are wearing a tricorne!
@@ -64,18 +71,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
64
71
  requirements:
65
72
  - - ">="
66
73
  - !ruby/object:Gem::Version
74
+ segments:
75
+ - 0
67
76
  version: "0"
68
- version:
69
77
  required_rubygems_version: !ruby/object:Gem::Requirement
70
78
  requirements:
71
79
  - - ">="
72
80
  - !ruby/object:Gem::Version
81
+ segments:
82
+ - 0
73
83
  version: "0"
74
- version:
75
84
  requirements: []
76
85
 
77
86
  rubyforge_project:
78
- rubygems_version: 1.3.5
87
+ rubygems_version: 1.3.6
79
88
  signing_key:
80
89
  specification_version: 3
81
90
  summary: Easily create CSVs of any data that can be derived from instance methods on your classes.