Class: GDK::Execute::Rake
- Inherits:
-
Object
- Object
- GDK::Execute::Rake
- Defined in:
- lib/gdk/execute/rake.rb
Overview
Rake adapter to execute tasks in GDK or Gitlab rails environment
Instance Attribute Summary collapse
-
#tasks ⇒ Object
readonly
Returns the value of attribute tasks.
Instance Method Summary collapse
-
#execute_in_gdk(**args) ⇒ Object
Execute rake tasks in the GDK root folder and environment.
-
#execute_in_gitlab(**args) ⇒ Object
Execute rake tasks in the ‘gitlab` rails environment.
-
#initialize(*tasks) ⇒ Rake
constructor
A new instance of Rake.
-
#success? ⇒ Boolean
Return whether the execution was a success or not.
Constructor Details
#initialize(*tasks) ⇒ Rake
Returns a new instance of Rake.
10 11 12 |
# File 'lib/gdk/execute/rake.rb', line 10 def initialize(*tasks) @tasks = tasks end |
Instance Attribute Details
#tasks ⇒ Object (readonly)
Returns the value of attribute tasks.
7 8 9 |
# File 'lib/gdk/execute/rake.rb', line 7 def tasks @tasks end |
Instance Method Details
#execute_in_gdk(**args) ⇒ Object
Execute rake tasks in the GDK root folder and environment
17 18 19 20 21 |
# File 'lib/gdk/execute/rake.rb', line 17 def execute_in_gdk(**args) @shellout = Shellout.new(rake_command, chdir: GDK.root).execute(**args) self end |
#execute_in_gitlab(**args) ⇒ Object
Execute rake tasks in the ‘gitlab` rails environment
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/gdk/execute/rake.rb', line 26 def execute_in_gitlab(**args) if bundler_available? Bundler.with_unbundled_env do @shellout = Shellout.new(rake_command, chdir: GDK.config.gitlab.dir).execute(**args) end else @shellout = Shellout.new(rake_command, chdir: GDK.config.gitlab.dir).execute(**args) end self end |
#success? ⇒ Boolean
Return whether the execution was a success or not
41 42 43 |
# File 'lib/gdk/execute/rake.rb', line 41 def success? @shellout&.success? end |