Skip to content

Commit

Permalink
add Gemfile.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
tycooon committed Jan 23, 2020
1 parent ef6fb60 commit ff64398
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
@@ -1,6 +1,5 @@
/.bundle/
/.yardoc
/Gemfile.lock
/coverage/
/doc/
/pkg/
Expand Down
97 changes: 97 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,97 @@
PATH
remote: .
specs:
memery (1.2.0)

GEM
remote: https://rubygems.org/
specs:
ast (2.4.0)
benchmark-ips (2.7.2)
benchmark-memory (0.1.2)
memory_profiler (~> 0.9)
coderay (1.1.2)
coveralls (0.8.23)
json (>= 1.8, < 3)
simplecov (~> 0.16.1)
term-ansicolor (~> 1.3)
thor (>= 0.19.4, < 2.0)
tins (~> 1.6)
diff-lcs (1.3)
docile (1.3.2)
jaro_winkler (1.5.4)
json (2.3.0)
memory_profiler (0.9.14)
method_source (0.9.2)
parallel (1.19.1)
parser (2.7.0.2)
ast (~> 2.4.0)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
rack (2.1.1)
rainbow (3.0.0)
rake (13.0.1)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-core (3.9.1)
rspec-support (~> 3.9.1)
rspec-expectations (3.9.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.2)
rubocop (0.79.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
rubocop-config-umbrellio (0.79.0.68)
rubocop (= 0.79.0)
rubocop-performance (= 1.5.2)
rubocop-rails (= 2.4.1)
rubocop-rspec (= 1.37.1)
rubocop-performance (1.5.2)
rubocop (>= 0.71.0)
rubocop-rails (2.4.1)
rack (>= 1.1)
rubocop (>= 0.72.0)
rubocop-rspec (1.37.1)
rubocop (>= 0.68.1)
ruby-progressbar (1.10.1)
simplecov (0.16.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
sync (0.5.0)
term-ansicolor (1.7.1)
tins (~> 1.0)
thor (1.0.1)
tins (1.24.0)
sync
unicode-display_width (1.6.1)

PLATFORMS
ruby

DEPENDENCIES
benchmark-ips
benchmark-memory
bundler
coveralls
memery!
pry
rake
rspec
rubocop-config-umbrellio
simplecov

BUNDLED WITH
2.1.2

5 comments on commit ff64398

@AlexWayfer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?! 😢

If you are working on a gem, then DO NOT check in your Gemfile.lock. If you are working on a Rails app, then DO check in your Gemfile.lock.

Source: https://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/

Problem:

> git reb upstream/master
First, rewinding head to replay your work on top of it...
error: The following untracked working tree files would be overwritten by checkout:
	Gemfile.lock
Please move or remove them before you switch branches.
Aborting
fatal: Could not detach HEAD

Please, revert and use gemspec's locks.

@tycooon
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexWayfer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See https://bundler.io/man/bundle-install.1.html#THE-GEMFILE-LOCK.

Okay. But I don't understand what is "the pain of broken dependencies onto new contributors".

Oh, I found the same questions and issues in the bundler-site repo: https://github.com/rubygems/bundler/issues/5879

Will see, will see.

What problems you have faced and resolved with this change? I guess, nothing. But I'm already facing.

@tycooon
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your problem can be fixed by just deleting your version of Gemfile.lock before rebasing.
This fixes the problem of builds starting failing over time because some dependency got an update. I know that I can put all the versions in the gemspec, but this is hard to manage in case I want to update those dependencies. With Gemfile.lock in repo, I can just run bundle update.

@AlexWayfer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the problem of builds starting failing over time because some dependency got an update.

Which especially? RuboCop? You should to lock to patch-version (~> 0.79.0), not minor, for alpha-dependencies (0 major version), or not use them. This is wrote in SemVer guide. This is the issue.

I know that I can put all the versions in the gemspec, but this is hard to manage in case I want to update those dependencies.

If it hard — don't update your gem and dependencies of your gem, it's easy. If you want to update (to versions with breaking changes) — maintain your gem, update versions locks in gemspec and update your code for changes.

With Gemfile.lock in repo, I can just run bundle update.

Yep, but your gem is still broken for gem-users, which install it via gem install. In this case, with RuboCop, it's development dependency. But with runtime dependency… it's very dangerous. Please, think about it more.

Please sign in to comment.