Sha256: 5b52243023aff424409f37f93934e898c39f66eb0fc9525cd2185af1bb30d6a5

Contents?: true

Size: 993 Bytes

Versions: 8

Compression:

Stored size: 993 Bytes

Contents

# frozen_string_literal: true

require 'bundler'
require 'generators/boring/oauth/base_generator'

module Boring
  module Oauth
    module Twitter
      class InstallGenerator < Rails::Generators::Base
        include Boring::Oauth::BaseGenerator

        class MissingDeviseConfigurationError < StandardError; end

        desc "Adds Twitter OmniAuth to the application"
        source_root File.expand_path("templates", __dir__)

        def add_twitter_omniauth_gem
          say "Adding Twitter OmniAuth gem", :green
          Bundler.with_unbundled_env do
            run "bundle add omniauth-twitter"
          end
        end

        def invoke_common_generator_methods
          @oauth_name = :twitter
          add_provider_and_uuid_user_details
          configure_devise_omniauth
          add_omniauth_callback_routes
          add_omniauth_callback_controller
          configure_and_add_devise_setting_in_user_model
          show_readme
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
boring_generators-0.15.0 lib/generators/boring/oauth/twitter/install/install_generator.rb
boring_generators-0.14.0 lib/generators/boring/oauth/twitter/install/install_generator.rb
boring_generators-0.13.0 lib/generators/boring/oauth/twitter/install/install_generator.rb
boring_generators-0.12.0 lib/generators/boring/oauth/twitter/install/install_generator.rb
boring_generators-0.11.0 lib/generators/boring/oauth/twitter/install/install_generator.rb
boring_generators-0.10.0 lib/generators/boring/oauth/twitter/install/install_generator.rb
boring_generators-0.9.0 lib/generators/boring/oauth/twitter/install/install_generator.rb
boring_generators-0.8.0 lib/generators/boring/oauth/twitter/install/install_generator.rb