Split inspec into a core gem. (#3008)

* Split inspec into a core gem.
* Include inspec-core.gemspec, not inspec.gemspec.
* Only load aws and azure when the gems are installed.

Signed-off-by: Miah Johnson <miah@chia-pet.org>
This commit is contained in:
Miah Johnson 2018-05-03 07:30:01 -07:00 committed by Jared Quick
parent dd63d10a10
commit 67bbbb6ecf
4 changed files with 56 additions and 8 deletions

View file

@ -1,6 +1,6 @@
# encoding: utf-8
source 'https://rubygems.org'
gemspec
gemspec name: 'inspec'
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2.2')
gem 'json', '~> 1.8'

View file

@ -2,13 +2,15 @@
# encoding: utf-8
require 'bundler'
require 'bundler/gem_tasks'
require 'bundler/gem_helper'
require 'rake/testtask'
require 'passgen'
require 'train'
require_relative 'tasks/maintainers'
require_relative 'tasks/spdx'
Bundler::GemHelper.install_tasks name: 'inspec'
def prompt(message)
print(message)
STDIN.gets.chomp

43
inspec-core.gemspec Normal file
View file

@ -0,0 +1,43 @@
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'inspec/version'
Gem::Specification.new do |spec|
spec.name = 'inspec-core'
spec.version = Inspec::VERSION
spec.authors = ['Dominik Richter']
spec.email = ['dominik.richter@gmail.com']
spec.summary = 'Just InSpec'
spec.description = 'Core InSpec, local support only. See `inspec` for full support.'
spec.homepage = 'https://github.com/chef/inspec'
spec.license = 'Apache-2.0'
spec.files = %w{README.md MAINTAINERS.toml MAINTAINERS.md LICENSE
inspec-core.gemspec Gemfile CHANGELOG.md} +
Dir.glob('{bin,docs,examples,lib}/**/*', File::FNM_DOTMATCH)
.reject { |f| File.directory?(f) || f =~ /aws|azure|gcp/ }
spec.executables = %w{inspec}
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 2.3'
spec.add_dependency 'train-core', '~> 1.4'
spec.add_dependency 'thor', '~> 0.20'
spec.add_dependency 'json', '>= 1.8', '< 3.0'
spec.add_dependency 'method_source', '~> 0.8'
spec.add_dependency 'rubyzip', '~> 1.1'
spec.add_dependency 'rspec', '~> 3'
spec.add_dependency 'rspec-its', '~> 1.2'
spec.add_dependency 'hashie', '~> 3.4'
spec.add_dependency 'mixlib-log'
spec.add_dependency 'pry', '~> 0'
spec.add_dependency 'sslshake', '~> 1.2'
spec.add_dependency 'parallel', '~> 1.9'
spec.add_dependency 'faraday', '>=0.9.0'
spec.add_dependency 'tomlrb', '~> 1.2'
spec.add_dependency 'addressable', '~> 2.4'
spec.add_dependency 'parslet', '~> 1.5'
spec.add_dependency 'semverse'
spec.add_dependency 'htmlentities'
end

View file

@ -78,13 +78,16 @@ end
require 'utils/filter'
# AWS resources are included via their own file.
require 'resource_support/aws'
require 'resource_support/aws' if Gem.loaded_specs.key?('aws-sdk')
if Gem.loaded_specs.key?('azure_mgmt_resources')
require 'resources/azure/azure_backend.rb'
require 'resources/azure/azure_generic_resource.rb'
require 'resources/azure/azure_resource_group.rb'
require 'resources/azure/azure_virtual_machine.rb'
require 'resources/azure/azure_virtual_machine_data_disk.rb'
end
require 'resources/azure/azure_backend.rb'
require 'resources/azure/azure_generic_resource.rb'
require 'resources/azure/azure_resource_group.rb'
require 'resources/azure/azure_virtual_machine.rb'
require 'resources/azure/azure_virtual_machine_data_disk.rb'
require 'resources/aide_conf'
require 'resources/apache'
require 'resources/apache_conf'