coaster 1.3.34 → 1.3.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/coaster/cmd_options.rb +2 -30
- data/lib/coaster/git.rb +2 -0
- data/lib/coaster/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d90387f0828b0ece5fec61d33b6dd1458da6944816a877f8f222d0c732b3737e
|
4
|
+
data.tar.gz: 64d540a0623b059d65789d58118c668640dd9679595eb2b3582aa5708c639480
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6aa3bc61db4b538553799902876097e555fcc508ee7c7c8b86d19fca60f8d19e6c7dadf74812fa79bac75b7863ce0e3052b47d70e3e682555e8394f790465f3c
|
7
|
+
data.tar.gz: 0a9a86bf0baef2c0c07eb2bf3bc7c6a284eb201139c61b2536d04e00db7c0339f6a7062fdd604a39fa74c660c9cdda4eb323c2747c13825fee562cfcddca416e
|
data/lib/coaster/cmd_options.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
|
1
3
|
module Coaster
|
2
4
|
class CmdOptions
|
3
5
|
class << self
|
@@ -9,36 +11,6 @@ module Coaster
|
|
9
11
|
end
|
10
12
|
end
|
11
13
|
|
12
|
-
def options_s_to_h(options)
|
13
|
-
opts = {}
|
14
|
-
options = " #{options}"
|
15
|
-
options_indexes = options.enum_for(:scan, / -\w| --\w+| -- /).map { Regexp.last_match.begin(0) }
|
16
|
-
options_indexes << 0
|
17
|
-
options_indexes.each_cons(2) do |a, b|
|
18
|
-
option = options[a+1..b-1]
|
19
|
-
h = option_s_to_h(option)
|
20
|
-
options_h_merger(h, base: opts)
|
21
|
-
end
|
22
|
-
opts
|
23
|
-
end
|
24
|
-
|
25
|
-
def option_s_to_h(option)
|
26
|
-
if option.start_with?(/--\w/)
|
27
|
-
opt = option.split('=', 2)
|
28
|
-
opt << '' if opt.length == 1
|
29
|
-
elsif option.start_with?(/-\w/)
|
30
|
-
opt = option.split(' ', 2)
|
31
|
-
opt << '' if opt.length == 1
|
32
|
-
elsif option.start_with?('-- ')
|
33
|
-
opt = ['--', option[3..-1].split(' ')]
|
34
|
-
else
|
35
|
-
return {}
|
36
|
-
end
|
37
|
-
opt[1] = opt[1].split(',') if opt[1].include?(',')
|
38
|
-
opt[1] = opt[1].map{|s| s.include?('=') ? Hash[s.split('=', 2)] : s}.to_h if opt[1].is_a?(Array)
|
39
|
-
[opt].to_h
|
40
|
-
end
|
41
|
-
|
42
14
|
def option_v_to_s(option_v)
|
43
15
|
case option_v
|
44
16
|
when Hash then option_v.map{|vk,vv| Set[vk, vv]}.to_set
|
data/lib/coaster/git.rb
CHANGED
data/lib/coaster/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coaster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- buzz jung
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|