ey_rails_wizard 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog.md +8 -0
- data/README.md +21 -17
- data/Rakefile +21 -6
- data/lib/rails_wizard.rb +5 -5
- data/lib/rails_wizard/command.rb +29 -23
- data/lib/rails_wizard/config.rb +6 -6
- data/lib/rails_wizard/{recipe.rb → scroll.rb} +10 -10
- data/lib/rails_wizard/{recipes.rb → scrolls.rb} +9 -9
- data/lib/rails_wizard/template.rb +23 -23
- data/sample.rb +2 -2
- data/{recipes → scrolls}/active_admin.rb +1 -1
- data/{recipes → scrolls}/activerecord.rb +0 -0
- data/{recipes → scrolls}/cancan.rb +0 -0
- data/{recipes → scrolls}/capybara.rb +0 -0
- data/{recipes → scrolls}/carrierwave.rb +0 -0
- data/{recipes → scrolls}/carrierwave_direct.rb +0 -0
- data/{recipes → scrolls}/cartographer.rb +0 -0
- data/{recipes → scrolls}/cucumber.rb +1 -1
- data/scrolls/delayed_job.rb +94 -0
- data/{recipes → scrolls}/devise.rb +2 -2
- data/{recipes → scrolls}/devise_invitable.rb +0 -0
- data/{recipes → scrolls}/env_yaml.rb +0 -0
- data/{recipes → scrolls}/event_calendar.rb +0 -0
- data/scrolls/eycloud.rb +62 -0
- data/{recipes → scrolls}/eycloud_recipes_on_deploy.rb +1 -1
- data/{recipes → scrolls}/factory_girl.rb +1 -1
- data/{recipes → scrolls}/ffaker.rb +0 -0
- data/{recipes → scrolls}/fixture_builder.rb +0 -0
- data/{recipes → scrolls}/forgery.rb +0 -0
- data/{recipes → scrolls}/git.rb +0 -0
- data/scrolls/github.rb +31 -0
- data/{recipes → scrolls}/haml.rb +0 -0
- data/{recipes → scrolls}/heroku.rb +0 -0
- data/{recipes → scrolls}/hoptoad.rb +1 -1
- data/{recipes → scrolls}/inherited_resources.rb +0 -0
- data/scrolls/intercom.rb +35 -0
- data/{recipes → scrolls}/jammit.rb +0 -0
- data/{recipes → scrolls}/jasmine.rb +0 -0
- data/{recipes → scrolls}/jquery.rb +0 -0
- data/{recipes → scrolls}/mini_magick.rb +0 -0
- data/{recipes → scrolls}/mongo_mapper.rb +0 -0
- data/{recipes → scrolls}/mongohq.rb +2 -2
- data/{recipes → scrolls}/mongoid.rb +0 -0
- data/{recipes → scrolls}/mootools.rb +0 -0
- data/{recipes → scrolls}/mysql.rb +12 -2
- data/scrolls/newrelic.rb +11 -0
- data/{recipes → scrolls}/nifty_generators.rb +1 -1
- data/{recipes → scrolls}/oa_oauth.rb +0 -0
- data/{recipes → scrolls}/omniauth.rb +0 -0
- data/{recipes → scrolls}/paper_trail.rb +0 -0
- data/{recipes → scrolls}/pow.rb +0 -0
- data/{recipes → scrolls}/prototype.rb +0 -0
- data/{recipes → scrolls}/puma.rb +0 -0
- data/{recipes → scrolls}/rails_admin.rb +0 -0
- data/{recipes → scrolls}/rails_basics.rb +9 -4
- data/{recipes → scrolls}/rails_dev_tweaks.rb +0 -0
- data/{recipes → scrolls}/rails_erd.rb +0 -0
- data/{recipes → scrolls}/rails_footnotes.rb +0 -0
- data/{recipes → scrolls}/ransack.rb +0 -0
- data/{recipes → scrolls}/redis.rb +4 -0
- data/scrolls/resque.rb +70 -0
- data/{recipes → scrolls}/rmagick.rb +0 -0
- data/{recipes → scrolls}/rspec.rb +0 -0
- data/{recipes → scrolls}/sass.rb +1 -1
- data/{recipes → scrolls}/sequel.rb +0 -0
- data/{recipes → scrolls}/settingslogic.rb +0 -0
- data/{recipes → scrolls}/shoulda_matchers.rb +0 -0
- data/scrolls/sidekiq.rb +23 -0
- data/{recipes → scrolls}/simple_form.rb +1 -1
- data/{recipes → scrolls}/slim.rb +0 -0
- data/{recipes → scrolls}/sqlite3.rb +0 -0
- data/{recipes → scrolls}/test_unit.rb +0 -0
- data/{recipes → scrolls}/thin.rb +0 -0
- data/{recipes → scrolls}/thinking_sphinx.rb +0 -0
- data/{recipes → scrolls}/twitter_bootstrap_rails.rb +1 -1
- data/{recipes → scrolls}/unicorn.rb +0 -0
- data/spec/rails_wizard/config_spec.rb +6 -6
- data/spec/rails_wizard/recipe_spec.rb +16 -16
- data/spec/rails_wizard/recipes/sanity_spec.rb +13 -13
- data/spec/rails_wizard/recipes_spec.rb +9 -9
- data/spec/rails_wizard/template_spec.rb +15 -15
- data/templates/helpers.erb +9 -9
- data/templates/layout.erb +7 -7
- data/templates/new_scroll.erb +20 -0
- data/templates/{recipe.erb → scroll.erb} +3 -3
- data/version.rb +1 -1
- metadata +88 -83
- data/recipes/delayed_job.rb +0 -16
- data/recipes/eycloud.rb +0 -30
- data/recipes/resque.rb +0 -37
data/ChangeLog.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# ChangeLog
|
2
2
|
|
3
|
+
## v0.4
|
4
|
+
|
5
|
+
* SCROLLS ARE IN, "recipes" are out. Wizards use scrolls. Alchemists use recipes.
|
6
|
+
* Scrolls have no dependencies on `eycloud` or `eycloud_recipes_on_deploy`; these are optional
|
7
|
+
* `github` - GitHub repository creation
|
8
|
+
* `resque` + `delayed_job` can install their admin consoles
|
9
|
+
* `sidekiq` - high performance, low cost alternative to `resque` or `delayed_job`
|
10
|
+
|
3
11
|
## v0.3
|
4
12
|
|
5
13
|
* Engine Yard support - Resque
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# Engine Yard Rails Wizard Gem
|
2
2
|
|
3
|
-
The Engine Yard RailsWizard gem is both the official repository of
|
3
|
+
The Engine Yard RailsWizard gem is both the official repository of scrolls for [Engine Yard RailsWizard][1] as well as a stand-alone tool to generate rails templates from the command line. The website and the gem are kept in version sync, so any scrolls released to the gem will be simultaneously available on the web builder.
|
4
4
|
|
5
5
|
This is a fork of the original [RailsWizard gem][4] specifically for Engine Yard Cloud customers. We are very thankful to Michael Bleigh and Intridea for creating Rails Wizard.
|
6
6
|
|
7
|
-
Generated applications may include EY Cloud
|
7
|
+
Generated applications may include EY Cloud scrolls to setup/run required services.
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
@@ -18,35 +18,39 @@ The primary usage of the `ey_rails_wizard` gem is to utilize its interactive ter
|
|
18
18
|
|
19
19
|
ey_rails_wizard new APP_NAME
|
20
20
|
|
21
|
-
Where `APP_NAME` is the directory in which you wish to create the app (it mirrors the Rails creation syntax). You will then be guided through the
|
21
|
+
Where `APP_NAME` is the directory in which you wish to create the app (it mirrors the Rails creation syntax). You will then be guided through the scroll selection process and subsequently the Rails app generator will automatically run with the template and all appropriate command line options included.
|
22
22
|
|
23
|
-
### Specifying
|
23
|
+
### Specifying Scrolls
|
24
24
|
|
25
|
-
If you wish to skip the interactive
|
25
|
+
If you wish to skip the interactive scroll selector, you may provide instead a list of scrolls with the `-r` option:
|
26
26
|
|
27
27
|
ey_rails_wizard new APP_NAME -r jquery mongo_mapper sass
|
28
28
|
|
29
|
-
This will automatically generate a Rails template with the provided
|
29
|
+
This will automatically generate a Rails template with the provided scrolls and begin the app generator.
|
30
30
|
|
31
|
-
### Listing
|
31
|
+
### Listing Scrolls
|
32
32
|
|
33
|
-
You can also print out a simple list of
|
33
|
+
You can also print out a simple list of scrolls:
|
34
34
|
|
35
35
|
ey_rails_wizard list
|
36
36
|
|
37
|
-
Or print out a list of
|
37
|
+
Or print out a list of scrolls for a specific category:
|
38
38
|
|
39
39
|
ey_rails_wizard list persistence
|
40
40
|
|
41
|
-
# EY Rails Wizard
|
41
|
+
# EY Rails Wizard Scrolls
|
42
42
|
|
43
|
-
The Engine Yard Rails Wizard
|
43
|
+
The Engine Yard Rails Wizard scroll collection now live in this GitHub repository to make them fork-friendly and available for use with the command-line tool. You can see all of the scrolls in the [scrolls directory][2].
|
44
44
|
|
45
45
|
If you're looking for the web app source code, it now lives at [ey_rails_wizard.web][3].
|
46
46
|
|
47
|
-
## Submitting a
|
47
|
+
## Submitting a Scroll
|
48
48
|
|
49
|
-
|
49
|
+
Create new scrolls using:
|
50
|
+
|
51
|
+
rake new NAME=scroll-name
|
52
|
+
|
53
|
+
Submitting a scroll is actually a very straightforward process. Scrolls are made of up **template code** and **YAML back-matter** stored in a ruby file. The `__END__` parsing convention is used so that each scroll is actually a valid, parseable Ruby file. The structure of a scroll looks something like this:
|
50
54
|
|
51
55
|
```ruby
|
52
56
|
gem 'supergem'
|
@@ -63,16 +67,16 @@ description: Installs SuperGem which is useful for things
|
|
63
67
|
author: mbleigh
|
64
68
|
```
|
65
69
|
|
66
|
-
It's really that simple. The gem has RSpec tests that automatically validate each
|
70
|
+
It's really that simple. The gem has RSpec tests that automatically validate each scroll in the repository, so you should run `rake spec` as a basic sanity check before submitting a pull request. Note that these don't verify that your scroll code itself works, just that Engine Yard Rails Wizard could properly parse and understand your scroll file.
|
67
71
|
|
68
|
-
For more information on all available options for authoring
|
72
|
+
For more information on all available options for authoring scrolls,
|
69
73
|
please see the
|
70
74
|
|
71
75
|
## License
|
72
76
|
|
73
|
-
Engine Yard Rails Wizard and its
|
77
|
+
Engine Yard Rails Wizard and its scrolls are distributed under the MIT License.
|
74
78
|
|
75
79
|
[1]:http://railswizard.engineyard.com/
|
76
|
-
[2]:https://github.com/engineyard/ey_rails_wizard/tree/master/
|
80
|
+
[2]:https://github.com/engineyard/ey_rails_wizard/tree/master/scrolls
|
77
81
|
[3]:https://github.com/engineyard/ey_rails_wizard.web
|
78
82
|
[4]:https://github.com/intridea/rails_wizard
|
data/Rakefile
CHANGED
@@ -13,14 +13,14 @@ task :clean do
|
|
13
13
|
system 'rm -rf test_run'
|
14
14
|
end
|
15
15
|
|
16
|
-
desc "Execute a test run with the specified
|
16
|
+
desc "Execute a test run with the specified scrolls."
|
17
17
|
task :run => :clean do
|
18
|
-
|
18
|
+
scrolls = ENV['SCROLLS'].split(',')
|
19
19
|
|
20
20
|
require 'tempfile'
|
21
21
|
require 'rails_wizard'
|
22
22
|
|
23
|
-
template = RailsWizard::Template.new(
|
23
|
+
template = RailsWizard::Template.new(scrolls)
|
24
24
|
|
25
25
|
begin
|
26
26
|
dir = Dir.mktmpdir "rails_template"
|
@@ -36,10 +36,25 @@ task :run => :clean do
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
desc "Prints out a template from the provided
|
39
|
+
desc "Prints out a template from the provided scrolls."
|
40
40
|
task :print do
|
41
41
|
require 'rails_wizard'
|
42
42
|
|
43
|
-
|
44
|
-
puts RailsWizard::Template.new(
|
43
|
+
scrolls = ENV['SCROLLS'].split(',')
|
44
|
+
puts RailsWizard::Template.new(scrolls).compile
|
45
45
|
end
|
46
|
+
|
47
|
+
desc "Create a new template"
|
48
|
+
task :new do
|
49
|
+
unless (name = ENV['NAME']) && name.size > 0
|
50
|
+
$stderr.puts "USAGE: rake new NAME=scroll-name"
|
51
|
+
exit 1
|
52
|
+
end
|
53
|
+
require 'active_support/inflector'
|
54
|
+
require 'erb'
|
55
|
+
require 'rails_wizard/template'
|
56
|
+
scroll = RailsWizard::Template.render("new_scroll", binding)
|
57
|
+
scroll_path = "scrolls/#{name}.rb"
|
58
|
+
File.open(scroll_path, "w") { |file| file << scroll }
|
59
|
+
`open #{scroll_path}`
|
60
|
+
end
|
data/lib/rails_wizard.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
require 'rails_wizard/
|
2
|
-
require 'rails_wizard/
|
1
|
+
require 'rails_wizard/scrolls'
|
2
|
+
require 'rails_wizard/scroll'
|
3
3
|
require 'rails_wizard/config'
|
4
4
|
require 'rails_wizard/template'
|
5
5
|
|
6
|
-
Dir[File.dirname(__FILE__) + '/../
|
6
|
+
Dir[File.dirname(__FILE__) + '/../scrolls/*.rb'].each do |path|
|
7
7
|
key = File.basename(path, '.rb')
|
8
|
-
|
9
|
-
RailsWizard::
|
8
|
+
scroll = RailsWizard::Scroll.generate(key, File.open(path))
|
9
|
+
RailsWizard::Scrolls.add(scroll)
|
10
10
|
end
|
data/lib/rails_wizard/command.rb
CHANGED
@@ -5,39 +5,40 @@ module RailsWizard
|
|
5
5
|
class Command < Thor
|
6
6
|
include Thor::Actions
|
7
7
|
desc "new APP_NAME", "create a new Rails app"
|
8
|
-
method_option :
|
8
|
+
method_option :scrolls, :type => :array, :aliases => "-s", :desc => "List scrolls, e.g. -s resque rails_basics jquery"
|
9
|
+
method_option :template, :type => :boolean, :aliases => "-t", :desc => "Only display template that would be used"
|
9
10
|
def new(name)
|
10
|
-
if options[:
|
11
|
-
run_template(name, options[:
|
11
|
+
if options[:scrolls]
|
12
|
+
run_template(name, options[:scrolls], options[:template])
|
12
13
|
else
|
13
|
-
@
|
14
|
+
@scrolls = []
|
14
15
|
|
15
|
-
while
|
16
|
-
if
|
17
|
-
run_template(name, @
|
16
|
+
while scroll = ask("#{print_scrolls}#{bold}Which scroll would you like to add? #{clear}#{yellow}(blank to finish)#{clear}")
|
17
|
+
if scroll == ''
|
18
|
+
run_template(name, @scrolls)
|
18
19
|
break
|
19
|
-
elsif RailsWizard::
|
20
|
-
@
|
20
|
+
elsif RailsWizard::Scrolls.list.include?(scroll)
|
21
|
+
@scrolls << scroll
|
21
22
|
puts
|
22
|
-
puts "> #{green}Added '#{
|
23
|
+
puts "> #{green}Added '#{scroll}' to template.#{clear}"
|
23
24
|
else
|
24
25
|
puts
|
25
|
-
puts "> #{red}Invalid
|
26
|
+
puts "> #{red}Invalid scroll, please try again.#{clear}"
|
26
27
|
end
|
27
28
|
end
|
28
29
|
end
|
29
30
|
end
|
30
31
|
|
31
|
-
desc "list [CATEGORY]", "list available
|
32
|
+
desc "list [CATEGORY]", "list available scrolls (optionally by category)"
|
32
33
|
def list(category = nil)
|
33
34
|
if category
|
34
|
-
|
35
|
+
scrolls = RailsWizard::Scrolls.for(category).map{|r| RailsWizard::Scroll.from_mongo(r) }
|
35
36
|
else
|
36
|
-
|
37
|
+
scrolls = RailsWizard::Scrolls.list_classes
|
37
38
|
end
|
38
39
|
|
39
|
-
|
40
|
-
puts
|
40
|
+
scrolls.each do |scroll|
|
41
|
+
puts scroll.key.ljust(15) + "# #{scroll.description}"
|
41
42
|
end
|
42
43
|
end
|
43
44
|
|
@@ -49,28 +50,33 @@ module RailsWizard
|
|
49
50
|
def green; "\033[32m" end
|
50
51
|
def yellow; "\033[33m" end
|
51
52
|
|
52
|
-
def
|
53
|
+
def print_scrolls
|
53
54
|
puts
|
54
55
|
puts
|
55
56
|
puts
|
56
|
-
if @
|
57
|
-
puts "#{green}#{bold}Your
|
57
|
+
if @scrolls && @scrolls.any?
|
58
|
+
puts "#{green}#{bold}Your Scrolls:#{clear} " + @scrolls.join(", ")
|
58
59
|
puts
|
59
60
|
end
|
60
|
-
puts "#{bold}#{cyan}Available
|
61
|
+
puts "#{bold}#{cyan}Available Scrolls:#{clear} " + RailsWizard::Scrolls.list.join(', ')
|
61
62
|
puts
|
62
63
|
end
|
63
64
|
|
64
|
-
def run_template(name,
|
65
|
+
def run_template(name, scrolls, display_only = false)
|
65
66
|
puts
|
66
67
|
puts
|
67
68
|
puts "#{bold}Generating and Running Template..."
|
68
69
|
puts
|
69
70
|
file = Tempfile.new('template')
|
70
|
-
template = RailsWizard::Template.new(
|
71
|
+
template = RailsWizard::Template.new(scrolls)
|
71
72
|
file.write template.compile
|
72
73
|
file.close
|
73
|
-
|
74
|
+
if display_only
|
75
|
+
puts "Template stored to #{file.path}"
|
76
|
+
puts File.read(file.path)
|
77
|
+
else
|
78
|
+
system "rails new #{name} -m #{file.path} #{template.args.join(' ')}"
|
79
|
+
end
|
74
80
|
ensure
|
75
81
|
file.unlink
|
76
82
|
end
|
data/lib/rails_wizard/config.rb
CHANGED
@@ -41,7 +41,7 @@ module RailsWizard
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def conditions
|
44
|
-
[config_conditions,
|
44
|
+
[config_conditions, scroll_conditions].join(' && ')
|
45
45
|
end
|
46
46
|
|
47
47
|
def config_conditions
|
@@ -54,11 +54,11 @@ module RailsWizard
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
def
|
58
|
-
if details['
|
59
|
-
"
|
60
|
-
elsif details['
|
61
|
-
"!
|
57
|
+
def scroll_conditions
|
58
|
+
if details['if_scroll']
|
59
|
+
"scroll?('#{details['if_scroll']}')"
|
60
|
+
elsif details['unless_scroll']
|
61
|
+
"!scroll?('#{details['unless_scroll']}')"
|
62
62
|
else
|
63
63
|
'true'
|
64
64
|
end
|
@@ -5,7 +5,7 @@ require 'yaml'
|
|
5
5
|
require 'erb'
|
6
6
|
|
7
7
|
module RailsWizard
|
8
|
-
class
|
8
|
+
class Scroll
|
9
9
|
extend Comparable
|
10
10
|
|
11
11
|
def self.<=>(another)
|
@@ -28,7 +28,7 @@ module RailsWizard
|
|
28
28
|
if template_or_file.respond_to?(:read)
|
29
29
|
file = template_or_file.read
|
30
30
|
parts = file.split(/^__END__$/)
|
31
|
-
raise ArgumentError, "The
|
31
|
+
raise ArgumentError, "The scroll file must have YAML matter after an __END__" unless parts.size == 2
|
32
32
|
template = parts.first.strip
|
33
33
|
attributes = YAML.load(parts.last).inject({}) do |h,(k,v)|
|
34
34
|
h[k.to_sym] = v
|
@@ -38,12 +38,12 @@ module RailsWizard
|
|
38
38
|
template = template_or_file
|
39
39
|
end
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
scroll_class = Class.new(RailsWizard::Scroll)
|
42
|
+
scroll_class.attributes = attributes
|
43
|
+
scroll_class.template = template
|
44
|
+
scroll_class.key = key
|
45
45
|
|
46
|
-
|
46
|
+
scroll_class
|
47
47
|
end
|
48
48
|
|
49
49
|
ATTRIBUTES.each do |setter|
|
@@ -81,7 +81,7 @@ module RailsWizard
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def self.compile
|
84
|
-
"# >#{"[ #{name} ]".center(75,'-')}<\n\n# #{description}\
|
84
|
+
"# >#{"[ #{name} ]".center(75,'-')}<\n\n# #{description}\nsay_scroll '#{name}'\n\n#{template}\n"
|
85
85
|
end
|
86
86
|
def compile; self.class.compile end
|
87
87
|
|
@@ -95,8 +95,8 @@ module RailsWizard
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def self.from_mongo(key)
|
98
|
-
return key if key.respond_to?(:superclass) && key.superclass == RailsWizard::
|
99
|
-
RailsWizard::
|
98
|
+
return key if key.respond_to?(:superclass) && key.superclass == RailsWizard::Scroll
|
99
|
+
RailsWizard::Scrolls[key]
|
100
100
|
end
|
101
101
|
|
102
102
|
def self.get_binding
|
@@ -1,14 +1,14 @@
|
|
1
1
|
module RailsWizard
|
2
|
-
module
|
2
|
+
module Scrolls
|
3
3
|
@@categories = {}
|
4
4
|
@@list = {}
|
5
5
|
|
6
|
-
def self.add(
|
7
|
-
RailsWizard::
|
8
|
-
@@list[
|
9
|
-
(@@categories[
|
10
|
-
@@categories[
|
11
|
-
|
6
|
+
def self.add(scroll)
|
7
|
+
RailsWizard::Scrolls.const_set ActiveSupport::Inflector.camelize(scroll.key), scroll
|
8
|
+
@@list[scroll.key] = scroll
|
9
|
+
(@@categories[scroll.category.to_s] ||= []) << scroll.key
|
10
|
+
@@categories[scroll.category.to_s].uniq!
|
11
|
+
scroll
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.[](key)
|
@@ -31,8 +31,8 @@ module RailsWizard
|
|
31
31
|
(@@categories[category.to_s] || []).sort
|
32
32
|
end
|
33
33
|
|
34
|
-
def self.remove_from_category(category,
|
35
|
-
(@@categories[category.to_s] ||= []).delete(
|
34
|
+
def self.remove_from_category(category, scroll)
|
35
|
+
(@@categories[category.to_s] ||= []).delete(scroll.key)
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
module RailsWizard
|
2
2
|
class Template
|
3
|
-
attr_reader :
|
3
|
+
attr_reader :scrolls, :unknown_scroll_names
|
4
4
|
|
5
|
-
def initialize(
|
6
|
-
@
|
7
|
-
@
|
8
|
-
|
9
|
-
if
|
10
|
-
list <<
|
5
|
+
def initialize(scrolls)
|
6
|
+
@unknown_scroll_names = []
|
7
|
+
@scrolls = scrolls.inject([]) do |list, name|
|
8
|
+
scroll = RailsWizard::Scroll.from_mongo(name)
|
9
|
+
if scroll
|
10
|
+
list << scroll
|
11
11
|
else
|
12
|
-
@
|
13
|
-
$stderr.puts "Unknown
|
12
|
+
@unknown_scroll_names << name
|
13
|
+
$stderr.puts "Unknown scroll '#{name}'. Skipping."
|
14
14
|
end
|
15
15
|
list
|
16
16
|
end
|
@@ -27,30 +27,30 @@ module RailsWizard
|
|
27
27
|
def render(template_name, binding = nil); self.class.render(template_name, binding) end
|
28
28
|
|
29
29
|
|
30
|
-
def
|
31
|
-
@
|
30
|
+
def resolve_scrolls
|
31
|
+
@resolve_scrolls ||= scrolls_with_dependencies.sort
|
32
32
|
end
|
33
33
|
|
34
|
-
def
|
35
|
-
@
|
34
|
+
def scroll_classes
|
35
|
+
@scroll_classes ||= scrolls.map { |name| RailsWizard::Scroll.from_mongo(name) }
|
36
36
|
end
|
37
37
|
|
38
|
-
def
|
39
|
-
@
|
38
|
+
def scrolls_with_dependencies
|
39
|
+
@scrolls_with_dependencies ||= scroll_classes
|
40
40
|
|
41
41
|
added_more = false
|
42
|
-
for
|
43
|
-
|
44
|
-
requirement = RailsWizard::
|
45
|
-
count = @
|
46
|
-
(@
|
47
|
-
unless @
|
42
|
+
for scroll in scroll_classes
|
43
|
+
scroll.requires.each do |requirement|
|
44
|
+
requirement = RailsWizard::Scroll.from_mongo(requirement)
|
45
|
+
count = @scrolls_with_dependencies.size
|
46
|
+
(@scrolls_with_dependencies << requirement).uniq!
|
47
|
+
unless @scrolls_with_dependencies.size == count
|
48
48
|
added_more = true
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
-
added_more ?
|
53
|
+
added_more ? scrolls_with_dependencies : @scrolls_with_dependencies
|
54
54
|
end
|
55
55
|
|
56
56
|
def compile
|
@@ -58,7 +58,7 @@ module RailsWizard
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def args
|
61
|
-
|
61
|
+
scrolls.map(&:args).uniq
|
62
62
|
end
|
63
63
|
|
64
64
|
def custom_code?; false end
|