Class: RSGem::Context
- Inherits:
-
Object
- Object
- RSGem::Context
- Defined in:
- lib/rsgem/context.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #bundler_options ⇒ Object
- #ci_provider ⇒ Object
- #folder_path ⇒ Object
- #gem_name ⇒ Object
- #gemfile_path ⇒ Object
- #gemspec_path ⇒ Object
- #gitignore_path ⇒ Object
-
#initialize(options:) ⇒ Context
constructor
A new instance of Context.
- #license_path ⇒ Object
- #rakefile_path ⇒ Object
- #spec_helper_path ⇒ Object
Constructor Details
#initialize(options:) ⇒ Context
Returns a new instance of Context.
7 8 9 10 11 |
# File 'lib/rsgem/context.rb', line 7 def initialize(options:) @options = raise Errors::MissingGemName unless [:gem_name] end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/rsgem/context.rb', line 5 def @options end |
Instance Method Details
#bundler_options ⇒ Object
13 14 15 |
# File 'lib/rsgem/context.rb', line 13 def @bundler_options ||= [:bundler_options] end |
#ci_provider ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rsgem/context.rb', line 17 def ci_provider @ci_provider ||= begin if (name = [:ci_provider]) RSGem::Constants::CI_PROVIDERS.detect do |provider| provider.name == name end else RSGem::Constants::DEFAULT_CI_PROVIDER end end end |
#folder_path ⇒ Object
45 46 47 |
# File 'lib/rsgem/context.rb', line 45 def folder_path `pwd`.sub("\n", '/') + gem_name end |
#gem_name ⇒ Object
33 34 35 |
# File 'lib/rsgem/context.rb', line 33 def gem_name @gem_name ||= [:gem_name] end |
#gemfile_path ⇒ Object
29 30 31 |
# File 'lib/rsgem/context.rb', line 29 def gemfile_path "#{folder_path}/Gemfile" end |
#gemspec_path ⇒ Object
37 38 39 |
# File 'lib/rsgem/context.rb', line 37 def gemspec_path "#{folder_path}/#{gem_name}.gemspec" end |
#gitignore_path ⇒ Object
49 50 51 |
# File 'lib/rsgem/context.rb', line 49 def gitignore_path "#{folder_path}/.gitignore" end |
#license_path ⇒ Object
41 42 43 |
# File 'lib/rsgem/context.rb', line 41 def license_path "#{folder_path}/LICENSE.txt" end |
#rakefile_path ⇒ Object
53 54 55 |
# File 'lib/rsgem/context.rb', line 53 def rakefile_path "#{folder_path}/Rakefile" end |
#spec_helper_path ⇒ Object
57 58 59 |
# File 'lib/rsgem/context.rb', line 57 def spec_helper_path "#{folder_path}/spec/spec_helper.rb" end |