sprinkle 0.6.1.1 → 0.6.2

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0f1d6725ca74e75f617bcc041b6cfa9479e42cda
4
+ data.tar.gz: 350bc1e155ea7094583102db987f3b6faa282306
5
+ SHA512:
6
+ metadata.gz: 9be3e0863b8e304adef43e50a097b96c1aaf1c722dbc8da97d67a2c89b690ce88e3b6a5d7e2b3277dee57215e75ebe5efc6fed603c994693ba8f7c18484724fc
7
+ data.tar.gz: c20aa43749c3d10ccbc0659072e38fa286db9b87f71033af1bbd2199074751c57cff319b0905e75049c6fc8c0484e303dba0037c21d4dc121aafa5dcf04d14e8
@@ -1,5 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.0.0
3
4
  - 1.9.3
4
5
  - 1.9.2
5
6
  - 1.8.7
@@ -1,3 +1,16 @@
1
+ * A users own post :install hooks should happen after a file has completely been moved
2
+ (when using sudo this was not the case)
3
+
4
+ *Koen Punt*
5
+
6
+ * Remove the Deployment module from Object.
7
+
8
+ If anyone is relying on the behavior of placing their deployment block in a required
9
+ file then they will first need to manually add the module back to the Object class
10
+ themselves. Polluting Object is generally bad.
11
+
12
+ *Josh Goebel*
13
+
1
14
  * Add support for specifying the Net::SSH keys property
2
15
 
3
16
  *Chris Kimpton*
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sprinkle (0.5)
4
+ sprinkle (0.6.1.1)
5
5
  activesupport (>= 2.0.2)
6
6
  capistrano (>= 2.5.5)
7
7
  highline (>= 1.4.0)
@@ -13,14 +13,14 @@ GEM
13
13
  activesupport (3.2.13)
14
14
  i18n (= 0.6.1)
15
15
  multi_json (~> 1.0)
16
- capistrano (2.14.2)
16
+ capistrano (2.15.4)
17
17
  highline
18
18
  net-scp (>= 1.0.0)
19
19
  net-sftp (>= 2.0.0)
20
20
  net-ssh (>= 2.0.14)
21
21
  net-ssh-gateway (>= 1.1.0)
22
22
  diff-lcs (1.1.3)
23
- highline (1.6.16)
23
+ highline (1.6.18)
24
24
  i18n (0.6.1)
25
25
  json (1.7.5)
26
26
  multi_json (1.7.2)
@@ -28,10 +28,10 @@ GEM
28
28
  net-ssh (>= 2.6.5)
29
29
  net-sftp (2.1.1)
30
30
  net-ssh (>= 2.6.5)
31
- net-ssh (2.6.6)
31
+ net-ssh (2.6.7)
32
32
  net-ssh-gateway (1.2.0)
33
33
  net-ssh (>= 2.6.5)
34
- open4 (1.1.0)
34
+ open4 (1.3.0)
35
35
  rake (10.0.4)
36
36
  rdoc (3.12)
37
37
  json (~> 1.4)
@@ -28,13 +28,13 @@ module Sprinkle
28
28
  OPTIONS = { :testing => false, :verbose => false, :force => false }
29
29
  end
30
30
 
31
- # Object is extended to give the package, policy, and deployment methods. To
32
- # read about each method, see the corresponding module which is included.
31
+ # Object is extended to Add the package and policy methods. To read about
32
+ # each method, see the corresponding module which is included.
33
33
  #--
34
34
  # Define a logging target and understand packages, policies and deployment DSL
35
35
  #++
36
36
  class Object
37
- include Sprinkle::Package, Sprinkle::Policy, Sprinkle::Deployment
37
+ include Sprinkle::Package, Sprinkle::Policy
38
38
 
39
39
  def logger # :nodoc:
40
40
  # ActiveSupport::BufferedLogger was deprecated and replaced by ActiveSupport::Logger in Rails 4.
@@ -29,6 +29,10 @@ module Sprinkle
29
29
  # they will say so on their corresponding documentation page. See
30
30
  # Sprinkle::Installers
31
31
  #
32
+ # The deployment block must be included in the script file passed to the
33
+ # sprinkle executable. It may not be loaded from a required file unless you
34
+ # first manually include the Sprinkle::Deployment module in the Object class.
35
+ #
32
36
  # <b>Only one deployment block is on any given sprinkle script</b>
33
37
  module Deployment
34
38
  # The method outlined above which specifies deployment specific information
@@ -22,7 +22,7 @@ module Sprinkle
22
22
  private
23
23
 
24
24
  def read_from_package(m)
25
- @package.send(m) if @package.respond_to?(m)
25
+ @package.send(m) if @package.respond_to?(m) and @package.method(m).arity.abs < 2
26
26
  end
27
27
 
28
28
  def option?(sym)
@@ -99,11 +99,12 @@ module Sprinkle
99
99
  @orig_destination = destination
100
100
  super parent, options, &block
101
101
  @binding = options[:binding]
