Sha256: 715e29c3a3f8d0e0932a8519613022512dad462256b09ed5ed6a93f063961429
Contents?: true
Size: 1.17 KB
Versions: 2
Compression:
Stored size: 1.17 KB
Contents
# frozen_string_literal: true require "bundler" require "bundler/cli" require "refinements/pathnames" module Rubysmith module Builders # Builds Bundler Gemfile configuration and installs gem dependencies for project skeleton. class Bundler using Refinements::Pathnames def self.call(configuration, builder: Builder) = new(configuration, builder: builder).call def initialize configuration, builder: Builder, client: ::Bundler::CLI @configuration = configuration @builder = builder @client = client end def call builder.call(configuration.with(template_path: "%project_name%/Gemfile.erb")) .render .replace(/\n\s+group/, "\n\ngroup") .replace(/\n\s+gem/, "\n gem") .replace(/ (?=.+refinements)/, "") .replace(/(\n+|\s+)end/, "\nend") .replace(/\n\ngroup :(code_quality|test|tools) do\nend/, "") .replace(/org"\n+/, "org\"\n\n") configuration.project_root.change_dir { client.start %w[install --quiet] } nil end private attr_reader :configuration, :builder, :client end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rubysmith-0.11.0 | lib/rubysmith/builders/bundler.rb |
rubysmith-0.10.0 | lib/rubysmith/builders/bundler.rb |