Module: Mina::Flowdock::Plugin
- Defined in:
- lib/mina/flowdock/plugin.rb
Instance Method Summary collapse
- #erb_string(string, b = binding) ⇒ Object
- #flowdock_message ⇒ Object
- #flowdock_message_subject ⇒ Object
- #git_config ⇒ Object
- #git_user_email ⇒ Object
- #git_user_name ⇒ Object
- #print_local_debug(msg) ⇒ Object
-
#print_local_status(msg) ⇒ Object
Prints a status message.
- #print_notification_debug(flow) ⇒ Object
Instance Method Details
#erb_string(string, b = binding) ⇒ Object
34 35 36 37 38 |
# File 'lib/mina/flowdock/plugin.rb', line 34 def erb_string(string, b = binding) require "erb" erb = ERB.new(string) erb.result b end |
#flowdock_message ⇒ Object
18 19 20 |
# File 'lib/mina/flowdock/plugin.rb', line 18 def erb_string(settings.send :flowdock_message) end |
#flowdock_message_subject ⇒ Object
14 15 16 |
# File 'lib/mina/flowdock/plugin.rb', line 14 def erb_string(settings.send :flowdock_message_subject) end |
#git_config ⇒ Object
30 31 32 |
# File 'lib/mina/flowdock/plugin.rb', line 30 def git_config Git.open(".").config end |
#git_user_email ⇒ Object
26 27 28 |
# File 'lib/mina/flowdock/plugin.rb', line 26 def git_user_email git_config["user.email"] end |
#git_user_name ⇒ Object
22 23 24 |
# File 'lib/mina/flowdock/plugin.rb', line 22 def git_user_name git_config["user.name"] end |
#print_local_debug(msg) ⇒ Object
51 52 53 |
# File 'lib/mina/flowdock/plugin.rb', line 51 def print_local_debug(msg) puts " #{color(">>", 32)} #{color(msg, 32)}" end |
#print_local_status(msg) ⇒ Object
Prints a status message. (<-----
)
57 58 59 60 |
# File 'lib/mina/flowdock/plugin.rb', line 57 def print_local_status(msg) puts "" if verbose_mode? puts "#{color('<-----', 32)} #{msg}" end |
#print_notification_debug(flow) ⇒ Object
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/mina/flowdock/plugin.rb', line 40 def print_notification_debug(flow) flow = "flow: #{flow.api_token} [#{flow.project}]" subj = "subject: #{}" msg = "message: #{}" from = "from: #{git_user_name} <#{git_user_email}>" [flow, subj, msg, from].each do |debug| print_local_debug(debug) end end |