michael_taylor_sdk 1.0.1 → 1.0.3

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: '03613032665901e43dc7312cdda7a49d87b9f83b64b7dfcdbdf770f4bfcc738c'
4
- data.tar.gz: c38a19752db68e459cf04cc60e1ce40a0799f8728e4d2a8d9489544bcdbcb08b
3
+ metadata.gz: e8b30e7ccf6f6bcc18a63d8b787177de07471fd211875f9eb6ef70ededcda393
4
+ data.tar.gz: '08e0c2cd9ca02dfe355a4f65badd24e9a634fbe8f0ca699d21d3abe978293836'
5
5
  SHA512:
6
- metadata.gz: eb0ff8e3afeba6adbda9fe7384dc84f46609d9787e69b7680e486b0dd16c2e44d7b6a124e1aae4f2cf8769275fb06e4a5531a1fcf6d97fed29c7583e338385dc
7
- data.tar.gz: b36786f16696fe52fbc8497792efd5b4cd0da946f205f6d8b5268ef5448416685042a5e2a089117a6d340bd2de7790881c7668cdda842263a26a52d40f5fc9bb
6
+ metadata.gz: d39d2fde766489ddd234a1d2109a0584aa6f57cd4b283e70dcd93e69ead8902e777dfd436888262a74eb533f0f9a2d48e37ea06d0c215fa46cc8fec3476387f7
7
+ data.tar.gz: a517a4361b6b0cd34b69763acfaba649570696d63dbaddf2ddce08b60ea7f31e09b7179256b50316473aad61ba2655ce9af4c5da5ccf526a6567bfd9346f1a8b
data/.rubocop.yml CHANGED
@@ -1,3 +1,7 @@
1
+ plugins:
2
+ - rubocop-rspec
3
+ - rubocop-rake
4
+
1
5
  AllCops:
2
6
  TargetRubyVersion: 3.0
3
7
  NewCops: enable
@@ -35,3 +39,9 @@ Metrics/BlockLength:
35
39
  Metrics/MethodLength:
36
40
  Exclude:
37
41
  - spec/**/*.rb
42
+
43
+ RSpec/ExampleLength:
44
+ Enabled: false
45
+
46
+ RSpec/MultipleExpectations:
47
+ Enabled: false
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.1
1
+ 3.4.2
data/Gemfile CHANGED
@@ -2,11 +2,16 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- # Specify your gem's dependencies in michael_taylor_sdk.gemspec
6
5
  gemspec
7
6
 
8
- gem "rake", "~> 13.0"
7
+ group :test, :development do
8
+ gem "rake", "~> 13.2"
9
9
 
10
- gem "rspec", "~> 3.12"
10
+ gem "rspec", "~> 3.13"
11
11
 
