justwatch_client 0.2.0 → 0.3.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
  SHA256:
3
- metadata.gz: d9258999fdcefdbe1322c829bf4944680fd7899e15b1849d74c7c35297730d1d
4
- data.tar.gz: a987d484a9ad6215c09e1125c83ba7f680628b67dfb5a97307890956a1d37d48
3
+ metadata.gz: 934c78534a6360e729b7fb12a2e308b22c1ca18fcecbf8de2f4ce41d7e78671d
4
+ data.tar.gz: d24e44e8f24fd081aff16bf901e6741ad40060e3ba0b077c0c43f42a2cd68659
5
5
  SHA512:
6
- metadata.gz: 7dd45ab1f768d972ac1e00870d76d94b9043209a3b503be90116e614afed510eba17919872ccfc77d5d5bed3c5f2dcbb446e8d1faebb07a70f082fd43d19bf75
7
- data.tar.gz: d101496d1e9e803bf23763d9f0f0172ca0eadacccdde432da20ebba3e9881a244f0a31643d79e1367fce648afa64f7285b16d9eeedc6ab1137383b42bc90c172
6
+ metadata.gz: adc769c12fb41be5e86d8019db486bc9ccca128a64388ab9f6aaa67989f3f729c3d4c083836f81bc610e19ff06e0b8e84c467d19667d8b5b0e7a739f562526d1
7
+ data.tar.gz: 0bc7080912a836b3f9674484aede00ccf28aaa2694c26d1f45e6ada381fcc8f5c977065342482a0b0440fcafab0c206536e7e93c4c1372a18a418dfecf56f4b8
data/CHANGELOG.md ADDED
@@ -0,0 +1,36 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.3.0]
9
+
10
+ ### Changed
11
+
12
+ - **Breaking:** Ruby 3.3 is now the minimum supported version (was 2.7).
13
+ - **Breaking:** Faraday is now required at `~> 2.0` (was `>= 1, < 3`). Faraday 1 is
14
+ end-of-life, and the JSON middleware this gem relies on only reached Faraday core
15
+ in 1.10, so the old constraint advertised support that never worked in practice.
16
+ - `JustWatch::Api.request` no longer mutates the `params` hash it is given; the API
17
+ token is merged into a copy.
18
+ - Development dependencies updated: RuboCop `~> 1.90`, WebMock `~> 3.26`,
19
+ debug `~> 1.11`. Added Rake `~> 13.4` and a `Rakefile` with a default
20
+ `spec` + `rubocop` task.
21
+ - CI now tests against Ruby 3.3, 3.4 and 4.0; the end-of-life 3.1 and 3.2 entries
22
+ were removed.
23
+ - The gemspec builds its file list from a `Dir` glob instead of shelling out to
24
+ `git ls-files`, and now declares `rubygems_mfa_required` along with the usual
25
+ source, changelog and bug tracker metadata.
26
+
27
+ ### Internal
28
+
29
+ - The private `COUNTRY_PATH`, `GENRE_PATH` and `PROVIDER_PATH` constants (which were
30
+ defined on the singleton class and therefore unreachable as
31
+ `JustWatch::Genre::GENRE_PATH`) are now private class methods, matching the path
32
+ helpers already used by `JustWatch::Content`.
33
+
34
+ ## [0.2.0]
35
+
36
+ - Initial documented release.
data/README.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  Ruby Client for JustWatch API
4
4
 
5
+ Requires Ruby >= 3.3.
6
+
7
+ ## Installation
8
+
9
+ Add it to your `Gemfile`:
10
+
11
+ ```ruby
12
+ gem 'justwatch_client'
13
+ ```
14
+
15
+ Then run `bundle install`. Or install it directly:
16
+
17
+ ```
18
+ gem install justwatch_client
19
+ ```
20
+
5
21
  ## How to configure
6
22
 
7
23
  If you are using Rails, the better way is to define an initializer in `config/initializers`, defining the default locale and the token (we encourage to not push the token to the repo).
@@ -15,7 +15,7 @@ module JustWatch
15
15
  end
16
16
 
17
17
  def request(path, params = {})
18
- connection.get([API_VERSION_URL, path].join, params.merge!(token: token)).body
18
+ connection.get([API_VERSION_URL, path].join, params.merge(token: token)).body
19
19
  rescue Faraday::ResourceNotFound
20
20
  raise JustWatch::NotFoundError
21
21
  rescue Faraday::UnauthorizedError
@@ -3,15 +3,19 @@
3
3
  module JustWatch
4
4
  Country = Struct.new(:url_part, :full_locale, :status, :country, :currency, keyword_init: true) do
5
5
  class << self
6
- COUNTRY_PATH = '/countries'
7
-
8
6
  def list
