Class: CIQuantum::Adapter::Unfuddle

Inherits:
Struct
  • Object
show all
Defined in:
lib/ciquantum/adapter/unfuddle.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject

Returns the value of attribute config

Returns:

  • (Object)

    the current value of config



4
5
6
# File 'lib/ciquantum/adapter/unfuddle.rb', line 4

def config
  @config
end

Class Method Details

.config_nameObject



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

#urlObject



18
19
20
# File 'lib/ciquantum/adapter/unfuddle.rb', line 18

def url
  "https://#{config.user}.unfuddle.com/a#/repositories/#{config.project}/browse"
end