Class: MG

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/mg.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gemspec) ⇒ MG

Returns a new instance of MG.



8
9
10
11
12
# File 'lib/mg.rb', line 8

def initialize(gemspec)
  @gemspec = gemspec

  define_tasks
end

Instance Attribute Details

#gemspecObject

Returns the value of attribute gemspec.



6
7
8
# File 'lib/mg.rb', line 6

def gemspec
  @gemspec
end

Instance Method Details

#groupObject



18
19
20
# File 'lib/mg.rb', line 18

def group
  spec.rubyforge_project
end

#nameObject



14
15
16
# File 'lib/mg.rb', line 14

def name
  spec.name
end

#specObject

Load the gemspec using the same limitations as github



23
24
25
26
27
28
29
30
31
# File 'lib/mg.rb', line 23

def spec
  @spec ||= begin
    require "rubygems/specification"
    data = File.read(gemspec)
    spec = nil
    Thread.new { spec = eval("$SAFE = 3\n#{data}") }.join
    spec
  end
end