class Gutsy::Generator::GemState

Attributes

app_config[R]
app_name[R]
base_url[R]
description[R]

Public Class Methods

new(app_config) click to toggle source
# File lib/gutsy/generator/gem_state.rb, line 6
def initialize(app_config)
  @app_name = app_config[:name]
  @base_url = app_config[:base_url]
  @description = app_config[:description]
  @app_config = app_config
end

Public Instance Methods

api_versions() click to toggle source
# File lib/gutsy/generator/gem_state.rb, line 13
def api_versions
  @api_versions ||= app_config[:versions].map do |api_version_config|
    Gutsy::Generator::ApiVersionState.new(api_version_config, self)
  end
end
author() click to toggle source
# File lib/gutsy/generator/gem_state.rb, line 47
def author
  @author ||= OpenStruct.new(author_config)
end
gem_name() click to toggle source
# File lib/gutsy/generator/gem_state.rb, line 19
def gem_name
  @gem_name_snake ||= "#{app_name.underscore}_client"
end
gem_name_pascal() click to toggle source
# File lib/gutsy/generator/gem_state.rb, line 27
def gem_name_pascal
  @gem_name_pascal ||= gem_name.camelize(:upper)
end
gem_name_snake() click to toggle source
# File lib/gutsy/generator/gem_state.rb, line 23
def gem_name_snake
  gem_name
end
gem_version() click to toggle source
# File lib/gutsy/generator/gem_state.rb, line 31
def gem_version
  @gem_version ||= app_config[:gem_version] || '0.1.0'
end
repo_name() click to toggle source
# File lib/gutsy/generator/gem_state.rb, line 35
def repo_name
  app_config[:repo_name] || gem_name_snake
end
twine() click to toggle source
# File lib/gutsy/generator/gem_state.rb, line 51
def twine
  binding
end

Private Instance Methods

author_config() click to toggle source
# File lib/gutsy/generator/gem_state.rb, line 59
def author_config
  app_config[:author] || {
    name: "YOUR_NAME_HERE",
    email: "YOUR_EMAIL_ADDRESS",
    github: "GITHUB_USER"
  }
end