Class: Disco::AppBuilder

Inherits:
Rails::AppBuilder
  • Object
show all
Defined in:
lib/generators/disco/app/app_generator.rb

Instance Method Summary collapse

Instance Method Details

#appObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/generators/disco/app/app_generator.rb', line 14

def app
  super
  copy_file 'app/controllers/event_source_controller.rb'
  copy_file 'app/controllers/concerns/event_source.rb'
  copy_file 'app/helpers/event_source_helper.rb'
  copy_file 'app/assets/javascripts/event_source.js'
  copy_file 'app/assets/stylesheets/event_source.css'
  keep_file 'app/commands'
  keep_file 'app/events'
  keep_file 'app/projections'
  keep_file 'app/validations'

  keep_file 'domain/command_processors/domain'
  keep_file 'domain/models/domain'
  keep_file 'domain/projections/domain'
  keep_file 'domain/validations/domain'
end

#binObject



32
33
34
35
36
# File 'lib/generators/disco/app/app_generator.rb', line 32

def bin
  super
  copy_file 'bin/disco'
  chmod 'bin/disco', 0755, verbose: false
end

#configObject



38
39
40
41
42
43
44
45
# File 'lib/generators/disco/app/app_generator.rb', line 38

def config
  super
  inside 'config/initializers' do
    template 'create_domain.rb'
    copy_file 'build_validations_registry.rb'
    copy_file 'event_source_server.rb'
  end
end

#database_ymlObject



47
48
49
50
# File 'lib/generators/disco/app/app_generator.rb', line 47

def database_yml
  super
  template 'config/disco.yml'
end

#dbObject



52
53
54
55
# File 'lib/generators/disco/app/app_generator.rb', line 52

def db
  super
  append_file 'db/seeds.rb', File.binread(File.expand_path('../templates/db/seeds.rb', __FILE__)) unless behavior == :revoke
end

#gemfileObject



6
7
8
9
10
11
12
# File 'lib/generators/disco/app/app_generator.rb', line 6

def gemfile
  super
  append_file 'Gemfile', "\n# Rails Disco support
gem 'rails-disco', '~> #{RailsDisco::VERSION::STRING}'\n
# Required Multithreaded Webserver
gem 'puma'\n" unless behavior == :revoke
end