Displaying 20 results from an estimated 3000 matches similar to: "Cookie Sessions in Merb?"
2007 Aug 17
1
Cookies for Mongrels
This class provides a CookieJar object for Mongrels. Just initialize
with response and request objects and then treat like a hash. Does not
depend on cgi.rb
ry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cookies_for_mongrels.rb
Type: text/x-ruby-script
Size: 4776 bytes
Desc: not available
Url :
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 20
11
Proposed API change for respond_to
Ez (or someone) asked on #merb tonight whether respond_to was the
right API for
what it does. After some discussion and pasties, I offer the
following proposed
API for content negotiation and response format selection:
First, what does respond_to do right now? I see at as performing 3
distinct
operations:
1. parse params[:format] and the accepts header to find out what
format the
2007 Sep 22
2
http helpers c extension
hi,
I rewrote escape, unescape, and query_parse in a C extension.
http://s3.amazonaws.com/four.livejournal/20070922/http_helpers.tar.bz2
Here are some sample benchmarks (the benchmark script is included in
the package)
user system total real
escape: Single long
Mongrel: 1.680000 0.020000 1.700000 ( 1.837793)
HttpHlp: 0.030000 0.010000 0.040000 ( 0.036590)
2007 Sep 21
3
merb 0.4.0 - redirect problems
I had redirects working just the other day... before I upgraded to the
latest release. Can somebody please chime in as to why this simple redirect
is throwing an error?
Controller:
-----------------------
def do
redirect "http://www.ebay.com"
end
Error Output:
-------------------------
Internal server error 500
uninitialized constant Merb::ControllerMixin::MovedTemporarily
in
2008 Jan 14
29
Ebb Web Server
Hello Mongrel Users,
I''m writing a web server called Ebb. It''s written in C, makes use of
the Mongrel HTTP parser, and uses libev its event loop. The goal is to
be small, fast, and language independent server that can host web
frameworks. I have written a small Ruby binding which provides a Rack
handler - this will allow Ebb to host Rails, Merb, and other Ruby
frameworks. In the
2007 Aug 13
1
SqueezeBox, a new Mongrel handler
SqueezeBox is a simple file system based routing framework for erubis
templates.
It aims for a couple of niceties as well:
Instead of putting your logic inside your template, like you would
with PHP, SqueezeBox recognizes a separate logic file to be called
before it loads the template. This allows you room to load
ActiveRecord models or do calculations. These logic files return to
the webserver
2007 Sep 02
17
A Proposal To Magically Remove ''params''
I have a magical proposal for the anti-magic web framework.
Controller methods do not use arguments and yet expect arguments. This
is handled through this params hash because we don''t know in advance
what parameters a client could pass to Merb. But in almost every
instance, it is too much to know all the query parameters - one
doesn''t care if the user threw in an extraneous
2007 Oct 22
30
TST is right out
Hi Zed,
I checked in a pure-Ruby URI classifier to Mongrel trunk. Ola''s Java
port of the TST had some bug, and I don''t think it''s necessary in the
first place. The Ruby classifier is around 25 lines instead of the
400-odd lines for the C extension and the 200-odd for the Java
extension. It uses a Regexp which is perhaps shady:
@matcher = Regexp.new(routes.map do
2010 Nov 14
1
RCurl and cookies in POST requests
Hello.
I know that it's usually possible to write cookies to a cookie
file by removing the curl handle and doing a gc() call. I can do
this with getURL(), but I just can't obtain the same results with
postForm().
If I use:
curlHandle <- getCurlHandle(cookiefile=FILE, cookiejar=FILE)
and then do:
getURL(http://example.com/script.cgi, curl=curlHandle)
rm(curlHandle)
gc()
it's
2007 Aug 10
1
serving static files
It seems that Merb is sending static files with Mongrel::DirHandler.
(mongrel_handler.rb:52)
if get_or_head and @files.can_serve(path_info)
# File exists as-is so serve it up
MERB_LOGGER.info("Serving static file: #{path_info}")
@files.process(request,response)
I haven''t done benchmarks and I''ve hardly glanced at DirHandler''s code
but the
2007 Dec 11
54
1.9
Hey so,
People are asking about Mongrel Ruby 1.9 compatibility. Isn''t the
point of 1.9 for library developers to have time to get ready for 2.0?
It''s not like 1.9 is a production release.
Evan
--
Evan Weaver
Cloudburst, LLC
2009 Sep 17
1
RCurl and Google Scholar's EndNote references
Hi!
I've performed a Google Scholar Search using a query, let's say "Frank
Harrell", and parsed the links to the EndNote references from the resulting
HTML code. Now I'd like to download all the references automatically. For
this, I have tried to use RCurl, but I can't seem to get it working: I
always get error code "403 Forbidden" from the web server.
2007 Jul 31
2
controller exceptions
Since Merb has the lovely property of rendering the output of an
action, using ruby-level exceptions to render error pages in Merb
could be a cute way to approach error handling.
Suppose one has an action for editing a product which you would like
to restrict to administrators:
def edit
raise AdminAccessReqired unless session[:user] and session[:user].admin?
@product =
2007 Jul 30
1
streaming response
hello list!
I like merb a lot, it frees me from dropping to mongrel every time i
want to stream something.
i have an action which will stream a list of JSON objects (separated
by semicolons). unfortunately because of Mongrel''s write-only header
hash, once a Content-Length header has been written, I can never again
tell it to not send such a thing - and streaming doesn''t work if
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
2013 Aug 25
2
RCurl cookiejar
R-helpers,
When I use cURL in the Terminal:
curl --cookie-jar cookie.txt --url "http://corpusdelespanol.org/x.asp" --user-agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20100101 Firefox/23.0" --location --include
a cookie file "cookie.txt" is saved to my working directory. However, when I try what I think is the equivalent command R with RCurl:
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.
2012 Jun 07
1
How to set cookies in RCurl
Hi,
I am trying to access a website and read its content. The website is a
restricted access website that I access through a proxy server (which
therefore requires me to enable cookies). I have problems in allowing Rcurl
to receive and send cookies.
The following lines give me:
library(RCurl)
library(XML)
url <- "http://www.theurl.com"
content <- readHTMLTable(url)
content
2007 Aug 04
2
How do you run an app on "edge merb"?
I didn''t quite see a direct answer to Matt''s question regarding
running merb from SVN:
http://rubyforge.org/pipermail/merb-devel/2007-July/000132.html
In a merb application, is there something comparable to having rails
in the vendor/ folder of a rails app?
Thanks,
Duane Johnson
(canadaduane)