Skip to content

Commit 3399f72

Browse files
authored
Merge pull request #46 from bmarini/fix_namespace
Fix namespace
2 parents e77badc + 6d33d2e commit 3399f72

5 files changed

Lines changed: 15 additions & 25 deletions

File tree

lib/chef/knife/cookbook_inspect.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
class Chef
55
class Knife
66
class CookbookInspect < Knife
7-
include HealthInspector::Runner
7+
include ::HealthInspector::Runner
88

9-
checklist HealthInspector::Checklists::Cookbooks
9+
checklist ::HealthInspector::Checklists::Cookbooks
1010
banner 'knife cookbook inspect [COOKBOOK] (options)'
1111
end
1212
end

lib/chef/knife/data_bag_inspect.rb

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
require 'chef/knife'
2+
require 'health_inspector'
23

34
class Chef
45
class Knife
56
class DataBagInspect < Knife
6-
# :nocov:
7-
deps do
8-
require 'health_inspector'
9-
end
10-
# :nocov:
11-
127
banner 'knife data bag inspect [BAG] [ITEM] (options)'
138

149
def run
@@ -17,20 +12,20 @@ def run
1712
bag_name = @name_args[0]
1813
item_name = @name_args[1]
1914

20-
validator = HealthInspector::Checklists::DataBagItems.new(self)
15+
validator = ::HealthInspector::Checklists::DataBagItems.new(self)
2116
item = validator.load_item("#{bag_name}/#{item_name}")
2217
exit validator.validate_item item
2318

2419
when 1 # We are inspecting a data bag
2520
bag_name = @name_args[0]
2621

27-
validator = HealthInspector::Checklists::DataBags.new(self)
22+
validator = ::HealthInspector::Checklists::DataBags.new(self)
2823
item = validator.load_item(bag_name)
2924
exit validator.validate_item item
3025

3126
when 0 # We are inspecting all the data bags
32-
exit HealthInspector::Checklists::DataBags.run(self) &&
33-
HealthInspector::Checklists::DataBagItems.run(self)
27+
exit ::HealthInspector::Checklists::DataBags.run(self) &&
28+
::HealthInspector::Checklists::DataBagItems.run(self)
3429
end
3530
end
3631
end

lib/chef/knife/environment_inspect.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
class Chef
55
class Knife
66
class EnvironmentInspect < Knife
7-
include HealthInspector::Runner
7+
include ::HealthInspector::Runner
88

9-
checklist HealthInspector::Checklists::Environments
9+
checklist ::HealthInspector::Checklists::Environments
1010
banner 'knife environment inspect [ENVIRONMENT] (options)'
1111
end
1212
end

lib/chef/knife/inspect.rb

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
require 'chef/knife'
2+
require 'health_inspector'
23

34
class Chef
45
class Knife
56
class Inspect < Knife
67
CHECKLISTS = %w(Cookbooks DataBags DataBagItems Environments Roles)
78

8-
# :nocov:
9-
deps do
10-
require 'health_inspector'
11-
end
12-
# :nocov:
13-
149
banner 'knife inspect'
1510

1611
CHECKLISTS.each do |checklist|
17-
checklist = HealthInspector::Checklists.const_get(checklist)
12+
checklist = ::HealthInspector::Checklists.const_get(checklist)
1813

1914
option checklist.option,
2015
:long => "--[no-]#{checklist.option}",
@@ -25,7 +20,7 @@ class Inspect < Knife
2520

2621
def run
2722
results = checklists_to_run.map do |checklist|
28-
HealthInspector::Checklists.const_get(checklist).run(self)
23+
::HealthInspector::Checklists.const_get(checklist).run(self)
2924
end
3025

3126
exit !results.include?(false)
@@ -35,7 +30,7 @@ def run
3530

3631
def checklists_to_run
3732
CHECKLISTS.select do |checklist|
38-
checklist = HealthInspector::Checklists.const_get(checklist)
33+
checklist = ::HealthInspector::Checklists.const_get(checklist)
3934

4035
config[checklist.option]
4136
end

lib/chef/knife/role_inspect.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
class Chef
55
class Knife
66
class RoleInspect < Knife
7-
include HealthInspector::Runner
7+
include ::HealthInspector::Runner
88

9-
checklist HealthInspector::Checklists::Roles
9+
checklist ::HealthInspector::Checklists::Roles
1010
banner 'knife role inspect [ROLE] (options)'
1111
end
1212
end

0 commit comments

Comments
 (0)