casttv-rakeutil 1.1.0 → 1.1.2

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.
Files changed (3) hide show
  1. data/README +1 -0
  2. data/lib/rakeutil.rb +7 -2
  3. metadata +1 -1
data/README CHANGED
@@ -7,6 +7,7 @@ Features:
7
7
  - include Timeout
8
8
  - include Benchmark
9
9
  - makes Kernel#system a verbose call
10
+ - defines Kernel#ssh(host, command) # respects SSH_OPTS constant
10
11
  - defines Kernel#system?, which exits on failure
11
12
  - defines Kernel#jx(*args), which is basically:
12
13
  system "java <inferred options and classpath> arg1 arg2 ..."
@@ -24,6 +24,11 @@ def system(cmd)
24
24
  Kernel.system(cmd) unless $dry
25
25
  end
26
26
 
27
+ def ssh(host, cmd)
28
+ cmd = cmd.gsub "'", %['"'"']
29
+ system %[ssh #{SSH_OPTS || ""} #{host} '#{cmd}']
30
+ end
31
+
27
32
  def jx(*args)
28
33
  system "java -cp #{RAKE_CLASSPATH} #{RAKE_JAVA_OPTS} #{args.join(" ")}"
29
34
  end
@@ -39,7 +44,7 @@ end
39
44
 
40
45
  class Hash
41
46
  def to_os
42
- inject({}){ |memo, (k, v)| memo[k] = v.to_os; memo }
47
+ inject({}){ |memo, (k, v)| memo[k] = v.to_os; OpenStruct.new(memo) }
43
48
  end
44
49
  end
45
50
 
@@ -69,7 +74,7 @@ namespace :util do
69
74
 
70
75
  desc "Pretty-print all rakeutil constants"
71
76
  task :constants do
72
- $rake_consts.sort.each {|c| puts c + "\t" + const_get(c).inspect }
77
+ $rake_consts.sort.each {|c| puts c + "\t" + Kernel.const_get(c).inspect }
73
78
  end
74
79
 
75
80
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: casttv-rakeutil
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - CastTV