Class: Bookbinder::RemoteYamlCredentialProvider
- Inherits:
-
Object
- Object
- Bookbinder::RemoteYamlCredentialProvider
- Defined in:
- lib/bookbinder/remote_yaml_credential_provider.rb
Instance Method Summary collapse
- #credentials ⇒ Object
-
#initialize(logger, repository, git_accessor = Git) ⇒ RemoteYamlCredentialProvider
constructor
A new instance of RemoteYamlCredentialProvider.
Constructor Details
#initialize(logger, repository, git_accessor = Git) ⇒ RemoteYamlCredentialProvider
Returns a new instance of RemoteYamlCredentialProvider.
6 7 8 9 10 |
# File 'lib/bookbinder/remote_yaml_credential_provider.rb', line 6 def initialize(logger, repository, git_accessor = Git) @logger = logger @repository = repository @git_accessor = git_accessor end |
Instance Method Details
#credentials ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/bookbinder/remote_yaml_credential_provider.rb', line 12 def credentials @logger.log "Processing #{@repository.full_name.cyan}" Dir.mktmpdir do |destination_dir| @repository.copy_from_remote(destination_dir, @git_accessor) cred_file_yaml = File.join(destination_dir, @repository.short_name, 'credentials.yml') YAML.load_file(cred_file_yaml) end end |