Skip to content

Commit

Permalink
r10k::module::git: expose remote as getter
Browse files Browse the repository at this point in the history
This allows us to access the remote property to figure out the git URI
for a module:

```
$ bundle exec irb
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
irb(main):001:0> require 'json'
=> true
irb(main):002:0> require 'r10k/module_loader/puppetfile'
=> true
irb(main):003:0> puppetfile = R10K::ModuleLoader::Puppetfile.new(basedir: '/home/bastelfreak/code/controlrepo/').load
=>
{:modules=>
...
irb(main):004:0> mod = puppetfile[:modules].map {|mod| mod if mod.class == R10K::Module::Git}.compact.first
=>
...
irb(main):005:0> mod.remote
=> "https://github.com/voxpupuli/puppet-borg"
irb(main):006:0>
```
  • Loading branch information
bastelfreak committed Mar 29, 2024
1 parent 04b594d commit 78fce97
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/r10k/module/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ def self.statically_defined_version(name, args)
# @return [String]
attr_reader :default_override_ref

# @!attribute[r] remote
# @api private
# @return [String]
attr_reader :remote

include R10K::Util::Setopts

def initialize(title, dirname, opts, environment=nil)
Expand Down

0 comments on commit 78fce97

Please sign in to comment.