assonnato 0.3 → 0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7bf0c9bace1cba740c2d2baf731eb83a29d06448
4
- data.tar.gz: 8d82815b08a39fb20f06e5507804c97a9d9fb781
3
+ metadata.gz: 5839ba4848b1c31ccbcfc0bd3851e161552284a7
4
+ data.tar.gz: 8ba7e088195078311134df1925e7d609e09f4489
5
5
  SHA512:
6
- metadata.gz: abfd1ad2037dd4ea1eaf410e77ecf5e6262c5291f796cbc5bfd489f48ff96829977ee9cb78324871adcc87cb70d70fea3bedfff132784efd80b226b598e326c6
7
- data.tar.gz: 7d8778facdc126d5a7da4d373274c1a3d4e9b2eaf3690c340458db6d8f1b612c63aaf69a1c0a8fd93b484ab6536d2b9a57eb1dc38095557548ee64fa32b4a654
6
+ metadata.gz: e275a7a8b2c11b96d1ae672c8f6d15d846aed4093455133453f47457caa4fe7558147b47a612da5b01c5bbc6e300d9472a3123338ec53bf76e90f2f8e0918bc9
7
+ data.tar.gz: e626a45edc0cb9cb7c88618e457444396a2b82da3b64d8f31b9478e0cdce45a43cf52074a61522de688f91361ebb47763ad82e934b7fec8c3b1f87dee7f04983
@@ -13,5 +13,13 @@ module Assonnato
13
13
  def all!(show)
14
14
  parse get(@host, "/shows/get/#{URI.escape show}/episodes/all")
15
15
  end
16
+
17
+ def search!(keyword)
18
+ raise NotImplementedError, 'you can search only the shows'
19
+ end
20
+
21
+ def get!(show, episode)
22
+ all!(show).select { |ep| ep.id == episode }
23
+ end
16
24
  end
17
25
  end
@@ -9,5 +9,5 @@
9
9
  #++
10
10
 
11
11
  module Assonnato
12
- VERSION = '0.3'
12
+ VERSION = '0.4'
13
13
  end
data/spec/episode_spec.rb CHANGED
@@ -13,4 +13,18 @@ describe 'Assonnato' do
13
13
  res.first.should be_kind_of(Struct)
14
14
  res.first.episode.should eql(1)
15
15
  end
16
+
17
+ it 'can\'t search episodes' do
18
+ expect {
19
+ @episode.search!('monogatari')
20
+ }.to raise_error(NotImplementedError)
21
+ end
22
+
23
+ it 'returns a specific episode of the given show' do
24
+ res = @episode.get! 'Monogatari Second Series', 1
25
+ res.should be_kind_of(Array)
26
+ res.should_not be_empty
27
+ res.first.should be_kind_of(Struct)
28
+ res.first.episode.should eql(1)
29
+ end
16
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assonnato
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: '0.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Capuano