Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Allow gem to be installed from source #305

Merged
merged 2 commits into from
Nov 6, 2024

Conversation

javierjulio
Copy link
Contributor

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

In #303 I was asked to install the gem in my Gemfile from source to confirm a bug fix but I encountered two bundle install errors that prevented that. I had to make these changes to be able to successfully install from source.

Describe the solution you've provided

Do not depend on rake in the gemspec as there is no need too. Replacing Rake's FileList with Ruby's Dir is a common use for the affected line and can be seen in many popular gemspecs.

Describe alternatives you've considered

I didn't consider any alternatives because it would be best to not depend on an unnecessary dependency (e.g. rake) in the gemspec file. This also follows what is commonly done in other Ruby gems so it's well supported.

This causes an error on bundle install when installing the gem from source.

16.66 [!] There was an error while loading `launchdarkly-server-sdk.gemspec`: cannot load such file -- rake. Bundler cannot continue.
16.66 
16.66  #  from /usr/local/bundle/ruby/3.3.0/bundler/gems/ruby-server-sdk-c7080edbad3a/launchdarkly-server-sdk.gemspec:6
16.66  #  -------------------------------------------
16.66  #  require "ldclient-rb/version"
16.66  >  require "rake"
16.66  #  
16.66  #  -------------------------------------------
This causes an error on bundle install when installing the gem from source. FileList comes from Rake but it's unnecessary as Dir is a very common use in popular gemspecs.

[!] There was an error while loading `launchdarkly-server-sdk.gemspec`: uninitialized constant FileList. Bundler cannot continue.

 #  from /Users/j.julio/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/bundler/gems/launchdarkly-ruby-server-sdk-b8220416fe3f/launchdarkly-server-sdk.gemspec:18
 #  -------------------------------------------
 #  
 >    spec.files         = FileList["lib/**/*", "README.md", "LICENSE.txt"]
 #    spec.executables   = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
 #  -------------------------------------------
@javierjulio javierjulio requested a review from a team as a code owner November 5, 2024 22:31
@javierjulio javierjulio changed the title Allow gem to be installed from source fix: Allow gem to be installed from source Nov 5, 2024
@keelerm84 keelerm84 merged commit 76d06bc into launchdarkly:main Nov 6, 2024
6 of 7 checks passed
@keelerm84
Copy link
Member

Thank you for your contribution!

keelerm84 pushed a commit that referenced this pull request Nov 6, 2024
🤖 I have created a release *beep* *boop*
---


##
[8.8.2](8.8.1...8.8.2)
(2024-11-06)


### Bug Fixes

* Allow gem to be installed from source
([#305](#305))
([76d06bc](76d06bc))
* Improve DataKind eql? to consider object type
([#304](#304))
([5893245](5893245))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants