⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (1.01 KB)
Bug #13140
ยป test.rb
jdmeta (jake meta)
, 01/20/2017 04:40 AM
$\
=
"
\n
"
class
NilClass
def
to_s
()
"nil"
end
end
def
apply
(
input
)
regex
=
input
.
first
input
[
1
..-
1
].
each
{
|
e
|
print
(
"
\n
%s"
%
e
)
m
=
e
.
match
(
regex
)
unless
m
.
nil?
print
(
"pre'%s'"
%
m
.
pre_match
)
print
(
m
.
captures
)
print
(
"post'%s'"
%
m
.
post_match
)
else
print
(
"no match"
)
end
}
end
row
=
[
/^(% ([^\[%]+?) (\[ [^\]]+ \])? %)?+ (\^?)/x
,
"%erc_19%^ERC-19"
,
"%erl_[#8:30]%^ERL-[#]"
,
"^"
,
"%proj_name%^= "
,
"^[#1:20]"
]
section
=
[
/^(%([^%]+)%)?+((_?+)([^#]+))(#|$)/x
,
"_Project"
,
"%sn1_room%ROOM#room"
,
"_Notes#notes#context"
,
"%sn1_ov%OVERVIEW#overview#context"
,
"%sn1_sr%SPATIAL REQUIREMENTS#spatial#context"
,
"%sn1_fe%FURNITURE, FIXTURES & EQUIPMENT#equipment#context"
,
"%sn1_bd%BUILDING SYSTEM REQUIREMENTS#system#context"
,
"%sn1_room%#room"
,
"%sn1_ov%"
,
"_#room"
,
"#room"
,
"room"
]
apply
(
row
)
#apply( section )
(1-1/1)
Loading...