russianpost 0.4.2 → 0.4.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 +4 -4
- data/README.md +2 -2
- data/lib/russianpost/parcel.rb +2 -2
- data/lib/russianpost/version.rb +1 -1
- data/test/russianpost/parcel_test.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5c7faa5c898406ea60051e097b08e86c3903511
|
4
|
+
data.tar.gz: fbecdcde1434ea1ae21708292bd3555c9132490a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 868eff4aa1929d16c5ebf7a7f23c5b5675d9640e2acf51a4c62186ca1c443519bc3aae7d067458261519d1d717356958acec792f7a731c6da2d89e19ba0494ed
|
7
|
+
data.tar.gz: 11eb9bae98a6860910dd9a78c6d4083ca2873723b17c1971017691a72bf0c3b55b2725564eda2ec0746c4ca91feb7b91b0bc1cfb82d5432275b33647c3e52638
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@ To install gem stand-alone:
|
|
12
12
|
|
13
13
|
To use gem in a Rails app, add the following to your `Gemfile`:
|
14
14
|
|
15
|
-
gem "russianpost", "~> 0.4.
|
15
|
+
gem "russianpost", "~> 0.4.3"
|
16
16
|
|
17
17
|
This gem uses [Savon](http://savonrb.com/), which in turn uses [HTTPI](https://github.com/savonrb/httpi) internally. HTTPI chooses the best HTTP library of those you have installed. For the fastest results, make sure you add [Curb](https://github.com/taf2/curb) to your `Gemfile`:
|
18
18
|
|
@@ -54,7 +54,7 @@ RussianPost makes guesses about current state of the parcel.
|
|
54
54
|
|
55
55
|
### Operations API
|
56
56
|
|
57
|
-
Each `Operation` responds to the following methods. If there is no information, methods return `nil`.
|
57
|
+
Each `Operation` responds to the following methods. If there is no information, methods return `nil`. See the [wiki](https://github.com/artemshitov/russianpost/wiki) for a list of what else can be returned.
|
58
58
|
|
59
59
|
#### Address parameters
|
60
60
|
|
data/lib/russianpost/parcel.rb
CHANGED
@@ -16,7 +16,7 @@ module RussianPost
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def location
|
19
|
-
operations.last.operation_address
|
19
|
+
operations.last.operation_address unless operations.empty?
|
20
20
|
end
|
21
21
|
|
22
22
|
def mass
|
@@ -32,7 +32,7 @@ module RussianPost
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def type
|
35
|
-
operations.last.mail_type
|
35
|
+
operations.last.mail_type unless operations.empty?
|
36
36
|
end
|
37
37
|
|
38
38
|
private
|
data/lib/russianpost/version.rb
CHANGED
@@ -60,5 +60,14 @@ module RussianPost
|
|
60
60
|
def test_knows_recipient
|
61
61
|
assert_equal "ЕЛЕНА", parcel.recipient
|
62
62
|
end
|
63
|
+
|
64
|
+
def test_meta_methods_dont_fail_when_no_operations
|
65
|
+
VCR.use_cassette("RR123456785EE") do
|
66
|
+
parcel = Parcel.new("RR123456785EE")
|
67
|
+
[:location, :mass, :type, :rank, :recipient].each do |m|
|
68
|
+
assert_nil parcel.send(m)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
63
72
|
end
|
64
73
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: russianpost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artem Shitov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|