marvel_api 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -3
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/lib/marvel/client.rb +6 -1
- data/lib/marvel/connection.rb +22 -0
- data/lib/marvel/request.rb +16 -0
- data/{marvel.gemspec → marvel_api.gemspec} +8 -7
- metadata +7 -6
- data/Gemfile.lock +0 -96
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b054231edc23422b951341a6f9c0bab18d9071a6
|
4
|
+
data.tar.gz: 295bfd3aa2b6d23bb2b37fa3698fd68399a3aadc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bf6f671c3c305fdd9dfba0152604d06fce6f798f0b1cca059b75b5eaff690d124f42d6c087237b42e418d15d10e2b40a53c65027051969704da1b6074ea1530
|
7
|
+
data.tar.gz: 9a2a9c6cb44835ddd3987c511144d0733a00fe96c8c2159b7e6cf318d8134ec871ea1ae1cc8d69bb604d9b8c218bab9cd4072e7a1a05ab277c0ba7c443c66a4e
|
data/README.md
CHANGED
@@ -1,8 +1,16 @@
|
|
1
|
-
#
|
1
|
+
# marvel_api
|
2
2
|
|
3
|
-
Ruby bindings for the [Marvel API](http://developer.marvel.com/).
|
3
|
+
Ruby bindings for the [Marvel API](http://developer.marvel.com/). Still under construction... Feel free to contribute!
|
4
4
|
|
5
|
-
##
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
`gem install 'marvel_api'` or add `gem 'marvel_api'` to your Gemfile.
|
8
|
+
|
9
|
+
## Documentation
|
10
|
+
|
11
|
+
Coming soon.
|
12
|
+
|
13
|
+
## Contributing to marvel_api
|
6
14
|
|
7
15
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
8
16
|
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
data/Rakefile
CHANGED
@@ -18,7 +18,7 @@ Jeweler::Tasks.new do |gem|
|
|
18
18
|
gem.homepage = "http://github.com/O-I/marvel"
|
19
19
|
gem.license = "MIT"
|
20
20
|
gem.summary = %Q{Ruby bindings for the Marvel API}
|
21
|
-
gem.description = %Q{
|
21
|
+
gem.description = %Q{Marvel_API is a Ruby gem that lets you explore the Marvel Universe like never before.}
|
22
22
|
gem.email = "hore.rahul@gmail.com"
|
23
23
|
gem.authors = ["Rahul Horé"]
|
24
24
|
# dependencies defined in Gemfile
|
@@ -38,7 +38,7 @@ Rake::RDocTask.new do |rdoc|
|
|
38
38
|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
39
39
|
|
40
40
|
rdoc.rdoc_dir = 'rdoc'
|
41
|
-
rdoc.title = "
|
41
|
+
rdoc.title = "marvel_api #{version}"
|
42
42
|
rdoc.rdoc_files.include('README*')
|
43
43
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
44
44
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/marvel/client.rb
CHANGED
@@ -2,13 +2,17 @@ require 'json'
|
|
2
2
|
require 'time'
|
3
3
|
require 'faraday'
|
4
4
|
require 'digest/md5'
|
5
|
+
require_relative 'request'
|
6
|
+
require_relative 'connection'
|
5
7
|
require_relative 'configuration'
|
6
8
|
|
7
9
|
module Marvel
|
8
10
|
class Client
|
11
|
+
include Marvel::Request
|
12
|
+
include Marvel::Connection
|
9
13
|
include Marvel::Configuration
|
10
14
|
|
11
|
-
BASE_URL = 'https://gateway.marvel.com/v1/public/'
|
15
|
+
# BASE_URL = 'https://gateway.marvel.com/v1/public/'
|
12
16
|
|
13
17
|
def initialize
|
14
18
|
reset
|
@@ -35,6 +39,7 @@ module Marvel
|
|
35
39
|
def get_character(id)
|
36
40
|
# v1/public/characters/{characterId}
|
37
41
|
Faraday.get("#{BASE_URL}characters/#{id}#{auth}").body
|
42
|
+
# get("characters/#{id}#{auth}")
|
38
43
|
end
|
39
44
|
|
40
45
|
# fetches lists of comics filtered by a character id
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'faraday/middleware'
|
2
|
+
|
3
|
+
module Marvel
|
4
|
+
module Connection
|
5
|
+
private
|
6
|
+
|
7
|
+
def connection
|
8
|
+
options = {
|
9
|
+
ssl: { verify: false },
|
10
|
+
url: 'https://gateway.marvel.com/v1/public/'
|
11
|
+
}
|
12
|
+
|
13
|
+
Faraday.new(options) do |connection|
|
14
|
+
connection.use Faraday::Request::UrlEncoded
|
15
|
+
connection.use Faraday::Response::RaiseError
|
16
|
+
connection.use Faraday::Response::Rashify
|
17
|
+
connection.use Faraday::Response::ParseJson
|
18
|
+
connection.adapter(Faraday.default_adapter)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Marvel
|
2
|
+
module Request
|
3
|
+
def get(path, options = {})
|
4
|
+
request(:get, path, options)
|
5
|
+
end
|
6
|
+
|
7
|
+
private
|
8
|
+
|
9
|
+
def request(method, path, options)
|
10
|
+
response = connection.send(method) do |request|
|
11
|
+
request.url(path, options)
|
12
|
+
end
|
13
|
+
response.body
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub:
|
5
|
+
# stub: marvel_api 0.1.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
|
-
s.name = "
|
9
|
-
s.version = "0.1.
|
8
|
+
s.name = "marvel_api"
|
9
|
+
s.version = "0.1.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.authors = ["Rahul Hor\u{e9}"]
|
13
|
-
s.date = "2014-02-
|
14
|
-
s.description = "
|
13
|
+
s.date = "2014-02-13"
|
14
|
+
s.description = "Marvel_API is a Ruby gem that lets you explore the Marvel Universe like never before."
|
15
15
|
s.email = "hore.rahul@gmail.com"
|
16
16
|
s.extra_rdoc_files = [
|
17
17
|
"LICENSE.txt",
|
@@ -21,7 +21,6 @@ Gem::Specification.new do |s|
|
|
21
21
|
".document",
|
22
22
|
".rspec",
|
23
23
|
"Gemfile",
|
24
|
-
"Gemfile.lock",
|
25
24
|
"LICENSE.txt",
|
26
25
|
"README.md",
|
27
26
|
"Rakefile",
|
@@ -29,7 +28,9 @@ Gem::Specification.new do |s|
|
|
29
28
|
"lib/marvel.rb",
|
30
29
|
"lib/marvel/client.rb",
|
31
30
|
"lib/marvel/configuration.rb",
|
32
|
-
"marvel.
|
31
|
+
"lib/marvel/connection.rb",
|
32
|
+
"lib/marvel/request.rb",
|
33
|
+
"marvel_api.gemspec",
|
33
34
|
"spec/marvel_spec.rb",
|
34
35
|
"spec/spec_helper.rb"
|
35
36
|
]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marvel_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rahul Horé
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -122,8 +122,8 @@ dependencies:
|
|
122
122
|
- - '>='
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
-
description:
|
126
|
-
before.
|
125
|
+
description: Marvel_API is a Ruby gem that lets you explore the Marvel Universe like
|
126
|
+
never before.
|
127
127
|
email: hore.rahul@gmail.com
|
128
128
|
executables: []
|
129
129
|
extensions: []
|
@@ -134,7 +134,6 @@ files:
|
|
134
134
|
- .document
|
135
135
|
- .rspec
|
136
136
|
- Gemfile
|
137
|
-
- Gemfile.lock
|
138
137
|
- LICENSE.txt
|
139
138
|
- README.md
|
140
139
|
- Rakefile
|
@@ -142,7 +141,9 @@ files:
|
|
142
141
|
- lib/marvel.rb
|
143
142
|
- lib/marvel/client.rb
|
144
143
|
- lib/marvel/configuration.rb
|
145
|
-
- marvel.
|
144
|
+
- lib/marvel/connection.rb
|
145
|
+
- lib/marvel/request.rb
|
146
|
+
- marvel_api.gemspec
|
146
147
|
- spec/marvel_spec.rb
|
147
148
|
- spec/spec_helper.rb
|
148
149
|
homepage: http://github.com/O-I/marvel
|
data/Gemfile.lock
DELETED
@@ -1,96 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: https://rubygems.org/
|
3
|
-
specs:
|
4
|
-
activesupport (4.0.2)
|
5
|
-
i18n (~> 0.6, >= 0.6.4)
|
6
|
-
minitest (~> 4.2)
|
7
|
-
multi_json (~> 1.3)
|
8
|
-
thread_safe (~> 0.1)
|
9
|
-
tzinfo (~> 0.3.37)
|
10
|
-
addressable (2.3.5)
|
11
|
-
atomic (1.1.14)
|
12
|
-
builder (3.2.2)
|
13
|
-
coderay (1.1.0)
|
14
|
-
diff-lcs (1.2.5)
|
15
|
-
docile (1.1.2)
|
16
|
-
faraday (0.8.9)
|
17
|
-
multipart-post (~> 1.2.0)
|
18
|
-
git (1.2.6)
|
19
|
-
github_api (0.10.1)
|
20
|
-
addressable
|
21
|
-
faraday (~> 0.8.1)
|
22
|
-
hashie (>= 1.2)
|
23
|
-
multi_json (~> 1.4)
|
24
|
-
nokogiri (~> 1.5.2)
|
25
|
-
oauth2
|
26
|
-
hashie (2.0.5)
|
27
|
-
highline (1.6.20)
|
28
|
-
i18n (0.6.9)
|
29
|
-
jeweler (1.8.8)
|
30
|
-
builder
|
31
|
-
bundler (~> 1.0)
|
32
|
-
git (>= 1.2.5)
|
33
|
-
github_api (= 0.10.1)
|
34
|
-
highline (>= 1.6.15)
|
35
|
-
nokogiri (= 1.5.10)
|
36
|
-
rake
|
37
|
-
rdoc
|
38
|
-
json (1.8.1)
|
39
|
-
jwt (0.1.11)
|
40
|
-
multi_json (>= 1.5)
|
41
|
-
method_source (0.8.2)
|
42
|
-
minitest (4.7.5)
|
43
|
-
multi_json (1.8.4)
|
44
|
-
multi_xml (0.5.5)
|
45
|
-
multipart-post (1.2.0)
|
46
|
-
nokogiri (1.5.10)
|
47
|
-
oauth2 (0.9.3)
|
48
|
-
faraday (>= 0.8, < 0.10)
|
49
|
-
jwt (~> 0.1.8)
|
50
|
-
multi_json (~> 1.3)
|
51
|
-
multi_xml (~> 0.5)
|
52
|
-
rack (~> 1.2)
|
53
|
-
pry (0.9.12.6)
|
54
|
-
coderay (~> 1.0)
|
55
|
-
method_source (~> 0.8)
|
56
|
-
slop (~> 3.4)
|
57
|
-
rack (1.5.2)
|
58
|
-
rake (10.1.1)
|
59
|
-
rdoc (3.12.2)
|
60
|
-
json (~> 1.4)
|
61
|
-
rspec (2.14.1)
|
62
|
-
rspec-core (~> 2.14.0)
|
63
|
-
rspec-expectations (~> 2.14.0)
|
64
|
-
rspec-mocks (~> 2.14.0)
|
65
|
-
rspec-core (2.14.7)
|
66
|
-
rspec-expectations (2.14.5)
|
67
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
68
|
-
rspec-mocks (2.14.5)
|
69
|
-
shoulda (3.5.0)
|
70
|
-
shoulda-context (~> 1.0, >= 1.0.1)
|
71
|
-
shoulda-matchers (>= 1.4.1, < 3.0)
|
72
|
-
shoulda-context (1.1.6)
|
73
|
-
shoulda-matchers (2.5.0)
|
74
|
-
activesupport (>= 3.0.0)
|
75
|
-
simplecov (0.8.2)
|
76
|
-
docile (~> 1.1.0)
|
77
|
-
multi_json
|
78
|
-
simplecov-html (~> 0.8.0)
|
79
|
-
simplecov-html (0.8.0)
|
80
|
-
slop (3.4.7)
|
81
|
-
thread_safe (0.1.3)
|
82
|
-
atomic
|
83
|
-
tzinfo (0.3.38)
|
84
|
-
|
85
|
-
PLATFORMS
|
86
|
-
ruby
|
87
|
-
|
88
|
-
DEPENDENCIES
|
89
|
-
bundler (~> 1.0)
|
90
|
-
faraday
|
91
|
-
jeweler (~> 1.8.7)
|
92
|
-
pry
|
93
|
-
rdoc (~> 3.12)
|
94
|
-
rspec
|
95
|
-
shoulda
|
96
|
-
simplecov
|