Class: GemRelease::GemspecTemplate
- Defined in:
- lib/gem_release/gemspec_template.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#homepage ⇒ Object
readonly
Returns the value of attribute homepage.
-
#strategy ⇒ Object
readonly
Returns the value of attribute strategy.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
Attributes inherited from Template
#module_names, #module_path, #name, #template
Instance Method Summary collapse
- #exists? ⇒ Boolean
- #filename ⇒ Object
- #files ⇒ Object
-
#initialize(options = {}) ⇒ GemspecTemplate
constructor
A new instance of GemspecTemplate.
Methods inherited from Template
Methods included from Helpers
#gem_filename, #gem_name, #gem_name_from_directory, #gem_version, #gemspec, #gemspec_dirs, #gemspec_filename, #github_token, #github_user, #in_bootstrapped_dir, #in_gemspec_dirs, #quiet?, #run_cmd, #user_email, #user_name
Constructor Details
#initialize(options = {}) ⇒ GemspecTemplate
Returns a new instance of GemspecTemplate.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/gem_release/gemspec_template.rb', line 5 def initialize( = {}) super('gemspec', ) @author ||= user_name @email ||= user_email @homepage ||= "https://github.com/#{github_user}/#{name}" || "[your github name]" @summary ||= 'TODO: summary' @description ||= 'TODO: description' @strategy = [:strategy] end |
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author.
3 4 5 |
# File 'lib/gem_release/gemspec_template.rb', line 3 def @author end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/gem_release/gemspec_template.rb', line 3 def description @description end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
3 4 5 |
# File 'lib/gem_release/gemspec_template.rb', line 3 def email @email end |
#homepage ⇒ Object (readonly)
Returns the value of attribute homepage.
3 4 5 |
# File 'lib/gem_release/gemspec_template.rb', line 3 def homepage @homepage end |
#strategy ⇒ Object (readonly)
Returns the value of attribute strategy.
3 4 5 |
# File 'lib/gem_release/gemspec_template.rb', line 3 def strategy @strategy end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
3 4 5 |
# File 'lib/gem_release/gemspec_template.rb', line 3 def summary @summary end |
Instance Method Details
#exists? ⇒ Boolean
27 28 29 |
# File 'lib/gem_release/gemspec_template.rb', line 27 def exists? File.exists?(filename) end |
#filename ⇒ Object
31 32 33 |
# File 'lib/gem_release/gemspec_template.rb', line 31 def filename "#{name}.gemspec" end |
#files ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/gem_release/gemspec_template.rb', line 18 def files case strategy when 'git' '`git ls-files app lib`.split("\n")' else 'Dir.glob("{lib/**/*,[A-Z]*}")' end end |