rails_apps_composer 1.0.17 → 1.0.18

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile CHANGED
@@ -76,7 +76,7 @@ $ rails_apps_composer new APP_NAME -r jquery haml
76
76
  For example, to build the "rails3-mongoid-devise":http://github.com/RailsApps/rails3-mongoid-devise/ example application, run the command:
77
77
 
78
78
  <pre>
79
- $ rails_apps_composer new APP_NAME -r jquery haml rspec cucumber mongoid action_mailer devise add_user home_page home_page_users seed_database users_page css_setup application_layout devise_navigation cleanup ban_spiders git
79
+ $ rails_apps_composer new APP_NAME -r jquery haml rspec cucumber guard mongoid action_mailer devise add_user home_page home_page_users seed_database users_page css_setup application_layout navigation cleanup ban_spiders git
80
80
  </pre>
81
81
 
82
82
  Replace @APP_NAME@ with the name you want for your application.
@@ -124,7 +124,7 @@ h4. Template for Rails 3 + Devise + RSpec + Cucumber
124
124
  To build a reusable application template for the "rails3-devise-rspec-cucumber":http://github.com/RailsApps/rails3-devise-rspec-cucumber/ example application, run the command:
125
125
 
126
126
  <pre>
127
- $ rake print --silent RECIPES=jquery,haml,rspec,cucumber,action_mailer,devise,add_user,home_page,home_page_users,seed_database,users_page,css_setup,application_layout,html5,devise_navigation,cleanup,ban_spiders,extras,git > ~/Desktop/template.txt
127
+ $ rake print --silent RECIPES=jquery,haml,rspec,cucumber,guard,action_mailer,devise,add_user,home_page,home_page_users,seed_database,users_page,css_setup,application_layout,html5,navigation,cleanup,ban_spiders,extras,git > ~/Desktop/template.txt
128
128
  </pre>
129
129
 
130
130
  Then generate the application using the @-T@ flag. Add the @-J@ flag for Rails 3.0.
@@ -138,7 +138,7 @@ h4. Template for Rails 3 + Mongoid + Devise
138
138
  To build a reusable application template for the "rails3-mongoid-devise":http://github.com/RailsApps/rails3-mongoid-devise/ example application, run the command:
139
139
 
140
140
  <pre>
141
- $ rake print --silent RECIPES=jquery,haml,rspec,cucumber,mongoid,action_mailer,devise,add_user,home_page,home_page_users,seed_database,users_page,css_setup,application_layout,html5,devise_navigation,cleanup,ban_spiders,extras,git > ~/Desktop/template.txt
141
+ $ rake print --silent RECIPES=jquery,haml,rspec,cucumber,guard,mongoid,action_mailer,devise,add_user,home_page,home_page_users,seed_database,users_page,css_setup,application_layout,html5,navigation,cleanup,ban_spiders,extras,git > ~/Desktop/template.txt
142
142
  </pre>
143
143
 
144
144
  Then generate the application using the @-T -O@ flags. Add the @-J@ flag for Rails 3.0.
@@ -152,7 +152,7 @@ h4. Template for Rails 3 + Mongoid + OmniAuth
152
152
  To build a reusable application template for the "rails3-mongoid-omniauth":http://github.com/RailsApps/rails3-mongoid-omniauth/ example application, run the command:
153
153
 
154
154
  <pre>
155
- $ rake print --silent RECIPES=jquery,haml,rspec,cucumber,mongoid,seed_database,add_user,omniauth,home_page,home_page_users,css_setup,application_layout,html5,navigation,users_page,omniauth_email,cleanup,ban_spiders,extras,git > ~/Desktop/template.txt
155
+ $ rake print --silent RECIPES=jquery,haml,rspec,cucumber,guard,mongoid,seed_database,add_user,omniauth,home_page,home_page_users,css_setup,application_layout,html5,navigation,users_page,omniauth_email,cleanup,ban_spiders,extras,git > ~/Desktop/template.txt
156
156
  </pre>
157
157
 
158
158
  Then generate the application using the @-T -O@ flags. Add the @-J@ flag for Rails 3.0.
@@ -240,6 +240,8 @@ This project is based on "Michael Bleigh's RailsWizard gem":https://github.com/i
240
240
 
