rails_wizard 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/rails_wizard/command.rb +1 -0
- data/lib/rails_wizard/recipe.rb +1 -1
- data/recipes/capybara.rb +1 -1
- data/recipes/cucumber.rb +2 -2
- data/recipes/devise.rb +3 -2
- data/recipes/env_yaml.rb +54 -0
- data/recipes/heroku.rb +1 -1
- data/recipes/jammit.rb +1 -1
- data/recipes/mootools.rb +1 -1
- data/recipes/redis.rb +6 -0
- data/recipes/redistogo.rb +39 -0
- data/version.rb +1 -1
- metadata +37 -7
data/lib/rails_wizard/command.rb
CHANGED
@@ -15,6 +15,7 @@ module RailsWizard
|
|
15
15
|
while recipe = ask("#{print_recipes}#{bold}Which recipe would you like to add? #{clear}#{yellow}(blank to finish)#{clear}")
|
16
16
|
if recipe == ''
|
17
17
|
run_template(name, @recipes)
|
18
|
+
break
|
18
19
|
elsif RailsWizard::Recipes.list.include?(recipe)
|
19
20
|
@recipes << recipe
|
20
21
|
puts
|
data/lib/rails_wizard/recipe.rb
CHANGED
@@ -11,7 +11,7 @@ module RailsWizard
|
|
11
11
|
def self.<=>(another)
|
12
12
|
return -1 if another.run_after.include?(self.key) || self.run_before.include?(another.key)
|
13
13
|
return 1 if another.run_before.include?(self.key) || self.run_after.include?(another.key)
|
14
|
-
|
14
|
+
self.key <=> another.key
|
15
15
|
end
|
16
16
|
|
17
17
|
ATTRIBUTES = %w(key args category name description template config exclusive tags run_before run_after requires)
|
data/recipes/capybara.rb
CHANGED
data/recipes/cucumber.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
gem 'cucumber-rails', :group => :test
|
2
|
-
gem 'capybara', :group => :test
|
1
|
+
gem 'cucumber-rails', :group => [:development, :test]
|
2
|
+
gem 'capybara', :group => [:development, :test]
|
3
3
|
|
4
4
|
after_bundler do
|
5
5
|
generate "cucumber:install --capybara#{' --rspec' if recipes.include?('rspec')}#{' -D' unless recipes.include?('activerecord')}"
|
data/recipes/devise.rb
CHANGED
@@ -5,9 +5,10 @@ after_bundler do
|
|
5
5
|
|
6
6
|
if recipes.include? 'mongo_mapper'
|
7
7
|
gem 'mm-devise'
|
8
|
-
gsub_file 'config/
|
8
|
+
gsub_file 'config/initializers/devise.rb', 'devise/orm/', 'devise/orm/mongo_mapper_active_model'
|
9
|
+
generate 'mongo_mapper:devise User'
|
9
10
|
elsif recipes.include? 'mongoid'
|
10
|
-
gsub_file 'config/
|
11
|
+
gsub_file 'config/initializers/devise.rb', 'devise/orm/active_record', 'devise/orm/mongoid'
|
11
12
|
end
|
12
13
|
|
13
14
|
generate 'devise user'
|
data/recipes/env_yaml.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
say_wizard "Generating config/env.yaml..."
|
4
|
+
|
5
|
+
append_file "config/application.rb", <<-RUBY
|
6
|
+
|
7
|
+
require 'env_yaml'
|
8
|
+
RUBY
|
9
|
+
|
10
|
+
create_file "lib/env_yaml.rb", <<-RUBY
|
11
|
+
require 'yaml'
|
12
|
+
begin
|
13
|
+
env_yaml = YAML.load_file(File.dirname(__FILE__) + '/../config/env.yml')
|
14
|
+
if env_hash = env_yaml[ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'development']
|
15
|
+
puts env_hash.inspect
|
16
|
+
env_hash.each_pair do |k,v|
|
17
|
+
ENV[k] = v.to_s
|
18
|
+
end
|
19
|
+
end
|
20
|
+
rescue StandardError => e
|
21
|
+
end
|
22
|
+
|
23
|
+
RUBY
|
24
|
+
|
25
|
+
create_file "config/env.yml", <<-YAML
|
26
|
+
defaults:
|
27
|
+
ENV_YAML: true
|
28
|
+
|
29
|
+
development:
|
30
|
+
<<: *defaults
|
31
|
+
|
32
|
+
test:
|
33
|
+
<<: *defaults
|
34
|
+
|
35
|
+
production:
|
36
|
+
<<: *defaults
|
37
|
+
YAML
|
38
|
+
|
39
|
+
def env(k,v,rack_env='development')
|
40
|
+
inject_into_file "config/env.yml", :after => "#{rack_env}:\n <<: *defaults" do
|
41
|
+
<<-YAML
|
42
|
+
#{k}: #{v.inspect}
|
43
|
+
YAML
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
__END__
|
48
|
+
|
49
|
+
name: EnvYAML
|
50
|
+
description: "Allows you to set environment variables in a YAML file at config/env.yaml"
|
51
|
+
author: mbleigh
|
52
|
+
|
53
|
+
category: other
|
54
|
+
tags: [utilities, configuration]
|
data/recipes/heroku.rb
CHANGED
data/recipes/jammit.rb
CHANGED
data/recipes/mootools.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
inside "public/javascripts" do
|
2
2
|
get "https://github.com/kevinvaldek/mootools-ujs/raw/master/Source/rails.js", "rails.js"
|
3
|
-
get "http://ajax.googleapis.com/ajax/libs/mootools/1.
|
3
|
+
get "http://ajax.googleapis.com/ajax/libs/mootools/1.3.1/mootools-yui-compressed.js", "mootools.min.js"
|
4
4
|
end
|
5
5
|
|
6
6
|
gsub_file "config/application.rb", /# JavaScript.*\n/, ""
|
data/recipes/redis.rb
CHANGED
@@ -0,0 +1,39 @@
|
|
1
|
+
prepend_file "config/initializers/redis.rb", <<-RUBY
|
2
|
+
uri = URI.parse(ENV['REDISTOGO_URL'])
|
3
|
+
|
4
|
+
RUBY
|
5
|
+
|
6
|
+
inject_into_file "config/initializers/redis.rb", :after => "Redis.new" do
|
7
|
+
"(:host => uri.host, :port => uri.port, :password => uri.password)"
|
8
|
+
end
|
9
|
+
|
10
|
+
env("REDISTOGO_URL", "redis://localhost:6379")
|
11
|
+
|
12
|
+
after_bundler do
|
13
|
+
if config['use_heroku']
|
14
|
+
say_wizard "Adding redistogo:nano Heroku addon, you can always upgrade later."
|
15
|
+
run "heroku addons:add redistogo:nano"
|
16
|
+
else
|
17
|
+
env("REDISTOGO_URL", config['url'], 'production') if config['url']
|
18
|
+
end
|
19
|
+
end
|
20
|
+
__END__
|
21
|
+
|
22
|
+
name: RedisToGo
|
23
|
+
description: "Use RedisToGo hosting for this app's Redis."
|
24
|
+
author: mbleigh
|
25
|
+
|
26
|
+
requires: [redis, env_yaml]
|
27
|
+
run_after: [redis, env_yaml]
|
28
|
+
category: services
|
29
|
+
|
30
|
+
config:
|
31
|
+
- use_heroku:
|
32
|
+
type: boolean
|
33
|
+
prompt: "Use the RedisToGo Heroku addon?"
|
34
|
+
if_recipe: heroku
|
35
|
+
- url:
|
36
|
+
type: string
|
37
|
+
prompt: "Enter your RedisToGo URL:"
|
38
|
+
unless: use_heroku
|
39
|
+
|
data/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rails_wizard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Michael Bleigh
|
@@ -10,12 +10,11 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-03-
|
13
|
+
date: 2011-03-22 00:00:00 -05:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: i18n
|
18
|
-
prerelease: false
|
19
18
|
requirement: &id001 !ruby/object:Gem::Requirement
|
20
19
|
none: false
|
21
20
|
requirements:
|
@@ -23,10 +22,10 @@ dependencies:
|
|
23
22
|
- !ruby/object:Gem::Version
|
24
23
|
version: "0"
|
25
24
|
type: :runtime
|
25
|
+
prerelease: false
|
26
26
|
version_requirements: *id001
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
|
-
prerelease: false
|
30
29
|
requirement: &id002 !ruby/object:Gem::Requirement
|
31
30
|
none: false
|
32
31
|
requirements:
|
@@ -34,18 +33,41 @@ dependencies:
|
|
34
33
|
- !ruby/object:Gem::Version
|
35
34
|
version: 3.0.0
|
36
35
|
type: :runtime
|
36
|
+
prerelease: false
|
37
37
|
version_requirements: *id002
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
|
-
name:
|
40
|
-
prerelease: false
|
39
|
+
name: thor
|
41
40
|
requirement: &id003 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: "0"
|
46
|
+
type: :runtime
|
47
|
+
prerelease: false
|
48
|
+
version_requirements: *id003
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: rspec
|
51
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
42
52
|
none: false
|
43
53
|
requirements:
|
44
54
|
- - ~>
|
45
55
|
- !ruby/object:Gem::Version
|
46
56
|
version: 2.5.0
|
47
57
|
type: :development
|
48
|
-
|
58
|
+
prerelease: false
|
59
|
+
version_requirements: *id004
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: mg
|
62
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: "0"
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: *id005
|
49
71
|
description: Quickly and easily create Rails application templates featuring dozens of popular libraries.
|
50
72
|
email:
|
51
73
|
- michael@intridea.com
|
@@ -66,6 +88,7 @@ files:
|
|
66
88
|
- recipes/capybara.rb
|
67
89
|
- recipes/cucumber.rb
|
68
90
|
- recipes/devise.rb
|
91
|
+
- recipes/env_yaml.rb
|
69
92
|
- recipes/git.rb
|
70
93
|
- recipes/haml.rb
|
71
94
|
- recipes/heroku.rb
|
@@ -80,6 +103,7 @@ files:
|
|
80
103
|
- recipes/omniauth.rb
|
81
104
|
- recipes/prototype.rb
|
82
105
|
- recipes/redis.rb
|
106
|
+
- recipes/redistogo.rb
|
83
107
|
- recipes/rightjs.rb
|
84
108
|
- recipes/rspec.rb
|
85
109
|
- recipes/sass.rb
|
@@ -114,12 +138,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
138
|
requirements:
|
115
139
|
- - ">="
|
116
140
|
- !ruby/object:Gem::Version
|
141
|
+
hash: 2031770524673691899
|
142
|
+
segments:
|
143
|
+
- 0
|
117
144
|
version: "0"
|
118
145
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
146
|
none: false
|
120
147
|
requirements:
|
121
148
|
- - ">="
|
122
149
|
- !ruby/object:Gem::Version
|
150
|
+
hash: 2031770524673691899
|
151
|
+
segments:
|
152
|
+
- 0
|
123
153
|
version: "0"
|
124
154
|
requirements: []
|
125
155
|
|