class Ramix::Template
Constants
- ATTRIBUTE
- DIR_PATH
- SELF_ATTRIBUTE
- THOR_CLASS_OPTION
Public Class Methods
new(name, path = nil)
click to toggle source
# File lib/ramix/template.rb, line 11 def initialize(name, path = nil) @name = name @path = path || DIR_PATH begin draft, attribute, @output = File.read( File.join(@path, name + '.rb') ).split('---') @attribute = YAML.load(attribute) rescue @attribute, @output = {}, "\n\ngem '#{name}'" end end
Public Instance Methods
name()
click to toggle source
# File lib/ramix/template.rb, line 22 def name @attribute['name'] || @name end
order()
click to toggle source
# File lib/ramix/template.rb, line 26 def order @attribute['order'] || 0 end
output(*args)
click to toggle source
# File lib/ramix/template.rb, line 38 def output(*args) <<-OUTPUT instance_variable_set '@#{name}', #{args.dup.pop.inspect} #{@output} OUTPUT end