flextures 1.9.12 → 1.9.13
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/VERSION +1 -1
- data/flextures.gemspec +2 -2
- data/lib/flextures/flextures_loader.rb +10 -8
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.9.
|
1
|
+
1.9.13
|
data/flextures.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "flextures"
|
8
|
-
s.version = "1.9.
|
8
|
+
s.version = "1.9.13"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["baban"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-06-20"
|
13
13
|
s.description = "load and dump fixtures"
|
14
14
|
s.email = "babanba.n@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -61,15 +61,15 @@ module Flextures
|
|
61
61
|
d.to_i
|
62
62
|
},
|
63
63
|
string:->(d){
|
64
|
-
return d
|
65
|
-
return d
|
66
|
-
return d
|
64
|
+
return d if d.nil?
|
65
|
+
return d if d.is_a?(Hash)
|
66
|
+
return d if d.is_a?(Array)
|
67
67
|
d.to_s
|
68
68
|
},
|
69
69
|
text:->(d){
|
70
|
-
return d
|
71
|
-
return d
|
72
|
-
return d
|
70
|
+
return d if d.nil?
|
71
|
+
return d if d.is_a?(Hash)
|
72
|
+
return d if d.is_a?(Array)
|
73
73
|
d.to_s
|
74
74
|
},
|
75
75
|
time:->(d){
|
@@ -143,7 +143,8 @@ module Flextures
|
|
143
143
|
klass = PARENT::create_model table_name
|
144
144
|
attributes = klass.columns.map &:name
|
145
145
|
filter = create_filter klass, Factory[table_name], file_name, :csv
|
146
|
-
|
146
|
+
# rails3_acts_as_paranoid がdelete_allで物理削除しないことの対策
|
147
|
+
klass.send( klass.respond_to?(:delete_all!) ? :delete_all! : :delete_all )
|
147
148
|
CSV.open( "#{file_name}.csv" ) do |csv|
|
148
149
|
keys = csv.shift # keyの設定
|
149
150
|
warning "CSV", attributes, keys
|
@@ -165,7 +166,8 @@ module Flextures
|
|
165
166
|
|
166
167
|
attributes, filter = ->{
|
167
168
|
klass = PARENT::create_model table_name
|
168
|
-
|
169
|
+
# rails3_acts_as_paranoid がdelete_allで物理削除しないことの対策
|
170
|
+
klass.send( klass.respond_to?(:delete_all!) ? :delete_all! : :delete_all )
|
169
171
|
attributes = klass.columns.map &:name
|
170
172
|
filter = create_filter klass, Factory[table_name], file_name, :yml
|
171
173
|
[attributes, filter]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flextures
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -90,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
90
90
|
version: '0'
|
91
91
|
segments:
|
92
92
|
- 0
|
93
|
-
hash: -
|
93
|
+
hash: -806754019
|
94
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
95
|
none: false
|
96
96
|
requirements:
|