Page 1 of 3 | Next »
[23:15:41] pizzaops: Hi there. I'm experiencing some strange behavior with hash defaults and I'm wondering if somebody can help me understand this: https://gist.github.com/pizzaops/5502cd81c661d698bc15668234e1a7d4
[01:24:03] pizzaops: Is there a straightforward way to do a regex match against a string, and save everything *after* the match to a variable. For example...
[01:24:35] pizzaops: Given a regex of `\/CN=` and a string of `/OU=Domain Control Validated/CN=*.google.com`, save `*.google.com*` to a variable.
[20:20:17] pizzaops: So I've read the docs here — https://bundler.io/v1.11/man/bundle-install.1.html — and maybe I'm missing something, but is there no way to run `bundle install` from outside a project's directory?
[20:20:52] pizzaops: E.g. with git I can do things like `git --git-dir=/path/to/project/.git --work-dir=/path/to/project checkout master`
[20:23:11] pizzaops: RickHull: agreed, but hopefully it does it in the proper directory. I'll just make a Gemfile and test it real quick.
[20:34:54] pizzaops: RickHull: thanks again, can confirm that it creates the `Gemfile.lock` in the appropriate place automatically.
[20:52:16] pizzaops: I don't know how I've never run into this before, but I can't seem to find good info - is there a way to pass arguments in a Gemfile for use by bundler? E.g. if I normally need to do `gem install libv8 -v 'XX.XX.XX' -- --with-system-v8`, is there a way to actually specify the `-- --with-system-v8` in the Gemfile?
[20:54:19] pizzaops: Answered my own question: https://bundler.io/v1.15/man/bundle-config.1.html#BUILD-OPTIONS
[04:58:50] pizzaops: You can't just refer to instance variables by name without an @. The reason you see that so often is because people have created "reader" methods
[05:02:47] pizzaops: And personally I like to always use self.number not just number, because it's too vague.
[05:03:33] pizzaops: I'd prefer to have to explicitly change those, because I want it to be clear what's happening.
[19:30:47] pizzaops: I often do things like this when I want to set a default value for an instance variable (or just something inside a method in general) but still allow it to be overridable: https://gist.github.com/pizzaops/2f91371ff7a00edee6a09fbdc3035c0d
[19:38:03] pizzaops: There was some point where normal defaults weren't good enough but I don't remember why anymore, and I think I just kept doing this weird pattern even when not necessary
[23:10:31] pizzaops: This really feels like it should be a "map" to me not an "each", but map obviously returns an array not a hash, so yeah...any thoughts? https://gist.github.com/pizzaops/1f44b4e37bc2c57272c227102d83f851
[23:10:55] pizzaops: I mean it's basically fine as is, I'm just curious if there's a better way than yet another `.each`
[23:12:37] pizzaops: Papierkorb: so calling .to_hash on an array of arrays where each item is an array of length 2 converts it to a hash?
[23:15:22] pizzaops: Papierkorb: does this seem reasonable? https://gist.github.com/pizzaops/1f44b4e37bc2c57272c227102d83f851 — I need the ||= because calls on these objects can potentially trigger network traffic, so I don't want to create the hash again if I've already created it.
[23:17:18] pizzaops: So @networks will always return either way? (with that last line @networks/networks removed
[19:03:20] pizzaops: I'm trying to use the request pty error and it just fails (but I have no problem getting a pty via stadnard ssh)
[19:03:26] pizzaops: Exception `Net::SSH::ChannelRequestFailed' at /opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/net-ssh-3.1.0/lib/net/ssh/connection/channel.rb:566 - Net::SSH::ChannelRequestFailed
[03:34:31] pizzaops: Even if you're not using ruby-build (rbenv), that should cover the dependencies for compiling most gems on most platforms.
[03:36:25] pizzaops: But probably listen to Ox0dea since I don't know anything at all about Brightbox.
[23:42:21] pizzaops: Silly question maybe - RubyMine, when linting my code, is telling me that using Class variables (@@) is bad style. I'm not really clear on why though. I have things I need to store, and use several times throughout the class, that never change in a instance of the class. I just need them in variables so that I don't have to manually write that code over and
[23:45:05] pizzaops: Hmm. Sure, I could use a constant. But I don't entirely get what's *wrong* with class variables, still.
[23:50:52] pizzaops: Ox0dea: the behavior in your example makes perfect sense to me...isn't one of the main points of inheritance that you can also override parts the parent?
[04:34:48] pizzaops: Is there a way of doing this: @hardware = hardware.is_a? Wilhelm::Vms::Machine::Hardware ? hardware : raise Exception.new('hardware must be an instance of Wilhelm::Vms::Machine::Hardware')
[04:35:11] pizzaops: Basically I want to raise an exception if the "hardware" value isn't an instnace of that class, but i have like 7 more params to do that for so I dont want like 7 if/elses
[23:48:43] pizzaops: http://vignette3.wikia.nocookie.net/simpsons/images/5/5e/Dr._Riviera.png/revision/latest?cb=20120509073411
[23:49:56] pizzaops: I literally was thinking "this person is about to ask 'which is better, php or ruby?' "
[23:51:03] pizzaops: Well, my point is, it's more important to learn to program than to learn specifically Ruby (or PHP)
[23:51:26] pizzaops: probably go with Ruby over PHP, but either way, learn something and do something with it
[23:53:35] pizzaops: Learn some Ruby and learn some Sinatra and you should be able to do some fun stuff.
[22:52:43] pizzaops: I'm getting `stack level too deep` here when I call .new on it and I'm not quite sure why. It goes away if I remove the line about @hierarchy from the initialize method. https://gist.github.com/pizzaops/582144773875e4078b25
[22:53:03] pizzaops: This usually happens when I've accidentally done something endlessly looping/recursive but I don't see how I've done that here.
[22:54:59] pizzaops: Ox0dea: ohhhhh. I was trying to call an entirely diffefernt class named hiera haha
[22:56:14] pizzaops: Ox0dea: man rubymine is awesome. when i rename the file it autosearched all my other files for references to it
[22:56:35] pizzaops: I'm still a vim-user at heart but a lot of the rubymine stuff has been a big help in developing this larger app
[22:57:48] pizzaops: Ox0dea: yeah, I consider doing something that will only work if I ::fully scope it to be a last resort
[23:00:56] pizzaops: Yeah if you're trying to do some sort of super high performance thing that requires real-time ruby is probably not the right tool
[23:06:44] pizzaops: baweaver: based on earlier questions he might mean "what its capabilities are" not "how I can learn", but maybe dsadajsd you could clarify
[23:07:56] pizzaops: If you know how to program already in general, CodeCademy is a good way to learn Ruby syntax. If you don't know how to program in general, I think it leaves out too much context, and I'd encourage you to consider paying the $25 for teamtreehouse
[23:09:00] pizzaops: I only use shoes if i need to like, throw up a quick gui client for some internal tool or something
[23:09:38] pizzaops: I would argue that Qt has the better cross-platform story (although GTK for Win/Mac is certainly a thing)
[23:25:09] pizzaops: i guess i dont have to ship patches for rails either, but i do have to maintain an app that relies on it
[23:25:37] pizzaops: And when it comes to the "computer" I use to host an app, I actually do have a fairly deep relative knowledge of Linux internals, compared to say, OSX internals.
[00:43:37] pizzaops: shevy: it seems like there are a lot of blog posts/explanations/etc from just googling `ruby fibers`
[00:52:02] pizzaops: ACTION imagines that IRC had emoji and imagines that :trollface: rendered into the appropriate image and directs the imaginary trollface image at Radar
[09:27:28] pizzaops: dn5: yeah it returns nil but the original variable is untouched so you can still just return day like you're doing now
[09:31:56] pizzaops: raldu: that doesn't explain why they failed to compile though, only while they were being reinstalled.
[19:26:27] pizzaops: Why doesn't this return something wrapped in double-braces? https://gist.github.com/
[19:26:49] pizzaops: Since I'm wrapping the intiial memo in , and that happens with each "iteration" shouldn't i end up with wierdness
[19:29:40] pizzaops: baweaver: I know I'm doing that, but if I'm wrapping each memo in  for each iteration shouldnt i end up with arrays inside arrays
[19:36:00] pizzaops: Yeah, but on the second iteration I would expect it to be [[firstmemo]] + [nexthash]
[22:55:03] pizzaops: Wilhelm::Project::List for organization/namespacing purposes. Is there some way to do that?
[22:55:03] pizzaops: So when I require this code from somwhere — https://gist.github.com/pizzaops/f1c5eb2728e5124c2716 — e.g. require 'wilhelm/project/list', prior to trying to create an instance of the class inside, the error "Project is not a module" is returned. And that's true. There's a Wilhelm::Project class. But I still want to refer to this class here as