Class: Flowdock::Git
- Inherits:
-
Object
- Object
- Flowdock::Git
- Defined in:
- lib/flowdock/git.rb,
lib/flowdock/git/builder.rb
Defined Under Namespace
Constant Summary collapse
- TokenError =
Class.new(StandardError)
- DEFAULT_PERMANENT_REFS =
[ Regexp.new('refs/heads/master') ].freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(ref, from, to, options = {}) ⇒ Git
constructor
A new instance of Git.
-
#post ⇒ Object
Send git push notification to Flowdock.
- #repo ⇒ Object
Constructor Details
#initialize(ref, from, to, options = {}) ⇒ Git
Returns a new instance of Git.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/flowdock/git.rb', line 19 def initialize(ref, from, to, = {}) raise TokenError, "Flowdock API token not found" unless [:token] @ref = ref @from = from @to = to @options = @token = [:token] @commit_url = [:commit_url] @diff_url = [:diff_url] @repo_url = [:repo_url] @repo_name = [:repo_name] @permanent_refs = .fetch(:permanent_refs, DEFAULT_PERMANENT_REFS) end |
Class Method Details
Instance Method Details
#post ⇒ Object
Send git push notification to Flowdock
35 36 37 38 39 |
# File 'lib/flowdock/git.rb', line 35 def post .each do || ::Flowdock::Client.new(flow_token: @token).post_to_thread() end end |
#repo ⇒ Object
41 42 43 |
# File 'lib/flowdock/git.rb', line 41 def repo @options[:repo] end |