Sha256: b54bc4c04eff86d697027b4be3eed675640a5c29ba351882a0eda20429fc9204

Contents?: true

Size: 904 Bytes

Versions: 3

Compression:

Stored size: 904 Bytes

Contents

require 'logger'
require 'git-safe/ssh_tempfile'
require 'git-safe/private_key_file'
require 'git-safe/command_error'
require 'git-safe/git'
require 'git-safe/configuration'

module GitSafe
  class << self
    def init(work_tree, options = {})
      Git.new(work_tree, configuration.merge(options))
    end

    # A GitSafe configuration object. Must act like a hash and
    # return sensible values for all GitSafe configuration options.
    #
    # @see GitSafe::Configuration.
    attr_writer :configuration

    # The configuration object.
    #
    # @see GitSafe.configure
    def configuration
      @configuration ||= Configuration.new
    end

    # Call this method to modify defaults in your initializers.
    #
    # @example
    #   GitSafe.configure do |config|
    #     config.logger          = Logger.new(STDOUT)
    #   end
    def configure
      yield(configuration)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
git-safe-0.3.0 lib/git_safe.rb
git-safe-0.2.0 lib/git_safe.rb
git-safe-0.1.0 lib/git_safe.rb