102
- # perform the transfer in two steps if we're using sudo
103
- if sudo?
102
+ if sudo? # perform the transfer in two steps if we're using sudo
104
103
  final = @destination
105
104
  @destination = "/tmp/sprinkle_#{File.basename(@destination)}"
106
- post :install, "#{sudo_cmd}mv #{@destination} #{final}"
105
+ # make sure we push the move ahead of any other post install tasks
106
+ # a user may have requested
107
+ post(:install).unshift ["#{sudo_cmd}mv #{@destination} #{final}"]
107
108
  end
108
109
  owner(options[:owner]) if options[:owner]
109
110
  mode(options[:mode]) if options[:mode]
@@ -4,6 +4,8 @@ module Sprinkle
4
4
  # Sprinkle::Script gives you a way to programatically run a given
5
5
  # sprinkle script.
6
6
  class Script
7
+ include Sprinkle::Deployment
8
+
7
9
  # Run a given sprinkle script. This method is <b>blocking</b> so
8
10
  # it will not return until the sprinkling is complete or fails.
9
11
  #--
@@ -1,3 +1,3 @@
1
1
  module Sprinkle
2
- Version = "0.6.1.1"
2
+ Version = "0.6.2"
3
3
  end
@@ -42,10 +42,6 @@ describe Sprinkle::Installers::FreebsdPkg do
42
42
  @installer.send(:install_sequence).should == [ 'op1', 'pkg_add -r ruby', 'op2' ]
43
43
  end
44
44
 
45
- it 'should install a specific version if defined' do
46
- pending
47
- end
48
-
49
45
  end
50
46
 
51
47
  end
@@ -9,7 +9,9 @@ describe Sprinkle::Installers::Gem do
9
9
  end
10
10
 
11
11
  def create_gem(gem, version = nil, options = {}, &block)
12
- @package = mock(Sprinkle::Package, :name => gem, :version => version)
12
+ # @package = mock(Sprinkle::Package, :name => gem, :version => version)
13
+ @package = Package.new "test" do; end
14
+ @package.version version
13
15
  Sprinkle::Installers::Gem.new(@package, gem, options, &block)
14
16
  end
15
17
 
@@ -18,6 +20,12 @@ describe Sprinkle::Installers::Gem do
18
20
  before do
19
21
  @installer = create_gem @gem, @version, @options
20
22
  end
23
+
24
+ it "should return nil if no source is not configured" do
25
+ @options.delete(:source)
26
+ @installer = create_gem @gem, @version, @options
27
+ @installer.source.should == nil
28
+ end
21
29
 
22
30
  it 'should accept a single package to install' do
23
31
  @installer.gem.should == @gem
@@ -42,10 +42,6 @@ describe Sprinkle::Installers::OpenbsdPkg do
42
42
  @installer.send(:install_sequence).should == [ 'op1', 'pkg_add ruby', 'op2' ]
43
43
  end
44
44
 
45
- it 'should install a specific version if defined' do
46
- pending
47
- end
48
-
49
45
  end
50
46
 
51
47
  end
@@ -72,6 +72,23 @@ describe Sprinkle::Installers::Transfer do
72
72
  # end
73
73
 
74
74
  end
75
+
76
+ context 'pre/post with sudo' do
77
+ before do
78
+ @installer = create_transfer @source, @destination do
79
+ @options[:sudo]= true
80
+ pre :install, 'op1'
81
+ post :install, 'op2'
82
+ end
83
+ @installer_commands = @installer.install_sequence
84
+ @delivery = @installer.delivery
85
+ end
86
+
87
+ it "should call the pre and post install commands around the file transfer" do
88
+ @installer_commands.should == ["op1",:TRANSFER,
89
+ "sudo mv /tmp/sprinkle_destination destination", "op2"]
90
+ end
91
+ end
75
92
 
76
93
  context 'multiple pre/post commands' do
77
94
  before do
@@ -6,6 +6,10 @@ describe Sprinkle::Script, 'class' do
6
6
  Sprinkle::Script.should respond_to(:sprinkle)
7
7
  end
8
8
 
9
+ it 'should respond to deployment' do
10
+ Sprinkle::Script.new.should respond_to(:deployment)
11
+ end
12
+
9
13
  end
10
14
 
11
15
  describe Sprinkle::Script, 'when given a script' do
@@ -3,7 +3,7 @@ require File.expand_path("../spec_helper", File.dirname(__FILE__))
3
3
  describe Sprinkle do
4
4
 
5
5
  it 'should automatically extend Object to support package, policy and deployment DSL keywords' do
6
- %w( package policy deployment ).each do |keyword|
6
+ %w( package policy ).each do |keyword|
7
7
  Object.should respond_to(keyword.to_sym)
8
8
  end
9
9
  end
@@ -15,6 +15,8 @@ Gem::Specification.new do |s|
15
15
  "README.md"
16
16
  ]
17
17
 
18
+ s.license = "MIT"
19
+
18
20
  s.files = `git ls-files`.split("\n")
