Module: Appleseed::Generator::GithubMixin

Defined in:
lib/appleseed/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
19
20
# File 'lib/appleseed/generator/github_mixin.rb', line 4

def self.extended(generator)
  attr_accessor :github_username, :github_token

  generator.github_username           = generator.options[:github_username]
  generator.github_token              = generator.options[:github_token]
  generator.should_create_github_repository = !generator.options[:no_github]

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

Instance Method Details

#git_remoteObject



22
23
24
# File 'lib/appleseed/generator/github_mixin.rb', line 22

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

#homepageObject



26
27
28
# File 'lib/appleseed/generator/github_mixin.rb', line 26

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