jossh 0.1.4 → 0.1.5

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
  SHA1:
3
- metadata.gz: 7d18b383a8d45121c2f64df1ac726857fb44096d
4
- data.tar.gz: bebcc43c96495901ff70c46b906e7fbd51bdf177
3
+ metadata.gz: ada7289fa9d9e80eaeb6138d9db717288b39714e
4
+ data.tar.gz: 7bb2c4f1460ccbe880855196de4a7ff6d646b472
5
5
  SHA512:
6
- metadata.gz: b3a456a8f5468b9384b0087b03d25e2e3b660536df1d6a16e62e0c5fd2a72b5f9caf2aba8a5272f723b8e6a4de9e7cdb26031da3da0cd55065a313063921d043
7
- data.tar.gz: b43df4b36e426cfd037902654d79c20388988484a1e1c922e4c9d7c25884277e9201b99bbd1b8b2a39aeb0d01014ad536a506c22ac1ef9821b0a08783fdf712a
6
+ metadata.gz: 7f7cec75732678fe5cab4c149d713b49b93829d0a2031f899bc88aeb8e70515de2009f10f230c8990b5fc661a8db50704f3d96094488fb0166724751a8af359c
7
+ data.tar.gz: 70e7cf9f993aa127938db51eaa595bc277087633fa0a6d55ff83d3197f6d974d31a954329c429ed26319951da534895c2dc8360d606a32c51b805323e909c3ab
data/README.md CHANGED
@@ -46,6 +46,7 @@ commands or a local script over SSH.
46
46
  Usage:
47
47
  jossh <host> <script> [-- <arguments>...]
48
48
  jossh -m | --make-hostfile
49
+ jossh -e | --edit-hostfile
49
50
  jossh -l | --list
50
51
  jossh -h | --help
51
52
  jossh -v | --version
@@ -70,6 +71,7 @@ commands or a local script over SSH.
70
71
 
71
72
  Options:
72
73
  -m --make-hostfile Generate a template ssh_hosts.yml
74
+ -e --edit-hostfile Open the currently used ssh_hosts.yml file for editing
73
75
  -l --list Show hosts in ./ssh_hosts.yml or ~/ssh_hosts.yml
74
76
  -h --help Show this screen
75
77
  -v --version Show version
@@ -23,6 +23,7 @@ module Jossh
23
23
  return show_version if args['--version']
24
24
  return make_hostfile if args['--make-hostfile']
25
25
  return list_hosts if args['--list']
26
+ return edit_hosts if args['--edit-hostfile']
26
27
  handle_script args['<host>'].dup, args['<script>'], arguments: args['<arguments>']
27
28
  end
28
29
 
@@ -77,6 +78,17 @@ module Jossh
77
78
  end
78
79
  end
79
80
 
81
+ # :nocov:
82
+ def edit_hosts
83
+ runner = CommandRunner.new
84
+ if runner.active_hostfile
85
+ exec "${EDITOR:-vi} #{runner.active_hostfile}"
86
+ else
87
+ say "!txtred!Cannot find ssh_hosts.yml or ~/ssh_hosts.yml.\nRun 'jossh -m' to create one."
88
+ end
89
+ end
90
+ # :nocov:
91
+
80
92
  def show_version
81
93
  puts VERSION
82
94
  end
@@ -3,6 +3,7 @@ Jossh
3
3
  Usage:
4
4
  jossh <host> <script> [-- <arguments>...]
5
5
  jossh -m | --make-hostfile
6
+ jossh -e | --edit-hostfile
6
7
  jossh -l | --list
7
8
  jossh -h | --help
8
9
  jossh -v | --version
@@ -27,6 +28,7 @@ Arguments:
27
28
 
28
29
  Options:
29
30
  -m --make-hostfile Generate a template ssh_hosts.yml
31
+ -e --edit-hostfile Open the currently used ssh_hosts.yml file for editing
30
32
  -l --list Show hosts in ./ssh_hosts.yml or ~/ssh_hosts.yml
31
33
  -h --help Show this screen
32
34
  -v --version Show version
data/lib/jossh/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jossh
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jossh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-29 00:00:00.000000000 Z
11
+ date: 2015-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colsole