sprinkle 0.4.2 → 0.5.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. data/.gitignore +8 -0
  2. data/Gemfile +5 -0
  3. data/Gemfile.lock +54 -0
  4. data/README.markdown +178 -166
  5. data/Rakefile +4 -28
  6. data/bin/sprinkle +14 -1
  7. data/lib/sprinkle.rb +5 -1
  8. data/lib/sprinkle/actors/actors.rb +20 -5
  9. data/lib/sprinkle/actors/capistrano.rb +62 -36
  10. data/lib/sprinkle/actors/dummy.rb +127 -0
  11. data/lib/sprinkle/actors/local.rb +59 -17
  12. data/lib/sprinkle/actors/ssh.rb +189 -107
  13. data/lib/sprinkle/actors/vlad.rb +51 -32
  14. data/lib/sprinkle/configurable.rb +2 -1
  15. data/lib/sprinkle/deployment.rb +22 -2
  16. data/lib/sprinkle/errors/pretty_failure.rb +41 -0
  17. data/lib/sprinkle/errors/remote_command_failure.rb +24 -0
  18. data/lib/sprinkle/errors/transfer_failure.rb +28 -0
  19. data/lib/sprinkle/installers/apt.rb +17 -16
  20. data/lib/sprinkle/installers/binary.rb +23 -8
  21. data/lib/sprinkle/installers/brew.rb +17 -10
  22. data/lib/sprinkle/installers/bsd_port.rb +10 -6
  23. data/lib/sprinkle/installers/deb.rb +3 -10
  24. data/lib/sprinkle/installers/freebsd_pkg.rb +5 -11
  25. data/lib/sprinkle/installers/freebsd_portinstall.rb +8 -2
  26. data/lib/sprinkle/installers/gem.rb +9 -3
  27. data/lib/sprinkle/installers/group.rb +28 -4
  28. data/lib/sprinkle/installers/installer.rb +58 -7
  29. data/lib/sprinkle/installers/mac_port.rb +13 -6
  30. data/lib/sprinkle/installers/npm.rb +42 -0
  31. data/lib/sprinkle/installers/openbsd_pkg.rb +4 -11
  32. data/lib/sprinkle/installers/opensolaris_pkg.rb +7 -13
  33. data/lib/sprinkle/installers/package_installer.rb +33 -0
  34. data/lib/sprinkle/installers/pacman.rb +5 -13
  35. data/lib/sprinkle/installers/pear.rb +40 -0
  36. data/lib/sprinkle/installers/push_text.rb +18 -5
  37. data/lib/sprinkle/installers/rake.rb +7 -2
  38. data/lib/sprinkle/installers/reconnect.rb +29 -0
  39. data/lib/sprinkle/installers/replace_text.rb +11 -2
  40. data/lib/sprinkle/installers/rpm.rb +8 -6
  41. data/lib/sprinkle/installers/runner.rb +41 -16
  42. data/lib/sprinkle/installers/smart.rb +6 -17
  43. data/lib/sprinkle/installers/source.rb +22 -10
  44. data/lib/sprinkle/installers/thor.rb +7 -0
  45. data/lib/sprinkle/installers/transfer.rb +62 -41
  46. data/lib/sprinkle/installers/user.rb +34 -4
  47. data/lib/sprinkle/installers/yum.rb +10 -10
  48. data/lib/sprinkle/installers/zypper.rb +4 -15
  49. data/lib/sprinkle/package.rb +81 -98
  50. data/lib/sprinkle/policy.rb +11 -4
  51. data/lib/sprinkle/utility/log_recorder.rb +33 -0
  52. data/lib/sprinkle/verifiers/directory.rb +1 -1
  53. data/lib/sprinkle/verifiers/executable.rb +1 -1
  54. data/lib/sprinkle/verifiers/file.rb +11 -2
  55. data/lib/sprinkle/verifiers/package.rb +2 -14
  56. data/lib/sprinkle/verifiers/permission.rb +40 -0
  57. data/lib/sprinkle/verifiers/symlink.rb +2 -2
  58. data/lib/sprinkle/verifiers/test.rb +21 -0
  59. data/lib/sprinkle/verify.rb +3 -3
  60. data/lib/sprinkle/version.rb +3 -0
  61. data/spec/fixtures/my_file.txt +1 -0
  62. data/spec/sprinkle/actors/capistrano_spec.rb +16 -3
  63. data/spec/sprinkle/actors/local_spec.rb +24 -6
  64. data/spec/sprinkle/actors/ssh_spec.rb +38 -0
  65. data/spec/sprinkle/installers/apt_spec.rb +23 -2
  66. data/spec/sprinkle/installers/binary_spec.rb +22 -14
  67. data/spec/sprinkle/installers/brew_spec.rb +4 -4
  68. data/spec/sprinkle/installers/installer_spec.rb +36 -7
  69. data/spec/sprinkle/installers/npm_spec.rb +16 -0
  70. data/spec/sprinkle/installers/pear_spec.rb +16 -0
  71. data/spec/sprinkle/installers/push_text_spec.rb +23 -1
  72. data/spec/sprinkle/installers/rpm_spec.rb +5 -0
  73. data/spec/sprinkle/installers/runner_spec.rb +27 -11
  74. data/spec/sprinkle/installers/smart_spec.rb +60 -0
  75. data/spec/sprinkle/installers/source_spec.rb +4 -4
  76. data/spec/sprinkle/installers/transfer_spec.rb +31 -16
  77. data/spec/sprinkle/package_spec.rb +10 -2
  78. data/spec/sprinkle/policy_spec.rb +6 -0
  79. data/spec/sprinkle/verify_spec.rb +18 -4
  80. data/sprinkle.gemspec +22 -158
  81. metadata +178 -96
  82. data/TODO +0 -56
  83. data/VERSION +0 -1
  84. data/lib/sprinkle/verifiers/apt.rb +0 -21
  85. data/lib/sprinkle/verifiers/brew.rb +0 -21
  86. data/lib/sprinkle/verifiers/rpm.rb +0 -21
  87. data/lib/sprinkle/verifiers/users_groups.rb +0 -33
