Class: Overapp::Project
- Includes:
- FromHash
- Defined in:
- lib/overapp/project.rb,
lib/overapp/project/write.rb
Defined Under Namespace
Classes: Write
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
- #combined_files ⇒ Object
- #overapp_entries ⇒ Object
- #overapps ⇒ Object
- #write_to!(output_path) ⇒ Object
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
4 5 6 |
# File 'lib/overapp/project.rb', line 4 def path @path end |
Class Method Details
.load(*args) ⇒ Object
17 18 19 |
# File 'lib/overapp/project.rb', line 17 def load(*args) new(*args) end |
.project?(path) ⇒ Boolean
12 13 14 15 |
# File 'lib/overapp/project.rb', line 12 def project?(path) raise "checking for project, path doesn't exist #{path}" unless FileTest.exist?(path) !!project_files.map { |x| "#{path}/#{x}" }.find { |x| FileTest.exist?(x) } end |
.project_files ⇒ Object
8 9 10 |
# File 'lib/overapp/project.rb', line 8 def project_files %w(.fstemplate .overapp .overlay) end |
Instance Method Details
#combined_files ⇒ Object
66 67 68 |
# File 'lib/overapp/project.rb', line 66 def combined_files Write.new(:project => self).combined_files end |
#overapp_entries ⇒ Object
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/overapp/project.rb', line 38 def overapp_entries res = config.overapps local = config.overapps.find { |x| ['.',:self,path].include?(x.descriptor) } if local local.descriptor = path res else res + [ConfigEntry.new(:descriptor => path)] end end |
#overapps ⇒ Object
52 53 54 55 56 57 58 59 60 |
# File 'lib/overapp/project.rb', line 52 def overapps overapp_entries.map do |entry| if path == entry.descriptor load_raw_dir_class.new(:descriptor => path) else load_factory_class.new(:descriptor => entry.descriptor, :type => entry.type, :entry_ops => entry.entry_ops).loader end end end |