Skip to content

Commit

Permalink
Delegate to FilesGenerator's bundle_install
Browse files Browse the repository at this point in the history
  • Loading branch information
azimux committed Jul 24, 2024
1 parent 3d06b53 commit 5750d0d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 24 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.0.2] - 2024-07-24

- Fix bundle install bug

## [0.0.1] - 2024-06-17

- Add Apache-2.0 license
Expand Down
14 changes: 7 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ GEM
diff-lcs (1.5.1)
docile (1.4.0)
ffi (1.17.0-x86_64-linux-gnu)
foobara (0.0.1)
foobara (0.0.2)
foobara-util
foobara-files-generator (0.0.1)
foobara-files-generator (0.0.3)
foobara
foobara-rubocop-rules (0.0.3)
rubocop
Expand Down Expand Up @@ -51,7 +51,7 @@ GEM
nenv (~> 0.1)
shellany (~> 0.0)
parallel (1.25.1)
parser (3.3.3.0)
parser (3.3.4.0)
ast (~> 2.4.1)
racc
pry (0.14.2)
Expand All @@ -67,7 +67,7 @@ GEM
rb-inotify (0.11.1)
ffi (~> 1.0)
regexp_parser (2.9.2)
rexml (3.3.0)
rexml (3.3.2)
strscan
rspec (3.13.0)
rspec-core (~> 3.13.0)
Expand All @@ -85,13 +85,13 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.64.1)
rubocop (1.65.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
regexp_parser (>= 2.4, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
Expand All @@ -100,7 +100,7 @@ GEM
parser (>= 3.3.1.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (3.0.1)
rubocop-rspec (3.0.3)
rubocop (~> 1.61)
ruby-progressbar (1.13.0)
shellany (0.0.1)
Expand Down
19 changes: 3 additions & 16 deletions src/write_sh_cli_connector_to_disk.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
require_relative "generate_sh_cli_connector"
require "foobara/files_generator/bundler_actions"

module Foobara
module Generators
module ShCliConnectorGenerator
class WriteShCliConnectorToDisk < Foobara::Generators::WriteGeneratedFilesToDisk
include Foobara::FilesGenerator::BundlerActions

class << self
def generator_key
"sh-cli-connector"
Expand Down Expand Up @@ -47,22 +50,6 @@ def run_post_generation_tasks
end
end

def bundle_install
cmd = "bundle install"

Bundler.with_unbundled_env do
Open3.popen3(cmd) do |_stdin, _stdout, stderr, wait_thr|
exit_status = wait_thr.value

unless exit_status.success?
# :nocov:
warn "WARNING: could not #{cmd}\n#{stderr.read}"
# :nocov:puts "bundling..."
end
end
end
end

def rubocop_autocorrect
Open3.popen3("bundle exec rubocop --no-server -A") do |_stdin, _stdout, stderr, wait_thr|
exit_status = wait_thr.value
Expand Down
2 changes: 1 addition & 1 deletion version.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Foobara
module Generators
module ShCliConnectorGenerator
VERSION = "0.0.1".freeze
VERSION = "0.0.2".freeze
end
end
end

0 comments on commit 5750d0d

Please sign in to comment.