wreddit 1.2.0 → 1.2.1
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 +5 -0
- data/lib/wreddit.rb +3 -3
- data/lib/wreddit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe5a2dc912de21830e79e7fcefb154711d27bca4
|
4
|
+
data.tar.gz: 69b76f4f2b06e91c2bcddeca4c776ce478cf9bfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11f28bcf1d61fb3be222b00a3e00a39d7ee98653769291e909117eb26e40cd207572c78b762db89c06d729c6d3a8b547b828851a8fa3016539b43646167cf9d1
|
7
|
+
data.tar.gz: 362d9cde4c928965d4c61dc72218f451f4acf212b3d0dc6f1efe71c28bb498cc3d173227112b20fd8ea0178624e56c5df879ec84d057f47002b41afbd400b301
|
data/README.md
CHANGED
@@ -16,6 +16,11 @@ gem 'wreddit'
|
|
16
16
|
run ```bundle install``` in your app
|
17
17
|
|
18
18
|
## How to use
|
19
|
+
#### REDIS
|
20
|
+
This gem takes advantage of Redis caching which should help reduce the amount of error requests received by Reddit's Native API. You can't really make adjustments to the
|
21
|
+
caching because caching is going to happen automatically. In order to use Redis, you **MUST** be running a redis-server to handle the hash maps of URLs and response objects.
|
22
|
+
<br>
|
23
|
+
|
19
24
|
As of v.1.0.2 we are using the Wreddit class.
|
20
25
|
###### Example of basic usage
|
21
26
|
```
|
data/lib/wreddit.rb
CHANGED
@@ -105,7 +105,7 @@ class Wreddit
|
|
105
105
|
res = HTTParty.get(URI(@uri))
|
106
106
|
if res.code == 200
|
107
107
|
# if res is an OK (we are getting data)
|
108
|
-
@client.set(@uri, res , ex:
|
108
|
+
@client.set(@uri, res , ex: 60)
|
109
109
|
res = @client.get(@uri)
|
110
110
|
return res
|
111
111
|
end
|
@@ -121,7 +121,7 @@ class Wreddit
|
|
121
121
|
res = HTTParty.get(URI(@uri))
|
122
122
|
if res.code == 200
|
123
123
|
# if res is an OK (we are getting data)
|
124
|
-
@client.set(@uri, res, ex:
|
124
|
+
@client.set(@uri, res, ex: 60)
|
125
125
|
end
|
126
126
|
end
|
127
127
|
return res
|
@@ -134,7 +134,7 @@ class Wreddit
|
|
134
134
|
res = HTTParty.get(URI(@uri))
|
135
135
|
if res.code == 200
|
136
136
|
# if res is an OK (we are getting data)
|
137
|
-
@client.set(@uri, res, ex:
|
137
|
+
@client.set(@uri, res, ex: 60)
|
138
138
|
end
|
139
139
|
end
|
140
140
|
return res
|
data/lib/wreddit/version.rb
CHANGED