Class: StandardSingpass::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- StandardSingpass::Generators::InstallGenerator
- Defined in:
- lib/generators/standard_singpass/install/install_generator.rb
Overview
Installs StandardSingpass in a host Rails application.
Writes the initializer at ‘config/initializers/standard_singpass.rb` with the full configuration surface commented out so consumers know what’s available without being forced to wire everything up front.
Idempotent: re-running the generator skips an existing initializer unless ‘–force` is passed.
Instance Method Summary collapse
Instance Method Details
#copy_initializer ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/generators/standard_singpass/install/install_generator.rb', line 33 def copy_initializer initializer_path = "config/initializers/standard_singpass.rb" if File.exist?(File.join(destination_root, initializer_path)) && ![:force] say_status("identical", "#{initializer_path} (already exists; pass --force to overwrite)", :blue) return end template "initializer.rb.erb", initializer_path, force: [:force] end |