rails_apps_composer 3.0.9 → 3.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/recipes/analytics.rb +41 -0
- data/recipes/core.rb +1 -1
- data/recipes/deployment.rb +1 -1
- data/recipes/extras.rb +0 -1
- data/recipes/locale.rb +3 -0
- data/recipes/railsapps.rb +1 -1
- data/recipes/readme.rb +138 -62
- data/templates/helpers.erb +7 -3
- data/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa6c2251b9229fa1ce91203a50f3b8fdf3841adf
|
4
|
+
data.tar.gz: 16401b7cc7a17a7f677e103883d463db03e8e9b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6d0e5446cf806906a9d4fb23f02f02d4337756ec07e678470c2932a5897de92ff8f64c5fcaa0844616b9aadeffdda1c8466869c528b692b3bf4290716aadf5f
|
7
|
+
data.tar.gz: 2d912ebb738336d575b5917d00828eff559cec7bc8a420fc192ec4f68f546e0c157b0d45c9976c48e3c1d482e84ed9c5b7aeb5f6e922a35b74b713605c6ebaba
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# Application template recipe for the rails_apps_composer. Change the recipe here:
|
2
|
+
# https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/analytics.rb
|
3
|
+
|
4
|
+
prefs[:analytics] = multiple_choice "Install page-view analytics?", [["None", "none"],
|
5
|
+
["Google Analytics", "ga"],
|
6
|
+
["Segment.io", "segmentio"]] unless prefs.has_key? :analytics
|
7
|
+
case prefs[:analytics]
|
8
|
+
when 'ga'
|
9
|
+
ga_id = ask_wizard('Google Analytics ID?')
|
10
|
+
when 'segmentio'
|
11
|
+
segmentio_api_key = ask_wizard('Segment.io API key?')
|
12
|
+
end
|
13
|
+
|
14
|
+
stage_two do
|
15
|
+
say_wizard "recipe stage two"
|
16
|
+
unless prefer :analytics, 'none'
|
17
|
+
# don't add the gem if it has already been added by the railsapps recipe
|
18
|
+
add_gem 'rails_apps_pages', :group => :development unless prefs[:apps4]
|
19
|
+
end
|
20
|
+
case prefs[:analytics]
|
21
|
+
when 'ga'
|
22
|
+
generate 'analytics:google -f'
|
23
|
+
gsub_file 'app/assets/javascripts/google_analytics.js.coffee', /UA-XXXXXXX-XX/, ga_id
|
24
|
+
when 'segmentio'
|
25
|
+
generate 'analytics:segmentio -f'
|
26
|
+
gsub_file 'app/assets/javascripts/segmentio.js', /SEGMENTIO_API_KEY/, segmentio_api_key
|
27
|
+
end
|
28
|
+
### GIT ###
|
29
|
+
git :add => '-A' if prefer :git, true
|
30
|
+
git :commit => '-qm "rails_apps_composer: add analytics"' if prefer :git, true
|
31
|
+
end
|
32
|
+
|
33
|
+
__END__
|
34
|
+
|
35
|
+
name: analytics
|
36
|
+
description: "Add JavaScript files for Segment.io or Google Analytics"
|
37
|
+
author: RailsApps
|
38
|
+
|
39
|
+
requires: [setup, gems]
|
40
|
+
run_after: [setup, gems, init]
|
41
|
+
category: other
|
data/recipes/core.rb
CHANGED
data/recipes/deployment.rb
CHANGED
data/recipes/extras.rb
CHANGED
data/recipes/locale.rb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
# Application template recipe for the rails_apps_composer. Change the recipe here:
|
2
|
+
# https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/locale.rb
|
3
|
+
|
1
4
|
unless prefs[:locale]
|
2
5
|
prefs[:locale] = ask_wizard('Set a locale? Enter nothing for English, or es, de, etc:')
|
3
6
|
prefs[:locale] = 'none' unless prefs[:locale].present?
|
data/recipes/railsapps.rb
CHANGED
@@ -23,7 +23,7 @@ when "4"
|
|
23
23
|
["Custom application (experimental)", "none"]] unless prefs.has_key? :apps4
|
24
24
|
case prefs[:apps4]
|
25
25
|
when 'railsapps'
|
26
|
-
prefs[:apps4] = prefs[:rails_4_1_starter_app] || (multiple_choice "
|
26
|
+
prefs[:apps4] = prefs[:rails_4_1_starter_app] || (multiple_choice "Choose a starter application.",
|
27
27
|
[["learn-rails", "learn-rails"],
|
28
28
|
["rails-bootstrap", "rails-bootstrap"],
|
29
29
|
["rails-foundation", "rails-foundation"],
|
data/recipes/readme.rb
CHANGED
@@ -11,71 +11,147 @@ stage_three do
|
|
11
11
|
doc/README_FOR_APP
|
12
12
|
}.each { |file| remove_file file }
|
13
13
|
|
14
|
-
# add
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
print_preferences = prefs.map { |k, v| "\n* #{k}: #{v}" }.join('')
|
26
|
-
gsub_file "README.md", /RECIPES/, print_recipes
|
27
|
-
gsub_file "README.md", /PREFERENCES/, print_preferences
|
28
|
-
gsub_file "README", /RECIPES/, print_recipes
|
29
|
-
gsub_file "README", /PREFERENCES/, print_preferences
|
30
|
-
|
31
|
-
# Ruby on Rails
|
32
|
-
gsub_file "README.md", /\* Ruby/, "* Ruby version #{RUBY_VERSION}"
|
33
|
-
gsub_file "README.md", /\* Rails/, "* Rails version #{Rails::VERSION::STRING}"
|
34
|
-
|
35
|
-
# Database
|
36
|
-
gsub_file "README.md", /SQLite/, "PostgreSQL" if prefer :database, 'postgresql'
|
37
|
-
gsub_file "README.md", /SQLite/, "MySQL" if prefer :database, 'mysql'
|
38
|
-
gsub_file "README.md", /SQLite/, "MongoDB" if prefer :database, 'mongodb'
|
39
|
-
gsub_file "README.md", /ActiveRecord/, "the Mongoid ORM" if prefer :orm, 'mongoid'
|
40
|
-
|
41
|
-
# Template Engine
|
42
|
-
gsub_file "README.md", /ERB/, "Haml" if prefer :templates, 'haml'
|
43
|
-
gsub_file "README.md", /ERB/, "Slim" if prefer :templates, 'slim'
|
44
|
-
|
45
|
-
# Testing Framework
|
46
|
-
gsub_file "README.md", /Test::Unit/, "RSpec" if prefer :tests, 'rspec'
|
47
|
-
|
48
|
-
# Front-end Framework
|
49
|
-
gsub_file "README.md", /Front-end Framework: None/, "Front-end Framework: Bootstrap 2.3 (Sass)" if prefer :frontend, 'bootstrap2'
|
50
|
-
gsub_file "README.md", /Front-end Framework: None/, "Front-end Framework: Bootstrap 3.0 (Sass)" if prefer :frontend, 'bootstrap3'
|
51
|
-
gsub_file "README.md", /Front-end Framework: None/, "Front-end Framework: Zurb Foundation 4" if prefer :frontend, 'foundation4'
|
52
|
-
gsub_file "README.md", /Front-end Framework: None/, "Front-end Framework: Zurb Foundation 5" if prefer :frontend, 'foundation5'
|
53
|
-
|
54
|
-
# Form Builder
|
55
|
-
gsub_file "README.md", /Form Builder: None/, "Form Builder: SimpleForm" if prefer :form_builder, 'simple_form'
|
56
|
-
|
57
|
-
# Email
|
58
|
-
unless prefer :email, 'none'
|
59
|
-
gsub_file "README.md", /Gmail/, "SMTP" if prefer :email, 'smtp'
|
60
|
-
gsub_file "README.md", /Gmail/, "SendGrid" if prefer :email, 'sendgrid'
|
61
|
-
gsub_file "README.md", /Gmail/, "Mandrill" if prefer :email, 'mandrill'
|
62
|
-
gsub_file "README.md", /Email delivery is disabled in development./, "Email delivery is configured via MailCatcher in development." if prefer :mailcatcher, true
|
63
|
-
insert_into_file 'README.md', "\nEmail rendering in development enabled via MailView.", :after => /Email delivery is.*\n/ if prefer :mail_view, true
|
64
|
-
else
|
65
|
-
gsub_file "README.md", /Email/, ""
|
66
|
-
gsub_file "README.md", /-----/, ""
|
67
|
-
gsub_file "README.md", /The application is configured to send email using a Gmail account./, ""
|
68
|
-
gsub_file "README.md", /Email delivery is disabled in development./, ""
|
14
|
+
# add diagnostics to README
|
15
|
+
create_file 'README', "#{app_name.humanize.titleize}\n================\n\n"
|
16
|
+
append_to_file 'README' do <<-TEXT
|
17
|
+
Rails Composer, open source, supported by subscribers.
|
18
|
+
Please join RailsApps to support development of Rails Composer.
|
19
|
+
Need help? Ask on Stack Overflow with the tag 'railsapps.'
|
20
|
+
Problems? Submit an issue: https://github.com/RailsApps/rails_apps_composer/issues
|
21
|
+
Your application contains diagnostics in this README file.
|
22
|
+
Please provide a copy of this README file when reporting any issues.
|
23
|
+
\n
|
24
|
+
TEXT
|
69
25
|
end
|
26
|
+
append_to_file 'README' do <<-TEXT
|
27
|
+
option Build a starter application?
|
28
|
+
choose Enter your selection: [#{prefs[:apps4]}]
|
29
|
+
option Get on the mailing list for Rails Composer news?
|
30
|
+
choose Enter your selection: [#{prefs[:announcements]}]
|
31
|
+
option Web server for development?
|
32
|
+
choose Enter your selection: [#{prefs[:dev_webserver]}]
|
33
|
+
option Web server for production?
|
34
|
+
choose Enter your selection: [#{prefs[:prod_webserver]}]
|
35
|
+
option Database used in development?
|
36
|
+
choose Enter your selection: [#{prefs[:database]}]
|
37
|
+
option Template engine?
|
38
|
+
choose Enter your selection: [#{prefs[:templates]}]
|
39
|
+
option Test framework?
|
40
|
+
choose Enter your selection: [#{prefs[:tests]}]
|
41
|
+
option Continuous testing?
|
42
|
+
choose Enter your selection: [#{prefs[:continuous_testing]}]
|
43
|
+
option Front-end framework?
|
44
|
+
choose Enter your selection: [#{prefs[:frontend]}]
|
45
|
+
option Add support for sending email?
|
46
|
+
choose Enter your selection: [#{prefs[:email]}]
|
47
|
+
option Authentication?
|
48
|
+
choose Enter your selection: [#{prefs[:authentication]}]
|
49
|
+
option Devise modules?
|
50
|
+
choose Enter your selection: [#{prefs[:devise_modules]}]
|
51
|
+
option OmniAuth provider?
|
52
|
+
choose Enter your selection: [#{prefs[:omniauth_provider]}]
|
53
|
+
option Authorization?
|
54
|
+
choose Enter your selection: [#{prefs[:authorization]}]
|
55
|
+
option Use a form builder gem?
|
56
|
+
choose Enter your selection: [#{prefs[:form_builder]}]
|
57
|
+
option Add pages?
|
58
|
+
choose Enter your selection: [#{prefs[:pages]}]
|
59
|
+
option Set a locale?
|
60
|
+
choose Enter your selection: [#{prefs[:locale]}]
|
61
|
+
option Install page-view analytics?
|
62
|
+
choose Enter your selection: [#{prefs[:analytics]}]
|
63
|
+
option Add a deployment mechanism?
|
64
|
+
choose Enter your selection: [#{prefs[:deployment]}]
|
65
|
+
option Set a robots.txt file to ban spiders?
|
66
|
+
choose Enter your selection: [#{prefs[:ban_spiders]}]
|
67
|
+
option Create a GitHub repository? (y/n)
|
68
|
+
choose Enter your selection: [#{prefs[:github]}]
|
69
|
+
option Add gem and file for environment variables?
|
70
|
+
choose Enter your selection: [#{prefs[:local_env_file]}]
|
71
|
+
option Reduce assets logger noise during development?
|
72
|
+
choose Enter your selection: [#{prefs[:quiet_assets]}]
|
73
|
+
option Improve error reporting with 'better_errors' during development?
|
74
|
+
choose Enter your selection: [#{prefs[:better_errors]}]
|
75
|
+
option Use 'pry' as console replacement during development and test?
|
76
|
+
choose Enter your selection: [#{prefs[:pry]}]
|
77
|
+
option Use or create a project-specific rvm gemset?
|
78
|
+
choose Enter your selection: [#{prefs[:rvmrc]}]
|
79
|
+
TEXT
|
80
|
+
end
|
81
|
+
|
82
|
+
create_file 'public/humans.txt' do <<-TEXT
|
83
|
+
/* the humans responsible & colophon */
|
84
|
+
/* humanstxt.org */
|
85
|
+
|
86
|
+
|
87
|
+
/* TEAM */
|
88
|
+
<your title>: <your name>
|
89
|
+
Site:
|
90
|
+
Twitter:
|
91
|
+
Location:
|
92
|
+
|
93
|
+
/* THANKS */
|
94
|
+
Daniel Kehoe (@rails_apps) for the RailsApps project
|
95
|
+
|
96
|
+
/* SITE */
|
97
|
+
Standards: HTML5, CSS3
|
98
|
+
Components: jQuery
|
99
|
+
Software: Ruby on Rails
|
100
|
+
|
101
|
+
/* GENERATED BY */
|
102
|
+
Rails Composer: http://railscomposer.com/
|
103
|
+
TEXT
|
104
|
+
end
|
105
|
+
|
106
|
+
create_file 'README.md', "#{app_name.humanize.titleize}\n================\n\n"
|
107
|
+
append_to_file 'README.md' do <<-TEXT
|
108
|
+
This application was generated with the [rails_apps_composer](https://github.com/RailsApps/rails_apps_composer) gem
|
109
|
+
provided by the [RailsApps Project](http://railsapps.github.io/).
|
110
|
+
|
111
|
+
Rails Composer is open source and supported by subscribers. Please join RailsApps to support development of Rails Composer.
|
112
|
+
|
113
|
+
Problems? Issues?
|
114
|
+
-----------
|
115
|
+
|
116
|
+
Need help? Ask on Stack Overflow with the tag 'railsapps.'
|
70
117
|
|
71
|
-
|
72
|
-
gsub_file "README.md", /Authentication: None/, "Authentication: Devise" if prefer :authentication, 'devise'
|
73
|
-
gsub_file "README.md", /Authentication: None/, "Authentication: OmniAuth" if prefer :authentication, 'omniauth'
|
74
|
-
gsub_file "README.md", /Authorization: None/, "Authorization: Pundit" if prefer :authorization, 'pundit'
|
118
|
+
Your application contains diagnostics in the README file. Please provide a copy of the README file when reporting any issues.
|
75
119
|
|
76
|
-
|
77
|
-
|
78
|
-
|
120
|
+
If the application doesn’t work as expected, please [report an issue](https://github.com/RailsApps/rails_apps_composer/issues)
|
121
|
+
and include the diagnostics.
|
122
|
+
|
123
|
+
Ruby on Rails
|
124
|
+
-------------
|
125
|
+
|
126
|
+
This application requires:
|
127
|
+
|
128
|
+
- Ruby #{RUBY_VERSION}
|
129
|
+
- Rails #{Rails::VERSION::STRING}
|
130
|
+
|
131
|
+
Learn more about [Installing Rails](http://railsapps.github.io/installing-rails.html).
|
132
|
+
|
133
|
+
Getting Started
|
134
|
+
---------------
|
135
|
+
|
136
|
+
Documentation and Support
|
137
|
+
-------------------------
|
138
|
+
|
139
|
+
Issues
|
140
|
+
-------------
|
141
|
+
|
142
|
+
Similar Projects
|
143
|
+
----------------
|
144
|
+
|
145
|
+
Contributing
|
146
|
+
------------
|
147
|
+
|
148
|
+
Credits
|
149
|
+
-------
|
150
|
+
|
151
|
+
License
|
152
|
+
-------
|
153
|
+
TEXT
|
154
|
+
end
|
79
155
|
|
80
156
|
git :add => '-A' if prefer :git, true
|
81
157
|
git :commit => '-qm "rails_apps_composer: add README files"' if prefer :git, true
|
data/templates/helpers.erb
CHANGED
@@ -12,7 +12,11 @@ def say_recipe(name); say "\033[1m\033[36m" + "recipe".rjust(10) + "\033[0m" + "
|
|
12
12
|
def say_wizard(text); say_custom(@current_recipe || 'composer', text) end
|
13
13
|
|
14
14
|
def ask_wizard(question)
|
15
|
-
ask "\033[1m\033[36m" + (
|
15
|
+
ask "\033[1m\033[36m" + ("option").rjust(10) + "\033[1m\033[36m" + " #{question}\033[0m"
|
16
|
+
end
|
17
|
+
|
18
|
+
def whisper_ask_wizard(question)
|
19
|
+
ask "\033[1m\033[36m" + ("choose").rjust(10) + "\033[0m" + " #{question}"
|
16
20
|
end
|
17
21
|
|
18
22
|
def yes_wizard?(question)
|
@@ -30,13 +34,13 @@ end
|
|
30
34
|
def no_wizard?(question); !yes_wizard?(question) end
|
31
35
|
|
32
36
|
def multiple_choice(question, choices)
|
33
|
-
say_custom('
|
37
|
+
say_custom('option', "\033[1m\033[36m" + "#{question}\033[0m")
|
34
38
|
values = {}
|
35
39
|
choices.each_with_index do |choice,i|
|
36
40
|
values[(i + 1).to_s] = choice[1]
|
37
41
|
say_custom( (i + 1).to_s + ')', choice[0] )
|
38
42
|
end
|
39
|
-
answer =
|
43
|
+
answer = whisper_ask_wizard("Enter your selection:") while !values.keys.include?(answer)
|
40
44
|
values[answer]
|
41
45
|
end
|
42
46
|
|
data/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_apps_composer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Kehoe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -119,6 +119,7 @@ files:
|
|
119
119
|
- lib/rails_wizard/recipes.rb
|
120
120
|
- lib/rails_wizard/template.rb
|
121
121
|
- recipes/admin.rb
|
122
|
+
- recipes/analytics.rb
|
122
123
|
- recipes/core.rb
|
123
124
|
- recipes/deployment.rb
|
124
125
|
- recipes/devise.rb
|