Class: Andy::Pint
- Inherits:
-
Object
- Object
- Andy::Pint
- Defined in:
- lib/andy/pint.rb
Instance Method Summary collapse
- #author ⇒ Object
- #description ⇒ Object
- #generated_files ⇒ Object
-
#initialize(location) ⇒ Pint
constructor
A new instance of Pint.
- #location ⇒ Object
- #long_name ⇒ Object
- #name ⇒ Object
- #remote ⇒ Object
- #source_files ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(location) ⇒ Pint
Returns a new instance of Pint.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/andy/pint.rb', line 10 def initialize(location) @location = location begin config = YAML.load_file("#{location}/pint.yml") rescue raise UnknownPintException.new end pint_config = Andy::NestedOStruct.new config @my_config = pint_config.pint end |
Instance Method Details
#author ⇒ Object
37 38 39 |
# File 'lib/andy/pint.rb', line 37 def @my_config. end |
#description ⇒ Object
29 30 31 |
# File 'lib/andy/pint.rb', line 29 def description @my_config.description end |
#generated_files ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/andy/pint.rb', line 49 def generated_files my_files = [] Dir.glob("#{@location}/**/*").each do |file_name| file = File.new(file_name) if (! File.directory?(file_name)) path_name = Pathname.new(file_name).relative_path_from(Pathname.new(@location)).to_s generated_file_name = path_name.end_with?('.erb') ? path_name[0..-5] : path_name my_files << generated_file_name unless generated_file_name == 'pint.yml' end end my_files end |
#location ⇒ Object
45 46 47 |
# File 'lib/andy/pint.rb', line 45 def location @location end |
#long_name ⇒ Object
25 26 27 |
# File 'lib/andy/pint.rb', line 25 def long_name @my_config.long_name end |
#name ⇒ Object
21 22 23 |
# File 'lib/andy/pint.rb', line 21 def name @my_config.name end |
#remote ⇒ Object
41 42 43 |
# File 'lib/andy/pint.rb', line 41 def remote @my_config.remote end |
#source_files ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/andy/pint.rb', line 62 def source_files my_files = [] Dir.glob("#{@location}/**/*").each do |file_name| file = File.new(file_name) if (! File.directory?(file_name)) path_name = Pathname.new(file_name).relative_path_from(Pathname.new(@location)).to_s my_files << path_name unless path_name == 'pint.yml' end end my_files end |
#version ⇒ Object
33 34 35 |
# File 'lib/andy/pint.rb', line 33 def version @my_config.version end |