rye 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.txt CHANGED
@@ -1,9 +1,11 @@
1
1
  RYE, CHANGES
2
2
 
3
3
 
4
- #### 0.3.1 (2009-04-05) #############################
4
+ #### 0.3.2 (2009-04-05) #############################
5
5
 
6
6
  * FIXED: Module.instance_methods bug. In Ruby 1.9 it's Symbols (1.8 was Strings).
7
+ * FIXED: Rye::Set#add_boxes didn't return self.
8
+ # UPDATED: Lots of docs tweaks.
7
9
 
8
10
 
9
11
  #### 0.3 (2009-04-05) ###############################
data/README.rdoc CHANGED
@@ -1,10 +1,10 @@
1
1
  = Rye - v0.3
2
2
 
3
- Run system commands via SSH locally and remotely in a Ruby way.
3
+ Safely run remote commands via SSH in Ruby.
4
4
 
5
5
  Rye is similar to Rush[http://rush.heroku.com] but everything happens over SSH (no HTTP daemon) and the default settings are less powerful (for safety). For example, file globs are disabled so unless otherwise specified, you can't do this: <tt>rbox.rm('-rf', '/etc/**/*')</tt>.
6
6
 
7
- See +bin/try+ for working examples.
7
+ See bin/try for working examples.
8
8
 
9
9
  == Installation
10
10
 
@@ -136,9 +136,9 @@ One of:
136
136
 
137
137
  In safe-mode:
138
138
 
139
- * You can't use file globs. This means you can't do this: <tt>rbox.ls('*.rb')</tt>.
140
- * Command arguments cannot contain environment variables. However, environment variables are available to the commands you run. This means you can't do this: <tt>rbox.echo('$HOME')</tt>.
141
- * Pipes and operators don't work: <tt>|, &&, >, <, ||</tt>, etc...
139
+ * You can't use file globs. This means you can't do this: <tt>rbox.ls('*.rb')</tt>. <tt>~</tt> also doesn't work!
140
+ * Command arguments cannot contain environment variables (however, environment variables are available to the commands you run). This means you can't do this: <tt>rbox.echo('$HOME')</tt>.
141
+ * Pipes and operators don't work: <tt>|, &&, >, <, ||, ~</tt>, etc...
142
142
  * Backticks don't work either: <tt>procs=`ps aux`</tt>
143
143
 
144
144
  Why? In safe-mode, all command arguments are escaped which turns all arguments into their literal values.
@@ -146,6 +146,10 @@ Why? In safe-mode, all command arguments are escaped which turns all arguments i
146
146
  Using a Ruby interface to execute shell commands is pretty awesome, particularly to run them on several machines simultaneously. That's a lot of power and it's potentially very dangerous. That's why Rye disables this stuff by default. There's probably a way to do it safely but it's not obvious yet (to me). If you have any ideas, I'd love to hear them!
147
147
 
148
148
 
149
+ == Command Whitelist
150
+
151
+ Rye permits only a limited number of system commands to be run. This default whitelist is defined in Rye::Cmd but you can add your own commands as you please (see Example 2).
152
+
149
153
  == Credits
150
154
 
151
155
  * Delano Mandelbaum (delano@solutious.com)
@@ -154,7 +158,7 @@ Using a Ruby interface to execute shell commands is pretty awesome, particularly
154
158
  == Thanks
155
159
 
156
160
  * Solutious Incorporated (http://solutious.com) for all the orange juice.
157
- * The country of Canada for making Rye Whiskey.
161
+ * The country of Canada for making Rye Whisky.
158
162
 
159
163
 
160
164
  == Kudos
@@ -165,6 +169,11 @@ Using a Ruby interface to execute shell commands is pretty awesome, particularly
165
169
  * http://groups.google.com/group/ruby-talk-google/browse_thread/thread/674a6f6de15ceb49?pli=1
166
170
  * http://paste.lisp.org/display/6912
167
171
 
172
+ == More Info
173
+
174
+ * http://github.com/delano/rye
175
+ * http://delano.github.com/rye
176
+ * http://www.youtube.com/watch?v=_StUVh6ENuw
168
177
 
169
178
  == Credits
170
179
 
data/lib/rye/cmd.rb CHANGED
@@ -22,25 +22,37 @@ module Rye;
22
22
  def cp(*args); cmd("cp", args); end
23
23
  def mv(*args); cmd("mv", args); end
24
24
  def ls(*args); cmd('ls', args); end
25
- def rm(*args); cmd('rm', args); end
25
+ #def rm(*args); cmd('rm', args); end
26
26
  def ps(*args); cmd('ps', args); end
27
27
  def sh(*args); cmd('sh', args); end
28
+
28
29
  def env; cmd "env"; end
29
30
  def pwd; cmd "pwd"; end
31
+ def svn(*args); cmd('svn', args); end
32
+ def cvs(*args); cmd('cvs', args); end
33
+ def git(*args); cmd('git', args); end
34
+ def sed(*args); cmd('sed', args); end
35
+ def awk(*args); cmd('awk', args); end
30
36
  def cat(*args); cmd('cat', args); end
37
+
38
+ #def kill(*args); cmd('kill', args); end
39
+ def sudo(*args); cmd('sudo', args); end
31
40
  def grep(*args); cmd('grep', args); end
32
41
  def date(*args); cmd('date', args); end
33
42
  def ruby(*args); cmd('ruby', args); end
34
43
  def perl(*args); cmd('perl', args); end
35
44
  def bash(*args); cmd('bash', args); end
36
45
  def echo(*args); cmd('echo', args); end
46
+
47
+ def mount; cmd("mount"); end
37
48
  def sleep(seconds=1); cmd("sleep", seconds); end
38
49
  def touch(*args); cmd('touch', args); end
39
50
  def uname(*args); cmd('uname', args); end
40
- def mount; cmd("mount"); end
41
- def python(*args); cmd('python', args); end
51
+
42
52
  def uptime; cmd("uptime"); end
53
+ def python(*args); cmd('python', args); end
43
54
  def printenv(*args); cmd('printenv', args); end
55
+
44
56
  # Consider Rye.sysinfo.os == :unix
45
57
  end
46
58
 
data/lib/rye/set.rb CHANGED
@@ -49,7 +49,7 @@ module Rye
49
49
  @boxes += boxes.collect do |box|
50
50
  box.is_a?(Rye::Box) ? box.add_keys(@keys) : Rye::Box.new(box, @opts)
51
51
  end
52
- @boxes
52
+ self
53
53
  end
54
54
  alias :add_boxes :add_box
55
55
 
data/lib/rye.rb CHANGED
@@ -9,12 +9,12 @@ require 'sys'
9
9
 
10
10
  # = Rye
11
11
  #
12
- # Run system commands via SSH locally and remotely in a Ruby way.
12
+ # Safely run remote commands via SSH in Ruby.
13
13
  #
14
14
  # Rye is similar to Rush[http://rush.heroku.com] but everything
15
15
  # happens over SSH (no HTTP daemon) and the default settings are
16
- # less powerful (for safety). For example, file globs are disabled
17
- # so unless otherwise specified, you can't do this:
16
+ # less dangerous (for safety). For example, file globs are
17
+ # disabled so unless otherwise specified, you can't do this:
18
18
  # <tt>rbox.rm('/etc/**/*')</tt>.
19
19
  #
20
20
  # * See +bin/try+ for a bunch of working examples.
data/rye.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  @spec = Gem::Specification.new do |s|
2
2
  s.name = "rye"
3
3
  s.rubyforge_project = "rye"
4
- s.version = "0.3.1"
4
+ s.version = "0.3.2"
5
5
  s.summary = "Rye: Run system commands via SSH locally and remotely in a Ruby way."
6
6
  s.description = s.summary
7
7
  s.author = "Delano Mandelbaum"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rye
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delano Mandelbaum