Class: Fuselage::Tag
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
-
#object ⇒ Object
Returns the value of attribute object.
-
#sha ⇒ Object
Returns the value of attribute sha.
-
#tag ⇒ Object
Returns the value of attribute tag.
-
#tagger ⇒ Object
Returns the value of attribute tagger.
-
#url ⇒ Object
Returns the value of attribute url.
Attributes inherited from Base
Class Method Summary collapse
-
.create(repo, tag, message, object, options = {}) ⇒ Object
Create a tag.
-
.find(repo, sha, user = nil) ⇒ Object
Find a tag.
Instance Method Summary collapse
Methods inherited from Base
delete_method, get, #initialize, post
Constructor Details
This class inherits a constructor from Fuselage::Base
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/fuselage/tag.rb', line 3 def @message end |
#object ⇒ Object
Returns the value of attribute object.
3 4 5 |
# File 'lib/fuselage/tag.rb', line 3 def object @object end |
#sha ⇒ Object
Returns the value of attribute sha.
3 4 5 |
# File 'lib/fuselage/tag.rb', line 3 def sha @sha end |
#tag ⇒ Object
Returns the value of attribute tag.
3 4 5 |
# File 'lib/fuselage/tag.rb', line 3 def tag @tag end |
#tagger ⇒ Object
Returns the value of attribute tagger.
3 4 5 |
# File 'lib/fuselage/tag.rb', line 3 def tagger @tagger end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/fuselage/tag.rb', line 3 def url @url end |
Class Method Details
.create(repo, tag, message, object, options = {}) ⇒ Object
Create a tag
Options:
:type, values: 'commit', 'tree', and 'blob'. default is commit
:tagger
:name
:date
:email
examples:
Tag.create('cockpit', v1.0', 'New tag', '45f6d8e74e145b910be4e15f67ef3892fe7abb26')
Commit.create('cockpit', v1.0', 'New tag', '45f6d8e74e145b910be4e15f67ef3892fe7abb26', {
:tagger => {:name => 'Corey', :email => '[email protected]'}
})
31 32 33 34 35 36 37 |
# File 'lib/fuselage/tag.rb', line 31 def self.create(repo, tag, , object, ={}) raise AuthenticationRequired unless Api.authenticated = {:type => 'commit'}.merge() params = {:tag => tag, :message => , :object => object}.merge() user = User.current.login Tag.new(post("/repos/#{user}/#{repo}/git/blobs", params)) end |
.find(repo, sha, user = nil) ⇒ Object
Find a tag
examples:
Tag.find('cockpit', '45f6d8e74e145b910be4e15f67ef3892fe7abb26')
9 10 11 12 13 |
# File 'lib/fuselage/tag.rb', line 9 def self.find(repo, sha, user=nil) raise AuthenticationRequired unless Api.authenticated user ||= User.current.login Tag.new(get("/repos/#{user}/#{repo}/git/tags/#{sha}")) end |
Instance Method Details
#to_s ⇒ Object
39 40 41 |
# File 'lib/fuselage/tag.rb', line 39 def to_s tag end |