Class: Gemkeeper::BundlerMirrorConfigurator
- Inherits:
-
Object
- Object
- Gemkeeper::BundlerMirrorConfigurator
- Defined in:
- lib/gemkeeper/bundler_mirror_configurator.rb
Overview
Configures Bundler mirror settings so private gem registries proxy through local Geminabox.
Instance Method Summary collapse
- #configure(output: $stdout) ⇒ Object
-
#initialize(candidates, port:, global:) ⇒ BundlerMirrorConfigurator
constructor
A new instance of BundlerMirrorConfigurator.
Constructor Details
#initialize(candidates, port:, global:) ⇒ BundlerMirrorConfigurator
Returns a new instance of BundlerMirrorConfigurator.
6 7 8 9 10 |
# File 'lib/gemkeeper/bundler_mirror_configurator.rb', line 6 def initialize(candidates, port:, global:) @remotes = candidates.filter_map { |c| c[:remote] if c[:source_type] == :private_gem }.uniq @local_url = "http://localhost:#{port}" @scope = global ? "--global" : "--local" end |
Instance Method Details
#configure(output: $stdout) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/gemkeeper/bundler_mirror_configurator.rb', line 12 def configure(output: $stdout) return if @remotes.empty? output.puts "" @remotes.each { |remote| configure_mirror(remote, output) } end |