Class: EacGit::Local::Subrepo

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_git/local/subrepo.rb

Overview

A git-subrepo (https://github.com/ingydotnet/git-subrepo) in a [EacGit::Local].

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.sanitize_subpath(subpath) ⇒ String

Parameters:

  • subpath (Pathname, String)

Returns:

  • (String)


13
14
15
# File 'lib/eac_git/local/subrepo.rb', line 13

def sanitize_subpath(subpath)
  subpath.to_pathname.to_path.gsub(%r{/+$}, '').to_pathname
end

Instance Method Details

#command(subrepo_subcommand, *subrepo_subcommand_args) ⇒ Object



24
25
26
27
# File 'lib/eac_git/local/subrepo.rb', line 24

def command(subrepo_subcommand, *subrepo_subcommand_args)
  local.command('subrepo', subrepo_subcommand, subpath.to_path,
                *subrepo_subcommand_args)
end

#write_configObject



31
32
33
# File 'lib/eac_git/local/subrepo.rb', line 31

def write_config
  config_absolute_path.write(config.to_content)
end