Class: Hatate::AppBuilder

Inherits:
Rails::AppBuilder
  • Object
show all
Defined in:
lib/hatate/app_builder.rb

Instance Method Summary collapse

Instance Method Details

#database_configObject



16
17
18
19
20
21
22
# File 'lib/hatate/app_builder.rb', line 16

def database_config
  inject_into_file(
    "config/database.yml",
    postgres_test_config,
    after: "database: #{app_name}_test"
  )
end

#dependenciesObject



24
25
26
27
28
# File 'lib/hatate/app_builder.rb', line 24

def dependencies
  bundle_command "install"
  bundle_command "lock --add-platform x86_64-linux"
  rails_command "tailwindcss:install"
end

#gemfileObject



7
8
9
# File 'lib/hatate/app_builder.rb', line 7

def gemfile
  template "Gemfile.erb", "Gemfile"
end

#github_actionsObject



30
31
32
33
# File 'lib/hatate/app_builder.rb', line 30

def github_actions
  template "lint.yml", ".github/workflows/lint.yml"
  template "test.yml", ".github/workflows/test.yml"
end

#leftoversObject



11
12
13
14
# File 'lib/hatate/app_builder.rb', line 11

def leftovers
  bundle_command "exec standardrb --fix-unsafely"
  initial_commit
end

#readmeObject



3
4
5
# File 'lib/hatate/app_builder.rb', line 3

def readme
  template "README.md.erb", "README.md"
end

#ruby_versionObject



46
47
48
# File 'lib/hatate/app_builder.rb', line 46

def ruby_version
  create_file ".ruby-version", "#{Hatate::RUBY_VERSION}\n"
end

#test_helpersObject



35
36
37
38
39
40
41
42
43
44
# File 'lib/hatate/app_builder.rb', line 35

def test_helpers
  template "spec/.rspec", ".rspec"
  template "spec/spec_helper.rb", "spec/spec_helper.rb"
  template "spec/rails_helper.rb", "spec/rails_helper.rb"
  template "spec/support/cuprite.rb", "spec/support/cuprite.rb"
  template "spec/support/system.rb", "spec/support/system.rb"
  template "spec/support/factory_bot.rb", "spec/support/factory_bot.rb"
  template "spec/support/freeze_time.rb", "spec/support/freeze_time.rb"
  template "spec/support/i18n.rb", "spec/support/i18n.rb"
end