Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Extracting a new "GemInstaller" from installer.rb #4063

Merged
merged 1 commit into from Nov 18, 2015

Conversation

A5308Y
Copy link
Contributor

@A5308Y A5308Y commented Oct 17, 2015

My goal was to reveal the main part of install_gem_from_spec. From my
perspective the main part is:

  1. Install
  2. Generate stubs
  3. Print message to the user
    (4. handle exceptions)

While working on it I found that Bundler::Installer's run method and
instance variables weren't used when installing gems with
install_gem_from_spec. The installer was (and still is) only used to
generate executable stubs.
So I inserted the new GemInstaller in ParallelInstaller; passing the
instantiated Bundler::Installer to the GemInstaller only to generate
the executable stubs.

Based on this I would continue by extracting two BinstubGenerator
classes and removing GemInstaller's dependency on Bundler::Installer,
possibly allowing for a more concise way to generate binstubs in other
parts of bundler.

I was a bit intimidated by the amount of installers and weary to add
another one to this contested namespace. So I checked in with
@indirect who approved of the general direction of the refactoring and
suggested to rename the old GemInstaller to RubyGemsGemInstaller.

@segiddins
Copy link
Member

👍🏻 I like

@segiddins
Copy link
Member

@indirect r+?

@indirect
Copy link
Member

@homu r+

@homu
Copy link
Contributor

homu commented Oct 21, 2015

📌 Commit 868a5a8 has been approved by indirect

@homu
Copy link
Contributor

homu commented Oct 21, 2015

⌛ Testing commit 868a5a8 with merge a792eb5...

homu added a commit that referenced this pull request Oct 21, 2015
Extracting a new "GemInstaller" from installer.rb

My goal was to reveal the main part of install_gem_from_spec. From my
perspective the main part is:
1. Install
2. Generate stubs
3. Print message to the user
(4. handle exceptions)

While working on it I found that Bundler::Installer's run method and
instance variables weren't used when installing gems with
install_gem_from_spec. The installer was (and still is) only used to
generate executable stubs.
So I inserted the new GemInstaller in ParallelInstaller; passing the
instantiated Bundler::Installer to the GemInstaller only to generate
the executable stubs.

Based on this I would continue by extracting two BinstubGenerator
classes and removing GemInstaller's dependency on Bundler::Installer,
possibly allowing for a more concise way to generate binstubs in other
parts of bundler.

I was a bit intimidated by the amount of installers and weary to add
another one to this contested namespace. So I checked in with
@indirect who approved of the general direction of the refactoring and
suggested to rename the old GemInstaller to RubyGemsGemInstaller.
@homu
Copy link
Contributor

homu commented Oct 21, 2015

💔 Test failed - status

@indirect
Copy link
Member

@A5308Y can you fix the failing tests? At least one is RuboCop, I'm not sure about the rest. Thanks!

@A5308Y
Copy link
Contributor Author

A5308Y commented Oct 27, 2015

Sorry for the delay. I had a bike accident and hurt my dominant hand. I didn't even look at github-things for quite a while now. It's a lot better now. I still have to type carefully though. I see what I can do today in the (European) evening.

Regarding the failure:
Rubocop says not to rescue Exception but StandardError. Exception was rescued before. So I guess my change only allowed to see it.
Would rescuing StandardError a functionality change in bundler? Would that be covered by the specs?

@segiddins
Copy link
Member

Just doing rescue => e should be sufficient

@indirect
Copy link
Member

I think it was a big that we previously rescued Exception, since that would stop ctrl-c from working. Let's change to StandardError (which is the default, and so you can just rescue => e like @segiddins said).

perspective the main part is:
1. Install
2. Generate stubs
3. Print message to the user
(4. handle exceptions)

While working on it I found that Bundler::Installer's run method and
instance variables weren't used when installing gems with
install_gem_from_spec. The installer was (and still is) only used to
generate executable stubs.
So I inserted the new GemInstaller in ParallelInstaller; passing the
instantiated Bundler::Installer to the GemInstaller only to generate
the executable stubs.

Based on this I would continue by extracting two BinstubGenerator
classes and removing GemInstaller's dependency on Bundler::Installer,
possibly allowing for a more concise way to generate binstubs in other
parts of bundler.

I was a bit intimidated by the amount of installers and weary to add
another one to this contested namespace. So I checked in with
@indirect who approved of the general direction of the refactoring and
suggested to rename the old GemInstaller to RubyGemsGemInstaller.
@A5308Y
Copy link
Contributor Author

A5308Y commented Oct 29, 2015

@indirect @segiddins I fixed this on Tuesday and just realized that there might not have been a notification. So, this is it.

@segiddins
Copy link
Member

🚢

@A5308Y
Copy link
Contributor Author

A5308Y commented Nov 4, 2015

Hmm. Long time no comment. Can I do something to help the process?

