module Rockstart::Generators::ClassOptionHelpers

Adds helpers for common class options used by rockstart

Public Instance Methods

all_class_options() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 12
def all_class_options
  auth0_class_option
  devise_class_option
  frontend_class_option
  memcached_class_option
  postgres_class_option
  pundit_class_option
  rollbar_class_option
  sidekiq_class_option
end
auth0_class_option() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 23
def auth0_class_option
  class_option :auth0, type: :boolean,
                       desc: "Include Auth0 support",
                       default: false
end
devise_class_option() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 29
def devise_class_option
  class_option :devise, type: :boolean,
                        desc: "Include Devise support",
                        default: true
end
frontend_class_option() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 35
def frontend_class_option
  class_option :frontend, type: :boolean,
                          desc: "Include frontend support",
                          default: true
end
memcached_class_option() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 41
def memcached_class_option
  class_option :memcached, type: :boolean,
                           desc: "Include Memcached support",
                           default: true
end
postgres_class_option() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 47
def postgres_class_option
  class_option :postgres, type: :boolean,
                          desc: "Include Postgres support",
                          default: Rockstart::Env.postgres_db?
end
pundit_class_option() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 53
def pundit_class_option
  class_option :pundit, type: :boolean,
                        desc: "Include Pundit support",
                        default: true
end
rollbar_class_option() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 59
def rollbar_class_option
  class_option :rollbar, type: :boolean,
                         desc: "Include Rollbar support",
                         default: true
end
sidekiq_class_option() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 65
def sidekiq_class_option
  class_option :sidekiq, type: :boolean,
                         desc: "Include Sidekiq support",
                         default: true
end

Protected Instance Methods

auth0?() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 88
def auth0?
  options.fetch(:auth0)
end
auth0_option() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 92
def auth0_option
  auth0? ? "--auth0" : "--no-auth0"
end
devise?() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 96
def devise?
  options.fetch(:devise)
end
devise_option() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 100
def devise_option
  devise? ? "--devise" : "--no-devise"
end
frontend?() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 104
def frontend?
  options.fetch(:frontend)
end
frontend_option() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 108
def frontend_option
  frontend? ? "--frontend" : "--no-frontend"
end
memcached?() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 112
def memcached?
  options.fetch(:memcached)
end
memcached_option() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 116
def memcached_option
  memcached? ? "--memcached" : "--no-memcached"
end
postgres?() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 120
def postgres?
  options.fetch(:postgres)
end
postgres_option() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 124
def postgres_option
  postgres? ? "--postgres" : "--no-postgres"
end
pundit?() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 128
def pundit?
  options.fetch(:pundit)
end
pundit_option() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 132
def pundit_option
  pundit? ? "--pundit" : "--no-pundit"
end
rollbar?() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 136
def rollbar?
  options.fetch(:rollbar)
end
rollbar_option() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 140
def rollbar_option
  rollbar? ? "--rollbar" : "--no-rollbar"
end
sidekiq?() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 144
def sidekiq?
  options.fetch(:sidekiq)
end
sidekiq_option() click to toggle source
# File lib/rockstart/generators/class_option_helpers.rb, line 148
def sidekiq_option
  sidekiq? ? "--sidekiq" : "--no-sidekiq"
end