Class: Required
- Inherits:
-
Object
- Object
- Required
- Defined in:
- lib/require-dsl.rb
Instance Attribute Summary collapse
-
#location ⇒ Object
Returns the value of attribute location.
-
#stdout ⇒ Object
Returns the value of attribute stdout.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(base_path, path) ⇒ Required
constructor
A new instance of Required.
Constructor Details
#initialize(base_path, path) ⇒ Required
Returns a new instance of Required.
26 27 28 29 |
# File 'lib/require-dsl.rb', line 26 def initialize base_path, path rel_path = relative_path(base_path, path) @location = File.dirname(rel_path) end |
Instance Attribute Details
#location ⇒ Object
Returns the value of attribute location.
24 25 26 |
# File 'lib/require-dsl.rb', line 24 def location @location end |
#stdout ⇒ Object
Returns the value of attribute stdout.
24 25 26 |
# File 'lib/require-dsl.rb', line 24 def stdout @stdout end |
Class Method Details
.extend_files(files, required) ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'lib/require-dsl.rb', line 42 def self.extend_files files, required files.extend(FileListExtension).required = required files.map! do |f| f.extend(FileString) f.required = required f end files end |
.glob(options) ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/require-dsl.rb', line 31 def self.glob case [:recursive] when :full '**/*.rb' when :single ['*/*.rb', '*.rb'] else '*.rb' end end |