9
- countries = Api.request(COUNTRY_PATH)
7
+ countries = Api.request(countries_path)
10
8
 
11
9
  countries.map do |country|
12
10
  new(country.slice(*members))
13
11
  end
14
12
  end
13
+
14
+ private
15
+
16
+ def countries_path
17
+ '/countries'
18
+ end
15
19
  end
16
20
  end
17
21
  end
@@ -3,15 +3,19 @@
3
3
  module JustWatch
4
4
  Genre = Struct.new(:id, :translation, :short_name, :technical_name, keyword_init: true) do
5
5
  class << self
6
- GENRE_PATH = '/genres/all/locale'
7
-
8
6
  def list(locale: Api.locale)
9
- genres = Api.request([GENRE_PATH, locale].join('/'))
7
+ genres = Api.request(genres_path(locale))
10
8
 
11
9
  genres.map do |genre|
12
10
  new(genre.slice(*members))
13
11
  end
14
12
  end
13
+
14
+ private
15
+
16
+ def genres_path(locale)
17
+ "/genres/all/locale/#{locale}"
18
+ end
15
19
  end
16
20
  end
17
21
  end
@@ -4,15 +4,19 @@ module JustWatch
4
4
  Provider = Struct.new(:id, :technical_name, :short_name, :clear_name, :monetization_types, :icon_url, :slug,
5
5
  keyword_init: true) do
6
6
  class << self
7
- PROVIDER_PATH = '/providers/all/locale'
8
-
9
7
  def list(locale: Api.locale)
10
- providers = Api.request([PROVIDER_PATH, locale].join('/'))
8
+ providers = Api.request(providers_path(locale))
11
9
 
12
10
  providers.map do |provider|
13
11
  new(provider.slice(*members))
14
12
  end
15
13
  end
14
+
15
+ private
16
+
17
+ def providers_path(locale)
18
+ "/providers/all/locale/#{locale}"
19
+ end
16
20
  end
17
21
  end
18
22
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JustWatch
4
- VERSION = '0.2.0'
4
+ VERSION = '0.3.0'
5
5
  end
metadata CHANGED
@@ -1,36 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: justwatch_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandro Perea
8
8
  - Josep Casanovas
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2024-05-14 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: faraday
16
15
  requirement: !ruby/object:Gem::Requirement
17
16
  requirements:
18
- - - ">="
17
+ - - "~>"
19
18
  - !ruby/object:Gem::Version
20
- version: '1'
21
- - - "<"
22
- - !ruby/object:Gem::Version
23
- version: '3'
19
+ version: '2.0'
24
20
  type: :runtime
25
21
  prerelease: false
26
22
  version_requirements: !ruby/object:Gem::Requirement
27
23
  requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- version: '1'
31
- - - "<"
24
+ - - "~>"
32
25
  - !ruby/object:Gem::Version
33
- version: '3'
26
+ version: '2.0'
34
27
  description: Ruby API Client for JustWatch.
35
28
  email:
36
29
  - alejandro.perea.fdez@gmail.com
@@ -39,6 +32,7 @@ extensions: []
39
32
  extra_rdoc_files:
40
33
  - README.md
41
34
  files:
35
+ - CHANGELOG.md
42
36
  - LICENSE
43
37
  - README.md
44
38
  - lib/just_watch.rb
@@ -57,8 +51,12 @@ files:
57
51
  homepage: https://github.com/cineol-gems/justwatch-client
58
52
  licenses:
59
53
  - MIT
60
- metadata: {}
61
- post_install_message:
54
+ metadata:
55
+ homepage_uri: https://github.com/cineol-gems/justwatch-client
56
+ source_code_uri: https://github.com/cineol-gems/justwatch-client
57
+ changelog_uri: https://github.com/cineol-gems/justwatch-client/blob/main/CHANGELOG.md
58
+ bug_tracker_uri: https://github.com/cineol-gems/justwatch-client/issues
59
+ rubygems_mfa_required: 'true'
62
60
  rdoc_options:
63
61
  - "--charset=UTF-8"
64
62
  require_paths:
@@ -67,15 +65,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
67
65
  requirements:
68
66
  - - ">="
69
67
  - !ruby/object:Gem::Version
70
- version: '2.7'
68
+ version: '3.3'
71
69
  required_rubygems_version: !ruby/object:Gem::Requirement
72
70
  requirements:
73
71
  - - ">="
74
72
  - !ruby/object:Gem::Version
75
73
  version: '0'
76
74
  requirements: []
77
- rubygems_version: 3.3.7
78
- signing_key:
75
+ rubygems_version: 3.6.9
79
76
  specification_version: 4
80
77
  summary: Ruby API Client for JustWatch
81
78
  test_files: []