Module: GithubCLI::DSL
- Included in:
- GithubCLI
- Defined in:
- lib/github_cli/dsl.rb
Constant Summary collapse
- @@program_name =
$0.split(/\//)[-1]
- @@error_block =
nil
Instance Method Summary collapse
- #before(&block) ⇒ Object
- #configure(&block) ⇒ Object
-
#on_error ⇒ Object
Defines behaviour on error to emit consistent type.
-
#program_name(name = nil) ⇒ Object
Defines a program name.
Instance Method Details
#before(&block) ⇒ Object
25 26 |
# File 'lib/github_cli/dsl.rb', line 25 def before(&block) end |
#configure(&block) ⇒ Object
28 29 |
# File 'lib/github_cli/dsl.rb', line 28 def configure(&block) end |
#on_error ⇒ Object
Defines behaviour on error to emit consistent type.
19 20 21 22 23 |
# File 'lib/github_cli/dsl.rb', line 19 def on_error yield rescue Exception => error raise GithubCLI::GithubCLIError, "Rescued: #{error}" end |
#program_name(name = nil) ⇒ Object
Defines a program name.
10 11 12 13 14 15 |
# File 'lib/github_cli/dsl.rb', line 10 def program_name(name=nil) if name @@program_name = name end @@program_name end |