doit 0.3.0 → 0.3.2

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: 7e3e55b5782a334d1ace53286a138bdd935a4d09
4
- data.tar.gz: 4fa3b68d8f34263279ae3dff8e1d87a1c7dfbfa0
3
+ metadata.gz: 3bc140e881b43c004f6a23f5b200d098dc7e4359
4
+ data.tar.gz: 9475f4ed399cd3ebf2dfd227b436da2a434ae7a3
5
5
  SHA512:
6
- metadata.gz: ded0af93c825b472874ea32daae00c5e0821ad0132c474fc308d6354e174ed782a1d28a6e5f6548de84cd5e9d7d3f6500104a800970a12a84502d6c72e0bfb39
7
- data.tar.gz: 59310dd1e3791d555998cd37e042247a6c558c79699b3e0c7c8ee308c9536e9640085daa3e4df19465076aab2ea0a4532a06e6844baf1bc9943e662454355216
6
+ metadata.gz: 13bfdfd39a32bf91c75c033bd472634a4df85b469429b20e21294cce80b1021ebec9837fe48bd4679a0c5174409b7accdd74cec8d781598a5a8dd42c5bc0db70
7
+ data.tar.gz: ca8a31bc0293c45becb74cbd990aac41c5c67d910042f99bc18ec090dcd2096a6a4a2b5bf29b2713649f39d85066edd9c2e074e48505e847237867c1fe6fb0e1
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ *.gem
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ rails-5.1
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.2.0
1
+ ruby-2.5.0
data/.travis.yml CHANGED
@@ -1,8 +1,12 @@
1
1
  language: ruby
2
2
  sudo: false
3
+
3
4
  rvm:
4
- - 2.0.0
5
- - 2.2.3
5
+ - 2.5.0
6
+ - 2.4.1
7
+ - 2.3.0
8
+ # - 2.2.3 # tested; no longer in CI
9
+ # - 2.0.0 # tested; no longer in CI
6
10
 
7
11
  notifications:
8
12
  email: false
data/Gemfile CHANGED
@@ -1,15 +1,16 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'micro-optparse'
4
-
5
- group :test do
6
- gem 'simplecov', require: false
7
- end
3
+ gemspec
8
4
 
9
- group :test, :development do
10
- gem 'rake'
11
- gem 'observr'
12
- gem 'minitest'
13
- end
5
+ #gem 'micro-optparse'
6
+ #
7
+ #group :test do
8
+ # gem 'simplecov', require: false
9
+ #end
10
+ #
11
+ #group :test, :development do
12
+ # gem 'rake'
13
+ # gem 'observr'
14
+ # gem 'minitest'
15
+ #end
14
16
 
