Class: Jobshop::AppBuilder

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

Direct Known Subclasses

CanaryBuilder

Instance Method Summary collapse

Instance Method Details

#config_schema_formatObject



23
24
25
26
27
28
29
30
# File 'lib/generators/jobshop/app/app_generator.rb', line 23

def config_schema_format
  return if options[:pretend]

  data = "config.active_record.schema_format = :sql"
  sentinel = /class [a-z_:]+ < Rails::Application/i
  inject_into_file("config/application.rb", "\n    #{data}",
                   after: sentinel, verbose: true)
end

#gemfileObject



16
17
18
19
20
21
# File 'lib/generators/jobshop/app/app_generator.rb', line 16

def gemfile
  super
  append_to_file "Gemfile", <<~GEMFILE
    \ngem "jobshop", "~> #{Jobshop.gem_version}"
  GEMFILE
end

#mount_engineObject



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

def mount_engine
  return if options[:pretend]

  route %Q(mount Jobshop::Engine => "/")
end

#procfileObject



12
13
14
# File 'lib/generators/jobshop/app/app_generator.rb', line 12

def procfile
  template "Procfile"
end

#readmeObject



8
9
10
# File 'lib/generators/jobshop/app/app_generator.rb', line 8

def readme
  template "README.md.tt"
end