Module: Astromapper

Defined in:
lib/astromapper.rb,
lib/astromapper/cli.rb,
lib/astromapper/svg.rb,
lib/astromapper/builder.rb,
lib/astromapper/version.rb,
lib/astromapper/exporter.rb,
lib/astromapper/generator.rb,
lib/astromapper/builder/star.rb,
lib/astromapper/builder/orbit.rb,
lib/astromapper/builder/sector.rb,
lib/astromapper/builder/volume.rb

Defined Under Namespace

Modules: Builder Classes: Cli, Exporter, Generator, Svg

Constant Summary collapse

VERSION =
"1.0.2"

Class Method Summary collapse

Class Method Details

.config(root_dir = nil) ⇒ Object



28
29
30
31
32
33
34
35
36
37
# File 'lib/astromapper.rb', line 28

def self.config(root_dir = nil)
  root_dir ||= Pathname.new(Dir.pwd)
  path = root_dir.join("_astromapper.yml")

  raise "Invalid Bookmaker directory; couldn't found #{path} file." unless File.file?(path)
  content = File.read(path)
  erb = ERB.new(content).result

  YAML.load(erb)#.with_indifferent_access
end

.loggerObject



51
52
53
# File 'lib/astromapper.rb', line 51

def self.logger
   @logger ||= Logger.new(File.open("/tmp/astromapper.log", "a"))
end

.names(root_dir = nil) ⇒ Object



41
42
43
44
45
46
47
48
49
50
# File 'lib/astromapper.rb', line 41

def self.names(root_dir = nil)
  root_dir ||= Pathname.new(Dir.pwd)
  path = root_dir.join("templates/names.yml")

  raise "Invalid Bookmaker directory; couldn't found #{path} file." unless File.file?(path)
  content = File.read(path)
  erb = ERB.new(content).result

  @names = YAML.load(erb)#.with_indifferent_access
end

.output_file(ext = "txt") ⇒ Object



38
39
40
# File 'lib/astromapper.rb', line 38

def self.output_file(ext="txt")
  "output/#{config['name'].to_permalink}.#{ext}"
end