beet 0.6.4 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/VERSION +1 -1
  2. data/beet.gemspec +1 -1
  3. data/bin/beet +2 -2
  4. data/lib/beet/executor.rb +16 -4
  5. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.4
1
+ 0.6.5
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{beet}
8
- s.version = "0.6.4"
8
+ s.version = "0.6.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jack Dempsey"]
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="rails/authlogic, rails/clean_files, rails/git"
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=rails/authlogic,rails/clean_files,rails/git
110
+ beet -g example_app -r=rails3/auth/devise,rails3/clean_files,rails3/git
111
111
  }
112
112
  end
113
113
  end
@@ -56,11 +56,16 @@ module Beet
56
56
  system("rails new #{project_name}")
57
57
  end
58
58
  else
59
- puts "Generating rails project #{project_name}..."
60
- if @template
61
- system("rails #{project_name} -m #{TEMPLATE_LOCATIONS[@template]}")
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
- system("rails #{project_name}")
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
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 6
8
- - 4
9
- version: 0.6.4
8
+ - 5
9
+ version: 0.6.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jack Dempsey