Remove compare_linker
mmyoji opened this issue · comments
mmyoji commented
- Write code by myself for less dependencies.
- Use cleaner similar gem.
mmyoji commented
compare_linker does
- Fetch base branch's Gemfile.lock and head branch's one from remote
- Compare their diffs
- Find
https://github.com/:username/:repo/compare
links - Create comment
On the other hand, this bu_pr
gem itself does executing bundle update
and it is not necessary to fetch Gemfile.lock
s from remote repository. Only compare the file(s) before and after bundle update
in local machine.
require "bundler"
file = File.read("./Gemfile.lock")
before_parser = Bundler::LockfileParser.new(file)
# execute `bundle update`
file = File.read("./Gemfile.lock")
after_parser = Bundler::LockfileParser.new(file)
# and compare gems
very simple approach 😎
Problems
- how to get the
Gemfile.lock
path?Dir.pwd + "/Gemfile.lock"
?? just try- =>
Bundler.root #=> #<Pathname:/home/mmyoji/projects/bu_pr>
mmyoji commented
no motivation