libpixel 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b0f22ebc9734b9ef50dca3c743461b6df558e065
4
- data.tar.gz: 4841c3f1f7a9dc7c6b55537be6b8bce1f18846b8
3
+ metadata.gz: cdf3be5cedd06e1393f0c41eff6f437eb28c1257
4
+ data.tar.gz: 7b222cff5dfb155843868ab00bc39f8012002c27
5
5
  SHA512:
6
- metadata.gz: 04fd860a31cdd64dea9391343b18c593469747984682e630a29d8e96975777dead7356e7e6fab77794586d215e213d37e0792b481eb1383949f653009f9441e0
7
- data.tar.gz: fd81c111aa5f13e2acd13c6eab081e946b104e491e5d6243459776ae6036b9ba34de7466cddf361458270b5de0c14b19d0b7230bd544f00c1897117e352617c9
6
+ metadata.gz: b6cd92a231e7003043d6f98d89671cf99f4f7e4ae71ce5f1b46b4765b30f1368af12658037ca2791e6468931b0f7dcae88095650cad3c7d74755b90c72ed6456
7
+ data.tar.gz: ef3ac00d6ced0d14b09078488b2f3ef353838833717f63d6c9a32037ac38b04c8db1251b688d4d4ffbad6d1f6a7c1477a22e47b4151aa5bb51b80d17a36a9961
@@ -29,6 +29,7 @@ module LibPixel
29
29
  end
30
30
 
31
31
  def url(path, options={})
32
+ path = "/" if path.nil? || path.empty?
32
33
  query = options.map { |k,v| "#{k}=#{URI.encode_www_form_component(v)}" }.join("&")
33
34
 
34
35
  if query == ""
@@ -1,3 +1,3 @@
1
1
  module LibPixel
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/libpixel.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Joao Carlos"]
10
10
  spec.email = ["joao@libpixel.com"]
11
11
  spec.summary = %q{Ruby library to generate and sign LibPixel URLs.}
12
- spec.homepage = "http://libpixel.com"
12
+ spec.homepage = "https://github.com/libpixel/libpixel-ruby"
13
13
  spec.license = "MIT"
14
14
 
15
15
  spec.files = `git ls-files -z`.split("\x0")
data/test/test_client.rb CHANGED
@@ -61,6 +61,13 @@ describe LibPixel::Client do
61
61
  url = "http://test.libpx.com/images/1.jpg?width=600&signature=dfcaec7b88d53a7a932e8a6a00d10b4f9ff1336b"
62
62
  assert_equal url, client.url("/images/1.jpg", width: 600)
63
63
  end
64
+
65
+ it "sets the path to '/' if nil or empty" do
66
+ client = LibPixel::Client.new(host: "test.libpx.com")
67
+ url = "http://test.libpx.com/?src=url"
68
+ assert_equal url, client.url("", src: "url")
69
+ assert_equal url, client.url(nil, src: "url")
70
+ end
64
71
  end
65
72
 
66
73
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libpixel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joao Carlos
@@ -71,7 +71,7 @@ files:
71
71
  - libpixel.gemspec
72
72
  - test/minitest_helper.rb
73
73
  - test/test_client.rb
74
- homepage: http://libpixel.com
74
+ homepage: https://github.com/libpixel/libpixel-ruby
75
75
  licenses:
76
76
  - MIT
77
77
  metadata: {}