Class: EasyCreds::Installer

Inherits:
Object
  • Object
show all
Defined in:
lib/easy_creds/installer.rb

Constant Summary collapse

INITIALIZER_PATH =
'config/initializers/00_credentials_local_overlay.rb'
GITIGNORE_PATH =
'.gitignore'
GITIGNORE_RULE =
"/config/credentials/*.key\n"
INITIALIZER_CONTENT =
<<~RUBY
  # frozen_string_literal: true

  # Merge config/credentials/<env>_local.yml.enc on top of the base credentials.
  # The local overlay is gitignored and never pushed to 1Password — use it for
  # machine-specific overrides (e.g. a local database URL different from staging).
  require 'easy_creds/overlay'
  EasyCreds::Overlay.apply!(Rails.application)
RUBY

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ Installer

Returns a new instance of Installer.



19
20
21
# File 'lib/easy_creds/installer.rb', line 19

def initialize(root)
  @root = Pathname.new(root)
end

Instance Method Details

#runObject



23
24
25
26
# File 'lib/easy_creds/installer.rb', line 23

def run
  install_initializer
  install_gitignore
end