Class: J1App::Commands

Inherits:
Object
  • Object
show all
Defined in:
lib/j1_app/j1_auth_manager/commands.rb

Constant Summary collapse

FILES =
%w(Rakefile config.ru .gitignore dotenv).freeze
VARS =
%w(client_id client_secret team_id org_name).freeze

Class Method Summary collapse

Class Method Details

.env_var_set?(var) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/j1_app/j1_auth_manager/commands.rb', line 13

def self.env_var_set?(var)
  !ENV[var].to_s.blank?
end

.execute_command(*args) ⇒ Object



7
8
9
10
11
# File 'lib/j1_app/j1_auth_manager/commands.rb', line 7

def self.execute_command(*args)
  output, status = Open3.capture2e(*args)
  raise "Command `#{args.join(" ")}` failed: #{output}" unless status.exitstatus.zero?
  output
end