augury 0.2.0 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 9658042a5e949c0611f9e7044dac8f8d5f5a4b4b
4
- data.tar.gz: 0d6b3d19af712ddde14d4690c00e3c721ba5521e
2
+ SHA256:
3
+ metadata.gz: a64d5b9b6c80e57c0f10de6a8be3d6eb8bbf163961e8b3517747aaf6ab5bded6
4
+ data.tar.gz: 3b9179deded9d6e36900413f1e7552827f9fa887113d255c48084444900c16fd
5
5
  SHA512:
6
- metadata.gz: 08b35032107de0c6f05119eeadf8b6bc2316ae5904105c84ef5ff6655642b49223ed36932e987abcedad3462dc3926e07e7f67ab83b2de2fb1bf25e49f356a00
7
- data.tar.gz: c8bbbfefdcc61cf07844543e7a7e14e0bb074655ed867ce271279155398046a81995feaa5242a6b61aed097cea1c46e6518b06b3892c6aacd244d1f53224ac4b
6
+ metadata.gz: af5ee70fa0b1055708dc0e2e6064f58dfb8d76ca15e8ccfdcade378c96f1510d848ff577073afbadceb49130289182df27342d7cb0ec835aac8dc5ff4843c839
7
+ data.tar.gz: 744f11c04c5215569f3e4577fa1e2a99d10e5c27d9aca8753b550dea56b960cd6aad27c19ebb9601e75eccd136303a4f78bc92b83afaf6f0a82e2721d44a47c1
@@ -0,0 +1,10 @@
1
+ ---
2
+ plugins:
3
+ fixme:
4
+ enabled: true
5
+ rubocop:
6
+ enabled: true
7
+ channel: rubocop-0-92
8
+ ratings:
9
+ paths:
10
+ - "**.rb"
data/.gitignore CHANGED
@@ -1,10 +1,13 @@
1
1
  /.bundle/
2
+ /vendor/
2
3
  /.yardoc
3
- /Gemfile.lock
4
4
  /_yardoc/
5
5
  /coverage/
