The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2014-03-22

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:03 Adurah With a name like FreMEAN on twitter, I guess calling people assholes is what they'd do.
00:03 jberger I don't know what was added
00:04 jberger what are we looking at?
00:04 Adurah A joke was added.
00:10 Adurah Was that fake freman? can't really tell with mibbit.
00:12 jberger tell usa ya what, I'm just going to keep using great software to build great software
00:12 Adurah Differing host...
00:12 jberger s/usa//
00:13 Adurah Probably fake freman, he wouldn't come back if he was done with it.
00:13 jberger I'm tired of the drama, let's just be adults here
00:14 Adurah Probably was that vygr guy.
00:14 Adurah No idea who that is...
00:23 Adurah https://twitter.com/deborahkagan/status/445088398416805888 Whew, I was concerned there for a moment.
00:24 jberger hahaha now that's the mind of humor I can appreciate
00:48 jack joined #mojo
00:55 d4rkie joined #mojo
01:01 batman joined #mojo
01:01 elvis joined #mojo
01:59 zacts joined #mojo
02:19 russum joined #mojo
02:25 rem_lex|pivo joined #mojo
02:39 russum joined #mojo
02:45 klapperl_ joined #mojo
02:54 zM joined #mojo
02:54 laouji joined #mojo
02:59 russum joined #mojo
04:16 jack_ joined #mojo
04:39 thowe joined #mojo
05:09 hesperaux joined #mojo
05:20 laouji joined #mojo
05:31 * tempire prances
05:41 damaya joined #mojo
05:42 damaya Hi guys
07:24 dotandimet joined #mojo
07:53 hummeleBop joined #mojo
07:59 sujithm joined #mojo
08:07 jack joined #mojo
08:22 basiliscos joined #mojo
08:45 Vandal joined #mojo
08:51 edestler joined #mojo
08:56 dotandimet joined #mojo
10:06 denis_boyun joined #mojo
10:14 Tiger|2 joined #mojo
10:36 edestler joined #mojo
10:44 ver joined #mojo
11:09 batman jberger: do you have any idea why i have import() in Mandel.pm ? https://github.com/jhthorsen/mandel/blob/master/lib/Mandel.pm#L289
11:09 batman jberger: no idea what good that does...
11:10 batman ah! now i think i get it... need to deprecate that functionality
11:26 D4RK-PH0ENiX joined #mojo
11:27 batman jberger: https://github.com/jhthorsen/mandel/commit/6016a55dab304023ce8008eec1ebba640bb85774 # no idea how to do a sane deprecation if this...
11:29 neyasov_ joined #mojo
11:29 dod joined #mojo
11:37 dvinciguerra joined #mojo
11:39 d4rkie joined #mojo
11:43 Tiger|2 joined #mojo
11:50 jack joined #mojo
11:56 dod joined #mojo
12:03 jberger batman, yeah that looks fine
12:03 jberger except
12:04 jberger now you won't be able to subclass
12:05 batman what do you mean?
12:06 jberger use Mandle 'My::BaseClass'
12:06 jberger maybe that never worked
12:06 batman when do you want to do that?
12:08 jberger package Horse; use Mandle 'Animal';
12:09 batman use Mojo::Base 'Animal'; ?
12:10 jberger maybe that's the real problem
12:10 batman (what you suggest did never work)
12:11 jberger maybe use Mandle should provide field, and we should just use Mojo::Base for inheritance directly
12:11 batman but how do you feel about just deprecating use Mandel; magic? it will break existing usage....
12:11 batman use Mandel != use Mandel::Document
12:11 batman ^ regarding "field"
12:12 jberger oh right, you already removed that!
12:12 jberger Then yeah, no reason to have that at all
12:14 batman :)
12:16 batman oh. i think i've figured out how to fix it without breaking existing functionality
12:16 * batman tries it out
12:17 jberger looking through MangoModel it is commented out from the very earliest commit
12:17 batman ok :)
12:18 jberger wait, no
12:18 jberger I found it, wrong file
12:18 jberger https://github.com/jberger/MangoModel/blob/master/lib/MangoModel/Type.pm#L58
12:19 jberger without trying to import field into the caller, there is no reason to have that import method
12:19 jberger classes should just use Mojo::Base
12:27 batman https://github.com/jhthorsen/mandel/commit/6c1e564cbf5eeee6a5167542ac89e1b59f83b124 :)
12:27 batman jberger: i will release that soon
12:28 batman unless you have comments
12:31 jberger I guess that works
12:31 jberger I wouldn't mind tacking in a deprecation warning too
12:31 batman maybe i should update the synopsis to do use Mojo::Base 'Mandel'; ..?
12:32 batman but if i deprecate, then i need some alternative. "use Mojo::Base 'Mandel';" is a valid alternative
12:34 jberger Why not just use Mojo::Base -base; use Mandle::Document;
12:34 batman because this isn't a document.
12:36 jberger oh gods, now I'm totally lost
12:36 batman rough weekend? :)
12:37 jberger just woke up
12:38 jberger I should never check irc before I have coffee
12:38 batman hehe. true :)
12:38 batman go get some coffee. i will make a new commit in the meanwhile
12:39 jberger would use Mojo::Base 'Mandel' work?
12:39 batman yes
12:39 jberger Then that's what it should be
12:41 jberger meantime, if we can detach Mandel::Document from Mojo::Base it might be better too. But all in good time
12:41 batman why?
12:41 batman https://github.com/jhthorsen/mandel/commit/39cd38e27bc4aef3cf019c3fc51efe401f7dab34
12:44 jberger btw a couple typos
12:44 jberger # use the model in you application
12:44 batman can you fix?
12:44 jberger your
12:44 batman ah. thanks
12:44 batman i can fix
12:45 batman more?
12:45 purl somebody said more was more is less. or Masters of Reverse Engineering.  They cracked CSS :) or see "again" or see "yet again" or legendary outlining software put out 15 years ago by Symantec who has since lost the source code. or software that makes people still run Mac OS 8 just so they can use it
12:45 jberger I probably ought to get a computer out
12:45 batman what do you mean?
12:45 jberger I'm on my phone
12:45 batman ah :)
12:45 batman convos?
12:45 purl convos is, like, really great on Android
12:46 jberger via convos as it happens
12:46 batman \o/
12:46 jberger it is like really great on Android
12:46 * jberger kicks purl
12:46 purl What? What?  Did i miss a cue?
12:47 jberger batman++
12:47 batman so... new mandel release?
12:47 jberger sure
12:47 batman cool
12:48 jberger I still need to open my convos to the internet
12:48 batman if you want, i can hook you up on demo.convos.by
12:48 jberger right now I can only use it when I'm on my LAN
12:48 batman i'm not clearing all conversations. i got an exception list
12:49 jberger nah, I've got this running and it's kinda cool
12:49 batman ok
12:49 jberger I just need to setup nat and noip again
12:49 batman demo.convos.by died some days ago though... redis had used all the memory :)
12:49 batman i think that's pretty cool
12:50 jberger haha, wow
12:50 jberger is it really that memory intensive?
12:50 batman https://metacpan.org/release/JHTHORSEN/Mandel-0.16
12:51 batman depends on the number of users :)
12:51 jberger yay
12:51 jberger batman++
12:52 batman there's 18 users on demo.convos.by, and the digitalocean instance only has 512 MB of memory
12:53 jberger I hadn't seen that there was a release for the blocking behavior too
12:53 jberger ahh
12:53 batman toadfarm use about 100MB of memory, not sure what else use memory...
12:54 jberger hmmm still no sri
12:55 batman is he on vacation?
12:58 jberger something like that
12:58 purl i think something like that is the basic gist of what we have going forward. Except I have to make sure there is oversight on the 'mst trained bastard' program
12:59 batman :)
13:02 batman i think of so many weird things... is return unless $str eq 'ok'; just as fast as return if $str ne 'ok'; ?
13:26 mire_ joined #mojo
13:40 jberger ne might be able to sort circuit
13:40 jberger But that's micro optimization
13:40 hesco I seem unable to pull my listen_socket from the configuration. Can anyone please advise?  https://gist.github.com/hesco/d54fc374e9e3506560b4
13:41 jberger hesco as I said yesterday, I don't think that that pattern is something we actively support
13:43 hesco that pattern, meaning getting access to the configuration before invoking start_app()?
13:43 hesco jberger: ^^^^^^^^^^
13:45 jberger certainly I have never tried it, so I can't help you. perhaps sometime else can
13:47 hesco thanks.  Perhaps I need to reproduce my configuration settings by hard coding my port assignments into a hash key'd off MOJO_MODE, without trying to jump these hoops.  Will try that I guess.
13:47 jberger hesco: can you really not just have the test script invoke the app? http://mojolicio.us/perldoc/Test/Mojo#SYNOPSIS
13:47 batman jberger: indeed it's micro optimization :)
13:48 hesco I need to run multiple versions of my application: dev, ci, qa, uat, and prod.
13:49 hesco I'm working to automate deployment, so I can set MOJO_MODE in the environment and have the application do the expected thing on launch.
13:50 hesco I'm keying distinct environments, distinct database instances, distinct ports, etc. off of MOJO_MODE.
13:51 hesco At the moment, I have only one machine to support this project, that may change next month, but until it does I need distinct ports to run these various environments simultaneously.
13:52 jberger ok so I can understand the need for a mapping of db instances...
13:52 jberger But why the port of the mojo application?
13:53 jberger the application does not need to be running before the tests start
13:53 jberger oh
13:54 jberger are you trying to test against a running instance of the app? in that case why are you calling start_app?
13:56 hesco yes, my uat environment is for humans to conduct exploratory testing with
13:57 jberger ok I think I have misunderstood
13:57 jberger you are not writing a test script, but rather the application script
13:58 hesco This is my first mojolicious project (from scratch, have had to read and hack a little on other folks mojo code before), so I'm sure most of what I have produced counts as cargo cult code.
13:58 hesco yes, at this moment, I am automating deployment.
13:59 jberger in that case, we really do recommend using exactly the recommended application script from the end of the growing guide
14:00 jberger http://mojolicio.us/perldoc/Mojolicious/Guides/Growing#Script
14:01 jberger checking that the mode is set is fine
14:02 zivester joined #mojo
14:04 jberger if you really need to read the configuration file before starting the app, I think I would recommend that you do that separately
14:05 hesco This ugly hack handles my requirement for the moment: the final update at the bottom of this paste: https://gist.github.com/hesco/d54fc374e9e3506560b4
14:05 d4rkie joined #mojo
14:07 jberger I think your only problem from the original is that the throwaway app you start to read the configuration file isn't named
14:08 jberger so you are most likely getting the built in hello world app
14:08 jberger line 22
14:13 jberger confirmed, the app you start on line 22 is Mojo::HelloWorld and thus does not contain the configuration file you need
14:14 jberger either start a throwaway instance of your actual app, or else setup the default app so that it sees your configuration file
14:14 jberger hesco ^^
14:16 hesco I get: Can't locate object method "config" via package "Mojolicious::Commands"
14:17 jberger you'll have to tinker with it, I've never tried creating a throw away app during startup like this
14:18 jberger hesco https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Command.pm#L15
14:23 jberger hesco, how does your app load the configuration file?
14:24 hesco jberger: thanks for that.  that was helpful.  MyApp->startup() includes:  $self->plugin('INIConfig', {file => 'conf.d/tfc_' . $self->mojo_mode . '.conf'});  as shown in the paste.
14:25 jberger oops sorry I missed that
14:26 dotandimet joined #mojo
14:26 hesco no sweat, you contribute much, even if I occassionally repeat myself.
14:27 hesco I think a more elegant solution may just await a future iteration.  My hash may duplicate configuration in the code base, but it gets me moving again.  To stay moving, I can comment out the default.listen, from config files; or perhaps simply manually parse those files myself from the script, rather than trying to instantiate the application before I have to instantiate the application.
14:27 hummeleBop joined #mojo
14:28 jberger I would try to get the default app to load that same configuration file
14:28 jberger the problem would be if your app merges some defaults then you will need to keep them in sync
14:29 hesco In fact, I think a new MyApp::parse_listen_socket_from_config_file() function which requires no instantiation might be just what is needed here.
14:29 jberger yeah
14:29 hesco ok, that sounds like a plan the.  thanks for helping me think through that.
14:29 jberger no problem
14:30 jberger anyway, now you see why we recommend just using the script we provide ;-)
14:31 jberger the rabbit hole gets dark and steep very quickly
14:33 cpan_mojo Mojolicious-Plugin-Bootstrap3 3.1003 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-Bootstrap3-3.1003
14:34 jberger hesco just to mention it: I'm not sure how well such a script would work with hypnotoad should you ever think about that
14:34 jberger hypnotoad is very picky about some of that stuff
14:35 hesco and hypnotoad would be a preferred option for a production deployment, I assume?
14:35 jberger Then again perhaps it would be easier, as hypnotoad takes it's listen pry from the config file!
14:35 jberger s/pry/port/
14:36 * jberger curses swipe typing
14:36 hesco I've been running this as perl -Ipaths scripts/myapp &
14:36 jberger yes, on *nix
14:37 hesco I'm impressed.  I would have thought you were at a keyboard
14:37 jberger phone
14:37 hesco a qwerty one I mean
14:37 jberger phone and convos
14:37 hesco I can't do that.  never developed those skills
14:38 jberger as I told batman earlier, I really should just get up and get the laptop
14:38 jberger it's just been a lazy type morning
14:39 jberger haha, that was almost 2 hours ago
14:46 mire_ joined #mojo
14:47 batman ;)
14:55 cpan_mojo Mojolicious-Plugin-Bootstrap3 3.1004 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-Bootstrap3-3.1004
14:55 hesco so, that is sorted out and working now; will deal with hypnotoad requirements when we cross that bridge.
14:55 hesco thanks jberger
14:55 batman jberger: https://metacpan.org/pod/release/JHTHORSEN/Mojolicious-Plugin-Bootstrap3-3.1004/lib/Mojolicious/Plugin/Bootstrap3.pm#Non-standard-files
14:56 batman added a note about jquery version ^
14:56 batman hope it's understandable
15:04 Jim joined #mojo
15:08 Jim Regarding theMojolicious::Plugin::Mount,   I have app1 and app2 and want to use the Mount plugin to launch them in one, should I create a separate app3 as a wrapper and mount both app1 and app2 in app3? or should I mount app2 in app1?
15:09 batman Jim: you can mount one app inside another.
15:10 batman Jim: have you considered toadfarm? https://metacpan.org/release/Toadfarm
15:11 Jim Thanks Batman, what if I have 10 apps, which app of the 10 should I use as the "launcher" to mount all others?
15:11 batman check out toadfarm
15:12 Jim I have read about Toadfarm on irc before, will surely try, in my user case I have a few small apps, does it make more sense to use toadfarm or mount plugin?
15:12 sh4 joined #mojo
15:13 batman Jim: i always use toadfarm, even when i only got one app
15:13 batman in your case...it makes sense when the applications is not hard coupled.
15:14 Jim seems toadfarm is more natural in this case because all apps are still symmetric, I don't want one real app to serve as the mount point.
15:14 batman so if app1 depends on app2, then you could mount app2 inside app1, but if app1 works without app2, i would use a wrapper app
15:14 batman in my case, that wrapper app is toadfarm
15:14 Jim got it makes lot sense
15:14 batman cool :)
15:14 batman but i'm biased, since i wrote toadfarm ;)
15:15 batman feedback and questions are welcome
15:15 Jim ahh:) as long as it works well, will do
15:16 batman the main reason i always use toadfarm is that i can start my apps from crontab, using "toadfarm --start -a My::Application"
15:16 batman --start will check if it's already running and do nothing if the app is already running
15:17 Jim that's something useful
15:20 jberger hesco glad I could help
15:20 jberger batman: looks fine
15:22 batman jberger: thanks :)
15:26 * batman need to document options for toadfarm :(
15:33 Jim joined #mojo
15:46 dj_goku ls
16:19 Jim @batman: regarding Toadfarm, can  /path/to/my-app be a relative path to where myconfig.conf is?
16:28 spoot joined #mojo
16:29 batman i don't get the question :(
16:30 Jim figuring out what '/path/to/my-app' should be
16:30 batman i would suggest using full path.
16:31 Jim got it, let me step in the code to see how it works.
16:31 batman dj_goku: did you send me a mail with build failure for bootstrap3 ?
16:43 dj_goku I did sir.
16:43 dj_goku :D
16:44 batman dj_goku: what is the environment? debian, osx, windows, ...
16:44 dj_goku osx
16:44 batman ok. could you run the tests manually? cd /Users/dj_goku/.cpanm/work/1395502996.596; prove -vl
16:45 dj_goku will do
16:45 batman thanks
16:45 punter joined #mojo
16:47 punter I have a problem: my 'around_action' hook traps errors (with eval) and does a $c->render(json => $error), which works well. But when I call $next->() at the end of my around_action handler, then it doesn't work well anymore, and I get the Mojolicious Exception page in case of error.
16:47 dj_goku batman: http://paste.scsys.co.uk/330755
16:47 punter Should I scrap the call to $next->(), or is there another trick I can do to avoid Mojolicious from rendering an extra error page at me?
16:48 batman dj_goku: that sucks. do you have a "blib" directory?
16:48 dj_goku yes
16:49 batman Jim: https://github.com/jhthorsen/toadfarm#DESCRIPTION <-- would you mind reading the new description? i hope this will make it more understandable.
16:49 batman if not, please give me feedback
16:49 punter Maybe by doing something in before_render, I could stop the renderer from rendering any exceptions?
16:50 batman Jim: yeah...and https://github.com/jhthorsen/toadfarm#command-line-options
16:50 batman dj_goku: what about blib/lib/Mojolicious/Plugin/Bootstrap3/sass/ ?
16:50 batman and lib/Mojolicious/Plugin/Bootstrap3/sass/
16:52 batman dj_goku: oh crap! i think i get it now.
16:52 dj_goku ok cool
16:53 punter Any solution to my problem?
16:54 batman punter: i think you're using the wrong tool. maybe you want to use https://metacpan.org/pod/Mojolicious#before_render instead
16:55 punter batman, You mean I shouldn't "eval" to trap my error, but I should let my error cause the renderer to render an exception page (which I can customize)?
16:55 punter I need to trap my error, in order to call $db->rollback (in case of error)
16:55 batman not sure what you should, just throwing out ideas :)
16:56 punter o
16:56 batman punter: oh. that's awful :(
16:56 punter I heard so
16:56 punter in this group
16:56 batman you should let $db go out of scope and the database will clean up
17:01 punter So, how can I "cancel" the exception rendering mechanism? I don't want Mojolicious to automatically render exceptions. is that possible?
17:02 batman it's easier to answer what you want to do instead of what you don't want to :/
17:02 batman i mean... what do you want to happen?
17:02 punter I'll write again what I want to do.
17:02 batman and seriously: you should let $db go out of scope. you WILL be think "oh god, why didn't i listen" later on if you do _not_
17:03 punter I've called $self->render on my own inside around_action. Therefore under no case do I want Mojolicious to render an extra error page.
17:03 punter :-)
17:03 punter I'm using an ORM, and it's a little complicated to let the $db go out of scope (I think it's always in RAM somewhere)
17:04 batman sounds like there's something else going on
17:04 batman then you have a memory leak.
17:04 punter no, there's only one $db var per process
17:04 punter ok
17:04 punter I'll try something, and come back in 2 minutes
17:04 batman Test::LeakTrace
17:05 purl hmmm... Test::LeakTrace is very slow compared to the other two
17:05 * batman wonder which the other two are...
17:05 batman one $db pr process..? how are you able to do transactions then?
17:06 batman nevermind the last question. (your app is probably blocking)
17:07 punter I'm doing blocking. hm, batman, there actually might be something else going on. The error page gets rendered even when I return errors with a status of 200. I'll search some more on what's going on.
17:07 punter thanks
17:07 punter Maybe I should do transactions with non-blocking Mojolicious, with promises.
17:08 punter After I get this working, I'll try that.
17:08 Jim left #mojo
17:08 batman punter: then you need to have one $db pr request. not one $db pr process
17:09 punter yes
17:09 punter and use AnyEvent::DB::mysql ?
17:09 punter or plain DBI, it doesn't matter
17:11 batman sorry. can't help you :(
17:11 cpan_mojo Mojolicious-Plugin-Bootstrap3 3.1005 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-Bootstrap3-3.1005
17:12 dj_goku boom!
17:12 dj_goku trying now
17:12 batman dj_goku \o/
17:12 dj_goku sweeeeet
17:12 dj_goku works
17:12 Jim joined #mojo
17:12 dj_goku well installs
17:12 dj_goku havne't tried to use it.
17:13 dj_goku :D
17:13 batman yay! that's sweet
17:13 batman dj_goku: haha. it will probably work
17:13 batman Jim: did you get the links i posted?
17:15 batman dj_goku: i'm considering adding @import "bootstrap/field-with-error"; as standard, but i'm not quite sure yet...
17:16 punter I think I should study the Mojolicious.pm code
17:16 dj_goku batman: Plugin "bootstrap" missing, maybe you need to install it?
17:16 batman dj_goku: bootstrap3, not bootstrap
17:17 dj_goku ahh documentation is wrong  :D
17:17 batman NOOOOOOO! epic fail :P
17:18 batman fixing that now
17:19 dj_goku lol
17:19 dj_goku trying to figure out how to use it though.
17:19 dj_goku should I just add the assets into my head portion of my layout?
17:19 spoot joined #mojo
17:21 batman yeah %= asset 'bootstrap.css'
17:22 dj_goku hmm
17:23 dj_goku dumb question. do I need to have the files in public/js?
17:23 dj_goku I setup bootstrap already, but want to switch to your module.
17:23 batman no. you don't need anything else than what is documented in the SYNOPSIS
17:24 dj_goku hmm
17:24 batman you don't need any files. they are bundled with the m-p-bootstrap3 distribution.
17:24 batman note: bootstrap != bootstrap3
17:25 dj_goku [Error] Failed to load resource: the server responded with a status of 404 (Not Found) (bootstrap.css, line 0)
17:25 dj_goku hmm
17:26 batman no other errors? like missing sass or something?
17:27 dj_goku lol http://localhost:3000/css/bootstrap.css is there.
17:27 dj_goku one second
17:27 purl one second is, like, second is the duration of 9,192,631,770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the caesium-133 atom
17:27 batman dj_goku: that's your file, not what i've created
17:27 dj_goku Error: Popover requires tooltip.js
17:28 dj_goku batman: right but it can't find the /mojolious/../bootstrap.css
17:28 dj_goku http://localhost:3000/Mojolicious/Plugin/AssetPack/could/not/compile/bootstrap.css
17:28 dj_goku it can't find that.
17:30 batman "could not compile" ^^
17:30 batman that means you're missing an error in the log
17:30 batman it should say something like: sass require "sass". http://sass-lang.com/install
17:30 cpan_mojo Mojolicious-Plugin-Bootstrap3 3.1006 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-Bootstrap3-3.1006
17:31 dj_goku hmm nope
17:31 dj_goku don't see that.
17:31 batman that's weird... anyway: follow that link and install sass :)
17:31 dj_goku brewinstall maybe
17:32 Tiger|2 guys, i'm new in mojolicious my first project on mojolicious is https://github.com/dmitry-tiger/Graph, i see i use model in controller and i want to move some procedures in model package, but i don't understand what is best way to pass config object e.t.c. to model package. is it bad practice to pass $self object into function parameter?
17:32 batman Jim?
17:32 purl well, Jim is being helpful and polite
17:33 dj_goku batman: uh what os you on?
17:33 batman dj_goku: ubuntu
17:34 dj_goku wait sass is a ruby app?
17:34 batman dj_goku: yeah
17:34 batman Tiger|2: yes. that is often bad practice. you probably want to decouple the model and controller
17:34 dj_goku weird
17:34 batman why is that weird?
17:34 dj_goku I just want the UI of bootstrap.
17:34 batman Tiger|2: you just pass on the parameters that is required for the model to work.
17:35 batman dj_goku: yeah. i don't get why that's not working :(
17:35 dj_goku batman: well after sass it works.
17:36 batman dj_goku: something weird is going on...
17:36 punter Ok, here's my problem (and might be a Mojolicious bug as well): if around_action DOESN'T call $c->$action, then $c->$action STILL gets called, when $next->() is included in the around_action handler
17:36 punter Shouldn't the action NOT be executed in this case?
17:36 batman dj_goku: i will check the dist again
17:36 dj_goku batman: if I could share my session I would give you access.
17:37 batman dj_goku: can you tell me which files that is in ./public/packed ?
17:38 dj_goku still getting this though Error: Popover requires tooltip.js
17:38 dj_goku <link href="/packed/bootstrap-3ad501f5241e958b2bb89b4add1de793.css" rel="stylesheet" />
17:38 dj_goku that what you mean? ^^
17:38 batman /packed/bootstrap-3ad501f5241e958b2bb89b4add1de793.css <--- right. looks like the same file
17:39 batman are you modifying $app->static->paths ?
17:39 dj_goku nope
17:39 punter Is there something like a jsFiddle for Mojolicious apps?
17:39 dj_goku I am using a basic template: http://getbootstrap.com/examples/starter-template/
17:39 batman punter: liveperl.us
17:39 purl liveperl.us is, like, way cool. Guess it's firewalled from the inside ? (tried a g(..) got connection refused) :)
17:40 dj_goku ^^
17:40 punter ta batman
17:40 disputin joined #mojo
17:40 batman dj_goku: could you do this inside your app: warn Mojolicious::Plugin::Bootstrap3->asset_path
17:40 denis_boyun joined #mojo
17:41 batman after plugin('bootstrap3');
17:41 Tiger|2 batman: in my situation what is the best way to pass dbc helper to model
17:42 dj_goku /Users/dj_goku/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/Mojolicious/Plugin/Bootstrap3 at SimpleShop.pl line 4
17:42 batman "dbc helper" ?
17:42 ua_ joined #mojo
17:43 batman dj_goku: and you got /Users/dj_goku/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/Mojolicious/Plugin/Bootstrap3/packed/bootstrap-3ad501f5241e958b2bb89b4add1de793.css ?
17:43 dj_goku Tiger|2: helper dbh => sub { MyApp::Schema->connect('dbi:SQLite:file.db') or die 'Error: can not connect to simpleshop database' };
17:45 dj_goku batman: I see it there yes
17:45 batman dj_goku: i feel like an idiot. i seriously don't get why you needed to install sass :(
17:46 batman dj_goku: could you also do: warn join ' --- ', @{ $app->static->paths };
17:46 batman after plugin('bootstrap3');
17:46 dj_goku lol me either my manually adding bootstrap works.
17:47 dj_goku /Users/dj_goku/Development/perl/SimpleShop/public --- /Users/dj_goku/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/Mojolicious/Plugin/Bootstrap3 at SimpleShop.pl line 5
17:47 Tiger|2 batman:  i mean helper on https://github.com/dmitry-tiger/Graph/blob/master/lib/Graph.pm line 6, because i cant use mojolicious helpers inside model
17:48 dj_goku batman: btw there is only one file in my app/public
17:48 dj_goku but I see a number of files under the module /packed
17:48 batman Tiger|2: sorry. i can't help you.
17:48 dj_goku ls /Users/dj_goku/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/Mojolicious/Plugin/Bootstrap3/packed/
17:49 dj_goku bootstrap-3ad501f5241e958b2bb89b4add1de793.cssbootstrap-4a6855540fc3feeb306465859305cd6e.cssbootstrap-6d87c9526ee3bab443a129357c4a072b.jsbootstrap-cdb1eb2d042a35178ff03ebab9cb1e48.js
17:49 dj_goku sorry for pasting so much.
17:49 dj_goku :(
17:50 batman and you only have $self->plugin('bootstrap3'); ? no options..?
17:50 dj_goku right: plugin 'bootstrap3';
17:53 batman dj_goku: i think i'm able to reproduce the bug now :)
17:53 batman i'll be back later with more information
17:54 dj_goku haha alright I need to get lunch and other stuff.
17:54 dj_goku really awesome work~
17:54 dj_goku !
17:54 batman :)
17:54 batman thanks for all the help so far
17:56 batman dj_goku: can you let me know when you are back?
17:56 dj_goku will do
17:58 batman btw: did you get the bootstrap.css file now?
17:58 batman or does it still not work after installing sass?
17:58 dj_goku oh no it works
17:58 dj_goku just tooltip.js is erroring still
17:59 batman ah. right.
17:59 dj_goku should I have all of those css and js above I pasted in packed?
17:59 batman do you see that error in the browser?
17:59 dj_goku yeah in console
17:59 batman no, you shouldn't have any actually. that's the bug i'm fixing now.
17:59 dj_goku popover.js
18:00 dj_goku other than that, no errors
18:00 batman ok. thanks
18:00 dj_goku np
18:00 batman looks like i messed up the js order
18:01 dj_goku ahh
18:01 dj_goku I am building out an ubuntu server now.
18:01 dj_goku so we will see if I have any issues. :)
18:01 dj_goku local dev is osx
18:02 punter batman, I posted my problem in the mailing list (easier to see and answer there).
18:02 dj_goku well I need a break bbl
18:02 batman punter: ok. wish you get an aswer
18:02 batman dj_goku: take care :)
18:11 punter batman, maybe you'll want to answer it. it's very differently put than what I asked here.
18:15 cpan_mojo Mojolicious-Plugin-AssetPack 0.08 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-0.08
18:18 cpan_mojo Mojolicious-Plugin-Bootstrap3 3.1007 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-Bootstrap3-3.1007
18:21 batman dj_goku: ^ the fix was in assetpack. no need to for sass now
18:21 batman unless you want to customize the pack
18:38 dj_goku batman: haha ok nice. ill install it once i get back up. i am on my phone now. :)
18:38 batman cool
18:53 denis_boyun__ joined #mojo
19:04 mire_ joined #mojo
19:28 dotandimet joined #mojo
19:39 damaya joined #mojo
19:39 damaya Hi all, I am trying to understand callbacks used with routes.
19:39 damaya Basically, if the user is authenticated I'd like to render one page, and if not, I'd like to render a different page.
19:42 damaya Does this look fine: http://pastebin.com/ELmbVmPu
20:10 damaya Can't locate object method "del" via package "Mojolicious::Routes::Route"
20:10 damaya woops, sorry.
20:10 damaya Meant to Google that.
20:17 dj_goku batman: that worked and fixed all the problems!
20:25 damaya yeah, my authentication callback does not work
20:25 damaya hrm
20:38 punter How many times does $app->startup get executed, in a hypnotoad setup with 4 workers? 1, 4 or 5?
20:39 punter damaya, I think the method name is "delete", not "del"
20:40 damaya sorry about that. I accidentally posted that to the channel. I had figured that one out pretty quick ;)
20:40 damaya Thanks for the help though!
20:52 damaya ok, so oddly the callback example on the site isn't even working for me: http://pastebin.com/BVYkW245
20:52 damaya results in: None of these routes could generate a response for your GET request for /bye, maybe you need to add a new one?
21:03 jberger try any rather than route
21:03 damaya I did... get, any, route, all the same.
21:04 punter I suggest you make a minimal example of a complete Mojolicious::Lite application which is runnable on liveperl.us, and post the code in pastebin.
21:04 punter I don't know if that will get you an answer, though
21:05 damaya I restarted morbo, now it is working.
21:06 punter How can I get the $prefork server object from within a plugin of mine?
21:06 punter a
21:08 jberger I don't know that you can, and I doubt that you should
21:08 punter I need it, in order to execute "srand" on each launched worker
21:08 punter ok
21:08 punter How else can I do that?
21:08 jberger there is an example of exactly that in the docs
21:08 punter the Mojolicious docs? Thanks
21:12 jberger http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Built-in_web_server
21:15 punter jberger, rand isn't mentioned in this doc piece you gave me
21:16 punter oh it is
21:16 punter sorry :-)
21:16 punter (not rand, but next_tick, ok)
21:17 jberger right, I meant doing something at each new worker
21:19 punter worked perfectly, thanks
21:19 punter Maybe this should be placed elsewhere in the documentation
21:19 punter looks important
21:22 punter even though I didn't call "rand" anywhere myself before forking, all children give the same number when asked to call rand
21:22 punter This is serious (all workers will produce the same session tokens, if we use our own session token builder)
21:23 punter It should either be fixed or documented
21:23 punter May I open a bug about this?
21:26 punter Is there a reason it hasn't been fixed all this time (I see there's a plugin that works around it)
21:47 meshl joined #mojo
21:48 punter posted a bug for it
21:50 Adurah Isn't using rand for things that require cryptographic strength a no-no?
21:54 jberger session secrets are supposed to be the same between workers
21:55 jberger otherwise how do you handle a subsequent request to a different worker?
21:55 mudler joined #mojo
21:58 jberger I'm not sure what you think the bug is here
22:00 punter jberger, not everyone uses Mojo secrets for their auth needs
22:00 punter jberger, I for instance, store session tokens in database
22:01 punter also someone might want to build anonline casino
22:01 punter won't it be strange if the same numbers keep falling again and again?
22:01 Adurah Maybe they wouldn't use rand for it...?
22:01 punter yes ok
22:02 punter ok for the casino (not rand)
22:02 jberger punter this is a defined behavior in perl and iirc all languages that implement fork
22:02 punter but for session tokens?
22:02 Adurah Session tokens... /dev/urandom?
22:02 jberger I don't know what mojolicious is supposed to do about it
22:03 meshl joined #mojo
22:04 punter jberger, do you mean that all webservers have this same "problem" that I'm mentioning?
22:04 jberger yes
22:04 jberger those that fork
22:04 punter still the fact that everyone has the same "problem" doesn't mean we don't have to educate our users about it and how they can solve it
22:04 punter I think, I don't know
22:04 jberger randomness is hard, let's go shopping
22:05 punter casinos have either a generator that constantly generates numbers (whether they're needed or not), or they have special hardware that uses the environment to produce randomness
22:06 punter perhaps sri could move the documentation snippet we mentioned, over to hypnotoad's page
22:06 punter or copy it
22:06 punter that would also make me happy
22:06 meshl hey everyone... how do I set *several* HTTP headers at once in a Mojo::UserAgent GET request?
22:08 meshl I tried $self->ua->get($url => $headers)->res->text, $headers being a {header1 => value1, header2 => value2} but that did not work apparently...
22:08 jberger I wouldn't mind seeing a heading for it in the cookbook personally
22:09 punter that too
22:12 jberger meshl see Mojo::Headers::from_hash
22:13 jberger should work just fine
22:13 jberger what do you see with MOJO_USERAGENT_DEBUG=1
22:17 meshl jberger, sorry I won't be able to test at the moment, but surely these tips will help, thanks mate
22:20 Tiger|2 guys, what is the best way error handling with db errors in model? return db error in controller and parse it?
22:39 russum1 joined #mojo
23:19 mattastrophe joined #mojo
23:20 nic I can't say what's "best", but that way works for me
23:21 nic Part of the controller's job is knowing which problems are fatal, etc, and what to do/log/etc
23:35 disputin joined #mojo
23:43 d4rkie joined #mojo
23:44 D4RK-PH0ENiX joined #mojo
23:50 dvinciguerra joined #mojo
23:52 dj_goku so I am pretty new to web dev and html forms. what I want is a button that when clicked will pop up or do an overlay which will provide search and selection once this selection is done it needs to POST or PUT not sure which is better back to a /customers route which will then add/update a customer.

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary