rush 0.6 → 0.6.1

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 (4) hide show
  1. data/README.rdoc +87 -0
  2. data/Rakefile +24 -52
  3. data/VERSION +1 -0
  4. metadata +31 -10
data/README.rdoc ADDED
@@ -0,0 +1,87 @@
1
+ = rush -- manage your unix systems with pure Ruby
2
+
3
+ rush is a unix integration library and an interactive shell which uses pure Ruby syntax. Walk directory trees; create, copy, search, and destroy files; find and kill processes - everything you'd normally do with shell commands, now in the strict and elegant world of Ruby.
4
+
5
+ == Usage
6
+
7
+ Count the number of classes in your project using bash:
8
+
9
+ find myproj -name \*.rb | xargs grep '^\s*class' | wc -l
10
+
11
+ In rush, this is:
12
+
13
+ myproj['**/*.rb'].search(/^\s*class/).lines.size
14
+
15
+ Pesky stray mongrels? In bash:
16
+
17
+ kill `ps aux | grep mongrel_rails | grep -v grep | cut -c 10-20`
18
+
19
+ In rush:
20
+
21
+ processes.filter(:cmdline => /mongrel_rails/).kill
22
+
23
+ == As a library
24
+
25
+ require 'rubygems'
26
+ require 'rush'
27
+
28
+ file = Rush['/tmp/myfile']
29
+ file.write "hello"
30
+ puts file.contents
31
+ file.destroy
32
+
33
+ puts Rush.my_process.pid
34
+ puts Rush.processes.size
35
+ puts Rush.bash("echo SHELL COMMAND | tr A-Z a-z")
36
+ puts Rush.launch_dir['*.rb'].search(/Rush/).entries.inspect
37
+
38
+ == Invoking the shell
39
+
40
+ Run the "rush" binary to enter the interactive shell.
41
+
42
+ == Remote access and clustering
43
+
44
+ rush can control any number of remote machines from a single location. Copy files or directories between servers as seamlessly as if it was all local.
45
+
46
+ Example of remote access:
47
+
48
+ local = Rush::Box.new('localhost')
49
+ remote = Rush::Box.new('my.remote.server.com')
50
+ local_dir = local['/Users/adam/myproj/']
51
+ remote_dir = remote['/home/myproj/app/']
52
+
53
+ local_dir.copy_to remote_dir
54
+ remote_dir['**/.svn/'].each { |d| d.destroy }
55
+
56
+ Clustering:
57
+
58
+ local_dir = Rush::Box.new('localhost')['/Users/adam/server_logs/'].create
59
+ servers = %w(www1 www2 www3).map { |n| Rush::Box.new(n) }
60
+ servers.each { |s| s['/var/log/nginx/access.log'].copy_to local_dir["#{s.host}_access.log"] }
61
+
62
+ == Reference
63
+
64
+ For more details on syntax and commands, see:
65
+
66
+ * Rush
67
+ * Rush::Entry
68
+ * Rush::File
69
+ * Rush::Dir
70
+ * Rush::Commands
71
+ * Rush::Box
72
+ * Rush::Process
73
+
74
+ == Meta
75
+
76
+ Created by Adam Wiggins
77
+
78
+ Patches contributed by Chihiro Ito, Gabriel Ware, Michael Schutte, Ricardo Chimal Jr., and Nicholas Schlueter, Pedro Belo, and Martin Kuehl
79
+
80
+ Logo by James Lindenbaum
81
+
82
+ Released under the MIT License: http://www.opensource.org/licenses/mit-license.php
83
+
84
+ http://rush.heroku.com
85
+
86
+ http://groups.google.com/group/ruby-shell
87
+
data/Rakefile CHANGED
@@ -1,4 +1,28 @@
1
1
  require 'rake'
2
+
3
+ require 'jeweler'
4
+
5
+ Jeweler::Tasks.new do |s|
6
+ s.name = "rush"
7
+ s.summary = "A Ruby replacement for bash+ssh."
8
+ s.description = "A Ruby replacement for bash+ssh, providing both an interactive shell and a library. Manage both local and remote unix systems from a single client."
9
+ s.author = "Adam Wiggins"
10
+ s.email = "adam@heroku.com"
11
+ s.homepage = "http://rush.heroku.com/"
12
+ s.executables = [ "rush", "rushd" ]
13
+ s.rubyforge_project = "ruby-shell"
14
+ s.has_rdoc = true
15
+
16
+ s.add_dependency 'mongrel'
17
+ s.add_dependency 'session'
18
+
19
+ s.files = FileList["[A-Z]*", "{bin,lib,spec}/**/*"]
20
+ end
21
+
22
+ Jeweler::RubyforgeTasks.new
23
+
24
+ ######################################################
25
+
2
26
  require 'spec/rake/spectask'
3
27
 
4
28
  desc "Run all specs"
@@ -23,57 +47,7 @@ task :default => :spec
23
47
 
