| Time |
S |
Nick |
Message |
| 00:08 |
|
|
baton8 joined #mojo |
| 00:09 |
|
|
ispeak joined #mojo |
| 00:19 |
|
|
MojoGuest991 joined #mojo |
| 00:40 |
|
|
j3nnn1 joined #mojo |
| 00:49 |
|
ccushing |
where can I find the Change log? |
| 00:49 |
|
purl |
the Change log is probably being migrated to a seperate file, and an entire set of docs are being built |
| 00:50 |
|
|
Alias joined #mojo |
| 00:50 |
|
vervain |
ccushing: https://github.com/kraih/mojo/blob/master/Changes |
| 00:51 |
|
ccushing |
haha, I'm a tard :S I was in the wrong dir on metacpan :( oops |
| 00:51 |
|
vervain |
:-) |
| 00:54 |
|
ccushing |
will mojo conflict with Moose if I felt so inclined to use Moose? |
| 00:56 |
|
vervain |
Try it. |
| 00:58 |
|
vervain |
I'd not use Moose for classes derived from Mojo... but you could write standalone Moose modules that you use in your Mojo app. |
| 00:58 |
|
ccushing |
it's more of a question as to whether I can anticipate weird issues, for example mojo seems to have a 'has' keyword but so does moose |
| 00:58 |
|
ccushing |
ok |
| 01:25 |
|
|
jnap joined #mojo |
| 01:42 |
|
ccushing |
I see references to $c in Mojolicous::Controller. what is it? is it just $self->app? |
| 01:43 |
|
ccushing |
I'm trying to figure out what I should do to have ->url_for |
| 01:50 |
|
ccushing |
also how do I receive json? is it auto deserialized into a hash somewhere? |
| 01:53 |
|
vervain |
my $c = $stash->{'mojo.content'} ||= {}; |
| 02:05 |
|
vervain |
I don't believe that JSON is serialized for you. How you read it depends on how you send it, same as any param. |
| 02:06 |
|
vervain |
deserialized I mean. There is a serializer under ...render( json => 'foo' ) |
| 02:09 |
|
ccushing |
http://privatepaste.com/701feb9ffd |
| 02:09 |
|
ccushing |
http://privatepaste.com/b94de25eef |
| 02:10 |
|
ccushing |
doesn't seem like the json I'm sending is being deserialized in content |
| 02:13 |
|
vervain |
respond_to is experimental... you get to keep the pieces. |
| 02:14 |
|
ccushing |
well I'm dumping the hash too, nothing in content |
| 02:14 |
|
vervain |
Besides... that is for reply data... not request data. |
| 02:15 |
|
ccushing |
yeah I'm just dumping the stash |
| 02:15 |
|
ccushing |
also if respond_to is experimental what should be using? |
| 02:16 |
|
vervain |
respond_to is largely syntactic sugar... so if it were me I'd just put together explicit logic in my router/action |
| 02:16 |
|
ccushing |
looks like content is actually in an object called asset |
| 02:19 |
|
vervain |
I think a req->body should help you. |
| 02:24 |
|
ccushing |
hmm... yeah that's got the content, but still serialized... guess I'll have to deserialize it myself |
| 02:25 |
|
ccushing |
will work more on this tomorrow |
| 02:30 |
|
ccushing |
ah $self->req->json will do it |
| 02:36 |
|
tempire |
ccushing: you can use respond_to |
| 02:36 |
|
tempire |
most things are experimental to begin with. |
| 02:36 |
|
tempire |
if people use them, they generally stay. |
| 02:37 |
|
tempire |
the experimental lets us try things out without having to support it indefinitely |
| 02:38 |
|
tempire |
you just gotta pay attention to the releases to see how they fair |
| 02:38 |
|
tempire |
which, if it's in production, you should probably be doing anyway :) |
| 02:43 |
|
crab |
man, doing something with svn feels like driving into a wall |
| 02:46 |
|
|
xaka joined #mojo |
| 03:36 |
|
|
Psyche^ joined #mojo |
| 03:59 |
|
|
amoore joined #mojo |
| 04:12 |
|
|
amoore joined #mojo |
| 04:16 |
|
cfedde |
is there a "delay" or "timeout" kind of feature? some kind of mojo flavored clock to hang periodic events to? or is it better to just do such things outside the framework? |
| 04:20 |
|
crab |
cfedde: you can use a timer |
| 04:20 |
|
|
mire_ joined #mojo |
| 04:21 |
|
crab |
cfedde: toroid.org/ams/etc/mojolicious-http-streaming shows one example of their use (to implement tail -f) |
| 04:21 |
|
crab |
the manpages have others |
| 04:23 |
|
cfedde |
cool, thanks |
| 05:17 |
|
|
mire_ joined #mojo |
| 05:28 |
|
|
arpadszasz joined #mojo |
| 05:41 |
|
|
ispy_ joined #mojo |
| 05:58 |
|
|
abra_ joined #mojo |
| 06:24 |
|
|
d4rkie joined #mojo |
| 06:38 |
|
|
jmmills joined #mojo |
| 06:42 |
|
|
jmmills joined #mojo |
| 06:42 |
|
|
jmmills left #mojo |
| 07:00 |
|
|
koban joined #mojo |
| 07:01 |
|
|
Vandal joined #mojo |
| 07:14 |
|
marcus |
goooood morning mojolicious |
| 07:20 |
|
Vandal |
good day |
| 07:20 |
|
purl |
every day's a holiday, every meal's a feast |
| 07:23 |
|
|
d4rkie joined #mojo |
| 07:24 |
|
|
d4rkie joined #mojo |
| 07:25 |
|
crab |
hi. |
| 07:29 |
|
sri |
tempire: you shouldn't say things like that |
| 07:30 |
|
crab |
like what? |
| 07:30 |
|
sri |
experimental means he should not use it if he's not ok with it breaking |
| 07:30 |
|
sri |
in the past whenever i encouraged people to use experimental stuff it backfired |
| 07:31 |
|
marcus |
I agree |
| 07:32 |
|
marcus |
don't use experimental features unless you understand what that means. |
| 07:32 |
|
tempire |
ok |
| 07:33 |
|
sri |
good morning btw. |
| 07:34 |
|
|
sugar joined #mojo |
| 07:35 |
|
sri |
you can help to make respond_to stable though |
| 07:35 |
|
sri |
https://github.com/kraih/mojo/issues/237 |
| 07:37 |
|
sri |
until someone does the work it has to stay experimental |
| 07:43 |
|
crab |
i've been looking at that actually |
| 07:48 |
|
crab |
the bug you've pointed to has been fixed and closed, as you probably know. |
| 07:49 |
|
crab |
but all that q= blah has been widely misunderstood and/or misused before. |
| 07:49 |
|
sri |
yes, the problem is more complex though |
| 07:49 |
|
sri |
for example firefox extensions can change the Accept header, and quite a few do |
| 07:50 |
|
crab |
as a first step, it seems quite sensible to pay attention a single accept value (which is probably the most common useful case) and return that format, and ignore complicated ones. |
| 07:51 |
|
sri |
then the question becomes if we can safely add support for more complex Accept headers in the future |
| 07:52 |
|
crab |
right. |
| 07:53 |
|
crab |
one possible alternative is to always give html highest priority (assuming that it's a browser that's going to render the result), and pay attention to the full specification only otherwise. |
| 07:54 |
|
crab |
but i'm not sure i like that kind of thing/ |
| 07:54 |
|
crab |
s/\/// |
| 07:54 |
|
sri |
neither do i |
| 07:56 |
|
crab |
ok, what would the downside be if we interpreted it absolutely strictly? some webkit browsers will get xml when they'd prefer html |
| 07:57 |
|
sri |
there are json highlighting extensions that make json the highest priority |
| 07:57 |
|
crab |
oh good god. |
| 07:57 |
|
purl |
Great Googly Moogly! |
| 08:09 |
|
crab |
"Please click on the content type you really want: <...>" :-) |
| 08:21 |
|
sri |
:) |
| 08:28 |
|
|
berov joined #mojo |
| 08:31 |
|
|
ysyrota joined #mojo |
| 08:32 |
|
|
Andrei666 joined #mojo |
| 08:42 |
|
marcus |
grr |
| 08:44 |
|
marcus |
Note that characters from 128 to 255 (inclusive) are by default internally not encoded as UTF−8 for backward compatibility reasons. |
| 08:44 |
|
marcus |
FUGLY |
| 09:08 |
|
|
spleenjack joined #mojo |
| 09:11 |
|
plu |
marcus: where is that coming from? |
| 09:12 |
|
|
baton8 joined #mojo |
| 09:12 |
|
marcus |
plu: perldoc -f chr |
| 09:12 |
|
purl |
chr NUMBER or chr |
| 09:12 |
|
plu |
thanks :) |
| 09:26 |
|
|
cosmincx joined #mojo |
| 09:27 |
|
|
GitHub95 joined #mojo |
| 09:27 |
|
GitHub95 |
[mojo] kraih pushed 1 new commit to master: http://git.io/Su7tjA |
| 09:27 |
|
GitHub95 |
[mojo/master] added experimental local_address attribute to Mojo::UserAgent - Sebastian Riedel |
| 09:27 |
|
|
GitHub95 left #mojo |
| 09:28 |
|
sri |
i know yko wanted this too, no promises it will stay though |
| 09:28 |
|
sri |
online tests need to be improved btw |
| 09:29 |
|
sri |
they are currently location dependent |
| 09:29 |
|
sri |
as in only work from germany |
| 09:29 |
|
sri |
due to geo redirects |
| 09:30 |
|
yko |
yay! |
| 09:31 |
|
yko |
i do :) |
| 09:31 |
|
sri |
yko: what are you using it for anyway? |
| 09:35 |
|
marcus |
sacrificing virgins |
| 09:35 |
|
yko |
for dirty things, mostly. something like cheating with rate limits and sacrificing virgins |
| 09:35 |
|
sri |
:o |
| 09:37 |
|
sri |
https://github.com/kraih/mojo/issues/249 |
| 09:37 |
|
sri |
should be a rather beginner friendly task |
| 09:37 |
|
sri |
since it is mostly about finding new test targets online |
| 09:39 |
|
sri |
needs to be done by someone not from germany though ;p |
| 10:02 |
|
|
MojoGuest694 joined #mojo |
| 10:02 |
|
MojoGuest694 |
From: http://www.google.de/url?sa=t&[…]D0vcKNULg&cad=rja (1 hits) |
| 10:03 |
|
MojoGuest694 |
dgsdfgfd |
| 10:03 |
|
|
cosmincx joined #mojo |
| 10:03 |
|
|
cekedess joined #mojo |
| 10:04 |
|
marty |
dirty things, sacrificing virgins, mayhem I tell you - next thing you know you'll all be drinking warm beer. |
| 10:45 |
|
|
Andrei666 joined #mojo |
| 10:49 |
|
Andrei666 |
hey guys, I'm doing html files out of our pods....for the project I'm currently in, |
| 10:49 |
|
Andrei666 |
and the css that I use for the moment is the one from cpan 'http://search.cpan.org/s/style.css' |
| 10:50 |
|
Andrei666 |
but it kinda looks like '96 and I'd like to make the htmls more in the present |
| 10:50 |
|
Andrei666 |
and was looking at the mojo docs, |
| 10:50 |
|
Andrei666 |
is there any way to use the same css from mojolicious? |
| 10:50 |
|
Andrei666 |
is there any...hard link to the mojo css? |
| 10:54 |
|
|
cosmincx joined #mojo |
| 10:54 |
|
sri |
you can't rely on built in templates, they will change |
| 10:56 |
|
Andrei666 |
ok |
| 10:56 |
|
Andrei666 |
thanks :) |
| 10:59 |
|
marcus |
marty: that's only for mad dogs and englishmen! |
| 10:59 |
|
marcus |
THERE WILL BE BLOOD |
| 10:59 |
|
marcus |
Andrei666: I suggest using bootstrap |
| 11:00 |
|
Andrei666 |
marcus: can you be more specific? I'm kind of a noob... |
| 11:02 |
|
marcus |
Andrei666: http://twitter.github.com/bootstrap/ |
| 11:03 |
|
Andrei666 |
marcus: oh...that's great |
| 11:03 |
|
Andrei666 |
thanks :) |
| 11:15 |
|
|
MojoGuest488 joined #mojo |
| 11:15 |
|
MojoGuest488 |
From: http://www.google.com/url?sa=t[…]uzUnHhWcD0vcKNULg (1 hits) |
| 11:32 |
|
|
GitHub121 joined #mojo |
| 11:32 |
|
GitHub121 |
[mojo] kraih pushed 1 new commit to master: http://git.io/opJffg |
| 11:32 |
|
GitHub121 |
[mojo/master] improved tests for many environment variables - Sebastian Riedel |
| 11:32 |
|
|
GitHub121 left #mojo |
| 11:37 |
|
diegok |
Hello. is there something like response_timeout or it's the same as connect_timeout?. Where should I set a timeout cb when making a UA request? |
| 11:38 |
|
sri |
diegok: you mean maximum time receiving the whole response may take? |
| 11:39 |
|
diegok |
sri: yes, and max time to receive the first bit |
| 11:39 |
|
sri |
first does not exist, second is covered by keep alive timeout |
| 11:40 |
|
sri |
keep alive timeout is implemented as a general inactivity timeout on the connection |
| 11:40 |
|
diegok |
so, if there are no more than keep alive timeout between two bits, req is ok? |
| 11:40 |
|
sri |
yes |
| 11:41 |
|
diegok |
I'm seeing a lot of requests not returning a tx... |
| 11:42 |
|
diegok |
and, the other one?, where should I set a timeout cb?, I see it's on the stream. But, a new stream is build for every tx? |
| 11:43 |
|
diegok |
actually I do set some things on the tx on UA start |
| 11:45 |
|
diegok |
^ but now I'm not pretty sure where I can set a stream cb for timeout event. |
| 11:47 |
|
|
abra__ joined #mojo |
| 11:48 |
|
|
GitHub183 joined #mojo |
| 11:48 |
|
GitHub183 |
[mojo] kraih pushed 1 new commit to master: http://git.io/KgvklA |
| 11:48 |
|
GitHub183 |
[mojo/master] removed MOJO_STATIC_CLASS and MOJO_TEMPLATE_CLASS environment variables - Sebastian Riedel |
| 11:48 |
|
|
GitHub183 left #mojo |
| 11:48 |
|
sri |
i actually have no idea why those env vars ever existed :) |
| 11:49 |
|
sri |
they can only break things as far as i can see, since static and template classes need to be localized to the application |
| 11:50 |
|
sri |
maybe i meant to abuse them for internal tests a long time ago |
| 11:52 |
|
sri |
diegok: those events are all experimental, but you could go via start(Mojo::UserAgent), connection(Mojo::Transaction::HTTP), timeout(Mojo::IOLoop::Stream) |
| 11:53 |
|
sri |
experimental though, so don't do it |
| 11:54 |
|
diegok |
sri: hm... I need some more control over these timeouts... |
| 11:55 |
|
diegok |
I'm ok to rewrite my thing when experimental features change something... |
| 11:55 |
|
diegok |
I already did when we started to have events :) |
| 11:56 |
|
sri |
good, i'm just warning everyone now since we had a few complaints recently ;) |
| 11:57 |
|
diegok |
sri: I think we should have a simplest way of setting all this "event receivers" from UA. <-- as I think UA is the interface for most of us playing with the client... |
| 11:57 |
|
diegok |
^ just a thought :) |
| 11:58 |
|
sri |
feel free to make a proposal |
| 11:58 |
|
sri |
github issues are open for discussions |
| 11:58 |
|
diegok |
ok, good to know :) |
| 11:59 |
|
sri |
it won't be easy to convince me though, i'd rather remove code from useragent than add ;p |
| 11:59 |
|
diegok |
oh my! :-) |
| 12:00 |
|
sri |
it's about the most complicated code we have, i really want to split it up in many little pieces |
| 12:01 |
|
sri |
so, if someone could extract connection management into a separate module like Mojo::UserAgent::Connection, you would be my hero |
| 12:02 |
|
diegok |
Yes, I'm ok with the pieces but in my usage pattern there are a few entry points to the mojo namespace: UA, lite, etc. So what I'm thinking is that UA should have some shortcuts for the pieces it use, something as Lite... |
| 12:02 |
|
sri |
according to sloccount UserAgent.pm is only 392 lines of code, but i doubt we have many devs that really understand it |
| 12:03 |
|
sri |
diegok: i'm ok with that, as long as it comes with maintainability improvements |
| 12:03 |
|
diegok |
yes, 392 lines of hard to follow code.. I came from those lines just now :) |
| 12:04 |
|
sri |
UserAgent.pm is a little special, there are many many things that could be added that would easily turn it into a maintenance nightmare |
| 12:04 |
|
sri |
yea, especially the proxy stuff is really hard |
| 12:04 |
|
diegok |
yes! :( |
| 12:05 |
|
diegok |
understand your point... I'll think about it... |
| 12:05 |
|
sri |
heck, it does WebSockets over TLS with connect proxy support :) |
| 12:05 |
|
diegok |
I love/hate UA :) |
| 12:05 |
|
sri |
me too |
| 12:06 |
|
sri |
hmm, maybe i'll open a github task for that too |
| 12:06 |
|
* diegok |
I hate myself when I love/hate something! |
| 12:07 |
|
diegok |
for that? |
| 12:07 |
|
purl |
i think for that is not an explanation |
| 12:14 |
|
sri |
https://github.com/kraih/mojo/issues/250 |
| 12:16 |
|
|
Alias joined #mojo |
| 12:45 |
|
|
ispeak joined #mojo |
| 13:06 |
|
crab |
is anyone working on json pointer support already? |
| 13:06 |
|
crab |
because if not, i'm going to do it. |
| 13:15 |
|
crab |
ok. |
| 13:15 |
|
marcus |
crab: please do it :) |
| 13:18 |
|
sri |
crab: i don't think the design discussion is over yet |
| 13:20 |
|
sri |
at least i have no clue yet how it would work :) |
| 13:21 |
|
crab |
well, (a) nobody has said anything after marcus's +1, and (b) i'm sure the discussion can continue after i've written some code. |
| 13:21 |
|
sri |
of course |
| 13:21 |
|
sri |
it's actually a good task for a feature branch, we could practice working together on a new feature |
| 13:22 |
|
crab |
i'm just doing the simplest thing: adding a pointer sub to Mojo::JSON, and a json_pointer_is to Test::Mojo |
| 13:22 |
|
crab |
that alone would be very useful for me. |
| 13:22 |
|
|
tholen42 joined #mojo |
| 13:22 |
|
crab |
and yes, i'm doing it in a branch named json-pointer, but it's not yet pushed to github. |
| 13:22 |
|
sri |
sounds good |
| 13:22 |
|
|
noganex_ joined #mojo |
| 13:22 |
|
sri |
like Mojo::JSON->pointer($structure, '/foo/0/bar')? |
| 13:23 |
|
crab |
sri: i did ->pointer('/foo/0/bar', $structure) |
| 13:23 |
|
crab |
er |
| 13:23 |
|
crab |
no. |
| 13:23 |
|
crab |
Mojo::JSON->pointer just takes /foo/0/bar and returns either a Mojo::JSON, or a value. |
| 13:24 |
|
crab |
json_pointer_is takes '/foo/0/bar' and $structure |
| 13:24 |
|
sri |
hmm, now i'm confused |
| 13:24 |
|
sri |
but i just had an idea |
| 13:24 |
|
crab |
do tell. |
| 13:25 |
|
crab |
sri: i've done exactly what the two examples you posted in the thread look like |
| 13:25 |
|
sri |
$json->decode($bytes, '/foo/0/bar')… $tx->res->json('/foo/0/bar') |
| 13:26 |
|
sri |
wait |
| 13:26 |
|
sri |
my example was depending on the resulting data structure to be blessed into a class with a ->pointer method |
| 13:26 |
|
sri |
perl -Mojo -E'say g("http://mojolicio.us/foo.json")->res->json->pointer("/foo/1/bar")' |
| 13:26 |
|
sri |
->json normally returns the data structure |
| 13:27 |
|
sri |
that's what i was unsure about |
| 13:28 |
|
sri |
oh |
| 13:28 |
|
crab |
doesn't ->json return a Mojo::JSON? |
| 13:28 |
|
sri |
nope |
| 13:29 |
|
sri |
undef, array or hash |
| 13:29 |
|
sri |
perl -Mojo -E'say g("http://mojolicio.us/foo.json")->res->json("/foo/1/bar")' |
| 13:30 |
|
sri |
that's more realistic |
| 13:30 |
|
crab |
ah, crud. how about making json take a pointer argument? |
| 13:30 |
|
sri |
for your solution |
| 13:30 |
|
crab |
heh |
| 13:30 |
|
sri |
just like ->dom |
| 13:30 |
|
crab |
right. |
| 13:31 |
|
sri |
you got that the test is (json pointer, expected result structure)? |
| 13:31 |
|
crab |
sorry, brain fade there. i knew that ->json works like that, but i was thinking of ->dom and confused the two. |
| 13:31 |
|
crab |
yes, i got that. |
| 13:31 |
|
sri |
great |
| 13:32 |
|
crab |
should it be json_is($ptr, $expected [, $msg])? |
| 13:32 |
|
sri |
not sure |
| 13:32 |
|
sri |
it's better than json_pointer_is |
| 13:34 |
|
crab |
i'll call it that and we can change it if something else looks better. |
| 13:34 |
|
|
inokenty joined #mojo |
| 13:34 |
|
hide |
I have a method that converts a file size in bytes, into something more readable. Right now I'm passing the formatted value to an html template, but I want the template to handle the conversion. Trying to figure out where the method should live. Should the method be moved to a plugin? |
| 13:35 |
|
inokenty |
Use helpers |
| 13:36 |
|
crab |
yes, make a plugin that installs whatever helpers like this you need |
| 13:36 |
|
crab |
(or register the helper directly in startup(), if you like) |
| 13:36 |
|
hide |
thanks, I will look into it |
| 13:37 |
|
crab |
are you using lite or plain mojolicious? |
| 13:37 |
|
hide |
plain |
| 13:38 |
|
crab |
so $app->helper(fmtsize => sub { return "$_[1] bytes" }); will let you do <%= size $n %> in your templates |
| 13:39 |
|
hide |
cool, thanks again. |
| 13:40 |
|
inokenty |
crab: maybe <%= fmtsize $n %> ? |
| 13:40 |
|
crab |
inokenty: er, yeah |
| 13:40 |
|
hide |
I got the intention :) |
| 13:48 |
|
sri |
crab: wonder if changing the Mojo::JSON api a little would be worth it |
| 13:48 |
|
|
jnap joined #mojo |
| 13:49 |
|
crab |
so that it can extract stuff without reparsing the whole thing? |
| 13:49 |
|
sri |
stuff like Mojo::JSON->new({foo => [1, 2, 3]})->pointer('/foo')->encode |
| 13:49 |
|
sri |
(just throwing around ideas) |
| 13:50 |
|
crab |
sri: afaik, that can even be done later without breaking res->json('/foo') |
| 13:50 |
|
sri |
indeed |
| 13:50 |
|
crab |
(i.e. let me do it the decode($bytes,$ptr) way to start with, it won't hurt) |
| 13:51 |
|
sri |
sure |
| 13:51 |
|
sri |
you like the two argument decode? |
| 13:52 |
|
crab |
seems apt and not too intrusive. |
| 13:53 |
|
sri |
my main problem is that i can't think of a really great api that doesn't involve blessing the array/hash results into a class :/ |
| 13:54 |
|
crab |
yes, i was thinking there's no way to avoid that forever. |
| 13:55 |
|
|
judofyr joined #mojo |
| 13:55 |
|
judofyr |
sri: any more thoughts on asset pipeline? |
| 13:56 |
|
sri |
it's "my $json = Mojo::JSON->new; say $json->pointer($json->decode($bytes), '/foo/0/bar');" vs "say Mojo::JSON->new->decode($bytes)->pointer('/foo/0/bar');" |
| 13:57 |
|
sri |
judofyr: no |
| 13:57 |
|
judofyr |
sri: what's that? query syntax for JSON objects? |
| 13:58 |
|
sri |
or we keep the decoded data structure around inside $json |
| 13:58 |
|
* judofyr |
reads the logs |
| 13:58 |
|
sri |
Mojo::JSON->new($bytes)->pointer('/foo/0/bar') |
| 13:58 |
|
sri |
that would work without breaking stuff |
| 13:59 |
|
sri |
new could detect bytes, hash, array and store the structure |
| 13:59 |
|
sri |
of course memory requirements could potentially go up if you keep $json around |
| 14:00 |
|
sri |
judofyr: https://github.com/kraih/mojo/issues/247 |
| 14:01 |
|
sri |
crab: don't let me distract you :) |
| 14:06 |
|
sri |
tempire: what would "mojo get mojolicio.us/foo.json /foo/0/bar" output if the result was an array or object? |
| 14:10 |
|
crab |
->encode |
| 14:13 |
|
* sri |
nods |
| 14:18 |
|
judofyr |
sri: what's up with open issues on GitHub? :O |
| 14:18 |
|
sri |
open issues are cool now |
| 14:18 |
|
judofyr |
ah |
| 14:19 |
|
judofyr |
open is the new closed |
| 14:19 |
|
sri |
like bow ties |
| 14:23 |
|
|
batman joined #mojo |
| 14:23 |
|
batman |
hi |
| 14:24 |
|
batman |
what does "Premature connection close." error mean in Mojo::Message::Response ? |
| 14:24 |
|
judofyr |
oh, look, it's the batman! |
| 14:24 |
|
batman |
judofyr: don't get too exited. wait for the movie |
| 14:25 |
|
batman |
does it have anything to do with timeout? |
| 14:26 |
|
sri |
batman: it does |
| 14:27 |
|
sri |
batman: mojo version? |
| 14:28 |
|
batman |
2.38. |
| 14:28 |
|
|
MojoGuest275 joined #mojo |
| 14:28 |
|
MojoGuest275 |
From: http://www.google.pl/url?sa=t&[…]uzUnHhWcD0vcKNULg (1 hits) |
| 14:28 |
|
sri |
then the server closed the connection |
| 14:28 |
|
batman |
without sending anything back? |
| 14:29 |
|
|
MojoGuest275 left #mojo |
| 14:31 |
|
batman |
should i try to tweak the timeout? |
| 14:49 |
|
crab |
sri: suddenly i understand why you closed issues the first time |
| 14:50 |
|
sri |
crab: :D |
| 14:50 |
|
|
amoore joined #mojo |
| 14:50 |
|
sri |
NOT MY PROBLEM ANYMORE! |
| 14:50 |
|
sri |
\o/ |
| 14:50 |
|
marcus |
memowe: https://gist.github.com/1501814 |
| 14:51 |
|
|
GitHub99 joined #mojo |
| 14:51 |
|
GitHub99 |
[mojo] kraih pushed 1 new commit to master: http://git.io/-_y79Q |
| 14:51 |
|
GitHub99 |
[mojo/master] added FAQ answers for timeout error messages - Sebastian Riedel |
| 14:51 |
|
|
GitHub99 left #mojo |
| 14:51 |
|
sri |
batman: that might help |
| 14:51 |
|
elb0w |
sri: do you realize how amazing mojo is? |
| 14:51 |
|
elb0w |
I cannot find anything to compare it to |
| 14:52 |
|
sri |
elb0w: thanks for reminding me :) |
| 14:52 |
|
elb0w |
I mean its unreal |
| 14:52 |
|
elb0w |
Its literally kept me from learning a new language, I start writing python or ruby then I go why |
| 14:52 |
|
elb0w |
they dont have mojo |
| 14:52 |
|
elb0w |
I showed a dev and they are learning perl just to use mojo haha |
| 14:52 |
|
marcus |
sri: seem mithaldu isn't a very big fan of you :p |
| 14:53 |
|
sri |
marcus: it's a german thing |
| 14:53 |
|
marcus |
if there's any other germans willing to review translations besides memowe just contact me. |
| 14:53 |
|
sri |
it's funny, most of the time when i see someone following me around and flaming me wherever i go it's a fellow german :) |
| 14:54 |
|
sri |
mithaldu and daxim being the loudest |
| 14:57 |
|
elb0w |
Man I dont want to release this module without tests but how do I test something I need responses from the server with |
| 14:57 |
|
elb0w |
host a dummy server? |
| 14:57 |
|
sri |
optional tests |
| 14:57 |
|
omega |
or mocking |
| 14:57 |
|
elb0w |
I wrote a mailgun wrapper |
| 14:58 |
|
elb0w |
it uses LWP gonna make a plugin for mojo later that uses Mojo UA |
| 14:58 |
|
elb0w |
making mail sending simple |
| 14:58 |
|
elb0w |
https://github.com/gtsafas/mailgun.perl |
| 14:58 |
|
sri |
mailgun looks awesome |
| 14:58 |
|
|
koban left #mojo |
| 14:58 |
|
elb0w |
it is |
| 14:58 |
|
elb0w |
favorite thing ever |
| 14:58 |
|
elb0w |
their new api is so simple |
| 14:59 |
|
elb0w |
implemented a wrapper in 45minutes |
| 14:59 |
|
elb0w |
need to refactor it a bit and make it smarter |
| 14:59 |
|
elb0w |
but that has like 75% of their api already lol |
| 15:00 |
|
elb0w |
proper mojo plugin would be nice |
| 15:00 |
|
sri |
crab: i'm actually tempted to add a "WTFBBQ?" label for issues :D |
| 15:02 |
|
elb0w |
Lost wrote this earlier this month, https://github.com/gtsafas/mailgun.perl |
| 15:02 |
|
sri |
but tempire would just turn it into a "glitter" label |
| 15:02 |
|
elb0w |
er |
| 15:02 |
|
elb0w |
wrong window |
| 15:02 |
|
purl |
I love you too, dad. |
| 15:02 |
|
marcus |
moar glitter! |
| 15:02 |
|
* marcus |
drives home. |
| 15:03 |
|
* sri |
imagines marcus jumping into his snow plow |
| 15:04 |
|
sri |
or maybe a dog sled |
| 15:07 |
|
sri |
oh right, we can assign issues |
| 15:07 |
|
sri |
crab: you should assign the json one to yourself |
| 15:14 |
|
sri |
perhaps we should consider deprecating keep_alive_timeout |
| 15:14 |
|
sri |
and call it something like inactivity_timeout |
| 15:18 |
|
sugar |
why should? |
| 15:19 |
|
sugar |
what's wrong with keep_alive_timeout? |
| 15:19 |
|
sri |
apparently it confuses many users |
| 15:19 |
|
sri |
they associate it exclusively with the HTTP feature |
| 15:20 |
|
sri |
which in this case is only half of the truth |
| 15:22 |
|
crab |
how to assign? |
| 15:23 |
|
sri |
crab: already done, but there is a little gear button below the issue title |
| 15:23 |
|
crab |
and yes, changing that name would remove a lot of confusion |
| 15:24 |
|
sri |
websocket_timeout too? |
| 15:24 |
|
sri |
right now we have keep_alive_timeout and websocket_timeout |
| 15:24 |
|
crab |
what's the difference? |
| 15:24 |
|
purl |
the difference is Epsilon, a number that gets closer to zero the longer you think about it. |
| 15:25 |
|
sri |
same thing |
| 15:25 |
|
sri |
different context |
| 15:25 |
|
crab |
makes sense to call them both inactivity_timeout, then |
| 15:25 |
|
sri |
websocket_timeout gets assigned after successful handshake |
| 15:25 |
|
sri |
websocket_inactivity_timeout? |
| 15:25 |
|
sri |
looks weird |
| 15:26 |
|
crab |
oh, they can be applied to the same connection? i missed that. |
| 15:26 |
|
crab |
then inactivity_timeout and websocket_timeout is ok |
| 15:26 |
|
sri |
yea, one is before handshake and one after |
| 15:26 |
|
sri |
since websocket connections start as http |
| 15:28 |
|
crab |
sri: btw, i'm going to be studying the whole ioloop code next, so that i can have opinions about it too. |
| 15:28 |
|
crab |
i've only looked at specific parts before, not the whole thing |
| 15:28 |
|
sri |
crab: very much appreciated |
| 15:41 |
|
|
j3nnn1 joined #mojo |
| 15:44 |
|
|
metaperl joined #mojo |
| 15:48 |
|
|
GitHub157 joined #mojo |
| 15:48 |
|
GitHub157 |
[mojo] kraih pushed 1 new commit to master: http://git.io/QzgkMQ |
| 15:48 |
|
GitHub157 |
[mojo/master] deprecated all keep_alive_timeout attributes and parameters in favor of inactivity_timeout - Sebastian Riedel |
| 15:48 |
|
|
GitHub157 left #mojo |
| 15:50 |
|
sri |
a lot better |
| 15:52 |
|
|
MojoGuest781 joined #mojo |
| 15:52 |
|
|
xaka joined #mojo |
| 15:53 |
|
|
KayT3 joined #mojo |
| 15:55 |
|
|
mercutioviz joined #mojo |
| 15:56 |
|
|
MojoGuest902 joined #mojo |
| 15:56 |
|
MojoGuest902 |
From: http://www.google.de/url?sa=t&[…]uzUnHhWcD0vcKNULg (1 hits) |
| 15:57 |
|
MojoGuest902 |
foo |
| 15:57 |
|
purl |
bar |
| 15:57 |
|
MojoGuest902 |
foo |
| 15:57 |
|
purl |
bar |
| 15:57 |
|
MojoGuest902 |
fossy |
| 15:57 |
|
MojoGuest902 |
foo |
| 15:57 |
|
purl |
bar |
| 15:58 |
|
MojoGuest902 |
foo |
| 15:58 |
|
purl |
bar |
| 15:58 |
|
MojoGuest902 |
foo |
| 15:58 |
|
purl |
bar |
| 15:58 |
|
MojoGuest902 |
42 |
| 15:58 |
|
crab |
sri: if the pointer doesn't match, do i set error() or just return undef, or both? |
| 15:59 |
|
sri |
crab: good question |
| 15:59 |
|
purl |
Yeah, it is. I'm stumped. |
| 15:59 |
|
sri |
undef is a valid json value after all |
| 15:59 |
|
sri |
so it doesn't really signal anything in this case |
| 15:59 |
|
crab |
yeah |
| 16:01 |
|
sri |
i guess the question is how it will commonly be used |
| 16:02 |
|
sri |
do we need to know if it matched anything |
| 16:03 |
|
sri |
$t->json_exists('/foo/0/bar') kinda makes sense |
| 16:03 |
|
sri |
or not |
| 16:03 |
|
sri |
hmm :S |
| 16:04 |
|
sri |
$t->json_is('/foo/0/bar', undef) |
| 16:04 |
|
sri |
that would be an impossible test |
| 16:10 |
|
crab |
:-( |
| 16:12 |
|
sri |
is there another solution than to set ->error? |
| 16:19 |
|
xaka |
may i suggest extend FAQ for "Connection timeout" error with the information like "if your handler generates response longer than inactivity value, it won't be sent to a client". This is most important missing part i believe because client (usually browsers) always have much bigger timeout than mojo server |
| 16:34 |
|
|
GitHub82 joined #mojo |
| 16:34 |
|
GitHub82 |
[mojo] kraih pushed 1 new commit to master: http://git.io/-8cMtw |
| 16:34 |
|
GitHub82 |
[mojo/master] extend FAQ answer about inactivity timeouts - Sebastian Riedel |
| 16:34 |
|
|
GitHub82 left #mojo |
| 16:36 |
|
sri |
crab: starting to wonder if jsonpointers are such a good idea after all |
| 16:36 |
|
sri |
they are very close |
| 16:37 |
|
marcus |
Close to what? |
| 16:37 |
|
sri |
close to what i want |
| 16:37 |
|
judofyr |
sri: what do you miss? |
| 16:37 |
|
sri |
they don't allow relative searching for example |
| 16:38 |
|
sri |
say i want all occurences of 0/bar |
| 16:38 |
|
sri |
that would also solve the undef result problem |
| 16:38 |
|
sri |
since you get an empty collection/array |
| 16:39 |
|
judofyr |
it doesn't support map either (e.g. users/@/name to get an array of names) |
| 16:39 |
|
sri |
that would be a bit much |
| 16:40 |
|
judofyr |
probably. at least when Collection provides map anyway |
| 16:40 |
|
crab |
jpath! jquery... oh, wait, not jquery. |
| 16:40 |
|
sri |
:) |
| 16:40 |
|
sri |
jpointer |
| 16:42 |
|
sri |
not like there is alot of specs to choose from though |
| 16:42 |
|
sri |
jsonpath is ugly as hell |
| 16:42 |
|
crab |
it seems ~inevitable that json pointer will grow more features |
| 16:43 |
|
* sri |
nods |
| 16:43 |
|
sri |
i can't get over the undef problem |
| 16:44 |
|
|
metaperl|2 joined #mojo |
| 16:46 |
|
sri |
http://tools.ietf.org/html/dra[…]yan-json-patch-04 # also an interesting spec |
| 16:46 |
|
crab |
we'll need a separate object with ->exists(ptr) and ->extract(ptr) |
| 16:46 |
|
sri |
applying partial patches to json |
| 16:47 |
|
sri |
crab: oh, interesting direction |
| 16:47 |
|
crab |
ooh, that patch thing would be so neat. i think i might actually start using that. |
| 16:47 |
|
sri |
Mojo::JSON::Pointer? |
| 16:48 |
|
sri |
now we are back to the problem of blessing results into a class though |
| 16:48 |
|
|
sugar joined #mojo |
| 16:49 |
|
|
kaare joined #mojo |
| 16:50 |
|
crab |
sri: i don't see any way to avoid it |
| 16:51 |
|
sri |
don't think we can actually do it |
| 16:52 |
|
sri |
or can we? |
| 16:52 |
|
|
xaka joined #mojo |
| 16:53 |
|
sri |
or keep the modules completely separate |
| 16:53 |
|
sri |
https://github.com/janl/node-jsonpointer |
| 16:54 |
|
sri |
kinda like the others do it |
| 16:54 |
|
sri |
at least until we find a sane way to merge them |
| 16:54 |
|
sri |
i mean, it doesn't really affect the apis we have planned so far, does it? |
| 16:55 |
|
* crab |
looks |
| 16:56 |
|
crab |
oh. so operate on a structure. yes, i thought about that too. and no, it wouldn't affect what we planned. |
| 16:56 |
|
crab |
finding good names for the methods will be a bit of work though |
| 16:56 |
|
sri |
yea, operate on a structure is more versatile |
| 16:57 |
|
crab |
i mean, i want to do $res->thingy('/foo/1/bar'), not Mojo::JSON::Pointer->new($res->json)->get('/foo/1/bar') |
| 16:57 |
|
|
abra_ joined #mojo |
| 16:57 |
|
sri |
->json('/foo/1/bar') should still work, no? |
| 16:57 |
|
crab |
well, res->json() could still take the pointer |
| 16:57 |
|
crab |
yes |
| 16:58 |
|
sri |
doesn't matter much for test either |
| 16:58 |
|
crab |
exactly. ok, i like that. are you ok with Mojo::JSON::Pointer? |
| 16:58 |
|
sri |
it's my only idea :) |
| 16:58 |
|
sri |
maybe tempire or marcus have a better one? |
| 17:03 |
|
sri |
the whole thing is a little weird, since you actually want to work with the data structure, very much unlike an XML DOM tree |
| 17:03 |
|
crab |
yeah |
| 17:04 |
|
crab |
so MJP::exists returns true/false, ::get returns undef if !exists, and the value otherwise. |
| 17:05 |
|
sri |
sounds sensible |
| 17:05 |
|
crab |
and Mojo::JSON itself is entirely unchanged. |
| 17:05 |
|
sri |
i think blessing its results is no-go |
| 17:06 |
|
sri |
*+a |
| 17:06 |
|
crab |
::Message::json evaluates the pointer if one is provided, and Test::Mojo has json_is, json_exists (json_has?) |
| 17:06 |
|
sri |
json_has? |
| 17:06 |
|
sri |
oh for exists |
| 17:07 |
|
sri |
we have ->element_exists |
| 17:07 |
|
sri |
json_exists only makes sense |
| 17:07 |
|
crab |
fine |
| 17:08 |
|
sri |
kinda like json_has though :) |
| 17:08 |
|
sri |
grrr |
| 17:08 |
|
crab |
yeah, i like the way it looks in code |
| 17:08 |
|
crab |
and json_has_not is much nicer than json_exists_not :-) |
| 17:09 |
|
sri |
indeed |
| 17:09 |
|
sri |
i guess it wins |
| 17:10 |
|
sri |
json_hasnt? |
| 17:10 |
|
sri |
text_isnt |
| 17:10 |
|
crab |
i'd die a little inside every time i read that without an apostrophe |
| 17:11 |
|
sri |
well, Test::More does it |
| 17:11 |
|
* crab |
dies a little inside ;-) |
| 17:11 |
|
sri |
it's a convention |
| 17:11 |
|
sri |
:D |
| 17:12 |
|
crab |
of course, ->text_isn could return a blessed object with a t method! |
| 17:13 |
|
crab |
no, that won't quite work. drat |
| 17:27 |
|
crab |
hum. i need a quote. |
| 17:35 |
|
sri |
heh |
| 17:36 |
|
sri |
in the last simpons episode were many great ones |
| 17:36 |
|
|
abra__ joined #mojo |
| 17:37 |
|
sri |
crab: http://en.wikiquote.org/wiki/T[…]_of_Future_Passed |
| 17:37 |
|
sri |
those should be enought for every line |
| 17:41 |
|
sri |
"Google, even though you've enslaved half the world, you're still a damn fine search engine." |
| 17:43 |
|
crab |
ok, must sleep. back tomorrow. |
| 17:44 |
|
|
grim_fandango joined #mojo |
| 17:45 |
|
sri |
nn |
| 17:45 |
|
|
MojoGuest35 joined #mojo |
| 17:47 |
|
|
newbie joined #mojo |
| 17:54 |
|
|
MojoGuest527 joined #mojo |
| 17:54 |
|
|
MojoGuest331 joined #mojo |
| 17:55 |
|
|
MojoGuest689 joined #mojo |
| 18:06 |
|
|
MojoGuest626 joined #mojo |
| 18:12 |
|
|
MojoGuest143 joined #mojo |
| 18:14 |
|
|
ispeak joined #mojo |
| 18:23 |
|
sri |
omg, the next firefox is gorgeous :o http://i.imgur.com/ur555.png |
| 18:23 |
|
marcus |
sri: guess it will be a while until you get your book, ships 30. january |
| 18:23 |
|
sri |
marcus: thanks, from what i saw it's totally worth the wait :D |
| 18:24 |
|
vervain |
My company has an annual 3 day meeting at a resort... one of the evening socials this year is a 'wear your favorite t-shirt'... |
| 18:24 |
|
vervain |
I'm thinking White text on black shirt 'Got Mojo?' :-D |
| 18:24 |
|
marcus |
Your Order ID is: #4916 |
| 18:24 |
|
marcus |
vervain: that should get you laid :) |
| 18:26 |
|
marcus |
crab: I'd prefer Mojo::JSONPointer, but I guess Mojo::JSON::Pointer is fine too. |
| 18:29 |
|
* marcus |
just remembered sri's old domain.. oook.de |
| 18:29 |
|
|
MojoGuest829 joined #mojo |
| 18:29 |
|
MojoGuest829 |
From: http://www.google.at/url?sa=t&[…]ankDQod0w&cad=rja (1 hits) |
| 18:29 |
|
MojoGuest829 |
gh |
| 18:29 |
|
|
sugar joined #mojo |
| 18:30 |
|
marcus |
sri: http://web.archive.org/web/200[…]tp://www.oook.de/ :) |
| 18:33 |
|
marcus |
archive.org, bringing embarrasment to the internet for more than 15 years. |
| 18:33 |
|
sri |
wow, that's old |
| 18:34 |
|
marcus |
http://web.archive.org/web/200[…]ttp://thefeed.no/ my plans for 2002 |
| 18:34 |
|
marcus |
apache 2.0, mason and alzabo |
| 18:36 |
|
sri |
:D |
| 18:42 |
|
ccushing |
I still am not sure what $c in a controller is supposed to represent. In Cat it's the context object, but as far as I can tell mojo doesn't have one |
| 18:43 |
|
sri |
$c *is* the controller |
| 18:44 |
|
ccushing |
oh so it'd be the same as saying $self right? |
| 18:44 |
|
sri |
exactly |
| 18:44 |
|
ccushing |
or... how should I get access to that |
| 18:44 |
|
ccushing |
ok |
| 18:44 |
|
ccushing |
then why the F* doesn't it use $self |
| 18:44 |
|
ccushing |
it makes the docs damn confusing |
| 18:45 |
|
sri |
that depends on context |
| 18:45 |
|
sri |
if you look at it from the outside it's $c, if it's the actual invocant it's $self |
| 18:46 |
|
sri |
it's only confusing when you come from catalyst, and that's really catalysts fault :) |
| 18:46 |
|
ccushing |
perhaps but imo, anytime there's a variable declared and I can't find it's definition I find it confusing |
| 18:47 |
|
sri |
what definition? |
| 18:47 |
|
purl |
somebody said definition was refined every couple of years, usually, different rules about steps and raising my knee and arm motions. |
| 18:47 |
|
sri |
$self is like the first line in the tutorial |
| 18:48 |
|
sri |
did you skip the tutorial? |
| 18:49 |
|
vervain |
ccushing: $c isn't defined... it's not like you can just use $c in a controller without defining it first. |
| 18:49 |
|
vervain |
And I think that is where the pod for Mojolicious::Controller may fall down. |
| 18:50 |
|
sri |
vervain: the pod is just a reference, explanations are in the tutorial |
| 18:51 |
|
|
MojoGuest89 joined #mojo |
| 18:56 |
|
|
MojoGuest556 joined #mojo |
| 18:57 |
|
MojoGuest556 |
hello |
| 18:57 |
|
purl |
niihau, MojoGuest556. |
| 18:58 |
|
marcus |
sri: I still kinda thing $self would be clearer in the controller docs |
| 18:58 |
|
marcus |
think |
| 18:59 |
|
vervain |
Having $self throughout might be a bit 'noisy' over and over again... but it could be made explicit that $c is a synonym. |
| 19:01 |
|
tempire |
all the browsers seem to be on the ball now. even opera is pretty |
| 19:01 |
|
tempire |
if opera would have been this pretty 3 years ago, they would have preempted chrome |
| 19:03 |
|
tempire |
hmm. pixelmator only supports 8bit pngs |
| 19:03 |
|
tempire |
:( |
| 19:06 |
|
sri |
marcus: seriously? |
| 19:06 |
|
purl |
is that for real? |
| 19:06 |
|
marcus |
sri: yeah, because you are almost always using a controller from itself, not from the outside. |
| 19:08 |
|
sri |
marcus: and what about examples like http://mojolicio.us/perldoc/Mojolicious#hook |
| 19:09 |
|
marcus |
not sure tho, would not be consistent with the other documentation. |
| 19:09 |
|
sri |
right |
| 19:09 |
|
sri |
i try to use $self only in the right context |
| 19:09 |
|
sri |
$self in Mojolicious would be a lot more confusing imo |
| 19:09 |
|
marcus |
sri: yeah, $c is clearly the right choice for 'hook'. |
| 19:11 |
|
sri |
didn't we have a discussion about using $c everywhere in the past? |
| 19:11 |
|
sri |
don't remember how it ended |
| 19:11 |
|
marcus |
in tears |
| 19:12 |
|
sri |
that sounds about right |
| 19:14 |
|
|
mire_ joined #mojo |
| 19:14 |
|
sri |
hmm, firefox nightly is still ugly |
| 19:29 |
|
|
MojoGuest216 joined #mojo |
| 19:43 |
|
|
ispeak joined #mojo |
| 19:44 |
|
marcus |
sri: please submit a metacpan logo, current ones are making me cry. |
| 19:44 |
|
sri |
:) |
| 19:48 |
|
|
batman left #mojo |
| 19:59 |
|
|
netfeed joined #mojo |
| 20:05 |
|
ccushing |
sri I got pulled into a meeting, yeah I read the tutorial but it's all around ::Lite, which I'm not using, and iirc it doesn't use $c at all. vervain I know it needs to be defined, the problem is that it's obviously an object, and I was trying to figure out what object |
| 20:05 |
|
sri |
ccushing: as the description says, almost everything in the lite tutorial *does* apply to normal apps |
| 20:06 |
|
sri |
ccushing: i don't even understand what got you started with $c |
| 20:06 |
|
sri |
tutorials and guides are pretty consistent with $self |
| 20:06 |
|
ccushing |
http://search.cpan.org/~ams/Mo[…]ous/Controller.pm everything in here uses $c |
| 20:06 |
|
ccushing |
and I was looking for url_for |
| 20:06 |
|
sri |
that's an api reference |
| 20:07 |
|
ccushing |
I'm aware |
| 20:07 |
|
ccushing |
and I was looking at the reference because what I needed wasn't in the tutorial |
| 20:07 |
|
ccushing |
but transitioning to the reference from the tutorial makes not a lot of sense |
| 20:08 |
|
ccushing |
I have no idea how to use configs at the end of the tutorial either |
| 20:08 |
|
sri |
ccushing: http://mojolicio.us/perldoc/Mo[…]cious/Lite#Routes |
| 20:08 |
|
ccushing |
I figured that out |
| 20:08 |
|
marcus |
ccushing: it's consistent with everything here using $url tho - http://mojolicio.us/perldoc/Mojo/URL |
| 20:08 |
|
sri |
it's like the first thing you learn |
| 20:08 |
|
marcus |
for instance |
| 20:08 |
|
sri |
i think it boils down to you having skipped learning ::Lite |
| 20:09 |
|
marcus |
seems to be a common theme. |
| 20:09 |
|
sri |
the documentation is written with the expectation that you learn ::Lite and then move on |
| 20:09 |
|
ccushing |
I didn't skip it, but I may have skimmed it. I'm not doing any html coding either |
| 20:09 |
|
ccushing |
this is a json only app |
| 20:09 |
|
sri |
or skimmed, yea |
| 20:10 |
|
ccushing |
get '/bye' < I have no need for that syntax |
| 20:10 |
|
sri |
it's irrelevant |
| 20:10 |
|
ccushing |
I needed to look at mojolicious style route handling |
| 20:10 |
|
sri |
all action code is exactly the same |
| 20:11 |
|
sri |
you don't learn ::Lite or full Mojolicious, you have to learn both |
| 20:11 |
|
sri |
because they are 99.9% the same |
| 20:11 |
|
marcus |
Lite is just sugar on top of Mojolicious |
| 20:11 |
|
ccushing |
right |
| 20:12 |
|
sri |
https://github.com/kraih/mojo/[…]cious/Lite.pm#L11 # that's the whole thing |
| 20:13 |
|
sri |
and half of it is home dir detection :) |
| 20:15 |
|
marty |
Is it worth being concerned about session/cookie data size? Or is it safe to just put as much info in the session as we need and assume the browser will take it? (I'm kinda confused on this) |
| 20:15 |
|
sri |
4096 bytes |
| 20:15 |
|
purl |
well, 4096 bytes is the URL limit |
| 20:16 |
|
* marty |
pats purl |
| 20:16 |
|
* purl |
purrs |
| 20:16 |
|
sri |
and that's after serialization |
| 20:16 |
|
marcus |
also, remember it's sent with every request |
| 20:16 |
|
marcus |
so be conservative |
| 20:16 |
|
marty |
so we should keep track of our data size and split it into multiple cookies manually if needed? |
| 20:17 |
|
sri |
indeed, don't store more than you have to in the session |
| 20:17 |
|
marcus |
marty: store on the server side if you need a lot of data |
| 20:17 |
|
marcus |
just use an id to reference it or whatever in the client side session |
| 20:17 |
|
marty |
I'm thinking of things like shopping carts with hundreds of line items. Hmm, maybe better to just store a cart_id in the session and then store the cart in mongo |
| 20:17 |
|
* marty |
nods |
| 20:18 |
|
marty |
Yep, thanks guys |
| 20:18 |
|
sri |
yea |
| 20:22 |
|
* ccushing |
shudders at mention of mongo |
| 20:22 |
|
ccushing |
and shopping cart |
| 20:26 |
|
* ccushing |
still doesn't see that that explains how to use url_for outside of a template |
| 20:26 |
|
|
MojoGuest178 joined #mojo |
| 20:26 |
|
MojoGuest178 |
From: http://www.google.fr/url?sa=t&[…]uzUnHhWcD0vcKNULg (1 hits) |
| 20:26 |
|
MojoGuest178 |
ddfdfff |
| 20:26 |
|
MojoGuest178 |
f |
| 20:26 |
|
MojoGuest178 |
f |
| 20:26 |
|
|
MojoGuest655 joined #mojo |
| 20:26 |
|
MojoGuest655 |
From: http://www.google.fr/url?sa=t&[…]uzUnHhWcD0vcKNULg (2 hits) |
| 20:28 |
|
|
MojoGuest620 joined #mojo |
| 20:29 |
|
marty |
ccushing: Actually, mongo works quite well for a shopping cart. It's not perfect but so far I'm finding it very flexible. Here is a better analysis... http://kylebanker.com/blog/201[…]db-and-ecommerce/ |
| 20:29 |
|
ccushing |
marty I would be concerned about mongo's lack of acid |
| 20:29 |
|
|
MojoGuest740 joined #mojo |
| 20:29 |
|
ccushing |
of course lack of acid always concerns me |
| 20:29 |
|
marcus |
PLEASE SEND ACID! |
| 20:29 |
|
marcus |
WE'RE DESPERATE OVER HERE! |
| 20:30 |
|
|
MojoGuest455 joined #mojo |
| 20:30 |
|
MojoGuest455 |
From: http://www.google.fr/url?sa=t&[…]uzUnHhWcD0vcKNULg (3 hits) |
| 20:30 |
|
ccushing |
marcus I'll let you know if I get some real ACID ;) |
| 20:31 |
|
|
MojoGuest110 joined #mojo |
| 20:31 |
|
marcus |
If you're still able to articulate, that is. |
| 20:31 |
|
marty |
Yea. I would never consider anything but an ACID compliant RDBMS for anything financial or accounting related. But ecommerce is mostly displaying and sorting data. Not much need for ACID in there. |
| 20:32 |
|
ccushing |
but it's people buying stuff |
| 20:32 |
|
marty |
The only place I might use Postgresql would be at the checkout stage. I may store the order and payment info in Postgresql. |
| 20:37 |
|
ccushing |
$self->headers->location( |
| 20:37 |
|
ccushing |
$self->url_For( '/user', $user->user_id ) |
| 20:37 |
|
ccushing |
); |
| 20:37 |
|
ccushing |
hmm... maybe I shoulda pasted that :/ |
| 20:37 |
|
ccushing |
anyways |
| 20:37 |
|
ccushing |
would that be accurate for setting a location within the controller |
| 20:42 |
|
* marty |
throws ccushing into the alligator pit for pasting into the channel. :P |
| 20:43 |
|
marcus |
ccushing: you should have. |
| 20:43 |
|
marcus |
ccushing: do you actually want redirect_to? |
| 20:43 |
|
vervain |
Can anyone recommend an Android IRC client? I could use irssi, ssh and screen but I'm not all that fond of irssi. |
| 20:45 |
|
marty |
url_For should be lowercase |
| 20:46 |
|
marty |
But ya, what marcus |
| 20:46 |
|
marty |
said |
| 20:49 |
|
ccushing |
what I want is a 201 with a Location: or a 302 with a Location: so do I want redirect_to? |
| 20:50 |
|
vervain |
Every now and again I run across some local file system HTML docs... I use this: http://pastebin.com/qZbc4r1t to fire up a quick server... is there a better way? |
| 20:51 |
|
netfeed |
vervain: weechat + screen? |
| 20:51 |
|
ccushing |
didn't someone write a psgi fileserver that just works... just sayin |
| 20:51 |
|
ccushing |
it like took a directory as an option |
| 20:52 |
|
vervain |
Any chance you remember a name? |
| 20:52 |
|
|
GitHub88 joined #mojo |
| 20:52 |
|
GitHub88 |
[mojo] kraih pushed 1 new commit to master: http://git.io/82Z_1A |
| 20:52 |
|
GitHub88 |
[mojo/master] fixed Morbo to ignore hidden directories - Sebastian Riedel |
| 20:52 |
|
|
GitHub88 left #mojo |
| 20:53 |
|
ccushing |
http://search.cpan.org/~miyaga[…]/App/Directory.pm might have been thinking of this, which is about the same as what you hove... hmm |
| 20:53 |
|
ccushing |
have* |
| 20:57 |
|
ccushing |
vervain why put up a webserver to read htdocs? |
| 20:58 |
|
sri |
vervain: perl -Mojo? |
| 20:59 |
|
sri |
perl -Mojo -E'a->static->root("."); a->start' daemon |
| 21:01 |
|
sri |
or just "mkdir public; perl -Mojo -E'a->start' daemon" |
| 21:14 |
|
ccushing |
is there any way to change how errors are output? like output exceptions in json instead of html + css |
| 21:14 |
|
ccushing |
or simpler |
| 21:14 |
|
ccushing |
since I'm not viewing in a browser |
| 21:26 |
|
ccushing |
$self->redirect_to( '/user', user_id => $user->user_id ); # Location: http://localhost:3000/user |
| 21:26 |
|
ccushing |
$user_id has a value |
| 21:26 |
|
ccushing |
well $user->user_id |
| 21:26 |
|
ccushing |
so why is it not putting it in the uri |
| 21:41 |
|
ccushing |
http://privatepaste.com/61e64497b3 |
| 21:42 |
|
ccushing |
why is url_for not consistantly generating a url |
| 21:42 |
|
ccushing |
it doesn't show an actual url when I print it either |
| 21:54 |
|
vervain |
ccushing: In my catalyst world I use ErrorCatcher and CustomErrorMessage to send emails to support/sysadmin... I'll be building something similar for my Mojo... if you are interested in collaboration I'd be up for it. |
| 21:55 |
|
marty |
ccushing: something like $self->redirect_to( '/user/' . $user->user_id ); |
| 21:56 |
|
ccushing |
that works, though using redirect_to seems to create the wrong status message in the debug log |
| 21:56 |
|
ccushing |
and 302 found is not the same a 201 created :/ |
| 21:56 |
|
ccushing |
though both should have a Location: |
| 21:58 |
|
ccushing |
http://privatepaste.com/df163195ff |
| 21:58 |
|
ccushing |
seems to work as expected |
| 21:59 |
|
vervain |
ccushing: I use a local server to view HTML docs because it's a better experience than file:// |
| 21:59 |
|
vervain |
usually |
| 22:01 |
|
ccushing |
vervain and maybe on the email thing... at the very least someone here may need that if it does not exist yet |
| 22:05 |
|
marty |
You can also set a response code like so... $self->res->code(201); $self->redirect_to( '/user/' . $user->user_id ); |
| 22:24 |
|
newbie |
can i redefine HTTP 500 handler? i believe i saw an example how to do it, but i can't find it |
| 22:30 |
|
marty |
xaka: Is this what you are looking for? http://search.cpan.org/~ams/Mo[…]#render_exception |
| 22:32 |
|
xaka |
marty: nope, i want to redefine exception handling logic at all (actually the same as ccushing want) so application/json will be sent to a client instead of text/html |
| 22:33 |
|
ccushing |
marty I tried that it still output a 302, and a debug 302, order seemed to be wrong, but even fixing the order didn't seem to (though I'd have to double check) fix the debug log |
| 22:36 |
|
marty |
xaka: can't you use $self->respond_to( json => sub { do_stuff_here } ); |
| 22:36 |
|
|
vervain_ joined #mojo |
| 22:36 |
|
xaka |
marty: i have a lot of controllers and i'm too lazy to do it for every method :) |
| 22:37 |
|
marty |
ccushing: strange. I tested it here and it works perfectly. Not sure what is happening. |
| 22:37 |
|
ccushing |
marty nfc, but the alternate method works, it was simply a matter of determining all the right calls |
| 22:38 |
|
xaka |
marcus: oh, looking through code helps a lot. I think i can define application's "render_exception" method and it'll called |
| 22:38 |
|
|
vervain_ joined #mojo |
| 22:38 |
|
xaka |
there is some hidden check inside Routes.pm :) |
| 22:38 |
|
ccushing |
xaka if you figure it out let me know |
| 22:39 |
|
xaka |
sri: is it safe to use this hidden "hack"? i mean define "sub render_exception" inside application class |
| 22:39 |
|
ccushing |
it's all kinda stupid, I requested application/json why on earth are you sending me a text/html error |
| 22:40 |
|
xaka |
ccushing: mojo can't decide for you what to send back, what the format, etc. so it uses common way to do it |
| 22:41 |
|
xaka |
are expecting [] or {}, or whatever else? mojo doesn't know and can't know so it's up to you redefine the logic. The only question is how to do it |
| 22:41 |
|
xaka |
*are you |
| 22:42 |
|
ccushing |
xaka well respond_to (experimental) is capable of making decisions based on content type. no reason a default couldn't be to serialize into the request format if a serializer is available |
| 22:43 |
|
marty |
try appending .json to your url and see if that changes anything. |
| 22:46 |
|
marty |
I had some javascript widgets that were not setting the accept header correctly so I had to set the format in the url |
| 22:47 |
|
ccushing |
no it doesn't |
| 22:47 |
|
ccushing |
it responds correctly unless an exception is thrown by the application |
| 22:51 |
|
sri |
ccushing: why would it default to sending you a json exception for a server error? exceptions are exceptional and the server has no reason whatsoever to assume your browser app can handle arbitrary json objects that have absolutely nothing todo with the resource you originally requested |
| 22:52 |
|
ccushing |
why does it assume I can handle arbitrary html? |
| 22:52 |
|
sri |
why not? |
| 22:52 |
|
ccushing |
it's making the assumption my client is a web browser |
| 22:52 |
|
ccushing |
because the assumption is false |
| 22:52 |
|
sri |
no, it just falls back to what it always does |
| 22:53 |
|
sri |
one way or the other, you're screwed, why add unnecessary complexity? |
| 22:53 |
|
ccushing |
so I can read it on the command line client. I'd personally be more happy reading plain text so I can read the error |
| 22:53 |
|
sri |
both are wrong, simplest solution wins |
| 22:53 |
|
ccushing |
html is not simple |
| 22:54 |
|
xaka |
anyway, sri, is there any way to redefine any internal 404/500/... handlers at application level, not only controller? |
| 22:57 |
|
xaka |
my application is full of JSON so i don't need to wrap into eval every controller's subroutine and generate JSON response manually in case of error. Having possibility to do it at application level might save my fingers and time |
| 22:58 |
|
ccushing |
my application is a JSON API, it provides no HTML or other interfaces |
| 23:00 |
|
vervain_ |
The error question is crutial to me... I need application level error handling. I guess I've been assuming that was a given. |
| 23:00 |
|
xaka |
ccushing: the only way which i see is create JsonController, redefine render_exception there and base all your controllers on this class. That will work. I'm not sure it's clear solution, but still |
| 23:01 |
|
ccushing |
xaka Method Modifiers would probably work too |
| 23:02 |
|
ccushing |
https://metacpan.org/module/Cl[…]Method::Modifiers |
| 23:02 |
|
xaka |
no, it's from black magic novel, i don't like it :) |
| 23:02 |
|
ccushing |
though that wouldn't necessarily happen in every class |
| 23:02 |
|
ccushing |
heh |
| 23:03 |
|
ccushing |
I wonder if sri would accept a patch if we could come up with one |
| 23:03 |
|
xaka |
having JsonController you can controll which controllers should "supports" such logic and which are not, probably it's better than having global exception handler |
| 23:04 |
|
sri |
open an issue with a clear proposal and we can discuss it |
| 23:04 |
|
vervain_ |
In fairness Sri doesn't have to accept a patch for you to run it. :-) |
| 23:04 |
|
sri |
you have to convince all core devs, not just me |
| 23:05 |
|
ccushing |
vervain_ I don't like writing patches that aren't even going to be considered. It's a PITA to maintain custom patches |
| 23:05 |
|
ccushing |
but I'll think about it, and put it on my todo list |
| 23:06 |
|
xaka |
my proposal would be - allow to redefine internal 404/500/... handlers in watermode mode: if controller has handler, call it; otherwise check application for a handler |
| 23:06 |
|
xaka |
*waterfall |
| 23:06 |
|
vervain_ |
I hear ya... but custom patches with got are pretty easy. I do it with kernels all the time. |
| 23:07 |
|
ccushing |
vervain_ I maintained a git one with git for a while |
| 23:07 |
|
ccushing |
until they rewrote the entire fiel |
| 23:07 |
|
ccushing |
file* |
| 23:07 |
|
vervain_ |
Ya... you van still get bit. |
| 23:08 |
|
vervain_ |
I'll need it though right out of the gate... an error in startup should be able to throw an error that gets caught and emailed. |
| 23:25 |
|
|
vervain_ joined #mojo |
| 23:26 |
|
sri |
vervain_: you could just hook into the message event of the logger and catch errors http://mojolicio.us/perldoc/Mo[…]kbook#EventSource |
| 23:26 |
|
sri |
experimental though |
| 23:28 |
|
vervain_ |
Well then... I guess some experimenting is in order then :-) thanks! |
| 23:28 |
|
xaka |
ccushing: using JsonController works well |
| 23:36 |
|
|
mire_ joined #mojo |
| 23:47 |
|
|
joemcneirney joined #mojo |
| 23:47 |
|
|
vervain_ joined #mojo |
| 23:51 |
|
|
jmhgtx joined #mojo |
| 23:51 |
|
|
metaperl joined #mojo |
| 23:53 |
|
|
mattastrophe joined #mojo |