Class: Licensee::Project
- Inherits:
-
Object
- Object
- Licensee::Project
- Defined in:
- lib/licensee/project.rb
Instance Attribute Summary collapse
-
#base_path ⇒ Object
readonly
Returns the value of attribute base_path.
Instance Method Summary collapse
-
#initialize(base_path) ⇒ Project
constructor
A new instance of Project.
- #license ⇒ Object
- #license_file ⇒ Object
- #matches ⇒ Object
Constructor Details
#initialize(base_path) ⇒ Project
Returns a new instance of Project.
6 7 8 9 |
# File 'lib/licensee/project.rb', line 6 def initialize(base_path) raise "Invalid directory" unless File.directory?(base_path) @base_path = File.(base_path) end |
Instance Attribute Details
#base_path ⇒ Object (readonly)
Returns the value of attribute base_path.
4 5 6 |
# File 'lib/licensee/project.rb', line 4 def base_path @base_path end |
Instance Method Details
#license ⇒ Object
19 20 21 |
# File 'lib/licensee/project.rb', line 19 def license @license ||= license_file.match if license_file end |
#license_file ⇒ Object
11 12 13 |
# File 'lib/licensee/project.rb', line 11 def license_file @license_file ||= Licensee::LicenseFile.find(base_path) end |
#matches ⇒ Object
15 16 17 |
# File 'lib/licensee/project.rb', line 15 def matches @matches ||= license_file.matches if license_file end |