Class: BunnyApp::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/bunny_app/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_configuration_fileObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/generators/bunny_app/install_generator.rb', line 7

def create_configuration_file
  initializer 'bunny_app.rb' do
    "      # Specifies configuration options for the Bunny gem.\n      BunnyApp.config do |c|\n\n        # This is where your API credentials go. You should almost certainly not have it\n        # committed to source control, but instead load it from a secret store.\n        c.client_id = ENV['BUNNY_APP_CLIENT_ID']\n        c.client_secret = ENV['BUNNY_APP_CLIENT_SECRET']\n        c.scope = ENV['BUNNY_APP_SCOPE']\n\n        # Base URI for the Bunny API\n        c.base_uri = 'https://<subdomain>.bunny.com'\n\n        # Optional.\n        # Use this instead of client_id/secret if you dont care about the token expiring\n        # c.access_token = ENV['BUNNY_APP_ACCESS_TOKEN']\n\n      end\n    CONFIG\n  end\nend\n"