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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 828ee0a66f1bb5ca97672511c524b698f68ed19b
4
- data.tar.gz: 413ae8403c09cc03f279481b0d7d9b20c389548e
3
+ metadata.gz: 973ad7ac6161666570edbe049641311b8a8aebb0
4
+ data.tar.gz: a50607c5c035a75982e4bf0764d7eee6c2873c7c
5
5
  SHA512:
6
- metadata.gz: 180b7d137796638361cd2c016d33a00d1a4b1e8cb28ea76eecdad0daf3bcf842860ffe45b9c56a2b13b7c108d1f8566f66278f055dfad37c544b6ef860abc226
7
- data.tar.gz: 1e497e09e730eb98f115831e897903e75e67a1696c5b4596f345f10b5919f9eb6905fcdc1786e1d691dd725d35f7ce19a74fe0c0b11ce727be32d245870079ef
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Mysh
4
4
  #The version string of MY SHell.
5
- VERSION = "0.1.5"
5
+ VERSION = "0.1.6"
6
6
 
7
7
  #A brief summary of this gem.
8
8
  SUMMARY = "mysh -- a Ruby inspired command shell"
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.5
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-07 00:00:00.000000000 Z
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