random_yiff 0.2.0 → 0.2.1
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 +8 -8
- data/README.md +10 -4
- data/lib/random_yiff/cli.rb +8 -1
- data/lib/random_yiff/version.rb +1 -1
- data/spec/random_yiff/cli_spec.rb +18 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTlhZGNjMzNlZGI2ZDczOGZkZTc3ZjkyMTdkOTIzODVkOThiZmE2ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTMwNjJhZjNlZGQzMDY0ZWFkN2U2OTIyNTgyNGE5YWEzNjQwYmNkOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MWMzYWFhODdkNmExM2YwMTQxM2VjYTIxY2ZmNTgyMTU0NDA3N2I0YjkyMjYy
|
10
|
+
OTcwZjFhM2QyYWQ4ZTNiYmExNDE4MDA0YjQ5NDcwMTk5OWUwMGNmNDllNTY0
|
11
|
+
NzY2NTNhZTk3NDY0Nzk5NDE4OWQ0YzljMjEzNjhkODUxYTA4Yjk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTI4NWUwZDk1ZDUyY2U2MjNmOGUxMGIzYzYxMjBlYWI5YmIxY2Q0NGNhYjUx
|
14
|
+
MjE0MDFlNGFlMjVjMmZmN2M0NGI5NzY0NWJhMTUyYWZlMGYzNjg1MzBkNjVj
|
15
|
+
MzFhNzczNzRiZDdlYWRhY2Y3YjBiNTcwODI3MWI1MmIzNTk5YjU=
|
data/README.md
CHANGED
@@ -2,10 +2,16 @@
|
|
2
2
|
[](https://travis-ci.org/JamesAwesome/random_yiff)
|
3
3
|
[](https://coveralls.io/r/JamesAwesome/random_yiff)
|
4
4
|
|
5
|
-
Bring forth Random Furry pr0n, amaze your friends, scare normal people.
|
6
|
-
|
7
5
|
RandomYiff will provide you with a random post from e621.net via their /post/random route.
|
8
6
|
|
7
|
+
The RandomYiff gem is both a library and a CLI app named `yiff`.
|
8
|
+
|
9
|
+
The `RandomYiff::E621` class allows a user to get a random post from e621. Helper methods such
|
10
|
+
as `#file` allow the user to access the furry pr0n associated with said e621 post with ease.
|
11
|
+
|
12
|
+
The `yiff` command allows users to open furry pr0n in browser, download furry pr0n and
|
13
|
+
even print furry pr0n in terminal as colored ascii.
|
14
|
+
|
9
15
|
## Installation
|
10
16
|
|
11
17
|
Add this line to your application's Gemfile:
|
@@ -24,10 +30,10 @@ Or install it yourself as:
|
|
24
30
|
|
25
31
|
## Usage
|
26
32
|
|
27
|
-
|
33
|
+
For CLI app usage
|
28
34
|
|
29
35
|
```bash
|
30
|
-
yiff
|
36
|
+
yiff help
|
31
37
|
```
|
32
38
|
|
33
39
|
To return a random post URI
|
data/lib/random_yiff/cli.rb
CHANGED
@@ -14,9 +14,16 @@ module RandomYiff
|
|
14
14
|
|
15
15
|
desc 'ascii', 'Print furry pr0n as ascii'
|
16
16
|
|
17
|
+
method_option :width,
|
18
|
+
desc: 'width to limit ascii to',
|
19
|
+
type: :numeric,
|
20
|
+
default: nil
|
21
|
+
|
17
22
|
def ascii
|
18
23
|
yiff = random_image
|
19
|
-
|
24
|
+
ascii_opts = { color: true }
|
25
|
+
ascii_opts.merge!(width: options[:width]) if options[:width]
|
26
|
+
puts AsciiArt.new(yiff.file_url).to_ascii_art(ascii_opts)
|
20
27
|
end
|
21
28
|
|
22
29
|
desc 'download', 'Download furry pr0n'
|
data/lib/random_yiff/version.rb
CHANGED
@@ -38,13 +38,29 @@ describe RandomYiff::Cli do
|
|
38
38
|
end
|
39
39
|
|
40
40
|
describe '#ascii' do
|
41
|
+
before do
|
42
|
+
allow(AsciiArt).to receive(:new).and_return(furry_pr0n)
|
43
|
+
end
|
44
|
+
|
41
45
|
let(:furry_pr0n) { instance_double(AsciiArt) }
|
46
|
+
|
42
47
|
it 'prints a random furry pr0n image as ascii' do
|
43
|
-
|
44
|
-
|
48
|
+
expect(furry_pr0n).to receive(:to_ascii_art)
|
49
|
+
.with(color: true)
|
50
|
+
.and_return('yiff')
|
45
51
|
expect { RandomYiff::Cli.start(['ascii']) }
|
46
52
|
.to output("yiff\n").to_stdout
|
47
53
|
end
|
54
|
+
|
55
|
+
context 'when given a width via method option' do
|
56
|
+
it 'prints random furry pr0n with width specified' do
|
57
|
+
expect(furry_pr0n).to receive(:to_ascii_art)
|
58
|
+
.with(color: true, width: 160)
|
59
|
+
.and_return('yiff')
|
60
|
+
expect { RandomYiff::Cli.start(%w(ascii --width 160)) }
|
61
|
+
.to output("yiff\n").to_stdout
|
62
|
+
end
|
63
|
+
end
|
48
64
|
end
|
49
65
|
|
50
66
|
describe '#random_image' do
|