@segiddins
Copy link
Member

@homu r+

@homu
Copy link
Contributor

homu commented Nov 4, 2015

📌 Commit f7ee5ae has been approved by segiddins

@homu
Copy link
Contributor

homu commented Nov 5, 2015

⌛ Testing commit f7ee5ae with merge b4ff4c4...

homu added a commit that referenced this pull request Nov 5, 2015
Extracting a new "GemInstaller" from installer.rb

My goal was to reveal the main part of install_gem_from_spec. From my
perspective the main part is:
1. Install
2. Generate stubs
3. Print message to the user
(4. handle exceptions)

While working on it I found that Bundler::Installer's run method and
instance variables weren't used when installing gems with
install_gem_from_spec. The installer was (and still is) only used to
generate executable stubs.
So I inserted the new GemInstaller in ParallelInstaller; passing the
instantiated Bundler::Installer to the GemInstaller only to generate
the executable stubs.

Based on this I would continue by extracting two BinstubGenerator
classes and removing GemInstaller's dependency on Bundler::Installer,
possibly allowing for a more concise way to generate binstubs in other
parts of bundler.

I was a bit intimidated by the amount of installers and weary to add
another one to this contested namespace. So I checked in with
@indirect who approved of the general direction of the refactoring and
suggested to rename the old GemInstaller to RubyGemsGemInstaller.
@barosl
Copy link

barosl commented Nov 5, 2015

Strangely, it seems that the problem persists. So the previous problem was not transient.

The status for #4077 (9 days ago) was correctly reported by Travis as you can see in here, but starting with #4085 (6 days ago) the API shows nothing. So do the recent two PRs, including the current PR.

Did you happen to change the configuration for Travis and/or GitHub, maybe around 7 days ago?

@indirect
Copy link
Member

indirect commented Nov 6, 2015

@barosl that's really, really strange. The Travis build log shows the merge for #4085 being built, and even references the correct commit: https://travis-ci.org/bundler/bundler/builds/88536039. Maybe Travis has a bug and is not reporting back to Github correctly? I'll check with them.

@segiddins
Copy link
Member

@homu retry

@homu
Copy link
Contributor

homu commented Nov 12, 2015

⌛ Testing commit f7ee5ae with merge 3a4e927...

homu added a commit that referenced this pull request Nov 12, 2015
Extracting a new "GemInstaller" from installer.rb

My goal was to reveal the main part of install_gem_from_spec. From my
perspective the main part is:
1. Install
2. Generate stubs
3. Print message to the user
(4. handle exceptions)

While working on it I found that Bundler::Installer's run method and
instance variables weren't used when installing gems with
install_gem_from_spec. The installer was (and still is) only used to
generate executable stubs.
So I inserted the new GemInstaller in ParallelInstaller; passing the
instantiated Bundler::Installer to the GemInstaller only to generate
the executable stubs.

Based on this I would continue by extracting two BinstubGenerator
classes and removing GemInstaller's dependency on Bundler::Installer,
possibly allowing for a more concise way to generate binstubs in other
parts of bundler.

I was a bit intimidated by the amount of installers and weary to add
another one to this contested namespace. So I checked in with
@indirect who approved of the general direction of the refactoring and
suggested to rename the old GemInstaller to RubyGemsGemInstaller.
@homu
Copy link
Contributor

homu commented Nov 12, 2015

💔 Test failed - status

@segiddins
Copy link
Member

@homu retry

@homu
Copy link
Contributor

homu commented Nov 17, 2015

⌛ Testing commit f7ee5ae with merge 7be4f29...

homu added a commit that referenced this pull request Nov 17, 2015
Extracting a new "GemInstaller" from installer.rb

My goal was to reveal the main part of install_gem_from_spec. From my
perspective the main part is:
1. Install
2. Generate stubs
3. Print message to the user
(4. handle exceptions)

While working on it I found that Bundler::Installer's run method and
instance variables weren't used when installing gems with
install_gem_from_spec. The installer was (and still is) only used to
generate executable stubs.
So I inserted the new GemInstaller in ParallelInstaller; passing the
instantiated Bundler::Installer to the GemInstaller only to generate
the executable stubs.

Based on this I would continue by extracting two BinstubGenerator
classes and removing GemInstaller's dependency on Bundler::Installer,
possibly allowing for a more concise way to generate binstubs in other
parts of bundler.

I was a bit intimidated by the amount of installers and weary to add
another one to this contested namespace. So I checked in with
@indirect who approved of the general direction of the refactoring and
suggested to rename the old GemInstaller to RubyGemsGemInstaller.
@homu
Copy link
Contributor

homu commented Nov 18, 2015

☀️ Test successful - status

@homu homu merged commit f7ee5ae into rubygems:master Nov 18, 2015
@coilysiren coilysiren modified the milestone: Release Archive Oct 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants