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.
Files changed (3) hide show
  1. data/app/lib/application.rb.erb +2 -2
  2. data/bin/waves +18 -1
  3. metadata +1 -1
@@ -1,5 +1,5 @@
1
- require 'layers/orm/sequel'
1
+ <%= @orm_require %>
2
2
  module <%= @name %>
3
3
  include Waves::Foundations::Default
4
- include Waves::Layers::ORM::Sequel
4
+ <%= @orm_include %>
5
5
  end
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dyoder-waves
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.6
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Yoder