Class: Daiku::Plugins::Datamapper::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/daiku/plugins/datamapper/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
12 13 14 |
# File 'lib/daiku/plugins/datamapper/cli.rb', line 12 def self.source_root File.('../', __FILE__) end |
Instance Method Details
#bootrb ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/daiku/plugins/datamapper/cli.rb', line 16 def bootrb insert_into_file "#{app}/lib/boot.rb", :after => "#models\n" do <<-DMREQ.strip_heredoc require File.join($app_root, 'config/datamapper') # require models here DataMapper.finalize DMREQ end end |
#config ⇒ Object
26 27 28 |
# File 'lib/daiku/plugins/datamapper/cli.rb', line 26 def config template('_templates/datamapper.rb.tt', "#{app}/config/datamapper.rb") end |
#gemfile ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/daiku/plugins/datamapper/cli.rb', line 30 def gemfile content = <<-DMGEMS.strip_heredoc group :datamapper do gem 'dm-aspects' gem 'dm-aggregates' gem 'dm-core' gem 'dm-migrations' gem 'dm-pager' gem 'dm-postgres-adapter' gem 'dm-postgres-types' gem 'dm-timestamps' gem 'dm-transactions' gem 'dm-validations' end DMGEMS append_to_file "#{app}/Gemfile", content end |