marver 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -1
- data/README.md +2 -0
- data/Rakefile +5 -0
- data/lib/marver/finders/comic_finder.rb +4 -6
- data/lib/marver/finders/event_finder.rb +4 -6
- data/lib/marver/finders/serie_finder.rb +4 -8
- data/lib/marver/finders/story_finder.rb +4 -8
- data/lib/marver/version.rb +1 -1
- data/spec/marver/entities/comic_spec.rb +1 -1
- data/spec/marver/finders/comic_finder_spec.rb +1 -1
- data/spec/marver/finders/event_finder_spec.rb +1 -1
- data/spec/marver/finders/serie_finder_spec.rb +1 -1
- data/spec/marver/finders/story_finder_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbf8f57412fffbdad133f75f085aee5884fac3ac
|
4
|
+
data.tar.gz: 159ecf070992f3aa39fe0c5816d004c10469ab93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 765d37edbb611c578372a73c360aa267489422827eea9693fcfaae436ee22124a7e2a4dde661e62f5e84cb76c484315bfd54f6e5c03984e29a04aeec53bc4948
|
7
|
+
data.tar.gz: 6c59c053d464407e0dfaa6a8895370534fe627195dadd0eb9914791277504415131f0cb27bd133dd364b95a73e74afb6acbfc11766a15003f899c5d76cf882cf
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
Marver
|
2
2
|
======
|
3
3
|
|
4
|
+
![TravisCI](https://travis-ci.org/fteem/marver.svg?branch=master)
|
5
|
+
|
4
6
|
Marver is an easy to use Ruby gem for [Marvel's API](http://developer.marvel.com/).
|
5
7
|
It is still very much work in progress. Has lots of rough edges that you might cut yourself on. You've been warned.
|
6
8
|
|
data/Rakefile
CHANGED
@@ -2,12 +2,10 @@ require './lib/marver.rb'
|
|
2
2
|
|
3
3
|
module Marver
|
4
4
|
class ComicFinder
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
Marver::Comic.build(results)
|
10
|
-
end
|
5
|
+
def find(options = {})
|
6
|
+
response = Marver::API::Client.new.get(:comics, options)
|
7
|
+
results = Marver::DataContainer.new(response).results
|
8
|
+
Marver::Comic.build(results)
|
11
9
|
end
|
12
10
|
end
|
13
11
|
end
|
@@ -2,12 +2,10 @@ require './lib/marver.rb'
|
|
2
2
|
|
3
3
|
module Marver
|
4
4
|
class EventFinder
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
Marver::Event.build(results)
|
10
|
-
end
|
5
|
+
def find(options = {})
|
6
|
+
response = Marver::API::Client.new.get(:events, options)
|
7
|
+
results = Marver::DataContainer.new(response).results
|
8
|
+
Marver::Event.build(results)
|
11
9
|
end
|
12
10
|
end
|
13
11
|
end
|
@@ -2,14 +2,10 @@ require './lib/marver.rb'
|
|
2
2
|
|
3
3
|
module Marver
|
4
4
|
class SerieFinder
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
results = Marver::DataContainer.new(response).results
|
10
|
-
Marver::Serie.build(results)
|
11
|
-
end
|
5
|
+
def find(conditions = {})
|
6
|
+
response = Marver::API::Client.new.get(:series, conditions)
|
7
|
+
results = Marver::DataContainer.new(response).results
|
8
|
+
Marver::Serie.build(results)
|
12
9
|
end
|
13
|
-
|
14
10
|
end
|
15
11
|
end
|
@@ -2,14 +2,10 @@ require './lib/marver.rb'
|
|
2
2
|
|
3
3
|
module Marver
|
4
4
|
class StoryFinder
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
results = Marver::DataContainer.new(response).results
|
10
|
-
Marver::Story.build(results)
|
11
|
-
end
|
5
|
+
def find(conditions = {})
|
6
|
+
response = Marver::API::Client.new.get(:stories, conditions)
|
7
|
+
results = Marver::DataContainer.new(response).results
|
8
|
+
Marver::Story.build(results)
|
12
9
|
end
|
13
|
-
|
14
10
|
end
|
15
11
|
end
|
data/lib/marver/version.rb
CHANGED
@@ -80,7 +80,7 @@ describe Marver::Comic do
|
|
80
80
|
expect(comic.text_objects.first.class).to eq Marver::TextObject
|
81
81
|
expect(comic.text_objects.first.type).to eq "issue_solicit_text"
|
82
82
|
expect(comic.text_objects.first.language).to eq "en-us"
|
83
|
-
expect(comic.text_objects.first.text).to
|
83
|
+
expect(comic.text_objects.first.text).to include "In that age, the remaining mutants created a stronghold, a last bastion for their dying race: Fortress X. And in that Age Of X, when humanity vowed to see Fortress X destroyed, a team of heroes and heroines found themselves united against this terrible mutant threat. This is their epoch!"
|
84
84
|
end
|
85
85
|
|
86
86
|
it '#urls - A set of public web site URLs for the resource.' do
|
@@ -13,7 +13,7 @@ describe Marver::ComicFinder do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
it 'builds a Comic out of the received json' do
|
16
|
-
expect(Marver::ComicFinder.find({ name: 'The Avengers' })).to be_kind_of(Marver::Comic)
|
16
|
+
expect(Marver::ComicFinder.new.find({ name: 'The Avengers' })).to be_kind_of(Marver::Comic)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -13,7 +13,7 @@ describe Marver::EventFinder do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
it 'builds an Event out of the received json' do
|
16
|
-
expect(Marver::EventFinder.find({ title: 'Fall of the Mutants' })).to be_kind_of(Marver::Event)
|
16
|
+
expect(Marver::EventFinder.new.find({ title: 'Fall of the Mutants' })).to be_kind_of(Marver::Event)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -14,7 +14,7 @@ describe Marver::SerieFinder do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'builds a Serie out of the received json' do
|
17
|
-
expect(Marver::SerieFinder.find({ name: 'The Avengers' })).to be_kind_of(Marver::Serie)
|
17
|
+
expect(Marver::SerieFinder.new.find({ name: 'The Avengers' })).to be_kind_of(Marver::Serie)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -14,7 +14,7 @@ describe Marver::StoryFinder do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'builds a Story out of the received json' do
|
17
|
-
expect(Marver::StoryFinder.find({ name: 'Cover #892' })).to be_kind_of(Marver::Story)
|
17
|
+
expect(Marver::StoryFinder.new.find({ name: 'Cover #892' })).to be_kind_of(Marver::Story)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|