6
6
  /doc/
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
- *.gem
10
+ /*.gem
11
+
12
+ # rspec failure tracking
13
+ .rspec_status
@@ -0,0 +1,45 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+ Exclude:
4
+ - bin/**/*
5
+ - vendor/**/*
6
+
7
+ Style/TrailingCommaInArguments:
8
+ EnforcedStyleForMultiline: comma
9
+
10
+ Style/TrailingCommaInHashLiteral:
11
+ EnforcedStyleForMultiline: comma
12
+
13
+ Style/TrailingCommaInArrayLiteral:
14
+ EnforcedStyleForMultiline: comma
15
+
16
+ Style/RedundantSelf:
17
+ Enabled: false
18
+
19
+ Layout/IndentationWidth:
20
+ Enabled: false
21
+
22
+ # Alignment so that changing var / method does not change all lines in diff
23
+ Layout/ParameterAlignment:
24
+ EnforcedStyle: with_fixed_indentation
25
+
26
+ Layout/ArgumentAlignment:
27
+ EnforcedStyle: with_fixed_indentation
28
+
29
+ Layout/MultilineMethodCallIndentation:
30
+ EnforcedStyle: indented
31
+
32
+ Layout/MultilineOperationIndentation:
33
+ EnforcedStyle: indented
34
+
35
+ Layout/EndAlignment:
36
+ EnforcedStyleAlignWith: variable
37
+ AutoCorrect: true
38
+
39
+ Layout/CaseIndentation:
40
+ EnforcedStyle: end
41
+ IndentOneStep: true
42
+
43
+ # Ignore for rspec
44
+ Metrics/BlockLength:
45
+ ExcludedMethods: ['describe', 'context']
@@ -0,0 +1,15 @@
1
+ ---
2
+ include:
3
+ - "**/*.rb"
4
+ exclude:
5
+ - spec/**/*
6
+ - test/**/*
7
+ - vendor/**/*
8
+ - ".bundle/**/*"
9
+ require: []
10
+ domains: []
11
+ reporters:
12
+ - rubocop
13
+ require_paths: []
14
+ plugins: []
15
+ max_files: 5000
@@ -1,4 +1,16 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.2
4
- before_install: gem install bundler -v 1.10.6
3
+ - 3.0
4
+ - 2.7
5
+ - 2.6
6
+ before_install:
7
+ - sudo apt-get -y install fortune
8
+ before_script:
9
+ - export PATH=$PATH:/usr/games
10
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
11
+ - chmod +x ./cc-test-reporter
12
+ - ./cc-test-reporter before-build
13
+ script:
14
+ - bundle exec rspec
15
+ after_script:
16
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
@@ -0,0 +1,37 @@
1
+ # Changes
2
+
3
+ ## 1.0.2 (2020-01-09)
4
+
5
+ - Fix bug with specific tweet count retrieval
6
+
7
+ ## 1.0.1 (2020-01-08)
8
+
9
+ - Remove unused gem
10
+
11
+ ## 1.0.0 (2020-01-08)
12
+
13
+ - Convert augury config from ini style to yaml (breaking change)
14
+ - Add options for filtering out tweets (retweets, replies, links)
15
+ - Add option to show twitter user name as an attribution
16
+ - Ensure output has not html entities in it
17
+
18
+ ## 0.3.0 (2015-08-20)
19
+
20
+ - Add `count` option and allow for a user to get all tweets
21
+ - Improve error handling
22
+ - Handle spaces in `path` argument
23
+ - Properly get defaults from the config if not passed on the command line
24
+ - Updated docs and interactive help
25
+
26
+ ## 0.2.1 (2015-08-19)
27
+
28
+ - Fix docs on rubygems site
29
+
30
+ ## 0.2.0 (2015-08-19)
31
+
32
+ - Initial working code and documentation
33
+
34
+ ## 0.1.0 (2015-08-19)
35
+
36
+ - Initial code skeleton
37
+ - Test push to rubygems
data/Gemfile CHANGED
@@ -1,4 +1,26 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in augury.gemspec
4
6
  gemspec
