rprogram 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +18 -6
- data/README.txt +2 -0
- data/lib/rprogram/non_option.rb +4 -0
- data/lib/rprogram/options.rb +3 -1
- data/lib/rprogram/program.rb +9 -9
- data/lib/rprogram/version.rb +1 -1
- metadata +2 -2
data/History.txt
CHANGED
@@ -1,9 +1,21 @@
|
|
1
|
-
|
1
|
+
=== 0.1.5 / 2009-01-14
|
2
|
+
|
3
|
+
* Use Kernel.system in RProgram::Program#run, instead of Open3.popen3:
|
4
|
+
* popen3 is not well supported on Windows.
|
5
|
+
* win32-open3 does not allow for the execution of single programs with
|
6
|
+
separate command-line arguments. Instead, it merely executes a command
|
7
|
+
string in command.com. This seems to allow arbitrary command injection
|
8
|
+
via command-line arguments.
|
9
|
+
* RProgram::Program#run will now return either +true+ or +false+,
|
10
|
+
depending on the exit status of the program.
|
11
|
+
* Added some missing documentation.
|
12
|
+
|
13
|
+
=== 0.1.4 / 2009-01-07
|
2
14
|
|
3
15
|
* Added <tt>lib/rprogram/rprogram.rb</tt> to the Manifest.
|
4
16
|
* Added more documentation.
|
5
17
|
|
6
|
-
|
18
|
+
=== 0.1.3 / 2008-01-27
|
7
19
|
|
8
20
|
* Renamed <tt>Program.create_from_path</tt> to
|
9
21
|
<tt>Program.find_with_path</tt>.
|
@@ -12,14 +24,14 @@
|
|
12
24
|
* Renamed <tt>Program.create</tt> to <tt>Program.find</tt>.
|
13
25
|
* Renamed <tt>Program.run_with_task</tt> to <tt>Program.run_task</tt>.
|
14
26
|
|
15
|
-
|
27
|
+
=== 0.1.2 / 2008-01-18
|
16
28
|
|
17
29
|
* DRY'ed up lib/rprogram/task.
|
18
30
|
* Added Task.define_option.
|
19
31
|
* Added OptionList so that Option may contain sub-options.
|
20
32
|
* Touched up documenation.
|
21
33
|
|
22
|
-
|
34
|
+
=== 0.1.1 / 2008-01-18
|
23
35
|
|
24
36
|
* Added support for the Option argument separators.
|
25
37
|
|
@@ -32,7 +44,7 @@
|
|
32
44
|
|
33
45
|
* Fixed lib/rprogram.rb file.
|
34
46
|
|
35
|
-
|
47
|
+
=== 0.1.0 / 2008-01-17
|
36
48
|
|
37
49
|
* Removed redundent methods in Program:
|
38
50
|
* Program.find_by_name
|
@@ -41,7 +53,7 @@
|
|
41
53
|
* Made Program Nameable by default.
|
42
54
|
* Prevented arbitrary command-injection in Program#run.
|
43
55
|
|
44
|
-
|
56
|
+
=== 0.0.9 / 2008-01-09
|
45
57
|
|
46
58
|
* Initial release.
|
47
59
|
* Provides cross-platform access to the PATH variable.
|
data/README.txt
CHANGED
@@ -12,6 +12,8 @@ system.
|
|
12
12
|
|
13
13
|
== FEATURES/PROBLEMS:
|
14
14
|
|
15
|
+
* Uses Kernel.system for safe execution of individual programs and their
|
16
|
+
separate command-line arguments.
|
15
17
|
* Provides cross-platform access to the PATH variable.
|
16
18
|
* Supports leading/tailing non-options.
|
17
19
|
* Supports long-options and short-options.
|
data/lib/rprogram/non_option.rb
CHANGED
data/lib/rprogram/options.rb
CHANGED
data/lib/rprogram/program.rb
CHANGED
@@ -90,21 +90,22 @@ module RProgram
|
|
90
90
|
|
91
91
|
#
|
92
92
|
# Runs the program with the specified _args_ and returns
|
93
|
-
#
|
93
|
+
# either +true+ or +false+, depending on the exit status of the
|
94
|
+
# program.
|
94
95
|
#
|
95
96
|
# echo = Program.find_by_name('echo')
|
96
|
-
# echo.run(
|
97
|
+
# echo.run('hello')
|
98
|
+
# # hello
|
99
|
+
# # => true
|
97
100
|
#
|
98
101
|
def run(*args)
|
99
102
|
args = args.map { |arg| arg.to_s }
|
100
103
|
|
101
104
|
if RProgram.debug
|
102
|
-
|
105
|
+
STDERR.puts ">>> #{@path} #{args.join(' ')}"
|
103
106
|
end
|
104
107
|
|
105
|
-
|
106
|
-
return stdout.readlines
|
107
|
-
end
|
108
|
+
return Kernel.system(@path,*args)
|
108
109
|
end
|
109
110
|
|
110
111
|
#
|
@@ -117,9 +118,8 @@ module RProgram
|
|
117
118
|
#
|
118
119
|
# Returns the path of the program.
|
119
120
|
#
|
120
|
-
#
|
121
|
-
# /usr/bin/echo
|
122
|
-
# # => nil
|
121
|
+
# Program.find_by_name('echo').to_s
|
122
|
+
# # => "/usr/bin/echo"
|
123
123
|
#
|
124
124
|
def to_s
|
125
125
|
@path.to_s
|
data/lib/rprogram/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rprogram
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Postmodern
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-01-
|
12
|
+
date: 2009-01-14 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|