19
21
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
22
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprinkle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1.1
5
- prerelease:
4
+ version: 0.6.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Marcus Crafter
@@ -10,118 +9,104 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2013-05-29 00:00:00.000000000 Z
12
+ date: 2013-06-06 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rspec
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ! '>='
18
+ - - '>='
21
19
  - !ruby/object:Gem::Version
22
20
  version: '2.5'
23
21
  type: :development
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
- - - ! '>='
25
+ - - '>='
29
26
  - !ruby/object:Gem::Version
30
27
  version: '2.5'
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: rake
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
- - - ! '>='
32
+ - - '>='
37
33
  - !ruby/object:Gem::Version
38
34
  version: 0.8.7
39
35
  type: :development
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
- - - ! '>='
39
+ - - '>='
45
40
  - !ruby/object:Gem::Version
46
41
  version: 0.8.7
47
42
  - !ruby/object:Gem::Dependency
48
43
  name: rdoc
49
44
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
45
  requirements:
52
- - - ! '>='
46
+ - - '>='
53
47
  - !ruby/object:Gem::Version
54
48
  version: '3.12'
55
49
  type: :development
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
52
  requirements:
60
- - - ! '>='
53
+ - - '>='
61
54
  - !ruby/object:Gem::Version
62
55
  version: '3.12'
63
56
  - !ruby/object:Gem::Dependency
64
57
  name: open4
65
58
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
59
  requirements:
68
- - - ! '>='
60
+ - - '>='
69
61
  - !ruby/object:Gem::Version
70
62
  version: 1.1.0
71
63
  type: :runtime
72
64
  prerelease: false
73
65
  version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
66
  requirements:
76
- - - ! '>='
67
+ - - '>='
77
68
  - !ruby/object:Gem::Version
78
69
  version: 1.1.0
79
70
  - !ruby/object:Gem::Dependency
80
71
  name: activesupport
81
72
  requirement: !ruby/object:Gem::Requirement
82
- none: false
83
73
  requirements:
84
- - - ! '>='
74
+ - - '>='
85
75
  - !ruby/object:Gem::Version
86
76
  version: 2.0.2
87
77
  type: :runtime
88
78
  prerelease: false
89
79
  version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
80
  requirements:
92
- - - ! '>='
81
+ - - '>='
93
82
  - !ruby/object:Gem::Version
94
83
  version: 2.0.2
95
84
  - !ruby/object:Gem::Dependency
96
85
  name: highline
97
86
  requirement: !ruby/object:Gem::Requirement
98
- none: false
99
87
  requirements:
100
- - - ! '>='
88
+ - - '>='
101
89
  - !ruby/object:Gem::Version
102
90
  version: 1.4.0
103
91
  type: :runtime
104
92
  prerelease: false
105
93
  version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
94
  requirements:
108
- - - ! '>='
95
+ - - '>='
109
96
  - !ruby/object:Gem::Version
110
97
  version: 1.4.0
111
98
  - !ruby/object:Gem::Dependency
112
99
  name: capistrano
113
100
  requirement: !ruby/object:Gem::Requirement
114
- none: false
115
101
  requirements:
116
- - - ! '>='
102
+ - - '>='
117
103
  - !ruby/object:Gem::Version
118
104
  version: 2.5.5
119
105
  type: :runtime
120
106
  prerelease: false
121
107
  version_requirements: !ruby/object:Gem::Requirement
122
- none: false
123
108
  requirements:
124
- - - ! '>='
109
+ - - '>='
125
110
  - !ruby/object:Gem::Version
126
111
  version: 2.5.5
127
112
  description: Ruby DSL based software provisioning tool
@@ -268,28 +253,28 @@ files:
268
253
  - spec/sprinkle/verify_spec.rb
269
254
  - sprinkle.gemspec
270
255
  homepage: https://github.com/sprinkle-tool/sprinkle
271
- licenses: []
256
+ licenses:
257
+ - MIT
258
+ metadata: {}
272
259
  post_install_message:
273
260
  rdoc_options: []
274
261
  require_paths:
275
262
  - lib
276
263
  required_ruby_version: !ruby/object:Gem::Requirement
277
- none: false
278
264
  requirements:
279
- - - ! '>='
265
+ - - '>='
280
266
  - !ruby/object:Gem::Version
281
267
  version: '0'
282
268
  required_rubygems_version: !ruby/object:Gem::Requirement
283
- none: false
284
269
  requirements:
285
- - - ! '>='
270
+ - - '>='
286
271
  - !ruby/object:Gem::Version
287
272
  version: '0'
288
273
  requirements: []
289
274
  rubyforge_project: sprinkle
290
- rubygems_version: 1.8.23
275
+ rubygems_version: 2.0.2
291
276
  signing_key:
292
- specification_version: 3
277
+ specification_version: 4
293
278
  summary: Ruby DSL based software provisioning tool
294
279
  test_files:
295
280
  - spec/fixtures/my_file.txt