Class: Cli::Commands::NewApp::Files::Irbrc

Inherits:
Object
  • Object
show all
Defined in:
lib/cli/commands/new_app/files/irbrc.rb

Class Method Summary collapse

Class Method Details

.callObject



8
9
10
# File 'lib/cli/commands/new_app/files/irbrc.rb', line 8

def self.call
  File.write(".irbrc", content)
end

.contentObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/cli/commands/new_app/files/irbrc.rb', line 12

def self.content
  "    # frozen_string_literal: true\n\n    # Kirei needs to know where the root of the project is\n    APP_ROOT = File.expand_path(__dir__)\n\n    ENV[\"RACK_ENV\"] ||= \"development\"\n    ENV[\"APP_VERSION\"] ||= (ENV[\"GIT_SHA\"] ||= `git rev-parse --short HEAD`.to_s.chomp.freeze)\n    require(\"dotenv/load\") if %w[test development].include?(ENV[\"RACK_ENV\"])\n    require_relative(\"app\")\n  RUBY\nend\n"