Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop installing the global configatron method when loading configatro…
…n/core
- Loading branch information
Showing
9 changed files
with
43 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
$stderr.puts "Warning: Loading 'configatron/core' has been deprecated. Please just load 'configatron directly." | ||
class Configatron | ||
# Signals that we should not load the extensions. | ||
NO_EXT = true | ||
end | ||
|
||
require 'configatron' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Kernel | ||
def configatron | ||
Configatron::KernelStore.instance | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,9 +50,3 @@ def unlock! | |
@locked = false | ||
end | ||
end | ||
|
||
module Kernel | ||
def configatron | ||
Configatron::KernelStore.instance | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env ruby | ||
|
||
if defined?(configatron) | ||
raise "`configatron` method was defined at load-time!" | ||
end | ||
|
||
require 'configatron/core' | ||
|
||
if defined?(configatron) | ||
raise "Loaded configatron/core but `configatron` was defined!" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require_relative '_lib' | ||
require 'subprocess' | ||
|
||
class Critic::Functional::ConfigatronTest < Critic::Functional::Test | ||
describe 'loading' do | ||
it 'does not define top-level configatron method if loading configatron/core' do | ||
Subprocess.check_call([File.expand_path('../_lib/scripts/core.rb', __FILE__)]) | ||
end | ||
end | ||
end |
File renamed without changes.