jenkins-remote-api 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,13 +7,13 @@ module Ci
7
7
  include XmlHelper
8
8
 
9
9
  COLOR_STATUS_MAPPING = {
10
- 'blue' => 'success',
11
- 'red' => 'failure',
12
- 'blue_anime' => 'building',
13
- 'red_anime' => 'building',
14
- 'disabled' => 'disabled',
15
- 'aborted' => 'aborted',
16
- 'yellow' => 'unstable', #rare
10
+ '^blue$' => 'success',
11
+ '^red$' => 'failure',
12
+ '.*anime$' => 'building',
13
+ '^disabled$' => 'disabled',
14
+ '^aborted$' => 'aborted',
15
+ '^yellow$' => 'unstable', #rare
16
+ '^grey$' => 'disabled',
17
17
  }
18
18
 
19
19
  attr_accessor :ci_address
@@ -79,8 +79,9 @@ module Ci
79
79
  end
80
80
 
81
81
  def get_status_to color
82
- raise "This color '#{color}' and its corresponding status hasn't been added to library, pls contact author." unless COLOR_STATUS_MAPPING.has_key?(color)
83
- COLOR_STATUS_MAPPING[color]
82
+ result_color_key = COLOR_STATUS_MAPPING.keys.find { | color_regex | color_regex.match(color)}
83
+ raise "This color '#{color}' and its corresponding status hasn't been added to library, pls contact author." if result_color_key.nil?
84
+ COLOR_STATUS_MAPPING[result_color_key]
84
85
  end
85
86
 
86
87
  def get_job_summary_on job_name
@@ -1,7 +1,7 @@
1
1
  module Jenkins
2
2
  module Remote
3
3
  module Api
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Tuo Huang
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-09-05 00:00:00 +08:00
17
+ date: 2011-09-14 00:00:00 +08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency