augury 0.3.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.codeclimate.yml +10 -0
- data/.gitignore +5 -3
- data/.rubocop.yml +45 -0
- data/.solargraph.yml +15 -0
- data/.travis.yml +14 -2
- data/CHANGELOG.md +26 -0
- data/Gemfile +22 -0
- data/Gemfile.lock +179 -0
- data/README.md +123 -38
- data/Rakefile +5 -3
- data/augury.gemspec +16 -34
- data/bin/console +12 -0
- data/bin/extract_creds +12 -0
- data/bin/setup +5 -0
- data/lib/augury.rb +3 -2
- data/lib/augury/cli.rb +78 -21
- data/lib/augury/exception.rb +9 -1
- data/lib/augury/fortune.rb +77 -48
- data/lib/augury/version.rb +3 -1
- metadata +20 -186
- data/TODO.md +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5bfe458d2f8431e98c03bef3fd02e3110cc0a3be14523a468dca050f3ea1c478
|
4
|
+
data.tar.gz: d758020f0f3281a559a48237fe17edf9a9600c7d7072a11c5597ae038fd7b07c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b756e409e7d664fe41e85394979f126ae43c623e7b98a8e1c214916fa18860664f1431a485fa8d210798eccf2165b944cc646d577ff76c00a77513f2ef146834
|
7
|
+
data.tar.gz: 79250c0549f60c415bdf476f16faf41bccc3f8dd05f97f44b1bbd9aab25508e0beff1e51bb3cebbf71a228cc767ed884f4f66b618a25e15c4dcfc4f44d530ac2
|
data/.codeclimate.yml
ADDED
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -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']
|
data/.solargraph.yml
ADDED
data/.travis.yml
CHANGED
@@ -1,4 +1,16 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
-
|
4
|
-
|
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
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,31 @@
|
|
1
1
|
# Changes
|
2
2
|
|
3
|
+
## 1.1.0 (2020-01-24)
|
4
|
+
|
5
|
+
- Add ability to transform tweet text with find / replace
|
6
|
+
- Get full text of tweets, not the default abbreviated version
|
7
|
+
- Switch to better word wrapping library
|
8
|
+
|
9
|
+
## 1.0.3 (2020-01-23)
|
10
|
+
|
11
|
+
- Pin Thor version to avoid issue with `options` override
|
12
|
+
- Add tests for `Augury::CLI`
|
13
|
+
|
14
|
+
## 1.0.2 (2020-01-09)
|
15
|
+
|
16
|
+
- Fix bug with specific tweet count retrieval
|
17
|
+
|
18
|
+
## 1.0.1 (2020-01-08)
|
19
|
+
|
20
|
+
- Remove unused gem
|
21
|
+
|
22
|
+
## 1.0.0 (2020-01-08)
|
23
|
+
|
24
|
+
- Convert augury config from ini style to yaml (breaking change)
|
25
|
+
- Add options for filtering out tweets (retweets, replies, links)
|
26
|
+
- Add option to show twitter user name as an attribution
|
27
|
+
- Ensure output has not html entities in it
|
28
|
+
|
3
29
|
## 0.3.0 (2015-08-20)
|
4
30
|
|
5
31
|
- Add `count` option and allow for a user to get all tweets
|
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'
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,179 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
augury (1.1.0)
|
5
|
+
thor (~> 1.0.0)
|
6
|
+
twitter (~> 7.0)
|
7
|
+
word_wrap (~> 1.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.2)
|
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.5)
|
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
|
+
ffi (1.14.2)
|
30
|
+
ffi-compiler (1.0.1)
|
31
|
+
ffi (>= 1.0.0)
|
32
|
+
rake
|
33
|
+
hashdiff (1.0.1)
|
34
|
+
http (4.4.1)
|
35
|
+
addressable (~> 2.3)
|
36
|
+
http-cookie (~> 1.0)
|
37
|
+
http-form_data (~> 2.2)
|
38
|
+
http-parser (~> 1.2.0)
|
39
|
+
http-cookie (1.0.3)
|
40
|
+
domain_name (~> 0.5)
|
41
|
+
http-form_data (2.3.0)
|
42
|
+
http-parser (1.2.3)
|
43
|
+
ffi-compiler (>= 1.0, < 2.0)
|
44
|
+
http_parser.rb (0.6.0)
|
45
|
+
jaro_winkler (1.5.4)
|
46
|
+
kramdown (2.3.0)
|
47
|
+
rexml
|
48
|
+
kramdown-parser-gfm (1.1.0)
|
49
|
+
kramdown (~> 2.0)
|
50
|
+
memoizable (0.4.2)
|
51
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
52
|
+
method_source (1.0.0)
|
53
|
+
mini_portile2 (2.5.0)
|
54
|
+
multipart-post (2.1.1)
|
55
|
+
naught (1.1.0)
|
56
|
+
nokogiri (1.11.1)
|
57
|
+
mini_portile2 (~> 2.5.0)
|
58
|
+
racc (~> 1.4)
|
59
|
+
parallel (1.20.1)
|
60
|
+
parser (3.0.0.0)
|
61
|
+
ast (~> 2.4.1)
|
62
|
+
pry (0.13.1)
|
63
|
+
coderay (~> 1.1)
|
64
|
+
method_source (~> 1.0)
|
65
|
+
pry-awesome_print (9.6.11)
|
66
|
+
awesome_print (>= 1.1.0, < 999)
|
67
|
+
pry (>= 0.9.0, < 999)
|
68
|
+
pry-byebug (3.9.0)
|
69
|
+
byebug (~> 11.0)
|
70
|
+
pry (~> 0.13.0)
|
71
|
+
pry-doc (1.1.0)
|
72
|
+
pry (~> 0.11)
|
73
|
+
yard (~> 0.9.11)
|
74
|
+
public_suffix (4.0.6)
|
75
|
+
racc (1.5.2)
|
76
|
+
rainbow (3.0.0)
|
77
|
+
rake (13.0.3)
|
78
|
+
regexp_parser (2.0.3)
|
79
|
+
reverse_markdown (2.0.0)
|
80
|
+
nokogiri
|
81
|
+
rexml (3.2.4)
|
82
|
+
rspec (3.10.0)
|
83
|
+
rspec-core (~> 3.10.0)
|
84
|
+
rspec-expectations (~> 3.10.0)
|
85
|
+
rspec-mocks (~> 3.10.0)
|
86
|
+
rspec-core (3.10.1)
|
87
|
+
rspec-support (~> 3.10.0)
|
88
|
+
rspec-expectations (3.10.1)
|
89
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
90
|
+
rspec-support (~> 3.10.0)
|
91
|
+
rspec-mocks (3.10.1)
|
92
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
93
|
+
rspec-support (~> 3.10.0)
|
94
|
+
rspec-support (3.10.1)
|
95
|
+
rubocop (0.92.0)
|
96
|
+
parallel (~> 1.10)
|
97
|
+
parser (>= 2.7.1.5)
|
98
|
+
rainbow (>= 2.2.2, < 4.0)
|
99
|
+
regexp_parser (>= 1.7)
|
100
|
+
rexml
|
101
|
+
rubocop-ast (>= 0.5.0)
|
102
|
+
ruby-progressbar (~> 1.7)
|
103
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
104
|
+
rubocop-ast (1.4.1)
|
105
|
+
parser (>= 2.7.1.5)
|
106
|
+
rubocop-rake (0.5.1)
|
107
|
+
rubocop
|
108
|
+
rubocop-rspec (1.44.1)
|
109
|
+
rubocop (~> 0.87)
|
110
|
+
rubocop-ast (>= 0.7.1)
|
111
|
+
ruby-progressbar (1.11.0)
|
112
|
+
simple_oauth (0.3.1)
|
113
|
+
simplecov (0.21.2)
|
114
|
+
docile (~> 1.1)
|
115
|
+
simplecov-html (~> 0.11)
|
116
|
+
simplecov_json_formatter (~> 0.1)
|
117
|
+
simplecov-html (0.12.3)
|
118
|
+
simplecov_json_formatter (0.1.2)
|
119
|
+
solargraph (0.40.2)
|
120
|
+
backport (~> 1.1)
|
121
|
+
benchmark
|
122
|
+
bundler (>= 1.17.2)
|
123
|
+
e2mmap
|
124
|
+
jaro_winkler (~> 1.5)
|
125
|
+
kramdown (~> 2.3)
|
126
|
+
kramdown-parser-gfm (~> 1.1)
|
127
|
+
parser (~> 3.0)
|
128
|
+
reverse_markdown (>= 1.0.5, < 3)
|
129
|
+
rubocop (>= 0.52)
|
130
|
+
thor (~> 1.0)
|
131
|
+
tilt (~> 2.0)
|
132
|
+
yard (~> 0.9, >= 0.9.24)
|
133
|
+
thor (1.0.1)
|
134
|
+
thread_safe (0.3.6)
|
135
|
+
tilt (2.0.10)
|
136
|
+
twitter (7.0.0)
|
137
|
+
addressable (~> 2.3)
|
138
|
+
buftok (~> 0.2.0)
|
139
|
+
equalizer (~> 0.0.11)
|
140
|
+
http (~> 4.0)
|
141
|
+
http-form_data (~> 2.0)
|
142
|
+
http_parser.rb (~> 0.6.0)
|
143
|
+
memoizable (~> 0.4.0)
|
144
|
+
multipart-post (~> 2.0)
|
145
|
+
naught (~> 1.0)
|
146
|
+
simple_oauth (~> 0.3.0)
|
147
|
+
unf (0.1.4)
|
148
|
+
unf_ext
|
149
|
+
unf_ext (0.0.7.7)
|
150
|
+
unicode-display_width (1.7.0)
|
151
|
+
vcr (6.0.0)
|
152
|
+
webmock (3.11.1)
|
153
|
+
addressable (>= 2.3.6)
|
154
|
+
crack (>= 0.3.2)
|
155
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
156
|
+
word_wrap (1.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,31 +1,35 @@
|
|
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
10
|
<blockquote>
|
7
11
|
Augury is the practice from ancient Roman religion of<br>
|
8
12
|
interpreting omens from the observed flight of birds.<br><br>
|
9
|
-
As per
|
13
|
+
As per <a href="https://en.wikipedia.org/wiki/Augury">Wikipedia</a>
|
10
14
|
</blockquote>
|
11
15
|
|
12
16
|
There are a lot of really funny twitter accounts out there.
|
13
17
|
Let's just pick one and get started.
|
14
18
|
|
15
|
-
```
|
19
|
+
```sh
|
16
20
|
$ augury generate seinfeldtoday
|
17
21
|
```
|
18
22
|
|
19
23
|
This just created the fortune files in the current directory:
|
20
24
|
|
21
|
-
```
|
25
|
+
```sh
|
22
26
|
$ ls
|
23
27
|
seinfeldtoday seinfeldtoday.dat
|
24
28
|
```
|
25
29
|
|
26
30
|
You can now read the new fortunes!
|
27
31
|
|
28
|
-
```
|
32
|
+
```sh
|
29
33
|
$ fortune seinfeldtoday
|
30
34
|
Elaine has no idea what her BF does for a living and it's now too
|
31
35
|
late to ask. E:"Teacher, I think. Or a doctor? Wait Is
|
@@ -51,13 +55,13 @@ gem 'augury'
|
|
51
55
|
|
52
56
|
And then execute:
|
53
57
|
|
54
|
-
```
|
58
|
+
```sh
|
55
59
|
$ bundle
|
56
60
|
```
|
57
61
|
|
58
62
|
Or install it yourself as:
|
59
63
|
|
60
|
-
```
|
64
|
+
```sh
|
61
65
|
$ gem install augury
|
62
66
|
```
|
63
67
|
|
@@ -69,7 +73,7 @@ The fortune program ships with a `strfile` program that converts the plain text
|
|
69
73
|
For example,
|
70
74
|
if you are using Homebrew on OS X:
|
71
75
|
|
72
|
-
```
|
76
|
+
```sh
|
73
77
|
$ brew install fortune
|
74
78
|
```
|
75
79
|
|
@@ -77,71 +81,138 @@ $ brew install fortune
|
|
77
81
|
|
78
82
|
### Augury Config
|
79
83
|
|
80
|
-
Create the `~/.augry.
|
84
|
+
Create the `~/.augry.yml` file and then set the permissions since your Twitter API info will be in there.
|
81
85
|
|
82
86
|
```sh
|
83
|
-
$ touch ~/.augury.
|
84
|
-
$ chmod 600 ~/.augury.
|
87
|
+
$ touch ~/.augury.yml
|
88
|
+
$ chmod 600 ~/.augury.yml
|
85
89
|
```
|
86
90
|
|
87
|
-
Set any of
|
91
|
+
Set any of the available settings in the config like this:
|
88
92
|
|
89
|
-
```
|
90
|
-
|
91
|
-
|
93
|
+
```yaml
|
94
|
+
count: 20
|
95
|
+
attribution: true
|
92
96
|
```
|
93
97
|
|
94
98
|
### Option list
|
95
99
|
|
96
|
-
These are the available options for the `~/.augury.
|
100
|
+
These are the available options for the `~/.augury.yml` config file.
|
97
101
|
|
98
102
|
Option | Description | Default
|
99
103
|
------ | :---------- | -------
|
100
104
|
`append` | Make the script add more entries to the specified file instead of re-writing it | `false`
|
101
105
|
`width` | Set the default width used if none is given on the command line. | `72`
|
102
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
|
+
`remove_links` | Remove all links from tweets before any other `transforms`. If set, this infers `links` is `true`. | `false`
|
111
|
+
`attribution` | Add an author attribution to each fortune. | `false`
|
112
|
+
`apply_transforms` | Apply the global and feed specific transforms. | `false`
|
113
|
+
`transforms` | Transformations to apply to specific user feeds. See [Transforms](#transforms) below. |
|
114
|
+
`global-transforms` | Transformations to apply to all feeds. Applied after `transforms` See [Transforms](#transforms) below. |
|
103
115
|
|
104
116
|
### Twitter Setup
|
105
117
|
|
106
118
|
First, you will need to create a new Twitter application by going here:
|
107
|
-
https://
|
119
|
+
https://developer.twitter.com
|
108
120
|
|
109
121
|
This will give you the ability to generate the consumer and access information used below.
|
110
122
|
|
111
|
-
Add the following to your `~/.augury.
|
123
|
+
Add the following to your `~/.augury.yml` config.
|
124
|
+
|
125
|
+
```yaml
|
126
|
+
twitter:
|
127
|
+
consumer_key: YOUR_CONSUMER_KEY
|
128
|
+
consumer_secret: YOUR_CONSUMER_SECRET
|
129
|
+
access_token: YOUR_ACCESS_TOKEN
|
130
|
+
access_token_secret: YOUR_ACCESS_TOKEN_SECRET
|
131
|
+
```
|
132
|
+
|
133
|
+
### Transforms
|
134
|
+
|
135
|
+
Global substitutions can be made using regular expressions.
|
136
|
+
Each transform is a pattern and replacement.
|
137
|
+
For instance, if you wanted to replace all `Hello`'s with `Hello world`, you could add the following:
|
138
|
+
|
139
|
+
```yaml
|
140
|
+
global-transforms:
|
141
|
+
-
|
142
|
+
- !ruby/regexp /(hello)/i
|
143
|
+
- "\\1 world"
|
144
|
+
```
|
145
|
+
|
146
|
+
Global transforms are applied after all other `transforms`.
|
147
|
+
Word wrapping is applied after the transforms have been applied.
|
148
|
+
|
149
|
+
#### Feed specific
|
150
|
+
|
151
|
+
Transforms can also be defined per user feed.
|
152
|
+
If you wanted to do the same as the global above, but only for `seinfeldtoday`, then add the following:
|
153
|
+
|
154
|
+
```yaml
|
155
|
+
transforms:
|
156
|
+
seinfeldtoday:
|
157
|
+
-
|
158
|
+
- !ruby/regexp /(hello)/i
|
159
|
+
- "\\1 world"
|
160
|
+
```
|
161
|
+
|
162
|
+
Or a more interesting example using the example earlier for `seinfeldtoday`:
|
163
|
+
|
164
|
+
```text
|
165
|
+
Elaine has no idea what her BF does for a living and it's now too
|
166
|
+
late to ask. E:"Teacher, I think. Or a doctor? Wait Is
|
167
|
+
'computers' a job?"
|
168
|
+
```
|
169
|
+
|
170
|
+
Then add the following to make this a bit more readable:
|
112
171
|
|
113
|
-
```
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
172
|
+
```yaml
|
173
|
+
transforms:
|
174
|
+
seinfeldtoday:
|
175
|
+
-
|
176
|
+
- !ruby/regexp /(E:\s*)/
|
177
|
+
- "\n\nElaine: "
|
178
|
+
-
|
179
|
+
- !ruby/regexp /BF/
|
180
|
+
- "boyfriend"
|
181
|
+
```
|
182
|
+
|
183
|
+
Then we end up with this:
|
184
|
+
|
185
|
+
```text
|
186
|
+
Elaine has no idea what her boyfriend does for a living and it's now
|
187
|
+
too late to ask.
|
188
|
+
|
189
|
+
Elaine: "Teacher, I think. Or a doctor? Wait Is 'computers' a job?"
|
119
190
|
```
|
120
191
|
|
121
192
|
## Usage
|
122
193
|
|
123
194
|
Create a fortune for the latest *seinfeldtoday* tweets.
|
124
195
|
|
125
|
-
```
|
196
|
+
```sh
|
126
197
|
$ augury generate seinfeldtoday
|
127
198
|
```
|
128
199
|
|
129
200
|
Now you have some fortunes.
|
130
201
|
|
131
|
-
```
|
202
|
+
```sh
|
132
203
|
$ fortune seinfeldtoday
|
133
204
|
```
|
134
205
|
|
135
206
|
Specify a width and a different path to use:
|
136
207
|
|
137
|
-
```
|
208
|
+
```sh
|
138
209
|
$ augury generate -w 120 seinfeldtoday /usr/local/share/games/fortune/Modern\ Seinfeld
|
139
210
|
```
|
140
211
|
|
141
212
|
If this is where your fortune program looks for fortunes,
|
142
213
|
you can now use the new fortune.
|
143
214
|
|
144
|
-
```
|
215
|
+
```sh
|
145
216
|
$ fortune "Modern Seinfeld"
|
146
217
|
```
|
147
218
|
|
@@ -149,9 +220,9 @@ $ fortune "Modern Seinfeld"
|
|
149
220
|
|
150
221
|
Run the help to get more details about what the program can do
|
151
222
|
|
152
|
-
```
|
153
|
-
$
|
154
|
-
$
|
223
|
+
```sh
|
224
|
+
$ augury help
|
225
|
+
$ augury help generate
|
155
226
|
```
|
156
227
|
|
157
228
|
## Development
|
@@ -161,7 +232,7 @@ do the following.
|
|
161
232
|
|
162
233
|
Create a fork, then get the code
|
163
234
|
|
164
|
-
```
|
235
|
+
```sh
|
165
236
|
$ git clone git@github.com:YOUR_USERNAME/augury.git
|
166
237
|
$ cd augury
|
167
238
|
```
|
@@ -171,29 +242,43 @@ Run the setup script to get everything installed:
|
|
171
242
|
**NOTE**: This requires having bundler available.
|
172
243
|
That is beyond the scope of this README.
|
173
244
|
|
174
|
-
```
|
245
|
+
```sh
|
175
246
|
$ bin/setup
|
176
247
|
```
|
177
248
|
|
178
249
|
Once that is finished, there is a console available.
|
179
250
|
This gives you access to all the code via Pry.
|
180
251
|
|
181
|
-
```
|
252
|
+
```sh
|
182
253
|
$ bin/console
|
183
254
|
```
|
184
255
|
|
185
|
-
The `augury` command will be available in
|
256
|
+
The `augury` command will be available in `exe`:
|
186
257
|
|
187
|
-
```
|
188
|
-
$
|
258
|
+
```sh
|
259
|
+
$ bundle exec ruby exe/augury help
|
189
260
|
```
|
190
261
|
|
191
262
|
### Run the tests
|
192
263
|
|
193
264
|
You can run the tests with the rake task:
|
194
265
|
|
266
|
+
```sh
|
267
|
+
$ bundle exec rspec
|
195
268
|
```
|
196
|
-
|
269
|
+
|
270
|
+
#### Twitter ENV
|
271
|
+
|
272
|
+
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.
|
273
|
+
|
274
|
+
```sh
|
275
|
+
$ eval `bin/extract_creds`
|
276
|
+
```
|
277
|
+
|
278
|
+
Then run the tests as you normally would.
|
279
|
+
|
280
|
+
```sh
|
281
|
+
$ bundle exec rspec
|
197
282
|
```
|
198
283
|
|
199
284
|
## Contributing
|
@@ -209,7 +294,7 @@ The gem is available as open source under the terms of the [MIT License](http://
|
|
209
294
|
Thanks to [TinderBox](http://gettinderbox.com) for giving us time to make cool things happen!
|
210
295
|
|
211
296
|
This was an excellent learning experience for the author,
|
212
|
-
who
|
297
|
+
who was new at programming in Ruby.
|
213
298
|
|
214
299
|
The [Developing a RubyGem using Bundler][gemdocs] documentation was fun to read and informative.
|
215
300
|
It helped get the skeleton of the code set up and extra goodies in the development profile.
|