Class: QCloudHive::HiveSpec
- Inherits:
-
Object
- Object
- QCloudHive::HiveSpec
- Defined in:
- lib/qcloudhive/spec_helper.rb
Instance Attribute Summary collapse
-
#branch ⇒ Object
Returns the value of attribute branch.
-
#commit ⇒ Object
Returns the value of attribute commit.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#sourceURL ⇒ Object
Returns the value of attribute sourceURL.
Instance Method Summary collapse
-
#initialize(name = nil, path = nil) ⇒ HiveSpec
constructor
A new instance of HiveSpec.
- #podspec ⇒ Object
- #toConfig ⇒ Object
- #writeJson ⇒ Object
Constructor Details
#initialize(name = nil, path = nil) ⇒ HiveSpec
Returns a new instance of HiveSpec.
9 10 11 12 13 |
# File 'lib/qcloudhive/spec_helper.rb', line 9 def initialize(name=nil, path=nil) @name = name @path = path @podspec = nil end |
Instance Attribute Details
#branch ⇒ Object
Returns the value of attribute branch.
6 7 8 |
# File 'lib/qcloudhive/spec_helper.rb', line 6 def branch @branch end |
#commit ⇒ Object
Returns the value of attribute commit.
7 8 9 |
# File 'lib/qcloudhive/spec_helper.rb', line 7 def commit @commit end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/qcloudhive/spec_helper.rb', line 4 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'lib/qcloudhive/spec_helper.rb', line 5 def path @path end |
#sourceURL ⇒ Object
Returns the value of attribute sourceURL.
8 9 10 |
# File 'lib/qcloudhive/spec_helper.rb', line 8 def sourceURL @sourceURL end |
Instance Method Details
#podspec ⇒ Object
15 16 17 18 19 20 |
# File 'lib/qcloudhive/spec_helper.rb', line 15 def podspec if @podspec.nil? @podspec = Pod::Specification.from_file(path) end return @podspec end |
#toConfig ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/qcloudhive/spec_helper.rb', line 21 def toConfig config = "[#{name}]\n" if not path.nil? config += "path=#{path}\n" end if not commit.nil? config += "commit=#{commit}\n" end if not branch.nil? config += "branch=#{branch}\n" end if not sourceURL.nil? config += "sourceURL=#{sourceURL}\n" end config end |
#writeJson ⇒ Object
38 39 40 41 42 43 |
# File 'lib/qcloudhive/spec_helper.rb', line 38 def writeJson jsonPath = @path + ".json" File.open("#{jsonPath}", "w") { |f| f.write podspec.to_json } end |