ru2 2.3.0 → 2.3.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.
- checksums.yaml +4 -4
- data/gemfiles/activesupport_3.gemfile.lock +1 -1
- data/gemfiles/activesupport_4.gemfile.lock +1 -1
- data/gemfiles/activesupport_5.gemfile.lock +1 -1
- data/lib/ru.rb +0 -2
- data/lib/ru/option_printer.rb +2 -1
- data/lib/ru/process.rb +10 -3
- data/lib/ru/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bf8b7e55213af2a3730866b3d572d3268eab750
|
4
|
+
data.tar.gz: c858b907bfceb9f97a705eee4c572a764bd7ee55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd8136cbc35266aeee002efb7728e9ff4b62a00e987c08550540f1677f3500c1b3ae10aa27ce6d5128836cc1b9bc1fbadf7d2f13c894f7e8bdf24c3f39f6d595
|
7
|
+
data.tar.gz: 7776259585c4a6a54b484711649d92327dd9761dcfd663a2930a44924a11583cb58344ee7640071f81bbbdb9d14555e768229dd1e4489089d12c6c8b02bd9da7
|
data/lib/ru.rb
CHANGED
data/lib/ru/option_printer.rb
CHANGED
data/lib/ru/process.rb
CHANGED
@@ -14,7 +14,7 @@ module Ru
|
|
14
14
|
args = ARGV.dup
|
15
15
|
@code = args.shift
|
16
16
|
|
17
|
-
if @code.
|
17
|
+
if @code.empty?
|
18
18
|
$stderr.puts @option_printer.run(:help)
|
19
19
|
return
|
20
20
|
end
|
@@ -43,7 +43,13 @@ module Ru
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
|
46
|
+
begin
|
47
|
+
output = context.instance_eval(@parsed[:code])
|
48
|
+
rescue NoMethodError
|
49
|
+
require 'active_support/all'
|
50
|
+
|
51
|
+
output = context.instance_eval(@parsed[:code])
|
52
|
+
end
|
47
53
|
output = @stdin if output == nil
|
48
54
|
|
49
55
|
prepare_output(output)
|
@@ -58,6 +64,7 @@ module Ru
|
|
58
64
|
elsif code.start_with?('=')
|
59
65
|
{ code: code[1..-1], get_stdin: false }
|
60
66
|
elsif code.start_with?('!')
|
67
|
+
require 'active_support/deprecation'
|
61
68
|
ActiveSupport::Deprecation.warn %('!1+2' syntax is going to be replaced with '=1+2')
|
62
69
|
{ code: code[1..-1], get_stdin: false }
|
63
70
|
else
|
@@ -108,7 +115,7 @@ module Ru
|
|
108
115
|
end
|
109
116
|
|
110
117
|
def get_stdin(paths, stream)
|
111
|
-
if paths.
|
118
|
+
if ! paths.empty?
|
112
119
|
if stream
|
113
120
|
::File.open(paths[0])
|
114
121
|
else
|
data/lib/ru/version.rb
CHANGED