usaidwat 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/log.feature +127 -77
- data/features/posts.feature +9 -9
- data/lib/usaidwat/commands/log.rb +2 -1
- data/lib/usaidwat/commands/posts.rb +1 -0
- data/lib/usaidwat/ext/array.rb +15 -0
- data/lib/usaidwat/ext/string.rb +5 -4
- data/lib/usaidwat/filter.rb +7 -2
- data/lib/usaidwat/formatter/comment.rb +3 -3
- data/lib/usaidwat/formatter/post.rb +2 -2
- data/lib/usaidwat/version.rb +1 -1
- data/spec/usaidwat/array_spec.rb +46 -22
- data/spec/usaidwat/formatter_spec.rb +0 -19
- data/spec/usaidwat/string_spec.rb +6 -10
- data/usaidwat.gemspec +1 -0
- metadata +19 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd56c1ad68b4c40008065965cdb1ae6868d6156f
|
4
|
+
data.tar.gz: 28f5d5efdf0f0699b5acf4c4819e5dcbd9484755
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad29b44221fcbd8e8f9559c8e0852598fe90034e2cc6bfdc7abfe908b90d664e0129538f0eb8ab6e158ae96d745f679cdd362fd9ffaa36b2ef6322b5ebecf8fa
|
7
|
+
data.tar.gz: 1ccdf23613c87cd19356d1e26dc63e022fe88dbb38d45300494af76b3c40a644aa59e53032a2912f13fd4c67da26bff26480ca8099f7354d0f4d6cd55df102fc
|
data/features/log.feature
CHANGED
@@ -12,7 +12,7 @@ Feature: Browse comments
|
|
12
12
|
"""
|
13
13
|
wikipedia
|
14
14
|
http://www.reddit.com/r/wikipedia/comments/142t4w/z/c79peed
|
15
|
-
Heisenbug: a software bug that seems to disappear or alter its behavior when one
|
15
|
+
Heisenbug: a software bug that seems to disappear or alter its behavior when one attempts to study it
|
16
16
|
over 2 years ago • +1
|
17
17
|
|
18
18
|
Yep. My first experience with a Heisenbug occurred in a C++ program, and disappeared when I tried to print a variable with printf (only to reappear when that call was removed).
|
@@ -20,7 +20,7 @@ Feature: Browse comments
|
|
20
20
|
|
21
21
|
nyc
|
22
22
|
http://www.reddit.com/r/nyc/comments/141zqc/z/c79dxg6
|
23
|
-
NYC taxi roof lights get overhaul - A light simply will mean the cab is
|
23
|
+
NYC taxi roof lights get overhaul - A light simply will mean the cab is available. No light will mean it's not.
|
24
24
|
over 2 years ago • +2
|
25
25
|
|
26
26
|
It has a fare when the lights are off.
|
@@ -42,7 +42,7 @@ Feature: Browse comments
|
|
42
42
|
"""
|
43
43
|
wikipedia
|
44
44
|
http://www.reddit.com/r/wikipedia/comments/142t4w/z/c79peed
|
45
|
-
Heisenbug: a software bug that seems to disappear or alter its behavior when one
|
45
|
+
Heisenbug: a software bug that seems to disappear or alter its behavior when one attempts to study it
|
46
46
|
over 2 years ago • +1
|
47
47
|
|
48
48
|
Yep. My first experience with a Heisenbug occurred in a C++ program, and disappeared when I tried to print a variable with printf (only to reappear when that call was removed).
|
@@ -50,7 +50,7 @@ Feature: Browse comments
|
|
50
50
|
|
51
51
|
nyc
|
52
52
|
http://www.reddit.com/r/nyc/comments/141zqc/z/c79dxg6
|
53
|
-
NYC taxi roof lights get overhaul - A light simply will mean the cab is
|
53
|
+
NYC taxi roof lights get overhaul - A light simply will mean the cab is available. No light will mean it's not.
|
54
54
|
over 2 years ago • +2
|
55
55
|
|
56
56
|
It has a fare when the lights are off.
|
@@ -64,7 +64,7 @@ Feature: Browse comments
|
|
64
64
|
"""
|
65
65
|
wikipedia
|
66
66
|
http://www.reddit.com/r/wikipedia/comments/142t4w/z/c79peed
|
67
|
-
Heisenbug: a software bug that seems to disappear or alter its behavior when one
|
67
|
+
Heisenbug: a software bug that seems to disappear or alter its behavior when one attempts to study it
|
68
68
|
Sat, 1 Dec 2012, 12:14 PM • +1
|
69
69
|
|
70
70
|
Yep. My first experience with a Heisenbug occurred in a C++ program, and disappeared when I tried to print a variable with printf (only to reappear when that call was removed).
|
@@ -72,7 +72,7 @@ Feature: Browse comments
|
|
72
72
|
|
73
73
|
nyc
|
74
74
|
http://www.reddit.com/r/nyc/comments/141zqc/z/c79dxg6
|
75
|
-
NYC taxi roof lights get overhaul - A light simply will mean the cab is
|
75
|
+
NYC taxi roof lights get overhaul - A light simply will mean the cab is available. No light will mean it's not.
|
76
76
|
Fri, 30 Nov 2012, 4:44 PM • +2
|
77
77
|
|
78
78
|
It has a fare when the lights are off.
|
@@ -94,7 +94,7 @@ Feature: Browse comments
|
|
94
94
|
"""
|
95
95
|
wikipedia
|
96
96
|
http://www.reddit.com/r/wikipedia/comments/142t4w/z/c79peed
|
97
|
-
Heisenbug: a software bug that seems to disappear or alter its behavior when one
|
97
|
+
Heisenbug: a software bug that seems to disappear or alter its behavior when one attempts to study it
|
98
98
|
over 2 years ago • +1
|
99
99
|
|
100
100
|
Yep. My first experience with a Heisenbug occurred in a C++ program, and disappeared when I tried to print a variable with printf (only to reappear when that call was removed).
|
@@ -102,7 +102,7 @@ Feature: Browse comments
|
|
102
102
|
|
103
103
|
nyc
|
104
104
|
http://www.reddit.com/r/nyc/comments/141zqc/z/c79dxg6
|
105
|
-
NYC taxi roof lights get overhaul - A light simply will mean the cab is
|
105
|
+
NYC taxi roof lights get overhaul - A light simply will mean the cab is available. No light will mean it's not.
|
106
106
|
over 2 years ago • +2
|
107
107
|
|
108
108
|
It has a fare when the lights are off.
|
@@ -124,7 +124,7 @@ Feature: Browse comments
|
|
124
124
|
"""
|
125
125
|
wikipedia
|
126
126
|
http://www.reddit.com/r/wikipedia/comments/142t4w/z/c79peed
|
127
|
-
Heisenbug: a software bug that seems to disappear or alter its behavior when one
|
127
|
+
Heisenbug: a software bug that seems to disappear or alter its behavior when one attempts to study it
|
128
128
|
over 2 years ago • +1
|
129
129
|
|
130
130
|
Yep. My first experience with a Heisenbug occurred in a C++ program, and disappeared when I tried to print a variable with printf (only to reappear when that call was removed).
|
@@ -132,7 +132,7 @@ Feature: Browse comments
|
|
132
132
|
|
133
133
|
nyc
|
134
134
|
http://www.reddit.com/r/nyc/comments/141zqc/z/c79dxg6
|
135
|
-
NYC taxi roof lights get overhaul - A light simply will mean the cab is
|
135
|
+
NYC taxi roof lights get overhaul - A light simply will mean the cab is available. No light will mean it's not.
|
136
136
|
over 2 years ago • +2
|
137
137
|
|
138
138
|
It has a fare when the lights are *off.*
|
@@ -154,7 +154,7 @@ Feature: Browse comments
|
|
154
154
|
"""
|
155
155
|
Games
|
156
156
|
http://www.reddit.com/r/Games/comments/13xc2o/z/c784qj8
|
157
|
-
The True Story of Battlefield 3, the Battlefield Franchise, Its Community, & EA/
|
157
|
+
The True Story of Battlefield 3, the Battlefield Franchise, Its Community, & EA/DICE
|
158
158
|
over 2 years ago • +2
|
159
159
|
|
160
160
|
That's exactly how I feel. There are times when I have a ton of fun playing BF3…but it always feels like it has so much more potential to be an awesome game.
|
@@ -164,7 +164,7 @@ Feature: Browse comments
|
|
164
164
|
|
165
165
|
books
|
166
166
|
http://www.reddit.com/r/books/comments/13vijv/z/c77stm8
|
167
|
-
I was saddened hearing this story on the Takeaway this morning- "Is literature
|
167
|
+
I was saddened hearing this story on the Takeaway this morning- "Is literature necessary?" discussing the new common core standards dictating that 70% of reading be non-fiction.
|
168
168
|
over 2 years ago • +1
|
169
169
|
|
170
170
|
I went to a public school.
|
@@ -180,7 +180,7 @@ Feature: Browse comments
|
|
180
180
|
|
181
181
|
books
|
182
182
|
http://www.reddit.com/r/books/comments/13vijv/z/c77n2hg
|
183
|
-
I was saddened hearing this story on the Takeaway this morning- "Is literature
|
183
|
+
I was saddened hearing this story on the Takeaway this morning- "Is literature necessary?" discussing the new common core standards dictating that 70% of reading be non-fiction.
|
184
184
|
over 2 years ago • +11
|
185
185
|
|
186
186
|
Yeah, I'm disappointed that some people only enjoyed two books. I didn't like all of the stuff I read in high school, but I got to read great things like Animal Farm, 1984, Night, Raisin in the Sun, The Glass Menagerie, Shakespeare, King Arthur, A Doll's House, Death of a Salesman, and probably more.
|
@@ -194,7 +194,7 @@ Feature: Browse comments
|
|
194
194
|
"""
|
195
195
|
Games
|
196
196
|
http://www.reddit.com/r/Games/comments/13xc2o/z/c784qj8
|
197
|
-
The True Story of Battlefield 3, the Battlefield Franchise, Its Community, & EA/
|
197
|
+
The True Story of Battlefield 3, the Battlefield Franchise, Its Community, & EA/DICE
|
198
198
|
over 2 years ago • +2
|
199
199
|
|
200
200
|
That's exactly how I feel. There are times when I have a ton of fun playing BF3…but it always feels like it has so much more potential to be an awesome game.
|
@@ -204,7 +204,7 @@ Feature: Browse comments
|
|
204
204
|
|
205
205
|
books
|
206
206
|
http://www.reddit.com/r/books/comments/13vijv/z/c77stm8
|
207
|
-
I was saddened hearing this story on the Takeaway this morning- "Is literature
|
207
|
+
I was saddened hearing this story on the Takeaway this morning- "Is literature necessary?" discussing the new common core standards dictating that 70% of reading be non-fiction.
|
208
208
|
over 2 years ago • +1
|
209
209
|
|
210
210
|
I went to a public school.
|
@@ -220,7 +220,7 @@ Feature: Browse comments
|
|
220
220
|
|
221
221
|
books
|
222
222
|
http://www.reddit.com/r/books/comments/13vijv/z/c77n2hg
|
223
|
-
I was saddened hearing this story on the Takeaway this morning- "Is literature
|
223
|
+
I was saddened hearing this story on the Takeaway this morning- "Is literature necessary?" discussing the new common core standards dictating that 70% of reading be non-fiction.
|
224
224
|
over 2 years ago • +11
|
225
225
|
|
226
226
|
Yeah, I'm disappointed that some people only enjoyed two books. I didn't like all of the stuff I read in high school, but I got to read great things like Animal Farm, 1984, Night, Raisin in the Sun, The Glass Menagerie, Shakespeare, King Arthur, A Doll's House, Death of a Salesman, and probably more.
|
@@ -234,7 +234,7 @@ Feature: Browse comments
|
|
234
234
|
"""
|
235
235
|
Games
|
236
236
|
http://www.reddit.com/r/Games/comments/13xc2o/z/c784qj8
|
237
|
-
The True Story of Battlefield 3, the Battlefield Franchise, Its Community, & EA/
|
237
|
+
The True Story of Battlefield 3, the Battlefield Franchise, Its Community, & EA/DICE
|
238
238
|
over 2 years ago • +2
|
239
239
|
|
240
240
|
That's exactly how I feel. There are times when I have a ton of fun playing BF3…but it always feels like it has so much more potential to be an awesome game.
|
@@ -244,7 +244,7 @@ Feature: Browse comments
|
|
244
244
|
|
245
245
|
books
|
246
246
|
http://www.reddit.com/r/books/comments/13vijv/z/c77stm8
|
247
|
-
I was saddened hearing this story on the Takeaway this morning- "Is literature
|
247
|
+
I was saddened hearing this story on the Takeaway this morning- "Is literature necessary?" discussing the new common core standards dictating that 70% of reading be non-fiction.
|
248
248
|
over 2 years ago • +1
|
249
249
|
|
250
250
|
I went to a public school.
|
@@ -260,7 +260,7 @@ Feature: Browse comments
|
|
260
260
|
|
261
261
|
books
|
262
262
|
http://www.reddit.com/r/books/comments/13vijv/z/c77n2hg
|
263
|
-
I was saddened hearing this story on the Takeaway this morning- "Is literature
|
263
|
+
I was saddened hearing this story on the Takeaway this morning- "Is literature necessary?" discussing the new common core standards dictating that 70% of reading be non-fiction.
|
264
264
|
over 2 years ago • +11
|
265
265
|
|
266
266
|
Yeah, I'm disappointed that some people only enjoyed two books. I didn't like all of the stuff I read in high school, but I got to read great things like Animal Farm, 1984, Night, Raisin in the Sun, The Glass Menagerie, Shakespeare, King Arthur, A Doll's House, Death of a Salesman, and probably more.
|
@@ -272,8 +272,8 @@ Feature: Browse comments
|
|
272
272
|
When I run `usaidwat log --oneline mipadi`
|
273
273
|
Then it should pass with:
|
274
274
|
"""
|
275
|
-
wikipedia Heisenbug: a software bug that seems to disappear or alter its
|
276
|
-
nyc NYC taxi roof lights get overhaul - A light simply will mean the cab is
|
275
|
+
wikipedia Heisenbug: a software bug that seems to disappear or alter its behavior when one attempts to study it
|
276
|
+
nyc NYC taxi roof lights get overhaul - A light simply will mean the cab is available. No light will mean it's not.
|
277
277
|
worldnews Palestinians win upgraded UN status by wide margin
|
278
278
|
"""
|
279
279
|
|
@@ -283,8 +283,8 @@ Feature: Browse comments
|
|
283
283
|
When I run `usaidwat log --oneline -n 2 mipadi`
|
284
284
|
Then it should pass with:
|
285
285
|
"""
|
286
|
-
wikipedia Heisenbug: a software bug that seems to disappear or alter its
|
287
|
-
nyc NYC taxi roof lights get overhaul - A light simply will mean the cab is
|
286
|
+
wikipedia Heisenbug: a software bug that seems to disappear or alter its behavior when one attempts to study it
|
287
|
+
nyc NYC taxi roof lights get overhaul - A light simply will mean the cab is available. No light will mean it's not.
|
288
288
|
"""
|
289
289
|
|
290
290
|
Scenario: One-line comments should be collapsed into unique titles
|
@@ -293,79 +293,79 @@ Feature: Browse comments
|
|
293
293
|
When I run `usaidwat log --oneline mipadi`
|
294
294
|
Then it should pass with exactly:
|
295
295
|
"""
|
296
|
-
wikipedia Heisenbug: a software bug that seems to disappear or alter its
|
297
|
-
nyc NYC taxi roof lights get overhaul - A light simply will mean the cab is
|
296
|
+
wikipedia Heisenbug: a software bug that seems to disappear or alter its behavior when one attempts to study it
|
297
|
+
nyc NYC taxi roof lights get overhaul - A light simply will mean the cab is available. No light will mean it's not.
|
298
298
|
worldnews Palestinians win upgraded UN status by wide margin
|
299
|
-
AskReddit Do colleges actually teach students how to think critically? Or even
|
300
|
-
AskReddit I'm from Tennessee and most of our jokes are geared toward Mississippi
|
301
|
-
AskReddit Today I was going 80mph in a 55 when an unmarked police car pulled up
|
302
|
-
AskReddit Why should I pay for a college degree when all of the information they
|
299
|
+
AskReddit Do colleges actually teach students how to think critically? Or even to think/question at all?
|
300
|
+
AskReddit I'm from Tennessee and most of our jokes are geared toward Mississippi and Alabama. Where are you from, and who are your jokes geared toward?
|
301
|
+
AskReddit Today I was going 80mph in a 55 when an unmarked police car pulled up next to me. Rather than pull me over, the officer simply mouthed "SLOW DOWN" and drove away. Reddit, when has the law made you crap your pants and then immediately made you day?
|
302
|
+
AskReddit Why should I pay for a college degree when all of the information they will teach me is probably available for free on the web? Why not set up some sort of accreditation program where people just take tests and get a degree?
|
303
303
|
apple iTunes 11 finally available for download - The Verge
|
304
|
-
Games The True Story of Battlefield 3, the Battlefield Franchise, Its Community,
|
305
|
-
AskReddit Professors/Students of Reddit- What are your feelings towards shit
|
306
|
-
books I was saddened hearing this story on the Takeaway this morning- "Is
|
307
|
-
AskReddit My friends give me crap about not watching "good" movies. Such as I've
|
304
|
+
Games The True Story of Battlefield 3, the Battlefield Franchise, Its Community, & EA/DICE
|
305
|
+
AskReddit Professors/Students of Reddit- What are your feelings towards shit Professors?
|
306
|
+
books I was saddened hearing this story on the Takeaway this morning- "Is literature necessary?" discussing the new common core standards dictating that 70% of reading be non-fiction.
|
307
|
+
AskReddit My friends give me crap about not watching "good" movies. Such as I've never seen any of the James Bonds movies. Reddit what movies do I need to see before I die?
|
308
308
|
AskReddit Reddit, what is the worst thing about your city?
|
309
309
|
AskReddit What is it like to own a decommissioned police car?
|
310
|
-
AskReddit When Microsoft was found guilty of violating antitrust law by bundling
|
310
|
+
AskReddit When Microsoft was found guilty of violating antitrust law by bundling Internet Explorer with Windows, how was the average user supposed to download a browser to begin with if IE wasn't there?
|
311
311
|
django I need a little help understanding billing and payment
|
312
312
|
programming Why software engineers are vastly undervalued
|
313
313
|
AskReddit Is Germany racist?
|
314
|
-
apple Report: Apple bumps Android from top spot in U.S. smartphone market on
|
315
|
-
AskReddit I got stood up by a girl for the first date. I have to go to work
|
314
|
+
apple Report: Apple bumps Android from top spot in U.S. smartphone market on strength of iPhone 5
|
315
|
+
AskReddit I got stood up by a girl for the first date. I have to go to work tommorrow with her. How should I handle it?
|
316
316
|
AskReddit How much does 'life' costs in your country/city/area?
|
317
317
|
programming Apple's proposal for modules in C(++) [PDF slides]
|
318
|
-
AskReddit Half of my facebook newsfeed is of people posting this quoted
|
319
|
-
AskReddit I'm lying in my warm bed with my fiance as my jetpack while Redditing
|
320
|
-
AskReddit I found out tonight that my dad's great grandfather was a Civil War
|
321
|
-
AskReddit This morning on the way home from walking my dogs I shit myself. What'
|
318
|
+
AskReddit Half of my facebook newsfeed is of people posting this quoted copyright protection statement to supposedly keep facebook from using their data. Am I right in assuming that this completely pointless?
|
319
|
+
AskReddit I'm lying in my warm bed with my fiance as my jetpack while Redditing and am perfectly, blissfully content. So tell me Reddit, what are some of your moments of contentment where you realized "hey, life doesn't suck."?
|
320
|
+
AskReddit I found out tonight that my dad's great grandfather was a Civil War POW. He was a union soldier from NY by way of MI, held captive by the confederate army in City Center at Richmond, VA and released at the end of the war. Reddit what have you found in your family's history that has surprised you?
|
321
|
+
AskReddit This morning on the way home from walking my dogs I shit myself. What's the most embarrassing kid thing you've done as an adult?
|
322
322
|
AskReddit Is it just me or do women have less genuine friendships than men?
|
323
323
|
programming RubyMonk
|
324
|
-
AskReddit How many government officials would have to die in an accident or
|
324
|
+
AskReddit How many government officials would have to die in an accident or attack, before a common citizen would be appointed or elected to the office of the United States?
|
325
325
|
programming The X.Org CodingStyle
|
326
|
-
AskReddit How would you stop people from pushing others into oncoming subways?
|
327
|
-
worldnews How Israeli Drone Pilots Made Their Life-and-Death Choices Over Gaza -
|
328
|
-
AskReddit This entire semester I thought my TA was a girl named Kayla...it's a
|
329
|
-
AskReddit Why is it that mathematical "illiteracy" is ok, but being unable to
|
326
|
+
AskReddit How would you stop people from pushing others into oncoming subways? Create something.
|
327
|
+
worldnews How Israeli Drone Pilots Made Their Life-and-Death Choices Over Gaza - “When you see a target, all you want to do is attack. But it’s not that simple.”
|
328
|
+
AskReddit This entire semester I thought my TA was a girl named Kayla...it's a boy named Caleb. My prof just forwarded him an e-mail where I referred to my TA "Kayla" and now I want to crawl into a hole and die. Has anything similar ever happened to you Reddit?
|
329
|
+
AskReddit Why is it that mathematical "illiteracy" is ok, but being unable to read or write is unacceptable?
|
330
330
|
AskReddit What's your brand of cigarette, and why?
|
331
|
-
AskReddit Accomplished Adults of Reddit: Honestly, is it more important to do
|
332
|
-
AskReddit I m a nutritionist. I often over hear people talk about nutrition like
|
331
|
+
AskReddit Accomplished Adults of Reddit: Honestly, is it more important to do what you love, even if it means making little money or is it more important to do something you may enjoy less, but will make lots of money from?
|
332
|
+
AskReddit I m a nutritionist. I often over hear people talk about nutrition like they are an expert, but they couldn't be farther from the truth. Reddit, what are some things in your profession that the lay person gets wrong?
|
333
333
|
personalfinance What's the most expensive mistake you ever made financially?
|
334
|
-
AskReddit I want to quit college and enlist in the Air Force. Am I throwing away
|
335
|
-
AskReddit Reddit, my boyfriend is abroad for a year. I'm trying to subtly work
|
336
|
-
AskReddit Why is everyone naming Israel as the "aggressor"?? Am I missing
|
334
|
+
AskReddit I want to quit college and enlist in the Air Force. Am I throwing away my future?
|
335
|
+
AskReddit Reddit, my boyfriend is abroad for a year. I'm trying to subtly work fake slang into our conversations with the hope of convincing him to use it when he gets back in the US. Give me your suggestions!
|
336
|
+
AskReddit Why is everyone naming Israel as the "aggressor"?? Am I missing something?
|
337
337
|
programming Why Brit Ruby 2013 was cancelled and why this is not ok — Gist
|
338
338
|
battlefield3 Can't argue with those rules..
|
339
|
-
AskReddit Who thinks "Mens Gift Ideas" are always super lame? Men of reddit what
|
339
|
+
AskReddit Who thinks "Mens Gift Ideas" are always super lame? Men of reddit what lame "guy" gifts are you tired of receiving? How would you edit these lists your wives, mothers, sisters are reading?
|
340
340
|
redditcasual Submissions for new clan tag...
|
341
341
|
programming How To Package Your Python Code - The Right Way…
|
342
342
|
programming Hounded By Recruiters, Coders Put Themselves Up For Auction - Forbes
|
343
343
|
photography Do you travel? If so, what camera do you use/prefer?
|
344
|
-
AskReddit I want to go to college for music even though it's not the most
|
345
|
-
AskReddit Reddit, what popular opinions about films do you think the complete
|
346
|
-
AskReddit If someone writes "Should of" instead of "Should have", I immediately
|
347
|
-
AskReddit I'm A Mixed Race Teen (Black Dad, White Mum) And I Constantly Get
|
348
|
-
AskReddit Do the James Bond films features occur in any sort of chronological
|
344
|
+
AskReddit I want to go to college for music even though it's not the most financially stable. Is it better to study your passion rather than a more financially stable option?
|
345
|
+
AskReddit Reddit, what popular opinions about films do you think the complete opposite of?
|
346
|
+
AskReddit If someone writes "Should of" instead of "Should have", I immediately read the rest of the post like it's a retarded person speaking. Yet I can't do anything about it. What other small annoyances are so widespread that it's beyond fixing?
|
347
|
+
AskReddit I'm A Mixed Race Teen (Black Dad, White Mum) And I Constantly Get People Incorrectly Guessing What My Ethnicity Is. Does This Happen To Anyone Else? If So, What Is Your Ethnicity And What Do People Guess You Are?
|
348
|
+
AskReddit Do the James Bond films features occur in any sort of chronological order? How severe are any continuity breaks?
|
349
349
|
apple iMessage down?
|
350
|
-
AskReddit Reddit, how old were you when you officially moved out? I'm 24 and
|
350
|
+
AskReddit Reddit, how old were you when you officially moved out? I'm 24 and feel like a total loser...
|
351
351
|
AskReddit Guys, what do girls wear that you absolutely can't stand?
|
352
|
-
AskReddit Looking into getting Windows 8 (Don't really like the looks of it from
|
353
|
-
AskReddit My stepdaughter is acting (sexually) inappropriately around me - what
|
352
|
+
AskReddit Looking into getting Windows 8 (Don't really like the looks of it from what I've seen in screenshots, but I figured I'd give it a chance). Should I go 32-bit or 64-bit? Why?
|
353
|
+
AskReddit My stepdaughter is acting (sexually) inappropriately around me - what actions should I take?
|
354
354
|
programming FizzBuzz Still Works
|
355
355
|
AskReddit Reddit, what is your most expensive mistake?
|
356
356
|
AskReddit Were you a part of the Occupy Wall Street movement?
|
357
|
-
AskReddit I'm coming up on my 6th year free from cocaine. Anybody else had or
|
357
|
+
AskReddit I'm coming up on my 6th year free from cocaine. Anybody else had or have a significant milestone this year?
|
358
358
|
programming UserManager.isUserAGoat() -- Oh you silly goat
|
359
|
-
AskReddit in regards to choosing a future career, should salary or enjoy-ability
|
360
|
-
AskReddit Guy I like asks me out to have coffee; gives me tips on how to get a
|
359
|
+
AskReddit in regards to choosing a future career, should salary or enjoy-ability be a more important deciding factor?
|
360
|
+
AskReddit Guy I like asks me out to have coffee; gives me tips on how to get a boyfriend. Reddit, when did you realize that you have been friendzoned?
|
361
361
|
AskReddit Men of Reddit: How much pressure is there for you guys to look good?
|
362
362
|
AskReddit Reddit, what custom ringtone do you use?
|
363
|
-
AskReddit Reddit: A lot of talk happens here about taxing the rich at a higher
|
364
|
-
AskReddit I'm dropping out of college and joining the workforce for a while,
|
363
|
+
AskReddit Reddit: A lot of talk happens here about taxing the rich at a higher percentage and is generally approved of. But how high should it actually be?
|
364
|
+
AskReddit I'm dropping out of college and joining the workforce for a while, have you dropped out and if so, how did it go?
|
365
365
|
AskReddit What ever happened to the cent sign (¢)?
|
366
|
-
AskReddit I ask you this reddit, what is your most prized possession in this
|
367
|
-
AskReddit Reddit seems to hate Papa Johns and Chik-Fil-A with a passion. What
|
368
|
-
AskReddit Men of Reddit: Do you get turned off when a girl says she is a
|
366
|
+
AskReddit I ask you this reddit, what is your most prized possession in this world. Doesn't necessarily have to be expensive, just important to you.
|
367
|
+
AskReddit Reddit seems to hate Papa Johns and Chik-Fil-A with a passion. What are some businesses that we love?
|
368
|
+
AskReddit Men of Reddit: Do you get turned off when a girl says she is a feminist?
|
369
369
|
"""
|
370
370
|
|
371
371
|
Scenario: Search for a specific comment
|
@@ -376,7 +376,7 @@ Feature: Browse comments
|
|
376
376
|
"""
|
377
377
|
wikipedia
|
378
378
|
http://www.reddit.com/r/wikipedia/comments/142t4w/z/c79peed
|
379
|
-
Heisenbug: a software bug that seems to disappear or alter its behavior when one
|
379
|
+
Heisenbug: a software bug that seems to disappear or alter its behavior when one attempts to study it
|
380
380
|
over 2 years ago • +1
|
381
381
|
|
382
382
|
Yep. My first experience with a Heisenbug occurred in a C++ program, and disappeared when I tried to print a variable with printf (only to reappear when that call was removed).
|
@@ -390,7 +390,21 @@ Feature: Browse comments
|
|
390
390
|
"""
|
391
391
|
wikipedia
|
392
392
|
http://www.reddit.com/r/wikipedia/comments/142t4w/z/c79peed
|
393
|
-
Heisenbug: a software bug that seems to disappear or alter its behavior when one
|
393
|
+
Heisenbug: a software bug that seems to disappear or alter its behavior when one attempts to study it
|
394
|
+
over 2 years ago • +1
|
395
|
+
|
396
|
+
Yep. My first experience with a Heisenbug occurred in a C++ program, and disappeared when I tried to print a variable with printf (only to reappear when that call was removed).
|
397
|
+
"""
|
398
|
+
|
399
|
+
Scenario: Search for a specific comment in a specific subreddit
|
400
|
+
Given the Reddit service returns comments for the user "mipadi"
|
401
|
+
And time is frozen at Jun 24, 2015 11:05 AM
|
402
|
+
When I run `usaidwat log --grep='heisenbug' mipadi wikipedia`
|
403
|
+
Then it should pass with:
|
404
|
+
"""
|
405
|
+
wikipedia
|
406
|
+
http://www.reddit.com/r/wikipedia/comments/142t4w/z/c79peed
|
407
|
+
Heisenbug: a software bug that seems to disappear or alter its behavior when one attempts to study it
|
394
408
|
over 2 years ago • +1
|
395
409
|
|
396
410
|
Yep. My first experience with a Heisenbug occurred in a C++ program, and disappeared when I tried to print a variable with printf (only to reappear when that call was removed).
|
@@ -405,6 +419,42 @@ Feature: Browse comments
|
|
405
419
|
mipadi has no comments matching /oogabooga/.
|
406
420
|
"""
|
407
421
|
|
422
|
+
Scenario: Search for a specific comment in a specific subreddit with no matches
|
423
|
+
Given the Reddit service returns comments for the user "mipadi"
|
424
|
+
And time is frozen at Jun 24, 2015 11:05 AM
|
425
|
+
When I run `usaidwat log --grep='oogabooga' mipadi wikipedia`
|
426
|
+
Then it should pass with:
|
427
|
+
"""
|
428
|
+
mipadi has no comments matching /oogabooga/ in /r/wikipedia.
|
429
|
+
"""
|
430
|
+
|
431
|
+
Scenario: Search for a specific comment in a specific subreddit that does not exist in that subreddit but exists elsewhere
|
432
|
+
Given the Reddit service returns comments for the user "mipadi"
|
433
|
+
And time is frozen at Jun 24, 2015 11:05 AM
|
434
|
+
When I run `usaidwat log --grep='heisenbug' mipadi programming`
|
435
|
+
Then it should pass with:
|
436
|
+
"""
|
437
|
+
mipadi has no comments matching /heisenbug/ in /r/programming.
|
438
|
+
"""
|
439
|
+
|
440
|
+
Scenario: Search for a specific comment in two subreddits with no matches
|
441
|
+
Given the Reddit service returns comments for the user "mipadi"
|
442
|
+
And time is frozen at Jun 24, 2015 11:05 AM
|
443
|
+
When I run `usaidwat log --grep='oogabooga' mipadi programming wikipedia`
|
444
|
+
Then it should pass with:
|
445
|
+
"""
|
446
|
+
mipadi has no comments matching /oogabooga/ in /r/programming or /r/wikipedia.
|
447
|
+
"""
|
448
|
+
|
449
|
+
Scenario: Search for a specific comment in three subreddits with no matches
|
450
|
+
Given the Reddit service returns comments for the user "mipadi"
|
451
|
+
And time is frozen at Jun 24, 2015 11:05 AM
|
452
|
+
When I run `usaidwat log --grep='oogabooga' mipadi programming wikipedia AskReddit`
|
453
|
+
Then it should pass with:
|
454
|
+
"""
|
455
|
+
mipadi has no comments matching /oogabooga/ in /r/programming, /r/wikipedia, or /r/askreddit.
|
456
|
+
"""
|
457
|
+
|
408
458
|
Scenario: List all comments for a user that does not exist
|
409
459
|
Given the Reddit service does not have a user "testuser"
|
410
460
|
When I run `usaidwat log testuser`
|
@@ -445,7 +495,7 @@ Feature: Browse comments
|
|
445
495
|
"""
|
446
496
|
AskReddit
|
447
497
|
http://www.reddit.com/r/AskReddit/comments/141kt9/z/c795rwz
|
448
|
-
Do colleges actually teach students how to think critically? Or even to think/
|
498
|
+
Do colleges actually teach students how to think critically? Or even to think/question at all?
|
449
499
|
over 2 years ago • +1
|
450
500
|
|
451
501
|
I think it depends on where you go and what you study, but yes, I think they do teach you to think critically, especially in humanities courses and seminars. Maybe it's just because I went to a small, private liberal arts college rather than a huge school, but critical thinking was definitely a part of my education.
|
@@ -453,7 +503,7 @@ Feature: Browse comments
|
|
453
503
|
|
454
504
|
AskReddit
|
455
505
|
http://www.reddit.com/r/AskReddit/comments/140t5c/z/c795nw3
|
456
|
-
I'm from Tennessee and most of our jokes are geared toward Mississippi and
|
506
|
+
I'm from Tennessee and most of our jokes are geared toward Mississippi and Alabama. Where are you from, and who are your jokes geared toward?
|
457
507
|
over 2 years ago • +1
|
458
508
|
|
459
509
|
You're from New Jersey? Which exit?
|
@@ -461,7 +511,7 @@ Feature: Browse comments
|
|
461
511
|
|
462
512
|
AskReddit
|
463
513
|
http://www.reddit.com/r/AskReddit/comments/140h3z/z/c795muo
|
464
|
-
Today I was going 80mph in a 55 when an unmarked police car pulled up next to me
|
514
|
+
Today I was going 80mph in a 55 when an unmarked police car pulled up next to me. Rather than pull me over, the officer simply mouthed "SLOW DOWN" and drove away. Reddit, when has the law made you crap your pants and then immediately made you day?
|
465
515
|
over 2 years ago • +1
|
466
516
|
|
467
517
|
You didn't slow down for very long though, did you?
|
@@ -475,7 +525,7 @@ Feature: Browse comments
|
|
475
525
|
"""
|
476
526
|
AskReddit
|
477
527
|
http://www.reddit.com/r/AskReddit/comments/140t5c/z/c795nw3
|
478
|
-
I'm from Tennessee and most of our jokes are geared toward Mississippi and
|
528
|
+
I'm from Tennessee and most of our jokes are geared toward Mississippi and Alabama. Where are you from, and who are your jokes geared toward?
|
479
529
|
over 2 years ago • +1
|
480
530
|
|
481
531
|
You're from New Jersey? Which exit?
|
@@ -489,7 +539,7 @@ Feature: Browse comments
|
|
489
539
|
"""
|
490
540
|
AskReddit
|
491
541
|
http://www.reddit.com/r/AskReddit/comments/140t5c/z/c795nw3
|
492
|
-
I'm from Tennessee and most of our jokes are geared toward Mississippi and
|
542
|
+
I'm from Tennessee and most of our jokes are geared toward Mississippi and Alabama. Where are you from, and who are your jokes geared toward?
|
493
543
|
over 2 years ago • +1
|
494
544
|
|
495
545
|
You're from New Jersey? Which exit?
|
@@ -503,7 +553,7 @@ Feature: Browse comments
|
|
503
553
|
"""
|
504
554
|
AskReddit
|
505
555
|
http://www.reddit.com/r/AskReddit/comments/141kt9/z/c795rwz
|
506
|
-
Do colleges actually teach students how to think critically? Or even to think/
|
556
|
+
Do colleges actually teach students how to think critically? Or even to think/question at all?
|
507
557
|
over 2 years ago • +1
|
508
558
|
|
509
559
|
I think it depends on where you go and what you study, but yes, I think they do teach you to think critically, especially in humanities courses and seminars. Maybe it's just because I went to a small, private liberal arts college rather than a huge school, but critical thinking was definitely a part of my education.
|
@@ -511,7 +561,7 @@ Feature: Browse comments
|
|
511
561
|
|
512
562
|
AskReddit
|
513
563
|
http://www.reddit.com/r/AskReddit/comments/140t5c/z/c795nw3
|
514
|
-
I'm from Tennessee and most of our jokes are geared toward Mississippi and
|
564
|
+
I'm from Tennessee and most of our jokes are geared toward Mississippi and Alabama. Where are you from, and who are your jokes geared toward?
|
515
565
|
over 2 years ago • +1
|
516
566
|
|
517
567
|
You're from New Jersey? Which exit?
|
@@ -519,7 +569,7 @@ Feature: Browse comments
|
|
519
569
|
|
520
570
|
AskReddit
|
521
571
|
http://www.reddit.com/r/AskReddit/comments/140h3z/z/c795muo
|
522
|
-
Today I was going 80mph in a 55 when an unmarked police car pulled up next to me
|
572
|
+
Today I was going 80mph in a 55 when an unmarked police car pulled up next to me. Rather than pull me over, the officer simply mouthed "SLOW DOWN" and drove away. Reddit, when has the law made you crap your pants and then immediately made you day?
|
523
573
|
over 2 years ago • +1
|
524
574
|
|
525
575
|
You didn't slow down for very long though, did you?
|
data/features/posts.feature
CHANGED
@@ -124,7 +124,7 @@ Feature: Show posts
|
|
124
124
|
|
125
125
|
webdev
|
126
126
|
https://www.reddit.com/r/webdev/comments/29og3m
|
127
|
-
Sick of Ruby, dynamic typing, side effects, and basically object-oriented
|
127
|
+
Sick of Ruby, dynamic typing, side effects, and basically object-oriented programming
|
128
128
|
about a year ago
|
129
129
|
https://blog.abevoelker.com/sick-of-ruby-dynamic-typing-side-effects-object-oriented-programming/
|
130
130
|
|
@@ -198,21 +198,21 @@ Feature: Show posts
|
|
198
198
|
webdev The Future of Web Design is Hidden in the History of Architecture
|
199
199
|
swift Does Swift make native app development easier?
|
200
200
|
webdev Microservices in Clojure
|
201
|
-
movies Interstellar's true black hole would have been too confusing for
|
202
|
-
webdev Major security alert as 40,000 MongoDB databases left unsecured on the
|
203
|
-
vim Why does my shell prompt disappear when I install and use vim 7.4 (on CentOS
|
201
|
+
movies Interstellar's true black hole would have been too confusing for audiences
|
202
|
+
webdev Major security alert as 40,000 MongoDB databases left unsecured on the internet
|
203
|
+
vim Why does my shell prompt disappear when I install and use vim 7.4 (on CentOS 6)?
|
204
204
|
swift Swift for CLI tools
|
205
205
|
Games Chief Executive of Rovio, Maker of Angry Birds Game, to Step Down
|
206
206
|
webdev You have ruined HTML
|
207
207
|
swift A few thoughts on Swift
|
208
|
-
webdev Sick of Ruby, dynamic typing, side effects, and basically object-oriented
|
208
|
+
webdev Sick of Ruby, dynamic typing, side effects, and basically object-oriented programming
|
209
209
|
webdev Vim for people who think things like Vim are weird and hard
|
210
210
|
webdev The emperor’s new clothes were built with Node.js
|
211
|
-
webdev Clojure, or how to put the spark back into your relationship with
|
211
|
+
webdev Clojure, or how to put the spark back into your relationship with programming
|
212
212
|
Clojure Clojure: A Retrospective
|
213
|
-
programming Fresh perspectives: Learning new languages after you know (quite) a
|
213
|
+
programming Fresh perspectives: Learning new languages after you know (quite) a few
|
214
214
|
webdev I created a tool for sampling Reddit users' karma (link and comment)
|
215
|
-
programming Erlang and code style: Musings on mostly defensive programming
|
215
|
+
programming Erlang and code style: Musings on mostly defensive programming styles
|
216
216
|
webdev Facebook: MVC Does Not Scale, Use Flux Instead
|
217
217
|
"""
|
218
218
|
|
@@ -261,7 +261,7 @@ Feature: Show posts
|
|
261
261
|
|
262
262
|
webdev
|
263
263
|
https://www.reddit.com/r/webdev/comments/29og3m
|
264
|
-
Sick of Ruby, dynamic typing, side effects, and basically object-oriented
|
264
|
+
Sick of Ruby, dynamic typing, side effects, and basically object-oriented programming
|
265
265
|
about a year ago
|
266
266
|
https://blog.abevoelker.com/sick-of-ruby-dynamic-typing-side-effects-object-oriented-programming/
|
267
267
|
|
@@ -34,7 +34,7 @@ module USaidWat
|
|
34
34
|
comments = redditor.comments
|
35
35
|
|
36
36
|
res = filter_entries('comments', redditor, comments, subreddits) >>
|
37
|
-
lambda { |r| grep_entries('comments', redditor, r.value, options['grep']) } >>
|
37
|
+
lambda { |r| grep_entries('comments', redditor, r.value, options['grep'], subreddits) } >>
|
38
38
|
lambda { |r| limit_entries('comments', redditor, r.value, options['limit']) } >>
|
39
39
|
lambda { |r| ensure_entries('comments', redditor, r.value) }
|
40
40
|
|
@@ -56,6 +56,7 @@ module USaidWat
|
|
56
56
|
def list_comments(comments, options = {})
|
57
57
|
oneline = options[:oneline]
|
58
58
|
formatter = (oneline ? USaidWat::CLI::CompactCommentFormatter : USaidWat::CLI::CommentFormatter).new(options)
|
59
|
+
ENV['LESS'] = 'RS' if options[:oneline]
|
59
60
|
page
|
60
61
|
comments.each { |c| print formatter.format(c) }
|
61
62
|
end
|
data/lib/usaidwat/ext/array.rb
CHANGED
@@ -2,4 +2,19 @@ class Array
|
|
2
2
|
def subreddits
|
3
3
|
join(' ').split(/[ ,\+]/).map { |sr| sr.downcase }
|
4
4
|
end
|
5
|
+
|
6
|
+
def or_join
|
7
|
+
case count
|
8
|
+
when 0
|
9
|
+
''
|
10
|
+
when 1
|
11
|
+
first
|
12
|
+
when 2
|
13
|
+
join(' or ')
|
14
|
+
else
|
15
|
+
last_entry = 'or ' + last
|
16
|
+
items = self[0...-1] << last_entry
|
17
|
+
items.join(', ')
|
18
|
+
end
|
19
|
+
end
|
5
20
|
end
|
data/lib/usaidwat/ext/string.rb
CHANGED
@@ -1,10 +1,6 @@
|
|
1
1
|
require 'rainbow'
|
2
2
|
|
3
3
|
class String
|
4
|
-
def truncate(width)
|
5
|
-
self[0, width]
|
6
|
-
end
|
7
|
-
|
8
4
|
def pluralize(n, suffix = 's', singular_suffix = '')
|
9
5
|
if n == 1
|
10
6
|
self + singular_suffix
|
@@ -20,4 +16,9 @@ class String
|
|
20
16
|
def unescape_html
|
21
17
|
gsub(/>/, '>').gsub(/</, '<').gsub(/&/, '&')
|
22
18
|
end
|
19
|
+
|
20
|
+
def prefix_subreddit
|
21
|
+
return self if length == 0
|
22
|
+
'/r/' + self
|
23
|
+
end
|
23
24
|
end
|
data/lib/usaidwat/filter.rb
CHANGED
@@ -13,11 +13,16 @@ module USaidWat
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
def grep_entries(noun, redditor, entries, grep)
|
16
|
+
def grep_entries(noun, redditor, entries, grep, subreddits = [])
|
17
17
|
return USaidWat::Right.new(entries) if grep.nil?
|
18
18
|
entries = entries.select { |e| e.body =~ /#{grep}/i }
|
19
19
|
if entries.empty?
|
20
|
-
msg = "#{redditor.username} has no #{noun} matching /#{grep}
|
20
|
+
msg = "#{redditor.username} has no #{noun} matching /#{grep}/"
|
21
|
+
unless subreddits.empty?
|
22
|
+
prefixed_subs = subreddits.map(&:prefix_subreddit)
|
23
|
+
msg += " in " + prefixed_subs.or_join
|
24
|
+
end
|
25
|
+
msg += "."
|
21
26
|
USaidWat::Left.new(msg)
|
22
27
|
else
|
23
28
|
USaidWat::Right.new(entries)
|
@@ -7,7 +7,7 @@ module USaidWat
|
|
7
7
|
out.write("\n\n") unless @count == 0
|
8
8
|
out.write("#{comment.subreddit}\n".color(:green))
|
9
9
|
out.write("#{comment_link(comment)}\n".color(:yellow))
|
10
|
-
out.write("#{comment.link_title.strip.unescape_html
|
10
|
+
out.write("#{comment.link_title.strip.unescape_html}\n".color(:magenta))
|
11
11
|
out.write("#{comment_date(comment)}".color(:blue))
|
12
12
|
out.write(" \u2022 ".color(:cyan))
|
13
13
|
out.write(sprintf("%+d\n", comment_karma(comment)).color(:blue))
|
@@ -63,7 +63,7 @@ module USaidWat
|
|
63
63
|
out = StringIO.new
|
64
64
|
subreddit = comment.subreddit
|
65
65
|
cols -= subreddit.length + 1
|
66
|
-
title = comment.link_title.strip.unescape_html
|
66
|
+
title = comment.link_title.strip.unescape_html
|
67
67
|
key = "#{subreddit} #{title}"
|
68
68
|
if !seen?(key)
|
69
69
|
out.write("#{subreddit}".color(:green))
|
@@ -77,7 +77,7 @@ module USaidWat
|
|
77
77
|
private
|
78
78
|
|
79
79
|
def comments
|
80
|
-
@comments ||= Set.new
|
80
|
+
@comments ||= ::Set.new
|
81
81
|
end
|
82
82
|
|
83
83
|
def mark_seen(comment)
|
@@ -7,7 +7,7 @@ module USaidWat
|
|
7
7
|
out.write("\n\n\n") unless @count == 0
|
8
8
|
out.write("#{post.subreddit}\n".color(:green))
|
9
9
|
out.write("#{post_link(post)}\n".color(:yellow))
|
10
|
-
out.write("#{post.title.strip.unescape_html
|
10
|
+
out.write("#{post.title.strip.unescape_html}\n".color(:magenta))
|
11
11
|
out.write("#{post_date(post)}".color(:blue))
|
12
12
|
out.write("\n#{post.url}") unless post.url.end_with?(post.permalink)
|
13
13
|
@count += 1
|
@@ -32,7 +32,7 @@ module USaidWat
|
|
32
32
|
out = StringIO.new
|
33
33
|
subreddit = post.subreddit
|
34
34
|
cols -= subreddit.length + 1
|
35
|
-
title = post.title.strip.unescape_html
|
35
|
+
title = post.title.strip.unescape_html
|
36
36
|
out.write(subreddit.color(:green))
|
37
37
|
out.write(" #{title}\n")
|
38
38
|
out.rewind
|
data/lib/usaidwat/version.rb
CHANGED
data/spec/usaidwat/array_spec.rb
CHANGED
@@ -4,32 +4,56 @@ require 'usaidwat/ext/array'
|
|
4
4
|
module USaidWat
|
5
5
|
module Ext
|
6
6
|
describe Array do
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
describe "#subreddits" do
|
8
|
+
it "should split args separated by spaces" do
|
9
|
+
v = %W{one two three}
|
10
|
+
expected = v
|
11
|
+
actual = v.subreddits
|
12
|
+
expect(actual).to eq(expected)
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
it "should split args separated by commas" do
|
16
|
+
v = ['one,two,three']
|
17
|
+
expected = %W{one two three}
|
18
|
+
actual = v.subreddits
|
19
|
+
expect(actual).to eq(expected)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should split args separated by plus signs" do
|
23
|
+
v = ['one+two+three']
|
24
|
+
expected = %W{one two three}
|
25
|
+
actual = v.subreddits
|
26
|
+
expect(actual).to eq(expected)
|
27
|
+
end
|
20
28
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
29
|
+
it "should downcase all args" do
|
30
|
+
v = %W{one Two Three}
|
31
|
+
expected = %W{one two three}
|
32
|
+
actual = v.subreddits
|
33
|
+
expect(actual).to eq(expected)
|
34
|
+
end
|
26
35
|
end
|
27
36
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
37
|
+
describe "#or_join" do
|
38
|
+
it "should return the first item if the array has one item" do
|
39
|
+
v = ['wikipedia']
|
40
|
+
expect(v.or_join).to eq("wikipedia")
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should separate the last entry by 'or'" do
|
44
|
+
v = ['wikipedia', 'programming']
|
45
|
+
expect(v.or_join).to eq('wikipedia or programming')
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should separate all entries with commas and add the word 'or'" do
|
49
|
+
v = ['wikipedia', 'programming', 'AskReddit']
|
50
|
+
expect(v.or_join).to eq('wikipedia, programming, or AskReddit')
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should return an empty string for empty arrays" do
|
54
|
+
v = []
|
55
|
+
expect(v.or_join).to eq('')
|
56
|
+
end
|
33
57
|
end
|
34
58
|
end
|
35
59
|
end
|
@@ -159,25 +159,6 @@ EXPECTED
|
|
159
159
|
expect(lines[2]).to eq('')
|
160
160
|
expect(lines[3]).not_to eq('')
|
161
161
|
end
|
162
|
-
|
163
|
-
it "should truncate titles to 80 characters" do
|
164
|
-
post = double("post")
|
165
|
-
expect(post).to receive(:subreddit).and_return("webdev")
|
166
|
-
expect(post).to receive(:permalink).twice.and_return("/r/webdev/comments/29og3m/sick_of_ruby_dynamic_typing_side_effects_and/")
|
167
|
-
expect(post).to receive(:title).and_return("Sick of Ruby, dynamic typing, side effects, and basically object-oriented programming")
|
168
|
-
expect(post).to receive(:created_utc).and_return(Time.at(1404331670))
|
169
|
-
expect(post).to receive(:url).twice.and_return("https://blog.abevoelker.com/sick-of-ruby-dynamic-typing-side-effects-object-oriented-programming/")
|
170
|
-
expected = <<-EXPECTED
|
171
|
-
webdev
|
172
|
-
https://www.reddit.com/r/webdev/comments/29og3m
|
173
|
-
Sick of Ruby, dynamic typing, side effects, and basically object-oriented progra
|
174
|
-
about a year ago
|
175
|
-
https://blog.abevoelker.com/sick-of-ruby-dynamic-typing-side-effects-object-oriented-programming/
|
176
|
-
EXPECTED
|
177
|
-
expected = expected.strip
|
178
|
-
actual = formatter.format(post).delete_ansi_color_codes
|
179
|
-
expect(actual).to eq(expected)
|
180
|
-
end
|
181
162
|
end
|
182
163
|
end
|
183
164
|
|
@@ -4,18 +4,14 @@ require 'spec_helper'
|
|
4
4
|
module USaidWat
|
5
5
|
module Ext
|
6
6
|
describe String do
|
7
|
-
describe "#
|
8
|
-
it "
|
9
|
-
|
10
|
-
s
|
11
|
-
expect(s.truncate(n).length).to eq(n)
|
7
|
+
describe "#prefix_subreddit" do
|
8
|
+
it "should add /r/ to the beginning of strings" do
|
9
|
+
s = "wikipedia"
|
10
|
+
expect(s.prefix_subreddit).to eq("/r/wikipedia")
|
12
11
|
end
|
13
12
|
|
14
|
-
it "
|
15
|
-
|
16
|
-
s = "string"
|
17
|
-
expect(s.truncate(n).length).to eq(s.length)
|
18
|
-
expect(s.truncate(n).length).to be < n
|
13
|
+
it "should return an empty string if the string itself is empty" do
|
14
|
+
expect(''.prefix_subreddit).to eq('')
|
19
15
|
end
|
20
16
|
end
|
21
17
|
|
data/usaidwat.gemspec
CHANGED
@@ -37,6 +37,7 @@ Gem::Specification.new do |gem|
|
|
37
37
|
|
38
38
|
gem.add_development_dependency('aruba', '~> 0.9')
|
39
39
|
gem.add_development_dependency('cucumber', '~> 2.0')
|
40
|
+
gem.add_development_dependency('rake', '~> 12.0')
|
40
41
|
gem.add_development_dependency('rspec', '~> 3.2')
|
41
42
|
gem.add_development_dependency('timecop', '~> 0.8.0')
|
42
43
|
gem.add_development_dependency('webmock', '~> 2.0')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: usaidwat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Dippery
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: downterm
|
@@ -128,6 +128,20 @@ dependencies:
|
|
128
128
|
- - "~>"
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '2.0'
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: rake
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - "~>"
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '12.0'
|
138
|
+
type: :development
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - "~>"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '12.0'
|
131
145
|
- !ruby/object:Gem::Dependency
|
132
146
|
name: rspec
|
133
147
|
requirement: !ruby/object:Gem::Requirement
|
@@ -246,9 +260,9 @@ homepage: https://github.com/mdippery/usaidwat
|
|
246
260
|
licenses:
|
247
261
|
- MIT
|
248
262
|
metadata:
|
249
|
-
build_date:
|
250
|
-
commit: v1.5.
|
251
|
-
commit_hash:
|
263
|
+
build_date: 2017-03-05 18:42:10 PST
|
264
|
+
commit: v1.5.1
|
265
|
+
commit_hash: 76e5fc4336f86bc7336ce8cf448230b500186e14
|
252
266
|
post_install_message:
|
253
267
|
rdoc_options: []
|
254
268
|
require_paths:
|