ro_thor 4.6.0 → 4.6.4

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
  SHA256:
3
- metadata.gz: 40a5e6127722a684605524581c7e89944b58e56f1dd70b6a17ddea65bc2ef18e
4
- data.tar.gz: b59e1dafcef1f636262269db13c6a4075c3d3aff5433f59d7754dd6dcb9a8f42
3
+ metadata.gz: c9849c3848afee6af24a77627d2c230240d56392b16318fd2c57944a8259955c
4
+ data.tar.gz: c9bb5a620807f7bed997feb964d667c999f66c4de0d8ef4d923c87c4c3c044c5
5
5
  SHA512:
6
- metadata.gz: c0e7640798240171dc4b27eb498606691985848b82b5fdc18bf1a34f886a2382503ed6eec44c4fe36c351517e7f919790ad4584a9245a9a72bd91125d52a21f8
7
- data.tar.gz: 1284f79d0f46079b6ed0b1833b59449f022c4e8a0a39a7cd3c558db7100f23b4de93e7ab6ffbbfac9213efe02095ba3d9e94c2526480e20ed0b889962b896720
6
+ metadata.gz: 02d7f6ff434be07eb629fa70a09bebef9417ad2195fbf0fae14ce9454b193ff48b24ee023b8aed42dccf6cb6ee3bc39439ae252bbec4a2df9f8875119b46e65e
7
+ data.tar.gz: cf137cd3a67e40e8c760417e7fd87171eb98ddb135c1fc4cdfa85e2ff60e5a0e355ea2045cb98a6083b07b3a38b59a5a1fc092a4317d4ad6cfb772ae7c718e23
@@ -7,6 +7,7 @@ require 'ro_thor/base'
7
7
  require 'ro_thor/sh'
8
8
  require 'ro_thor/ro_file'
9
9
  require 'ro_thor/array'
10
+ require 'ro_thor/string'
10
11
  require 'ro_thor/helper'
11
12
  require 'ro_thor/ro_err'
12
13
  require 'ro_thor/http'
@@ -39,6 +40,10 @@ class RoThor < Thor
39
40
  desc(str, "")
40
41
  end
41
42
 
43
+ def st(*args)
44
+ start(args)
45
+ end
46
+
42
47
  def create_command(*args, &blk)
43
48
  if @usage.nil?
44
49
  return
@@ -46,10 +51,6 @@ class RoThor < Thor
46
51
  super
47
52
  end
48
53
 
49
- def st(*args, &blk)
50
- start(args)
51
- end
52
-
53
54
  def lamb(*args, &blk)
54
55
  lambda(*args, &blk)
55
56
  end
@@ -140,13 +141,13 @@ class RoThor < Thor
140
141
 
141
142
  def toggle_win(win_name)
142
143
  wins = begin
143
- shsu("xdotool search --onlyvisible #{win_name}").split("\n")
144
- rescue RoThor::Sh::Err => e
145
- out(e)
146
- out(e.backtrace.join("\n"))
147
- sleep(0.5)
148
- retry
149
- end
144
+ shsu("xdotool search --onlyvisible #{win_name}").split("\n")
145
+ rescue RoThor::Sh::Err => e
146
+ out(e)
147
+ out(e.backtrace.join("\n"))
148
+ sleep(0.5)
149
+ retry
150
+ end
150
151
  if wins.size > 0
151
152
  sh "xdotool windowactivate #{wins.first.strip}"
152
153
  end
@@ -1,6 +1,7 @@
1
1
  require_relative 'base'
2
2
  class Array
3
3
  unless method_defined? :ro_opts
4
+ # @return [] return args_without_options, options
4
5
  def ro_opts(*args, &blk)
5
6
  a = []
6
7
  opts = {}
@@ -1,4 +1,5 @@
1
1
  require_relative 'base'
2
+ require_relative 'string'
2
3
 
3
4
  class RoThor
4
5
  module Helper
@@ -11,8 +12,8 @@ class RoThor
11
12
  shsu("xclip -sel clip -o")
12
13
  end
13
14
 
14
- def to_md5(s, *args, &blk)
15
- Digest::MD5.hexdigest(s)
15
+ def to_md5(str)
16
+ str.md5
16
17
  end
17
18
 
18
19
  def in_pj(pj_name, *args, &blk)
@@ -42,7 +42,9 @@ class RoThor
42
42
 
43
43
  def msp(f, *args, &blk)
44
44
  p = parent(f)
45
- FileUtils.mkpath(p)
45
+ if !test(?d, p)
46
+ FileUtils.mkpath(p)
47
+ end
46
48
  end
47
49
 
48
50
  def msd(p, *args, &blk)
@@ -0,0 +1,7 @@
1
+ class String
2
+ if !method_defined? :md5
3
+ def md5
4
+ Digest::MD5.hexdigest(self)
5
+ end
6
+ end
7
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ro_thor
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.0
4
+ version: 4.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-11 00:00:00.000000000 Z
11
+ date: 2020-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -110,6 +110,7 @@ files:
110
110
  - lib/ro_thor/ro_file.rb
111
111
  - lib/ro_thor/sh.rb
112
112
  - lib/ro_thor/ssh.rb
113
+ - lib/ro_thor/string.rb
113
114
  - spec/lib/core_ext/array_spec.rb
114
115
  - spec/lib/ro_cmd/thor/dp_spec.rb
115
116
  - spec/lib/ro_thor/ro_err_spec.rb
@@ -140,10 +141,10 @@ signing_key:
140
141
  specification_version: 4
141
142
  summary: ''
142
143
  test_files:
143
- - spec/spec_helper.rb
144
144
  - spec/lib/ro_cmd/thor/dp_spec.rb
145
- - spec/lib/core_ext/array_spec.rb
146
145
  - spec/lib/ro_thor/ssh_spec.rb
147
146
  - spec/lib/ro_thor/ro_err_spec.rb
147
+ - spec/lib/core_ext/array_spec.rb
148
148
  - spec/rails_helper.rb
149
+ - spec/spec_helper.rb
149
150
  - spec/mysql/my.cnf