Class: Gutsy::Generator::GemState
- Inherits:
-
Object
- Object
- Gutsy::Generator::GemState
- Defined in:
- lib/gutsy/generator/gem_state.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
readonly
Returns the value of attribute app_name.
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
Instance Method Summary collapse
- #api_versions ⇒ Object
- #author ⇒ Object
- #copyright_owner ⇒ Object
- #copyright_year ⇒ Object
- #gem_name ⇒ Object
- #gem_name_pascal ⇒ Object
- #gem_name_snake ⇒ Object
- #gem_version ⇒ Object
-
#initialize(app_config) ⇒ GemState
constructor
A new instance of GemState.
- #repo_name ⇒ Object
- #twine ⇒ Object
Constructor Details
#initialize(app_config) ⇒ GemState
Returns a new instance of GemState.
6 7 8 9 10 11 |
# 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 |
Instance Attribute Details
#app_name ⇒ Object (readonly)
Returns the value of attribute app_name.
4 5 6 |
# File 'lib/gutsy/generator/gem_state.rb', line 4 def app_name @app_name end |
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
4 5 6 |
# File 'lib/gutsy/generator/gem_state.rb', line 4 def base_url @base_url end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/gutsy/generator/gem_state.rb', line 4 def description @description end |
Instance Method Details
#api_versions ⇒ Object
13 14 15 16 17 |
# 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 ⇒ Object
47 48 49 |
# File 'lib/gutsy/generator/gem_state.rb', line 47 def @author ||= OpenStruct.new() end |
#copyright_owner ⇒ Object
43 44 45 |
# File 'lib/gutsy/generator/gem_state.rb', line 43 def copyright_owner @copyright_owner ||= .name end |
#copyright_year ⇒ Object
39 40 41 |
# File 'lib/gutsy/generator/gem_state.rb', line 39 def copyright_year @copyright_year ||= Time.now.year end |
#gem_name ⇒ Object
19 20 21 |
# File 'lib/gutsy/generator/gem_state.rb', line 19 def gem_name @gem_name_snake ||= "#{app_name.underscore}_client" end |
#gem_name_pascal ⇒ Object
27 28 29 |
# File 'lib/gutsy/generator/gem_state.rb', line 27 def gem_name_pascal @gem_name_pascal ||= gem_name.camelize(:upper) end |
#gem_name_snake ⇒ Object
23 24 25 |
# File 'lib/gutsy/generator/gem_state.rb', line 23 def gem_name_snake gem_name end |
#gem_version ⇒ Object
31 32 33 |
# File 'lib/gutsy/generator/gem_state.rb', line 31 def gem_version @gem_version ||= app_config[:gem_version] || '0.1.0' end |
#repo_name ⇒ Object
35 36 37 |
# File 'lib/gutsy/generator/gem_state.rb', line 35 def repo_name app_config[:repo_name] || gem_name_snake end |
#twine ⇒ Object
51 52 53 |
# File 'lib/gutsy/generator/gem_state.rb', line 51 def twine binding end |