241
241
  RSpec, Cucumber, and Yard recipes were contributed by "Ramon Brooker":http://cogniton-mind.tumblr.com/.
242
242
 
243
+ Guard recipe contributed by "Ashley Woodard":https://github.com/ashley-woodard.
244
+
243
245
  Additional recipes by Daniel Kehoe, "http://danielkehoe.com/":http://danielkehoe.com/.
244
246
 
245
247
  Is the gem useful to you? Follow the project on Twitter:
data/recipes/cucumber.rb CHANGED
@@ -11,7 +11,7 @@ if config['cucumber']
11
11
  else
12
12
  # for Rails 3.1+, use optimistic versioning for gems
13
13
  gem 'cucumber-rails', '>= 1.0.2', :group => :test
14
- gem 'capybara', '>= 1.1.0', :group => :test
14
+ gem 'capybara', '>= 1.1.1', :group => :test
15
15
  gem 'database_cleaner', '>= 0.6.7', :group => :test
16
16
  gem 'launchy', '>= 2.0.5', :group => :test
17
17
  end
data/recipes/devise.rb CHANGED
@@ -7,7 +7,7 @@ if config['devise']
7
7
  gem 'devise', '1.3.4'
8
8
  else
9
9
  # for Rails 3.1+, use optimistic versioning for gems
10
- gem 'devise', '>= 1.4.4'
10
+ gem 'devise', '>= 1.4.5'
11
11
  end
12
12
  else
13
13
  recipes.delete('devise')
data/recipes/guard.rb ADDED
@@ -0,0 +1,79 @@
1
+ if config['guard']
2
+ gem 'guard', '>= 0.6.2', :group => :development
3
+
4
+ append_file 'Gemfile' do <<-RUBY
5
+ case HOST_OS
6
+ when /darwin/i
7
+ gem 'rb-fsevent', :group => :development
8
+ gem 'growl', :group => :development
9
+ when /linux/i
10
+ gem 'libnotify', :group => :development
11
+ gem 'rb-inotify', :group => :development
12
+ when /mswin|windows/i
13
+ gem 'rb-fchange', :group => :development
14
+ gem 'win32console', :group => :development
15
+ gem 'rb-notifu', :group => :development
16
+ end
17
+ RUBY
18
+ end
19
+
20
+ def guards
21
+ @guards ||= []
22
+ end
23
+
24
+ def guard(name, version = nil)
25
+ args = []
26
+ if version
27
+ args << version
28
+ end
29
+ args << { :group => :development }
30
+ gem "guard-#{name}", *args
31
+ guards << name
32
+ end
33
+
34
+ guard 'bundler', '>= 0.1.3'
35
+
36
+ unless recipes.include? 'pow'
37
+ guard 'rails', '>= 0.0.3'
38
+ end
39
+
40
+ if config['livereload']
41
+ guard 'livereload', '>= 0.3.0'
42
+ end
43
+
44
+ if recipes.include? 'rspec'
45
+ guard 'rspec', '>= 0.4.3'
46
+ end
47
+
48
+ if recipes.include? 'cucumber'
49
+ guard 'cucumber', '>= 0.6.1'
50
+ end
51
+
52
+ after_bundler do
53
+ run 'guard init'
54
+ guards.each do |name|
55
+ run "guard init #{name}"
56
+ end
57
+ end
58
+
59
+ else
60
+ recipes.delete 'guard'
61
+ end
62
+
63
+ __END__
64
+
65
+ name: guard
66
+ description: "Automate your workflow with Guard"
67
+ author: ashley_woodard
68
+
69
+ run_after: [rspec, cucumber]
70
+ category: other
71
+ tags: [dev]
72
+
73
+ config:
74
+ - guard:
75
+ type: boolean
76
+ prompt: Would you like to use Guard to automate your workflow?
77
+ - livereload:
78
+ type: boolean
79
+ prompt: Would you like to enable the LiveReload guard?
data/recipes/html5.rb CHANGED
@@ -51,14 +51,14 @@ RUBY
51
51
  = stylesheet_link_tag :application
52
52
  = javascript_include_tag :application
53
53
  = csrf_meta_tags
