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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTI3ZDM4MjA4NDE3ZWRiMjFhOTY1YjFmNjk4MjQ0MDFiMDMzN2M3NA==
4
+ MTlhZGNjMzNlZGI2ZDczOGZkZTc3ZjkyMTdkOTIzODVkOThiZmE2ZA==
5
5
  data.tar.gz: !binary |-
6
- NmJjMTY5MDA3Yzc1MThhNGI5MGQ5OTlmYjg0NWQyNTAwNTFhMDc1YQ==
6
+ OTMwNjJhZjNlZGQzMDY0ZWFkN2U2OTIyNTgyNGE5YWEzNjQwYmNkOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjMyOTgzYmQyODFiODc5ZDJiNGI3N2E4ZDMyZjE4MDdlZmE3NmM3OTBhMjQz
10
- MTZkZGFjNmQzMTRjYTc1YjE3N2NjNWRkYzA0MGMyZDcwMGE4YzBmZjczYThi
11
- YmU2MjVmZThiZTJjMDg3NjgyODg1NTlmOTdkOTAwN2FhMDU1NDc=
9
+ MWMzYWFhODdkNmExM2YwMTQxM2VjYTIxY2ZmNTgyMTU0NDA3N2I0YjkyMjYy
10
+ OTcwZjFhM2QyYWQ4ZTNiYmExNDE4MDA0YjQ5NDcwMTk5OWUwMGNmNDllNTY0
11
+ NzY2NTNhZTk3NDY0Nzk5NDE4OWQ0YzljMjEzNjhkODUxYTA4Yjk=
12
12
  data.tar.gz: !binary |-
13
- ZWNjYjZmNzhlMzZjOWYxNmRjMzRmNjE4MzY1ODY5OTRjZTFmMDY1MDBiOWY5
14
- ODhlNGE1NmM0YTcxM2RhYjM3YmIxNGI5NTIxNTlhYzM1NGVjNmEzOTkwN2I2
15
- YTdkNjE0N2MwOTRlMmUyNTgwY2FiYjVjYWU0YzAzOGUwMjc5ZDc=
13
+ ZTI4NWUwZDk1ZDUyY2U2MjNmOGUxMGIzYzYxMjBlYWI5YmIxY2Q0NGNhYjUx
14
+ MjE0MDFlNGFlMjVjMmZmN2M0NGI5NzY0NWJhMTUyYWZlMGYzNjg1MzBkNjVj
15
+ MzFhNzczNzRiZDdlYWRhY2Y3YjBiNTcwODI3MWI1MmIzNTk5YjU=
data/README.md CHANGED
@@ -2,10 +2,16 @@
2
2
  [![Build Status](https://travis-ci.org/JamesAwesome/random_yiff.svg?branch=master)](https://travis-ci.org/JamesAwesome/random_yiff)
3
3
  [![Coverage Status](https://coveralls.io/repos/JamesAwesome/random_yiff/badge.svg)](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
- As a cli app
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
@@ -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
- puts AsciiArt.new(yiff.file_url).to_ascii_art(color: true, width: 160)
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'
@@ -1,3 +1,3 @@
1
1
  module RandomYiff
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
@@ -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
- allow(AsciiArt).to receive(:new).and_return(furry_pr0n)
44
- allow(furry_pr0n).to receive(:to_ascii_art).and_return('yiff')
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: random_yiff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Awesome