evropochta 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95c05e20fa1d3a300d89e9364bc7ec5644756a47f617b780746d0fee0e5c6fc8
4
- data.tar.gz: b225700ca8d1ef4ad165bcfb618be9f62539d13adec52a61c19cdb85f285366a
3
+ metadata.gz: caf3f8d1e579d691f47a8a489515c97ef94150e408652dc0f901d1df51bdb22c
4
+ data.tar.gz: e725a4422aee1d748333f1aa1db97b9d4abeda242943940251506440e337b5f0
5
5
  SHA512:
6
- metadata.gz: 5756637c37eb45945dc74356ee99f6d09ec46f29fbd73d291e1208268c2fa0974c4270fb5c0d0edcf23b34cab3f4649c8f8f7e266c8fd7e21a2ed181d927cef9
7
- data.tar.gz: 60a29f4b2f30602c6fdecb8a4b82facadd1b558398f2bcba957597af824ae1e43d0c44e5ad5913deb0f5202e5c3f57b9bd3a9a49c959f4b63b7242295d9cb975
6
+ metadata.gz: d3a0405a76a1a011d8f59e1fceb300bf65998034f07198f0cad744ef33f48d27107b09509fe7a30d03c9aa5f3f91378aad13c9cb857cad858b9ac0e421c51ba5
7
+ data.tar.gz: f6c0a453f5afbb5d5ea427375e6cd26eb9f133eca50b23bd0060cb748142090f52edaad61fe6038fd632e85c8861aec7e54c1447df63e30466d54e86c42025f3
data/README.md CHANGED
@@ -1,2 +1,29 @@
1
- # Evropochta
2
- Gem for working with the "Evropochta" delivery service via API
1
+ ## Quick start
2
+
3
+ ```
4
+ gem install evropochta
5
+ ```
6
+
7
+ ```ruby
8
+ require "evropochta"
9
+ ```
10
+
11
+ ```ruby
12
+ gem "evropochta"
13
+ ```
14
+
15
+ ## Support
16
+
17
+ If you want to report a bug, or have ideas, feedback or questions about the gem, [let me know via GitHub issues](https://github.com/mattbrictson/gem/issues/new) and I will do my best to provide a helpful answer. Happy hacking!
18
+
19
+ ## License
20
+
21
+ The gem is available as open source under the terms of the [MIT License](LICENSE.txt).
22
+
23
+ ## Code of conduct
24
+
25
+ Everyone interacting in this project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](CODE_OF_CONDUCT.md).
26
+
27
+ ## Contribution guide
28
+
29
+ Pull requests are welcome!
data/exe/evropochta CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "evropochta"
3
+ require "evropochta"
@@ -3,7 +3,14 @@ module Evropochta
3
3
  module Search4
4
4
  module_function
5
5
 
6
+ MAX_LIMIT = 50
7
+
6
8
  def call(address: "", limit_addresses: 10, address4_id: 0)
9
+ if limit_addresses.zero? || limit_addresses > MAX_LIMIT
10
+ LOG.error("Incorrect limit addresses (#{limit_addresses}). Should be in range 1 to 50")
11
+ return []
12
+ end
13
+
7
14
  Services::Shared.request(
8
15
  "Addresses.Search4",
9
16
  {
@@ -7,7 +7,7 @@ module Evropochta
7
7
  Services::Shared.request(
8
8
  "Postal.DeliveryTime",
9
9
  Number: track_number,
10
- Address1IdReciever: address1_id_reciever,
10
+ Address1IdReciever: address1_id_reciever
11
11
  )
12
12
  end
13
13
  end
@@ -9,7 +9,7 @@ module Evropochta
9
9
  {
10
10
  PostalItemExternalId: postal_item_external_ids,
11
11
  SerialNumber: serial_numbers,
12
- DateTransfer: date_transfer,
12
+ DateTransfer: date_transfer
13
13
  }
14
14
  )
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module Evropochta
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.2.1".freeze
3
3
  end
data/lib/evropochta.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "dotenv/load"
2
+ require "logger"
2
3
  require_relative "evropochta/version"
3
4
  require_relative "evropochta/config"
4
5
  require_relative "evropochta/services/api_service"
@@ -24,4 +25,5 @@ require_relative "evropochta/postal/group_order"
24
25
  require_relative "evropochta/postal/delivery_time"
25
26
 
26
27
  module Evropochta
28
+ LOG = Logger.new($stdout, level: :warn)
27
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evropochta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Grahovskiy
@@ -9,7 +9,21 @@ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
11
  date: 2024-11-02 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: logger
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description:
14
28
  email:
15
29
  - kuberlite@gmail.com