Module: Staticz::Compilable
Instance Method Summary collapse
- #build_path ⇒ Object
- #create_link_function ⇒ Object
- #exists? ⇒ Boolean
- #path ⇒ Object
- #path_method_name ⇒ Object
- #print(indentation) ⇒ Object
- #source_path ⇒ Object
- #valid ⇒ Object
Instance Method Details
#build_path ⇒ Object
11 12 13 |
# File 'lib/manifest/compilable.rb', line 11 def build_path "build/#{name}.#{build_file_ending}" end |
#create_link_function ⇒ Object
31 32 33 34 |
# File 'lib/manifest/compilable.rb', line 31 def create_link_function link_path = "#{name}.#{build_file_ending}" Object.send(:define_method, path_method_name) { link_path } end |
#exists? ⇒ Boolean
15 16 17 |
# File 'lib/manifest/compilable.rb', line 15 def exists? File.exist? source_path end |
#path ⇒ Object
3 4 5 |
# File 'lib/manifest/compilable.rb', line 3 def path name.to_s end |
#path_method_name ⇒ Object
19 20 21 |
# File 'lib/manifest/compilable.rb', line 19 def path_method_name "#{path.gsub(/[\/-]/, "_")}_path" end |
#print(indentation) ⇒ Object
36 37 38 |
# File 'lib/manifest/compilable.rb', line 36 def print(indentation) puts "#{" " * (indentation * 3)}└─ #{tile_type_name}: #{path} #{valid} -> #{path_method_name}" end |
#source_path ⇒ Object
7 8 9 |
# File 'lib/manifest/compilable.rb', line 7 def source_path "src/#{name}.#{source_file_ending}" end |