metadata CHANGED
@@ -1,101 +1,143 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: sprinkle
3
- version: !ruby/object:Gem::Version
4
- hash: 11
5
- prerelease:
6
- segments:
7
- - 0
8
- - 4
9
- - 2
10
- version: 0.4.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.0.rc1
5
+ prerelease: 6
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Marcus Crafter
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-10-04 00:00:00 +11:00
19
- default_executable: sprinkle
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2012-05-05 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: rspec
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '2.5'
22
+ type: :development
23
23
  prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 9
30
- segments:
31
- - 2
32
- - 5
33
- version: "2.5"
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '2.5'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: 0.8.7
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 0.8.7
46
+ - !ruby/object:Gem::Dependency
47
+ name: rdoc
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '3.12'
34
54
  type: :development
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: activesupport
38
55
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
40
57
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 11
45
- segments:
46
- - 2
47
- - 0
48
- - 2
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '3.12'
62
+ - !ruby/object:Gem::Dependency
63
+ name: open4
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: 1.1.0
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: 1.1.0
78
+ - !ruby/object:Gem::Dependency
79
+ name: activesupport
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
49
85
  version: 2.0.2
50
86
  type: :runtime
51
- version_requirements: *id002
52
- - !ruby/object:Gem::Dependency
53
- name: highline
54
87
  prerelease: false
55
- requirement: &id003 !ruby/object:Gem::Requirement
88
+ version_requirements: !ruby/object:Gem::Requirement
56
89
  none: false
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- hash: 7
61
- segments:
62
- - 1
63
- - 4
64
- - 0
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: 2.0.2
94
+ - !ruby/object:Gem::Dependency
95
+ name: highline
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
65
101
  version: 1.4.0
66
102
  type: :runtime
67
- version_requirements: *id003
68
- - !ruby/object:Gem::Dependency
69
- name: capistrano
70
103
  prerelease: false
71
- requirement: &id004 !ruby/object:Gem::Requirement
104
+ version_requirements: !ruby/object:Gem::Requirement
72
105
  none: false
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- hash: 17
77
- segments:
78
- - 2
79
- - 5
80
- - 5
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: 1.4.0
110
+ - !ruby/object:Gem::Dependency
111
+ name: capistrano
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
81
117
  version: 2.5.5
82
118
  type: :runtime
83
- version_requirements: *id004
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: 2.5.5
84
126
  description: Ruby DSL based software provisioning tool
85
127
  email: crafterm@redartisan.com
