Class: CIQuantum::Adapter::Unfuddle
- Inherits:
-
Struct
- Object
- Struct
- CIQuantum::Adapter::Unfuddle
- Defined in:
- lib/ciquantum/adapter/unfuddle.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
Class Method Summary collapse
Instance Method Summary collapse
- #[](command) ⇒ Object
- #commit_from_request(body) ⇒ Object
- #commit_url(commit) ⇒ Object
- #url ⇒ Object
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config
4 5 6 |
# File 'lib/ciquantum/adapter/unfuddle.rb', line 4 def config @config end |
Class Method Details
.config_name ⇒ Object
6 7 8 |
# File 'lib/ciquantum/adapter/unfuddle.rb', line 6 def self.config_name 'unfuddle' end |
.from_config(config) ⇒ Object
10 11 12 |
# File 'lib/ciquantum/adapter/unfuddle.rb', line 10 def self.from_config config self.new config[config_name] end |
Instance Method Details
#[](command) ⇒ Object
22 23 24 |
# File 'lib/ciquantum/adapter/unfuddle.rb', line 22 def [] command return config[command] end |
#commit_from_request(body) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/ciquantum/adapter/unfuddle.rb', line 26 def commit_from_request body begin return Changeset.new(body).commit rescue Unfuddle::ChangesetError => e nil end end |
#commit_url(commit) ⇒ Object
14 15 16 |
# File 'lib/ciquantum/adapter/unfuddle.rb', line 14 def commit_url commit "http://#{config.user}.unfuddle.com/a#/repositories/#{config.project}/commit?commit=#{commit.sha}" end |
#url ⇒ Object
18 19 20 |
# File 'lib/ciquantum/adapter/unfuddle.rb', line 18 def url "https://#{config.user}.unfuddle.com/a#/repositories/#{config.project}/browse" end |