Module: Jeweler::Generator::GithubMixin

Defined in:
lib/jeweler/generator/github_mixin.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(generator) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/jeweler/generator/github_mixin.rb', line 4

def self.extended(generator)
  generator.github_username           = generator.options[:github_username]
  generator.github_token              = generator.options[:github_token]
  generator.should_create_remote_repo = generator.options[:create_repo]

  unless generator.github_username
    raise NoGitHubUser
  end
  
  if generator.should_create_remote_repo
    unless generator.github_token
      raise NoGitHubToken
    end
  end
end

Instance Method Details

#git_remoteObject



20
21
22
# File 'lib/jeweler/generator/github_mixin.rb', line 20

def git_remote
  @git_remote ||= "[email protected]:#{github_username}/#{project_name}.git"
end

#homepageObject



24
25
26
# File 'lib/jeweler/generator/github_mixin.rb', line 24

def homepage
  @homepage ||= "http://github.com/#{github_username}/#{project_name}"
end