Featured post
rubygems - conflicting ruby gems -
i need use 2 gems in project both claim pdf namespace: pdf-reader , htmldoc.
is there way them play nice together? way can think of rewrite own version of htmldoc give different namespace.
there's no elegant solution problem. if need 2 gems working side side think best option fork 1 of them (or possibly both) , use fork. how i'd go it:
- if either gem hosted on github fork it, or if both on github fork 1 seems least work.
- if neither gem on github, see if can hold of source (grabbing gem possibility, finding real repository might helpful there may other files there not included in gem), , put in repository on github. make sure gem's license allows (which if it's 1 of common open source licenses).
- make changes.
- make sure there
.gemspec
file in root of repository, next step not work otherwise. use bundler manage projects dependencies. instead of specifying dependency library you've modified
gem 'the_gem'
specify this:
gem 'the_gem', :git => 'git://github.com/you/the_gem.git'
(but change url repository actual one)
send e-mail maintainer of gem modified , ask him or consider merging in changes in next release.
bundler makes easy use alternative versions of gems minimal hassle. fork gems, fix bugs or add features, change gemfile
point version, ask maintainer merge in changes. when, or if, happens change gemfile
refer official version of gem.
an alternative strategy, if maintainer not want merge in changes , want distribute version others push version rubygems new gem, in case prefix gem name name, or other string identifies gem variant.
- Get link
- X
- Other Apps
Comments
Post a Comment