random_yiff 0.2.2 → 0.3.0

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
- MzkyOWY4NWRhOTkzZWYzZGE5ZTIxZDlhODMyNjUyYTk2YzRkMTg4Yg==
4
+ MDYyOTQ2ZmQxZDBjYmIwNDk1OGNiZWVkMzIxOWU5NDNhMzY1YTE3YQ==
5
5
  data.tar.gz: !binary |-
6
- MDFlYWI0NDNhMjE4Mjc5MjM3Y2UyMWRiZmYwODdiZmQzZWMxNWY3Yw==
6
+ YjNkNzU2NmU5NGI1YTg4M2I1Mjk5MzM1ODBhN2U3OTdlZGIxODI5OQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OGQzNDEwZWQ4YmMyYTdhMWY2MTZjYzhkMjk0MmRjNTZiMDdjZTI5NmY5ZTg0
10
- MWFiMDRkZDUyOWVmN2Y4OWFlNWY5NmNjMDFhZTljYjhmNzcxZDY4Y2RhZTlh
11
- ZmJkMWFmMmRhMjFmMjRjNjQ0MDkzMjkxNjYzYTY3MzA4YzY1MjQ=
9
+ ZmQ2YjRjZmEyYzE5ZTYwOWU5ZDY2NDlkYTkyODBhZWNjZGQ0MzMzYWUwMGY1
10
+ Yzg4YWQ3ZGI5MmY1OGQxNTdlNmFjNzlkMzVlYmU2MTc4YmQ1MTc1ZGJlNmNh
11
+ OTZiZmM2YTE0OTZiZjhjMGQ3YjkzOTM1NDU0M2FmY2ZiMmMxZDI=
12
12
  data.tar.gz: !binary |-
13
- ZTI2NTlmN2RhNWNiOWFjZTM0OTE2NjlmNDcyMjkxODMzOGYyODA0YWRhMzgx
14
- MzlmNzgzOWMwMDU2ZWQ1ZDg0MWE3YjE1ODBhOWViOWZiZTIwMjE0NTFhMTY3
15
- MmZiYjM3YThjZTc0ODQxOGExOGYxZGNiNGY2YjMwZmM5OGM4YzE=
13
+ Yjg2MzRiYmQ5M2UyY2FjMzdlZjg3Yzc5ZGNiMDNlYzhhZTJhMDU1MTY3Yjk5
14
+ NWM2MTFmMDRhZGJiY2UzNDM2MWQ5Mzc2ZGY3YmU0NDVhMWM4MmZlN2QxZDIx
15
+ MWNmYTUxZjEwN2UyM2FkNjlhMDIxYmIyNjMwODA2ZGZiMTgzMDc=
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  [![Build Status](https://travis-ci.org/JamesAwesome/random_yiff.svg?branch=master)](https://travis-ci.org/JamesAwesome/random_yiff)
2
2
  [![Coverage Status](https://coveralls.io/repos/JamesAwesome/random_yiff/badge.svg)](https://coveralls.io/r/JamesAwesome/random_yiff)
3
3
  [![Gem Version](https://badge.fury.io/rb/random_yiff.svg)](http://badge.fury.io/rb/random_yiff)
4
+ [![Code Climate](https://codeclimate.com/github/JamesAwesome/random_yiff/badges/gpa.svg)](https://codeclimate.com/github/JamesAwesome/random_yiff)
4
5
  # RandomYiff
5
6
 
6
7
  RandomYiff will provide you with a random post from e621.net via their /post/random route.
@@ -10,8 +11,7 @@ The RandomYiff gem is both a library and a CLI app named `yiff`.
10
11
  The `RandomYiff::E621` class allows a user to get a random post from e621. Helper methods such
11
12
  as `#file` allow the user to access the furry pr0n associated with said e621 post with ease.
12
13
 
13
- The `yiff` command allows users to open furry pr0n in browser, download furry pr0n and
14
- even print furry pr0n in terminal as colored ascii.
14
+ The `yiff` command allows users to open furry pr0n in browser or download furry pr0n to disk.
15
15
 
16
16
  ## Installation
17
17
 
@@ -1,6 +1,5 @@
1
1
  require 'thor'
2
2
  require 'launchy'
3
- require 'asciiart'
4
3
 
5
4
  module RandomYiff
6
5
  class Cli < Thor
@@ -12,20 +11,6 @@ module RandomYiff
12
11
  end
13
12
  end
14
13
 
15
- desc 'ascii', 'Print furry pr0n as ascii'
16
-
17
- method_option :width,
18
- desc: 'width to limit ascii to',
19
- type: :numeric,
20
- default: nil
21
-
22
- def ascii
23
- yiff = random_image
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)
27
- end
28
-
29
14
  desc 'download', 'Download furry pr0n'
30
15
 
31
16
  method_option :path,
@@ -41,21 +26,5 @@ module RandomYiff
41
26
  end
42
27
 
43
28
  default_task :open
44
-
45
- private
46
-
47
- class NotAnImage < StandardError; end
48
-
49
- def random_image
50
- RandomYiff::E621.new do |yiff|
51
- fail NotAnImage if non_image_formats.include?(yiff.file_ext)
52
- end
53
- rescue NotAnImage
54
- random_image
55
- end
56
-
57
- def non_image_formats
58
- ['flv']
59
- end
60
29
  end
61
30
  end
@@ -1,3 +1,3 @@
1
1
  module RandomYiff
2
- VERSION = '0.2.2'
2
+ VERSION = '0.3.0'
3
3
  end
data/random_yiff.gemspec CHANGED
@@ -19,7 +19,6 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.add_dependency 'thor'
21
21
  spec.add_dependency 'launchy'
22
- spec.add_dependency 'asciiart'
23
22
  spec.add_development_dependency 'bundler', '~> 1.7'
24
23
  spec.add_development_dependency 'rake', '~> 10.0'
25
24
  spec.add_development_dependency 'rspec', '~> 3.2'
@@ -36,41 +36,4 @@ describe RandomYiff::Cli do
36
36
  end
37
37
  end
38
38
  end
39
-
40
- describe '#ascii' do
41
- before do
42
- allow(AsciiArt).to receive(:new).and_return(furry_pr0n)
43
- end
44
-
45
- let(:furry_pr0n) { instance_double(AsciiArt) }
46
-
47
- it 'prints a random furry pr0n image as ascii' do
48
- expect(furry_pr0n).to receive(:to_ascii_art)
49
- .with(color: true)
50
- .and_return('yiff')
51
- expect { RandomYiff::Cli.start(['ascii']) }
52
- .to output("yiff\n").to_stdout
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
64
- end
65
-
66
- describe '#random_image' do
67
- subject(:cli) { RandomYiff::Cli.new }
68
-
69
- it 'reinitializes RandomYiff::E621 until it finds an image' do
70
- furry_pr0n = double(RandomYiff::E621)
71
- expect(RandomYiff::E621).to receive(:new).twice.and_yield(furry_pr0n)
72
- expect(furry_pr0n).to receive(:file_ext).twice.and_return('flv', 'jpg')
73
- cli.send(:random_image)
74
- end
75
- end
76
39
  end
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.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Awesome
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: asciiart
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ! '>='
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: bundler
57
43
  requirement: !ruby/object:Gem::Requirement