54
- %body{:class => params[:controller]}
55
- #container.container
56
- %header
57
- - flash.each do |name, msg|
58
- = content_tag :div, msg, :id => "flash_\#{name}" if msg.is_a?(String)
59
- #main{:role => "main"}
60
- = yield
61
- %footer
54
+ %body{:class => params[:controller]}
55
+ #container.container
56
+ %header
57
+ - flash.each do |name, msg|
58
+ = content_tag :div, msg, :id => "flash_\#{name}" if msg.is_a?(String)
59
+ #main{:role => "main"}
60
+ = yield
61
+ %footer
62
62
  HAML
63
63
  end
64
64
  else
@@ -4,12 +4,57 @@
4
4
  after_bundler do
5
5
 
6
6
  say_wizard "Navigation recipe running 'after bundler'"
7
+
8
+ if recipes.include? 'devise'
9
+ # Create navigation links for Devise
10
+ if recipes.include? 'haml'
11
+ # There is Haml code in this script. Changing the indentation is perilous between HAMLs.
12
+ # We have to use single-quote-style-heredoc to avoid interpolation.
13
+ create_file "app/views/shared/_navigation.html.haml" do <<-'HAML'
14
+ - if user_signed_in?
15
+ %li
16
+ = link_to('Logout', destroy_user_session_path, :method=>'delete')
17
+ - else
18
+ %li
19
+ = link_to('Login', new_user_session_path)
20
+ - if user_signed_in?
21
+ %li
22
+ = link_to('Edit account', edit_user_registration_path)
23
+ - else
24
+ %li
25
+ = link_to('Sign up', new_user_registration_path)
26
+ HAML
27
+ end
28
+ else
29
+ create_file "app/views/shared/_navigation.html.erb" do <<-ERB
30
+ <% if user_signed_in? %>
31
+ <li>
32
+ <%= link_to('Logout', destroy_user_session_path, :method=>'delete') %>
33
+ </li>
34
+ <% else %>
35
+ <li>
36
+ <%= link_to('Login', new_user_session_path) %>
37
+ </li>
38
+ <% end %>
39
+ <% if user_signed_in? %>
40
+ <li>
41
+ <%= link_to('Edit account', edit_user_registration_path) %>
42
+ </li>
43
+ <% else %>
44
+ <li>
45
+ <%= link_to('Sign up', new_user_registration_path) %>
46
+ </li>
47
+ <% end %>
48
+ ERB
49
+ end
50
+ end
7
51
 
8
- # Create navigation links
9
- if recipes.include? 'haml'
10
- # There is Haml code in this script. Changing the indentation is perilous between HAMLs.
11
- # We have to use single-quote-style-heredoc to avoid interpolation.
12
- create_file "app/views/shared/_navigation.html.haml" do <<-'HAML'
52
+ else
53
+ # Create navigation links
54
+ if recipes.include? 'haml'
55
+ # There is Haml code in this script. Changing the indentation is perilous between HAMLs.
56
+ # We have to use single-quote-style-heredoc to avoid interpolation.
57
+ create_file "app/views/shared/_navigation.html.haml" do <<-'HAML'
13
58
  - if user_signed_in?
14
59
  %li
15
60
  Logged in as #{current_user.name}
@@ -19,9 +64,9 @@ after_bundler do
19
64
  %li
20
65
  = link_to('Login', signin_path)
21
66
  HAML
22
- end
23
- else
24
- create_file "app/views/shared/_navigation.html.erb" do <<-ERB
67
+ end
68
+ else
69
+ create_file "app/views/shared/_navigation.html.erb" do <<-ERB
25
70
  <% if user_signed_in? %>
26
71
  <li>
27
72
  Logged in as <%= current_user.name %>
@@ -35,6 +80,7 @@ HAML
35
80
  </li>
36
81
  <% end %>
37
82
  ERB
83
+ end
38
84
  end
39
85
  end
40
86
 
data/recipes/omniauth.rb CHANGED
@@ -7,8 +7,7 @@ if config['omniauth']
7
7
  gem 'omniauth', '0.2.6'
8
8
  else
9
9
  # for Rails 3.1+, use optimistic versioning for gems
10
- # avoid gem compatibility issues for Cucumber and Launchy by using OmniAuth from GitHub
11
- gem 'omniauth', '>= 0.2.6', :git => "git://github.com/intridea/omniauth.git"
10
+ gem 'omniauth', '>= 0.3.0.rc3'
12
11
  end
