class Creategem::Repository

Constants

REPOSITORIES

Attributes

gem_server_url[R]
name[R]
private[R]
user[R]
user_email[R]
user_name[R]
vendor[R]

Public Class Methods

new(options) click to toggle source
# File lib/creategem/repository.rb, line 10
def initialize(options)
  @vendor = options[:vendor]
  @private = options[:private]
  @name = options[:name]
  @user = options[:user]
  @user_name = ::Git.global_config "user.name"
  @user_email = ::Git.global_config "user.email"
  @gem_server_url = options[:gem_server_url]
  @private = options[:private]
end

Public Instance Methods

bitbucket?() click to toggle source
# File lib/creategem/repository.rb, line 25
def bitbucket?
  vendor == :bitbucket
end
github?() click to toggle source
# File lib/creategem/repository.rb, line 21
def github?
  vendor == :github
end
origin() click to toggle source
# File lib/creategem/repository.rb, line 42
def origin
  "git@#{REPOSITORIES[vendor]}:#{user}/#{name}.git"
end
private?() click to toggle source

this could change later. For now all private repositories are on bitbucket and all private ones on github

# File lib/creategem/repository.rb, line 30
def private?
  self.private
end
public?() click to toggle source
# File lib/creategem/repository.rb, line 34
def public?
  !private?
end
url() click to toggle source
# File lib/creategem/repository.rb, line 38
def url
  "https://#{REPOSITORIES[vendor]}/#{user}/#{name}"
end