cureutils 0.1.5 → 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/.gitignore +1 -0
- data/bin/cure +11 -2
- data/cureutils.plugin.zsh +1 -0
- data/lib/cureutils/cli.rb +32 -6
- data/lib/cureutils/version.rb +2 -2
- data/{etc/cure-completion.zsh → zsh-completion/_cure} +61 -42
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60bf2354dca5de196e274d9e7594e7bf3590d214
|
4
|
+
data.tar.gz: a4ccd611f4639a2dbc4c4f990b152727c1e60a5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5791479dd71f91966a7c25cf725c5ee82829d5fbbb551812df1b8e37495944e7caaaa86c62b36bd3e71c44acc24e865d63da9225b56cd9ce6c8ef69c5e2fe0f2
|
7
|
+
data.tar.gz: 2f160e03740359179cbdc274ad9316b31f687a8ce251bb2588d294ae4c1d350ea908fb4746ffd13932c63eb3fc8ec39f1aa59f4eeb2fb1f8f0a030a928481180
|
data/.gitignore
CHANGED
data/bin/cure
CHANGED
@@ -1,4 +1,13 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require "cureutils"
|
3
2
|
|
4
|
-
|
3
|
+
# Trap intrrupts to quit cleanly.
|
4
|
+
# Refer to https://twitter.com/mitchellh/status/283014103189053442
|
5
|
+
Signal.trap('INT') { abort }
|
6
|
+
|
7
|
+
require 'cureutils'
|
8
|
+
|
9
|
+
begin
|
10
|
+
Cureutils::CLI.start
|
11
|
+
rescue Interrupt
|
12
|
+
abort('Interrupted...')
|
13
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
fpath+="`dirname $0`/zsh-completion"
|
data/lib/cureutils/cli.rb
CHANGED
@@ -24,7 +24,12 @@ module Cureutils
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
desc '
|
27
|
+
desc 'version', 'Output the version number.'
|
28
|
+
def version
|
29
|
+
puts "#{Cureutils.name} #{Cureutils::Version}"
|
30
|
+
end
|
31
|
+
|
32
|
+
desc 'transform', 'Change human_name to precure_name.'
|
28
33
|
def transform
|
29
34
|
manager = CureTranslateManager.new
|
30
35
|
manager.translate_from_to('[:human_name:]', '[:precure_name:]')
|
@@ -40,16 +45,37 @@ module Cureutils
|
|
40
45
|
exit(manager.print_results)
|
41
46
|
end
|
42
47
|
|
43
|
-
desc 'girls', "Print girls' name"
|
48
|
+
desc 'girls [OPTIONS]', "Print girls' name."
|
49
|
+
option 'verbose', aliases: 'v',
|
50
|
+
type: :boolean,
|
51
|
+
desc: "Include particular girl's full name."
|
52
|
+
option 'movie', aliases: 'm',
|
53
|
+
type: :boolean,
|
54
|
+
desc: 'Include who have only appeared in the movies.'
|
44
55
|
def girls
|
45
|
-
|
46
|
-
|
56
|
+
girls = Precure.all_stars
|
57
|
+
girls = girls << Cure.echo if options[:movie]
|
58
|
+
girls.map!(&:human_name)
|
59
|
+
if options[:verbose]
|
60
|
+
girls.each do |v|
|
61
|
+
puts v
|
62
|
+
end
|
63
|
+
else
|
64
|
+
girls.each do |v|
|
65
|
+
puts v.gsub(/\([^\)]+\)$/, '')
|
66
|
+
end
|
47
67
|
end
|
48
68
|
end
|
49
69
|
|
50
|
-
desc 'precures', 'Print Precure names'
|
70
|
+
desc 'precures [OPTIONS]', 'Print Precure names.'
|
71
|
+
option 'movie', aliases: 'm',
|
72
|
+
type: :boolean,
|
73
|
+
desc: 'Include who have only appeared in the movies.'
|
51
74
|
def precures
|
52
|
-
|
75
|
+
cures = Precure.all_stars
|
76
|
+
cures = cures << Cure.echo if options[:movie]
|
77
|
+
cures.map!(&:precure_name)
|
78
|
+
cures.each do |v|
|
53
79
|
puts v
|
54
80
|
end
|
55
81
|
end
|
data/lib/cureutils/version.rb
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
|
5
5
|
# cure CMD
|
6
6
|
subcommands=(
|
7
|
+
"version: Output the version number."
|
7
8
|
"help: Output the usage and exit."
|
8
9
|
"date: Display date, time and Precure related events."
|
9
10
|
"echo: Print messages of Precure."
|
@@ -18,48 +19,49 @@ subcommands=(
|
|
18
19
|
|
19
20
|
# cure precures | cure tr [:precure_name:] [:girl_name:] | grep '[[:alnum:]]' | sort | uniq | sed 's/^cure_//'
|
20
21
|
precure_girl_names=(
|
21
|
-
'
|
22
|
-
'
|
23
|
-
'
|
24
|
-
'
|
25
|
-
'
|
26
|
-
'
|
27
|
-
'
|
28
|
-
'
|
29
|
-
'
|
30
|
-
'
|
31
|
-
'
|
32
|
-
'
|
33
|
-
'
|
34
|
-
'
|
35
|
-
'
|
36
|
-
'
|
37
|
-
'
|
38
|
-
'
|
39
|
-
'
|
40
|
-
'
|
41
|
-
'
|
42
|
-
'
|
43
|
-
'
|
44
|
-
'
|
45
|
-
'
|
46
|
-
'
|
47
|
-
'
|
48
|
-
'
|
49
|
-
'
|
50
|
-
'
|
51
|
-
'
|
52
|
-
'
|
53
|
-
'
|
54
|
-
'
|
55
|
-
'
|
56
|
-
'
|
57
|
-
'
|
58
|
-
'
|
59
|
-
'
|
60
|
-
'
|
61
|
-
'
|
62
|
-
'
|
22
|
+
'cure_ace'
|
23
|
+
'cure_aqua'
|
24
|
+
'cure_beat'
|
25
|
+
'cure_beauty'
|
26
|
+
'cure_berry'
|
27
|
+
'cure_black'
|
28
|
+
'cure_bloom'
|
29
|
+
'cure_blossom'
|
30
|
+
'cure_diamond'
|
31
|
+
'cure_dream'
|
32
|
+
'cure_echo'
|
33
|
+
'cure_egret'
|
34
|
+
'cure_felice'
|
35
|
+
'cure_flora'
|
36
|
+
'cure_fortune'
|
37
|
+
'cure_happy'
|
38
|
+
'cure_heart'
|
39
|
+
'cure_honey'
|
40
|
+
'cure_lemonade'
|
41
|
+
'cure_lovely'
|
42
|
+
'cure_magical'
|
43
|
+
'cure_march'
|
44
|
+
'cure_marine'
|
45
|
+
'cure_melody'
|
46
|
+
'cure_mermaid'
|
47
|
+
'cure_mint'
|
48
|
+
'cure_miracle'
|
49
|
+
'cure_moonlight'
|
50
|
+
'cure_muse'
|
51
|
+
'cure_passion'
|
52
|
+
'cure_peace'
|
53
|
+
'cure_peach'
|
54
|
+
'cure_pine'
|
55
|
+
'cure_princess'
|
56
|
+
'cure_rhythm'
|
57
|
+
'cure_rosetta'
|
58
|
+
'cure_rouge'
|
59
|
+
'cure_scarlet'
|
60
|
+
'cure_sunny'
|
61
|
+
'cure_sunshine'
|
62
|
+
'cure_sword'
|
63
|
+
'cure_twinkle'
|
64
|
+
'cure_white'
|
63
65
|
'milky_rose'
|
64
66
|
'shiny_luminous'
|
65
67
|
)
|
@@ -114,6 +116,23 @@ function _cure-date () {
|
|
114
116
|
fi
|
115
117
|
}
|
116
118
|
|
119
|
+
function _cure-precures () {
|
120
|
+
local -a args
|
121
|
+
if (( CURRENT>=3 )) ; then
|
122
|
+
echo $words | grep -w -- '-m' 1> /dev/null || args=($args '-m:Include who have only appeared in the movies.')
|
123
|
+
_describe -t args 'args' args
|
124
|
+
fi
|
125
|
+
}
|
126
|
+
|
127
|
+
function _cure-girls () {
|
128
|
+
local -a args
|
129
|
+
if (( CURRENT>=3 )) ; then
|
130
|
+
echo $words | grep -w -- '-v' 1> /dev/null || args=($args "-v:Include particular girl's full name.")
|
131
|
+
echo $words | grep -w -- '-m' 1> /dev/null || args=($args '-m:Include who have only appeared in the movies.')
|
132
|
+
_describe -t args 'args' args
|
133
|
+
fi
|
134
|
+
}
|
135
|
+
|
117
136
|
function _cure()
|
118
137
|
{
|
119
138
|
if (( CURRENT==2 )) ; then
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cureutils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yamada, Yasuhiro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -133,7 +133,7 @@ files:
|
|
133
133
|
- Rakefile
|
134
134
|
- bin/cure
|
135
135
|
- cureutils.gemspec
|
136
|
-
-
|
136
|
+
- cureutils.plugin.zsh
|
137
137
|
- img/cureutils_logo.png
|
138
138
|
- lib/cureutils.rb
|
139
139
|
- lib/cureutils/cli.rb
|
@@ -144,6 +144,7 @@ files:
|
|
144
144
|
- lib/cureutils/cure_janken_manager.rb
|
145
145
|
- lib/cureutils/cure_translate_manager.rb
|
146
146
|
- lib/cureutils/version.rb
|
147
|
+
- zsh-completion/_cure
|
147
148
|
homepage: https://github.com/greymd/cureutils
|
148
149
|
licenses:
|
149
150
|
- MIT
|