Class: Libconsole::CI::Github::Attr
- Inherits:
-
Object
- Object
- Libconsole::CI::Github::Attr
- Defined in:
- lib/libconsole/ci/github.rb
Overview
github.com/actions/toolkit/blob/main/packages/core/__tests__/core.test.ts github attr_accessor
Instance Attribute Summary collapse
-
#github_env ⇒ Object
Returns the value of attribute github_env.
-
#github_output ⇒ Object
(also: #output)
Returns the value of attribute github_output.
-
#github_path ⇒ Object
Returns the value of attribute github_path.
-
#github_state ⇒ Object
(also: #state)
Returns the value of attribute github_state.
-
#github_step_summary ⇒ Object
(also: #summary)
Returns the value of attribute github_step_summary.
-
#runner_debug ⇒ Object
Returns the value of attribute runner_debug.
Instance Method Summary collapse
- #add_path(path) ⇒ Object
- #debug? ⇒ Boolean
- #export_variable(key, val) ⇒ Object
-
#initialize ⇒ Attr
constructor
A new instance of Attr.
- #input_(*argv) ⇒ Object
- #state_(*argv) ⇒ Object
Constructor Details
#initialize ⇒ Attr
Returns a new instance of Attr.
83 84 85 86 87 88 89 90 91 |
# File 'lib/libconsole/ci/github.rb', line 83 def initialize @github_path = ENV["GITHUB_PATH"] || "" @github_env = ENV["GITHUB_ENV"] ? ENV["GITHUB_ENV"] + "\n" : "" @github_step_summary = ENV["GITHUB_STEP_SUMMARY"] @github_state = ENV["GITHUB_STATE"] @github_output = ENV["GITHUB_OUTPUT"] @runner_debug = ENV["RUNNER_DEBUG"] end |
Instance Attribute Details
#github_env ⇒ Object
Returns the value of attribute github_env.
74 75 76 |
# File 'lib/libconsole/ci/github.rb', line 74 def github_env @github_env end |
#github_output ⇒ Object Also known as: output
Returns the value of attribute github_output.
74 75 76 |
# File 'lib/libconsole/ci/github.rb', line 74 def github_output @github_output end |
#github_path ⇒ Object
Returns the value of attribute github_path.
74 75 76 |
# File 'lib/libconsole/ci/github.rb', line 74 def github_path @github_path end |
#github_state ⇒ Object Also known as: state
Returns the value of attribute github_state.
74 75 76 |
# File 'lib/libconsole/ci/github.rb', line 74 def github_state @github_state end |
#github_step_summary ⇒ Object Also known as: summary
Returns the value of attribute github_step_summary.
74 75 76 |
# File 'lib/libconsole/ci/github.rb', line 74 def github_step_summary @github_step_summary end |
#runner_debug ⇒ Object
Returns the value of attribute runner_debug.
74 75 76 |
# File 'lib/libconsole/ci/github.rb', line 74 def runner_debug @runner_debug end |
Instance Method Details
#add_path(path) ⇒ Object
93 94 95 |
# File 'lib/libconsole/ci/github.rb', line 93 def add_path(path) @github_path = _path_arr(@github_path).push(path).join(":") end |
#debug? ⇒ Boolean
123 124 125 |
# File 'lib/libconsole/ci/github.rb', line 123 def debug? @runner_debug end |
#export_variable(key, val) ⇒ Object
97 98 99 |
# File 'lib/libconsole/ci/github.rb', line 97 def export_variable(key, val) @github_env += "#{key}=#{val}\n" end |
#input_(*argv) ⇒ Object
101 102 103 104 105 106 107 108 109 110 |
# File 'lib/libconsole/ci/github.rb', line 101 def input_(*argv) name = argv[0] val = argv[1] case argv.size when 1 ENV["INPUT_#{name}"] when 2 ENV["INPUT_#{name}"] = val end end |
#state_(*argv) ⇒ Object
112 113 114 115 116 117 118 119 120 121 |
# File 'lib/libconsole/ci/github.rb', line 112 def state_(*argv) name = argv[0] val = argv[1] case argv.size when 1 ENV["STATE_#{name}"] when 2 ENV["STATE_#{name}"] = val end end |