thyone_creator 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/thyone +7 -0
- data/lib/rails_wizard/command.rb +116 -0
- data/lib/rails_wizard/config.rb +88 -0
- data/lib/rails_wizard/recipe.rb +106 -0
- data/lib/rails_wizard/recipes.rb +38 -0
- data/lib/rails_wizard/template.rb +73 -0
- data/lib/rails_wizard.rb +10 -0
- data/recipes/action_mailer.rb +123 -0
- data/recipes/active_admin.rb +44 -0
- data/recipes/activerecord.rb +37 -0
- data/recipes/add_user.rb +129 -0
- data/recipes/airbrake.rb +34 -0
- data/recipes/backbone.rb +23 -0
- data/recipes/capybara.rb +34 -0
- data/recipes/cleanup.rb +40 -0
- data/recipes/cloudfiles.rb +36 -0
- data/recipes/compass.rb +46 -0
- data/recipes/compass_960.rb +48 -0
- data/recipes/cucumber.rb +75 -0
- data/recipes/datamapper.rb +111 -0
- data/recipes/devise.rb +114 -0
- data/recipes/extras.rb +80 -0
- data/recipes/git.rb +40 -0
- data/recipes/guard.rb +99 -0
- data/recipes/haml.rb +23 -0
- data/recipes/heroku.rb +62 -0
- data/recipes/home_page.rb +58 -0
- data/recipes/home_page_users.rb +47 -0
- data/recipes/html5.rb +153 -0
- data/recipes/inherited_resources.rb +23 -0
- data/recipes/less.rb +12 -0
- data/recipes/mongohq.rb +59 -0
- data/recipes/mongoid.rb +39 -0
- data/recipes/mongolab.rb +59 -0
- data/recipes/omniauth.rb +192 -0
- data/recipes/omniauth_email.rb +82 -0
- data/recipes/paperclip.rb +79 -0
- data/recipes/rails_admin.rb +21 -0
- data/recipes/redis.rb +23 -0
- data/recipes/responders.rb +10 -0
- data/recipes/resque.rb +25 -0
- data/recipes/rspec.rb +133 -0
- data/recipes/sass.rb +25 -0
- data/recipes/seed_database.rb +76 -0
- data/recipes/settingslogic.rb +43 -0
- data/recipes/simple_form.rb +54 -0
- data/recipes/slim.rb +46 -0
- data/recipes/static_page.rb +43 -0
- data/recipes/subdomains.rb +121 -0
- data/recipes/users_page.rb +165 -0
- data/spec/rails_wizard/config_spec.rb +108 -0
- data/spec/rails_wizard/recipe_spec.rb +81 -0
- data/spec/rails_wizard/recipes/sanity_spec.rb +30 -0
- data/spec/rails_wizard/recipes_spec.rb +24 -0
- data/spec/rails_wizard/template_spec.rb +78 -0
- data/spec/spec_helper.rb +11 -0
- data/spec/support/rails_directory.rb +17 -0
- data/spec/support/template_runner.rb +28 -0
- data/templates/helpers.erb +45 -0
- data/templates/layout.erb +83 -0
- data/templates/recipe.erb +10 -0
- data/version.rb +3 -0
- metadata +251 -0
@@ -0,0 +1,45 @@
|
|
1
|
+
def recipes; @recipes end
|
2
|
+
def recipe?(name); @recipes.include?(name) end
|
3
|
+
|
4
|
+
def say_custom(tag, text); say "\033[1m\033[36m" + tag.to_s.rjust(10) + "\033[0m" + " #{text}" end
|
5
|
+
def say_recipe(name); say "\033[1m\033[36m" + "recipe".rjust(10) + "\033[0m" + " Running #{name} recipe..." end
|
6
|
+
def say_wizard(text); say_custom(@current_recipe || 'wizard', text) end
|
7
|
+
|
8
|
+
def ask_wizard(question)
|
9
|
+
ask "\033[1m\033[30m\033[46m" + (@current_recipe || "prompt").rjust(10) + "\033[0m\033[36m" + " #{question}\033[0m"
|
10
|
+
end
|
11
|
+
|
12
|
+
def yes_wizard?(question)
|
13
|
+
answer = ask_wizard(question + " \033[33m(y/n)\033[0m")
|
14
|
+
case answer.downcase
|
15
|
+
when "yes", "y"
|
16
|
+
true
|
17
|
+
when "no", "n"
|
18
|
+
false
|
19
|
+
else
|
20
|
+
yes_wizard?(question)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def no_wizard?(question); !yes_wizard?(question) end
|
25
|
+
|
26
|
+
def multiple_choice(question, choices)
|
27
|
+
say_custom('question', question)
|
28
|
+
values = {}
|
29
|
+
choices.each_with_index do |choice,i|
|
30
|
+
values[(i + 1).to_s] = choice[1]
|
31
|
+
say_custom (i + 1).to_s + ')', choice[0]
|
32
|
+
end
|
33
|
+
answer = ask_wizard("Enter your selection:") while !values.keys.include?(answer)
|
34
|
+
values[answer]
|
35
|
+
end
|
36
|
+
|
37
|
+
@current_recipe = nil
|
38
|
+
@configs = {}
|
39
|
+
|
40
|
+
@after_blocks = []
|
41
|
+
def after_bundler(&block); @after_blocks << [@current_recipe, block]; end
|
42
|
+
@after_everything_blocks = []
|
43
|
+
def after_everything(&block); @after_everything_blocks << [@current_recipe, block]; end
|
44
|
+
@before_configs = {}
|
45
|
+
def before_config(&block); @before_configs[@current_recipe] = block; end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# >---------------------------------------------------------------------------<
|
2
|
+
#
|
3
|
+
# _____ _ _ __ ___ _
|
4
|
+
# | __ \ (_) | \ \ / (_) | |
|
5
|
+
# | |__) |__ _ _| |___\ \ /\ / / _ ______ _ _ __ __| |
|
6
|
+
# | _ // _` | | / __|\ \/ \/ / | |_ / _` | '__/ _` |
|
7
|
+
# | | \ \ (_| | | \__ \ \ /\ / | |/ / (_| | | | (_| |
|
8
|
+
# |_| \_\__,_|_|_|___/ \/ \/ |_/___\__,_|_| \__,_|
|
9
|
+
#
|
10
|
+
# This template was generated by rails_apps_composer, a custom version of
|
11
|
+
# RailsWizard, the application template builder. For more information, see:
|
12
|
+
# https://github.com/RailsApps/rails_apps_composer/
|
13
|
+
#
|
14
|
+
# >---------------------------------------------------------------------------<
|
15
|
+
|
16
|
+
# >----------------------------[ Initial Setup ]------------------------------<
|
17
|
+
|
18
|
+
initializer 'generators.rb', <<-RUBY
|
19
|
+
Rails.application.config.generators do |g|
|
20
|
+
end
|
21
|
+
RUBY
|
22
|
+
|
23
|
+
@recipes = <%= resolve_recipes.map(&:key).inspect %>
|
24
|
+
|
25
|
+
<%= render "helpers" %>
|
26
|
+
|
27
|
+
# this application template only supports Rails version 3.1 and newer
|
28
|
+
case Rails::VERSION::MAJOR.to_s
|
29
|
+
when "3"
|
30
|
+
case Rails::VERSION::MINOR.to_s
|
31
|
+
when "2"
|
32
|
+
say_wizard "You are using Rails version #{Rails::VERSION::STRING}."
|
33
|
+
when "1"
|
34
|
+
say_wizard "You are using Rails version #{Rails::VERSION::STRING}."
|
35
|
+
when "0"
|
36
|
+
say_wizard "You are using Rails version #{Rails::VERSION::STRING} which is not supported. Try 3.1 or newer."
|
37
|
+
raise StandardError.new "Rails #{Rails::VERSION::STRING} is not supported. Try 3.1 or newer."
|
38
|
+
else
|
39
|
+
say_wizard "You are using Rails version #{Rails::VERSION::STRING}."
|
40
|
+
end
|
41
|
+
else
|
42
|
+
say_wizard "You are using Rails version #{Rails::VERSION::STRING} which is not supported. Try 3.1 or newer."
|
43
|
+
raise StandardError.new "Rails #{Rails::VERSION::STRING} is not supported. Try 3.1 or newer."
|
44
|
+
end
|
45
|
+
|
46
|
+
say_wizard "Checking configuration. Please confirm your preferences."
|
47
|
+
|
48
|
+
# >---------------------------[ Autoload Modules/Classes ]-----------------------------<
|
49
|
+
|
50
|
+
inject_into_file 'config/application.rb', :after => 'config.autoload_paths += %W(#{config.root}/extras)' do <<-'RUBY'
|
51
|
+
|
52
|
+
config.autoload_paths += %W(#{config.root}/lib)
|
53
|
+
RUBY
|
54
|
+
end
|
55
|
+
|
56
|
+
# >---------------------------------[ Recipes ]----------------------------------<
|
57
|
+
|
58
|
+
<% resolve_recipes.each do |recipe| %>
|
59
|
+
<%= render 'recipe', recipe.get_binding %>
|
60
|
+
<% end %>
|
61
|
+
|
62
|
+
<% if custom_code? %># >-----------------------------[ Custom Code ]-------------------------------<
|
63
|
+
|
64
|
+
<%= custom_code %><% end %>
|
65
|
+
|
66
|
+
@current_recipe = nil
|
67
|
+
|
68
|
+
# >-----------------------------[ Run Bundler ]-------------------------------<
|
69
|
+
|
70
|
+
say_wizard "Running 'bundle install'. This will take a while."
|
71
|
+
run 'bundle install'
|
72
|
+
run 'bundle update'
|
73
|
+
say_wizard "Running 'after bundler' callbacks."
|
74
|
+
require 'bundler/setup'
|
75
|
+
@after_blocks.each{|b| config = @configs[b[0]] || {}; @current_recipe = b[0]; b[1].call}
|
76
|
+
|
77
|
+
@current_recipe = nil
|
78
|
+
say_wizard "Running 'after everything' callbacks."
|
79
|
+
@after_everything_blocks.each{|b| config = @configs[b[0]] || {}; @current_recipe = b[0]; b[1].call}
|
80
|
+
|
81
|
+
@current_recipe = nil
|
82
|
+
say_wizard "Finished running the rails_apps_composer app template."
|
83
|
+
say_wizard "Your new Rails app is ready."
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# ><%= "[ #{name} ]".center(75,'-') %><
|
2
|
+
|
3
|
+
@current_recipe = "<%= key %>"
|
4
|
+
@before_configs["<%= key %>"].call if @before_configs["<%= key %>"]
|
5
|
+
say_recipe '<%= name %>'
|
6
|
+
|
7
|
+
<%= config.compile if config %>
|
8
|
+
@configs[@current_recipe] = config
|
9
|
+
|
10
|
+
<%= template %>
|
data/version.rb
ADDED
metadata
ADDED
@@ -0,0 +1,251 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: thyone_creator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- babaru trinit
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-06-06 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: i18n
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: activesupport
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 3.0.0
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 3.0.0
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: thor
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rake
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rspec
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 2.5.0
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 2.5.0
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: mg
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: activesupport
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 3.0.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 3.0.0
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: i18n
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
description: A gem with recipes to create Rails application templates you can use
|
143
|
+
to generate Rails starter apps.
|
144
|
+
email:
|
145
|
+
- babaru.trinit@gmail.com
|
146
|
+
executables:
|
147
|
+
- thyone
|
148
|
+
extensions: []
|
149
|
+
extra_rdoc_files: []
|
150
|
+
files:
|
151
|
+
- lib/rails_wizard/command.rb
|
152
|
+
- lib/rails_wizard/config.rb
|
153
|
+
- lib/rails_wizard/recipe.rb
|
154
|
+
- lib/rails_wizard/recipes.rb
|
155
|
+
- lib/rails_wizard/template.rb
|
156
|
+
- lib/rails_wizard.rb
|
157
|
+
- recipes/action_mailer.rb
|
158
|
+
- recipes/active_admin.rb
|
159
|
+
- recipes/activerecord.rb
|
160
|
+
- recipes/add_user.rb
|
161
|
+
- recipes/airbrake.rb
|
162
|
+
- recipes/backbone.rb
|
163
|
+
- recipes/capybara.rb
|
164
|
+
- recipes/cleanup.rb
|
165
|
+
- recipes/cloudfiles.rb
|
166
|
+
- recipes/compass.rb
|
167
|
+
- recipes/compass_960.rb
|
168
|
+
- recipes/cucumber.rb
|
169
|
+
- recipes/datamapper.rb
|
170
|
+
- recipes/devise.rb
|
171
|
+
- recipes/extras.rb
|
172
|
+
- recipes/git.rb
|
173
|
+
- recipes/guard.rb
|
174
|
+
- recipes/haml.rb
|
175
|
+
- recipes/heroku.rb
|
176
|
+
- recipes/home_page.rb
|
177
|
+
- recipes/home_page_users.rb
|
178
|
+
- recipes/html5.rb
|
179
|
+
- recipes/inherited_resources.rb
|
180
|
+
- recipes/less.rb
|
181
|
+
- recipes/mongohq.rb
|
182
|
+
- recipes/mongoid.rb
|
183
|
+
- recipes/mongolab.rb
|
184
|
+
- recipes/omniauth.rb
|
185
|
+
- recipes/omniauth_email.rb
|
186
|
+
- recipes/paperclip.rb
|
187
|
+
- recipes/rails_admin.rb
|
188
|
+
- recipes/redis.rb
|
189
|
+
- recipes/responders.rb
|
190
|
+
- recipes/resque.rb
|
191
|
+
- recipes/rspec.rb
|
192
|
+
- recipes/sass.rb
|
193
|
+
- recipes/seed_database.rb
|
194
|
+
- recipes/settingslogic.rb
|
195
|
+
- recipes/simple_form.rb
|
196
|
+
- recipes/slim.rb
|
197
|
+
- recipes/static_page.rb
|
198
|
+
- recipes/subdomains.rb
|
199
|
+
- recipes/users_page.rb
|
200
|
+
- version.rb
|
201
|
+
- templates/helpers.erb
|
202
|
+
- templates/layout.erb
|
203
|
+
- templates/recipe.erb
|
204
|
+
- spec/rails_wizard/config_spec.rb
|
205
|
+
- spec/rails_wizard/recipe_spec.rb
|
206
|
+
- spec/rails_wizard/recipes/sanity_spec.rb
|
207
|
+
- spec/rails_wizard/recipes_spec.rb
|
208
|
+
- spec/rails_wizard/template_spec.rb
|
209
|
+
- spec/spec_helper.rb
|
210
|
+
- spec/support/rails_directory.rb
|
211
|
+
- spec/support/template_runner.rb
|
212
|
+
- bin/thyone
|
213
|
+
homepage: http://github.com/babaru/thyone_creator
|
214
|
+
licenses: []
|
215
|
+
post_install_message:
|
216
|
+
rdoc_options: []
|
217
|
+
require_paths:
|
218
|
+
- lib
|
219
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
220
|
+
none: false
|
221
|
+
requirements:
|
222
|
+
- - ! '>='
|
223
|
+
- !ruby/object:Gem::Version
|
224
|
+
version: '0'
|
225
|
+
segments:
|
226
|
+
- 0
|
227
|
+
hash: 2482826019460600701
|
228
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
229
|
+
none: false
|
230
|
+
requirements:
|
231
|
+
- - ! '>='
|
232
|
+
- !ruby/object:Gem::Version
|
233
|
+
version: '0'
|
234
|
+
segments:
|
235
|
+
- 0
|
236
|
+
hash: 2482826019460600701
|
237
|
+
requirements: []
|
238
|
+
rubyforge_project: thyone_creator
|
239
|
+
rubygems_version: 1.8.24
|
240
|
+
signing_key:
|
241
|
+
specification_version: 3
|
242
|
+
summary: A version of the RailsWizard gem with custom recipes for Rails starter apps.
|
243
|
+
test_files:
|
244
|
+
- spec/rails_wizard/config_spec.rb
|
245
|
+
- spec/rails_wizard/recipe_spec.rb
|
246
|
+
- spec/rails_wizard/recipes/sanity_spec.rb
|
247
|
+
- spec/rails_wizard/recipes_spec.rb
|
248
|
+
- spec/rails_wizard/template_spec.rb
|
249
|
+
- spec/spec_helper.rb
|
250
|
+
- spec/support/rails_directory.rb
|
251
|
+
- spec/support/template_runner.rb
|