12
- gem "rubocop", "~> 1.48"
12
+ gem "rubocop", "~> 1.72"
13
+
14
+ gem "rubocop-rake", "~> 0.7.1"
15
+
16
+ gem "rubocop-rspec", "~> 3.5"
17
+ end
data/Gemfile.lock CHANGED
@@ -1,57 +1,71 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- michael_taylor_sdk (1.0.0)
4
+ michael_taylor_sdk (1.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  ast (2.4.2)
10
- diff-lcs (1.5.0)
11
- json (2.6.3)
12
- parallel (1.22.1)
13
- parser (3.2.1.1)
10
+ diff-lcs (1.6.0)
11
+ json (2.10.1)
12
+ language_server-protocol (3.17.0.4)
13
+ lint_roller (1.1.0)
14
+ parallel (1.26.3)
15
+ parser (3.3.7.1)
14
16
  ast (~> 2.4.1)
17
+ racc
18
+ racc (1.8.1)
15
19
  rainbow (3.1.1)
16
- rake (13.0.6)
17
- regexp_parser (2.7.0)
18
- rexml (3.2.5)
19
- rspec (3.12.0)
20
- rspec-core (~> 3.12.0)
21
- rspec-expectations (~> 3.12.0)
22
- rspec-mocks (~> 3.12.0)
23
- rspec-core (3.12.1)
24
- rspec-support (~> 3.12.0)
25
- rspec-expectations (3.12.2)
20
+ rake (13.2.1)
21
+ regexp_parser (2.10.0)
22
+ rspec (3.13.0)
23
+ rspec-core (~> 3.13.0)
24
+ rspec-expectations (~> 3.13.0)
25
+ rspec-mocks (~> 3.13.0)
26
+ rspec-core (3.13.3)
27
+ rspec-support (~> 3.13.0)
28
+ rspec-expectations (3.13.3)
26
29
  diff-lcs (>= 1.2.0, < 2.0)
27
- rspec-support (~> 3.12.0)
28
- rspec-mocks (3.12.4)
30
+ rspec-support (~> 3.13.0)
31
+ rspec-mocks (3.13.2)
29
32
  diff-lcs (>= 1.2.0, < 2.0)
30
- rspec-support (~> 3.12.0)
31
- rspec-support (3.12.0)
32
- rubocop (1.48.1)
33
+ rspec-support (~> 3.13.0)
34
+ rspec-support (3.13.2)
35
+ rubocop (1.72.2)
33
36
  json (~> 2.3)
37
+ language_server-protocol (~> 3.17.0.2)
38
+ lint_roller (~> 1.1.0)
34
39
  parallel (~> 1.10)
35
- parser (>= 3.2.0.0)
40
+ parser (>= 3.3.0.2)
36
41
  rainbow (>= 2.2.2, < 4.0)
37
- regexp_parser (>= 1.8, < 3.0)
38
- rexml (>= 3.2.5, < 4.0)
39
- rubocop-ast (>= 1.26.0, < 2.0)
42
+ regexp_parser (>= 2.9.3, < 3.0)
43
+ rubocop-ast (>= 1.38.0, < 2.0)
40
44
  ruby-progressbar (~> 1.7)
41
- unicode-display_width (>= 2.4.0, < 3.0)
42
- rubocop-ast (1.27.0)
43
- parser (>= 3.2.1.0)
45
+ unicode-display_width (>= 2.4.0, < 4.0)
46
+ rubocop-ast (1.38.0)
47
+ parser (>= 3.3.1.0)
48
+ rubocop-rake (0.7.1)
49
+ lint_roller (~> 1.1)
50
+ rubocop (>= 1.72.1)
51
+ rubocop-rspec (3.5.0)
52
+ lint_roller (~> 1.1)
53
+ rubocop (~> 1.72, >= 1.72.1)
44
54
  ruby-progressbar (1.13.0)
45
- unicode-display_width (2.4.2)
55
+ unicode-display_width (3.1.4)
56
+ unicode-emoji (~> 4.0, >= 4.0.4)
57
+ unicode-emoji (4.0.4)
46
58
 
47
59
  PLATFORMS
48
60
  x86_64-linux
49
61
 
50
62
  DEPENDENCIES
51
63
  michael_taylor_sdk!
52
- rake (~> 13.0)
53
- rspec (~> 3.12)
54
- rubocop (~> 1.48)
64
+ rake (~> 13.2)
65
+ rspec (~> 3.13)
66
+ rubocop (~> 1.72)
67
+ rubocop-rake (~> 0.7.1)
68
+ rubocop-rspec (~> 3.5)
55
69
 
56
70
  BUNDLED WITH
57
71
  2.4.6
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2023 Michael Taylor
3
+ Copyright (c) 2025 Michael Taylor
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/design.md ADDED
@@ -0,0 +1,18 @@
1
+ This SDK is designed around a pipeline that transforms an SDK method call
2
+ into an HTTP request and transforms the response into an easy to use result.
3
+ Each pipeline stage is defined under the pipeline directory.
4
+
5
+ Each pipeline stage is designed to have a simple transformation on the input and/or output.
6
+ * paginate add pagination parameters to the input and adds the returned pagination properties into the output
7
+ * filter adds query parameters to the input for queries like name=Movie Name
8
+ * json converts the output from a string to a Ruby Hash by parsing the string as JSON
9
+ * response_body pulls the body from the HTTP response and ensures it is present and not empty
10
+ * set_path adds the path information that will later be appended to the base URL
11
+ * retry runs a retry strategy to attempt to resolve server errors
12
+ * raise_http_errors converts the HTTP response classes into errors for 4XX and 5XX response codes
13
+ * get_request is the final stage that makes the HTTP request
14
+
15
+ The main SDK object has methods that provide access to the API paths. These are defined under the api_paths directory.
16
+ Currently there is just `.movies` but it could be expanded to include other paths like `.books` or `.characters`
17
+ by adding new subclasses of MichaelTaylorSdk::ApiPaths::Base. These subclasses only need to define the main path used
18
+ in the API and any custom queries that abstract away complexity from the user by adding filters or combining related calls.
@@ -27,6 +27,8 @@ module MichaelTaylorSdk::ApiPaths
27
27
  execute_pipeline(paginated_pipeline, {})
28
28
  end
29
29
  end
30
+ raise "Movie named #{name} not found" if movies[:items].empty?
31
+
30
32
  matching_movie = movies[:items][0]
31
33
  quotes_from_movie(matching_movie[:_id])
32
34
  end
@@ -29,7 +29,7 @@ module MichaelTaylorSdk::Errors
29
29
  # Errors related to processing the returned content
30
30
  class ContentError < StandardError
31
31
  def initialize(msg = nil)
32
- super(msg)
32
+ super
33
33
  end
34
34
  end
35
35
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MichaelTaylorSdk
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.3"
5
5
  end
@@ -30,7 +30,6 @@ module MichaelTaylorSdk
30
30
  base_url: DEFAULT_BASE_URL,
31
31
  default_retry_strategy: MichaelTaylorSdk::RetryStrategy::OneTry.new
32
32
  )
