kaplan 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/kaplan.rb +4 -6
- data/lib/kaplan/version.rb +1 -1
- metadata +4 -4
data/lib/kaplan.rb
CHANGED
@@ -48,7 +48,7 @@ module Kaplan
|
|
48
48
|
def current_environment
|
49
49
|
::Rails.env.to_s
|
50
50
|
end
|
51
|
-
|
51
|
+
|
52
52
|
def current_environment=(environment)
|
53
53
|
if ::Rails.version.split(".")[0] == "3"
|
54
54
|
::Rails.env = environment
|
@@ -70,7 +70,7 @@ module Kaplan
|
|
70
70
|
def current_environment
|
71
71
|
::Padrino.env.to_s
|
72
72
|
end
|
73
|
-
|
73
|
+
|
74
74
|
def current_environment=(environment)
|
75
75
|
silence_warnings do
|
76
76
|
::Padrino.instance_variable_set("@_env", nil)
|
@@ -103,7 +103,7 @@ module Kaplan
|
|
103
103
|
map {|path| Dir["#{project_root}/#{path}"] }.
|
104
104
|
flatten.
|
105
105
|
select {|file| File.file?(file) && file =~ /\.(yml|yaml|rb|txt|csv)/ }
|
106
|
-
|
106
|
+
|
107
107
|
if files.empty?
|
108
108
|
raise "Error in Kaplan.seeds: Couldn't find the seed files you specified."
|
109
109
|
end
|
@@ -131,9 +131,7 @@ module Kaplan
|
|
131
131
|
seeds.each do |filename, ext, collection_name, model|
|
132
132
|
if ext == "rb"
|
133
133
|
puts " - Adding data for #{collection_name}..." if level > 1
|
134
|
-
|
135
|
-
records = [records] if Hash === records
|
136
|
-
insert_rows(records, model)
|
134
|
+
load filename
|
137
135
|
elsif ext == "yml" || ext == "yaml"
|
138
136
|
data = ::YAML.load_file(filename)
|
139
137
|
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: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
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: 2011-
|
18
|
+
date: 2011-02-02 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|