stampery 0.1.1 → 0.1.2
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 +2 -1
- data/example.rb +22 -0
- data/lib/stampery.rb +8 -2
- data/stampery.gemspec +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1534e27adafd15f44bbb8906d184a4b46bf7c6e1
|
4
|
+
data.tar.gz: 5575bcb669a5366ef27d3e68c149086a256119f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecb7ab3c49a2e65a54ac84215182d610f28912265f36102e274d0ba41bbeb0b789bd9d4adefe9799a621bc1c2fde94207d06b6424ec024f6114cf86fd56df352
|
7
|
+
data.tar.gz: 9c15da2e5a4ecc0072e6694f8ecf98a4a559222c3789e2be3847a3dc34211a0f58d52a026dfe102ac26abcd419b436bc68444c72e3fea47b3542da2aa2730ea7
|
data/README.md
CHANGED
@@ -21,7 +21,8 @@ Or install it yourself as:
|
|
21
21
|
```ruby
|
22
22
|
require 'stampery'
|
23
23
|
|
24
|
-
|
24
|
+
# Sign up and get your secret token at https://api-dashboard.stampery.com
|
25
|
+
stampery = Client.new 'user-secret'
|
25
26
|
|
26
27
|
stampery.on :proof do |hash, proof|
|
27
28
|
puts 'Received proof for'
|
data/example.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'stampery'
|
2
|
+
|
3
|
+
# Sign up and get your secret token at https://api-dashboard.stampery.com
|
4
|
+
stampery = Client.new 'user-secret'
|
5
|
+
|
6
|
+
stampery.on :proof do |hash, proof|
|
7
|
+
puts 'Received proof for'
|
8
|
+
puts hash
|
9
|
+
puts 'Proof'
|
10
|
+
puts proof.to_s
|
11
|
+
end
|
12
|
+
|
13
|
+
stampery.on :error do |err|
|
14
|
+
puts "Woot: #{err}"
|
15
|
+
end
|
16
|
+
|
17
|
+
stampery.on :ready do
|
18
|
+
digest = stampery.hash 'Hello, blockchain!'
|
19
|
+
stampery.stamp digest
|
20
|
+
end
|
21
|
+
|
22
|
+
stampery.start
|
data/lib/stampery.rb
CHANGED
@@ -22,7 +22,9 @@ class Client
|
|
22
22
|
|
23
23
|
def start
|
24
24
|
api_login @api_end_point
|
25
|
-
|
25
|
+
if @auth
|
26
|
+
amqp_login @amqp_end_point
|
27
|
+
end
|
26
28
|
end
|
27
29
|
|
28
30
|
def stamp data
|
@@ -46,7 +48,11 @@ class Client
|
|
46
48
|
req = @api_client.call_async('stampery.3.auth', @client_id, @client_secret, user_agent)
|
47
49
|
req.join
|
48
50
|
@auth = req.result
|
49
|
-
|
51
|
+
if @auth
|
52
|
+
puts "logged #{@client_id}"
|
53
|
+
else
|
54
|
+
emit :error, "Couldn't log in"
|
55
|
+
end
|
50
56
|
end
|
51
57
|
|
52
58
|
def amqp_login end_point
|
data/stampery.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stampery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johann Ortiz
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- Rakefile
|
121
121
|
- bin/console
|
122
122
|
- bin/setup
|
123
|
+
- example.rb
|
123
124
|
- lib/stampery.rb
|
124
125
|
- lib/stampery/version.rb
|
125
126
|
- stampery.gemspec
|