24
48
  ######################################################
25
49
 
26
- require 'rake'
27
- require 'rake/testtask'
28
- require 'rake/clean'
29
- require 'rake/gempackagetask'
30
50
  require 'rake/rdoctask'
31
- require 'fileutils'
32
- include FileUtils
33
-
34
- version = "0.6"
35
- name = "rush"
36
-
37
- spec = Gem::Specification.new do |s|
38
- s.name = name
39
- s.version = version
40
- s.summary = "A Ruby replacement for bash+ssh."
41
- s.description = "A Ruby replacement for bash+ssh, providing both an interactive shell and a library. Manage both local and remote unix systems from a single client."
42
- s.author = "Adam Wiggins"
43
- s.email = "adam@heroku.com"
44
- s.homepage = "http://rush.heroku.com/"
45
- s.executables = [ "rush", "rushd" ]
46
- s.rubyforge_project = "ruby-shell"
47
-
48
- s.add_dependency 'mongrel'
49
- s.add_dependency 'session'
50
-
51
- s.platform = Gem::Platform::RUBY
52
- s.has_rdoc = true
53
-
54
- s.files = %w(Rakefile) + Dir.glob("{bin,lib,spec}/**/*")
55
-
56
- s.require_path = "lib"
57
- s.bindir = "bin"
58
- end
59
-
60
- Rake::GemPackageTask.new(spec) do |p|
61
- p.need_tar = true if RUBY_PLATFORM !~ /mswin/
62
- end
63
-
64
- task :install => [ :package ] do
65
- sh %{sudo gem install pkg/#{name}-#{version}.gem}
66
- end
67
-
68
- task :uninstall => [ :clean ] do
69
- sh %{sudo gem uninstall #{name}}
70
- end
71
-
72
- Rake::TestTask.new do |t|
73
- t.libs << "spec"
74
- t.test_files = FileList['spec/*_spec.rb']
75
- t.verbose = true
76
- end
77
51
 
78
52
  Rake::RDocTask.new do |t|
79
53
  t.rdoc_dir = 'rdoc'
@@ -85,5 +59,3 @@ Rake::RDocTask.new do |t|
85
59
  t.rdoc_files.include('lib/rush/*.rb')
86
60
  end
87
61
 
88
- CLEAN.include [ 'pkg', '*.gem', '.config' ]
89
-
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.6.1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rush
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.6"
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Wiggins
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-16 00:00:00 -07:00
12
+ date: 2009-06-20 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -39,13 +39,15 @@ executables:
39
39
  - rushd
40
40
  extensions: []
41
41
 
42
- extra_rdoc_files: []
43
-
42
+ extra_rdoc_files:
43
+ - README.rdoc
44
44
  files:
45
+ - README.rdoc
45
46
  - Rakefile
47
+ - VERSION
46
48
  - bin/rush
47
49
  - bin/rushd
48
- - lib/rush
50
+ - lib/rush.rb
49
51
  - lib/rush/access.rb
50
52
  - lib/rush/array_ext.rb
51
53
  - lib/rush/box.rb
@@ -68,7 +70,6 @@ files:
68
70
  - lib/rush/shell.rb
69
71
  - lib/rush/ssh_tunnel.rb
70
72
  - lib/rush/string_ext.rb
71
- - lib/rush.rb
72
73
  - spec/access_spec.rb
73
74
  - spec/array_ext_spec.rb
74
75
  - spec/base.rb
@@ -93,8 +94,8 @@ files:
93
94
  has_rdoc: true
94
95
  homepage: http://rush.heroku.com/
95
96
  post_install_message:
96
- rdoc_options: []
97
-
97
+ rdoc_options:
98
+ - --charset=UTF-8
98
99
  require_paths:
99
100
  - lib
100
101
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -116,5 +117,25 @@ rubygems_version: 1.3.1
116
117
  signing_key:
117
118
  specification_version: 2
118
119
  summary: A Ruby replacement for bash+ssh.
119
- test_files: []
120
-
120
+ test_files:
121
+ - spec/access_spec.rb
122
+ - spec/array_ext_spec.rb
123
+ - spec/base.rb
124
+ - spec/box_spec.rb
125
+ - spec/commands_spec.rb
126
+ - spec/config_spec.rb
127
+ - spec/dir_spec.rb
128
+ - spec/embeddable_shell_spec.rb
129
+ - spec/entry_spec.rb
130
+ - spec/file_spec.rb
131
+ - spec/find_by_spec.rb
132
+ - spec/fixnum_ext_spec.rb
133
+ - spec/local_spec.rb
134
+ - spec/process_set_spec.rb
135
+ - spec/process_spec.rb
136
+ - spec/remote_spec.rb
137
+ - spec/rush_spec.rb
138
+ - spec/search_results_spec.rb
139
+ - spec/shell_spec.rb
140
+ - spec/ssh_tunnel_spec.rb
141
+ - spec/string_ext_spec.rb