rails_apps_composer 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/recipes/add_user.rb +2 -2
- data/recipes/add_user_name.rb +2 -2
- data/recipes/application_layout.rb +7 -6
- data/recipes/cleanup.rb +13 -4
- data/recipes/cucumber.rb +9 -9
- data/recipes/devise.rb +4 -4
- data/recipes/git.rb +4 -2
- data/recipes/haml.rb +1 -1
- data/recipes/jquery.rb +1 -1
- data/recipes/rspec.rb +1 -1
- data/recipes/seed_database.rb +2 -2
- data/templates/layout.erb +23 -0
- data/version.rb +1 -1
- metadata +5 -5
data/recipes/add_user.rb
CHANGED
@@ -67,8 +67,8 @@ ERB
|
|
67
67
|
|
68
68
|
# copy Haml versions of modified Devise views
|
69
69
|
inside 'app/views/devise/registrations' do
|
70
|
-
get 'https://github.com/RailsApps/rails3-application-templates/
|
71
|
-
get 'https://github.com/RailsApps/rails3-application-templates/
|
70
|
+
get 'https://raw.github.com/RailsApps/rails3-application-templates/master/files/rails3-mongoid-devise/app/views/devise/registrations/edit.html.haml', 'edit.html.haml'
|
71
|
+
get 'https://raw.github.com/RailsApps/rails3-application-templates/master/files/rails3-mongoid-devise/app/views/devise/registrations/new.html.haml', 'new.html.haml'
|
72
72
|
end
|
73
73
|
|
74
74
|
end
|
data/recipes/add_user_name.rb
CHANGED
@@ -53,8 +53,8 @@ ERB
|
|
53
53
|
|
54
54
|
# copy Haml versions of modified Devise views
|
55
55
|
inside 'app/views/devise/registrations' do
|
56
|
-
get 'https://github.com/RailsApps/rails3-application-templates/
|
57
|
-
get 'https://github.com/RailsApps/rails3-application-templates/
|
56
|
+
get 'https://raw.github.com/RailsApps/rails3-application-templates/master/files/rails3-mongoid-devise/app/views/devise/registrations/edit.html.haml', 'edit.html.haml'
|
57
|
+
get 'https://raw.github.com/RailsApps/rails3-application-templates/master/files/rails3-mongoid-devise/app/views/devise/registrations/new.html.haml', 'new.html.haml'
|
58
58
|
end
|
59
59
|
|
60
60
|
end
|
@@ -14,18 +14,19 @@ after_bundler do
|
|
14
14
|
%html
|
15
15
|
%head
|
16
16
|
%title #{app_name}
|
17
|
-
= stylesheet_link_tag :
|
18
|
-
= javascript_include_tag :
|
19
|
-
=
|
17
|
+
= stylesheet_link_tag :application
|
18
|
+
= javascript_include_tag :application
|
19
|
+
= csrf_meta_tags
|
20
20
|
%body
|
21
21
|
- flash.each do |name, msg|
|
22
22
|
= content_tag :div, msg, :id => "flash_\#{name}" if msg.is_a?(String)
|
23
23
|
= yield
|
24
24
|
HAML
|
25
25
|
end
|
26
|
-
if recipes.include? 'rails 3.
|
27
|
-
gsub_file 'app/views/layouts/application.html.haml', /stylesheet_link_tag :
|
28
|
-
gsub_file 'app/views/layouts/application.html.haml', /javascript_include_tag :
|
26
|
+
if recipes.include? 'rails 3.0'
|
27
|
+
gsub_file 'app/views/layouts/application.html.haml', /stylesheet_link_tag :application/, 'stylesheet_link_tag :all'
|
28
|
+
gsub_file 'app/views/layouts/application.html.haml', /javascript_include_tag :application/, 'javascript_include_tag :defaults'
|
29
|
+
gsub_file 'app/views/layouts/application.html.haml', /csrf_meta_tags/, 'csrf_meta_tag'
|
29
30
|
end
|
30
31
|
else
|
31
32
|
inject_into_file 'app/views/layouts/application.html.erb', :after => "<body>\n" do
|
data/recipes/cleanup.rb
CHANGED
@@ -10,12 +10,21 @@ after_bundler do
|
|
10
10
|
README
|
11
11
|
doc/README_FOR_APP
|
12
12
|
public/index.html
|
13
|
-
public/images/rails.png
|
14
13
|
}.each { |file| remove_file file }
|
15
|
-
|
14
|
+
|
15
|
+
if recipes.include? 'rails 3.0'
|
16
|
+
%w{
|
17
|
+
public/images/rails.png
|
18
|
+
}.each { |file| remove_file file }
|
19
|
+
else
|
20
|
+
%w{
|
21
|
+
app/assets/images/rails.png
|
22
|
+
}.each { |file| remove_file file }
|
23
|
+
end
|
24
|
+
|
16
25
|
# add placeholder READMEs
|
17
|
-
get "https://github.com/RailsApps/rails3-application-templates/
|
18
|
-
get "https://github.com/RailsApps/rails3-application-templates/
|
26
|
+
get "https://raw.github.com/RailsApps/rails3-application-templates/master/files/sample_readme.txt", "README"
|
27
|
+
get "https://raw.github.com/RailsApps/rails3-application-templates/master/files/sample_readme.textile", "README.textile"
|
19
28
|
gsub_file "README", /App_Name/, "#{app_name.humanize.titleize}"
|
20
29
|
gsub_file "README.textile", /App_Name/, "#{app_name.humanize.titleize}"
|
21
30
|
|
data/recipes/cucumber.rb
CHANGED
@@ -10,8 +10,8 @@ if config['cucumber']
|
|
10
10
|
gem 'launchy', '0.4.0', :group => :test
|
11
11
|
else
|
12
12
|
# for Rails 3.1+, use optimistic versioning for gems
|
13
|
-
gem 'cucumber-rails', '>= 0.5.
|
14
|
-
gem 'capybara', '>= 1.0.0.
|
13
|
+
gem 'cucumber-rails', '>= 0.5.2', :group => :test
|
14
|
+
gem 'capybara', '>= 1.0.0.rc1', :group => :test
|
15
15
|
gem 'database_cleaner', '>= 0.6.7', :group => :test
|
16
16
|
gem 'launchy', '>= 0.4.0', :group => :test
|
17
17
|
end
|
@@ -38,14 +38,14 @@ if config['cucumber']
|
|
38
38
|
say_wizard "Copying Cucumber scenarios from the rails3-devise-rspec-cucumber examples"
|
39
39
|
begin
|
40
40
|
# copy all the Cucumber scenario files from the rails3-devise-rspec-cucumber example app
|
41
|
-
get 'https://github.com/RailsApps/rails3-devise-rspec-cucumber/
|
42
|
-
get 'https://github.com/RailsApps/rails3-devise-rspec-cucumber/
|
43
|
-
get 'https://github.com/RailsApps/rails3-devise-rspec-cucumber/
|
44
|
-
get 'https://github.com/RailsApps/rails3-devise-rspec-cucumber/
|
45
|
-
get 'https://github.com/RailsApps/rails3-devise-rspec-cucumber/
|
46
|
-
get 'https://github.com/RailsApps/rails3-devise-rspec-cucumber/
|
41
|
+
get 'https://raw.github.com/RailsApps/rails3-devise-rspec-cucumber/master/features/users/sign_in.feature', 'features/users/sign_in.feature'
|
42
|
+
get 'https://raw.github.com/RailsApps/rails3-devise-rspec-cucumber/master/features/users/sign_out.feature', 'features/users/sign_out.feature'
|
43
|
+
get 'https://raw.github.com/RailsApps/rails3-devise-rspec-cucumber/master/features/users/sign_up.feature', 'features/users/sign_up.feature'
|
44
|
+
get 'https://raw.github.com/RailsApps/rails3-devise-rspec-cucumber/master/features/users/user_edit.feature', 'features/users/user_edit.feature'
|
45
|
+
get 'https://raw.github.com/RailsApps/rails3-devise-rspec-cucumber/master/features/users/user_show.feature', 'features/users/user_show.feature'
|
46
|
+
get 'https://raw.github.com/RailsApps/rails3-devise-rspec-cucumber/master/features/step_definitions/user_steps.rb', 'features/step_definitions/user_steps.rb'
|
47
47
|
remove_file 'features/support/paths.rb'
|
48
|
-
get 'https://github.com/RailsApps/rails3-devise-rspec-cucumber/
|
48
|
+
get 'https://raw.github.com/RailsApps/rails3-devise-rspec-cucumber/master/features/support/paths.rb', 'features/support/paths.rb'
|
49
49
|
rescue OpenURI::HTTPError
|
50
50
|
say_wizard "Unable to obtain Cucumber example files from the repo"
|
51
51
|
end
|
data/recipes/devise.rb
CHANGED
@@ -44,13 +44,13 @@ if config['devise']
|
|
44
44
|
say_wizard "Copying RSpec files from the rails3-devise-rspec-cucumber examples"
|
45
45
|
begin
|
46
46
|
# copy all the RSpec specs files from the rails3-devise-rspec-cucumber example app
|
47
|
-
get 'https://github.com/RailsApps/rails3-devise-rspec-cucumber/
|
47
|
+
get 'https://raw.github.com/RailsApps/rails3-devise-rspec-cucumber/master/spec/factories.rb', 'spec/factories.rb'
|
48
48
|
remove_file 'spec/controllers/home_controller_spec.rb'
|
49
49
|
remove_file 'spec/controllers/users_controller_spec.rb'
|
50
|
-
get 'https://github.com/RailsApps/rails3-devise-rspec-cucumber/
|
51
|
-
get 'https://github.com/RailsApps/rails3-devise-rspec-cucumber/
|
50
|
+
get 'https://raw.github.com/RailsApps/rails3-devise-rspec-cucumber/master/spec/controllers/home_controller_spec.rb', 'spec/controllers/home_controller_spec.rb'
|
51
|
+
get 'https://raw.github.com/RailsApps/rails3-devise-rspec-cucumber/master/spec/controllers/users_controller_spec.rb', 'spec/controllers/users_controller_spec.rb'
|
52
52
|
remove_file 'spec/models/user_spec.rb'
|
53
|
-
get 'https://github.com/RailsApps/rails3-devise-rspec-cucumber/
|
53
|
+
get 'https://raw.github.com/RailsApps/rails3-devise-rspec-cucumber/master/spec/models/user_spec.rb', 'spec/models/user_spec.rb'
|
54
54
|
rescue OpenURI::HTTPError
|
55
55
|
say_wizard "Unable to obtain RSpec example files from the repo"
|
56
56
|
end
|
data/recipes/git.rb
CHANGED
@@ -7,10 +7,11 @@ after_everything do
|
|
7
7
|
|
8
8
|
# Git should ignore some files
|
9
9
|
remove_file '.gitignore'
|
10
|
-
get "https://github.com/RailsApps/rails3-application-templates/
|
10
|
+
get "https://raw.github.com/RailsApps/rails3-application-templates/master/files/gitignore.txt", ".gitignore"
|
11
11
|
|
12
12
|
if recipes.include? 'omniauth'
|
13
13
|
append_file '.gitignore' do <<-TXT
|
14
|
+
|
14
15
|
# keep OmniAuth service provider secrets out of the Git repo
|
15
16
|
config/initializers/omniauth.rb
|
16
17
|
TXT
|
@@ -20,11 +21,12 @@ TXT
|
|
20
21
|
# Initialize new Git repo
|
21
22
|
git :init
|
22
23
|
git :add => '.'
|
23
|
-
git :commit => "-aqm 'new Rails app generated by
|
24
|
+
git :commit => "-aqm 'new Rails app generated by Rails Apps Composer gem'"
|
24
25
|
# Create a git branch
|
25
26
|
git :checkout => ' -b working_branch'
|
26
27
|
git :add => '.'
|
27
28
|
git :commit => "-m 'Initial commit of working_branch'"
|
29
|
+
git :checkout => 'master'
|
28
30
|
end
|
29
31
|
|
30
32
|
__END__
|
data/recipes/haml.rb
CHANGED
data/recipes/jquery.rb
CHANGED
@@ -15,7 +15,7 @@ if config['jquery']
|
|
15
15
|
remove_file 'public/javascripts/prototype.js'
|
16
16
|
# add jQuery files
|
17
17
|
inside "public/javascripts" do
|
18
|
-
get "https://github.com/rails/jquery-ujs/
|
18
|
+
get "https://raw.github.com/rails/jquery-ujs/master/src/rails.js", "rails.js"
|
19
19
|
get "http://code.jquery.com/jquery-1.6.min.js", "jquery.js"
|
20
20
|
if config['ui']
|
21
21
|
get "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js", "jqueryui.js"
|
data/recipes/rspec.rb
CHANGED
@@ -24,7 +24,7 @@ if config['rspec']
|
|
24
24
|
# use the database_cleaner gem to reset the test database
|
25
25
|
gem 'database_cleaner', '>= 0.6.7', :group => :test
|
26
26
|
# include RSpec matchers from the mongoid-rspec gem
|
27
|
-
gem 'mongoid-rspec', '>= 1.4.
|
27
|
+
gem 'mongoid-rspec', '>= 1.4.4', :group => :test
|
28
28
|
end
|
29
29
|
if config['factory_girl']
|
30
30
|
# use the factory_girl gem for test fixtures
|
data/recipes/seed_database.rb
CHANGED
@@ -7,7 +7,7 @@ after_bundler do
|
|
7
7
|
say_wizard "SeedDatabase recipe running 'after bundler'"
|
8
8
|
|
9
9
|
unless recipes.include? 'mongoid'
|
10
|
-
run 'rake db:migrate'
|
10
|
+
run 'bundle exec rake db:migrate'
|
11
11
|
end
|
12
12
|
|
13
13
|
if recipes.include? 'mongoid'
|
@@ -28,7 +28,7 @@ FILE
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
run 'rake db:seed'
|
31
|
+
run 'bundle exec rake db:seed'
|
32
32
|
|
33
33
|
end
|
34
34
|
|
data/templates/layout.erb
CHANGED
@@ -40,8 +40,31 @@ else
|
|
40
40
|
say_wizard "You are using Rails version #{Rails::VERSION::STRING} which is not supported."
|
41
41
|
end
|
42
42
|
|
43
|
+
# show which version of rake is running
|
44
|
+
# with the added benefit of ensuring that the Gemfile's version of rake is activated
|
45
|
+
gemfile_rake_ver = run 'bundle exec rake --version', :capture => true, :verbose => false
|
46
|
+
say_wizard "You are using #{gemfile_rake_ver.strip}"
|
47
|
+
|
43
48
|
say_wizard "Checking configuration. Please confirm your preferences."
|
44
49
|
|
50
|
+
# >---------------------------[ Javascript Runtime ]-----------------------------<
|
51
|
+
|
52
|
+
@current_recipe = "linux"
|
53
|
+
config = {}
|
54
|
+
config['linux'] = yes_wizard?("Are using a Linux OS such as Ubuntu?") if true && true unless config.key?('linux')
|
55
|
+
@configs[@current_recipe] = config
|
56
|
+
|
57
|
+
if config['linux']
|
58
|
+
if recipes.include? 'rails 3.0'
|
59
|
+
# nothing needed
|
60
|
+
else
|
61
|
+
# for Rails 3.1+, install a gem for a Javascript runtime
|
62
|
+
gem 'therubyracer', '>= 0.8.2'
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# >---------------------------------[ Recipes ]----------------------------------<
|
67
|
+
|
45
68
|
<% resolve_recipes.each do |recipe| %>
|
46
69
|
<%= render 'recipe', recipe.get_binding %>
|
47
70
|
<% end %>
|
data/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rails_apps_composer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.0.
|
5
|
+
version: 1.0.6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Daniel Kehoe
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-06-09 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: i18n
|
@@ -175,7 +175,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
175
175
|
requirements:
|
176
176
|
- - ">="
|
177
177
|
- !ruby/object:Gem::Version
|
178
|
-
hash:
|
178
|
+
hash: 1634060641105125699
|
179
179
|
segments:
|
180
180
|
- 0
|
181
181
|
version: "0"
|
@@ -184,14 +184,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
184
|
requirements:
|
185
185
|
- - ">="
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
hash:
|
187
|
+
hash: 1634060641105125699
|
188
188
|
segments:
|
189
189
|
- 0
|
190
190
|
version: "0"
|
191
191
|
requirements: []
|
192
192
|
|
193
193
|
rubyforge_project: rails_apps_composer
|
194
|
-
rubygems_version: 1.8.
|
194
|
+
rubygems_version: 1.8.5
|
195
195
|
signing_key:
|
196
196
|
specification_version: 3
|
197
197
|
summary: A version of the RailsWizard gem with custom recipes for Rails starter apps.
|