doit 0.3.6 → 0.3.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab3e45ae5cd8368470a2f596274de76dace66dcbdf5179a36e72f0829593b7f6
4
- data.tar.gz: 7639c595a1c200e7d6dcbae89272cbde935f1c391082a0cf2256329b724b3e46
3
+ metadata.gz: 3b8c68afcf5f77a8417f547416d04bdc90c38f0cda47ec2614cb83367c472d31
4
+ data.tar.gz: ffad2c5f2b2e7ba683bf881d0214832ac61ac0c4a32c0136a0fde6ee24bb9de0
5
5
  SHA512:
6
- metadata.gz: 4469bb7cb6e1ed2d38830da1ea11570f90a398f04a4a9ad11d8c42a443cc9e3d2d3b9b71643a0964836a8d5def2781203255ffa36e16d0db9eef1e101144e529
7
- data.tar.gz: 5440ec7f1a51ae549dac16cde73dc968b5488dbb0a2cc28a64969b092c86016cba03e90b9e16a1cde15dfc582a1fba3c3b5bad1009128bc1c56b563470790873
6
+ metadata.gz: 46c1dbc104ca4cfbf6b4045fd32ca1fb7709d74a4c4d5fe5c7bbeaa51d4ee3e13239a3b9bf69ac265e3bab24ec20b07140b340fe5f0495713213d875ef348d37
7
+ data.tar.gz: 67253a363b7fe882dd385c2cbd1738b5335c79c9332a882cc44be8ff870c223aa22acd4820c15973e5522c0a467da20cc6597223c17bd88402adc2f5c8f23a5f
@@ -1,74 +1,10 @@
1
- # inherit_from: .rubocop_todo.yml
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
- - 'Gemfile'
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/**/*'
@@ -1 +1 @@
1
- rails-5.2
1
+ rails-6.0
@@ -1 +1 @@
1
- ruby-2.6.1
1
+ ruby-2.6.6
@@ -5,7 +5,11 @@ bundler_args: --without production
5
5
  script: "bundle exec rake test"
6
6
 
7
7
  rvm:
8
- - 2.6.1
8
+ - 2.6.6 # 2020-07-17
9
+ # - 2.6.5 # 2019-10-29
10
+ # - 2.6.4 # 2019-10-15
11
+ # - 2.6.3 # 2019-06-21
12
+ # - 2.6.1
9
13
  # - 2.5.1
10
14
  # - 2.5.0
11
15
  # - 2.4.1
data/.watchr CHANGED
@@ -16,33 +16,38 @@ end
16
16
 
17
17
  def run_it(type, file)
18
18
  case type
19
- # when 'test'; run %Q{ruby -I"lib:test" -rubygems #{file}}
20
- when 'test'; run %Q{ruby -I"lib:test" #{file}}
21
- when 'spec'; run %Q{spring rspec -X #{file}}
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
- %w{test}.each { |dir| run "rake #{dir}" if File.exists?(dir) }
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{test spec}.each { |type|
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{test spec}.each { |type|
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{rb erb haml slim}.each { |type|
44
- watch(".*/.*\.#{type}") { |m|
45
- run_matching_files("#{m[0].split('/').last.split('.').first}")
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
@@ -1,3 +1,9 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
+
5
+ group :test do
6
+ gem 'observr'
7
+ gem 'rubocop', require: false
8
+ gem 'simplecov', require: false
9
+ end
@@ -1,33 +1,54 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- doit (0.3.5)
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
- docile (1.3.1)
11
- json (2.2.0)
10
+ ast (2.4.1)
11
+ docile (1.3.2)
12
12
  micro-optparse (1.2.1)
13
- minitest (5.11.3)
14
- rake (12.3.2)
15
- simplecov (0.16.1)
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
- json (>= 1.8, < 3)
18
- simplecov-html (~> 0.10.0)
19
- simplecov-html (0.10.2)
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
- rake
47
+ minitest (~> 5)
48
+ observr
49
+ rake (~> 13)
50
+ rubocop
30
51
  simplecov
31
52
 
32
53
  BUNDLED WITH
33
- 1.17.2
54
+ 2.1.4
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2019 Dittmar Krall
1
+ Copyright (c) 2014-2020 Dittmar Krall
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of
4
4
  this software and associated documentation files (the "Software"), to deal in
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/deploy
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
- 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'
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)
@@ -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
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: true
1
+ # rubocop: disable all
2
2
 
3
3
  require 'my'
4
4
  require 'run'
@@ -1,8 +1,11 @@
1
- # frozen_string_literal: true
1
+ # rubocop: disable all
2
2
 
3
3
  module Globals
4
- VERSION = '0.3.6' # 2019-03-06
5
- # VERSION = '0.3.5' # 2018-09-11
6
- # VERSION = '0.3.4' # 2018-08-19
7
- # VERSION = '0.3.3'
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
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: true
1
+ # rubocop: disable all
2
2
 
3
3
  require 'pathname'
4
4
  require 'erb'
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") : '' unless Array === txt
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
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: true
1
+ # rubocop: disable all
2
2
 
3
3
  Run = Object.new
4
4
  class << Run
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: true
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 Array === @matrix.first
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 === val ?
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.6
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: 2019-03-06 00:00:00.000000000 Z
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: '0'
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: '0'
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: '0'
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: '0'
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: '0'
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: '0'
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.0.1
136
+ rubygems_version: 3.1.4
151
137
  signing_key:
152
138
  specification_version: 4
153
139
  summary: Simple local & remote script executor