irasutoya-cli 0.1.0 → 0.2.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 +4 -4
- data/.rubocop.yml +4 -0
- data/Gemfile.lock +54 -54
- data/README.md +18 -20
- data/images/example.png +0 -0
- data/irasutoya-cli.gemspec +2 -1
- data/lib/irasutoya/cli.rb +18 -3
- data/lib/irasutoya/cli/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e10c8ff8bddcd7eb83923ae042332a2554abfc4144262db317a3b1085e32889f
|
|
4
|
+
data.tar.gz: 4a58bef84e4f75b8c8e717621c4e93f8ef91be2933be77f69c4d1e0a5a0ed4c7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 417b78d50561284015dcf15ea967988dfcafc820439c8de424c142c2205721bdbd703b68db974257d2db97e01b349cf0929965b0f4b1012a7f27e6b835004a2e
|
|
7
|
+
data.tar.gz: add9d0140bc5d0c2eae5e42a1f402573b7aad2416b41f58f20b61c49ef89f93400d5ed70ec07a51a6aa00bb4a76bb3e24b729713ad4b476d062064824359995e
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
irasutoya-cli (0.
|
|
4
|
+
irasutoya-cli (0.2.0)
|
|
5
5
|
irasutoya
|
|
6
6
|
terminal_image
|
|
7
7
|
thor
|
|
@@ -9,18 +9,17 @@ PATH
|
|
|
9
9
|
GEM
|
|
10
10
|
remote: https://rubygems.org/
|
|
11
11
|
specs:
|
|
12
|
-
ast (2.4.
|
|
13
|
-
codecov (0.
|
|
12
|
+
ast (2.4.1)
|
|
13
|
+
codecov (0.2.12)
|
|
14
14
|
json
|
|
15
15
|
simplecov
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
diff-lcs (1.3)
|
|
16
|
+
coderay (1.1.3)
|
|
17
|
+
diff-lcs (1.4.4)
|
|
19
18
|
docile (1.3.2)
|
|
20
|
-
fastimage (2.
|
|
21
|
-
ffi (1.
|
|
19
|
+
fastimage (2.2.0)
|
|
20
|
+
ffi (1.13.1)
|
|
22
21
|
formatador (0.2.5)
|
|
23
|
-
guard (2.
|
|
22
|
+
guard (2.16.2)
|
|
24
23
|
formatador (>= 0.2.4)
|
|
25
24
|
listen (>= 2.7, < 4.0)
|
|
26
25
|
lumberjack (>= 1.0.12, < 2.0)
|
|
@@ -34,70 +33,71 @@ GEM
|
|
|
34
33
|
guard (~> 2.1)
|
|
35
34
|
guard-compat (~> 1.1)
|
|
36
35
|
rspec (>= 2.99.0, < 4.0)
|
|
37
|
-
guard-rubocop (1.
|
|
36
|
+
guard-rubocop (1.4.0)
|
|
38
37
|
guard (~> 2.0)
|
|
39
|
-
rubocop (
|
|
40
|
-
irasutoya (1.
|
|
38
|
+
rubocop (< 2.0)
|
|
39
|
+
irasutoya (1.1.0)
|
|
41
40
|
nokogiri
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
rb-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
lumberjack (1.0.13)
|
|
49
|
-
method_source (0.9.2)
|
|
41
|
+
json (2.3.1)
|
|
42
|
+
listen (3.2.1)
|
|
43
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
44
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
|
45
|
+
lumberjack (1.2.8)
|
|
46
|
+
method_source (1.0.0)
|
|
50
47
|
mini_portile2 (2.4.0)
|
|
51
48
|
nenv (0.3.0)
|
|
52
|
-
nokogiri (1.10.
|
|
49
|
+
nokogiri (1.10.10)
|
|
53
50
|
mini_portile2 (~> 2.4.0)
|
|
54
51
|
notiffany (0.1.3)
|
|
55
52
|
nenv (~> 0.1)
|
|
56
53
|
shellany (~> 0.0)
|
|
57
|
-
parallel (1.
|
|
58
|
-
parser (2.
|
|
59
|
-
ast (~> 2.4.
|
|
60
|
-
pry (0.
|
|
61
|
-
coderay (~> 1.1
|
|
62
|
-
method_source (~>
|
|
54
|
+
parallel (1.19.2)
|
|
55
|
+
parser (2.7.2.0)
|
|
56
|
+
ast (~> 2.4.1)
|
|
57
|
+
pry (0.13.1)
|
|
58
|
+
coderay (~> 1.1)
|
|
59
|
+
method_source (~> 1.0)
|
|
63
60
|
rainbow (3.0.0)
|
|
64
|
-
rake (
|
|
65
|
-
rb-fsevent (0.10.
|
|
66
|
-
rb-inotify (0.10.
|
|
61
|
+
rake (13.0.1)
|
|
62
|
+
rb-fsevent (0.10.4)
|
|
63
|
+
rb-inotify (0.10.1)
|
|
67
64
|
ffi (~> 1.0)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
rspec-
|
|
72
|
-
|
|
73
|
-
rspec-
|
|
74
|
-
rspec-
|
|
65
|
+
regexp_parser (1.8.2)
|
|
66
|
+
rexml (3.2.4)
|
|
67
|
+
rspec (3.10.0)
|
|
68
|
+
rspec-core (~> 3.10.0)
|
|
69
|
+
rspec-expectations (~> 3.10.0)
|
|
70
|
+
rspec-mocks (~> 3.10.0)
|
|
71
|
+
rspec-core (3.10.0)
|
|
72
|
+
rspec-support (~> 3.10.0)
|
|
73
|
+
rspec-expectations (3.10.0)
|
|
75
74
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
76
|
-
rspec-support (~> 3.
|
|
77
|
-
rspec-mocks (3.
|
|
75
|
+
rspec-support (~> 3.10.0)
|
|
76
|
+
rspec-mocks (3.10.0)
|
|
78
77
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
79
|
-
rspec-support (~> 3.
|
|
80
|
-
rspec-support (3.
|
|
81
|
-
rubocop (
|
|
82
|
-
jaro_winkler (~> 1.5.1)
|
|
78
|
+
rspec-support (~> 3.10.0)
|
|
79
|
+
rspec-support (3.10.0)
|
|
80
|
+
rubocop (1.2.0)
|
|
83
81
|
parallel (~> 1.10)
|
|
84
|
-
parser (>= 2.
|
|
82
|
+
parser (>= 2.7.1.5)
|
|
85
83
|
rainbow (>= 2.2.2, < 4.0)
|
|
84
|
+
regexp_parser (>= 1.8)
|
|
85
|
+
rexml
|
|
86
|
+
rubocop-ast (>= 1.0.1)
|
|
86
87
|
ruby-progressbar (~> 1.7)
|
|
87
|
-
unicode-display_width (>= 1.4.0, <
|
|
88
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
|
89
|
+
rubocop-ast (1.1.1)
|
|
90
|
+
parser (>= 2.7.1.5)
|
|
88
91
|
ruby-progressbar (1.10.1)
|
|
89
|
-
ruby_dep (1.5.0)
|
|
90
92
|
shellany (0.0.1)
|
|
91
|
-
simplecov (0.
|
|
93
|
+
simplecov (0.19.1)
|
|
92
94
|
docile (~> 1.1)
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
simplecov-html (0.10.2)
|
|
95
|
+
simplecov-html (~> 0.11)
|
|
96
|
+
simplecov-html (0.12.3)
|
|
96
97
|
terminal_image (0.3.0)
|
|
97
98
|
fastimage
|
|
98
|
-
thor (0.
|
|
99
|
-
unicode-display_width (1.
|
|
100
|
-
url (0.3.2)
|
|
99
|
+
thor (1.0.1)
|
|
100
|
+
unicode-display_width (1.7.0)
|
|
101
101
|
|
|
102
102
|
PLATFORMS
|
|
103
103
|
ruby
|
|
@@ -109,7 +109,7 @@ DEPENDENCIES
|
|
|
109
109
|
guard-rspec
|
|
110
110
|
guard-rubocop
|
|
111
111
|
irasutoya-cli!
|
|
112
|
-
rake (~>
|
|
112
|
+
rake (~> 13.0)
|
|
113
113
|
rspec (~> 3.0)
|
|
114
114
|
rubocop
|
|
115
115
|
simplecov
|
data/README.md
CHANGED
|
@@ -1,34 +1,32 @@
|
|
|
1
1
|
# Irasutoya::Cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://badge.fury.io/rb/irasutoya-cli)
|
|
4
|
+
[](https://circleci.com/gh/unhappychoice/irasutoya-cli)
|
|
5
|
+
[](https://codeclimate.com/github/unhappychoice/irasutoya-cli)
|
|
6
|
+
[](https://codecov.io/gh/unhappychoice/irasutoya-cli)
|
|
7
|
+
[](https://libraries.io/github/unhappychoice/irasutoya-cli)
|
|
8
|
+

|
|
9
|
+

|
|
4
10
|
|
|
5
|
-
|
|
11
|
+

|
|
6
12
|
|
|
7
13
|
## Installation
|
|
8
14
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```ruby
|
|
12
|
-
gem 'irasutoya-cli'
|
|
15
|
+
```sh
|
|
16
|
+
$ gem install irasutoya-cli
|
|
13
17
|
```
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
$ bundle
|
|
18
|
-
|
|
19
|
-
Or install it yourself as:
|
|
20
|
-
|
|
21
|
-
$ gem install irasutoya-cli
|
|
19
|
+
To see preview of image, you need to use [iTerm2](https://iterm2.com/index.html) or terminals with [libsixel](https://github.com/saitoha/libsixel) installed.
|
|
22
20
|
|
|
23
21
|
## Usage
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
```sh
|
|
24
|
+
$ irasutoya
|
|
25
|
+
Commands:
|
|
26
|
+
irasutoya help [COMMAND] # Describe available commands or one specific command
|
|
27
|
+
irasutoya random # Gives you random irasutoya image
|
|
28
|
+
irasutoya search {query} # Gives you irasutoya 3 images by given query
|
|
29
|
+
```
|
|
32
30
|
|
|
33
31
|
## Contributing
|
|
34
32
|
|
data/images/example.png
ADDED
|
Binary file
|
data/irasutoya-cli.gemspec
CHANGED
|
@@ -7,6 +7,7 @@ require 'irasutoya/cli/version'
|
|
|
7
7
|
Gem::Specification.new do |spec|
|
|
8
8
|
spec.name = 'irasutoya-cli'
|
|
9
9
|
spec.version = Irasutoya::Cli::VERSION
|
|
10
|
+
spec.required_ruby_version = '>= 2.5'
|
|
10
11
|
spec.authors = ['Yuji Ueki']
|
|
11
12
|
spec.email = ['unhappychoice@gmail.com']
|
|
12
13
|
|
|
@@ -37,7 +38,7 @@ Gem::Specification.new do |spec|
|
|
|
37
38
|
spec.add_development_dependency 'guard'
|
|
38
39
|
spec.add_development_dependency 'guard-rspec'
|
|
39
40
|
spec.add_development_dependency 'guard-rubocop'
|
|
40
|
-
spec.add_development_dependency 'rake', '~>
|
|
41
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
|
41
42
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
42
43
|
spec.add_development_dependency 'rubocop'
|
|
43
44
|
spec.add_development_dependency 'simplecov'
|
data/lib/irasutoya/cli.rb
CHANGED
|
@@ -11,12 +11,27 @@ module Irasutoya
|
|
|
11
11
|
class Runner < Thor
|
|
12
12
|
desc 'random', 'Gives you random irasutoya image'
|
|
13
13
|
def random
|
|
14
|
-
|
|
14
|
+
display(Irasutoya::Irasuto.random)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
desc 'search {query}', 'Gives you 3 irasutoya images by given query'
|
|
18
|
+
def search(query)
|
|
19
|
+
Irasutoya::Irasuto
|
|
20
|
+
.search(query: query)
|
|
21
|
+
.take(3)
|
|
22
|
+
.flat_map(&:fetch_irasuto)
|
|
23
|
+
.compact
|
|
24
|
+
.each(&method(:display))
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
private
|
|
28
|
+
|
|
29
|
+
def display(irasuto)
|
|
15
30
|
say "Page URL: #{irasuto.url}"
|
|
16
31
|
say "Title: #{irasuto.title}"
|
|
17
32
|
say "Description: #{irasuto.description}"
|
|
18
|
-
say "Image URL: #{
|
|
19
|
-
TerminalImage.show_url
|
|
33
|
+
irasuto.image_urls.each { |image_url| say "Image URL: #{image_url}" }
|
|
34
|
+
irasuto.image_urls.each(&TerminalImage.method(:show_url))
|
|
20
35
|
rescue TerminalImage::UnsupportedTerminal
|
|
21
36
|
say 'warn: This terminal is not able to show images inline', :yellow
|
|
22
37
|
say 'warn: Please use iTerm2 or terminal installed libsixel.', :yellow
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: irasutoya-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yuji Ueki
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2020-11-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: irasutoya
|
|
@@ -128,14 +128,14 @@ dependencies:
|
|
|
128
128
|
requirements:
|
|
129
129
|
- - "~>"
|
|
130
130
|
- !ruby/object:Gem::Version
|
|
131
|
-
version: '
|
|
131
|
+
version: '13.0'
|
|
132
132
|
type: :development
|
|
133
133
|
prerelease: false
|
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
135
|
requirements:
|
|
136
136
|
- - "~>"
|
|
137
137
|
- !ruby/object:Gem::Version
|
|
138
|
-
version: '
|
|
138
|
+
version: '13.0'
|
|
139
139
|
- !ruby/object:Gem::Dependency
|
|
140
140
|
name: rspec
|
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -197,6 +197,7 @@ files:
|
|
|
197
197
|
- README.md
|
|
198
198
|
- Rakefile
|
|
199
199
|
- exe/irasutoya
|
|
200
|
+
- images/example.png
|
|
200
201
|
- irasutoya-cli.gemspec
|
|
201
202
|
- lib/irasutoya/cli.rb
|
|
202
203
|
- lib/irasutoya/cli/version.rb
|
|
@@ -215,7 +216,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
215
216
|
requirements:
|
|
216
217
|
- - ">="
|
|
217
218
|
- !ruby/object:Gem::Version
|
|
218
|
-
version: '
|
|
219
|
+
version: '2.5'
|
|
219
220
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
221
|
requirements:
|
|
221
222
|
- - ">="
|