Activity Graph

Page 1 of 10 | Next »


[16:32:34] bougyman: hrm. I forgot something and google isn't helping me remember.
[16:35:51] bougyman:
[16:37:41] bougyman: google points me here, which are just variations of what I'd already done:
[16:41:44] bougyman: phaul: I know it is.
[16:42:32] bougyman: I don't think I ever mentioned inheritance. I know the difference.
[16:42:36] bougyman: This is just namespace nesting.
[16:42:51] bougyman: and I want to know the parent namespace of a class inside that module
[16:43:41] bougyman: module Outer; module Inner; module SuperInner; class Foo; def my_parent; ...; end; end; end; end; end
[16:43:52] bougyman: I want foo's my_parent to return Outer::Inner::SuperInner
[16:44:07] bougyman: I mean, that's what it does, currently.
[17:42:49] bougyman: phaul: the parent of a child class is looking for its own namespace.
[17:42:57] bougyman: But this method is defined in its parent class.
[17:43:05] bougyman: which has a different namespace.
[17:45:23] bougyman: Module.nesting seems to always choose the parent class's namespace.


[19:04:36] bougyman: Ping timeout: 240 seconds
[19:06:06] bougyman: has joined #ruby


[23:46:35] bougyman: *.net *.split


[02:44:28] bougyman: Ping timeout: 264 seconds
[02:46:12] bougyman: has joined #ruby


[04:13:37] bougyman: and 418 is "I'm a teapot"
[04:13:54] bougyman: lemur: I have :)


[22:02:27] bougyman: ddffg: I'd use a work queue for that.
[22:02:39] bougyman: so all rails does is put them on that work queue (beanstalk is nice for this)
[22:02:47] bougyman: then as many workers you want can work that queue to send the mail


[14:39:37] bougyman: i was about to mention each_with_object
[14:39:38] bougyman: [1,2,3].each_with_object([]) { |n, sum| sum.push(n) if n.odd? }
[14:40:03] bougyman: but yeah, select is better
[14:41:30] bougyman: haha, it's true.
[14:43:37] bougyman: just cause it can doesn't mean it should, though
[14:43:38] bougyman: [1,2,3].inject(0) { |sum, n| n.odd? ? sum += n : sum }


[14:40:56] bougyman: That's not an interesting problem.
[14:46:20] bougyman: are you looking for all files?
[14:47:34] bougyman: Nobun: Dir.glob('**/*').select { |f| File.file? f }
[14:47:36] bougyman: try that instead.
[14:47:40] bougyman: see if it's what you want.
[14:48:27] bougyman: and then just use the select block for your comparison.
[14:48:45] bougyman: f =~ /#{xext_in}$/ instead of File.file? f
[14:49:37] bougyman: Or even just Dir.glob("**/*.#{xext_in}") probably



[06:20:13] bougyman: Just gotta choose plugins that fit you.
[06:20:23] bougyman: Personally I like ctrlspace.


[16:00:58] bougyman: if it's bound to it would be serving all ips.
[16:01:11] bougyman: You don't have a reverse proxy in front of it?


[11:41:10] bougyman: I use a module instance variable for it.
[11:42:26] bougyman: module MyApp; def self.log; @log ||= default_log; end; def self.log=(other); @log = other; end; end
[11:42:31] bougyman: but it doesn't complain if you change it
[11:43:23] bougyman: yeah, that's the most common pattern I see
[11:44:47] bougyman: module method
[11:45:37] bougyman: it's considered good style to use .
[11:45:47] bougyman: and weird to use :: for anything other than nesting namespaces.
[11:45:52] bougyman: or accessing ... yeah
[11:46:09] bougyman: :: _works_, but it's ruby idiom to use . for calling methods, not ::


[17:22:13] bougyman: AR is an orm
[17:22:17] bougyman: arel is the dsl for sql, no?


[15:59:50] bougyman: Tohm3: sounds like you jumped to chapter 14 without going through chapter 1
[15:59:51] bougyman: nor any of the ones between 1 and 14


[22:11:26] bougyman:
[22:11:29] bougyman: have you signed it yet?


[17:08:20] bougyman: what's the version number?
[17:08:25] bougyman: I mean, what's an example?


[21:36:04] bougyman: leitz: make a ~/.inputrc and set the vi editing mode in that.
[21:36:13] bougyman: which will work for any readline based applications
[21:53:37] bougyman: works here.
[21:53:41] bougyman: is your ruby built without readline?


