class Pantograph::Actions::EnsureBundleExecAction

Raises an exception and stop the lane execution if not using bundle exec to run pantograph

Public Class Methods

author() click to toggle source
# File pantograph/lib/pantograph/actions/ensure_bundle_exec.rb, line 43
def self.author
  ['rishabhtayal', 'johnknapprs']
end
available_options() click to toggle source
# File pantograph/lib/pantograph/actions/ensure_bundle_exec.rb, line 35
def self.available_options
  []
end
category() click to toggle source
# File pantograph/lib/pantograph/actions/ensure_bundle_exec.rb, line 58
def self.category
  :misc
end
description() click to toggle source

@!group Documentation

# File pantograph/lib/pantograph/actions/ensure_bundle_exec.rb, line 25
def self.description
  'Raises an exception if not using `bundle exec` to run pantograph'
end
details() click to toggle source
# File pantograph/lib/pantograph/actions/ensure_bundle_exec.rb, line 29
def self.details
  [
    'This action will check if you are using bundle exec to run pantograph.'
  ].join("\n")
end
example_code() click to toggle source
# File pantograph/lib/pantograph/actions/ensure_bundle_exec.rb, line 47
def self.example_code
  [
    'ensure_bundle_exec',
    ' # always check before running a lane
    before_all do
      ensure_bundle_exec
    end
    '
  ]
end
is_supported?(platform) click to toggle source
# File pantograph/lib/pantograph/actions/ensure_bundle_exec.rb, line 62
def self.is_supported?(platform)
  true
end
output() click to toggle source
# File pantograph/lib/pantograph/actions/ensure_bundle_exec.rb, line 39
def self.output
  []
end
run(params) click to toggle source
# File pantograph/lib/pantograph/actions/ensure_bundle_exec.rb, line 5
def self.run(params)
  return if PluginManager.new.gemfile_path.nil?
  if PantographCore::Helper.bundler?
    UI.success('Using bundled pantograph ✅')
  else
    error_message = [
      'pantograph detected a Gemfile in the current directory.',
      'However it seems like you did not use `bundle exec`.',
      "Use `bundle exec pantograph #{ARGV.join(' ')}`"
    ]
    error_message = error_message.join(' ')

    UI.user_error!(error_message)
  end
end