augury 1.0.1 → 1.0.2

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: 64257249dcbb8b277c6e19b5a53fffb5f66ef9faf301443fe80c4cdc2416df17
4
- data.tar.gz: 43c407f9e4bfcb659c1beb15e2456d70a7df949cd1c7c72680dd058e42398e50
3
+ metadata.gz: a64d5b9b6c80e57c0f10de6a8be3d6eb8bbf163961e8b3517747aaf6ab5bded6
4
+ data.tar.gz: 3b9179deded9d6e36900413f1e7552827f9fa887113d255c48084444900c16fd
5
5
  SHA512:
6
- metadata.gz: 0f395c7327e9e32b4dd8eb793868f3588f2d680c59b97d045af09589996e1bb1bd467ec3ba4efda183e120664f3dff56c36b5d3f9e2b3feca22637c800ba9b91
7
- data.tar.gz: 49ef40634fae8a75d28a872eb8e64e68127a4a65255c8d4d444cd7d7696b79b5f2a072fea504ef16a18ff3e7883fc838e63367affdabf8f6f3725857688ebe42
6
+ metadata.gz: af5ee70fa0b1055708dc0e2e6064f58dfb8d76ca15e8ccfdcade378c96f1510d848ff577073afbadceb49130289182df27342d7cb0ec835aac8dc5ff4843c839
7
+ data.tar.gz: 744f11c04c5215569f3e4577fa1e2a99d10e5c27d9aca8753b550dea56b960cd6aad27c19ebb9601e75eccd136303a4f78bc92b83afaf6f0a82e2721d44a47c1
@@ -8,6 +8,3 @@ plugins:
8
8
  ratings:
9
9
  paths:
10
10
  - "**.rb"
11
- exclude_paths:
12
- - features/**/*
13
- - spec/**/*
data/.gitignore CHANGED
@@ -7,7 +7,6 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
- /bin/*
11
10
  /*.gem
12
11
 
13
12
  # rspec failure tracking
@@ -1,5 +1,9 @@
1
1
  # Changes
2
2
 
3
+ ## 1.0.2 (2020-01-09)
4
+
5
+ - Fix bug with specific tweet count retrieval
6
+
3
7
  ## 1.0.1 (2020-01-08)
4
8
 
5
9
  - Remove unused gem
data/Gemfile CHANGED
@@ -17,6 +17,7 @@ gem 'webmock'
17
17
  gem 'pry'
18
18
  gem 'pry-awesome_print'
19
19
  gem 'pry-byebug'
20
+ gem 'pry-doc'
20
21
 
21
22
  # Linting / completion
22
23
  gem 'rubocop', '0.92'
@@ -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.cfg` file and then set the permissions since your Twitter API info will be in there.
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.cfg
88
- $ chmod 600 ~/.augury.cfg
87
+ $ touch ~/.augury.yml
88
+ $ chmod 600 ~/.augury.yml
89
89
  ```
90
90
 
91
- Set any of these settings in the `augury` section of the config like this:
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 rake spec
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
@@ -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
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'yaml'
5
+
6
+ augury_config = YAML.load_file(File.expand_path('~/.augury.yml'))
7
+ puts augury_config['twitter'].collect { |k, v| "export TWITTER_#{k.upcase}=#{v}" }.join("\n")
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install --binstubs
@@ -17,23 +17,24 @@ module Augury
17
17
  response = yield(max_id)
18
18
  collection += response
19
19
  if response.empty?
20
- collection.flatten
20
+ collection
21
21
  elsif !@config[:count].zero? && collection.length >= @config[:count]
22
- collection.flatten
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: @config[:count].zero? ? 200 : @config[: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
- @tweets = @twitter.user_timeline(@username, options)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Augury
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  end
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.1
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-08 00:00:00.000000000 Z
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