Class: Logirel::VS::Project
- Inherits:
-
Object
- Object
- Logirel::VS::Project
- Defined in:
- lib/logirel/vs/solution.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#project_types ⇒ Object
readonly
Returns the value of attribute project_types.
Instance Method Summary collapse
- #directory ⇒ Object
-
#initialize(prfile, opts = {}) ⇒ Project
constructor
A new instance of Project.
- #test? ⇒ Boolean
- #web? ⇒ Boolean
Constructor Details
#initialize(prfile, opts = {}) ⇒ Project
Returns a new instance of Project.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/logirel/vs/solution.rb', line 13 def initialize(prfile, opts = {}) @file = File.("#{prfile}") @name = File.basename(@file, ".csproj") @solution_path = opts[:solution_path] || '.' @project_types = [] throw "Project #{@file} must exist." unless File.exists? @file parse(File.read(@file)) end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
9 10 11 |
# File 'lib/logirel/vs/solution.rb', line 9 def file @file end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/logirel/vs/solution.rb', line 8 def name @name end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
10 11 12 |
# File 'lib/logirel/vs/solution.rb', line 10 def output @output end |
#project_types ⇒ Object (readonly)
Returns the value of attribute project_types.
11 12 13 |
# File 'lib/logirel/vs/solution.rb', line 11 def project_types @project_types end |
Instance Method Details
#directory ⇒ Object
25 26 27 |
# File 'lib/logirel/vs/solution.rb', line 25 def directory File.dirname(file) end |
#test? ⇒ Boolean
29 30 31 |
# File 'lib/logirel/vs/solution.rb', line 29 def test? project_types.any? {|t| ProjectTypes.test? t } end |
#web? ⇒ Boolean
33 34 35 |
# File 'lib/logirel/vs/solution.rb', line 33 def web? project_types.any? {|t| ProjectTypes.web? t } end |