rprogram 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +9 -0
- data/lib/rprogram/program.rb +10 -10
- data/lib/rprogram/version.rb +1 -1
- metadata +44 -51
data/History.txt
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
== 0.1.3 / 2008-01-27
|
2
|
+
|
3
|
+
* Renamed <tt>Program.create_from_path</tt> to
|
4
|
+
<tt>Program.find_with_path</tt>.
|
5
|
+
* Renamed <tt>Program.create_from_paths</tt> to
|
6
|
+
<tt>Program.find_with_paths</tt>.
|
7
|
+
* Renamed <tt>Program.create</tt> to <tt>Program.find</tt>.
|
8
|
+
* Renamed <tt>Program.run_with_task</tt> to <tt>Program.run_task</tt>.
|
9
|
+
|
1
10
|
== 0.1.2 / 2008-01-18
|
2
11
|
|
3
12
|
* DRY'ed up lib/rprogram/task.
|
data/lib/rprogram/program.rb
CHANGED
@@ -41,11 +41,11 @@ module RProgram
|
|
41
41
|
# is a valid file. Any given _args_ or a given _block_ will be used
|
42
42
|
# in creating the new program.
|
43
43
|
#
|
44
|
-
# Program.
|
44
|
+
# Program.find_with_path('/bin/cd') # => Program
|
45
45
|
#
|
46
|
-
# Program.
|
46
|
+
# Program.find_with_path('/obviously/fake') # => nil
|
47
47
|
#
|
48
|
-
def self.
|
48
|
+
def self.find_with_path(path,*args,&block)
|
49
49
|
return self.new(path,*args,&block) if File.file?(path)
|
50
50
|
end
|
51
51
|
|
@@ -54,11 +54,11 @@ module RProgram
|
|
54
54
|
# if a path within _paths_ is a valid file. Any given _args_ or
|
55
55
|
# a given _block_ will be used in creating the new program.
|
56
56
|
#
|
57
|
-
# Program.
|
57
|
+
# Program.find_with_paths(['/bin/cd','/usr/bin/cd']) # => Program
|
58
58
|
#
|
59
|
-
# Program.
|
59
|
+
# Program.find_with_paths(['/obviously/fake','/bla']) # => nil
|
60
60
|
#
|
61
|
-
def self.
|
61
|
+
def self.find_with_paths(paths,*args,&block)
|
62
62
|
paths.each do |path|
|
63
63
|
return self.new(path,*args,&block) if File.file?(path)
|
64
64
|
end
|
@@ -70,13 +70,13 @@ module RProgram
|
|
70
70
|
# +program_names+, a ProramNotFound exception will be raised. Any given
|
71
71
|
# _args_ or a given _block_ will be used in creating the new program.
|
72
72
|
#
|
73
|
-
# Program.
|
73
|
+
# Program.find # => Program
|
74
74
|
#
|
75
|
-
# MyProgram.
|
75
|
+
# MyProgram.find('stuff','here') do |prog|
|
76
76
|
# ...
|
77
77
|
# end
|
78
78
|
#
|
79
|
-
def self.
|
79
|
+
def self.find(*args,&block)
|
80
80
|
path = Compat.find_program_by_names(program_names)
|
81
81
|
unless path
|
82
82
|
names = program_names.map { |name| name.dump }.join(', ')
|
@@ -105,7 +105,7 @@ module RProgram
|
|
105
105
|
#
|
106
106
|
# Runs the program with the specified _task_ object.
|
107
107
|
#
|
108
|
-
def
|
108
|
+
def run_task(task)
|
109
109
|
run(*(task.arguments))
|
110
110
|
end
|
111
111
|
|
data/lib/rprogram/version.rb
CHANGED
metadata
CHANGED
@@ -1,36 +1,33 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.9.4
|
3
|
+
specification_version: 1
|
2
4
|
name: rprogram
|
3
5
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
6
|
+
version: 0.1.3
|
7
|
+
date: 2008-01-27 00:00:00 -08:00
|
8
|
+
summary: RProgram is a library for creating Rubyful wrappers around command-line programs
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email: postmodern.mod3@gmail.com
|
12
|
+
homepage: " by Postmodern Modulus III"
|
13
|
+
rubyforge_project: rprogram
|
14
|
+
description: "== FEATURES/PROBLEMS: * Provides cross-platform access to the PATH variable. * Supports leading/tailing non-options. * Supports long-options and short-options. * Supports custom formating of options. == INSTALL: $ sudo gem install rprogram == LICENSE:"
|
15
|
+
autorequire:
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: true
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
24
|
+
version:
|
5
25
|
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
6
29
|
authors:
|
7
30
|
- Postmodern Modulus III
|
8
|
-
autorequire:
|
9
|
-
bindir: bin
|
10
|
-
cert_chain: []
|
11
|
-
|
12
|
-
date: 2008-01-18 00:00:00 -08:00
|
13
|
-
default_executable:
|
14
|
-
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
16
|
-
name: hoe
|
17
|
-
version_requirement:
|
18
|
-
version_requirements: !ruby/object:Gem::Requirement
|
19
|
-
requirements:
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 1.4.0
|
23
|
-
version:
|
24
|
-
description: "== FEATURES/PROBLEMS: * Provides cross-platform access to the PATH variable. * Supports leading/tailing non-options. * Supports long-options and short-options. * Supports custom formating of options. == INSTALL: $ sudo gem install rprogram == LICENSE:"
|
25
|
-
email: postmodern.mod3@gmail.com
|
26
|
-
executables: []
|
27
|
-
|
28
|
-
extensions: []
|
29
|
-
|
30
|
-
extra_rdoc_files:
|
31
|
-
- History.txt
|
32
|
-
- Manifest.txt
|
33
|
-
- README.txt
|
34
31
|
files:
|
35
32
|
- History.txt
|
36
33
|
- Manifest.txt
|
@@ -54,32 +51,28 @@ files:
|
|
54
51
|
- lib/rprogram/nameable.rb
|
55
52
|
- lib/rprogram/program.rb
|
56
53
|
- test/test_rprogram.rb
|
57
|
-
|
58
|
-
|
59
|
-
post_install_message:
|
54
|
+
test_files:
|
55
|
+
- test/test_rprogram.rb
|
60
56
|
rdoc_options:
|
61
57
|
- --main
|
62
58
|
- README.txt
|
63
|
-
|
64
|
-
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: "0"
|
76
|
-
version:
|
59
|
+
extra_rdoc_files:
|
60
|
+
- History.txt
|
61
|
+
- Manifest.txt
|
62
|
+
- README.txt
|
63
|
+
executables: []
|
64
|
+
|
65
|
+
extensions: []
|
66
|
+
|
77
67
|
requirements: []
|
78
68
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
-
|
69
|
+
dependencies:
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: hoe
|
72
|
+
version_requirement:
|
73
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 1.4.0
|
78
|
+
version:
|