doit 0.3.6 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -68
- data/.ruby-gemset +1 -1
- data/.ruby-version +1 -1
- data/.travis.yml +5 -1
- data/.watchr +14 -9
- data/Gemfile +6 -0
- data/Gemfile.lock +34 -13
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/bin/doit +9 -9
- data/doit.gemspec +3 -4
- data/lib/doit.rb +1 -1
- data/lib/globals.rb +8 -5
- data/lib/import.rb +1 -1
- data/lib/my.rb +2 -3
- data/lib/run.rb +1 -1
- data/lib/what.rb +3 -3
- metadata +15 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b8c68afcf5f77a8417f547416d04bdc90c38f0cda47ec2614cb83367c472d31
|
4
|
+
data.tar.gz: ffad2c5f2b2e7ba683bf881d0214832ac61ac0c4a32c0136a0fde6ee24bb9de0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46c1dbc104ca4cfbf6b4045fd32ca1fb7709d74a4c4d5fe5c7bbeaa51d4ee3e13239a3b9bf69ac265e3bab24ec20b07140b340fe5f0495713213d875ef348d37
|
7
|
+
data.tar.gz: 67253a363b7fe882dd385c2cbd1738b5335c79c9332a882cc44be8ff870c223aa22acd4820c15973e5522c0a467da20cc6597223c17bd88402adc2f5c8f23a5f
|
data/.rubocop.yml
CHANGED
@@ -1,74 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
# inherit_from: .rubocop_todo.yml
|
4
|
-
|
5
|
-
# rubocop --auto-gen-config
|
6
|
-
# rubocop
|
7
|
-
# rubocop:disable all
|
8
|
-
|
9
|
-
#inherit_from: .rubocop_todo.yml
|
1
|
+
inherit_from:
|
2
|
+
- ~/configs/.rubocop.yml
|
10
3
|
|
11
4
|
AllCops:
|
12
5
|
Include:
|
13
|
-
# - 'app/**/*.rb'
|
14
|
-
# - 'bin/**/*.rb'
|
15
|
-
# - 'config/**/*.rb'
|
16
|
-
# - 'db/**/*.rb'
|
17
6
|
- 'lib/**/*.rb'
|
18
|
-
# - 'test/**/*.rb'
|
19
|
-
- '**/*.gemfile'
|
20
|
-
# - '**/*.gemspec'
|
21
|
-
# - '**/*.rake'
|
22
|
-
# - '**/*.ru'
|
23
|
-
# - '**/Gemfile'
|
24
|
-
# - '**/Rakefile'
|
25
|
-
|
26
|
-
#AllCops:
|
27
|
-
# Exclude:
|
28
|
-
# - 'db/**/*'
|
29
|
-
# - 'config/**/*'
|
30
|
-
# - 'script/**/*'
|
31
|
-
# - 'bin/{rails,rake}'
|
32
|
-
# - 'spec/**/*'
|
33
|
-
# - !ruby/regexp /old_and_unused\.rb$/
|
34
7
|
|
35
|
-
Bundler/OrderedGems:
|
36
8
|
Exclude:
|
37
|
-
- '
|
38
|
-
|
39
|
-
Layout/AccessModifierIndentation:
|
40
|
-
Enabled: false
|
41
|
-
Layout/AlignArray:
|
42
|
-
Enabled: false
|
43
|
-
Layout/CommentIndentation:
|
44
|
-
Enabled: false
|
45
|
-
Layout/EmptyLinesAroundAccessModifier:
|
46
|
-
Enabled: false
|
47
|
-
Layout/EmptyLinesAroundBlockBody:
|
48
|
-
Enabled: false
|
49
|
-
Layout/EmptyLinesAroundClassBody:
|
50
|
-
Enabled: false
|
51
|
-
Layout/ExtraSpacing:
|
52
|
-
Enabled: false
|
53
|
-
Layout/IndentArray:
|
54
|
-
Enabled: false
|
55
|
-
Layout/IndentationWidth:
|
56
|
-
Enabled: false
|
57
|
-
Layout/Tab:
|
58
|
-
Enabled: false
|
59
|
-
|
60
|
-
Security/YAMLLoad:
|
61
|
-
Enabled: false
|
62
|
-
|
63
|
-
Style/BlockDelimiters:
|
64
|
-
Enabled: false
|
65
|
-
Style/FrozenStringLiteralComment:
|
66
|
-
Exclude:
|
67
|
-
- 'test/**/*.rb'
|
68
|
-
Style/WhenThen:
|
69
|
-
Exclude:
|
70
|
-
- '.watchr'
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
9
|
+
- 'bin/**/*'
|
10
|
+
- 'test/**/*'
|
data/.ruby-gemset
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rails-
|
1
|
+
rails-6.0
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.6.
|
1
|
+
ruby-2.6.6
|
data/.travis.yml
CHANGED
data/.watchr
CHANGED
@@ -16,33 +16,38 @@ end
|
|
16
16
|
|
17
17
|
def run_it(type, file)
|
18
18
|
case type
|
19
|
-
|
20
|
-
when 'test'; run %
|
21
|
-
when 'spec'; run %
|
19
|
+
when 'test'; run %Q(ruby -I"lib:test" -r rubygems #{file})
|
20
|
+
# when 'test'; run %(rails test #{file})
|
21
|
+
when 'spec'; run %(spring rspec -X #{file})
|
22
22
|
else; puts "#{H} unknown type: #{type}, file: #{file}"
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
26
|
def run_all_tests
|
27
27
|
puts "\n#{HH} Running all tests #{HH}\n"
|
28
|
-
|
28
|
+
system "spring stop"
|
29
|
+
%w[test].each { |dir| run "rails #{dir}" if File.exist?(dir) }
|
29
30
|
end
|
30
31
|
|
31
32
|
def run_matching_files(base)
|
32
33
|
base = base.split('_').first
|
33
|
-
%w
|
34
|
+
%w[test spec].each { |type|
|
34
35
|
files = Dir["#{type}/**/*.rb"].select { |file| file =~ /#{base}_.*\.rb/ }
|
35
36
|
run_it type, files.join(' ') unless files.empty?
|
36
37
|
}
|
37
38
|
end
|
38
39
|
|
39
|
-
%w
|
40
|
+
%w[test spec].each { |type|
|
40
41
|
watch("#{type}/#{type}_helper\.rb") { run_all_tests }
|
41
42
|
watch("#{type}/.*/*_#{type}\.rb") { |match| run_it type, match[0] }
|
43
|
+
watch("#{type}/data/(.*)\.rb") { |match|
|
44
|
+
m1 = match[1]
|
45
|
+
run_matching_files("#{type}/#{m1}/#{m1}_#{type}.rb")
|
46
|
+
}
|
42
47
|
}
|
43
|
-
%w
|
44
|
-
watch("
|
45
|
-
run_matching_files(
|
48
|
+
%w[rb erb haml slim].each { |type|
|
49
|
+
watch("app/.*/(.*)\.#{type}") { |match|
|
50
|
+
run_matching_files(match[1])
|
46
51
|
}
|
47
52
|
}
|
48
53
|
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,33 +1,54 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
doit (0.3.
|
4
|
+
doit (0.3.9)
|
5
5
|
micro-optparse (~> 1)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
|
11
|
-
|
10
|
+
ast (2.4.1)
|
11
|
+
docile (1.3.2)
|
12
12
|
micro-optparse (1.2.1)
|
13
|
-
minitest (5.
|
14
|
-
|
15
|
-
|
13
|
+
minitest (5.14.1)
|
14
|
+
observr (1.0.5)
|
15
|
+
parallel (1.19.2)
|
16
|
+
parser (2.7.1.4)
|
17
|
+
ast (~> 2.4.1)
|
18
|
+
rainbow (3.0.0)
|
19
|
+
rake (13.0.1)
|
20
|
+
regexp_parser (1.7.1)
|
21
|
+
rexml (3.2.4)
|
22
|
+
rubocop (0.88.0)
|
23
|
+
parallel (~> 1.10)
|
24
|
+
parser (>= 2.7.1.1)
|
25
|
+
rainbow (>= 2.2.2, < 4.0)
|
26
|
+
regexp_parser (>= 1.7)
|
27
|
+
rexml
|
28
|
+
rubocop-ast (>= 0.1.0, < 1.0)
|
29
|
+
ruby-progressbar (~> 1.7)
|
30
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
31
|
+
rubocop-ast (0.1.0)
|
32
|
+
parser (>= 2.7.0.1)
|
33
|
+
ruby-progressbar (1.10.1)
|
34
|
+
simplecov (0.18.5)
|
16
35
|
docile (~> 1.1)
|
17
|
-
|
18
|
-
|
19
|
-
|
36
|
+
simplecov-html (~> 0.11)
|
37
|
+
simplecov-html (0.12.2)
|
38
|
+
unicode-display_width (1.7.0)
|
20
39
|
|
21
40
|
PLATFORMS
|
22
41
|
ruby
|
23
42
|
|
24
43
|
DEPENDENCIES
|
25
|
-
bundler
|
44
|
+
bundler (~> 2)
|
26
45
|
doit!
|
27
46
|
micro-optparse (~> 1)
|
28
|
-
minitest
|
29
|
-
|
47
|
+
minitest (~> 5)
|
48
|
+
observr
|
49
|
+
rake (~> 13)
|
50
|
+
rubocop
|
30
51
|
simplecov
|
31
52
|
|
32
53
|
BUNDLED WITH
|
33
|
-
1.
|
54
|
+
2.1.4
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -36,7 +36,7 @@ File Structure
|
|
36
36
|
~/.doit/deploy # chmod +x .doit/deploy
|
37
37
|
~/.doit/deploy.yml
|
38
38
|
$PROJ/.doit/deploy.yml # overwrites $HOME(~/) script/configuration
|
39
|
-
$PROJ/.doit/push # chmod +x .doit/
|
39
|
+
$PROJ/.doit/push # chmod +x .doit/push
|
40
40
|
$PROJ/.doit/push.yml
|
41
41
|
|
42
42
|
$PROJ/.doit/push
|
data/bin/doit
CHANGED
@@ -10,15 +10,15 @@ require 'globals'
|
|
10
10
|
require 'what'
|
11
11
|
|
12
12
|
options = Parser.new do |p|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
13
|
+
p.banner = 'Usage: doit script... [options] # execute locally or remotely'
|
14
|
+
p.version = "doit #{Globals::VERSION}"
|
15
|
+
p.option :list, 'Lists available scripts'
|
16
|
+
p.option :each, 'Lists each remote command (no execution)'
|
17
|
+
p.option :remote, 'Remote host or comma separated hosts',
|
18
|
+
default: '...', optional: true
|
19
|
+
p.option :silent, 'Run silently; suppress output'
|
20
|
+
p.option :verbose, 'Enable verbose output'
|
21
|
+
p.option :noop, 'Suppress execution of commannds'
|
22
22
|
end.process!
|
23
23
|
|
24
24
|
Doit.start(options)
|
data/doit.gemspec
CHANGED
@@ -20,10 +20,9 @@ Gem::Specification.new do |s|
|
|
20
20
|
.split("\n").map { |f| File.basename(f) }
|
21
21
|
s.require_paths = ['lib']
|
22
22
|
|
23
|
-
s.add_development_dependency 'bundler'
|
24
|
-
s.add_development_dependency 'rake'
|
23
|
+
s.add_development_dependency 'bundler', '~> 2'
|
24
|
+
s.add_development_dependency 'rake', '~> 13'
|
25
25
|
|
26
26
|
s.add_development_dependency 'micro-optparse', '~> 1'
|
27
|
-
s.add_development_dependency 'minitest'
|
28
|
-
s.add_development_dependency 'simplecov'
|
27
|
+
s.add_development_dependency 'minitest', '~> 5'
|
29
28
|
end
|
data/lib/doit.rb
CHANGED
data/lib/globals.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
-
#
|
1
|
+
# rubocop: disable all
|
2
2
|
|
3
3
|
module Globals
|
4
|
-
VERSION = '0.3.
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
VERSION = '0.3.9' # 2020-07-17
|
5
|
+
# VERSION = '0.3.8' # 2020-02-26
|
6
|
+
# VERSION = '0.3.7' # 2019-10-15
|
7
|
+
# VERSION = '0.3.6' # 2019-03-06
|
8
|
+
# VERSION = '0.3.5' # 2018-09-11
|
9
|
+
# VERSION = '0.3.4' # 2018-08-19
|
10
|
+
# VERSION = '0.3.3'
|
8
11
|
end
|
data/lib/import.rb
CHANGED
data/lib/my.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
My = Object.new
|
4
|
-
class << My
|
5
4
|
|
5
|
+
class << My
|
6
6
|
def verbose(what, txt)
|
7
7
|
marker = '*' * 4
|
8
8
|
arr = txt
|
9
|
-
arr = txt ? txt.split("\n") : ''
|
9
|
+
arr = txt ? txt.split("\n") : '' unless txt.is_a?(Array)
|
10
10
|
if arr.length > 1
|
11
11
|
puts "#{marker} #{what} #{marker}"
|
12
12
|
puts txt
|
@@ -15,5 +15,4 @@ class << My
|
|
15
15
|
puts "#{marker} #{what}: #{txt}"
|
16
16
|
end
|
17
17
|
end
|
18
|
-
|
19
18
|
end
|
data/lib/run.rb
CHANGED
data/lib/what.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# rubocop: disable all
|
2
2
|
|
3
3
|
require 'yaml'
|
4
4
|
require 'doit'
|
@@ -26,7 +26,7 @@ class << What
|
|
26
26
|
|
27
27
|
build_matrix
|
28
28
|
@matrix ||= []
|
29
|
-
@matrix = [@matrix] unless
|
29
|
+
@matrix = [@matrix] unless @matrix.first.is_a?(Array)
|
30
30
|
@matrix.map! { |m| m.flatten.inject({}) { |hsh, h| hsh.merge(h) } }
|
31
31
|
info
|
32
32
|
end
|
@@ -55,7 +55,7 @@ class << What
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def add_to_matrix(key, val)
|
58
|
-
arr = Array
|
58
|
+
arr = val.is_a?(Array) ?
|
59
59
|
val.collect { |v| [{ key => v }] } :
|
60
60
|
[{ key => val }]
|
61
61
|
@matrix = @matrix ? @matrix.product(arr) : arr
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dittmar Krall
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: micro-optparse
|
@@ -28,30 +28,30 @@ dependencies:
|
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '2'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '13'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '13'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: micro-optparse
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,30 +70,16 @@ dependencies:
|
|
70
70
|
name: minitest
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: simplecov
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
73
|
+
- - "~>"
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
75
|
+
version: '5'
|
90
76
|
type: :development
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
|
-
- - "
|
80
|
+
- - "~>"
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
82
|
+
version: '5'
|
97
83
|
description: Run good old shell/bash scripts locally or remotely(ssh).
|
98
84
|
email: dittmar.krall@matique.de
|
99
85
|
executables:
|
@@ -147,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
133
|
- !ruby/object:Gem::Version
|
148
134
|
version: '0'
|
149
135
|
requirements: []
|
150
|
-
rubygems_version: 3.
|
136
|
+
rubygems_version: 3.1.4
|
151
137
|
signing_key:
|
152
138
|
specification_version: 4
|
153
139
|
summary: Simple local & remote script executor
|