class QCloudHive::HiveSpec

Attributes

branch[RW]
commit[RW]
name[RW]
path[RW]
sourceURL[RW]

Public Class Methods

new(name=nil, path=nil) click to toggle source
# File lib/qcloudhive/spec_helper.rb, line 9
def initialize(name=nil, path=nil)
  @name = name
  @path = path
  @podspec = nil
end

Public Instance Methods

podspec() click to toggle source
# File lib/qcloudhive/spec_helper.rb, line 15
def podspec
  if @podspec.nil?
    @podspec = Pod::Specification.from_file(path)
  end
  return @podspec
end
toConfig() click to toggle source
# 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() click to toggle source
# File lib/qcloudhive/spec_helper.rb, line 38
def writeJson
  jsonPath = @path + ".json"
  File.open("#{jsonPath}", "w") { |f|
    f.write podspec.to_json
  }
end