Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Prevent bin/stalk from polluting Object with Stalker methods #6

Merged
merged 1 commit into from

2 participants

@rfb

Calling 'include Stalker' in the context of main (which is an instance
of Object) also extends Object with the class/instance methods from
Stalker, which basically pollutes all objects in an application.

Here is a gist which demonstrates the behaviour:

https://gist.github.com/2231315

And this ticket which is probably related:

adamwiggins#14

Calling 'extend Stalker' works on the instance of the current object.
When used in the context of main, all the methods from Stalker are
loaded and the global Object isn't polluted.

@rfb rfb Change 'include Stalker' to 'extend' in bin/stalk
Calling 'include Stalker' in the context of main (which is an instance
of Object) also extends Object with the class/instance methods from
Stalker, which basically pollutes all objects in an application.

Here is a gist which demonstrates the behaviour:

https://gist.github.com/2231315

And this ticket which is probably related:

adamwiggins/stalker#14

Calling 'extend Stalker' works on the instance of the current object.
When used in the context of main, all the methods from Stalker are
loaded and the global Object isn't polluted.
d14af56
@han han merged commit 8966206 into han:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 28, 2012
  1. @rfb

    Change 'include Stalker' to 'extend' in bin/stalk

    rfb authored
    Calling 'include Stalker' in the context of main (which is an instance
    of Object) also extends Object with the class/instance methods from
    Stalker, which basically pollutes all objects in an application.
    
    Here is a gist which demonstrates the behaviour:
    
    https://gist.github.com/2231315
    
    And this ticket which is probably related:
    
    adamwiggins/stalker#14
    
    Calling 'extend Stalker' works on the instance of the current object.
    When used in the context of main, all the methods from Stalker are
    loaded and the global Object isn't polluted.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  bin/stalk
View
2  bin/stalk
@@ -3,7 +3,7 @@
STDERR.sync = STDOUT.sync = true
require File.expand_path('../../lib/stalker', __FILE__)
-include Stalker
+extend Stalker
usage = "stalk <jobs.rb> [<job>[,<job>,..]]"
file = ARGV.shift or abort usage
Something went wrong with that request. Please try again.