Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
O
outvoke
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
What's new
5
Snippets
Groups
Projects
cleemy desu wayo
outvoke
Commits
a1fe7c47
Commit
a1fe7c47
authored
52 minutes ago
by
cleemy desu wayo
Browse files
Options
Downloads
Patches
Plain Diff
odify: add new feature "hooklo" and change event_cond to be optional
parent
eebee8e9
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
outvoke.rb
+12
-4
12 additions, 4 deletions
outvoke.rb
with
12 additions
and
4 deletions
outvoke.rb
+
12
−
4
ファイルを表示 @
a1fe7c47
#!/usr/bin/env ruby
#
# ==========================================================================
# Outvoke -- version 0.0.99.2024081
7
# Outvoke -- version 0.0.99.2024081
8
#
# written by cleemy desu wayo / Licensed under CC0 1.0
#
...
...
@@ -23,7 +23,7 @@ class Outvoke
@version
=
Struct
.
new
(
:branch
,
:body
).
new
(
'0.1'
,
'0.0.99.2024081
7
'
'0.0.99.2024081
8
'
)
@sources
=
Hash
.
new
...
...
@@ -159,7 +159,7 @@ end
module
OutvokeDSL
refine
Kernel
do
def
hook
(
ds_cond
,
event_cond
,
&
block
)
def
hook
(
ds_cond
,
event_cond
=
/./
,
&
block
)
raise
'$outvoke is not an Outvoke object'
unless
$outvoke
.
is_a?
(
Outvoke
)
$outvoke
.
extract_ds
(
ds_cond
).
each
do
|
label
|
...
...
@@ -176,7 +176,7 @@ module OutvokeDSL
end
# if block is given, execute in another thread (concurrent computing)
def
hookcc
(
ds_cond
,
event_cond
,
&
block
)
def
hookcc
(
ds_cond
,
event_cond
=
/./
,
&
block
)
if
block_given?
hook
(
ds_cond
,
event_cond
)
{
|
x
|
Thread
.
start
{
yield
x
}
;
nil
}
else
...
...
@@ -184,6 +184,14 @@ module OutvokeDSL
end
end
def
hooklo
(
event_cond
=
/./
,
&
block
)
if
block_given?
hook
(
"lo"
,
event_cond
)
{
|
x
|
yield
x
}
else
hook
(
"lo"
,
event_cond
)
end
end
def
loputs
(
x
)
$outvoke
.
loputs
(
x
)
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment