dns_guru 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/init.rb +1 -41
- data/rails/init.rb +1 -1
- metadata +1 -1
data/Rakefile
CHANGED
data/init.rb
CHANGED
@@ -1,42 +1,2 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
require 'dns_guru'
|
4
|
-
require 'rack'
|
5
|
-
require 'action_controller/test_process'
|
6
|
-
|
7
|
-
begin
|
8
|
-
config_files = [
|
9
|
-
File.join(File.dirname(__FILE__), "..","..","..","config","hosts.rb"),
|
10
|
-
File.join(File.dirname(__FILE__), "..","..","..","..","config","hosts.rb")
|
11
|
-
]
|
12
|
-
if const_defined?(:Rails)
|
13
|
-
config_files << File.join(Rails.root, "config","hosts.rb")
|
14
|
-
end
|
15
|
-
config_files.detect do |config_file|
|
16
|
-
if File.exists?(config_file)
|
17
|
-
DnsGuru.init(config_file)
|
18
|
-
true
|
19
|
-
end
|
20
|
-
end
|
21
|
-
rescue Exception => e
|
22
|
-
puts "Could not load dns_guru config file (hosts.rb): #{e}"
|
23
|
-
end
|
24
|
-
|
25
|
-
class Rack::Request
|
26
|
-
include DnsGuru::RequestMixin
|
27
|
-
end
|
28
|
-
|
29
|
-
class ActionController::Request
|
30
|
-
include DnsGuru::RequestMixin
|
31
|
-
end
|
32
|
-
|
33
|
-
class ActionController::TestRequest
|
34
|
-
include DnsGuru::RequestMixin
|
35
|
-
end
|
36
|
-
|
37
|
-
class ActionController::Base
|
38
|
-
include DnsGuru::ControllerMixin
|
39
|
-
|
40
|
-
helper_method :host_name
|
41
|
-
helper_method :host_name_params
|
42
|
-
end
|
2
|
+
require File.join(File.dirname(__FILE__), "lib", "init.rb")
|
data/rails/init.rb
CHANGED
@@ -9,7 +9,7 @@ begin
|
|
9
9
|
File.join(File.dirname(__FILE__), "..","..","..","config","hosts.rb"),
|
10
10
|
File.join(File.dirname(__FILE__), "..","..","..","..","config","hosts.rb")
|
11
11
|
]
|
12
|
-
if const_defined?(:Rails)
|
12
|
+
if Object.const_defined?(:Rails)
|
13
13
|
config_files << File.join(Rails.root, "config","hosts.rb")
|
14
14
|
end
|
15
15
|
config_files.detect do |config_file|
|