pastvu 1.0.0 → 1.0.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
2
  SHA256:
3
- metadata.gz: 1ede36b18a77672d8488001474123f2e4a869ee521d2006c8a56186a6f3c9b30
4
- data.tar.gz: 6e222696f72e76757ea24a0f8dd7dfc0d089f1b4081665708bc7d531548fda22
3
+ metadata.gz: 50bc81084dca16460f3de01a114b870bc9139d7761b1ae858763774559aa3668
4
+ data.tar.gz: 56cee8527470031d0e93b942bd44408e987d37e26892a08220c9fc9a0fe53b22
5
5
  SHA512:
6
- metadata.gz: e34ccfa15c79465afa76b9ea236f53675caaa5f7e8e88d6734b7d72fef2a39a49ef5d24c7bc559778c083a13ed1c6490bbbb08b5e8e9cad4b5b5b55fcd84b624
7
- data.tar.gz: 26f7aaaa4014f9afb341876fa932354687ab0568c5257bb6bf88b6567d028a627c5a3ca6242780676c78e46fbf088be1dea92bf5e879a5fbc81b46634e154508
6
+ metadata.gz: ae98ebbf32c9fb79f856c4bc5e6e0cafb02b431ae3a62d71dbf350682014dc6f4d14293b46a5fc542f1a78018668934e54e1d80abf2f9bf9d60de30c758c9d66
7
+ data.tar.gz: b0e6ece8d5076fcca3a890c109b58e4abeb1f6ea4baf545569cc971b903858e739bf360d010c1bb29f1d4636eb81be178ec69cee8ac936d1d1cf2e4df25b4d4f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [1.0.2] - 2024-10-24
2
+ - Remove Addressable dependency
3
+ - Fix README errors
4
+
5
+ ## [1.0.1] - 2023-1-12
6
+ - In README, remove the installation instruction to specify version in the Gemfile
7
+ - In README, add To do section
8
+
1
9
  ## [1.0.0] - 2023-1-12
2
10
 
3
11
  - First release!
data/README.md CHANGED
@@ -8,11 +8,11 @@ PastVu gem is a Ruby wrapper for [PastVu API](https://docs.pastvu.com/en/dev/api
8
8
 
9
9
  Install the gem and add to the application's Gemfile by executing:
10
10
 
11
- $ bundle add pastvu --version "~> 1.0.0"
11
+ $ bundle add pastvu
12
12
 
13
13
  or add the following line to the Gemfile manually
14
14
 
15
- # gem "pastvu", "~> 1.0.0"
15
+ # gem "pastvu"
16
16
 
17
17
  If bundler is not being used to manage dependencies, install the gem by executing:
18
18
 
@@ -97,9 +97,9 @@ photo_collection.each_with_index do |photo, i|
97
97
  desired_path_to_photo = "awesome_photo_number_#{i + 1}.jpg"
98
98
 
99
99
  # All return File object:
100
- photo.download(desired_path_to_photo, :standard)
101
- photo.download(desired_path_to_photo, :original)
102
- photo.download(desired_path_to_photo, :thumb) # or :thumbnail
100
+ photo.download(:standard, desired_path_to_photo)
101
+ photo.download(:original, desired_path_to_photo)
102
+ photo.download(:thumb, desired_path_to_photo) # or :thumbnail
103
103
  end
104
104
  ```
105
105
 
@@ -291,6 +291,10 @@ Pastvu.configure do |c|
291
291
  c.check_params_value # "true"
292
292
  end
293
293
  ```
294
+ ## To do list
295
+
296
+ * Rework tests to use [VCR gem](https://github.com/vcr/vcr)
297
+ * Refactor tests
294
298
 
295
299
  ## Contributing
296
300
 
@@ -11,7 +11,7 @@ module Pastvu
11
11
 
12
12
  DEFAULT_VALUES = {
13
13
  default_host: "pastvu.com",
14
- default_path: "api2",
14
+ default_path: "/api2",
15
15
  default_user_agent: "Ruby PastVu Gem/#{VERSION}, #{RUBY_PLATFORM}, Ruby/#{RUBY_VERSION}",
16
16
  default_ensure_successful_responses: true,
17
17
  default_check_params_type: true,
@@ -1,5 +1,4 @@
1
1
  require "net/http"
2
- require "addressable"
3
2
  require "open-uri"
4
3
 
5
4
  module Pastvu
@@ -24,19 +23,16 @@ module Pastvu
24
23
  @response = response.body
25
24
  end
26
25
  end
27
-
26
+
28
27
  def build_uri
29
- uri = Addressable::URI.new({ scheme: 'https', host: Pastvu.config.host })
30
-
31
- template = Addressable::Template.new(uri.to_s + "{/path*}" + "{?query*}")
32
-
33
- template.expand({
34
- "path" => Pastvu.config.path,
35
- "query" => {
36
- "method" => @method,
37
- "params" => JSON.dump(@params)
38
- }
39
- })
28
+ query = {
29
+ method: @method,
30
+ params: JSON.dump(@params)
31
+ }
32
+
33
+ URI::HTTPS.build(host: Pastvu.config.host,
34
+ path: Pastvu.config.path,
35
+ query: URI.encode_www_form(query))
40
36
  end
41
37
  end
42
38
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pastvu
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.2"
5
5
  end
data/pastvu.gemspec CHANGED
@@ -20,7 +20,6 @@ Gem::Specification.new do |spec|
20
20
  end
21
21
  end
22
22
 
23
- spec.add_dependency "addressable", "~> 2.8"
24
23
  spec.add_development_dependency "rspec", "~> 3.0"
25
24
  spec.add_development_dependency "webmock", "~> 3.19"
26
25
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pastvu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeny Nedoborskiy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-12 00:00:00.000000000 Z
11
+ date: 2024-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: addressable
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '2.8'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '2.8'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: rspec
29
15
  requirement: !ruby/object:Gem::Requirement