dyoder-waves 0.7.6 → 0.7.7
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/app/lib/application.rb.erb +2 -2
- data/bin/waves +18 -1
- metadata +1 -1
data/app/lib/application.rb.erb
CHANGED
data/bin/waves
CHANGED
@@ -21,6 +21,23 @@ Choice.options do
|
|
21
21
|
desc 'Show this message'
|
22
22
|
end
|
23
23
|
|
24
|
+
option :orm do
|
25
|
+
short '-o'
|
26
|
+
long '--orm=ORM'
|
27
|
+
desc "Select an ORM (e.g. active_record, sequel, none)"
|
28
|
+
default "sequel"
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
orm = Choice.choices.orm.snake_case
|
34
|
+
orm_require, orm_include = case orm
|
35
|
+
when 'sequel'
|
36
|
+
["require 'layers/orm/sequel'", "include Waves::Layers::ORM::Sequel"]
|
37
|
+
when 'active_record'
|
38
|
+
["require 'layers/orm/active_record'", "include Waves::Layers::ORM::ActiveRecord"]
|
39
|
+
when 'none'
|
40
|
+
['', '# This app was generated without an ORM layer']
|
24
41
|
end
|
25
42
|
|
26
43
|
app_path = ARGV[0]
|
@@ -37,7 +54,7 @@ template = "#{WAVES}/app"
|
|
37
54
|
generator = Rakegen.new("waves:app") do |gen|
|
38
55
|
gen.source = template
|
39
56
|
gen.target = app_path
|
40
|
-
gen.template_assigns = {:name => app_name.camel_case}
|
57
|
+
gen.template_assigns = {:name => app_name.camel_case, :orm_require => orm_require, :orm_include => orm_include }
|
41
58
|
gen.executables = %w{ bin/waves-console bin/waves-server}
|
42
59
|
end
|
43
60
|
|