Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

remove some pollution of the Object class

  • Loading branch information...
commit e3153cc15df8c0fa207490a11efa0a042f89f07b 1 parent c7a15b0
@yyyc514 yyyc514 authored
@@ -1,3 +1,11 @@
+* Remove the Deployment module from Object.
+ If anyone is relying on the behavior of placing their deployment block in a required
+ file then they will first need to manually add the module back to the Object class
+ themselves. Polluting Object is generally bad.
+ *Josh Goebel*
* Add support for specifying the Net::SSH keys property
*Chris Kimpton*
6 lib/sprinkle.rb
@@ -28,13 +28,13 @@ module Sprinkle
OPTIONS = { :testing => false, :verbose => false, :force => false }
-# Object is extended to give the package, policy, and deployment methods. To
-# read about each method, see the corresponding module which is included.
+# Object is extended to Add the package and policy methods. To read about
+# each method, see the corresponding module which is included.
# Define a logging target and understand packages, policies and deployment DSL
class Object
- include Sprinkle::Package, Sprinkle::Policy, Sprinkle::Deployment
+ include Sprinkle::Package, Sprinkle::Policy
def logger # :nodoc:
# ActiveSupport::BufferedLogger was deprecated and replaced by ActiveSupport::Logger in Rails 4.
4 lib/sprinkle/deployment.rb
@@ -29,6 +29,10 @@ module Sprinkle
# they will say so on their corresponding documentation page. See
# Sprinkle::Installers
+ # The deployment block must be included in the script file passed to the
+ # sprinkle executable. It may not be loaded from a required file unless you
+ # first manually include the Sprinkle::Deployment module in the Object class.
+ #
# <b>Only one deployment block is on any given sprinkle script</b>
module Deployment
# The method outlined above which specifies deployment specific information
2  lib/sprinkle/script.rb
@@ -4,6 +4,8 @@ module Sprinkle
# Sprinkle::Script gives you a way to programatically run a given
# sprinkle script.
class Script
+ include Sprinkle::Deployment
# Run a given sprinkle script. This method is <b>blocking</b> so
# it will not return until the sprinkling is complete or fails.
4 spec/sprinkle/script_spec.rb
@@ -6,6 +6,10 @@
Sprinkle::Script.should respond_to(:sprinkle)
+ it 'should respond to deployment' do
+ respond_to(:deployment)
+ end
describe Sprinkle::Script, 'when given a script' do
2  spec/sprinkle/sprinkle_spec.rb
@@ -3,7 +3,7 @@
describe Sprinkle do
it 'should automatically extend Object to support package, policy and deployment DSL keywords' do
- %w( package policy deployment ).each do |keyword|
+ %w( package policy ).each do |keyword|
Object.should respond_to(keyword.to_sym)
Please sign in to comment.
Something went wrong with that request. Please try again.