Class: RTask::Spec

Inherits:
Gem::Specification
  • Object
show all
Defined in:
lib/rtask/spec.rb

Instance Method Summary collapse

Constructor Details

#initialize(gem_spec = ::Gem::Specification.new) ⇒ Spec

Returns a new instance of Spec.



5
6
7
# File 'lib/rtask/spec.rb', line 5

def initialize(gem_spec = ::Gem::Specification.new)
  super(gem_spec)
end

Instance Method Details

#arrayObject



30
31
32
# File 'lib/rtask/spec.rb', line 30

def array
  ::Gem::Specification.array_attributes
end

#attributesObject



9
10
11
# File 'lib/rtask/spec.rb', line 9

def attributes
  __getobj__.class.attribute_names
end

#bool_attributesObject Also known as: bool



13
14
15
# File 'lib/rtask/spec.rb', line 13

def bool_attributes
  [:has_rdoc]
end

#requiredObject



24
25
26
27
28
# File 'lib/rtask/spec.rb', line 24

def required
  ::Gem::Specification.attribute_names.each do |name|
    ::Gem::Specification.required_attribute?()
  end
end

#standardObject



17
18
19
20
21
22
# File 'lib/rtask/spec.rb', line 17

def standard
  __getobj__.class.required_attributes +
    [:authors, :email, :homepage, :rubyforge_project, :description,
     :has_rdoc, :dependencies ] -
    [:rubygems_version, :specification_version, :date, :require_paths]
end

#type_of(name) ⇒ Object



34
35
36
37
38
39
40
41
42
# File 'lib/rtask/spec.rb', line 34

def type_of(name)
  if array.include?(name)
    return :array
  elsif bool.include?(name)
    return :bool
  else
    return :string
  end
end