cureutils 0.1.5 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 638a3b1f4eb73a02514eece933d1e92e6df5a407
4
- data.tar.gz: 5c183b238f20bda184636daf26159568c80f6428
3
+ metadata.gz: 60bf2354dca5de196e274d9e7594e7bf3590d214
4
+ data.tar.gz: a4ccd611f4639a2dbc4c4f990b152727c1e60a5b
5
5
  SHA512:
6
- metadata.gz: 4add95659a50a809e439fdd9b3aea5067a2e95ccfaaa32553dbd1e94db07bbac135a1e4593963dd611958dc6841a2352c77b7cd56d4a0f5e0c0ef7e9f811e711
7
- data.tar.gz: 026b49dbdd0f189a5a2c5660704d7cec7152bcfdaf5debf735c21ef93324a558e3f29d24ea53260d01914600b6a5508b7d25cf76e8e7c471766f7d4977b39176
6
+ metadata.gz: 5791479dd71f91966a7c25cf725c5ee82829d5fbbb551812df1b8e37495944e7caaaa86c62b36bd3e71c44acc24e865d63da9225b56cd9ce6c8ef69c5e2fe0f2
7
+ data.tar.gz: 2f160e03740359179cbdc274ad9316b31f687a8ce251bb2588d294ae4c1d350ea908fb4746ffd13932c63eb3fc8ec39f1aa59f4eeb2fb1f8f0a030a928481180
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ /tags
data/bin/cure CHANGED
@@ -1,4 +1,13 @@
1
1
  #!/usr/bin/env ruby
2
- require "cureutils"
3
2
 
4
- Cureutils::CLI.start
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"
@@ -24,7 +24,12 @@ module Cureutils
24
24
  end
25
25
  end
26
26
 
27
- desc 'transform', 'Change human_name to precure_name'
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
- Rubicure::Girl.config.map { |_k, v| v[:human_name] }.uniq.each do |v|
46
- puts v
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
- Rubicure::Girl.config.map { |_k, v| v[:precure_name] }.uniq.each do |v|
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
@@ -1,8 +1,8 @@
1
1
  module Cureutils
2
2
  class Version
3
3
  MAJOR = 0
4
- MINOR = 1
5
- PATCH = 5
4
+ MINOR = 2
5
+ PATCH = 0
6
6
  PRE = nil
7
7
 
8
8
  class << self
@@ -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
- 'ace'
22
- 'aqua'
23
- 'beat'
24
- 'beauty'
25
- 'berry'
26
- 'black'
27
- 'bloom'
28
- 'blossom'
29
- 'diamond'
30
- 'dream'
31
- 'echo'
32
- 'egret'
33
- 'flora'
34
- 'fortune'
35
- 'happy'
36
- 'heart'
37
- 'honey'
38
- 'lemonade'
39
- 'lovely'
40
- 'magical'
41
- 'march'
42
- 'marine'
43
- 'melody'
44
- 'mermaid'
45
- 'mint'
46
- 'miracle'
47
- 'moonlight'
48
- 'muse'
49
- 'passion'
50
- 'peace'
51
- 'peach'
52
- 'pine'
53
- 'princess'
54
- 'rhythm'
55
- 'rosetta'
56
- 'rouge'
57
- 'scarlet'
58
- 'sunny'
59
- 'sunshine'
60
- 'sword'
61
- 'twinkle'
62
- 'white'
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.1.5
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-07-04 00:00:00.000000000 Z
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
- - etc/cure-completion.zsh
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