15
- gemspec
data/Gemfile.lock CHANGED
@@ -1,31 +1,38 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- doit (0.3.0)
4
+ doit (0.3.2)
5
5
  micro-optparse (~> 1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  docile (1.1.5)
11
- json (1.8.3)
12
- micro-optparse (1.2.0)
13
- minitest (5.8.4)
14
- observr (1.0.5)
15
- rake (10.5.0)
16
- simplecov (0.11.1)
11
+ json (2.1.0)
12
+ micro-optparse (1.2.1)
13
+ minitest (5.11.3)
14
+ rake (12.3.0)
15
+ simplecov (0.15.1)
17
16
  docile (~> 1.1.0)
18
- json (~> 1.8)
17
+ json (>= 1.8, < 3)
19
18
  simplecov-html (~> 0.10.0)
20
- simplecov-html (0.10.0)
19
+ simplecov-html (0.10.2)
20
+ slim (3.0.9)
21
+ temple (>= 0.7.6, < 0.9)
22
+ tilt (>= 1.3.3, < 2.1)
23
+ temple (0.8.0)
24
+ tilt (2.0.8)
21
25
 
22
26
  PLATFORMS
23
27
  ruby
24
28
 
25
29
  DEPENDENCIES
30
+ bundler
26
31
  doit!
27
- micro-optparse
28
32
  minitest
29
- observr
30
33
  rake
31
34
  simplecov
35
+ slim
36
+
37
+ BUNDLED WITH
38
+ 1.16.1
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014 Dittmar Krall
1
+ Copyright (c) 2014-2017 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
@@ -23,12 +23,14 @@ Options
23
23
  -------
24
24
  -l, --[no-]list Lists available scripts
25
25
  -r, --remote ["host"] remote host or comma separated hosts
26
+ -e, --[no-]each Lists each remote command (no execution)
26
27
  -s, --[no-]silent run silently; suppress output
27
28
  -v, --[no-]verbose Enable verbose output
28
29
  -n, --[no-]noop Suppress execution of commannds
29
30
  -h, --help Show this message
30
31
  -V, --version Print version
31
32
 
33
+
32
34
  File Structure
33
35
  --------------
34
36
  ~/.doit/deploy # chmod +x .doit/deploy
@@ -73,4 +75,4 @@ $PROJ/.doit/push
73
75
  - bob@sample.com
74
76
  - alice@customer.com
75
77
 
76
- Copyright (c) 2014-2016 [Dittmar Krall], released under the MIT license
78
+ Copyright (c) 2014-2017 [Dittmar Krall], released under the MIT license
data/bin/doit CHANGED
@@ -6,6 +6,7 @@ $:.unshift lib unless $:.include?(lib)
6
6
  require 'doit'
7
7
  require 'micro-optparse'
8
8
  require 'globals'
9
+ require 'what'
9
10
 
10
11
  options = Parser.new do |p|
11
12
  p.banner = "Usage: doit script... [options] # execute locally or remotely"
data/doit.gemspec CHANGED
@@ -1,22 +1,29 @@
1
1
  $:.push File.expand_path("../lib", __FILE__)
2
2
  require 'globals'
3
3
 
4
- Gem::Specification.new do |gem|
5
- gem.name = 'doit'
6
- gem.version = Globals::VERSION
7
- gem.summary = "Simple local & remote script executor"
8
- gem.description = "Run good old shell/bash scripts locally or remotely(ssh)."
4
+ Gem::Specification.new do |s|
5
+ s.name = 'doit'
6
+ s.version = Globals::VERSION
7
+ s.summary = "Simple local & remote script executor"
8
+ s.description = "Run good old shell/bash scripts locally or remotely(ssh)."
9
9
 
10
- gem.authors = ['Dittmar Krall']
11
- gem.email = 'dittmar.krall@matique.de'
12
- gem.homepage = 'http://www.matique.de'
13
- gem.license = 'MIT'
10
+ s.authors = ['Dittmar Krall']
11
+ s.email = 'dittmar.krall@matique.de'
12
+ s.homepage = 'http://www.matique.de'
13
+ s.license = 'MIT'
14
14
 
15
- gem.add_dependency 'micro-optparse', '~> 1'
15
+ s.add_dependency 'micro-optparse', '~> 1'
16
16
 
17
- gem.files = `git ls-files`.split("\n")
18
- gem.test_files = `git ls-files -- test`.split("\n")
19
- gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
- gem.require_paths = ["lib"]
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- test`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
21
 
22
+ s.add_development_dependency 'bundler'
23
+ s.add_development_dependency 'rake'
24
+ s.add_development_dependency 'slim'
25
+
26
+ # s.add_development_dependency 'micro-optparse', '~> 1'
27
+ s.add_development_dependency 'minitest'
28
+ s.add_development_dependency 'simplecov'
22
29
  end
data/lib/doit.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require 'my'
2
2
  require 'run'
3
3
  require 'import'
4
- require 'what'
5
4
 
6
5
  Doit = Object.new
7
6
  class << Doit
@@ -17,7 +16,8 @@ class << Doit
17
16
  end
18
17
 
19
18
  def options
20
- @options || {}
19
+ @options ||= {}
20
+ @options
21
21
  end
22
22
 
23
23
  def list
data/lib/globals.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Globals
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.2'
3
3
  end
data/lib/import.rb CHANGED
@@ -4,8 +4,8 @@ require 'erb'
4
4
  Import = Object.new
5
5
  class << Import
6
6
 
7
- def script; @script; end
8
- def config; @config; end
7
+ def script; @script ||= nil; @script; end
8
+ def config; @config ||= nil; @config; end
9
9
 
10
10
  def init(name)
11
11
  @script = read(name)
@@ -54,7 +54,7 @@ class << Import
54
54
  def try_ascend(filename)
55
55
  Pathname.pwd.ascend { |dir|
56
56
  str = dir + filename
57
- return File.read(str) if File.exists?(str)
57
+ return File.read(str) if File.exist?(str)
58
58
  }
59
59
  nil
60
60
  end
data/test/doit_test.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'test_helper'
2
- require 'doit'
3
2
 
4
3
  describe Doit do
5
4
 
@@ -20,35 +19,35 @@ describe Doit do
20
19
  out = noop {
21
20
  Doit.list
22
21
  }
23
- assert_match /\/\.doit/, out
22
+ assert_match(/\/\.doit/, out)
24
23
  end
25
24
 
26
25
  it "execute" do
27
- out, err = capture_io do
26
+ out, _err = capture_io do
28
27
  Doit.execute('hello')
29
28
  end
30
- assert_match /\nHello\n/, out
29
+ assert_match(/\nHello\n/, out)
31
30
  end
32
31
 
33
32
  it "execute with unknown script" do
34
- out, err = capture_io do
33
+ out, _err = capture_io do
35
34
  Doit.execute('______unknown______')
36
35
  end
37
- assert_match /not found/, out
36
+ assert_match(/not found/, out)
38
37
  end
39
38
 
40
39
  it "tests option --each" do
41
40
  out = noop({each: true}) {
42
41
  Doit.execute('hello')
43
42
  }
44
- assert_match /doit hello -r/, out
43
+ assert_match(/doit hello -r/, out)
45
44
  end
46
45
 
47
46
  it "coverage: list; option -lv" do
48
47
  out = noop({verbose: true, list: true}) {
49
48
  Doit.start({verbose: true, list: true})
50
49
  }
51
- assert_match /just a test\n/, out
50
+ assert_match(/just a test\n/, out)
52
51
  end
53
52
 
54
53
  end
data/test/import_test.rb CHANGED
@@ -15,7 +15,7 @@ describe Import do
15
15
 
16
16
  it "list" do
17
17
  Import.init('hello')
18
- assert_match /\/\.doit\/hello$/, Import.list['hello']
18
+ assert_match(/\/\.doit\/hello$/, Import.list['hello'])
19
19
  end
20
20
 
21
21
  it "info" do
@@ -23,8 +23,8 @@ describe Import do
23
23
  Import.init('hello')
24
24
  Import.info
25
25
  }
26
- assert_match /SCRIPT/, out
27
- assert_match /CONFIG/, out
26
+ assert_match(/SCRIPT/, out)
27
+ assert_match(/CONFIG/, out)
28
28
  end
29
29
 
30
30
  it "coverage: script" do
data/test/my_test.rb CHANGED
@@ -5,18 +5,18 @@ describe My do
5
5
 
6
6
  it "verbose" do
7
7
  h = 'hello'
8
- out, err = capture_io do
8
+ _out, _err = capture_io do
9
9
  My.verbose('a', h)
10
10
  end
11
- assert_match /#{h}/, out
11
+ assert_match(/#{h}/, _out)
12
12
  end
13
13
 
14
14
  it "verbose text" do
15
15
  h = 'hello'
16
- out, err = capture_io do
16
+ _out, _err = capture_io do
17
17
  My.verbose('a', "#{h}\nx\n")
18
18
  end
19
- assert_match /#{h}/, out
19
+ assert_match(/#{h}/, _out)
20
20
  end
21
21
 
22
22
  end
data/test/run_test.rb CHANGED
@@ -6,42 +6,42 @@ require 'doit'
6
6
  describe Run do
7
7
 
8
8
  it "coverage #info" do
9
- out, err = capture_io do
9
+ _out, _err = capture_io do
10
10
  Run.init('', '')
11
11
  Run.info
12
12
  end
13
13
  end
14
14
 
15
15
  it "where '' returns nil" do
16
- out, err = capture_io do
16
+ _out, _err = capture_io do
17
17
  Run.init('', '')
18
18
  assert_equal nil, Run.ssh
19
19
  end
20
20
  end
21
21
 
22
22
  it "where 'a' returns nil" do
23
- out, err = capture_io do
23
+ _out, _err = capture_io do
24
24
  Run.init('', 'a')
25
25
  assert_equal nil, Run.ssh
26
26
  end
27
27
  end
28
28
 
29
29
  it "where 'a@b' returns 'ssh a@b'" do
30
- out, err = capture_io do
30
+ _out, _err = capture_io do
31
31
  Run.init('', 'a@b')
32
32
  assert_equal 'ssh a@b', Run.ssh
33
33
  end
34
34
  end
35
35
 
36
36
  it "where 'a@b:c' returns 'ssh a@b'" do
37
- out, err = capture_io do
37
+ _out, _err = capture_io do
38
38
  Run.init('', 'a@b:c')
39
39
  assert_equal 'ssh a@b', Run.ssh
40
40
  end
41
41
  end
42
42
 
43
43
  it "coverage #run" do
44
- out, err = capture_io do
44
+ _out, _err = capture_io do
45
45
  Run.init('', '')
46
46
  Run.run
47
47
  end
@@ -52,7 +52,7 @@ describe Run do
52
52
  Run.init('', '')
53
53
  Run.run
54
54
  }
55
- assert_match /EOS/, out
55
+ assert_match(/EOS/, out)
56
56
  end
57
57
 
58
58
  end
data/test/test_helper.rb CHANGED
@@ -4,6 +4,8 @@ SimpleCov.start do
4
4
  command_name 'Minitest'
5
5
  end
6
6
 
7
+ require 'what'
8
+
7
9
  require 'minitest/autorun'
8
10
 
9
11
  def noop(options = {noop: true}, &block)
@@ -11,7 +13,7 @@ def noop(options = {noop: true}, &block)
11
13
 
12
14
  out = '---'
13
15
  Doit.stub :options, options do
14
- out, err = capture_io do
16
+ out, _err = capture_io do
15
17
  block.call
16
18
  end
17
19
  end
data/test/what_test.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'test_helper'
2
- require 'what'
3
2
  require 'my'
4
3
 
5
4
  describe What do
@@ -20,7 +19,7 @@ describe What do
20
19
 
21
20
  it "coverage: #info" do
22
21
  Doit.stub :options, {verbose: true} do
23
- out, err = capture_io do
22
+ _out, _err = capture_io do
24
23
  What.init('', '')
25
24
  What.info
26
25
  end
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.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dittmar Krall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-01 00:00:00.000000000 Z
11
+ date: 2018-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: micro-optparse
@@ -24,6 +24,76 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: slim
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest
71
+ requirement: !ruby/object:Gem::Requirement
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
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
27
97
  description: Run good old shell/bash scripts locally or remotely(ssh).
28
98
  email: dittmar.krall@matique.de
29
99
  executables:
@@ -33,6 +103,8 @@ extra_rdoc_files: []
33
103
  files:
34
104
  - ".doit/hello"
35
105
  - ".doit/hello.yml"
106
+ - ".gitignore"
107
+ - ".ruby-gemset"
36
108
  - ".ruby-version"
37
109
  - ".travis.yml"
38
110
  - ".watchr"
@@ -75,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
147
  version: '0'
76
148
  requirements: []
77
149
  rubyforge_project:
78
- rubygems_version: 2.4.5
150
+ rubygems_version: 2.6.14
79
151
  signing_key:
80
152
  specification_version: 4
81
153
  summary: Simple local & remote script executor