7
+
8
+ gem 'rake'
9
+
10
+ # Testing
11
+ gem 'rspec', '~>3.0'
12
+ gem 'simplecov'
13
+ gem 'vcr'
14
+ gem 'webmock'
15
+
16
+ # Debugging
17
+ gem 'pry'
18
+ gem 'pry-awesome_print'
19
+ gem 'pry-byebug'
20
+ gem 'pry-doc'
21
+
22
+ # Linting / completion
23
+ gem 'rubocop', '0.92'
24
+ gem 'rubocop-rake'
25
+ gem 'rubocop-rspec'
26
+ gem 'solargraph'
@@ -0,0 +1,179 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ augury (1.0.1)
5
+ facets (~> 3.0)
6
+ thor (~> 1.0)
7
+ twitter (~> 7.0)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ addressable (2.7.0)
13
+ public_suffix (>= 2.0.2, < 5.0)
14
+ ast (2.4.1)
15
+ awesome_print (1.8.0)
16
+ backport (1.1.2)
17
+ benchmark (0.1.1)
18
+ buftok (0.2.0)
19
+ byebug (11.1.3)
20
+ coderay (1.1.3)
21
+ crack (0.4.5)
22
+ rexml
23
+ diff-lcs (1.4.4)
24
+ docile (1.3.4)
25
+ domain_name (0.5.20190701)
26
+ unf (>= 0.0.5, < 1.0.0)
27
+ e2mmap (0.1.0)
28
+ equalizer (0.0.11)
29
+ facets (3.1.0)
30
+ ffi (1.14.2)
31
+ ffi-compiler (1.0.1)
32
+ ffi (>= 1.0.0)
33
+ rake
34
+ hashdiff (1.0.1)
35
+ http (4.4.1)
36
+ addressable (~> 2.3)
37
+ http-cookie (~> 1.0)
38
+ http-form_data (~> 2.2)
39
+ http-parser (~> 1.2.0)
40
+ http-cookie (1.0.3)
41
+ domain_name (~> 0.5)
42
+ http-form_data (2.3.0)
43
+ http-parser (1.2.2)
44
+ ffi-compiler
45
+ http_parser.rb (0.6.0)
46
+ jaro_winkler (1.5.4)
47
+ kramdown (2.3.0)
48
+ rexml
49
+ kramdown-parser-gfm (1.1.0)
50
+ kramdown (~> 2.0)
51
+ memoizable (0.4.2)
52
+ thread_safe (~> 0.3, >= 0.3.1)
53
+ method_source (1.0.0)
54
+ mini_portile2 (2.5.0)
55
+ multipart-post (2.1.1)
56
+ naught (1.1.0)
57
+ nokogiri (1.11.1)
58
+ mini_portile2 (~> 2.5.0)
59
+ racc (~> 1.4)
60
+ parallel (1.20.1)
61
+ parser (2.7.2.0)
62
+ ast (~> 2.4.1)
63
+ pry (0.13.1)
64
+ coderay (~> 1.1)
65
+ method_source (~> 1.0)
66
+ pry-awesome_print (9.6.11)
67
+ awesome_print (>= 1.1.0, < 999)
68
+ pry (>= 0.9.0, < 999)
69
+ pry-byebug (3.9.0)
70
+ byebug (~> 11.0)
71
+ pry (~> 0.13.0)
72
+ pry-doc (1.1.0)
73
+ pry (~> 0.11)
74
+ yard (~> 0.9.11)
75
+ public_suffix (4.0.6)
76
+ racc (1.5.2)
77
+ rainbow (3.0.0)
78
+ rake (13.0.3)
79
+ regexp_parser (2.0.3)
80
+ reverse_markdown (2.0.0)
81
+ nokogiri
82
+ rexml (3.2.4)
83
+ rspec (3.10.0)
84
+ rspec-core (~> 3.10.0)
85
+ rspec-expectations (~> 3.10.0)
86
+ rspec-mocks (~> 3.10.0)
87
+ rspec-core (3.10.1)
88
+ rspec-support (~> 3.10.0)
89
+ rspec-expectations (3.10.1)
90
+ diff-lcs (>= 1.2.0, < 2.0)
91
+ rspec-support (~> 3.10.0)
92
+ rspec-mocks (3.10.1)
93
+ diff-lcs (>= 1.2.0, < 2.0)
94
+ rspec-support (~> 3.10.0)
95
+ rspec-support (3.10.1)
96
+ rubocop (0.92.0)
97
+ parallel (~> 1.10)
98
+ parser (>= 2.7.1.5)
99
+ rainbow (>= 2.2.2, < 4.0)
100
+ regexp_parser (>= 1.7)
101
+ rexml
102
+ rubocop-ast (>= 0.5.0)
103
+ ruby-progressbar (~> 1.7)
104
+ unicode-display_width (>= 1.4.0, < 2.0)
105
+ rubocop-ast (1.4.0)
106
+ parser (>= 2.7.1.5)
107
+ rubocop-rake (0.5.1)
108
+ rubocop
109
+ rubocop-rspec (1.44.1)
110
+ rubocop (~> 0.87)
111
+ rubocop-ast (>= 0.7.1)
112
+ ruby-progressbar (1.11.0)
113
+ simple_oauth (0.3.1)
114
+ simplecov (0.21.1)
115
+ docile (~> 1.1)
116
+ simplecov-html (~> 0.11)
117
+ simplecov_json_formatter (~> 0.1)
118
+ simplecov-html (0.12.3)
119
+ simplecov_json_formatter (0.1.2)
120
+ solargraph (0.40.1)
121
+ backport (~> 1.1)
122
+ benchmark
123
+ bundler (>= 1.17.2)
124
+ e2mmap
125
+ jaro_winkler (~> 1.5)
126
+ kramdown (~> 2.3)
127
+ kramdown-parser-gfm (~> 1.1)
128
+ parser (~> 2.3)
129
+ reverse_markdown (>= 1.0.5, < 3)
130
+ rubocop (>= 0.52)
131
+ thor (~> 1.0)
132
+ tilt (~> 2.0)
133
+ yard (~> 0.9, >= 0.9.24)
134
+ thor (1.0.1)
135
+ thread_safe (0.3.6)
136
+ tilt (2.0.10)
137
+ twitter (7.0.0)
138
+ addressable (~> 2.3)
139
+ buftok (~> 0.2.0)
140
+ equalizer (~> 0.0.11)
141
+ http (~> 4.0)
142
+ http-form_data (~> 2.0)
143
+ http_parser.rb (~> 0.6.0)
144
+ memoizable (~> 0.4.0)
145
+ multipart-post (~> 2.0)
146
+ naught (~> 1.0)
147
+ simple_oauth (~> 0.3.0)
148
+ unf (0.1.4)
149
+ unf_ext
150
+ unf_ext (0.0.7.7)
151
+ unicode-display_width (1.7.0)
152
+ vcr (6.0.0)
153
+ webmock (3.11.0)
154
+ addressable (>= 2.3.6)
155
+ crack (>= 0.3.2)
156
+ hashdiff (>= 0.4.0, < 2.0.0)
157
+ yard (0.9.26)
158
+
159
+ PLATFORMS
160
+ ruby
161
+
162
+ DEPENDENCIES
163
+ augury!
164
+ pry
165
+ pry-awesome_print
166
+ pry-byebug
167
+ pry-doc
168
+ rake
169
+ rspec (~> 3.0)
170
+ rubocop (= 0.92)
171
+ rubocop-rake
172
+ rubocop-rspec
173
+ simplecov
174
+ solargraph
175
+ vcr
176
+ webmock
177
+
178
+ BUNDLED WITH
179
+ 2.1.4
data/README.md CHANGED
@@ -1,25 +1,36 @@
1
1
  # Augury
