Class: HappySeed::Generators::GithubGenerator
- Inherits:
-
HappySeedGenerator
- Object
- Rails::Generators::Base
- HappySeedGenerator
- HappySeed::Generators::GithubGenerator
- Defined in:
- lib/generators/happy_seed/github/github_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.fingerprint ⇒ Object
8 9 10 |
# File 'lib/generators/happy_seed/github/github_generator.rb', line 8 def self.fingerprint gem_available? 'omniauth-github' end |
Instance Method Details
#install_github ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/generators/happy_seed/github/github_generator.rb', line 12 def install_github return if already_installed require_generator OmniauthGenerator gem 'omniauth-github' gem 'octokit' Bundler.with_clean_env do run "bundle install --without production" end directory 'docs' add_omniauth :github, "user", "Octokit" gsub_file( 'app/models/user.rb', /Octokit.*/, "Octokit::Client.new(access_token: github.accesstoken)" ) end |