pocket-ruby 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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/pocket/article.rb +2 -0
- data/lib/pocket/version.rb +1 -1
- data/test/pocket/article_test.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23523be975e32aab67f1eb9eae5bd8a9a23032e7b9e32dd16c7ebd54829dcfd5
|
4
|
+
data.tar.gz: f340f0180bffcee80c64321392205ad43439434a12171b670baab1b7c30eb56f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c639bdd2f2637e55642da60be20d03e3e8e4ea7bc87b2da4ebf5951d8f99d7717e3d7608e3ec66c79a1e7b0bdf49f4c673a95590ffa34bd54baf4f0b5293b8a
|
7
|
+
data.tar.gz: 03f454e5471e90266dce757748b7a3fefad8adcfefd954bae3e2bd52f687dc922c7d0d7911ef02e85b94344f733803b6aea2c5dbfb50dfe45c2a0f8679ed81e0
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.2.1] - 2021-04-10
|
4
|
+
|
5
|
+
- Return nil if `time_read` or `time_favorited` is '0' in the API response. Otherwise, this may be interpreted the Unix epoch (1970-01-01). ([#46](https://github.com/turadg/pocket-ruby/pull/46))
|
6
|
+
|
3
7
|
## [0.2.0] - 2021-04-03
|
4
8
|
|
5
9
|
- Add support for authors and tags in `Pocket::Article` ([#44](https://github.com/turadg/pocket-ruby/pull/44))
|
data/Gemfile.lock
CHANGED
data/lib/pocket/article.rb
CHANGED
@@ -88,6 +88,7 @@ module Pocket
|
|
88
88
|
|
89
89
|
def time_read
|
90
90
|
return nil unless response["time_read"]
|
91
|
+
return nil if response["time_read"] == "0"
|
91
92
|
Time.at(Integer(response["time_read"])).utc
|
92
93
|
end
|
93
94
|
|
@@ -97,6 +98,7 @@ module Pocket
|
|
97
98
|
|
98
99
|
def time_favorited
|
99
100
|
return nil unless response["time_favorited"]
|
101
|
+
return nil if response["time_favorited"] == "0"
|
100
102
|
Time.at(Integer(response["time_favorited"])).utc
|
101
103
|
end
|
102
104
|
|
data/lib/pocket/version.rb
CHANGED
data/test/pocket/article_test.rb
CHANGED
@@ -99,6 +99,11 @@ module Pocket
|
|
99
99
|
assert_nil article.time_read
|
100
100
|
end
|
101
101
|
|
102
|
+
test "time_read is nil if field is zero" do
|
103
|
+
parsed_response["time_read"] = "0"
|
104
|
+
assert_nil article.time_read
|
105
|
+
end
|
106
|
+
|
102
107
|
test "favorited?" do
|
103
108
|
assert article.favorited?
|
104
109
|
end
|
@@ -112,6 +117,11 @@ module Pocket
|
|
112
117
|
assert_nil article.time_favorited
|
113
118
|
end
|
114
119
|
|
120
|
+
test "time_favorited is nil if field is zero" do
|
121
|
+
parsed_response["time_favorited"] = "0"
|
122
|
+
assert_nil article.time_favorited
|
123
|
+
end
|
124
|
+
|
115
125
|
test "read?" do
|
116
126
|
assert article.read?
|
117
127
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pocket-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Turadg Aleahmad
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-04-
|
13
|
+
date: 2021-04-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: sinatra
|