Sha256: 0e4a1bfe6633161d5d077f001f1c56b0d14044db9ffa084a510eabd6e7e1750e

Contents?: true

Size: 507 Bytes

Versions: 9

Compression:

Stored size: 507 Bytes

Contents

require 'json'
require 'open-uri'

module LogCabin
  module Modules
    ##
    # Pull state from a GitHub tag
    module GithubTag
      include Prospectus.helpers.find(:regex)
      include Prospectus.helpers.find(:github_api)

      def load!
        fail('No repo specified') unless @repo
        @state.value = regex_helper(tag)
      end

      private

      def tag
        @tag ||= github_api.tags(@repo).first.name
      end

      def repo(value)
        @repo = value
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
prospectus-0.0.11 lib/prospectus/modules/github_tag.rb
prospectus-0.0.10 lib/prospectus/modules/github_tag.rb
prospectus-0.0.9 lib/prospectus/modules/github_tag.rb
prospectus-0.0.8 lib/prospectus/modules/github_tag.rb
prospectus-0.0.6 lib/prospectus/modules/github_tag.rb
prospectus-0.0.5 lib/prospectus/modules/github_tag.rb
prospectus-0.0.4 lib/prospectus/modules/github_tag.rb
prospectus-0.0.3 lib/prospectus/modules/github_tag.rb
prospectus-0.0.2 lib/prospectus/modules/github_tag.rb