pastvu 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: 8e0e14db9b88b1a72bfe18b3480d679bb07bcc253e263cd81a054d2d23dd8569
4
- data.tar.gz: 16306a452f788174418ff4342cf378f422d3660b43168c09ecb4f067c3b252d8
3
+ metadata.gz: '0521681372061872678ff69ce3e4e931f4afc6b7a6d36b4631cf4ea7386090db'
4
+ data.tar.gz: 99096efab3c33d055c58b701e6f5a4adac7f138082f722161ca1d30a552b86c7
5
5
  SHA512:
6
- metadata.gz: b27fa83719e8d559d5dbcbf1e7aa4ed9893434c6ca58c1cfe8e70d669b95e6504537f3e273edb701aa2697fea6444dd57d49113a739e26b31fb443569e72d151
7
- data.tar.gz: 10df7d1c9dd47ae926be00470ae374215e059bfe18606b1556dbbcd567e025bafb0602e4f0f97457609ceef31745be6d98537eeaf868585d305c769c467d4ad6
6
+ metadata.gz: 94126b5684af6e0e294a1462a28eb3628a39a8e2cac62e06d49b60513a340bfd767745990c798309ab2f4446abe6f9b2f4faa86af13b83838bbf44862b3ae06d
7
+ data.tar.gz: 13b4602a7bd61ae5ea2e9732cc1578eae93f1de6a02ee9f74ea7f65d1436187ce1d78ac31b9833024508c5138716237a13d7188d9d5d035c7d8c97cb7a50a175
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.0.3] - 2025-10-22
2
+ - Bump dependencies
3
+
4
+ ## [1.0.2] - 2024-10-24
5
+ - Remove Addressable dependency
6
+ - Fix README errors
7
+
1
8
  ## [1.0.1] - 2023-1-12
2
9
  - In README, remove the installation instruction to specify version in the Gemfile
3
10
  - In README, add To do section
data/README.md CHANGED
@@ -28,6 +28,24 @@ require "pastvu"
28
28
 
29
29
  Refer to [PastVu API documentation](https://docs.pastvu.com/en/dev/api) for available interactions, parameters, parameter types and response examples.
30
30
 
31
+ Here are several use-cases for the gem depending on what you may want to request from PastVu:
32
+
33
+ - [Nearest Photos](#scenario-getting-nearest-photos)
34
+ - [Requesting](#step-one---request-data)
35
+ - [Working with the requested data](#step-two---work-with-data)
36
+ - [Manipulating attributes](#manipulate-attributes)
37
+ - [Downloading photos](#download-photos)
38
+ - [Requesting additional info](#request-more-data-about-the-photo)
39
+ - [Photos inside geographical bounds](#scenario-getting-photos-inside-geographical-bounds)
40
+ - [Preparing request](#step-one---prepare-request)
41
+ - [Requesting](#step-two---request-data)
42
+ - [Manipulating requested data](#step-three---manipulate-data)
43
+ - [Working with requested photos](#photos)
44
+ - [Working with requested clusters](#clusters)
45
+ - [Full photo information](#scenario-getting-full-photo-information)
46
+ - [Commentaries for a photo](#scenario-getting-commentaries-for-a-photo)
47
+ - [Adjusting gem's configuration](#configuration)
48
+
31
49
  ### Scenario: Getting nearest photos
32
50
 
33
51
  #### Step one - request data
@@ -97,9 +115,9 @@ photo_collection.each_with_index do |photo, i|
97
115
  desired_path_to_photo = "awesome_photo_number_#{i + 1}.jpg"
98
116
 
99
117
  # 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
118
+ photo.download(:standard, desired_path_to_photo)
119
+ photo.download(:original, desired_path_to_photo)
120
+ photo.download(:thumb, desired_path_to_photo) # or :thumbnail
103
121
  end
104
122
  ```
105
123
 
@@ -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.1"
4
+ VERSION = "1.0.3"
5
5
  end
data/pastvu.gemspec CHANGED
@@ -5,7 +5,7 @@ require_relative "lib/pastvu/version"
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "pastvu"
7
7
  spec.version = Pastvu::VERSION
8
- spec.authors = ["Evgeny Nedoborskiy"]
8
+ spec.authors = ["projecteurlumiere"]
9
9
  spec.email = ["129510705+projecteurlumiere@users.noreply.github.com"]
10
10
  spec.homepage = "https://github.com/projecteurlumiere/pastvu"
11
11
  spec.summary = "A Ruby wrapper for PastVu API"
@@ -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,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pastvu
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
- - Evgeny Nedoborskiy
8
- autorequire:
7
+ - projecteurlumiere
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-01-12 00:00:00.000000000 Z
10
+ date: 2025-10-22 00:00:00.000000000 Z
12
11
  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
12
  - !ruby/object:Gem::Dependency
28
13
  name: rspec
29
14
  requirement: !ruby/object:Gem::Requirement
@@ -52,7 +37,6 @@ dependencies:
52
37
  - - "~>"
53
38
  - !ruby/object:Gem::Version
54
39
  version: '3.19'
55
- description:
56
40
  email:
57
41
  - 129510705+projecteurlumiere@users.noreply.github.com
58
42
  executables: []
@@ -86,7 +70,6 @@ homepage: https://github.com/projecteurlumiere/pastvu
86
70
  licenses:
87
71
  - MIT
88
72
  metadata: {}
89
- post_install_message:
90
73
  rdoc_options: []
91
74
  require_paths:
92
75
  - lib
@@ -101,8 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
84
  - !ruby/object:Gem::Version
102
85
  version: '0'
103
86
  requirements: []
104
- rubygems_version: 3.4.20
105
- signing_key:
87
+ rubygems_version: 3.6.2
106
88
  specification_version: 4
107
89
  summary: A Ruby wrapper for PastVu API
108
90
  test_files: []