patir 0.5.0 → 0.5.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.
- data/History.txt +3 -0
- data/README.txt +0 -1
- data/docu/index.html +9 -0
- data/docu/patir05.html +2 -2
- data/lib/patir/base.rb +1 -1
- data/lib/patir/command.rb +7 -6
- data/test/test_patir_command.rb +13 -1
- metadata +63 -56
data/History.txt
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
== 0.5.1 / 2008-02-26
|
2
|
+
* A couple more unit tests
|
3
|
+
* bugfix: command working directories are now fully expanded to avoid invalid nested chdir calls
|
1
4
|
== 0.5.0 / 2007-07-13
|
2
5
|
* setup_logger now accepts both Logger levels and :mute, :silent, :debug
|
3
6
|
* 3 part version number. Version module with MAJOR, MINOR and TINY
|
data/README.txt
CHANGED
@@ -15,7 +15,6 @@ patir provides the libraries common to all the project automation tools included
|
|
15
15
|
patir is the library of common functionality used in the patir projects.
|
16
16
|
This includes a class that allows you to build configuration files in Ruby and a library for command abstraction.
|
17
17
|
|
18
|
-
|
19
18
|
== REQUIREMENTS:
|
20
19
|
|
21
20
|
* systemu
|
data/docu/index.html
CHANGED
@@ -45,6 +45,15 @@
|
|
45
45
|
<div id="leftpanel">
|
46
46
|
<div align="justify" class="graypanel">
|
47
47
|
<span class="smalltitle">News</span><br /><br />
|
48
|
+
<span class="smallredtext">26 Februar 2008</span><br />
|
49
|
+
<span class="bodytext">patir v0.5.1 is out!</span><br />
|
50
|
+
<a href="patir051.html" class="smallgraytext">More...</a><br /><br />
|
51
|
+
<span class="smallredtext">05 December 2007</span><br />
|
52
|
+
<span class="bodytext">rutema v0.4.2 is out!.</span><br />
|
53
|
+
<a href="rutema041.html" class="smallgraytext">More...</a><br /><br />
|
54
|
+
<span class="smallredtext">04 December 2007</span><br />
|
55
|
+
<span class="bodytext">rutema v0.4.1 is out!.</span><br />
|
56
|
+
<a href="rutema041.html" class="smallgraytext">More...</a><br /><br />
|
48
57
|
<span class="smallredtext">15 August 2007</span><br />
|
49
58
|
<span class="bodytext">patir v0.5 is out!</span><br />
|
50
59
|
<a href="patir05.html" class="smallgraytext">More...</a><br /><br />
|
data/docu/patir05.html
CHANGED
@@ -30,9 +30,9 @@
|
|
30
30
|
</div>
|
31
31
|
|
32
32
|
<div class="bodytext" style="padding:12px;" align="justify">
|
33
|
-
<p>Patir 0.5 has been released!
|
33
|
+
<p>Patir 0.5.0 has been released!
|
34
34
|
</p><p>
|
35
|
-
0.5 is a maintenance release that improves slightly the setup_logger method (based on the assumption that we don't want to remove functinality people are familiar with) and cleans up a bit the versioning front (there is now a Version module to comply with gem conventions)
|
35
|
+
0.5.0 is a maintenance release that improves slightly the setup_logger method (based on the assumption that we don't want to remove functinality people are familiar with) and cleans up a bit the versioning front (there is now a Version module to comply with gem conventions and version numbers have now 3 parts)
|
36
36
|
</p><p>
|
37
37
|
Take a look at the <a href="rdoc/index.html">rdoc</a> for the library.<br>
|
38
38
|
And since you're going to want to play with it...just do a
|
data/lib/patir/base.rb
CHANGED
data/lib/patir/command.rb
CHANGED
@@ -117,7 +117,7 @@ module Patir
|
|
117
117
|
params=args[0] if args
|
118
118
|
raise ParameterException,"No ShellCommand parameters defined" unless params
|
119
119
|
@name=params[:name]
|
120
|
-
@working_directory=params[:working_directory]
|
120
|
+
@working_directory=File.expand_path(params[:working_directory])
|
121
121
|
#initialize the working directory value. This actually means ./
|
122
122
|
@working_directory||="."
|
123
123
|
#we need a command line :)
|
@@ -456,7 +456,8 @@ module Patir
|
|
456
456
|
include Patir::Command
|
457
457
|
def initialize name,working_directory=nil,&block
|
458
458
|
@name=name
|
459
|
-
@working_directory=working_directory
|
459
|
+
@working_directory=File.expand_path(working_directory)
|
460
|
+
@working_directory||=Dir.pwd
|
460
461
|
if block_given?
|
461
462
|
@cmd=block
|
462
463
|
else
|
@@ -466,11 +467,11 @@ module Patir
|
|
466
467
|
#Runs the associated block
|
467
468
|
def run
|
468
469
|
@run=true
|
469
|
-
prev_dir=Dir.pwd
|
470
470
|
begin
|
471
|
-
Dir.chdir(@working_directory)
|
472
|
-
|
473
|
-
|
471
|
+
Dir.chdir(@working_directory) do
|
472
|
+
t1=Time.now
|
473
|
+
@status=@cmd.call(self)
|
474
|
+
end
|
474
475
|
@exec_time=Time.now-t1
|
475
476
|
rescue SystemCallError
|
476
477
|
@output="#{$!}"
|
data/test/test_patir_command.rb
CHANGED
@@ -95,7 +95,19 @@ class TestShellCommand<Test::Unit::TestCase
|
|
95
95
|
def test_missing_params
|
96
96
|
assert_raise(ParameterException){cmd=ShellCommand.new()}
|
97
97
|
end
|
98
|
-
|
98
|
+
#test with another program
|
99
|
+
def test_ls
|
100
|
+
cmd=ShellCommand.new(:cmd=>"ls")
|
101
|
+
assert(!cmd.run?)
|
102
|
+
assert(!cmd.success?)
|
103
|
+
assert_nothing_raised(){cmd.run}
|
104
|
+
assert(cmd.run?)
|
105
|
+
if cmd.success?
|
106
|
+
assert_not_equal("", cmd.output)
|
107
|
+
else
|
108
|
+
assert_not_equal("", cmd.error)
|
109
|
+
end
|
110
|
+
end
|
99
111
|
end
|
100
112
|
|
101
113
|
class TestCommandSequence<Test::Unit::TestCase
|
metadata
CHANGED
@@ -1,33 +1,46 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.1
|
3
|
-
specification_version: 1
|
4
2
|
name: patir
|
5
3
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.5.
|
7
|
-
date: 2007-08-15 00:00:00 +02:00
|
8
|
-
summary: patir (Project Automation Tools in Ruby) provides libraries for use in automation tools
|
9
|
-
require_paths:
|
10
|
-
- lib
|
11
|
-
email: riva@braveworld.net
|
12
|
-
homepage: http://patir.rubyforge.org
|
13
|
-
rubyforge_project: patir
|
14
|
-
description: "== SYNOPSIS: patir is the library of common functionality used in the patir projects. This includes a class that allows you to build configuration files in Ruby and a library for command abstraction. == REQUIREMENTS: * systemu"
|
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.5.1
|
25
5
|
platform: ruby
|
26
|
-
signing_key:
|
27
|
-
cert_chain:
|
28
|
-
post_install_message:
|
29
6
|
authors:
|
30
7
|
- Vassilis Rizopoulos
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-02-26 00:00:00 +01:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: systemu
|
17
|
+
version_requirement:
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: "0"
|
23
|
+
version:
|
24
|
+
- !ruby/object:Gem::Dependency
|
25
|
+
name: hoe
|
26
|
+
version_requirement:
|
27
|
+
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
requirements:
|
29
|
+
- - ">="
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: 1.5.0
|
32
|
+
version:
|
33
|
+
description: "== SYNOPSIS: patir is the library of common functionality used in the patir projects. This includes a class that allows you to build configuration files in Ruby and a library for command abstraction. == REQUIREMENTS: * systemu"
|
34
|
+
email: riva@braveworld.net
|
35
|
+
executables: []
|
36
|
+
|
37
|
+
extensions: []
|
38
|
+
|
39
|
+
extra_rdoc_files:
|
40
|
+
- History.txt
|
41
|
+
- Manifest.txt
|
42
|
+
- README.txt
|
43
|
+
- COPYING.txt
|
31
44
|
files:
|
32
45
|
- History.txt
|
33
46
|
- Manifest.txt
|
@@ -60,40 +73,34 @@ files:
|
|
60
73
|
- docu/rw-run.png
|
61
74
|
- docu/rw-scenario.png
|
62
75
|
- docu/screenshots.html
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
- test/test_patir_configuration.rb
|
76
|
+
has_rdoc: true
|
77
|
+
homepage: http://patir.rubyforge.org
|
78
|
+
post_install_message:
|
67
79
|
rdoc_options:
|
68
80
|
- --main
|
69
81
|
- README.txt
|
70
|
-
|
71
|
-
-
|
72
|
-
|
73
|
-
|
74
|
-
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
82
|
+
require_paths:
|
83
|
+
- lib
|
84
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: "0"
|
89
|
+
version:
|
90
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: "0"
|
95
|
+
version:
|
79
96
|
requirements: []
|
80
97
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
version:
|
91
|
-
- !ruby/object:Gem::Dependency
|
92
|
-
name: hoe
|
93
|
-
version_requirement:
|
94
|
-
version_requirements: !ruby/object:Gem::Version::Requirement
|
95
|
-
requirements:
|
96
|
-
- - ">="
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
version: 1.2.1
|
99
|
-
version:
|
98
|
+
rubyforge_project: patir
|
99
|
+
rubygems_version: 1.0.1
|
100
|
+
signing_key:
|
101
|
+
specification_version: 2
|
102
|
+
summary: patir (Project Automation Tools in Ruby) provides libraries for use in automation tools
|
103
|
+
test_files:
|
104
|
+
- test/test_patir_base.rb
|
105
|
+
- test/test_patir_command.rb
|
106
|
+
- test/test_patir_configuration.rb
|