86
- executables:
128
+ executables:
87
129
  - sprinkle
88
130
  extensions: []
89
-
90
- extra_rdoc_files:
131
+ extra_rdoc_files:
91
132
  - README.markdown
92
- - TODO
93
- files:
133
+ files:
134
+ - .gitignore
94
135
  - CREDITS
136
+ - Gemfile
137
+ - Gemfile.lock
95
138
  - MIT-LICENSE
96
139
  - README.markdown
97
140
  - Rakefile
98
- - VERSION
99
141
  - bin/sprinkle
100
142
  - examples/packages/build_essential.rb
101
143
  - examples/packages/databases/mysql.rb
@@ -120,11 +162,15 @@ files:
120
162
  - lib/sprinkle.rb
121
163
  - lib/sprinkle/actors/actors.rb
122
164
  - lib/sprinkle/actors/capistrano.rb
165
+ - lib/sprinkle/actors/dummy.rb
123
166
  - lib/sprinkle/actors/local.rb
124
167
  - lib/sprinkle/actors/ssh.rb
125
168
  - lib/sprinkle/actors/vlad.rb
126
169
  - lib/sprinkle/configurable.rb
127
170
  - lib/sprinkle/deployment.rb
171
+ - lib/sprinkle/errors/pretty_failure.rb
172
+ - lib/sprinkle/errors/remote_command_failure.rb
173
+ - lib/sprinkle/errors/transfer_failure.rb
128
174
  - lib/sprinkle/extensions/arbitrary_options.rb
129
175
  - lib/sprinkle/extensions/array.rb
130
176
  - lib/sprinkle/extensions/blank_slate.rb
@@ -143,11 +189,15 @@ files:
143
189
  - lib/sprinkle/installers/install_package.rb
144
190
  - lib/sprinkle/installers/installer.rb
145
191
  - lib/sprinkle/installers/mac_port.rb
192
+ - lib/sprinkle/installers/npm.rb
146
193
  - lib/sprinkle/installers/openbsd_pkg.rb
147
194
  - lib/sprinkle/installers/opensolaris_pkg.rb
195
+ - lib/sprinkle/installers/package_installer.rb
148
196
  - lib/sprinkle/installers/pacman.rb
197
+ - lib/sprinkle/installers/pear.rb
149
198
  - lib/sprinkle/installers/push_text.rb
150
199
  - lib/sprinkle/installers/rake.rb
200
+ - lib/sprinkle/installers/reconnect.rb
151
201
  - lib/sprinkle/installers/replace_text.rb
152
202
  - lib/sprinkle/installers/rpm.rb
153
203
  - lib/sprinkle/installers/runner.rb
@@ -161,25 +211,27 @@ files:
161
211
  - lib/sprinkle/package.rb
162
212
  - lib/sprinkle/policy.rb
163
213
  - lib/sprinkle/script.rb
164
- - lib/sprinkle/verifiers/apt.rb
165
- - lib/sprinkle/verifiers/brew.rb
214
+ - lib/sprinkle/utility/log_recorder.rb
166
215
  - lib/sprinkle/verifiers/directory.rb
167
216
  - lib/sprinkle/verifiers/executable.rb
168
217
  - lib/sprinkle/verifiers/file.rb
169
218
  - lib/sprinkle/verifiers/package.rb
219
+ - lib/sprinkle/verifiers/permission.rb
170
220
  - lib/sprinkle/verifiers/process.rb
171
- - lib/sprinkle/verifiers/rpm.rb
172
221
  - lib/sprinkle/verifiers/ruby.rb
173
222
  - lib/sprinkle/verifiers/symlink.rb
174
- - lib/sprinkle/verifiers/users_groups.rb
223
+ - lib/sprinkle/verifiers/test.rb
175
224
  - lib/sprinkle/verify.rb
225
+ - lib/sprinkle/version.rb
176
226
  - script/console
177
227
  - script/destroy
178
228
  - script/generate
229
+ - spec/fixtures/my_file.txt
179
230
  - spec/spec.opts
180
231
  - spec/spec_helper.rb
181
232
  - spec/sprinkle/actors/capistrano_spec.rb
182
233
  - spec/sprinkle/actors/local_spec.rb
234
+ - spec/sprinkle/actors/ssh_spec.rb
183
235
  - spec/sprinkle/configurable_spec.rb