2
2
 
3
+ [![Maintainability](https://api.codeclimate.com/v1/badges/73443845cac0dadff540/maintainability)](https://codeclimate.com/github/claytron/augury/maintainability)
4
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/73443845cac0dadff540/test_coverage)](https://codeclimate.com/github/claytron/augury/test_coverage)
5
+ [![Tests](https://travis-ci.com/claytron/augury.svg?branch=master)](https://travis-ci.com/github/claytron/augury)
6
+
3
7
  Have you ever wanted to turn a twitter account into a fortune file?
4
8
  Well, today is your lucky day!
5
9
 
6
- Here is an example:
10
+ <blockquote>
11
+ Augury is the practice from ancient Roman religion of<br>
12
+ interpreting omens from the observed flight of birds.<br><br>
13
+ As per <a href="https://en.wikipedia.org/wiki/Augury">Wikipedia</a>
14
+ </blockquote>
7
15
 
8
- ```
9
- $ augury generate SeinfeldToday
16
+ There are a lot of really funny twitter accounts out there.
17
+ Let's just pick one and get started.
18
+
19
+ ```sh
20
+ $ augury generate seinfeldtoday
10
21
  ```
11
22
 
12
23
  This just created the fortune files in the current directory:
13
24
 
14
- ```
25
+ ```sh
15
26
  $ ls
16
- SeinfeldToday SeinfeldToday.dat
27
+ seinfeldtoday seinfeldtoday.dat
17
28
  ```
18
29
 
19
30
  You can now read the new fortunes!
20
31
 
21
- ```
22
- $ fortune SeinfeldToday
32
+ ```sh
33
+ $ fortune seinfeldtoday
23
34
  Elaine has no idea what her BF does for a living and it's now too
24
35
  late to ask. E:"Teacher, I think. Or a doctor? Wait Is
25
36
  'computers' a job?"
@@ -27,6 +38,13 @@ late to ask. E:"Teacher, I think. Or a doctor? Wait Is
27
38
 
28
39
  Thanks for all the laughs fortune :)
29
40
 
41
+ Here are some accounts that work well with Augury:
42
+
43
+ - [Modern Seinfeld](https://twitter.com/seinfeldtoday)
44
+ - [Very Short Story](https://twitter.com/veryshortstory)
45
+ - [Bored Elon Musk](https://twitter.com/boredelonmusk)
46
+ - Your own feed, so you can get nostalgic.
47
+
30
48
  ## Installation
31
49
 
32
50
  Add this line to your application's Gemfile:
@@ -37,13 +55,13 @@ gem 'augury'
37
55
 
38
56
  And then execute:
39
57
 
40
- ```
58
+ ```sh
41
59
  $ bundle
42
60
  ```
43
61
 
44
62
  Or install it yourself as:
45
63
 
46
- ```
64
+ ```sh
47
65
  $ gem install augury
48
66
  ```
49
67
 
@@ -55,7 +73,7 @@ The fortune program ships with a `strfile` program that converts the plain text
55
73
  For example,
56
74
  if you are using Homebrew on OS X:
57
75
 
58
- ```
76
+ ```sh
59
77
  $ brew install fortune
60
78
  ```
61
79
 
@@ -63,69 +81,142 @@ $ brew install fortune
63
81
 
64
82
  ### Augury Config
65
83
 
66
- 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.
67
85
 
68
86
  ```sh
69
- $ touch ~/.augury.cfg
70
- $ chmod 600 ~/.augury.cfg
87
+ $ touch ~/.augury.yml
88
+ $ chmod 600 ~/.augury.yml
71
89
  ```
72
90
 
73
- 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:
74
92
 
75
- ```ini
76
- [augury]
77
- example_option = "An interesting value"
93
+ ```yaml
94
+ count: 20
95
+ attribution: true
78
96
  ```
79
97
 
80
98
  ### Option list
81
99
 
82
- These are the available options for the `~/.augury.cfg`
100
+ These are the available options for the `~/.augury.yml` config file.
83
101
 
84
- - `append` Make the script add more entries to the specified file instead of re-writing it. DEFAULT: False
85
- - `width` Set the default width used if none is given on the command line. DEFAULT: 72
102
+ Option | Description | Default
103
+ ------ | :---------- | -------
104
+ `append` | Make the script add more entries to the specified file instead of re-writing it | `false`
105
+ `width` | Set the default width used if none is given on the command line. | `72`
106
+ `count` | The number of tweets to get. Set to 0 to get all. | `200`
107
+ `retweets` | Include retweets. | `false`
108
+ `replies` | Include replies. | `false`
109
+ `links` | Include tweets with links in them. | `false`
110
+ `attribution` | Add an author attribution to each fortune. | `false`
86
111
 
87
112
  ### Twitter Setup
88
113
 
89
114
  First, you will need to create a new Twitter application by going here:
90
- https://apps.twitter.com
115
+ https://developer.twitter.com
91
116
 
92
117
  This will give you the ability to generate the consumer and access information used below.
93
118
 
94
- Add the following to your `~/.augury.cfg` file.
119
+ Add the following to your `~/.augury.yml` config.
95
120
 
96
- ```ini
97
- [twitter]
98
- consumer_key = "YOUR_CONSUMER_KEY"
99
- consumer_secret = "YOUR_CONSUMER_SECRET"
100
- access_token = "YOUR_ACCESS_TOKEN"
101
- access_token_secret = "YOUR_ACCESS_SECRET"
121
+ ```yaml
122
+ twitter:
123
+ consumer_key: YOUR_CONSUMER_KEY
124
+ consumer_secret: YOUR_CONSUMER_SECRET
125
+ access_token: YOUR_ACCESS_TOKEN
126
+ access_token_secret: YOUR_ACCESS_TOKEN_SECRET
102
127
  ```
103
128
 
104
129
  ## Usage
105
130
 
106
- Create a fortune for the latest SeinfeldToday tweets.
131
+ Create a fortune for the latest *seinfeldtoday* tweets.
107
132
 
108
- ```
109
- $ augury generate SeinfeldToday
133
+ ```sh
134
+ $ augury generate seinfeldtoday
110
135
  ```
111
136
 
112
137
  Now you have some fortunes.
113
138
 
139
+ ```sh
140
+ $ fortune seinfeldtoday
141
+ ```
142
+
143
+ Specify a width and a different path to use:
144
+
145
+ ```sh
146
+ $ augury generate -w 120 seinfeldtoday /usr/local/share/games/fortune/Modern\ Seinfeld
147
+ ```
148
+
149
+ If this is where your fortune program looks for fortunes,
150
+ you can now use the new fortune.
151
+
152
+ ```sh
153
+ $ fortune "Modern Seinfeld"
114
154
  ```
115
- $ fortune SeinfeldToday
155
+
156
+ ### See the interactive help
157
+
158
+ Run the help to get more details about what the program can do
159
+
160
+ ```sh
161
+ $ augury help
162
+ $ augury help generate
116
163
  ```
117
164
 
118
165
  ## Development
119
166
 
120
- After checking out the repo, run `bin/setup` to install dependencies.
121
- Then, run `rake spec` to run the tests.
122
- You can also run `bin/console` for an interactive prompt that will allow you to experiment.
167
+ If you want to contribute to this library,
168
+ do the following.
169
+
170
+ Create a fork, then get the code
171
+
172
+ ```sh
173
+ $ git clone git@github.com:YOUR_USERNAME/augury.git
174
+ $ cd augury
175
+ ```
176
+
177
+ Run the setup script to get everything installed:
123
178
 
124
- To install this gem onto your local machine, run `bundle exec rake install`.
125
- To release a new version, update the version number in `version.rb`,
126
- and then run `bundle exec rake release`,
127
- which will create a git tag for the version,
128
- push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
179
+ **NOTE**: This requires having bundler available.
180
+ That is beyond the scope of this README.
181
+
182
+ ```sh
183
+ $ bin/setup
184
+ ```
185
+
186
+ Once that is finished, there is a console available.
187
+ This gives you access to all the code via Pry.
188
+
189
+ ```sh
190
+ $ bin/console
191
+ ```
192
+
193
+ The `augury` command will be available in `exe`:
194
+
195
+ ```sh
196
+ $ bundle exec ruby exe/augury help
197
+ ```
198
+
199
+ ### Run the tests
200
+
201
+ You can run the tests with the rake task:
202
+
203
+ ```sh
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
219
+ ```
129
220
 
130
221
  ## Contributing
131
222
 
@@ -134,3 +225,16 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/claytr
134
225
  ## License
135
226
 
136
227
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
228
+
229
+ ## Thanks for all the fish
230
+
231
+ Thanks to [TinderBox](http://gettinderbox.com) for giving us time to make cool things happen!
232
+
233
+ This was an excellent learning experience for the author,
234
+ who was new at programming in Ruby.
235
+
236
+ The [Developing a RubyGem using Bundler][gemdocs] documentation was fun to read and informative.
237
+ It helped get the skeleton of the code set up and extra goodies in the development profile.
238
+ Highly recommended read!
239
+
240
+ [gemdocs]: https://github.com/radar/guides/blob/master/gem-development.md#developing-a-rubygem-using-bundler