Class: GemRelease::Gemspec

Inherits:
Template show all
Defined in:
lib/gem_release/gemspec.rb

Instance Attribute Summary collapse

Attributes inherited from Template

#module_name, #module_path, #name, #options

Instance Method Summary collapse

Methods inherited from Template

#render, #template, #write

Methods included from Helpers

#gem_filename, #gem_module_name, #gem_module_path, #gem_name, #gem_name_from_directory, #gem_version, #gemspec, #gemspec_filename, #github_token, #github_user, #user_email, #user_name

Constructor Details

#initialize(options = {}) ⇒ Gemspec

Returns a new instance of Gemspec.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/gem_release/gemspec.rb', line 5

def initialize(options = {})
  super

  @authors     ||= [user_name]
  @email       ||= user_email
  @homepage    ||= "http://github.com/#{github_user}/#{name}" || "[your github name]"

  @summary     ||= '[summary]'
  @description ||= '[description]'
  @strategy = options[:strategy]
end

Instance Attribute Details

#authorsObject (readonly)

Returns the value of attribute authors.



3
4
5
# File 'lib/gem_release/gemspec.rb', line 3

def authors
  @authors
end

#descriptionObject (readonly)

Returns the value of attribute description.



3
4
5
# File 'lib/gem_release/gemspec.rb', line 3

def description
  @description
end

#emailObject (readonly)

Returns the value of attribute email.



3
4
5
# File 'lib/gem_release/gemspec.rb', line 3

def email
  @email
end

#homepageObject (readonly)

Returns the value of attribute homepage.



3
4
5
# File 'lib/gem_release/gemspec.rb', line 3

def homepage
  @homepage
end

#summaryObject (readonly)

Returns the value of attribute summary.



3
4
5
# File 'lib/gem_release/gemspec.rb', line 3

def summary
  @summary
end

Instance Method Details

#exists?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/gem_release/gemspec.rb', line 26

def exists?
  File.exists?(filename)
end

#filenameObject



30
31
32
# File 'lib/gem_release/gemspec.rb', line 30

def filename
  "#{name}.gemspec"
end

#filesObject



17
18
19
20
21
22
23
24
# File 'lib/gem_release/gemspec.rb', line 17

def files
  case @strategy
  when 'git'
    '`git ls-files app lib`.split("\n")'
  else
    'Dir.glob("lib/**/**")'
  end
end

#template_nameObject



34
35
36
# File 'lib/gem_release/gemspec.rb', line 34

def template_name
  'gemspec.erb'
end