csv_pirate 3.4.1 → 3.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +6 -0
- data/VERSION.yml +3 -2
- data/csv_pirate.gemspec +5 -4
- data/lib/ninth_bit/pirate_ship.rb +12 -4
- metadata +2 -2
data/CHANGELOG
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
Version 3.4.3 2009-11-03
|
2
|
+
- Fixed has_csv_pirate_ship to allow models to load pre-migration, so rake tasks will still run.
|
3
|
+
|
4
|
+
Version 3.4.2 2009-10-15
|
5
|
+
- fixed has_csv_pirate_ship to work with any non-ActiveRecord (i.e. standard Ruby) classes... for real.
|
6
|
+
|
1
7
|
Version 3.4.1 2009-10-12
|
2
8
|
- :blackjack option :join is now working.
|
3
9
|
- Added warnings, and improved Readme
|
data/VERSION.yml
CHANGED
data/csv_pirate.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{csv_pirate}
|
8
|
-
s.version = "3.4.
|
8
|
+
s.version = "3.4.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{2009-
|
12
|
+
s.date = %q{2009-11-03}
|
13
13
|
s.description = %q{CsvPirate is the easy way to create a CSV of essentially anything in Rails, in full pirate regalia.
|
14
14
|
It works better if you are wearing a tricorne!}
|
15
15
|
s.email = %q{peter.boling@gmail.com}
|
@@ -53,3 +53,4 @@ It works better if you are wearing a tricorne!}
|
|
53
53
|
s.add_dependency(%q<fastercsv>, [">= 0"])
|
54
54
|
end
|
55
55
|
end
|
56
|
+
|
@@ -4,11 +4,9 @@ module NinthBit
|
|
4
4
|
module PirateShip
|
5
5
|
|
6
6
|
module ActMethods
|
7
|
-
#coding
|
7
|
+
#coding style is adopted from attachment_fu
|
8
8
|
def has_csv_pirate_ship(options = {})
|
9
|
-
|
10
|
-
# If you are using ActiveRecord then you only want ot check for booty if the table exists so it won't fail pre-migration
|
11
|
-
check_booty = defined?(ActiveRecord) && self.is_a?(ActiveRecord::Base) ? ActiveRecord::Base.connection.tables.include?(self.table_name) : true
|
9
|
+
check_booty = prevent_from_failing_pre_migration
|
12
10
|
|
13
11
|
options[:chart] ||= ['log','csv']
|
14
12
|
options[:aft] ||= '.csv'
|
@@ -46,6 +44,16 @@ module NinthBit
|
|
46
44
|
self.piratey_options = options
|
47
45
|
|
48
46
|
end
|
47
|
+
|
48
|
+
#return true if we can access the tables, return false if we'd better not.
|
49
|
+
def prevent_from_failing_pre_migration
|
50
|
+
# If you aren't using ActiveRecord (you are outside rails) then you must declare your :booty
|
51
|
+
# If you are using ActiveRecord then you only want ot check for booty if the table exists so it won't fail pre-migration
|
52
|
+
defined?(ActiveRecord) && ActiveRecord::Base.connection ?
|
53
|
+
ActiveRecord::Base.connection.tables.include?(self.table_name) :
|
54
|
+
true
|
55
|
+
end
|
56
|
+
|
49
57
|
end
|
50
58
|
|
51
59
|
module ClassMethods
|
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: 3.4.
|
4
|
+
version: 3.4.2
|
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: 2009-
|
12
|
+
date: 2009-11-03 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|