Sha256: 0cbf51cbcb14ce134bcba48781509b1b255faa25aae0e80b34caaec70cf63ea7

Contents?: true

Size: 741 Bytes

Versions: 2

Compression:

Stored size: 741 Bytes

Contents

::YARD::Templates::Engine.register_template_path File.dirname(__FILE__) + '/../templates'
require 'git'

# TODO (farleyknight@gmail.com): Rename this to yard-github
class YARD::Nowpunk
  class << self
    def parse_github_url_from_git_config
      remote_origin = Git.open(Dir.pwd).config["remote.origin.url"]
      @url ||= if remote_origin =~ /@/
                 gsub("git@", "").gsub(":", "/")
               else
                 gsub("git://", "")
               end
    end

    def project_name
      parse_github_url_from_git_config.match(/github\.com\/(.*)\/(.*)/)[2]
    end

    def github_url
      "http://" + parse_github_url_from_git_config
    end

    def github_master
      github_url + "/tree/master/"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yard-nowpunk-0.2.30 lib/yard-nowpunk.rb
yard-nowpunk-0.2.29 lib/yard-nowpunk.rb