184
236
  - spec/sprinkle/deployment_spec.rb
185
237
  - spec/sprinkle/extensions/array_spec.rb
@@ -193,13 +245,16 @@ files:
193
245
  - spec/sprinkle/installers/gem_spec.rb
194
246
  - spec/sprinkle/installers/installer_spec.rb
195
247
  - spec/sprinkle/installers/mac_port_spec.rb
248
+ - spec/sprinkle/installers/npm_spec.rb
196
249
  - spec/sprinkle/installers/openbsd_pkg_spec.rb
197
250
  - spec/sprinkle/installers/opensolaris_pkg_spec.rb
251
+ - spec/sprinkle/installers/pear_spec.rb
198
252
  - spec/sprinkle/installers/push_text_spec.rb
199
253
  - spec/sprinkle/installers/rake_spec.rb
200
254
  - spec/sprinkle/installers/replace_text_spec.rb
201
255
  - spec/sprinkle/installers/rpm_spec.rb
202
256
  - spec/sprinkle/installers/runner_spec.rb
257
+ - spec/sprinkle/installers/smart_spec.rb
203
258
  - spec/sprinkle/installers/source_spec.rb
204
259
  - spec/sprinkle/installers/thor_spec.rb
205
260
  - spec/sprinkle/installers/transfer_spec.rb
@@ -211,40 +266,67 @@ files:
211
266
  - spec/sprinkle/sprinkle_spec.rb
212
267
  - spec/sprinkle/verify_spec.rb
213
268
  - sprinkle.gemspec
214
- - TODO
215
- has_rdoc: true
216
269
  homepage: http://github.com/crafterm/sprinkle
217
270
  licenses: []
218
-
219
271
  post_install_message:
220
272
  rdoc_options: []
221
-
222
- require_paths:
273
+ require_paths:
223
274
  - lib
224
- required_ruby_version: !ruby/object:Gem::Requirement
275
+ required_ruby_version: !ruby/object:Gem::Requirement
225
276
  none: false
226
- requirements:
227
- - - ">="
228
- - !ruby/object:Gem::Version
229
- hash: 3
230
- segments:
231
- - 0
232
- version: "0"
233
- required_rubygems_version: !ruby/object:Gem::Requirement
277
+ requirements:
278
+ - - ! '>='
279
+ - !ruby/object:Gem::Version
280
+ version: '0'
281
+ required_rubygems_version: !ruby/object:Gem::Requirement
234
282
  none: false
235
- requirements:
236
- - - ">="
237
- - !ruby/object:Gem::Version
238
- hash: 3
239
- segments:
240
- - 0
241
- version: "0"
283
+ requirements:
284
+ - - ! '>='
285
+ - !ruby/object:Gem::Version
286
+ version: '0'
242
287
  requirements: []
243
-
244
288
  rubyforge_project: sprinkle
245
- rubygems_version: 1.4.2
289
+ rubygems_version: 1.8.23
246
290
  signing_key:
247
291
  specification_version: 3
248
292
  summary: Ruby DSL based software provisioning tool
