arsh 1.1 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/arsh +1 -0
- data/libs/rvm.rb +15 -6
- data/libs/version.rb +1 -1
- metadata +4 -4
data/bin/arsh
CHANGED
data/libs/rvm.rb
CHANGED
@@ -1,14 +1,23 @@
|
|
1
1
|
module ArshCommands
|
2
2
|
def self.rvm(command)
|
3
|
-
command = command.join(' ')
|
4
|
-
output = %x{bash -c "source #{ENV['rvm_path']}/scripts/rvm; rvm #{command}; env | grep -i rvm"}
|
5
|
-
output.split("\n").select { |l| l[/=/] }.each do |n|
|
6
|
-
var, value = n.split(/=/,2)
|
7
|
-
ENV[var] = value
|
8
|
-
end
|
3
|
+
command = command.is_a?(Array) ? command.join(' ') : command
|
9
4
|
case command
|
10
5
|
when /^use /
|
6
|
+
@output = %x{bash -c "source #{ENV['rvm_path']}/scripts/rvm; rvm #{command}; env | grep -i rvm"}
|
7
|
+
@output.split("\n").select { |l| l[/=/] }.each do |n|
|
8
|
+
var, value = n.split(/=/,2)
|
9
|
+
ENV[var] = value
|
10
|
+
end
|
11
11
|
puts "\e[32mUsing #{ENV['GEM_HOME']}\e[0m"
|
12
|
+
else
|
13
|
+
puts "\e[01;32mUsing Ctrl-C on this operation will push the operation to the background.\nThe operation will not stop\e[0m"
|
14
|
+
pid = ""
|
15
|
+
Process.fork do
|
16
|
+
pid = Process.pid
|
17
|
+
print "\n"
|
18
|
+
exec %Q{bash -c "source #{ENV['rvm_path']}/scripts/rvm; rvm #{command}"}
|
19
|
+
end
|
20
|
+
Process.waitpid(pid.to_i)
|
12
21
|
end
|
13
22
|
end
|
14
23
|
end
|
data/libs/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arsh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,11 +11,11 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-01-
|
14
|
+
date: 2012-01-18 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rb-readline
|
18
|
-
requirement: &
|
18
|
+
requirement: &6552700 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ! '>='
|
@@ -23,7 +23,7 @@ dependencies:
|
|
23
23
|
version: '0'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *6552700
|
27
27
|
description: Provides a shell that can run pure Ruby code as well as ordinary linux
|
28
28
|
commands.
|
29
29
|
email:
|