augury 1.0.1 → 1.0.2
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/.codeclimate.yml +0 -3
- data/.gitignore +0 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +4 -0
- data/README.md +19 -5
- data/bin/console +12 -0
- data/bin/extract_creds +7 -0
- data/bin/setup +5 -0
- data/lib/augury/fortune.rb +6 -5
- data/lib/augury/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a64d5b9b6c80e57c0f10de6a8be3d6eb8bbf163961e8b3517747aaf6ab5bded6
|
4
|
+
data.tar.gz: 3b9179deded9d6e36900413f1e7552827f9fa887113d255c48084444900c16fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af5ee70fa0b1055708dc0e2e6064f58dfb8d76ca15e8ccfdcade378c96f1510d848ff577073afbadceb49130289182df27342d7cb0ec835aac8dc5ff4843c839
|
7
|
+
data.tar.gz: 744f11c04c5215569f3e4577fa1e2a99d10e5c27d9aca8753b550dea56b960cd6aad27c19ebb9601e75eccd136303a4f78bc92b83afaf6f0a82e2721d44a47c1
|
data/.codeclimate.yml
CHANGED
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -69,6 +69,9 @@ GEM
|
|
69
69
|
pry-byebug (3.9.0)
|
70
70
|
byebug (~> 11.0)
|
71
71
|
pry (~> 0.13.0)
|
72
|
+
pry-doc (1.1.0)
|
73
|
+
pry (~> 0.11)
|
74
|
+
yard (~> 0.9.11)
|
72
75
|
public_suffix (4.0.6)
|
73
76
|
racc (1.5.2)
|
74
77
|
rainbow (3.0.0)
|
@@ -161,6 +164,7 @@ DEPENDENCIES
|
|
161
164
|
pry
|
162
165
|
pry-awesome_print
|
163
166
|
pry-byebug
|
167
|
+
pry-doc
|
164
168
|
rake
|
165
169
|
rspec (~> 3.0)
|
166
170
|
rubocop (= 0.92)
|
data/README.md
CHANGED
@@ -81,14 +81,14 @@ $ brew install fortune
|
|
81
81
|
|
82
82
|
### Augury Config
|
83
83
|
|
84
|
-
Create the `~/.augry.
|
84
|
+
Create the `~/.augry.yml` file and then set the permissions since your Twitter API info will be in there.
|
85
85
|
|
86
86
|
```sh
|
87
|
-
$ touch ~/.augury.
|
88
|
-
$ chmod 600 ~/.augury.
|
87
|
+
$ touch ~/.augury.yml
|
88
|
+
$ chmod 600 ~/.augury.yml
|
89
89
|
```
|
90
90
|
|
91
|
-
Set any of
|
91
|
+
Set any of the available settings in the config like this:
|
92
92
|
|
93
93
|
```yaml
|
94
94
|
count: 20
|
@@ -201,7 +201,21 @@ $ bundle exec ruby exe/augury help
|
|
201
201
|
You can run the tests with the rake task:
|
202
202
|
|
203
203
|
```sh
|
204
|
-
$ bundle exec
|
204
|
+
$ bundle exec spec
|
205
|
+
```
|
206
|
+
|
207
|
+
#### Twitter ENV
|
208
|
+
|
209
|
+
If you need to record a test with the Twitter API, you can set up the proper env vars by getting them from your currently set up `augury.yml` file.
|
210
|
+
|
211
|
+
```sh
|
212
|
+
$ eval `bin/extract_creds`
|
213
|
+
```
|
214
|
+
|
215
|
+
Then run the tests as you normally would.
|
216
|
+
|
217
|
+
```sh
|
218
|
+
$ bundle exec rspec
|
205
219
|
```
|
206
220
|
|
207
221
|
## Contributing
|
data/bin/console
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "augury"
|
5
|
+
# Load up the cli here as well
|
6
|
+
require "augury/cli"
|
7
|
+
|
8
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
9
|
+
# with your gem easier. You can also use a different console, if you like.
|
10
|
+
|
11
|
+
require "pry"
|
12
|
+
Pry.start
|
data/bin/extract_creds
ADDED
data/bin/setup
ADDED
data/lib/augury/fortune.rb
CHANGED
@@ -17,23 +17,24 @@ module Augury
|
|
17
17
|
response = yield(max_id)
|
18
18
|
collection += response
|
19
19
|
if response.empty?
|
20
|
-
collection
|
20
|
+
collection
|
21
21
|
elsif !@config[:count].zero? && collection.length >= @config[:count]
|
22
|
-
|
22
|
+
# Get everything or trim the results to the count
|
23
|
+
@config[:count].zero? ? collection : collection[0..@config[:count] - 1]
|
23
24
|
else
|
24
25
|
collect_with_max_id(collection, response.last.id - 1, &block)
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
28
29
|
def retrieve_tweets
|
29
|
-
collect_with_max_id do |max_id|
|
30
|
+
@tweets = collect_with_max_id do |max_id|
|
30
31
|
options = {
|
31
|
-
count:
|
32
|
+
count: 200,
|
32
33
|
include_rts: @config[:retweets],
|
33
34
|
exclude_replies: !@config[:replies],
|
34
35
|
}
|
35
36
|
options[:max_id] = max_id unless max_id.nil?
|
36
|
-
@
|
37
|
+
@twitter.user_timeline(@username, options)
|
37
38
|
end
|
38
39
|
rescue Twitter::Error::TooManyRequests => e
|
39
40
|
reset_length = e.rate_limit.reset_in + 1
|
data/lib/augury/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: augury
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clayton Parker
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -76,6 +76,7 @@ files:
|
|
76
76
|
- TODO.md
|
77
77
|
- augury.gemspec
|
78
78
|
- bin/console
|
79
|
+
- bin/extract_creds
|
79
80
|
- bin/setup
|
80
81
|
- exe/augury
|
81
82
|
- lib/augury.rb
|