beet 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/beet.gemspec +1 -1
- data/bin/beet +2 -2
- data/lib/beet/executor.rb +16 -4
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.5
|
data/beet.gemspec
CHANGED
data/bin/beet
CHANGED
@@ -103,11 +103,11 @@ class BeetRunner < Thor
|
|
103
103
|
Beet is used to quickly generate applications.
|
104
104
|
|
105
105
|
Example:
|
106
|
-
beet generate example_app --recipes="
|
106
|
+
beet generate example_app --recipes="rails3/auth/devise, rails3/clean_files, rails3/git"
|
107
107
|
|
108
108
|
Same thing but shorter:
|
109
109
|
|
110
|
-
beet -g example_app -r=
|
110
|
+
beet -g example_app -r=rails3/auth/devise,rails3/clean_files,rails3/git
|
111
111
|
}
|
112
112
|
end
|
113
113
|
end
|
data/lib/beet/executor.rb
CHANGED
@@ -56,11 +56,16 @@ module Beet
|
|
56
56
|
system("rails new #{project_name}")
|
57
57
|
end
|
58
58
|
else
|
59
|
-
|
60
|
-
|
61
|
-
|
59
|
+
unless rails2_version = search_for_rails_2
|
60
|
+
puts "Please create a rails2 command which points to rails 2.x executable."
|
61
|
+
exit
|
62
62
|
else
|
63
|
-
|
63
|
+
puts "Generating rails project #{project_name}..."
|
64
|
+
if @template
|
65
|
+
system("rails _#{rails2_version}_ #{project_name} -m #{TEMPLATE_LOCATIONS[@template]}")
|
66
|
+
else
|
67
|
+
system("rails _#{rails2_version}_ #{project_name}")
|
68
|
+
end
|
64
69
|
end
|
65
70
|
end
|
66
71
|
end
|
@@ -204,6 +209,13 @@ module Beet
|
|
204
209
|
end
|
205
210
|
nil
|
206
211
|
end
|
212
|
+
|
213
|
+
def search_for_rails_2
|
214
|
+
rails_versions = `gem list rails`.chomp
|
215
|
+
clean_versions = rails_versions.match /\((.*)\)/
|
216
|
+
numbered_versions = clean_versions[1].split(', ')
|
217
|
+
numbered_versions.find {|v| v.split('.').first.to_i == 2}
|
218
|
+
end
|
207
219
|
end
|
208
220
|
end
|
209
221
|
|