elchapo 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/elchapo.gemspec +1 -0
- data/lib/elchapo/bitcoin/http_connection.rb +13 -22
- data/lib/elchapo/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2606f6b487a32d94dff54491dcd4ac9181d8ca0a
|
4
|
+
data.tar.gz: c29ed0674b2164586b6d648e73dfc8ccd0c9064a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbd2cec362407c38c8b8096ce3704f1346448636007fc97efad148c8f3d4e6552f4a5edc5e47ee5331b0c9f382c2c757055c1fd7bd203a07b4178ade89bed675
|
7
|
+
data.tar.gz: 420b363385f88c3a80b4d0f7ceae13fde3940d28f0b636c680b5ab8cf8ba71deebe8161934cc1b7a187772a5c0f32217e694438ed45d88f0486f84d33b23e39d
|
data/elchapo.gemspec
CHANGED
@@ -1,37 +1,28 @@
|
|
1
|
-
require 'net/http'
|
2
1
|
require 'json'
|
2
|
+
require 'rest-client'
|
3
|
+
|
3
4
|
module Bitcoin
|
4
5
|
class HttpConnection < Client
|
5
|
-
attr_accessor :host, :port, :uri, :ssl
|
6
6
|
|
7
7
|
def initialize(host, user:, pass:)
|
8
8
|
super()
|
9
|
-
uri = URI.parse(host)
|
10
|
-
raise ArgumentError unless ['http', 'https'].include? uri.scheme
|
11
|
-
@host = uri.host
|
12
|
-
@port = uri.port
|
13
9
|
@user = user
|
14
10
|
@pass = pass
|
11
|
+
@url = host
|
15
12
|
|
16
|
-
@
|
17
|
-
if ssl
|
18
|
-
@uri = URI("https://#{@host}:#{@port}")
|
19
|
-
else
|
20
|
-
@uri = URI("http://#{@host}:#{@port}")
|
21
|
-
end
|
13
|
+
@header = {'Content-Type' => 'application/json'}
|
22
14
|
end
|
23
15
|
|
24
16
|
def send_single(payload)
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
return response.body
|
17
|
+
resp = RestClient::Request.execute(
|
18
|
+
user: @user,
|
19
|
+
password: @pass,
|
20
|
+
method: :post,
|
21
|
+
url: @url,
|
22
|
+
payload: payload,
|
23
|
+
headers: @header
|
24
|
+
)
|
25
|
+
return resp
|
35
26
|
end
|
36
27
|
|
37
28
|
end
|
data/lib/elchapo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elchapo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DilumN
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1.1'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rest-client
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 2.0.2
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 2.0.2
|
83
97
|
description: This will enable your Ruby application to connect to Ethereum Blockchain
|
84
98
|
email:
|
85
99
|
- dilumnavanjana@gmail.com
|
@@ -121,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
135
|
version: '0'
|
122
136
|
requirements: []
|
123
137
|
rubyforge_project:
|
124
|
-
rubygems_version: 2.6.
|
138
|
+
rubygems_version: 2.6.8
|
125
139
|
signing_key:
|
126
140
|
specification_version: 4
|
127
141
|
summary: Ruby API for Ethereum Blockchain network
|