doge_api 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/doge/api.rb +28 -0
- data/lib/{doge_chain.rb → doge/chain.rb} +0 -0
- data/lib/doge_api.rb +2 -28
- metadata +3 -3
- data/main.rb +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a59e01ba31bd1ced607b637a06c1abef101b245
|
4
|
+
data.tar.gz: 2e42764188e8d0701a9c323ba05d0bc00f7a16a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53b2a702418b19c50624fbf9174ee6ce2e2ae79b3467215e209b29061e1591541b8bb2c3d2fb6c4f7dae13d1541e1cb5d9a2eac4bc9fb20c980668c6c69b7665
|
7
|
+
data.tar.gz: 5ed23498cd803e1eb8aad522c72ecc504babcadbfc7928b95db5573edd1c361ba5921efdd20bb7653c631fb8404fde697158c8cdf22a26d2a37118fb17aa4ea2
|
data/lib/doge/api.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'uri'
|
2
|
+
require 'open-uri'
|
3
|
+
|
4
|
+
module DogeApi
|
5
|
+
class DogeApi
|
6
|
+
attr_accessor :api_key
|
7
|
+
|
8
|
+
def initialize(api_key)
|
9
|
+
@api_key = api_key
|
10
|
+
@base_uri = URI.parse('https://www.dogeapi.com/wow')
|
11
|
+
end
|
12
|
+
|
13
|
+
def build_uri(m, args)
|
14
|
+
uri = @base_uri
|
15
|
+
params = args.merge(:a => m, :api_key => @api_key)
|
16
|
+
uri.query = URI.encode_www_form(params)
|
17
|
+
uri
|
18
|
+
end
|
19
|
+
|
20
|
+
def fetch_uri(uri)
|
21
|
+
uri.open.read
|
22
|
+
end
|
23
|
+
|
24
|
+
def method_missing(m, args = {}, &block)
|
25
|
+
fetch_uri build_uri(m, args)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
File without changes
|
data/lib/doge_api.rb
CHANGED
@@ -1,28 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
module DogeApi
|
5
|
-
class DogeApi
|
6
|
-
attr_accessor :api_key
|
7
|
-
|
8
|
-
def initialize(api_key)
|
9
|
-
@api_key = api_key
|
10
|
-
@base_uri = URI.parse('https://www.dogeapi.com/wow')
|
11
|
-
end
|
12
|
-
|
13
|
-
def build_uri(m, args)
|
14
|
-
uri = @base_uri
|
15
|
-
params = args.merge(:a => m, :api_key => @api_key)
|
16
|
-
uri.query = URI.encode_www_form(params)
|
17
|
-
uri
|
18
|
-
end
|
19
|
-
|
20
|
-
def fetch_uri(uri)
|
21
|
-
uri.open.read
|
22
|
-
end
|
23
|
-
|
24
|
-
def method_missing(m, args = {}, &block)
|
25
|
-
fetch_uri build_uri(m, args)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
1
|
+
require_relative 'doge/api'
|
2
|
+
require_relative 'doge/chain'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doge_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxwell Bernstein
|
@@ -16,9 +16,9 @@ executables: []
|
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
|
-
- main.rb
|
20
19
|
- lib/doge_api.rb
|
21
|
-
- lib/
|
20
|
+
- lib/doge/api.rb
|
21
|
+
- lib/doge/chain.rb
|
22
22
|
homepage: http://github.com/tekknolagi/doge_api
|
23
23
|
licenses:
|
24
24
|
- MIT
|
data/main.rb
DELETED