Class: BintrayDeploy::Version
- Includes:
- Hashed
- Defined in:
- lib/bintray_deploy/model/version.rb
Instance Attribute Summary collapse
-
#desc ⇒ Object
Returns the value of attribute desc.
-
#name ⇒ Object
Returns the value of attribute name.
-
#pkg ⇒ Object
Returns the value of attribute pkg.
-
#repo ⇒ Object
Returns the value of attribute repo.
Instance Method Summary collapse
Methods included from Hashed
Methods inherited from Base
Instance Attribute Details
#desc ⇒ Object
Returns the value of attribute desc.
5 6 7 |
# File 'lib/bintray_deploy/model/version.rb', line 5 def desc @desc end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/bintray_deploy/model/version.rb', line 5 def name @name end |
#pkg ⇒ Object
Returns the value of attribute pkg.
5 6 7 |
# File 'lib/bintray_deploy/model/version.rb', line 5 def pkg @pkg end |
#repo ⇒ Object
Returns the value of attribute repo.
5 6 7 |
# File 'lib/bintray_deploy/model/version.rb', line 5 def repo @repo end |
Instance Method Details
#create ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/bintray_deploy/model/version.rb', line 7 def create payload = {:name => @name, :released => Time.now.utc.iso8601, :desc => @desc || ''}.to_json @bintray["/packages/#{C.user}/#{@repo}/#{@pkg}/versions"].post(payload, :content_type =>:json){ |resp, req, res, &b| if(resp.code !=201) raise Exception.new("package versioning failed #{resp}") end } end |
#delete ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/bintray_deploy/model/version.rb', line 16 def delete @bintray["/packages/#{C.user}/#{@repo}/#{@pkg}/versions/#{@name}"].delete{ |resp, req, res, &b| if(resp.code !=200) raise Exception.new("failed to delete version failed #{resp}") end } end |
#exists? ⇒ Boolean
24 25 26 27 28 29 30 31 32 |
# File 'lib/bintray_deploy/model/version.rb', line 24 def exists? @bintray["/packages/#{C.user}/#{@repo}/#{@pkg}/versions/#{@name}"].get{ |resp, req, res, &b| if(resp.code !=200) return false else return true end } end |