automateit 0.70923 → 0.70928
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.tar.gz.sig +0 -0
- data/CHANGES.txt +9 -0
- data/Rakefile +22 -4
- data/TODO.txt +0 -2
- data/TUTORIAL.txt +1 -0
- data/bin/aifield +7 -3
- data/bin/aitag +11 -5
- data/bin/automateit +15 -5
- data/examples/basic/recipes/install.rb +35 -27
- data/lib/automateit.rb +1 -0
- data/lib/automateit/cli.rb +7 -2
- data/lib/automateit/constants.rb +0 -3
- data/lib/automateit/download_manager.rb +46 -0
- data/lib/automateit/edit_manager.rb +32 -9
- data/lib/automateit/interpreter.rb +7 -3
- data/lib/automateit/plugin/manager.rb +2 -6
- data/lib/automateit/root.rb +3 -0
- data/lib/automateit/shell_manager.rb +45 -2
- data/lib/automateit/shell_manager/base_link.rb +1 -1
- data/lib/automateit/shell_manager/portable.rb +41 -13
- data/lib/automateit/tag_manager.rb +67 -3
- data/lib/tempster.rb +27 -16
- data/spec/integration/download_spec.rb +44 -0
- data/spec/integration/edit_manager_spec.rb +52 -0
- data/spec/integration/shell_manager_spec.rb +145 -18
- data/spec/integration/template_manager_erb_spec.rb +18 -1
- data/spec/integration/tempster_spec.rb +65 -0
- data/spec/unit/edit_manager_spec.rb +49 -5
- data/spec/unit/plugins_spec.rb +40 -4
- metadata +9 -2
- metadata.gz.sig +0 -0
data/spec/unit/plugins_spec.rb
CHANGED
@@ -50,7 +50,8 @@ class MyManager::MyFirstDriver < MyManager::BaseDriver
|
|
50
50
|
def suitability(method, *args)
|
51
51
|
case method
|
52
52
|
when :mymethod
|
53
|
-
|
53
|
+
value = args.first ? args.first[:one] : nil
|
54
|
+
return value == 1 ? 10 : 0
|
54
55
|
else
|
55
56
|
return -1
|
56
57
|
end
|
@@ -69,7 +70,8 @@ class MyManager::MySecondDriver < MyManager::BaseDriver
|
|
69
70
|
def suitability(method, *args)
|
70
71
|
case method
|
71
72
|
when :mymethod
|
72
|
-
|
73
|
+
value = args.first ? args.first[:one] : nil
|
74
|
+
return value == 1 ? 5 : 0
|
73
75
|
else
|
74
76
|
return -1
|
75
77
|
end
|
@@ -112,6 +114,14 @@ describe "MyManager" do
|
|
112
114
|
@m = MyManager.new
|
113
115
|
end
|
114
116
|
|
117
|
+
it "should have a class token" do
|
118
|
+
MyManager.token.should == :my_manager
|
119
|
+
end
|
120
|
+
|
121
|
+
it "should have an instance token" do
|
122
|
+
@m.token.should == :my_manager
|
123
|
+
end
|
124
|
+
|
115
125
|
it "should have drivers" do
|
116
126
|
for driver in [MyManager::MyUnsuitableDriver, MyManager::MyFirstDriver, MyManager::MySecondDriver]
|
117
127
|
@m.class.driver_classes.should include(driver)
|
@@ -146,7 +156,7 @@ describe "MyManager" do
|
|
146
156
|
end
|
147
157
|
|
148
158
|
describe "MyManager's drivers" do
|
149
|
-
before(:
|
159
|
+
before(:each) do
|
150
160
|
@m = MyManager.new
|
151
161
|
end
|
152
162
|
|
@@ -186,6 +196,18 @@ describe "MyManager's drivers" do
|
|
186
196
|
lambda { @m.driver_for(:mymethod, :one => 9) }.should raise_error(NotImplementedError)
|
187
197
|
end
|
188
198
|
|
199
|
+
it "should claim availability for suitable method" do
|
200
|
+
@m.available?(:mymethod, :one => 1).should be_true
|
201
|
+
end
|
202
|
+
|
203
|
+
it "should not claim availability of unsuitable method" do
|
204
|
+
@m.available?(:mymethod, :one => 9).should be_false
|
205
|
+
end
|
206
|
+
|
207
|
+
it "should not claim availability of non-existent method" do
|
208
|
+
@m.available?(:asdf).should be_false
|
209
|
+
end
|
210
|
+
|
189
211
|
it "should dispatch_to suitable driver" do
|
190
212
|
@m.dispatch_to(:mymethod, :one => 1).should == 1
|
191
213
|
@m.mymethod(:one => 1).should == 1
|
@@ -196,12 +218,26 @@ describe "MyManager's drivers" do
|
|
196
218
|
lambda { @m.mymethod(:one => 9) }.should raise_error(NotImplementedError)
|
197
219
|
end
|
198
220
|
|
199
|
-
it "should dispatch_to
|
221
|
+
it "should dispatch_to default driver regardless of suitability" do
|
200
222
|
@m.default(:my_unimplemented_driver)
|
201
223
|
lambda { @m.dispatch_to(:mymethod, :one => 1) }.should raise_error(NoMethodError)
|
202
224
|
lambda { @m.mymethod(:one => 1) }.should raise_error(NoMethodError)
|
203
225
|
end
|
204
226
|
|
227
|
+
it "should dispatch_to default= driver regardless of suitability" do
|
228
|
+
@m.default = :my_unimplemented_driver
|
229
|
+
lambda { @m.dispatch_to(:mymethod, :one => 1) }.should raise_error(NoMethodError)
|
230
|
+
lambda { @m.mymethod(:one => 1) }.should raise_error(NoMethodError)
|
231
|
+
end
|
232
|
+
|
233
|
+
it "should dispatch to a driver using :with option" do
|
234
|
+
@m.mymethod(:one => 1, :with => :my_first_driver).should == 1
|
235
|
+
end
|
236
|
+
|
237
|
+
it "should dispatch safely to non-suitable drivers" do
|
238
|
+
@m.dispatch_safely_to(:asdf).should be_nil
|
239
|
+
end
|
240
|
+
|
205
241
|
it "should have an interpreter instance" do
|
206
242
|
MyManager::MyFirstDriver.new.interpreter.should be_a_kind_of(AutomateIt::Interpreter)
|
207
243
|
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: automateit
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: "0.
|
7
|
-
date: 2007-09-
|
6
|
+
version: "0.70928"
|
7
|
+
date: 2007-09-29 00:00:00 -07:00
|
8
8
|
summary: AutomateIt is an open-source tool for automating the setup and maintenance of UNIX-like systems
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -102,6 +102,7 @@ files:
|
|
102
102
|
- lib/automateit/root.rb
|
103
103
|
- lib/automateit/project.rb
|
104
104
|
- lib/automateit/error.rb
|
105
|
+
- lib/automateit/download_manager.rb
|
105
106
|
- lib/automateit/plugin/base.rb
|
106
107
|
- lib/automateit/plugin/driver.rb
|
107
108
|
- lib/automateit/plugin/manager.rb
|
@@ -158,12 +159,15 @@ files:
|
|
158
159
|
- spec/integration/package_manager_spec.rb
|
159
160
|
- spec/integration/address_manager_linux_spec.rb
|
160
161
|
- spec/integration/platform_manager_spec.rb
|
162
|
+
- spec/integration/edit_manager_spec.rb
|
161
163
|
- spec/integration/shell_manager_spec.rb
|
162
164
|
- spec/integration/account_manager_spec.rb
|
163
165
|
- spec/integration/examples_spec.rb
|
164
166
|
- spec/integration/cli_spec.rb
|
165
167
|
- spec/integration/address_manager_portable_spec.rb
|
168
|
+
- spec/integration/tempster_spec.rb
|
166
169
|
- spec/integration/examples_spec_editor.rb
|
170
|
+
- spec/integration/download_spec.rb
|
167
171
|
- spec/extras/scratch.rb
|
168
172
|
- spec/extras/automateit_service_sysv_test
|
169
173
|
- spec/extras/simple_recipe.rb
|
@@ -185,12 +189,15 @@ test_files:
|
|
185
189
|
- spec/integration/package_manager_spec.rb
|
186
190
|
- spec/integration/address_manager_linux_spec.rb
|
187
191
|
- spec/integration/platform_manager_spec.rb
|
192
|
+
- spec/integration/edit_manager_spec.rb
|
188
193
|
- spec/integration/shell_manager_spec.rb
|
189
194
|
- spec/integration/account_manager_spec.rb
|
190
195
|
- spec/integration/examples_spec.rb
|
191
196
|
- spec/integration/cli_spec.rb
|
192
197
|
- spec/integration/address_manager_portable_spec.rb
|
198
|
+
- spec/integration/tempster_spec.rb
|
193
199
|
- spec/integration/examples_spec_editor.rb
|
200
|
+
- spec/integration/download_spec.rb
|
194
201
|
- spec/extras/scratch.rb
|
195
202
|
- spec/extras/automateit_service_sysv_test
|
196
203
|
- spec/extras/simple_recipe.rb
|
metadata.gz.sig
CHANGED
Binary file
|