similar to: Why Regexp#freeze?

Displaying 20 results from an estimated 9000 matches similar to: "Why Regexp#freeze?"

2007 Jul 13
1
Regexp Question - Merb::Router
Hi, I''m looking through the Merb::Routing code and I''ve found a regexp that I can''t figure out how it works. Merb::Router::SECTION_REGEXP #=> /(?::([a-z*_]+))/ It takes a route definition string, like "/products/:model/:id" and extracts the "model" string on the first pass, and later the "id" string. Can anyone shed some light on
2014 Nov 28
2
[PATCH] lib: Add COMPILE_REGEXP macro to hide regexp constructors/destructors.
[NOTE: this is not the complete patch. Once ACKed, I will make the same mechanical change to all the other places in the library that use this pattern.] --- src/guestfs-internal.h | 24 ++++++++ src/inspect-fs-unix.c | 164 +++++++++++-------------------------------------- 2 files changed, 59 insertions(+), 129 deletions(-) diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index
2007 Aug 06
2
Proposal: Pure Regex Router
So this has been an idea ever since Rails came out. Why not use a pure regular expression router in similar fashion to gsub? I imagine it working something like this: Merb::Router.prepare do |r| r.add %r[^/(.*)/(.*)/(\d+)$], :controller => ''\1'', :action => ''\2'', :id => ''\3'' r.add %r[^/user-(\d+)$], :user_id =>
2017 Aug 01
0
[PATCH v2 3/3] daemon: Restore PCRE regular expressions in OCaml code.
When parts of the daemon were previously converted to OCaml, the previous PCRE regexps were converted to Str regexps. Restore the original PCRE regexps. There was also one case where an original call to glob(3) was replaced by a Str regexp, and this is replaced by a PCRE regexp (although it is in fact identical in this instance). This updates commit b48da89dd6edce325f4c1f2956435c4d383ebe77 and
2007 Mar 12
5
Clarification of how controllers and views work together...
Hi, So I''ve started mucking about with Merb. I''m doing some experimenting with some product ideas. Things are working out quite well, Merb is a pleasure to use. It seems very fast too. A couple of rough spots but that might be me, if they are still chaffing after a few more days I''ll mention them. One thing... I wrote a controller and a view with several
2007 Sep 18
10
Routes
hi all, I want to move some routing tasks out of the router and into the controller. The goal is to make Merb feel less like mod_rewrite and give the user more control at the controller. The new Router is simple: it takes the path_info (not the whole request) then outputs a controller class and some parameters from the path matching. The rest of the routing would be done at the controller level.
2005 Aug 21
0
Patch for Element.Class - wrong regexp
Hello, I noticed (due to a recent post by Martin Honnen to clp) that Element.Class uses wrong regexps for its operations. E.g., Element.Class.has() will find "classA" in "classA-foobar" I also changed the interface of .has() to the more general one used in .has_any() --- util.js.old 2005-08-21 19:18:40.000000000 +0200 +++ util.js 2005-08-21 19:31:42.000000000 +0200 @@
2006 Apr 07
1
regexp in gotoif
Hello! this is a short one: in a gotoif-statement i would like to match a variable to a number, where the number could have digits from 2-6. asterisk only seems to be capable to match such a digit-range when used in the extension, but not in a regexp, at least the following query doesn't work: exten => _X.,1,GotoIf($[${EXTEN} : 234[2-6]]?jump:) obviously asterisk has a problem with
2010 Apr 19
3
stupid regexp question
Hello, I have a stupid regexp question. I have a large data frame of strings. I would like to convert all occurences of : "W.m^{-2}" to "W/m2" I make the following test : gsub(glob2rx("W.m^{-2}"), "W/m2", "W.m^{-2}") but it does not seem to work. I don't know how to do it otherwise as I could never learn how to deal with the special
2008 Apr 22
1
''dependencies'' and RedCloth
Hey gang. Jed noticed an issue with the ''dependency''/''dependencies'' macro the other day when working on the Collective wiki. Namely, if you make RedCloth a dependency Merb gets a little cranky. I think I have this figured out when doing some mods to Collective today too. However, before I go trying to fix this in Merb, I wanted to run this by the community.
2007 Aug 31
3
Bootstrapping from SVN
Is there a simple way to bootstrap merb directly from the Subversion repository, rather than first installing it as a gem? I can do the following if I already have an old gem lying around: merb -g testapp # using an old gem cd testapp rake merb:freeze_from_svn Unfortunately, that means I''m using an old version of the generator. So for example, when I just tried this,
2007 Aug 29
11
Non-Erubis Templates
Trunk Issue: Because of the use of ''autoload'', template handlers other than Erubis are not loaded automatically (Haml, XMLBuilder). Either this should be fixed, or the documentation should be updated to instruct people how to use non-Erb template engines. Apparently the solution is to do something like this in merb_init.rb: ::Merb::AbstractController.register_engine
2007 Sep 04
5
Xml templates...
I was looking in using an xml_builder template to do something like: blee.xerb xml.blees do <% for blee in @blees %> xml.blee = blee.name <% end %> end It looks like the xml_builder template can''t expand the erb tag. It this not the correct way to expand and xml template ? Thanks ! -------------- next part -------------- An HTML attachment was scrubbed... URL:
2012 Nov 09
2
Creating yyyymm regexp strings on the fly for aggregation.
Folks, This question is somewhat related to a previous posting of mine. I just can't seem to create a generic solution. Here is a function that I found searching around the internet: splitIt <- function(x, n) {split(x, sort(rank(x) %% n))} I use it like so: > splitIt(1:12, 2) $`0` [1] 1 2 3 4 5 6 $`1` [1] 7 8 9 10 11 12 Or > splitIt(1:12, 4) $`0` [1] 1 2 3 $`1` [1] 4 5 6
2014 Nov 28
0
Re: [PATCH] lib: Add COMPILE_REGEXP macro to hide regexp constructors/destructors.
On Friday 28 November 2014 14:44:30 Richard W.M. Jones wrote: > [NOTE: this is not the complete patch. Once ACKed, I will make the > same mechanical change to all the other places in the library that use > this pattern.] > --- > src/guestfs-internal.h | 24 ++++++++ > src/inspect-fs-unix.c | 164 +++++++++++-------------------------------------- > 2 files changed, 59
2005 Jul 20
0
Regexp update in R-devel
Following the report of Henrik Bengtsson which was traced by Duncan Murdoch to a bug in the regexp code from glibc-2.3.3 in R, I have updated the code in R-devel to -2.3.5. This had that bug fixed and about 700 other changes, most of which seem to be bug fixes. My tests on Linux (including of all CRAN packages) have detected no differences (but then I was not able to reproduce Henrik's
2007 Sep 11
4
Problem returning a Proc
I''m just playing with a recent Merb trunk (-r590). All the specs pass, apart from 2 pending. Now, the README says: "if you return a Proc object from your action, it will be called and the return value sent to the client." However this doesn''t seem to work with the following test controller: class Hello < Application def world res = "Hello world from
2007 Sep 04
11
returning(...) ?
The following construct is an ActiveSupport-ism: returning(Foo.new) do |foo| ... end I don''t especially like it, since it''s both more verbose and less efficient than the direct alternative: foo = Foo.new ... foo It doesn''t occur many times in Merb, so does anyone agree with me that it should be removed? I tried doing this (patch attached) and I find
2015 Apr 05
4
[LLVMdev] Format of special case list for sanitizers
The documentation for the sanitizer special case list format[0] says, > The meanining of * in regular expression for entity names is different - it is treated as in shell wildcarding. In SpecialCaseList::parse, we see that this is just replacing * with .*: // Replace * with .* for (size_t pos = 0; (pos = Regexp.find("*", pos)) != std::string::npos; pos +=
2009 Nov 04
4
[PATCH server] Update daemons to use new QMF.
This patch updates dbomatic, taskomatic and host-register to use the new C++ wrapped ruby QMF bindings. It also fixes a couple of bugs along the way including the 0 cpu bug for host-register. This is a compilation of work done by myself and Arjun Roy. Signed-off-by: Ian Main <imain at redhat.com> --- src/db-omatic/db_omatic.rb | 111 ++++++-------