signatureio 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Signatureio
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/signatureio.rb CHANGED
@@ -51,8 +51,17 @@ module Signatureio
51
51
  0
52
52
  end
53
53
 
54
+ def _root_url=(_root_url)
55
+ @_root_url = _root_url
56
+ end
57
+
58
+ def _root_url
59
+ return @_root_url if @_root_url
60
+ "https://www.signature.io"
61
+ end
62
+
54
63
  def api_endpoint
55
- ["https://www.signature.io/api/v", api_version].join
64
+ [_root_url, "/api/v", api_version].join
56
65
  end
57
66
 
58
67
  private
@@ -1,5 +1,5 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Signatureio do
4
- it { Signatureio::VERSION.should eq "0.0.3" }
4
+ it { Signatureio::VERSION.should eq "0.0.4" }
5
5
  end
@@ -32,4 +32,13 @@ describe Signatureio do
32
32
  it { subject.secret_api_key.should eq secret_api_key }
33
33
  it { subject.api_endpoint.should eq "https://www.signature.io/api/v1" }
34
34
  end
35
+
36
+ describe "setting _root_url" do
37
+ before do
38
+ subject._root_url = "http://localhost:3000"
39
+ end
40
+
41
+ it { subject._root_url = "http://localhost:3000" }
42
+ it { subject.api_endpoint.should eq "http://localhost:3000/api/v1" }
43
+ end
35
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: signatureio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -142,7 +142,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
142
142
  version: '0'
143
143
  segments:
144
144
  - 0
145
- hash: -3720145876798221900
145
+ hash: -493432354269638459
146
146
  required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  none: false
148
148
  requirements:
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  version: '0'
152
152
  segments:
153
153
  - 0
154
- hash: -3720145876798221900
154
+ hash: -493432354269638459
155
155
  requirements: []
156
156
  rubyforge_project:
157
157
  rubygems_version: 1.8.23