From d779dd53ae1741461044acaf67127d5b65ab0c68 Mon Sep 17 00:00:00 2001 From: Steven Danna Date: Thu, 18 Aug 2016 21:29:25 +0100 Subject: [PATCH] Move all dependency related classes into inspec/dependencies Signed-off-by: Steven Danna --- .../{dependencies.rb => dependencies/dependency_set.rb} | 6 +++--- lib/inspec/{ => dependencies}/requirement.rb | 0 lib/inspec/{ => dependencies}/resolver.rb | 2 +- lib/inspec/{ => dependencies}/vendor_index.rb | 0 lib/inspec/profile.rb | 4 ++-- .../inheritance/controls/example.rb | 0 .../inheritance/inspec.yml | 0 .../profile_a/controls/example.rb | 0 .../profile_a/inspec.yml | 0 .../profile_b/controls/example.rb | 0 .../profile_b/inspec.yml | 0 .../profile_c/inspec.yml | 0 .../profile_c/libraries/.gitkeep | 0 13 files changed, 6 insertions(+), 6 deletions(-) rename lib/inspec/{dependencies.rb => dependencies/dependency_set.rb} (89%) rename lib/inspec/{ => dependencies}/requirement.rb (100%) rename lib/inspec/{ => dependencies}/resolver.rb (99%) rename lib/inspec/{ => dependencies}/vendor_index.rb (100%) rename test/unit/mock/profiles/{dependencies-file => dependencies}/inheritance/controls/example.rb (100%) rename test/unit/mock/profiles/{dependencies-file => dependencies}/inheritance/inspec.yml (100%) rename test/unit/mock/profiles/{dependencies-file => dependencies}/profile_a/controls/example.rb (100%) rename test/unit/mock/profiles/{dependencies-file => dependencies}/profile_a/inspec.yml (100%) rename test/unit/mock/profiles/{dependencies-file => dependencies}/profile_b/controls/example.rb (100%) rename test/unit/mock/profiles/{dependencies-file => dependencies}/profile_b/inspec.yml (100%) rename test/unit/mock/profiles/{dependencies-file => dependencies}/profile_c/inspec.yml (100%) rename test/unit/mock/profiles/{dependencies-file => dependencies}/profile_c/libraries/.gitkeep (100%) diff --git a/lib/inspec/dependencies.rb b/lib/inspec/dependencies/dependency_set.rb similarity index 89% rename from lib/inspec/dependencies.rb rename to lib/inspec/dependencies/dependency_set.rb index 4735cb9b7..21aa1846e 100644 --- a/lib/inspec/dependencies.rb +++ b/lib/inspec/dependencies/dependency_set.rb @@ -1,9 +1,9 @@ # encoding: utf-8 -require 'inspec/vendor_index' -require 'inspec/resolver' +require 'inspec/dependencies/vendor_index' +require 'inspec/dependencies/resolver' module Inspec - class Dependencies + class DependencySet attr_reader :list, :vendor_path # initialize diff --git a/lib/inspec/requirement.rb b/lib/inspec/dependencies/requirement.rb similarity index 100% rename from lib/inspec/requirement.rb rename to lib/inspec/dependencies/requirement.rb diff --git a/lib/inspec/resolver.rb b/lib/inspec/dependencies/resolver.rb similarity index 99% rename from lib/inspec/resolver.rb rename to lib/inspec/dependencies/resolver.rb index 483cd2570..0845a060c 100644 --- a/lib/inspec/resolver.rb +++ b/lib/inspec/dependencies/resolver.rb @@ -4,7 +4,7 @@ require 'logger' require 'molinillo' require 'inspec/errors' -require 'inspec/requirement' +require 'inspec/dependencies/requirement' module Inspec class Resolver diff --git a/lib/inspec/vendor_index.rb b/lib/inspec/dependencies/vendor_index.rb similarity index 100% rename from lib/inspec/vendor_index.rb rename to lib/inspec/dependencies/vendor_index.rb diff --git a/lib/inspec/profile.rb b/lib/inspec/profile.rb index d6ce99083..2b8f06699 100644 --- a/lib/inspec/profile.rb +++ b/lib/inspec/profile.rb @@ -8,7 +8,7 @@ require 'inspec/polyfill' require 'inspec/fetcher' require 'inspec/source_reader' require 'inspec/metadata' -require 'inspec/dependencies' +require 'inspec/dependencies/dependency_set' module Inspec class Profile # rubocop:disable Metrics/ClassLength @@ -298,7 +298,7 @@ module Inspec def load_dependencies cwd = File.directory?(@target) ? @target : nil - res = Inspec::Dependencies.new(cwd, nil) + res = Inspec::DependencySet.new(cwd, nil) res.vendor(metadata.dependencies) res end diff --git a/test/unit/mock/profiles/dependencies-file/inheritance/controls/example.rb b/test/unit/mock/profiles/dependencies/inheritance/controls/example.rb similarity index 100% rename from test/unit/mock/profiles/dependencies-file/inheritance/controls/example.rb rename to test/unit/mock/profiles/dependencies/inheritance/controls/example.rb diff --git a/test/unit/mock/profiles/dependencies-file/inheritance/inspec.yml b/test/unit/mock/profiles/dependencies/inheritance/inspec.yml similarity index 100% rename from test/unit/mock/profiles/dependencies-file/inheritance/inspec.yml rename to test/unit/mock/profiles/dependencies/inheritance/inspec.yml diff --git a/test/unit/mock/profiles/dependencies-file/profile_a/controls/example.rb b/test/unit/mock/profiles/dependencies/profile_a/controls/example.rb similarity index 100% rename from test/unit/mock/profiles/dependencies-file/profile_a/controls/example.rb rename to test/unit/mock/profiles/dependencies/profile_a/controls/example.rb diff --git a/test/unit/mock/profiles/dependencies-file/profile_a/inspec.yml b/test/unit/mock/profiles/dependencies/profile_a/inspec.yml similarity index 100% rename from test/unit/mock/profiles/dependencies-file/profile_a/inspec.yml rename to test/unit/mock/profiles/dependencies/profile_a/inspec.yml diff --git a/test/unit/mock/profiles/dependencies-file/profile_b/controls/example.rb b/test/unit/mock/profiles/dependencies/profile_b/controls/example.rb similarity index 100% rename from test/unit/mock/profiles/dependencies-file/profile_b/controls/example.rb rename to test/unit/mock/profiles/dependencies/profile_b/controls/example.rb diff --git a/test/unit/mock/profiles/dependencies-file/profile_b/inspec.yml b/test/unit/mock/profiles/dependencies/profile_b/inspec.yml similarity index 100% rename from test/unit/mock/profiles/dependencies-file/profile_b/inspec.yml rename to test/unit/mock/profiles/dependencies/profile_b/inspec.yml diff --git a/test/unit/mock/profiles/dependencies-file/profile_c/inspec.yml b/test/unit/mock/profiles/dependencies/profile_c/inspec.yml similarity index 100% rename from test/unit/mock/profiles/dependencies-file/profile_c/inspec.yml rename to test/unit/mock/profiles/dependencies/profile_c/inspec.yml diff --git a/test/unit/mock/profiles/dependencies-file/profile_c/libraries/.gitkeep b/test/unit/mock/profiles/dependencies/profile_c/libraries/.gitkeep similarity index 100% rename from test/unit/mock/profiles/dependencies-file/profile_c/libraries/.gitkeep rename to test/unit/mock/profiles/dependencies/profile_c/libraries/.gitkeep