badges2svg 0.1.2 → 0.1.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/badges2svg.rb +3 -3
  3. data/tests/tests.rb +24 -0
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d2e5f8a45f158eddc934a8d5f18d20475f53385
4
- data.tar.gz: 9108a6de36f85c996c88af34b4147b91a54e8800
3
+ metadata.gz: c925547728c1059011d3d247b6387aa6c77bf9ec
4
+ data.tar.gz: f0bb39f66ee88fda11df12cacdaa463b711385b9
5
5
  SHA512:
6
- metadata.gz: 4d904165bdea789497617056477147bd3711b4de047d55fc164c8b074f555b07a1cf62364966fd9e7ebada29fc2f193e5cc171b28aa8012098b66911dec85f79
7
- data.tar.gz: 9fc4994767a7b92eed9e058ded5f60745c78aa832a6ad337b7aca598c5b54d037c9970fa73e2cbe472e823120a86a2d1ff8df234c98844750922127d6e8c2ae2
6
+ metadata.gz: db0b2e6518a4ab8c6de2c85feb32b567c9071442e127877eb1e255b9cbde57340e1e4190affe3ed362138338342fbf3f513ea78d0431a5738879395b188ef3d7
7
+ data.tar.gz: 5f1b7b262715e3747001735ac8a6ecd3acdc5874cab62ff74ab700a77bee9aafdc9ecab572782f509a5a5f1b5d5416199a81a15beb403209286eb1a5d5428feb
data/lib/badges2svg.rb CHANGED
@@ -24,13 +24,13 @@ module BadgesToSVG
24
24
  },
25
25
  {
26
26
  :name => :coveralls_branch,
27
- :pattern => 'https?://coveralls.io/repos/%{user}/%{repo}/badge.png' +
27
+ :pattern => 'https?://coveralls.io/r(epos)?/%{user}/%{repo}/badge.png' +
28
28
  '\\?branch=%{branch}',
29
29
  :string => '/coveralls/%{user}/%{repo}/%{branch}.svg'
30
30
  },
31
31
  {
32
32
  :name => :coveralls,
33
- :pattern => 'https?://coveralls.io/repos/%{user}/%{repo}/badge.png',
33
+ :pattern => 'https?://coveralls.io/r(epos)?/%{user}/%{repo}/badge.png',
34
34
  :string => '/coveralls/%{user}/%{repo}.svg'
35
35
  },
36
36
  {
@@ -84,7 +84,7 @@ module BadgesToSVG
84
84
  ]
85
85
 
86
86
  def version
87
- '0.1.2'
87
+ '0.1.3'
88
88
  end
89
89
 
90
90
  def root_url(opts={})
data/tests/tests.rb CHANGED
@@ -146,6 +146,18 @@ class BadgesToSVGTests < Test::Unit::TestCase
146
146
  assert_equal(ct2, BadgesToSVG.replace(ct1))
147
147
  end
148
148
 
149
+ def test_replace_one_coveralls_http_short
150
+ ct1 = "hello ![](http://coveralls.io/r/sferik/t/badge.png)"
151
+ ct2 = "hello ![](https://img.shields.io/coveralls/sferik/t.svg)"
152
+ assert_equal(ct2, BadgesToSVG.replace(ct1))
153
+ end
154
+
155
+ def test_replace_one_coveralls_https_short
156
+ ct1 = "hello ![](https://coveralls.io/r/sferik/t/badge.png)"
157
+ ct2 = "hello ![](https://img.shields.io/coveralls/sferik/t.svg)"
158
+ assert_equal(ct2, BadgesToSVG.replace(ct1))
159
+ end
160
+
149
161
  ## coveralls_branch
150
162
 
151
163
  def test_replace_one_coveralls_branch_http
@@ -160,6 +172,18 @@ class BadgesToSVGTests < Test::Unit::TestCase
160
172
  assert_equal(ct2, BadgesToSVG.replace(ct1))
161
173
  end
162
174
 
175
+ def test_replace_one_coveralls_branch_http_short
176
+ ct1 = "hello ![](http://coveralls.io/r/sferik/t/badge.png?branch=abc)"
177
+ ct2 = "hello ![](https://img.shields.io/coveralls/sferik/t/abc.svg)"
178
+ assert_equal(ct2, BadgesToSVG.replace(ct1))
179
+ end
180
+
181
+ def test_replace_one_coveralls_branch_https_short
182
+ ct1 = "hello ![](https://coveralls.io/r/sferik/t/badge.png?branch=abc)"
183
+ ct2 = "hello ![](https://img.shields.io/coveralls/sferik/t/abc.svg)"
184
+ assert_equal(ct2, BadgesToSVG.replace(ct1))
185
+ end
186
+
163
187
  ## gemnasium
164
188
 
165
189
  def test_replace_one_gemnasium_http
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: badges2svg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Baptiste Fontaine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-13 00:00:00.000000000 Z
11
+ date: 2014-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trollop