itunes_api 2.3.1 → 2.3.2

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
- SHA1:
3
- metadata.gz: e787203153382036331296dfdf3c880c9b64ae3d
4
- data.tar.gz: 5142689e8cb18846924f4b828fcb980590ef7c63
2
+ SHA256:
3
+ metadata.gz: 9d619427a217649c40574e01b2318d7571561d836a8c1c2332746ee02689612e
4
+ data.tar.gz: 26115cc1ac22837f4f5aeb431e53fa6f6b006c0795e32039c88974a6db73a11b
5
5
  SHA512:
6
- metadata.gz: 03be14d45c6fbb9c3331a4fac276fb6c1f5a195bd11fa0574db9c060a95e8b619dc5021efe1d08db5669a4f97ebde9a0864aa1298571ee3c6b05f8e9e27823fa
7
- data.tar.gz: 8e2c1be2325a65c122fb9cd722c4f70f9ced3d6a7f2ffbdf6899cd3df9ccddf959d1d7afbcdd7c1a7e88db9590d8adb3caf964144ced5e14a8663862b00ac5c5
6
+ metadata.gz: 5b47579f3815b43410cc643d161105986d3498cfde0c7bf1187e9c37af52c50cff33c7d77f93e47e070a9e1c493143d99754cae3d0cd172cfde81dda00ffcd6d
7
+ data.tar.gz: 7384875e00282e6024fa3f26e2c0bbbc5392926f0c0e83bcf2636a67bfa62693aa8e723e0c346c28e2757476070e8cc27fafca6f62e013ced1fac899134279ac
@@ -0,0 +1,42 @@
1
+ version: 2
2
+ jobs:
3
+ build:
4
+ docker:
5
+ - image: circleci/ruby:2.5.1-node-browsers
6
+
7
+ working_directory: ~/repo
8
+
9
+ steps:
10
+ - checkout
11
+
12
+ - restore_cache:
13
+ keys:
14
+ - v1-dependencies-{{ checksum "Gemfile.lock" }}
15
+ - v1-dependencies-
16
+
17
+ - run:
18
+ name: install dependencies
19
+ command: |
20
+ bundle install --jobs=4 --retry=3 --path vendor/bundle
21
+
22
+ - save_cache:
23
+ paths:
24
+ - ./vendor/bundle
25
+ key: v1-dependencies-{{ checksum "Gemfile.lock" }}
26
+
27
+ - run:
28
+ name: run tests
29
+ command: |
30
+ mkdir /tmp/test-results
31
+ TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
32
+
33
+ bundle exec rspec --format progress \
34
+ --out /tmp/test-results/rspec.xml \
35
+ --format progress \
36
+ $TEST_FILES
37
+
38
+ - store_test_results:
39
+ path: /tmp/test-results
40
+ - store_artifacts:
41
+ path: /tmp/test-results
42
+ destination: test-results
data/.gitignore CHANGED
@@ -2,7 +2,6 @@
2
2
  /.yardoc
3
3
  /_yardoc/
4
4
  /doc/
5
- /Gemfile.lock
6
5
  /pkg/
7
6
  /spec/reports/
8
7
  /tmp/
data/.rspec CHANGED
File without changes
data/.rubocop.yml ADDED
@@ -0,0 +1,24 @@
1
+ AllCops:
2
+ DisplayCopNames: true
3
+ Exclude:
4
+ - bin/**/*
5
+ - vendor/**/*
6
+ TargetRubyVersion: 2.5.1
7
+
8
+ Metrics/BlockLength:
9
+ Exclude:
10
+ - '**/*_spec.rb'
11
+
12
+ Metrics/MethodLength:
13
+ Max: 15
14
+
15
+ Metrics/LineLength:
16
+ Max: 100
17
+
18
+ Metrics/ModuleLength:
19
+ Exclude:
20
+ - '**/*_spec.rb'
21
+
22
+ Style/FrozenStringLiteralComment:
23
+ Exclude:
24
+ - '**/*_spec.rb'
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.5.1
data/CODE_OF_CONDUCT.md CHANGED
File without changes
data/Gemfile CHANGED
@@ -1,4 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
- ruby '2.4.2'
4
+
5
+ Encoding.default_external = Encoding::UTF_8
6
+ Encoding.default_internal = Encoding::UTF_8
3
7
 
