Skip to content

Commit

Permalink
Merge pull request #173 from boltops-tools/clean-core
Browse files Browse the repository at this point in the history
remove terraspace_plugin_* gem dependencies out of core
  • Loading branch information
tongueroo authored Dec 27, 2021
2 parents 8eccc90 + 26d87b4 commit c511389
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ source "https://rubygems.org"

# Specify your gem dependencies in terraspace.gemspec
gemspec

group :test do
gem "terraspace_plugin_aws"
gem "terraspace_plugin_azurerm"
gem "terraspace_plugin_google"
end
20 changes: 10 additions & 10 deletions lib/terraspace/cli/new/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ def create_base
directory ".", "#{name}"
end

def bundle_install
return if @options[:bundle] == false
log "=> Installing dependencies with: bundle install"
Bundler.with_unbundled_env do
bundle = "BUNDLE_IGNORE_CONFIG=1 bundle install"
bundle << " > /dev/null 2>&1" if @options[:quiet]
system(bundle, chdir: name)
end
end

# Will generate config folder from
#
# 1. terraspace code lang templates or
Expand Down Expand Up @@ -59,16 +69,6 @@ def create_starter_stack
Stack.start(component_args("demo", name))
end

def bundle_install
return if @options[:bundle] == false
log "=> Installing dependencies with: bundle install"
Bundler.with_unbundled_env do
bundle = "BUNDLE_IGNORE_CONFIG=1 bundle install"
bundle << " > /dev/null 2>&1" if @options[:quiet]
system(bundle, chdir: name)
end
end

def welcome_message_examples
return unless options[:examples]
log <<~EOL
Expand Down
2 changes: 2 additions & 0 deletions lib/terraspace/cli/new/source/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def template_name(template, type=nil)

def require_gem(name)
begin
# Need to clear gem paths since installing plugins like terraspace_plugin_aws as part of terraspace new project
Gem.clear_paths
require name # require plugin for the templates, this registers the plugin
rescue LoadError => e
puts "#{e.class}: #{e.message}".color(:red)
Expand Down
6 changes: 2 additions & 4 deletions terraspace.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@ Gem::Specification.new do |spec|
spec.add_dependency "memoist"
spec.add_dependency "rainbow"
spec.add_dependency "render_me_pretty"
spec.add_dependency "terraspace-bundler", "~> 0.4.0"
spec.add_dependency "rexml"
spec.add_dependency "terraspace-bundler", "~> 0.4.4"
spec.add_dependency "thor"
spec.add_dependency "tty-tree"
spec.add_dependency "zeitwerk"

# core baseline plugins
spec.add_dependency "terraspace_plugin_aws", "~> 0.3.0"
spec.add_dependency "terraspace_plugin_azurerm", "~> 0.3.0"
spec.add_dependency "terraspace_plugin_google", "~> 0.3.0"
spec.add_dependency "rspec-terraspace", "~> 0.3.0"

spec.add_development_dependency "bundler"
Expand Down

0 comments on commit c511389

Please sign in to comment.