Sha256: 7a8c6e5e44423f0d368a6722b00169e713424900e9a494169bef64f4cefd90c3

Contents?: true

Size: 1.28 KB

Versions: 4

Compression:

Stored size: 1.28 KB

Contents

# frozen_string_literal: true

# BDD for Ruby
#
# exe/rag addons/rspec

# NOTE: Currently not implemented fully

self.local_template_path = File.dirname(__FILE__)

gac 'base rails 7 image created'

prepare_environment

after_bundle do
  create_db
  scaffolds
  setup_customizations
  migrate_db
end

def scaffolds
  # add_scaffold('post', 'title', 'body:text', 'user:references')
  # add_scaffold('people', 'first_name', 'last_name', 'age:integer', 'address:text')
  # add_scaffold('product', 'name', 'price:integer')
end

def setup_customizations
  route("root 'home#index'")

  force_copy
  
  add_controller('home', 'index')
  
  directory "app/controllers"
  directory "app/models"
  directory "app/views"
  template  'app/views/layouts/application.html.erb'        , 'app/views/layouts/application.html.erb'
  directory "app/services"
end

def create_db
  # uncomment this if you need custom configuration in database.yml
  # gsub_file('config/database.yml', '  encoding: unicode', db_development_settings)
  db(drop: true, create: true)
end

def migrate_db
  template  'db/seeds.rb'                                   , 'db/seeds.rb'

  db(migrate: true, seed: true)
end

def db_development_settings
  <<-'RUBY'
  encoding: unicode
  host: 127.0.0.1
  username: printspeak
  password: printspeak
  RUBY
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_app_generator-0.3.6 after_templates/addons/rspec/_.rb
rails_app_generator-0.3.5 after_templates/addons/rspec/_.rb
rails_app_generator-0.3.4 after_templates/addons/rspec/_.rb
rails_app_generator-0.3.3 after_templates/addons/rspec/_.rb