4
8
  gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,61 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ itunes_api (2.3.2)
5
+ faraday
6
+ selfies
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ ast (2.4.0)
12
+ diff-lcs (1.3)
13
+ faraday (0.15.2)
14
+ multipart-post (>= 1.2, < 3)
15
+ jaro_winkler (1.5.1)
16
+ multipart-post (2.0.0)
17
+ parallel (1.12.1)
18
+ parser (2.5.1.0)
19
+ ast (~> 2.4.0)
20
+ powerpack (0.1.2)
21
+ rainbow (3.0.0)
22
+ rake (12.3.1)
23
+ rspec (3.7.0)
24
+ rspec-core (~> 3.7.0)
25
+ rspec-expectations (~> 3.7.0)
26
+ rspec-mocks (~> 3.7.0)
27
+ rspec-core (3.7.1)
28
+ rspec-support (~> 3.7.0)
29
+ rspec-expectations (3.7.0)
30
+ diff-lcs (>= 1.2.0, < 2.0)
31
+ rspec-support (~> 3.7.0)
32
+ rspec-mocks (3.7.0)
33
+ diff-lcs (>= 1.2.0, < 2.0)
34
+ rspec-support (~> 3.7.0)
35
+ rspec-support (3.7.1)
36
+ rubocop (0.57.2)
37
+ jaro_winkler (~> 1.5.1)
38
+ parallel (~> 1.10)
39
+ parser (>= 2.5)
40
+ powerpack (~> 0.1)
41
+ rainbow (>= 2.2.2, < 4.0)
42
+ ruby-progressbar (~> 1.7)
43
+ unicode-display_width (~> 1.0, >= 1.0.1)
44
+ ruby-progressbar (1.9.0)
45
+ selfies (1.4.2)
46
+ unicode-display_width (1.4.0)
47
+ vcr (4.0.0)
48
+
49
+ PLATFORMS
50
+ ruby
51
+
52
+ DEPENDENCIES
53
+ bundler
54
+ itunes_api!
55
+ rake
56
+ rspec
57
+ rubocop
58
+ vcr
59
+
60
+ BUNDLED WITH
61
+ 1.16.2
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2017 Mario D’Arco
3
+ Copyright (c) 2018 Mario D’Arco
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ItunesApi
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/itunes_api.svg)](https://badge.fury.io/rb/itunes_api) [![Dependency Status](https://gemnasium.com/badges/github.com/mariodarco/itunes-api.svg)](https://gemnasium.com/github.com/mariodarco/itunes-api) [![CircleCI](https://circleci.com/gh/mariodarco/itunes-api/tree/master.svg?style=shield)](https://circleci.com/gh/mariodarco/itunes-api/tree/master)
3
+ [![Gem Version](https://badge.fury.io/rb/itunes_api.svg)](https://badge.fury.io/rb/itunes_api) [![CircleCI](https://circleci.com/gh/mariodarco/itunes-api/tree/master.svg?style=shield)](https://circleci.com/gh/mariodarco/itunes-api/tree/master) [![Maintainability](https://api.codeclimate.com/v1/badges/2f78e613782a1d0be4f0/maintainability)](https://codeclimate.com/github/mariodarco/itunes-api/maintainability)
4
4
 
5
5
  A simple interface for the Itunes Api.
6
6
 
@@ -94,7 +94,7 @@ ItunesApi::Music.find_albums_by_apple_id(265766061, :es)
94
94
  Ruby version:
95
95
 
96
96
  ```text
97
- 2.4.2
97
+ 2.5.1
98
98
  ```
99
99
 
100
100
  Fork the project, clone the repository and bundle:
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
 
data/itunes_api.gemspec CHANGED
@@ -1,6 +1,6 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('../lib', __FILE__)
3
+ lib = File.expand_path('lib', __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require 'itunes_api/version'
6
6
 
@@ -1,6 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'singleton'
2
4
 
3
5
  module ItunesApi
6
+ # Used to hold configurations
4
7
  class Configuration
5
8
  include Singleton
6
9
  attr_accessor :country_code
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'date'
2
4
  module ItunesApi
3
5
  module Music
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ItunesApi
2
4
  module Music
3
5
  # Artist or Band from the Apple catalog
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ItunesApi
2
4
  module Music
3
5
  module Requests
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ItunesApi
2
4
  module Music
3
5
  module Requests
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ItunesApi
2
4
  module Music
3
5
  module Requests
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ItunesApi
2
4
  module Music
3
5
  module Requests
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'requests/albums'
2
4
  require_relative 'requests/artist'
3
5
  require_relative 'requests/search'
@@ -1,10 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ItunesApi
2
4
  module Music
3
5
  module Results
4
6
  # Wrapper for album search results.
5
7
  class Album
6
8
  attr_reader_init :data, :store
7
- private :data
8
9
 
9
10
  def artist
10
11
  @artist ||= data['artistName']
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ItunesApi
2
4
  module Music
3
5
  module Results
@@ -1,10 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ItunesApi
2
4
  module Music
3
5
  module Results
4
6
  # Wrapper for song search results.
5
7
  class Song
6
8
  attr_reader_init :data, :store
7
- private :data
8
9
 
9
10
  def album
10
11
  @album ||= data['collectionName']
@@ -70,7 +71,7 @@ module ItunesApi
70
71
  private
71
72
 
72
73
  def track_lenght(milliseconds)
73
- if milliseconds.to_i > 0
74
+ if milliseconds.to_i.positive?
74
75
  minutes, milliseconds = milliseconds.divmod(1000 * 60)
75
76
  seconds = milliseconds / 1000
76
77
  "#{minutes}:#{seconds}"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'results/album'
2
4
  require_relative 'results/artist'
3
5
  require_relative 'results/song'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ItunesApi
2
4
  module Music
3
5
  # Wrapper for song results.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'request'
2
4
  require_relative 'music/requests'
3
5
  require_relative 'music/results'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'faraday'
2
4
  require 'json'
3
5
  module ItunesApi
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ItunesApi
2
- VERSION = '2.3.1'.freeze
4
+ VERSION = '2.3.2'
3
5
  end
data/lib/itunes_api.rb CHANGED
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'selfies'
2
4
  require 'itunes_api/configuration'
3
5
  require 'itunes_api/music'
4
6
 
5
7
  # Interface to the Itunes Api
6
8
  module ItunesApi
7
- BASE_URL = 'https://itunes.apple.com'.freeze
9
+ BASE_URL = 'https://itunes.apple.com'
8
10
  LIMIT = 200
9
11
 
10
12
  def self.configure
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: 2.3.1
4
+ version: 2.3.2
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-09-21 00:00:00.000000000 Z
11
+ date: 2018-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -115,10 +115,14 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
+ - ".circleci/config.yml"
118
119
  - ".gitignore"
119
120
  - ".rspec"
121
+ - ".rubocop.yml"
122
+ - ".ruby-version"
120
123
  - CODE_OF_CONDUCT.md
121
124
  - Gemfile
125
+ - Gemfile.lock
122
126
  - LICENSE.txt
123
127
  - README.md
124
128
  - Rakefile
@@ -163,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
167
  version: '0'
164
168
  requirements: []
165
169
  rubyforge_project:
166
- rubygems_version: 2.6.13
170
+ rubygems_version: 2.7.6
167
171
  signing_key:
168
172
  specification_version: 4
169
173
  summary: iTunes Api