snowshoe_ruby 0.0.2.beta → 1.0.0
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.
- checksums.yaml +4 -4
- data/README.md +12 -1
- data/lib/snowshoe_ruby.rb +22 -15
- data/lib/snowshoe_ruby/version.rb +1 -1
- data/snowshoe_ruby-0.0.1.beta.gem +0 -0
- data/snowshoe_ruby-0.0.2.beta.gem +0 -0
- metadata +6 -6
- data/lib/snowshoe_ruby/client.rb +0 -12
- data/lib/snowshoe_ruby/config.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3592c40cdc9bc254bae46a1f957c0d185eae2e7e
|
4
|
+
data.tar.gz: 004301952e3a593cb66bf41d45540e80cf93ef85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18d07e70183c530cd3cb0d2eec3f3f81bbdd08bb5f98c81e5f2a34ac0acfd2a852d1cb7cc87944f0db082ec5c48dd44b0430865642b1a5c087d9e9173b2d69f6
|
7
|
+
data.tar.gz: 70207ac47ba4f6102d5fcf5f49bb0b7b8964507c019204a11a2685e61e55c14ec01021fa7cf77373d5fdd631b209ca98e978a332b9906289f5e9d718293be49f
|
data/README.md
CHANGED
@@ -20,7 +20,18 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
23
|
+
config/snowshoe.yml
|
24
|
+
|
25
|
+
development:
|
26
|
+
secret: yoursecret
|
27
|
+
key: yourkey
|
28
|
+
callback_url: http://yourdomain.com/showshoe
|
29
|
+
|
30
|
+
In your callback controller
|
31
|
+
|
32
|
+
SnowshoeRuby.stamp(params)
|
33
|
+
# or
|
34
|
+
redirect_to SnowshoeRuby.stamp_url
|
24
35
|
|
25
36
|
## Contributing
|
26
37
|
|
data/lib/snowshoe_ruby.rb
CHANGED
@@ -1,22 +1,29 @@
|
|
1
1
|
require "snowshoe_ruby/version"
|
2
|
-
require "snowshoe_ruby/client"
|
3
|
-
require "snowshoe_ruby/config"
|
4
2
|
|
5
3
|
module SnowshoeRuby
|
6
|
-
|
4
|
+
class << self
|
7
5
|
|
8
|
-
|
9
|
-
|
6
|
+
def config
|
7
|
+
@@config ||= YAML.load(open("#{Rails.root}/config/snowshoe.yml").read)[Rails.env]
|
8
|
+
end
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
})
|
17
|
-
# Get Auth key with consumer
|
18
|
-
@resp = @consumer.request(:post, '/v2/stamp', nil, {}, @data, { 'Content-Type' => 'application/x-www-form-urlencoded' })
|
10
|
+
def client
|
11
|
+
@@client ||= OAuth::Consumer.new( config["key"], config["secret"],
|
12
|
+
{:site => "http://beta.snowshoestamp.com/api", :scheme => :header}
|
13
|
+
)
|
14
|
+
end
|
19
15
|
|
20
|
-
|
21
|
-
|
16
|
+
def stamp_url
|
17
|
+
"http://beta.snowshoestamp.com/applications/client/#{config["key"]}/"
|
18
|
+
end
|
19
|
+
|
20
|
+
def stamp(data)
|
21
|
+
# Get Auth key with consumer
|
22
|
+
@resp = client.request(:post, '/v2/stamp', nil, {}, data, { 'Content-Type' => 'application/x-www-form-urlencoded' })
|
23
|
+
|
24
|
+
# Parse response and send to template
|
25
|
+
@response = JSON.parse(@resp.body)
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
22
29
|
end
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snowshoe_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- IggyIgner
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-10-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oauth
|
@@ -83,9 +83,9 @@ files:
|
|
83
83
|
- README.md
|
84
84
|
- Rakefile
|
85
85
|
- lib/snowshoe_ruby.rb
|
86
|
-
- lib/snowshoe_ruby/client.rb
|
87
|
-
- lib/snowshoe_ruby/config.rb
|
88
86
|
- lib/snowshoe_ruby/version.rb
|
87
|
+
- snowshoe_ruby-0.0.1.beta.gem
|
88
|
+
- snowshoe_ruby-0.0.2.beta.gem
|
89
89
|
- snowshoe_ruby.gemspec
|
90
90
|
- spec/snowshoe_ruby_spec.rb
|
91
91
|
- spec/spec_helper.rb
|
@@ -106,9 +106,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
106
106
|
version: '0'
|
107
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- - "
|
109
|
+
- - ">="
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version:
|
111
|
+
version: '0'
|
112
112
|
requirements: []
|
113
113
|
rubyforge_project:
|
114
114
|
rubygems_version: 2.2.2
|
data/lib/snowshoe_ruby/client.rb
DELETED
data/lib/snowshoe_ruby/config.rb
DELETED