mysh 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mysh.rb +3 -1
- data/lib/mysh/ruby.rb +19 -0
- data/lib/mysh/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 973ad7ac6161666570edbe049641311b8a8aebb0
|
4
|
+
data.tar.gz: a50607c5c035a75982e4bf0764d7eee6c2873c7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1633cd65d32d85839f07377ecc68c1f230449ba2ef04b41ae36120663e9c6b2bf9ea91b6232f7d4a4808a6f3deee72b770ebc90c358c72392a65ceffe9b1a863
|
7
|
+
data.tar.gz: 6c7c7c861c5da613eac8382a6f2754fdd05a0c6b50fdbfe56076956b7a85639a360876f0ab75809ebda6162ea7e58696bb5cf6fa988d7d35bd20dcf521fa0cb4
|
data/lib/mysh.rb
CHANGED
@@ -11,8 +11,9 @@ require 'mini_readline'
|
|
11
11
|
require 'vls'
|
12
12
|
|
13
13
|
require_relative 'mysh/smart_source'
|
14
|
-
require_relative 'mysh/internal'
|
15
14
|
require_relative 'mysh/expression'
|
15
|
+
require_relative 'mysh/internal'
|
16
|
+
require_relative 'mysh/ruby'
|
16
17
|
require_relative 'mysh/version'
|
17
18
|
|
18
19
|
#The MY SHell module. A container for its functionality.
|
@@ -35,6 +36,7 @@ module Mysh
|
|
35
36
|
begin
|
36
37
|
@exec_host.execute(input) ||
|
37
38
|
InternalCommand.execute(input) ||
|
39
|
+
ruby_execute(input) ||
|
38
40
|
system(input)
|
39
41
|
rescue Interrupt => err
|
40
42
|
puts err
|
data/lib/mysh/ruby.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
module Mysh
|
4
|
+
|
5
|
+
#Try to execute as a Ruby program.
|
6
|
+
def self.ruby_execute(str)
|
7
|
+
if File.extname(str.chomp) == '.rb'
|
8
|
+
new_command = "ruby #{str}"
|
9
|
+
|
10
|
+
puts "=> #{new_command}"
|
11
|
+
puts
|
12
|
+
|
13
|
+
system(new_command)
|
14
|
+
:ruby_exec
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
data/lib/mysh/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mysh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Camilleri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -150,6 +150,7 @@ files:
|
|
150
150
|
- lib/mysh/internal/instance.rb
|
151
151
|
- lib/mysh/internal/klass.rb
|
152
152
|
- lib/mysh/internal/parse.rb
|
153
|
+
- lib/mysh/ruby.rb
|
153
154
|
- lib/mysh/smart_source.rb
|
154
155
|
- lib/mysh/version.rb
|
155
156
|
- mysh.gemspec
|