rprogram 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/Manifest.txt +1 -0
- data/README.txt +5 -4
- data/Rakefile +2 -6
- data/lib/rprogram/option_list.rb +10 -0
- data/lib/rprogram/program.rb +5 -0
- data/lib/rprogram/rprogram.rb +17 -0
- data/lib/rprogram/version.rb +1 -1
- metadata +55 -45
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/README.txt
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
RProgram
|
2
|
-
|
3
|
-
|
1
|
+
= RProgram
|
2
|
+
|
3
|
+
* http://rprogram.rubyforge.org/
|
4
|
+
* Postmodern (postmodern.mod3 at gmail.com)
|
4
5
|
|
5
6
|
== DESCRIPTION:
|
6
7
|
|
@@ -24,7 +25,7 @@ system.
|
|
24
25
|
|
25
26
|
The MIT License
|
26
27
|
|
27
|
-
Copyright (c) 2007-
|
28
|
+
Copyright (c) 2007-2009 Hal Brodigan
|
28
29
|
|
29
30
|
Permission is hereby granted, free of charge, to any person obtaining
|
30
31
|
a copy of this software and associated documentation files (the
|
data/Rakefile
CHANGED
@@ -6,12 +6,8 @@ require './lib/rprogram/version.rb'
|
|
6
6
|
|
7
7
|
Hoe.new('rprogram', RProgram::VERSION) do |p|
|
8
8
|
p.rubyforge_name = 'rprogram'
|
9
|
-
p.
|
10
|
-
p.
|
11
|
-
p.summary = 'RProgram is a library for creating Rubyful wrappers around command-line programs'
|
12
|
-
p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n")
|
13
|
-
p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
|
14
|
-
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
|
9
|
+
p.developer('Postmodern', 'postmodern.mod3@gmail.com')
|
10
|
+
p.remote_rdoc_dir = ''
|
15
11
|
end
|
16
12
|
|
17
13
|
# vim: syntax=Ruby
|
data/lib/rprogram/option_list.rb
CHANGED
@@ -3,12 +3,22 @@ require 'rprogram/extensions/hash'
|
|
3
3
|
module RProgram
|
4
4
|
class OptionList < Hash
|
5
5
|
|
6
|
+
#
|
7
|
+
# Creates a new OptionList object with the given _options_.
|
8
|
+
#
|
6
9
|
def initialize(options={})
|
7
10
|
super(options)
|
8
11
|
end
|
9
12
|
|
10
13
|
protected
|
11
14
|
|
15
|
+
#
|
16
|
+
# Provides transparent access to the options within the option list.
|
17
|
+
#
|
18
|
+
# opt_list = OptionList.new(:name => 'test')
|
19
|
+
# opt_list.name
|
20
|
+
# # => "test"
|
21
|
+
#
|
12
22
|
def method_missing(sym,*args,&block)
|
13
23
|
name = sym.to_s
|
14
24
|
|
data/lib/rprogram/program.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'rprogram/rprogram'
|
1
2
|
require 'rprogram/compat'
|
2
3
|
require 'rprogram/task'
|
3
4
|
require 'rprogram/nameable'
|
@@ -97,6 +98,10 @@ module RProgram
|
|
97
98
|
def run(*args)
|
98
99
|
args = args.map { |arg| arg.to_s }
|
99
100
|
|
101
|
+
if RProgram.debug
|
102
|
+
$stderr << ">>> #{@path} #{args.join(' ')}\n"
|
103
|
+
end
|
104
|
+
|
100
105
|
Open3.popen3(@path,*args) do |stdin,stdout,stderr|
|
101
106
|
return stdout.readlines
|
102
107
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module RProgram
|
2
|
+
#
|
3
|
+
# Returns +true+ if RProgram debugging messages are enabled, returns
|
4
|
+
# +false+ if they are not enabled.
|
5
|
+
#
|
6
|
+
def RProgram.debug
|
7
|
+
@@debug ||= false
|
8
|
+
end
|
9
|
+
|
10
|
+
#
|
11
|
+
# Enables or disables RProgram debugging messages depending on the
|
12
|
+
# specified _value_.
|
13
|
+
#
|
14
|
+
def RProgram.debug=(value)
|
15
|
+
@@debug = value
|
16
|
+
end
|
17
|
+
end
|
data/lib/rprogram/version.rb
CHANGED
metadata
CHANGED
@@ -1,33 +1,38 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.4
|
3
|
-
specification_version: 1
|
4
2
|
name: rprogram
|
5
3
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.1.
|
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:
|
4
|
+
version: 0.1.4
|
25
5
|
platform: ruby
|
26
|
-
signing_key:
|
27
|
-
cert_chain:
|
28
|
-
post_install_message:
|
29
6
|
authors:
|
30
|
-
- Postmodern
|
7
|
+
- Postmodern
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-01-07 00:00:00 -08:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: hoe
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.8.2
|
24
|
+
version:
|
25
|
+
description: RProgram is a library for creating wrappers around command-line programs. RProgram provides a Rubyful interface to programs and all their options or non-options. RProgram can also search for programs installed on a system.
|
26
|
+
email:
|
27
|
+
- postmodern.mod3@gmail.com
|
28
|
+
executables: []
|
29
|
+
|
30
|
+
extensions: []
|
31
|
+
|
32
|
+
extra_rdoc_files:
|
33
|
+
- History.txt
|
34
|
+
- Manifest.txt
|
35
|
+
- README.txt
|
31
36
|
files:
|
32
37
|
- History.txt
|
33
38
|
- Manifest.txt
|
@@ -50,29 +55,34 @@ files:
|
|
50
55
|
- lib/rprogram/task.rb
|
51
56
|
- lib/rprogram/nameable.rb
|
52
57
|
- lib/rprogram/program.rb
|
58
|
+
- lib/rprogram/rprogram.rb
|
53
59
|
- test/test_rprogram.rb
|
54
|
-
|
55
|
-
|
60
|
+
has_rdoc: true
|
61
|
+
homepage: http://rprogram.rubyforge.org/
|
62
|
+
post_install_message:
|
56
63
|
rdoc_options:
|
57
64
|
- --main
|
58
65
|
- README.txt
|
59
|
-
|
60
|
-
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: "0"
|
73
|
+
version:
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: "0"
|
79
|
+
version:
|
67
80
|
requirements: []
|
68
81
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: 1.4.0
|
78
|
-
version:
|
82
|
+
rubyforge_project: rprogram
|
83
|
+
rubygems_version: 1.3.1
|
84
|
+
signing_key:
|
85
|
+
specification_version: 2
|
86
|
+
summary: RProgram is a library for creating wrappers around command-line programs
|
87
|
+
test_files:
|
88
|
+
- test/test_rprogram.rb
|