kaplan 0.1.1 → 0.1.2
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/lib/kaplan.rb +4 -2
- data/lib/kaplan/version.rb +1 -1
- metadata +4 -4
data/lib/kaplan.rb
CHANGED
@@ -98,7 +98,7 @@ module Kaplan
|
|
98
98
|
end
|
99
99
|
|
100
100
|
def seeds(env)
|
101
|
-
(Dir["#{project_root}/seeds
|
101
|
+
(Dir["#{project_root}/seeds/*.{yml,rb,txt,csv}"] + Dir["#{project_root}/seeds/#{env}/*.{yml,rb,txt,csv}"]).
|
102
102
|
reject {|filename| File.directory?(filename) }.
|
103
103
|
map do |filename|
|
104
104
|
basename = ::File.basename(filename)
|
@@ -120,7 +120,9 @@ module Kaplan
|
|
120
120
|
seeds(options[:env]).each do |filename, ext, collection_name, model|
|
121
121
|
if ext == "rb"
|
122
122
|
puts " - Adding data for #{collection_name}..." if level > 1
|
123
|
-
|
123
|
+
records = eval(File.read(filename))
|
124
|
+
records = [records] if Hash === records
|
125
|
+
insert_rows(records, model)
|
124
126
|
elsif ext == "yml" || ext == "yaml"
|
125
127
|
data = ::YAML.load_file(filename)
|
126
128
|
records = (Hash === data) ? data[data.keys.first] : data
|
data/lib/kaplan/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kaplan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Elliot Winkler
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-01-17 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|