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

IRC log for #mojo, 2017-04-26

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

All times shown according to UTC.

Time Nick Message
00:22 cheako joined #mojo
00:29 absolut_todd joined #mojo
00:45 bwf joined #mojo
00:49 kiwiroy joined #mojo
00:52 orev joined #mojo
00:55 orev what should one use now that rel_dir is gone?  I had been using that for add static paths as outlined here https://stackoverflow.com/questions/15576166/add-static-directory-to-mojo-lite-app by jberger
00:56 tchaves joined #mojo
00:57 cng I don’t *know* the answer, but I was just looking that this code, which adds a relative static path:
00:57 cng https://github.com/kraih/minion/blob/7ef4fadd531dcc7602ac603ea8d98446214e5d15/lib/Mojolicious/Plugin/Minion/Admin.pm#L10
00:59 orev ah, looks like rel_file has the same code as the old rel_dir
01:16 aborazmeh joined #mojo
01:59 jberger Yeah rel_dir no longer did anything distinct
02:00 jberger Though maybe better (and less confusing) to use child
02:49 kiwiroy joined #mojo
02:50 noganex joined #mojo
03:05 cheako joined #mojo
03:41 stryx` joined #mojo
03:49 inokenty-w joined #mojo
04:04 dboehmer_ joined #mojo
04:24 maschine joined #mojo
05:48 kiwiroy joined #mojo
06:30 salva joined #mojo
06:53 dod joined #mojo
06:54 stryx` joined #mojo
06:55 dod joined #mojo
06:58 dod joined #mojo
07:08 kiwiroy joined #mojo
07:15 AndrewIsh joined #mojo
07:17 Vandal joined #mojo
07:28 trone joined #mojo
07:49 kiwiroy joined #mojo
07:59 Peppard joined #mojo
08:05 ladnaV joined #mojo
08:10 Vandal joined #mojo
08:22 osfabibisi joined #mojo
08:32 dod joined #mojo
08:39 rshadow joined #mojo
08:44 Xyem Would there be any mileage in a patch making the join character in 'Mojo::Parameter' be an attribute? I'm having to generate URLs for a site that doesn't use '&' as the key=value pair separator.
08:46 rshadow joined #mojo
08:49 Xyem Probably not much use in it, but thought I'd ask anyway.
08:52 batman Xyem: this have been up before: https://github.com/kraih/mojo/issues/708
08:54 Xyem The more you know (didn't know anything other than & was valid). Thanks for the link.
09:05 stryx` joined #mojo
09:19 rshadow joined #mojo
10:02 coolo joined #mojo
10:30 batman Xyem: why do you need to generate url with something else than "&" ?
10:44 Xyem As I was under the impression that only '&' was valid, I thought this forum I was linking to was doing something special (?action=profile;id=10)
10:46 Xyem If it isn't something special, it may actually accept '&'.
10:48 Xyem I just tested it and it does indeed work :)
10:49 Xyem Oddly, the forum's own links aren't even consistent. I just saw "?session=biglongsessionid&action=profile;id=10"
10:49 batman i think historically "&" and ";" was competing, but ";" is now less favoured.
10:49 batman browsers get both formats
10:52 Xyem I see. The forum works correctly with both, so I am happy with that :)
10:52 coolo seriously? it's the first time I hear that this part is not speced. And indeed rfc3986 only references "as query components
10:52 coolo are often used to carry identifying information in the form of
10:52 coolo "key=value" pairs"
10:52 coolo nothing about how
11:26 tchaves joined #mojo
11:26 Xyem The Authentication plugin is a good demonstration why having access to the source code is useful. Behaviour described in the documentation isn't reflected in the code.
11:27 Xyem authenticate() claims to not call $validate_user_cb->() if you use the auto_validate key, but it does.
11:36 bobkare joined #mojo
11:45 * ashimema has submitted a few bugs to that plugin of late
11:50 dod joined #mojo
11:54 dod joined #mojo
12:08 castaway joined #mojo
12:13 Lee joined #mojo
12:25 Lee joined #mojo
12:33 perlpilot joined #mojo
12:48 berov joined #mojo
12:52 marty joined #mojo
12:55 webart jberger: strange ... so there actually is something called Job Description Language that is used for CERN and grid computing etc. (probably more than one version of it)
12:55 webart jberger: maybe that is what was being referenced
12:58 webart jberger: anyway are several variants of sort of half xml half ini file formats for submitting jobs it would be easy to parse them ... I like the idea of YAML inspired YAJDL:  YAJDL Ain't Job Description Language ;-)
12:59 batman coolo: you can look here for reference to the spec: https://github.com/kraih/mojo/blob/master/lib/Mojo/Parameters.pm#L152 and L159
12:59 batman hm... i thought i could reference two lines, instead of a range...
13:00 coolo you are saying mojo code is the spec? :)
13:03 webart jberger:  anyway Minion is super cool - I don't have a use case for job queue right now but I want to think of one :-D
13:05 webart jberger: parsing any kind of "markup" always reminds me of Ingy's super cool Pegex  https://github.com/ingydotnet/pegex-pm  heheh ... I don't have a use case for it but maybe I JDL grammar ;-)
13:05 webart $WORK !!
13:06 jberger I almost used Pegex at work the other day
13:07 jberger but I decided that I was trying to kill a bug with an A-Bomb
13:08 jberger but some day I want to find a use for it
13:08 jberger it would be rather interesting if someone could implement an abstract job description parser that translates to perl code
13:09 jberger Minion really doesn't need to be involved for the procedural stuff
13:09 jberger though I'm assuming there would be hooks around success etc
13:21 stryx` joined #mojo
13:24 armen joined #mojo
13:25 armen good morning
13:25 purl For you maybe.
13:28 gizmomathboy joined #mojo
13:40 Armen joined #mojo
13:45 marty_ joined #mojo
14:06 Pyritic joined #mojo
14:09 mcsnolte joined #mojo
14:18 jberger purl, that wasn't very nice
14:18 purl jberger: sorry...
14:18 jberger you should be
14:18 purl who says?
14:18 PopeFelix joined #mojo
14:18 jberger oh, getting fresh now?
14:19 gryphon joined #mojo
14:24 batman jberger: don't mess with the robots. one day they will take over and you don't want purl to hold a grudge :see_no_evil:
14:35 zivester joined #mojo
14:58 jberger 🤖
14:59 perlpilot joined #mojo
15:27 Pyritic joined #mojo
15:36 tchaves joined #mojo
16:13 PryMar56 joined #mojo
16:17 yysachinyy joined #mojo
16:26 dikim joined #mojo
16:26 itaipu joined #mojo
16:28 sh14 joined #mojo
16:34 cheako joined #mojo
16:35 perlpilot joined #mojo
16:36 osfabibisi joined #mojo
16:44 Armen is it always this quiet in here?
16:44 * Armen pokes purl
16:44 * purl wishes the bad Armen wouldn't do that.
16:47 disputin joined #mojo
16:53 Demian joined #mojo
16:59 Demian I am trying to send arguments to an application attribute
16:59 Demian something like this:  has => sub {my $self = shift; my $name = shift; Cat->new(name => $name)}
17:00 Demian sorry!  has friend => sub {...}
17:00 Demian this doesn't work later on when called from controllers ($c->app->friend('harry') )
17:01 Demian what is the correct approach?
17:01 purl the correct approach is to use emacs
17:02 pink_mist Demian: sounds like you should make it a simple method instead
17:03 Grinnz rofl purl
17:04 Demian this is silly, but what does that look like?
17:05 Demian this relates to loading a class that creates a dbh connection via https://github.com/kraih/mojo/wiki/Hypnotoad-prefork-web-server
17:05 Demian I would like to create an object that has methods that call upon a db way down in a legacy lib
17:06 Demian my $obj = $c->app->create_obj( @args )
17:07 pink_mist sub friend { my $self = shift; my ($name) = @_; Cat->new(name => $name); } # no "has" involved
17:07 Demian stuff!
17:07 purl i heard stuff was blooming right now I think
17:07 Demian or dear...  ok!
17:07 Demian thanks!
17:08 pink_mist I'm unsure why it's something you call on the app though; you don't seem to use $self at all
17:08 Demian that is true
17:09 Demian what is the better place to put it?
17:09 Armen I've been away from perl for a while... where does "has" come from? is that part of "moose"?
17:09 pink_mist well, why not just call Cat->new($name) ?
17:09 pink_mist Armen: Mojo::Base
17:09 purl Mojo::Base is really about embracing minimalism and getting the most syntactic sugar out of as little code as possible
17:09 pink_mist Armen: but Moose has a has as well
17:09 pink_mist Armen: as does Moo
17:10 Armen ah, but now I know where to find the relevant documentation. Thanks!
17:11 Demian pink_mist, you are very wise.
17:11 Demian thanks!
17:12 pink_mist (err, Cat->new(name => $name); ... oops)
17:16 Grinnz oh he's gone, i was going to say that helpers are often used for this sort of thing
17:20 PryMar56 joined #mojo
17:26 PopeF joined #mojo
17:34 dantti_laptop joined #mojo
17:47 PopeF0 joined #mojo
17:53 PopeFelix joined #mojo
18:03 miller joined #mojo
18:13 demian joined #mojo
18:15 perlpilot joined #mojo
18:17 demian I think I am close to solving an issue, but I still need some guidance:
18:17 demian i have a model that depends on a legacy lib that connects to a DB with 'use Model'
18:18 demian I pull all calls to the model functions out of the startup script for hypnotoad deployment, following posts related to DBI connections
18:19 demian when I launch with hypnotoad, i will get a "end-of-file on communication channel" error
18:19 demian when i hot deploy again, the error goes away and everything works!
18:20 demian all is well under morbo
18:21 demian any ideas how to fix for the first launch?
18:22 demian the "end-of-file on communication channel" is from Oracle
18:26 preaction does the model connect to dbi when it's loaded?
18:26 demian yes
18:26 preaction then you can't load the module until after startup() is run
18:27 preaction webart: i wrote a module called Beam::Minion which allows defining jobs in a YAML file
18:27 demian I will try wrapping in a require
18:27 demian thanks preaction
18:29 kgoess joined #mojo
18:29 demian It works!!!
18:29 preaction woo!
18:30 stryx` joined #mojo
18:31 cheako joined #mojo
18:32 demian I have the require in a subroutine that will be called a bunch of times.  Is there an after startup callback in mojolicious (or something similar), where I could slip the require in so it's only called once?
18:32 kgoess joined #mojo
18:34 rshadow joined #mojo
18:35 demian that's a require question, I'll keep looking elsewhere.  Thanks Mojo folks!
18:35 preaction demian: the bulk of the require only happens once. perl will not load a module twice
18:36 preaction in fact, require's pre-check is faster than any pre-check you could do yourself. but if you want, you could put some kind of object in a helper and use a `state` variable
18:38 demian thanks again preaction
19:01 dikim joined #mojo
19:17 dikim joined #mojo
19:18 rshadow joined #mojo
19:45 PopeFelix joined #mojo
19:52 stryx` joined #mojo
19:54 SwellJoe joined #mojo
20:02 kgoess joined #mojo
20:17 rshadow joined #mojo
20:21 itaipu joined #mojo
20:29 zivester joined #mojo
20:35 Grinnz added https://github.com/kraih/mojo/wiki/Upgrading#upgrading-to-mojolicious-731
20:36 Grinnz not sure if i got all the suggestions right
20:36 cheako joined #mojo
20:37 jberger rel_file wasn't removed but isn't child preferred generally?
20:38 pink_mist where's rel_file?
20:38 jberger Mojo::Home
20:38 pink_mist oh
20:39 jberger I guess it is probably the idea of portable unix-like paths?
20:39 jberger ie it splits on / before constructing the new Mojo::Home
20:40 jberger anyway, certainly a Grinnz++ is deserved
20:40 Grinnz feel free to edit ;)
20:42 jberger I can't decide if an edit is warrented
20:43 orev I find it odd that functions are removed during minor updates.  minor == semantic versioning
20:43 Grinnz orev: it doesn't follow semantic versioning strictly. the deprecation policy is documented
20:43 orev maybe mojo doesn't use that, but I think it's more or less what most people expect
20:43 orev RTFM is usually a bad response to concerns like this
20:43 Grinnz http://mojolicious.org/perldoc/Mojolicious/Guides/Contributing#Rules
20:44 Grinnz not sure what else could be done, except to make major version releases 4 times a year
20:44 Grinnz which IMO would make things worse
20:45 orev that would at least signal to users that something "bigger" has changed and they need to review their code, instead of getting an update and suddenly have something break
20:46 arcanez seems someone should read the changelog and upgrade notes to see if something may break regardless of version number
20:47 arcanez or be stuck holding the pieces
20:47 jberger well, more than that, with Carton and appropriate test coverage you shouldn't upgrade until you know you can
20:48 Grinnz it's generally recommended to pin versions with Carton with any CPAN module, but Mojolicious in particular
20:48 orev I'm seeing a lot of "shoulds" here.  "should" is one of the deadly sins of IT people
20:48 arcanez apparently jberger types faster than Grinnz
20:48 preaction the tl;dr is that it's how it is and it isn't going to change
20:49 Grinnz ... unless there's good reason to
20:49 orev the overwhelming majority of software issues patches that generally don't change things other than fix bugs, and feature changes (especially things that are removed), are usually reserved for, or at least signaled by, bigger version number changes
20:50 jberger I could put on my snark hat and say that Perl itself doesn't do that
20:50 Grinnz they do try to, though
20:50 jberger but that would involve having a major version number available :-P
20:50 Grinnz oh, that :P
20:50 orev eh, they painted themselves into a corner on that one
20:51 jberger no .... one person painted us into that corner
20:51 jberger an important person no doubt
20:51 orev larry ?
20:51 purl larry is the lead language designer or and: He *thinks*, then speaks, then *thinks*,... It's a VICIOUS CYCLE!
20:51 jberger ding
20:51 Grinnz "or and"? purl you make no sense
20:51 arcanez purl: literal larry?
20:51 purl arcanez: larry =is= the lead language designer or and: He *thinks*, then speaks, then *thinks*,... It's a VICIOUS CYCLE!
20:52 arcanez looks like the factoid is wrong, not purl
20:52 Grinnz purl is just too accepting
20:53 nicomen the problem with pinning is that all the security holes stay in there forever, some multi-version semver-based approach is in place imho.
20:53 Grinnz pinning is not meant to be "forever", but instead "until there's a chance to fix breakages"
20:54 jberger nicomen: that assumes that you never test/change your pinning
20:54 jberger I'm a fan of leaving the qa environment unpinned
20:54 nicomen true, but just using that as the default approach is not the optimal way either
20:55 nicomen yeah, pinning at release, let dev installs flow, makes sense-ish, unless you need to reproduce production stuff
20:55 jberger then you use the cpanfile.snapshot from prod
20:55 Grinnz that's why we keep a branch of the current production environment around
20:56 Grinnz quite helpful, unless it's a database difference
20:56 nicomen sure, just fire a docker up, shouldn't be a problem, but I've seen carton repos stay freezed for years
20:56 Grinnz (don't ask about our database setup)
20:56 nicomen actually local::lib, but same problem
20:56 nicomen no matter how much the sysadmins updated system perl, the abanonded^Wstably working web apps were vulnearable
20:57 Grinnz if no-one was going to update the code anyway, better that the modules aren't updated
20:57 jberger nicomen: ok but hypothetically, would a company that doesn't unpin their repos for years really be safer letting their dependencies float, unmonitored
20:57 jberger ?
20:57 nicomen except if you had a scheme where security updates could flow in freely
20:57 Grinnz CPAN doesn't particularly support that model unfortunately
20:57 nicomen jberger: no, that's part of my point
20:58 jberger then I don't get your point
20:58 nicomen so for people that don't know that much, it would be safer to say, use what your dist provides you with, and don't go above it, at least you will be covered security-wise, but yeah that's awfully boring and rigid
20:59 Grinnz right, that's up to the package manager to triage "security updates" vs "breaking changes" according to the distro's policies
20:59 nicomen just sandbox the thing, and whatever ;)
20:59 Grinnz CPAN doesn't have anyone in such a position, and the majority of dists don't make that distinction
21:00 jberger I'm very against trusting a distro packager to handle that personally
21:00 arcanez :)
21:00 jberger they do a good job
21:00 jberger but it is YOUR application
21:00 Grinnz for CPAN yeah. for other things in RHEL perhaps
21:00 jberger sure
21:01 jberger but you also don't just run dist-upgrade in prod every day either do you?
21:01 Grinnz one of our sysadmins tried that
21:01 marty joined #mojo
21:02 marty joined #mojo
21:03 jberger I think the Perl tenants of the default version dependency meaning "this and all later version" and the nature that mostly perl modules don't ever make breaking changes has lead to complacency in perl deployments
21:03 jberger if your core-business application is at stake, don't trust blind upgrades; its as simple as that to me
21:04 Grinnz it is quite a bit more common for a module to re-namespace itself than to make breaking changes
21:04 Grinnz major version or otherwise
21:05 Grinnz (except for security stuff)
21:05 jberger One of these days I'll make a project that defines sub VERSION to require a specified version
21:05 Grinnz ick. don't mess with UNIVERSAL
21:05 jberger that doesn't mess with UNIVERSAL
21:06 Grinnz instead do ->VERSION('==v1.2.3') (not sure if that actually works currently)
21:06 jberger just overrides it in your class
21:06 Grinnz right i mean don't mess with what it's expected to do
21:06 jberger but its that expectation that I think is wrong
21:06 Grinnz wrong or not, it would break anythign that checks versions
21:06 jberger and leads to this problem in the first place
21:09 Grinnz an equality version check specifically would be Package->VERSION == version->parse('foo'), probably with a version->parse around the first part for 5.8 compatibility
21:10 Grinnz not sure if VERSION was using version.pm then
21:11 jberger it still boggles my mind that p5p doesn't own version.pm
21:11 Grinnz mm
21:14 Grinnz ah. the return value of ->VERSION with no argument is stringified regardless of perl version, so yes wrap it in version->parse
21:15 Grinnz ->VERSION works back to at least perl 5.5 according to perlbot :P
21:19 preaction "It's for your own good" is rarely going to go over well with anybody
21:41 kiwiroy joined #mojo
22:42 maschine joined #mojo
23:07 marty joined #mojo

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