Class: Pantograph::Actions::EnsureBundleExecAction
Overview
Raises an exception and stop the lane execution if not using bundle exec to run pantograph
Constant Summary
Pantograph::Action::AVAILABLE_CATEGORIES, Pantograph::Action::RETURN_TYPES
Class Method Summary
collapse
action_name, authors, deprecated_notes, lane_context, method_missing, other_action, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text
Class Method Details
.author ⇒ Object
43
44
45
|
# File 'pantograph/lib/pantograph/actions/ensure_bundle_exec.rb', line 43
def self.author
['rishabhtayal', 'johnknapprs']
end
|
.available_options ⇒ Object
35
36
37
|
# File 'pantograph/lib/pantograph/actions/ensure_bundle_exec.rb', line 35
def self.available_options
[]
end
|
.category ⇒ Object
58
59
60
|
# File 'pantograph/lib/pantograph/actions/ensure_bundle_exec.rb', line 58
def self.category
:misc
end
|
.description ⇒ Object
25
26
27
|
# 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 ⇒ Object
29
30
31
32
33
|
# 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 ⇒ Object
47
48
49
50
51
52
53
54
55
56
|
# 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) ⇒ Boolean
62
63
64
|
# File 'pantograph/lib/pantograph/actions/ensure_bundle_exec.rb', line 62
def self.is_supported?(platform)
true
end
|
.output ⇒ Object
39
40
41
|
# File 'pantograph/lib/pantograph/actions/ensure_bundle_exec.rb', line 39
def self.output
[]
end
|
.run(params) ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# 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
|