[03:25:48] bougyman: there has to be a better way to do this.
[03:26:06] bougyman: without #inject-ing a hash to store the path iterator
[03:26:09] bougyman: [25] pry(main)> path.to_s.split('/').inject({files: [], path: []}) { |a, e| defa =[:path].join('/')).join("#{e}/default"); (a[:files] << defa) if defa.exist? ; a[:path] << e; a }[:files]
[03:26:09] bougyman: => #<Pathname:foo/bar/baz>
[03:26:09] bougyman: [24] pry(main)> path
[03:26:20] bougyman: => [#<Pathname:foo/default>, #<Pathname:foo/bar/default>, #<Pathname:foo/bar/baz/default>]
[03:26:24] bougyman: works, but I hate it.
[03:32:34] bougyman: { |e| d = e.join('default'); d.exist? ? d : nil }.compact
[03:32:36] bougyman: much better
[04:43:28] bougyman: Radar: thanks, got to that.
[04:43:35] bougyman: I knew inject was just all wrong
[04:47:19] bougyman: no it doesn't
[04:47:34] bougyman: need to .reverse, then
[04:57:22] bougyman: no, it's right
[04:57:24] bougyman: I want descend


[13:57:08] bougyman: Ping timeout: 255 seconds
[13:59:37] bougyman: has joined #ruby


[16:05:05] bougyman: benzrf: example?


[14:39:38] bougyman: I don't understand the question.
[14:39:53] bougyman: you have a string "foo" as a variable?
[14:40:11] bougyman: If so, you could do { foovar.to_sym => 'bar' }


[00:07:16] bougyman: *.net *.split
[00:15:33] bougyman: has joined #ruby


[05:31:10] bougyman: Ping timeout: 276 seconds
[05:35:36] bougyman: has joined #ruby


[05:16:31] bougyman: *.net *.split
[05:35:19] bougyman: has joined #ruby


[00:34:20] bougyman: same ruby version?



[21:20:15] bougyman: dminuoso: nil


[03:44:47] bougyman: *.net *.split
[07:47:37] bougyman: has joined #ruby


[02:47:15] bougyman: *.net *.split
[02:48:08] bougyman: has joined #ruby



[05:15:43] bougyman: *.net *.split
[05:15:55] bougyman: has joined #ruby


[12:25:54] bougyman: *.net *.split
[12:27:26] bougyman: has joined #ruby
[15:01:25] bougyman: *.net *.split
[15:03:10] bougyman: has joined #ruby


[16:01:14] bougyman: modules are used for that.
[16:01:31] bougyman: well, closest thing to prototyping a method that ruby has.


[02:48:41] bougyman: Ping timeout: 256 seconds
[02:55:51] bougyman: has joined #ruby


[19:17:50] bougyman: I get it. That's why I don't use it.


[18:56:51] bougyman: that's really a matter of opinion.
[18:56:58] bougyman: I would recommend: none.
[18:57:16] bougyman: #anythingbutrails is my hashtag
[18:58:19] bougyman: simple solutions for simple problems.
[18:58:25] bougyman: Not everything has to be a kitchen sink
[19:12:08] bougyman: type1team: if you're looking for an easy way to accomplish SEO, you're searching for a unicorn.


[01:55:16] bougyman: *.net *.split
[01:55:30] bougyman: has joined #ruby


[16:16:33] bougyman: Ping timeout: 248 seconds
[16:19:50] bougyman: has joined #ruby


[23:06:58] bougyman: Ping timeout: 264 seconds
[23:46:39] bougyman: has joined #ruby


[14:48:18] bougyman: *.net *.split
[14:54:22] bougyman: has joined #ruby
[21:43:05] bougyman: *.net *.split
[21:48:19] bougyman: has joined #ruby
[22:37:00] bougyman: *.net *.split
[22:42:09] bougyman: has joined #ruby


[14:58:30] bougyman: I prefer Pathname for these things, Bish
[14:58:35] bougyman: >> Pathname('/sys/class/net').children.detect { |w| 'wireless' }
[14:58:38] bougyman: => #<Pathname:/sys/class/net/wlo1>


[01:04:05] bougyman: the is used all over our code when the hash is comprised of counters.
[01:13:16] bougyman: RickHull: how could you get burned by it for counters?
[01:14:03] bougyman: ah, understood.
[01:14:06] bougyman: Yes, only ints.
[01:14:14] bougyman: But for ints I do think it fits the use case perfectly.


[17:42:14] bougyman: % perl -e 'print -1>>8;'
[17:42:15] bougyman: 72057594037927935%
[17:42:20] bougyman: ruby -e 'puts -1>>8'


[01:49:20] bougyman: and then some don't.
[01:49:24] bougyman: like Sequel.


[23:10:06] bougyman: RickHull: rubocop hates that.


[02:14:45] bougyman: @foo = bar is pretty obvious
[02:14:51] bougyman: even if you aren't familiar with ruby


[19:40:25] bougyman: validations of what?
[19:41:24] bougyman: There are a few ways i've seen.
[19:41:35] bougyman: Contracts, Design By Contract, is one I liked.
[19:41:55] bougyman: But validating input still happens before being handed off to the contracted method.


[13:37:42] bougyman: { } that much faster



[04:44:33] bougyman: these are complex questions which require a lot more information about your architecture and app.
[04:45:01] bougyman: perhaps better asked in #rubyonrails, too


[23:40:06] bougyman: backticks shell out
[23:40:30] bougyman: %x{ls} and `ls` essentially are the same.
[23:41:26] bougyman: part of the language


[15:12:12] bougyman: anyone know why curl would work on a box but ruby (rest-client) gives SSL Verify Fail?
[15:12:24] bougyman: I didn't think I had to recompile ruby to get new certs.
[16:31:19] bougyman: RedNifre: I had to rebuild ruby
[16:31:20] bougyman: doesn't make a lot of sense, but whatev
[16:38:49] bougyman: that's my thought.
[16:38:58] bougyman: but I figured I would get an error other than invalid cert, for that.
[16:39:00] bougyman: no worries.
[16:39:03] bougyman: fixed is fixed.


[20:15:08] bougyman: Ping timeout: 240 seconds
[20:16:04] bougyman: has joined #ruby


[14:42:17] bougyman: which bundle
[14:42:20] bougyman: and which ruby
[14:42:26] bougyman: i mean: type those
[14:42:29] bougyman: `whicn bundle`
[14:42:38] bougyman: and `which ruby`
[14:44:24] bougyman: GreatPotato: it is.
[14:44:40] bougyman: gem i bundler
[14:44:51] bougyman: it will put a bundler in your rvm path which supercedes /usr/bin/bundle


[15:31:16] bougyman: not necessarily, FrostCandy
[15:31:21] bougyman: what does the tree look like?
[15:31:25] bougyman: what kind of program is it?
[15:31:41] bougyman: rails or other?
[15:32:01] bougyman: routes.rb is where i'd look to see what methods are exposed to the public.
[15:32:12] bougyman: though that can be abstracted so much as to not be helpful sometimes.
[15:32:20] bougyman: app/models should contain the business logic.
[15:33:00] bougyman: and app/controllers are where routes are dispatched to. methods in the controllers/ classes are, that is.


[01:34:40] bougyman: Quit: ZNC 1.6.4 -
[01:34:54] bougyman: has joined #ruby
[05:13:54] bougyman: this is really not a job for regex.
[05:14:07] bougyman: you can do some crazy backtracking.
[05:14:11] bougyman: warrshrike: a parser.
[05:14:55] bougyman: warrshrike: you can just hack around that.
[05:15:04] bougyman: count the brackets in the string before you do your thing.
[05:15:18] bougyman: use the regex if the thing doesn't hit your edge cases.
[05:15:22] bougyman: if it does, do something else.
[05:17:32] bougyman: whatever it takes.
[05:17:37] bougyman: some recursion could pull it off.
[05:19:32] bougyman: I meant a recursive method, not regex recursion.
[05:19:47] bougyman: I mean, that method would likely use some regex or other string matching shit.
[05:20:06] bougyman: I'm trying not to program this for you and just get you thinking.
[05:20:46] bougyman: not as helpful as you figuring it out yourself.
[05:20:51] bougyman: that's how you become guru.
[05:21:32] bougyman: there's no anchor you could use?
[05:21:41] bougyman: That's kinda the rule with when you use regex or not.
[05:21:52] bougyman: If you can't anchor it, probably not the right tool.
[05:22:01] bougyman: ^ and $ are anchors, but there are many others.
[05:22:09] bougyman: \b, for instance
[05:22:14] bougyman: but that's not applicable here.
[05:22:26] bougyman: if the last ] were always followed by a \n, you could use $
[05:23:27] bougyman: don't [ inside the ^[ ]$ fuck you up just as much?
[05:24:03] bougyman: I guess only if they come after a ] in it.
[05:24:08] bougyman: still, it's a mess.
[05:24:21] bougyman: you can't contain on [ and ] if [ stuff ] stuff can contain [ and ]
[05:25:19] bougyman: wait, there's always quotes in the thing?
[05:25:22] bougyman: If so, that's your anchor.
[05:25:48] bougyman: [" starts it, and "] ends it.
[05:25:55] bougyman: well you put quotes there :)
[05:27:18] bougyman: the comma could be used, I think that's why 08/15-22:03 <....... elomatreb> warrsrike: Can commas appear in the brackets/fields?
[05:27:21] bougyman: he asked that.
[05:27:31] bougyman: if there can be commas in there, too, that fucks you up, a bit
[05:27:39] bougyman: cause you can't guarantee ], won't be in the input
[05:27:51] bougyman: 1st rule of regex: Know your data.


[02:31:09] bougyman: rvm doesn't work under #/bin/sh
[02:31:15] bougyman: took me like 10 minutes to figure that out.


[23:51:32] bougyman: *.net *.split
[23:52:23] bougyman: has joined #ruby


[03:22:39] bougyman: [6] pry(main)> a = TRUE && a = FALSE
[03:23:02] bougyman: dunno what ruby version is giving you that.
[03:23:09] bougyman: I didn't, either.
[03:23:12] bougyman: never seen that.
[03:23:17] bougyman: I've seen TrueClass and FalseClass
[03:23:22] bougyman: but not TRUE and FALSE
[03:24:19] bougyman: [7] pry(main)> RUBY_VERSION
[03:24:22] bougyman: => "2.2.3" here