signatureio 0.0.4 → 0.0.5
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.
- data/README.md +3 -1
- data/lib/signatureio/version.rb +1 -1
- data/lib/signatureio.rb +5 -3
- data/spec/signatureio/document_spec.rb +1 -1
- data/spec/signatureio/version_spec.rb +1 -1
- data/spec/signatureio_spec.rb +0 -2
- data/spec/spec_helper.rb +0 -2
- metadata +4 -4
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Signatureio Ruby Bindings
|
2
2
|
|
3
|
-
This gem is a wrapper for Signature.io's API.
|
3
|
+
This gem is a wrapper for [Signature.io](https://www.signature.io)'s API.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -21,6 +21,8 @@ Then in your application initialize the gem:
|
|
21
21
|
$ Signatureio.secret_api_key = "your_secret_api_key"
|
22
22
|
$ Signatureio.public_api_key = "your_public_api_key"
|
23
23
|
|
24
|
+
Alternatively, you can simply set the environment variables SIGNATURE_SECRET_API_KEY and SIGNATURE_PUBLIC_API_KEY on your machine. The rubygem will read it automatically so that you can skip the initialization.
|
25
|
+
|
24
26
|
## Usage
|
25
27
|
|
26
28
|
### Create Document
|
data/lib/signatureio/version.rb
CHANGED
data/lib/signatureio.rb
CHANGED
@@ -12,7 +12,7 @@ module Signatureio
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def request
|
15
|
-
@request
|
15
|
+
@request || setup_request!
|
16
16
|
end
|
17
17
|
|
18
18
|
def secret_api_key=(secret_api_key)
|
@@ -24,7 +24,7 @@ module Signatureio
|
|
24
24
|
|
25
25
|
def secret_api_key
|
26
26
|
return @secret_api_key if @secret_api_key
|
27
|
-
"missing_secret_api_key"
|
27
|
+
ENV['SIGNATURE_SECRET_API_KEY'] || "missing_secret_api_key"
|
28
28
|
end
|
29
29
|
|
30
30
|
def public_api_key=(public_api_key)
|
@@ -36,7 +36,7 @@ module Signatureio
|
|
36
36
|
|
37
37
|
def public_api_key
|
38
38
|
return @public_api_key if @public_api_key
|
39
|
-
"missing_public_api_key"
|
39
|
+
ENV['SIGNATURE_PUBLIC_API_KEY'] || "missing_public_api_key"
|
40
40
|
end
|
41
41
|
|
42
42
|
def api_version=(api_version)
|
@@ -80,5 +80,7 @@ module Signatureio
|
|
80
80
|
end
|
81
81
|
|
82
82
|
Signatureio.request.basic_auth(Signatureio.secret_api_key, '')
|
83
|
+
|
84
|
+
Signatureio.request
|
83
85
|
end
|
84
86
|
end
|
data/spec/signatureio_spec.rb
CHANGED
@@ -12,8 +12,6 @@ describe Signatureio do
|
|
12
12
|
|
13
13
|
it { subject.api_endpoint.should eq "https://www.signature.io/api/v0" }
|
14
14
|
it { subject.api_version.should eq 0 }
|
15
|
-
it { subject.secret_api_key.should eq "missing_secret_api_key" }
|
16
|
-
it { subject.public_api_key.should eq "missing_public_api_key" }
|
17
15
|
end
|
18
16
|
|
19
17
|
describe "setting values" do
|
data/spec/spec_helper.rb
CHANGED
@@ -8,7 +8,6 @@ Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].e
|
|
8
8
|
RSpec.configure do |config|
|
9
9
|
config.before(:suite) do
|
10
10
|
# FakeWeb.allow_net_connect = false
|
11
|
-
set_secret_and_public_api_keys!
|
12
11
|
end
|
13
12
|
|
14
13
|
# config.after(:suite) do
|
@@ -17,7 +16,6 @@ RSpec.configure do |config|
|
|
17
16
|
end
|
18
17
|
|
19
18
|
def set_secret_and_public_api_keys!
|
20
|
-
# These keys come form rspec@signature.io person.
|
21
19
|
Signatureio.secret_api_key = ENV['SIGNATURE_SECRET_API_KEY']
|
22
20
|
Signatureio.public_api_key = ENV['SIGNATURE_PUBLIC_API_KEY']
|
23
21
|
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.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-04-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -142,7 +142,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
142
142
|
version: '0'
|
143
143
|
segments:
|
144
144
|
- 0
|
145
|
-
hash: -
|
145
|
+
hash: -1445965729381535831
|
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: -
|
154
|
+
hash: -1445965729381535831
|
155
155
|
requirements: []
|
156
156
|
rubyforge_project:
|
157
157
|
rubygems_version: 1.8.23
|