Skip to content

Commit

Permalink
Use fast_ignore 💖
Browse files Browse the repository at this point in the history
  • Loading branch information
utkarsh2102 committed Jun 3, 2020
1 parent f264a14 commit 6cc677d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions batalert.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'batalert/version'
require 'fast_ignore'

Gem::Specification.new do |spec|
spec.name = "batalert"
Expand All @@ -11,14 +12,15 @@ Gem::Specification.new do |spec|
spec.license = "MIT"
spec.summary = %q{Battery notifications/alerts for your favorite WM! 💯}
spec.homepage = "https://github.com/utkarsh2102/batalert"
spec.files = Dir["config/*", "exe/*", "lib/**/*", "LICENSE", "README.md"]
spec.executables = Dir.glob("exe/*").map{ |f| File.basename(f) }
spec.files = FastIgnore.new(include_rules: ["config/*", "exe/*", "lib/**/*", "LICENSE", "README.md"], relative: true).sort
spec.executables = FastIgnore.new(include_rules: ["exe/*"]).map{ |f| File.basename(f) }
spec.bindir = "exe"
spec.require_paths = ["lib"]
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")

spec.add_dependency 'espeak-ruby'
spec.add_dependency 'libnotify'
spec.add_development_dependency 'fast_ignore'
spec.add_development_dependency 'whenever'
spec.add_development_dependency 'minitest'
spec.add_development_dependency 'rake'
Expand Down

3 comments on commit 6cc677d

@utkarsh2102
Copy link
Owner Author

Choose a reason for hiding this comment

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

Hi @deivid-rodriguez,

I neeeed help here!
Whilst this seems perfectly okay, syntax-wise, I can't seem to figure out why the CI is failing!?
Is it not the right way to do stuff? Or am I missing something very obvious?

@deivid-rodriguez
Copy link

Choose a reason for hiding this comment

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

Using a dependency of your library inside the gemspec itself is... problematic. I haven't looked at your CI error, but I wouldn't expect it to work because bundler needs to evaluate the gemspec before it is able to setup the $LOAD_PATH and everything else so that you can require your dependency. So, I would stick to Dir.glob here.

If we were to implement something like this in bundler/rubygems, we would need to vendor the fast_ignore code because dependency managers are not allowed to have any dependencies due to chicken and egg issues.

@utkarsh2102
Copy link
Owner Author

Choose a reason for hiding this comment

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

Using a dependency of your library inside the gemspec itself is... problematic. I haven't looked at your CI error, but I wouldn't expect it to work because bundler needs to evaluate the gemspec before it is able to setup the $LOAD_PATH and everything else so that you can require your dependency. So, I would stick to Dir.glob here.

Ah! I now understand this!
Thank you, you da best ❤️

If we were to implement something like this in bundler/rubygems, we would need to vendor the fast_ignore code because dependency managers are not allowed to have any dependencies due to chicken and egg issues.

Got it! I'll probably talk about this on Thursday then \o/

Please sign in to comment.