33
-
34
33
  raise "Access token must be given as a string" unless access_token.is_a? String
35
34
 
36
35
  @default_pipeline = lambda {
@@ -26,10 +26,4 @@ Gem::Specification.new do |spec|
26
26
  spec.bindir = "exe"
27
27
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
-
30
- # Uncomment to register a new dependency of your gem
31
- # spec.add_dependency "example-gem", "~> 1.0"
32
-
33
- # For more information and examples about making a new gem, check out our
34
- # guide at: https://bundler.io/guides/creating_gem.html
35
29
  end
metadata CHANGED
@@ -1,16 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: michael_taylor_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Taylor
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2023-03-15 00:00:00.000000000 Z
10
+ date: 2025-02-21 00:00:00.000000000 Z
12
11
  dependencies: []
13
- description:
14
12
  email:
15
13
  - mwtaylor@users.noreply.github.com
16
14
  executables: []
@@ -25,6 +23,7 @@ files:
25
23
  - LICENSE.txt
26
24
  - README.md
27
25
  - Rakefile
26
+ - design.md
28
27
  - lib/michael_taylor_sdk.rb
29
28
  - lib/michael_taylor_sdk/api_paths/all_paths.rb
30
29
  - lib/michael_taylor_sdk/api_paths/base.rb
@@ -52,7 +51,6 @@ licenses:
52
51
  metadata:
53
52
  rubygems_mfa_required: 'true'
54
53
  github_repo: https://github.com/mwtaylor/MichaelTaylor-SDK
55
- post_install_message:
56
54
  rdoc_options: []
57
55
  require_paths:
58
56
  - lib
@@ -67,8 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
65
  - !ruby/object:Gem::Version
68
66
  version: '0'
69
67
  requirements: []
70
- rubygems_version: 3.4.6
71
- signing_key:
68
+ rubygems_version: 3.6.2
72
69
  specification_version: 4
73
70
  summary: SDK for the Lord of the Rings API
74
71
  test_files: []