13
12
  else
14
13
  recipes.delete('omniauth')
data/recipes/sass.rb CHANGED
@@ -1,4 +1,6 @@
1
- gem 'sass', '>= 3.1.6'
1
+ if recipes.include? 'rails 3.0'
2
+ gem 'sass', '>= 3.1.6'
3
+ end
2
4
 
3
5
  if config['sass']
4
6
  after_bundler do
data/templates/layout.erb CHANGED
@@ -49,17 +49,21 @@ say_wizard "Checking configuration. Please confirm your preferences."
49
49
 
50
50
  # >---------------------------[ Javascript Runtime ]-----------------------------<
51
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'
52
+ prepend_file 'Gemfile' do <<-RUBY
53
+ require 'rbconfig'
54
+ HOST_OS = Config::CONFIG['host_os']
55
+
56
+ RUBY
57
+ end
58
+
59
+ if recipes.include? 'rails 3.1'
60
+ append_file 'Gemfile' do <<-RUBY
61
+ # install a Javascript runtime for linux
62
+ if HOST_OS =~ /linux/i
63
+ gem 'therubyracer', '>= 0.8.2'
64
+ end
65
+
66
+ RUBY
63
67
  end
64
68
  end
65
69
 
@@ -89,5 +93,4 @@ say_wizard "Running 'after everything' callbacks."
89
93
 
90
94
  @current_recipe = nil
91
95
  say_wizard "Finished running the rails_apps_composer app template."
92
- say_wizard "Your new Rails app is ready. Any problems?"
93
- say_wizard "See http://github.com/RailsApps/rails_apps_composer/issues"
96
+ say_wizard "Your new Rails app is ready."
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RailsWizard
2
- VERSION = "1.0.17"
2
+ VERSION = "1.0.18"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_apps_composer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.17
4
+ version: 1.0.18
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-02 00:00:00.000000000Z
12
+ date: 2011-09-09 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: i18n
16
- requirement: &2153644120 !ruby/object:Gem::Requirement
16
+ requirement: &2160883780 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2153644120
24
+ version_requirements: *2160883780
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activesupport
27
- requirement: &2153643220 !ruby/object:Gem::Requirement
27
+ requirement: &2160882380 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 3.0.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2153643220
35
+ version_requirements: *2160882380
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: thor
38
- requirement: &2153642300 !ruby/object:Gem::Requirement
38
+ requirement: &2160881080 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2153642300
46
+ version_requirements: *2160881080
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &2153640700 !ruby/object:Gem::Requirement
49
+ requirement: &2160880340 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 2.5.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2153640700
57
+ version_requirements: *2160880340
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: mg
60
- requirement: &2153639480 !ruby/object:Gem::Requirement
60
+ requirement: &2160879680 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2153639480
68
+ version_requirements: *2160879680
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: activesupport
71
- requirement: &2153637980 !ruby/object:Gem::Requirement
71
+ requirement: &2160878680 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 3.0.0
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *2153637980
79
+ version_requirements: *2160878680
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: i18n
82
- requirement: &2153637280 !ruby/object:Gem::Requirement
82
+ requirement: &2160877840 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *2153637280
90
+ version_requirements: *2160877840
91
91
  description: A gem with recipes to create Rails application templates you can use
92
92
  to generate Rails starter apps.
93
93
  email:
@@ -116,10 +116,10 @@ files:
116
116
  - recipes/css_setup.rb
117
117
  - recipes/cucumber.rb
118
118
  - recipes/devise.rb
119
- - recipes/devise_navigation.rb
120
119
  - recipes/env_yaml.rb
121
120
  - recipes/extras.rb
122
121
  - recipes/git.rb
122
+ - recipes/guard.rb
123
123
  - recipes/haml.rb
124
124
  - recipes/heroku.rb
125
125
  - recipes/home_page.rb
@@ -178,7 +178,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
178
178
  version: '0'
179
179
  segments:
180
180
  - 0
181
- hash: -530635227312937095
181
+ hash: -4569890152970572076
182
182
  required_rubygems_version: !ruby/object:Gem::Requirement
183
183
  none: false
184
184
  requirements:
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  version: '0'
188
188
  segments:
189
189
  - 0
190
- hash: -530635227312937095
190
+ hash: -4569890152970572076
191
191
  requirements: []
