Allow installing RDoc from a git source#1113
Conversation
| task :generate do | ||
| unless ENV.key?('BUNDLE_GEMFILE') | ||
| Gem.install 'racc', '> 1.4.10' | ||
| Gem.install 'kpeg', '>= 1.3.3' |
There was a problem hiding this comment.
@colby-swandale do you know if there's any rubygems API to better handle these dependencies without bundler?
There was a problem hiding this comment.
Could you expand the context where Bundler wouldn't be available?
There was a problem hiding this comment.
Bundler will be available, but this will be executed in 2 scenarios:
- When a developer runs
rake generate(or any tasks that depend on it) manually - When a user installs RDoc through git source
In the later case, I want to avoid installing all of RDoc's development dependencies as most of them aren't needed for generating the missing files.
|
@nobu Thanks for the suggestions 👍 |
|
@nobu Would you mind giving this another look? If you're not against it, I'd like to give it a try. |
Co-authored-by: Vinicius Stock <vinistock@users.noreply.github.com>
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
This does not work, at least when I tested it. The problem is, The fix is: git_path = File.expand_path("../../.git", __dir__)
if File.exist?(git_path)
system("rake generate")
endAt least that gets us to the next issue: |
|
Would it be crazy to do this: # rdoc.gemspec
if ENV["RDOC_FROM_SOURCE"] # or something better???
gem "kpeg"
... |
This implements option 2 in #1107, which is to use
extconf.rbto conditionally runrake generatewhen the gem is installed as a git source.To make sure the target machine has the required dependencies for the generation, I modified
rake generateto conditionally install thekpegandracc.