Class: Chamber::Commands::Initialize
- Defined in:
- lib/chamber/commands/initialize.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options = {}) ⇒ Initialize
constructor
A new instance of Initialize.
Constructor Details
#initialize(options = {}) ⇒ Initialize
Returns a new instance of Initialize.
8 9 10 11 12 |
# File 'lib/chamber/commands/initialize.rb', line 8 def initialize( = {}) super self.basepath = [:basepath] end |
Class Method Details
.call(options = {}) ⇒ Object
28 29 30 |
# File 'lib/chamber/commands/initialize.rb', line 28 def self.call( = {}) self.new().call end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/chamber/commands/initialize.rb', line 14 def call shell.create_file private_key_filepath, rsa_private_key.to_pem shell.create_file public_key_filepath, rsa_public_key.to_pem `chmod 600 #{private_key_filepath}` `chmod 644 #{public_key_filepath}` unless ::File.read(gitignore_filepath).match(/^.chamber.pem$/) shell.append_to_file gitignore_filepath, private_key_filepath.basename end shell.copy_file settings_template_filepath, settings_filepath end |