Module: Utilrb::Rake

Defined in:
lib/utilrb/rake_common.rb

Class Method Summary collapse

Class Method Details

.hoeObject


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/utilrb/rake_common.rb', line 3

def self.hoe
    require 'hoe'
    yield

rescue LoadError => e
    STDERR.puts "INFO: cannot load the Hoe gem. Distribution is disabled"
    STDERR.puts "INFO: error message is: #{e.message}"
    if ::Rake.application.options.trace
        puts e.backtrace.join("\n  ")
    end
rescue Exception => e
    STDERR.puts "INFO: cannot load the Hoe gem, or Hoe fails. Distribution is disabled"
    STDERR.puts "INFO: error message is: #{e.message}"
    if ::Rake.application.options.trace
        puts e.backtrace.join("\n  ")
    end
end

.rdocObject


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/utilrb/rake_common.rb', line 21

def self.rdoc
    require 'rdoc/task'
    yield

rescue LoadError => e
    STDERR.puts "INFO: cannot load RDoc, Documentation generation is disabled"
    STDERR.puts "INFO: error message is: #{e.message}"
    if ::Rake.application.options.trace
        puts e.backtrace.join("\n  ")
    end
rescue Exception => e
    STDERR.puts "INFO: cannot load the RDoc gem, or RDoc failed to load. Documentation generation is disabled"
    STDERR.puts "INFO: error message is: #{e.message}"
    if ::Rake.application.options.trace
        puts e.backtrace.join("\n  ")
    end
end