class Cubic::Generator::Config

Config stores data needed throughout the generation process.

Public Class Methods

[](key) click to toggle source
# File lib/cubic/generators/config.rb, line 14
def [](key)
  all[key] || defaults(key)
end
all() click to toggle source
# File lib/cubic/generators/config.rb, line 10
def all
  @settings
end
css_type(type) click to toggle source
# File lib/cubic/generators/config.rb, line 45
def css_type(type)
  @settings[:css_type] = type || 'css'
end
db(db) click to toggle source
# File lib/cubic/generators/config.rb, line 36
def db(db)
  @settings[:db] = db || 'sqlite3'
end
defaults(name) click to toggle source

Default options.

# File lib/cubic/generators/config.rb, line 55
def defaults(name)
  { root_path: Dir.getwd,
    name: 'No Name',
    test_type: 'rspec',
    orm: 'Sequel',
    db: 'sqlite3',
    html_type: 'haml',
    css_type: 'css' }[name]
end
gems(gems) click to toggle source

Gems to be added to Gemfile

# File lib/cubic/generators/config.rb, line 50
def gems(gems)
  @settings[:gems] = gems
end
html_type(type) click to toggle source

Consider renaming to 'template engine'

# File lib/cubic/generators/config.rb, line 41
def html_type(type)
  @settings[:html_type] = type || 'haml'
end
name(name) click to toggle source

Name of the application

# File lib/cubic/generators/config.rb, line 23
def name(name)
  @settings[:name] = name
end
orm(orm) click to toggle source
# File lib/cubic/generators/config.rb, line 32
def orm(orm)
  @settings[:orm] = orm || 'Sequel'
end
root_path(path) click to toggle source
# File lib/cubic/generators/config.rb, line 18
def root_path(path)
  @settings[:root_path] = path
end
test_type(type) click to toggle source

Prefered testing framework.

# File lib/cubic/generators/config.rb, line 28
def test_type(type)
  @settings[:test_type] = type || 'Rspec'
end