249
- test_files: []
250
-
293
+ test_files:
294
+ - spec/fixtures/my_file.txt
295
+ - spec/spec.opts
296
+ - spec/spec_helper.rb
297
+ - spec/sprinkle/actors/capistrano_spec.rb
298
+ - spec/sprinkle/actors/local_spec.rb
299
+ - spec/sprinkle/actors/ssh_spec.rb
300
+ - spec/sprinkle/configurable_spec.rb
301
+ - spec/sprinkle/deployment_spec.rb
302
+ - spec/sprinkle/extensions/array_spec.rb
303
+ - spec/sprinkle/extensions/string_spec.rb
304
+ - spec/sprinkle/installers/apt_spec.rb
305
+ - spec/sprinkle/installers/binary_spec.rb
306
+ - spec/sprinkle/installers/brew_spec.rb
307
+ - spec/sprinkle/installers/bsd_port_spec.rb
308
+ - spec/sprinkle/installers/freebsd_pkg_spec.rb
309
+ - spec/sprinkle/installers/freebsd_portinstall_spec.rb
310
+ - spec/sprinkle/installers/gem_spec.rb
311
+ - spec/sprinkle/installers/installer_spec.rb
312
+ - spec/sprinkle/installers/mac_port_spec.rb
313
+ - spec/sprinkle/installers/npm_spec.rb
314
+ - spec/sprinkle/installers/openbsd_pkg_spec.rb
315
+ - spec/sprinkle/installers/opensolaris_pkg_spec.rb
316
+ - spec/sprinkle/installers/pear_spec.rb
317
+ - spec/sprinkle/installers/push_text_spec.rb
318
+ - spec/sprinkle/installers/rake_spec.rb
319
+ - spec/sprinkle/installers/replace_text_spec.rb
320
+ - spec/sprinkle/installers/rpm_spec.rb
321
+ - spec/sprinkle/installers/runner_spec.rb
322
+ - spec/sprinkle/installers/smart_spec.rb
323
+ - spec/sprinkle/installers/source_spec.rb
324
+ - spec/sprinkle/installers/thor_spec.rb
325
+ - spec/sprinkle/installers/transfer_spec.rb
326
+ - spec/sprinkle/installers/yum_spec.rb
327
+ - spec/sprinkle/installers/zypper_spec.rb
328
+ - spec/sprinkle/package_spec.rb
329
+ - spec/sprinkle/policy_spec.rb
330
+ - spec/sprinkle/script_spec.rb
331
+ - spec/sprinkle/sprinkle_spec.rb
332
+ - spec/sprinkle/verify_spec.rb
data/TODO DELETED
@@ -1,56 +0,0 @@
1
- Version 0.1 plan
2
- ================
3
-
4
- INSTALLER
5
- * Fix up apt so that we can handle it if it asks questions, or fail? Check with Ben
6
- * Support alternate gem package sources - DONE
7
- * MD5/SHA1 checking on the installation files?
8
-
9
- MISC
10
- * Growl support
11
- * Do a merb example
12
- * Fix up printing of output so that its nice and a bit more like ports - DONE
13
- * print ports style output for stages (installing, configuring, etc...)
14
- * Add an option to print the hierarchy tree of packages to be installed only - DONE
15
- * BlankSlate - active support has one
16
- * CREDITS file - DONE
17
- * Get #!/usr/bin/env sprinkle working - DONE
18
-
19
- OPERATING SYSTEM
20
- * OS abstraction
21
- * build essential on Ubuntu only for example
22
-
23
- TESTING
24
- * Test on a base system Ubuntu system - DONE
25
- * Multiple runs, check system that's partially installed - DONE
26
- * Resuming downloads with wget ok - DONE
27
-
28
- ERRORS
29
- * Need to think about handling errors nicely
30
- * Recovering from an error, and or successive runs of sprinkle
31
- * store installed state on the remote server so we can skip installed packages?
32
- * what about self healing things later? need to think about it
33
-
34
- DOCUMENTATION
35
- * Document the code somewhat, at least review that its all ok
36
- * Wiki
37
- * Home page somewhere? point to github
38
- * Blog post
39
- * Screencast - use that cool screenflow tool?
40
-
41
- Post Version 0.1 plan
42
- =====================
43
-
44
- CONFIGURATION
45
- * Think about it - talk to Lincoln and Ben
46
- * Use cap 2.3 send/download file helpers, might be useful somehow for transporting config files
47
-
48
- ACTOR
49
- * Investigate a pure net:ssh/gateway delivery mechanism, ie. without cap?
50
- * Generate a cap task file as output? not sure if people would be interested in this?
51
- * use ruby2ruby to generate the file, nice :)
52
-
53
- MISC
54
- * Slicehost API support for creating a slice on the way
55
- * active resource
56
- * SSH keys, have to deploy them somehow?
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.4.2
@@ -1,21 +0,0 @@
1
- module Sprinkle
2
- module Verifiers
3
- # = Apt package Verifier
4
- #
5
- # Contains a verifier to check the existance of an Apt package.
6
- #
7
- # == Example Usage
8
- #
9
- # verify { has_apt 'ntp' }
10
- #
11
- module Apt
12
- Sprinkle::Verify.register(Sprinkle::Verifiers::Apt)
13
-
14
- # Checks to make sure the apt <tt>package</tt> exists on the remote server.
15
- def has_apt(package)
16
- @commands << "dpkg --status #{package} | grep \"ok installed\""
17
- end
18
-
19
- end
20
- end
21
- end