web_api 0.0.0 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +2 -0
- data/Manifest.txt +2 -0
- data/README.rdoc +2 -2
- data/examples/blockexplorer +16 -0
- data/lib/web_api/auto.rb +20 -0
- data/lib/web_api/version.rb +1 -1
- data/lib/web_api.rb +1 -0
- data/web_api.gemspec +5 -3
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8765bd7c5bf244439ea4930d925e8bba2340cc0c
|
4
|
+
data.tar.gz: 83059e8f9f9024398880e33869e5faeebaff4212
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebcade1ce08d06c82ff11b3716c2dc82aaeb32e87b675338636b8b7a053b1510e1e38f785b4d5b03004c96f0e07fb85e18c916fae9053a8ed31ec38943b1ff7b
|
7
|
+
data.tar.gz: f2fda298efd7d459f78885ce8f7a8b44143c548ff900491773f343e80da727ab3b3ba66efe2d58b7624d3a933bbbc0839982e327110581b3a38fb1b73b5d3c34
|
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
@@ -3,6 +3,7 @@ Manifest.txt
|
|
3
3
|
README.rdoc
|
4
4
|
TODO.txt
|
5
5
|
examples/bitcoincharts
|
6
|
+
examples/blockexplorer
|
6
7
|
examples/mtgox1
|
7
8
|
examples/mtgox2
|
8
9
|
examples/twitter
|
@@ -11,6 +12,7 @@ features/main.feature
|
|
11
12
|
features/step_definitions/main_steps.rb
|
12
13
|
lib/web_api.rb
|
13
14
|
lib/web_api/auth.rb
|
15
|
+
lib/web_api/auto.rb
|
14
16
|
lib/web_api/client.rb
|
15
17
|
lib/web_api/signed.rb
|
16
18
|
lib/web_api/signed2.rb
|
data/README.rdoc
CHANGED
@@ -11,7 +11,7 @@ In Beta. Testing not done. Only GET and POST implemented.
|
|
11
11
|
|
12
12
|
Looks like there's enough to be useful, and
|
13
13
|
wanted register the name.
|
14
|
-
I think the front end
|
14
|
+
I think the front end is fixed, so
|
15
15
|
the synopsis below is not likely to change.
|
16
16
|
|
17
17
|
== SYNOPSIS:
|
@@ -19,7 +19,7 @@ the synopsis below is not likely to change.
|
|
19
19
|
require 'web_api'
|
20
20
|
webapi = WEB_API::WebApi.new
|
21
21
|
### **Name** **Url** **Type(get or post)**
|
22
|
-
webapi.
|
22
|
+
webapi.add('wutuwant', 'http://service.org/v1/wutuwant', 'get')
|
23
23
|
# You can pass the post's (or query's) key value pairs in a hash.
|
24
24
|
response = webapi.wutuwant({'key'=>'value' })
|
25
25
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This Gem:
|
3
|
+
require 'web_api'
|
4
|
+
|
5
|
+
BX = WEB_API::Auto.new('http://blockexplorer.com/q/')
|
6
|
+
LJ = 55
|
7
|
+
|
8
|
+
puts "*** BlockExplorer.com ***"
|
9
|
+
print "Difficulty:\t"
|
10
|
+
puts BX.getdifficulty
|
11
|
+
print "Block Count:\t"
|
12
|
+
puts BX.getblockcount
|
13
|
+
# Etc... see http://blockexplorer.com/q/ for the API method list.
|
14
|
+
# But wait,... can it do this??? (address is associated with WikiLeaks.)
|
15
|
+
print "addressbalance('1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v'): ".ljust(LJ)
|
16
|
+
puts BX.addressbalance('1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v')
|
data/lib/web_api/auto.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
module WEB_API
|
2
|
+
|
3
|
+
class Auto < WebApi
|
4
|
+
|
5
|
+
# base no longer optional
|
6
|
+
def initialize(base)
|
7
|
+
super(base)
|
8
|
+
end
|
9
|
+
|
10
|
+
def method_missing(symbol , *args)
|
11
|
+
if @webmethods.has_key?(symbol)
|
12
|
+
return @webmethods[symbol].call(args)
|
13
|
+
end
|
14
|
+
path = (args.length > 0)? (symbol.to_s + '/' + args.join('/')) : symbol.to_s
|
15
|
+
uri = URI.parse _url(path)
|
16
|
+
WebApiMethod.new(uri, :get).call([])
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end # WEB_API
|
data/lib/web_api/version.rb
CHANGED
data/lib/web_api.rb
CHANGED
data/web_api.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'web_api'
|
4
|
-
s.version = '0.
|
4
|
+
s.version = '0.1.0'
|
5
5
|
|
6
6
|
s.homepage = 'https://github.com/carlosjhr64/web_api'
|
7
7
|
|
8
8
|
s.author = 'CarlosJHR64'
|
9
9
|
s.email = 'carlosjhr64@gmail.com'
|
10
10
|
|
11
|
-
s.date = '
|
11
|
+
s.date = '2014-01-05'
|
12
12
|
s.licenses = ['MIT']
|
13
13
|
|
14
14
|
s.description = <<DESCRIPTION
|
@@ -31,6 +31,7 @@ Manifest.txt
|
|
31
31
|
README.rdoc
|
32
32
|
TODO.txt
|
33
33
|
examples/bitcoincharts
|
34
|
+
examples/blockexplorer
|
34
35
|
examples/mtgox1
|
35
36
|
examples/mtgox2
|
36
37
|
examples/twitter
|
@@ -39,6 +40,7 @@ features/main.feature
|
|
39
40
|
features/step_definitions/main_steps.rb
|
40
41
|
lib/web_api.rb
|
41
42
|
lib/web_api/auth.rb
|
43
|
+
lib/web_api/auto.rb
|
42
44
|
lib/web_api/client.rb
|
43
45
|
lib/web_api/signed.rb
|
44
46
|
lib/web_api/signed2.rb
|
@@ -53,6 +55,6 @@ web_api.gemspec
|
|
53
55
|
s.add_development_dependency 'oauth', '~> 0.4', '>= 0.4.7'
|
54
56
|
s.add_development_dependency 'signet', '~> 0.5', '>= 0.5.0'
|
55
57
|
s.add_development_dependency 'test-unit', '~> 2.5', '>= 2.5.5'
|
56
|
-
s.requirements << 'ruby: ruby 2.
|
58
|
+
s.requirements << 'ruby: ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]'
|
57
59
|
|
58
60
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CarlosJHR64
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: help_parser
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- README.rdoc
|
106
106
|
- TODO.txt
|
107
107
|
- examples/bitcoincharts
|
108
|
+
- examples/blockexplorer
|
108
109
|
- examples/mtgox1
|
109
110
|
- examples/mtgox2
|
110
111
|
- examples/twitter
|
@@ -113,6 +114,7 @@ files:
|
|
113
114
|
- features/step_definitions/main_steps.rb
|
114
115
|
- lib/web_api.rb
|
115
116
|
- lib/web_api/auth.rb
|
117
|
+
- lib/web_api/auto.rb
|
116
118
|
- lib/web_api/client.rb
|
117
119
|
- lib/web_api/signed.rb
|
118
120
|
- lib/web_api/signed2.rb
|
@@ -142,9 +144,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
144
|
- !ruby/object:Gem::Version
|
143
145
|
version: '0'
|
144
146
|
requirements:
|
145
|
-
- 'ruby: ruby 2.
|
147
|
+
- 'ruby: ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]'
|
146
148
|
rubyforge_project:
|
147
|
-
rubygems_version: 2.0
|
149
|
+
rubygems_version: 2.2.0
|
148
150
|
signing_key:
|
149
151
|
specification_version: 4
|
150
152
|
summary: Ruby library for web api's.
|