capx 0.0.2 → 0.0.3

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: f5a2d415eadfd1beaadc13cfa665662b0804537d16fda29f9d7a971b0661c880
4
- data.tar.gz: a4862ab6b346307c66ca05cdf4b103d9fbb56929a512ad1440a113a39e491bfa
3
+ metadata.gz: 54f9c832dd635a2ee78e58603f3317c8c556149d07fe5fec0b8742640ef8ba8b
4
+ data.tar.gz: 1600766506adf2112eb75563e353c819302f1b9bd2be72b1b6d75a9a2b724d1b
5
5
  SHA512:
6
- metadata.gz: 59bc2ee34a9ca4488b0ca79f71f85db2cacd7c36f60bcdfe48f19ac981261e7e1d5737fba9fa8f34a0526c1d138c34087531fe239494218591baf2f08caadfa0
7
- data.tar.gz: fd7d1f6fb4c009270111837efbc283a1213a026f9d9c84dcf594719b7533f6ea32968c3290d188a0fa1938cac9b459f69d9f6bc86663417409c754ea193d210f
6
+ metadata.gz: df1ed19bb23d76de632044abec6a8df7ae4937567ac05069b042c9068af277ab6ebfed99a2038df2e7f1f44c9f5908518628bd2da18a4af286056b4178c2ec77
7
+ data.tar.gz: b846c3c660939616cd3890acab228e7042c03cf230f444f8a30bda1c78763b8a006c0e850f00cba76169af49f85c5e2f302171a551ead88eeb4a3b175bde40cb
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # CapX
2
2
 
3
- Generates SSH command using capistrano deploy configuration. \
3
+ Generates SSH commands using capistrano deploy configuration. \
4
4
  SSH username and host are parsed from capistrano deploy configuration. \
5
5
  \
6
6
  capistrano deploy configuration:
@@ -23,10 +23,12 @@ generated SSH command:
23
23
  This will add the following executable in your shell:
24
24
 
25
25
 
26
- capx [stage] [ssh]
26
+ capx [stage] [ssh|disk|info] [user]
27
27
 
28
28
 
29
29
  ### Examples:
30
30
 
31
31
  $ capx staging # show ssh command
32
- $ capx production ssh # execute ssh command
32
+ $ capx production ssh # execute ssh command
33
+ $ capx production ssh root # execute ssh command with root user
34
+ $ capx production disk # execute ssh 'df -H' command
data/bin/capx CHANGED
@@ -6,7 +6,7 @@ $LOAD_PATH.unshift(File.dirname(File.realpath(__FILE__)) + '/../lib')
6
6
  require 'capx'
7
7
 
8
8
  def show_help
9
- puts 'params: <stage> <switch> <user>'
9
+ puts 'params: <stage> <ssh|disk|info> <user>'
10
10
  puts 'example: capx staging ssh'
11
11
  end
12
12
 
@@ -25,8 +25,14 @@ module Capx
25
25
  if @switch == 'ssh'
26
26
  # call ssh
27
27
  cmd = "ssh #{@user}@#{@server}"
28
- puts "executing #{cmd}"
29
- exec(cmd)
28
+ execute_cmd(cmd)
29
+ elsif @switch == 'disk'
30
+ # call remote df -H
31
+ cmd = "ssh #{@user}@#{@server} 'df -H'"
32
+ execute_cmd(cmd)
33
+ elsif @switch == 'info'
34
+ cmd = "ssh #{@user}@#{@server} 'cat /etc/*-release'"
35
+ execute_cmd(cmd)
30
36
  else
31
37
  puts "#{@user}@#{@server}"
32
38
  end
@@ -35,5 +41,12 @@ module Capx
35
41
  puts "File #{file} not found"
36
42
  end
37
43
  end
44
+
45
+ private
46
+
47
+ def execute_cmd(cmd)
48
+ puts "executing #{cmd}"
49
+ exec(cmd)
50
+ end
38
51
  end
39
52
  end
@@ -1,5 +1,5 @@
1
1
  # main module for capx
2
2
  module Capx
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Kmet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-09 00:00:00.000000000 Z
11
+ date: 2018-07-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |2
14
14
  Generates SSH command using capistrano deploy configuration..
@@ -48,7 +48,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
48
48
  version: '0'
49
49
  requirements: []
50
50
  rubyforge_project:
51
- rubygems_version: 2.7.6
51
+ rubygems_version: 2.7.3
52
52
  signing_key:
53
53
  specification_version: 4
54
54
  summary: Generates SSH command using capistrano deploy configuration.