itunes_api 0.7.0 → 0.8.0

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: '086360de32ce5889a48b42076307dad1053d3246'
4
- data.tar.gz: 23a2bd2b8077266ba0e7f80b4675f3e21648341a
3
+ metadata.gz: f7576f1eac0855f1297ab072243601c0e6511ff3
4
+ data.tar.gz: 2cfa9d98fc5445d5e5a72a7391e001c4c942ada9
5
5
  SHA512:
6
- metadata.gz: 5254e87655037e9627c841f531977aae91d3cff571dfe717784f1c75e451e77890960b25207cfae7ce392f754604024b53daa7a72570d69522a9585a3a32cf14
7
- data.tar.gz: aa4d762126de0bdf0087d2dd56ceba1690eed644ceca577247a269258ddd0afeb19c3ba32774ce08cc154b3699c7e08c9b72583d17e8a3d9905bd5e34fed3864
6
+ metadata.gz: c364afcb8ff9bdaa9592708d02841045507715bc87dd361b16b98976da06c4f83b33583831e4c978cef5d2c743146e4d52766a8dd57ee62b3747da20c7bb372e
7
+ data.tar.gz: d8f7ba091ea4c399d8676b391954bdf51aecb4d5a0a71d9c64721f1014aeff872824085a5f759c5ed058c51b9c87275e0b50752663aeeb209a2171ca59ec2e38
data/Gemfile CHANGED
@@ -1,5 +1,5 @@
1
1
  source 'https://rubygems.org'
2
- ruby '2.3.3'
2
+ ruby '2.4.1'
3
3
 
4
4
  # Specify your gem's dependencies in itunes_api.gemspec
5
5
  gemspec
data/itunes_api.gemspec CHANGED
@@ -32,6 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
33
33
 
34
34
  spec.add_dependency 'faraday'
35
+ spec.add_dependency 'selfies'
35
36
 
36
37
  spec.add_development_dependency 'bundler'
37
38
  spec.add_development_dependency 'rake'
@@ -2,9 +2,8 @@ module ItunesApi
2
2
  module Music
3
3
  # Wrapper for album results.
4
4
  class Album
5
- def initialize(data)
6
- @data = data
7
- end
5
+ attr_reader_init :data
6
+ private :data
8
7
 
9
8
  def self.build(albums_data)
10
9
  albums_data.map { |data| new(data) }
@@ -36,10 +35,6 @@ module ItunesApi
36
35
  released: released,
37
36
  }
38
37
  end
39
-
40
- private
41
-
42
- attr_reader :data
43
38
  end
44
39
  end
45
40
  end
@@ -2,9 +2,8 @@ module ItunesApi
2
2
  module Music
3
3
  # Artist or Band from the Apple catalog
4
4
  class Artist
5
- def initialize(data)
6
- @data = data
7
- end
5
+ attr_reader_init :data
6
+ private :data
8
7
 
9
8
  def albums
10
9
  @albums ||= Album.build(data[:albums])
@@ -17,10 +16,6 @@ module ItunesApi
17
16
  def name
18
17
  @name ||= data[:artistName]
19
18
  end
20
-
21
- private
22
-
23
- attr_reader :data
24
19
  end
25
20
  end
26
21
  end
@@ -2,13 +2,8 @@ module ItunesApi
2
2
  module Music
3
3
  # Artist or Band resulting from a specific lookup
4
4
  class ArtistLookup
5
- def initialize(artist_id)
6
- @artist_id = artist_id
7
- end
8
-
9
- def self.artist(artist_id)
10
- new(artist_id).artist
11
- end
5
+ attr_reader_init :artist_id
6
+ selfie :artist
12
7
 
13
8
  def artist
14
9
  build_artist
@@ -16,8 +11,6 @@ module ItunesApi
16
11
 
17
12
  private
18
13
 
19
- attr_reader :artist_id
20
-
21
14
  def build_artist
22
15
  return lookup unless lookup
23
16
 
@@ -2,13 +2,8 @@ module ItunesApi
2
2
  module Music
3
3
  # Artists or Bands resulting from a search
4
4
  class ArtistSearch
5
- def initialize(name)
6
- @name = name
7
- end
8
-
9
- def self.artists(name)
10
- new(name).artists
11
- end
5
+ attr_reader_init :name
6
+ selfie :artists
12
7
 
13
8
  def artists
14
9
  @artists ||= artist_ids.map { |id| build_artist(id) }.compact
@@ -16,8 +11,6 @@ module ItunesApi
16
11
 
17
12
  private
18
13
 
19
- attr_reader :name
20
-
21
14
  def artist_ids
22
15
  @search ||= ItunesApi.artist_ids(name)
23
16
  end
@@ -3,14 +3,8 @@ module ItunesApi
3
3
  # Allows querying the API via lookup.
4
4
  class Lookup
5
5
  include Base
6
-
7
- def initialize(artist_id)
8
- @artist_id = artist_id
9
- end
10
-
11
- def self.artist_with_albums(id)
12
- new(id).artist_with_albums
13
- end
6
+ attr_reader_init :artist_id
7
+ selfie :artist_with_albums
14
8
 
15
9
  def artist_with_albums
16
10
  return artist unless artist
@@ -3,14 +3,8 @@ module ItunesApi
3
3
  # Fetch all the artist ids corresponding to a search term
4
4
  class Search
5
5
  include Base
6
-
7
- def initialize(artist_name)
8
- @artist_name = artist_name
9
- end
10
-
11
- def self.artist_ids(artist_name)
12
- new(artist_name).artist_ids
13
- end
6
+ attr_reader_init :artist_name
7
+ selfie :artist_ids
14
8
 
15
9
  def artist_ids
16
10
  results.collect do |result|
@@ -1,3 +1,3 @@
1
1
  module ItunesApi
2
- VERSION = '0.7.0'.freeze
2
+ VERSION = '0.8.0'.freeze
3
3
  end
data/lib/itunes_api.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'selfies'
1
2
  require 'itunes_api/configuration'
2
3
  require 'itunes_api/requests/all'
3
4
  require 'itunes_api/music/all'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itunes_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario D’Arco
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-25 00:00:00.000000000 Z
11
+ date: 2017-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: selfies
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -144,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
158
  version: '0'
145
159
  requirements: []
146
160
  rubyforge_project:
147
- rubygems_version: 2.5.2
161
+ rubygems_version: 2.6.11
148
162
  signing_key:
149
163
  specification_version: 4
150
164
  summary: iTunes Api