class Astromapper::Builder::Base
Attributes
root_dir[RW]
Public Class Methods
constitute(root_dir)
click to toggle source
# File lib/astromapper/builder.rb, line 13 def self.constitute(root_dir) new(root_dir).constitute end
new(root_dir)
click to toggle source
# File lib/astromapper/builder.rb, line 16 def initialize(root_dir) @root_dir = Pathname.new(root_dir) end
Public Instance Methods
config()
click to toggle source
# File lib/astromapper/builder.rb, line 20 def config Astromapper.config(root_dir) end
names()
click to toggle source
# File lib/astromapper/builder.rb, line 27 def names Astromapper.names end
spawn_command(cmd)
click to toggle source
# File lib/astromapper/builder.rb, line 31 def spawn_command(cmd) begin stdout_and_stderr, status = Open3.capture2e(*cmd) rescue Errno::ENOENT => e puts e.message else puts stdout_and_stderr unless status.success? status.success? end end
toss(a=2,b=2)
click to toggle source
# File lib/astromapper/builder.rb, line 23 def toss(a=2,b=2) (a.d6 - b).whole # (@@dice.roll(a) - b).whole end