Sha256: e3f818268eb90a1293a90269559328a5c2d694c210bf4236d5ce9b98f1d6fab5

Contents?: true

Size: 765 Bytes

Versions: 23

Compression:

Stored size: 765 Bytes

Contents

module Hackmac
  class OC
    def initialize(config:)
      @config = config
    end

    def remote
      @remote and return @remote
      source = @config.oc.source
      github = source.github
      auth = [ @config.github.user, @config.github.access_token ].compact
      auth.empty? and auth = nil
      suffix =
        case debug = source.debug?
        when true       then 'DEBUG'
        when false      then 'RELEASE'
        when nil        then nil
        end
      @remote = Hackmac::GithubSource.new(github, auth: auth, suffix: suffix)
    end

    def name
      remote.name
    end

    def version
      remote.version
    end

    def inspect
      "#<#{self.class}: #{to_s}>"
    end

    def to_s
      "#{name} #{version}"
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
hackmac-1.8.0 lib/hackmac/oc.rb
hackmac-1.7.1 lib/hackmac/oc.rb
hackmac-1.7.0 lib/hackmac/oc.rb
hackmac-1.6.1 lib/hackmac/oc.rb
hackmac-1.6.0 lib/hackmac/oc.rb
hackmac-1.5.1 lib/hackmac/oc.rb
hackmac-1.5.0 lib/hackmac/oc.rb
hackmac-1.4.2 lib/hackmac/oc.rb
hackmac-1.4.1 lib/hackmac/oc.rb
hackmac-1.4.0 lib/hackmac/oc.rb
hackmac-1.3.0 lib/hackmac/oc.rb
hackmac-1.2.1 lib/hackmac/oc.rb
hackmac-1.2.0 lib/hackmac/oc.rb
hackmac-1.1.3 lib/hackmac/oc.rb
hackmac-1.1.2 lib/hackmac/oc.rb
hackmac-1.1.1 lib/hackmac/oc.rb
hackmac-1.1.0 lib/hackmac/oc.rb
hackmac-1.0.5 lib/hackmac/oc.rb
hackmac-1.0.4 lib/hackmac/oc.rb
hackmac-1.0.3 lib/hackmac/oc.rb