The celluloid/culture
sub-module needs to be updated in every repository which uses it, and integrations between all the gems in Celluloid's core suite began to need greater efficiency in handling many gems at once. This lead to the birth of Celluloid::Sync
and its automation of several otherwise tedious tasks.
Running bundle
or rspec
will trigger Celluloid::Sync
automatically, without slowing you down.
1. It adds the gem you're in to the $LOADPATH
.
2. It tries to find the VERSION
constant for the current gem and load it.
This allows easy inclusion of VERSION
in gemspec, without individually including the required file first.
3. It updates the celluloid/culture
sub-module.
Whenever bundle
is run, the culture/
directory is synchronized with the repository before it's used any further.
4. It keeps Gemfile
and gemspec
requirements up to date.
Avoid circular dependency errors, but still have the power to use locally sourced repositories.
Add the line above to the top of both files, before everything else:
require File.expand_path("../culture/sync", __FILE__)
You only have one other line to add, other than line above ... right before the closing end
in the file:
require File.expand_path("../culture/sync", __FILE__)
Gem::Specification.new do |gem|
# ...
# ...
# Keep in mind, the VERSION constant of this gem ought to be loaded.
# ...
# ...
Celluloid::Sync::Gemspec[gem]
end
Similar to gemspec
above, you have only two bits to add. The second line we're adding goes at the very end, or at least after gemspec
is called:
require File.expand_path("../culture/sync", __FILE__)
# ...
# below any calls to `gemspec`
# below any other gems
# ...
Celluloid::Sync::Gemfile[self]