192
192
  rubyforge_project: rails_apps_composer
193
193
  rubygems_version: 1.8.9
@@ -1,117 +0,0 @@
1
- # Application template recipe for the rails_apps_composer. Check for a newer version here:
2
- # https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/devise_navigation.rb
3
-
4
- after_bundler do
5
-
6
- say_wizard "DeviseNavigation recipe running 'after bundler'"
7
-
8
- # Create navigation links for Devise
9
- if recipes.include? 'haml'
10
- # There is Haml code in this script. Changing the indentation is perilous between HAMLs.
11
- # We have to use single-quote-style-heredoc to avoid interpolation.
12
- create_file "app/views/devise/menu/_login_items.html.haml" do <<-'HAML'
13
- - if user_signed_in?
14
- %li
15
- = link_to('Logout', destroy_user_session_path, :method=>'delete')
16
- - else
17
- %li
18
- = link_to('Login', new_user_session_path)
19
- HAML
20
- end
21
- else
22
- create_file "app/views/devise/menu/_login_items.html.erb" do <<-ERB
23
- <% if user_signed_in? %>
24
- <li>
25
- <%= link_to('Logout', destroy_user_session_path, :method=>'delete') %>
26
- </li>
27
- <% else %>
28
- <li>
29
- <%= link_to('Login', new_user_session_path) %>
30
- </li>
31
- <% end %>
32
- ERB
33
- end
34
- end
35
-
36
- if recipes.include? 'haml'
37
- # There is Haml code in this script. Changing the indentation is perilous between HAMLs.
38
- # We have to use single-quote-style-heredoc to avoid interpolation.
39
- create_file "app/views/devise/menu/_registration_items.html.haml" do <<-'HAML'
40
- - if user_signed_in?
41
- %li
42
- = link_to('Edit account', edit_user_registration_path)
43
- - else
44
- %li
45
- = link_to('Sign up', new_user_registration_path)
46
- HAML
47
- end
48
- else
49
- create_file "app/views/devise/menu/_registration_items.html.erb" do <<-ERB
50
- <% if user_signed_in? %>
51
- <li>
52
- <%= link_to('Edit account', edit_user_registration_path) %>
53
- </li>
54
- <% else %>
55
- <li>
56
- <%= link_to('Sign up', new_user_registration_path) %>
57
- </li>
58
- <% end %>
59
- ERB
60
- end
61
- end
62
-
63
- # Add navigation links to the default application layout
64
- if recipes.include? 'html5'
65
- if recipes.include? 'haml'
66
- # There is Haml code in this script. Changing the indentation is perilous between HAMLs.
67
- inject_into_file 'app/views/layouts/application.html.haml', :after => "%header\n" do <<-HAML
68
- %nav
69
- %ul
70
- = render 'devise/menu/registration_items'
71
- = render 'devise/menu/login_items'
72
- HAML
73
- end
74
- else
75
- inject_into_file 'app/views/layouts/application.html.erb', :after => "<header>\n" do
76
- <<-ERB
77
- <nav>
78
- <ul>
79
- <%= render 'devise/menu/registration_items' %>
80
- <%= render 'devise/menu/login_items' %>
81
- </ul>
82
- </nav>
83
- ERB
84
- end
85
- end
86
- else
87
- if recipes.include? 'haml'
88
- # There is Haml code in this script. Changing the indentation is perilous between HAMLs.
89
- inject_into_file 'app/views/layouts/application.html.haml', :after => "%body\n" do <<-HAML
90
- %ul.hmenu
91
- = render 'devise/menu/registration_items'
92
- = render 'devise/menu/login_items'
93
- HAML
94
- end
95
- else
96
- inject_into_file 'app/views/layouts/application.html.erb', :after => "<body>\n" do
97
- <<-ERB
98
- <ul class="hmenu">
99
- <%= render 'devise/menu/registration_items' %>
100
- <%= render 'devise/menu/login_items' %>
101
- </ul>
102
- ERB
103
- end
104
- end
105
- end
106
-
107
- end
108
-
109
- __END__
110
-
111
- name: DeviseNavigation
112
- description: "Add navigation links for Devise."
113
- author: RailsApps
114
-
115
- requires: [devise]
116
- category: other
117
- tags: [utilities, configuration]