« Back to channel list

#ruby - 31 July 2016

« Back 1 day Forward 1 day »
[00:02:09] soLucien: you shouldn't
[00:02:36] havenwood: Guest59843: You should learn Ruby! You'll use it to write code.
[00:02:40] T2ya: hello. I've been attempting to learn ruby for the few days (about 4). I found i attempted a quiz which involves looping. I managed to solve but was interested in adding another twist to it. here's the loop i'm reffering to https://repl.it/Chij/2 . What i've been trying to do now is replace each number that begins with say "1" into a word. can someone point me in the correct direction. i am stumped.
[00:03:19] soLucien: unless you are specificlally going into DevOps, i see no reason why you should look at Ruby
[00:03:32] karapetyan: has joined #ruby
[00:03:41] Papierkorb: Guest59843: Please don't listen to soLucien
[00:04:16] Leates: has joined #ruby
[00:04:21] Guest59843: i know it sounded like a troll question but im not trolling the thing is im trying to convince my friend to learn it but he keeps saying when will i use it since he knows java js and php
[00:04:26] havenwood: soLucien: That's myopic. You should learn Ruby!
[00:05:53] soLucien: a period defined by frustrations, horrible tooling, bad (or inexistent) documentation and incompatibility, i suggest you look up something else
[00:06:06] soLucien: this is 2016 ..
[00:06:50] T2ya: It's "current year" do this
[00:07:10] Papierkorb: T2ya: First, quick feedback on your code if you don't mind. 1) If the learning material of yours didn't mention it, the algorithm you implemented is called "Fizz Buzz" 2) A while loop with a counter variable, counted manually, may seem simple enough at first, especially if you're coming from other languages. But instead, check out the #times method, which you can call on integers
[00:07:21] havenwood: soLucien: Again, you should probably learn the language before trying to discourage others from doing so.
[00:07:35] soLucien: heavenwood you are right
[00:07:56] Papierkorb: T2ya: Or the #upto method. I guess you're new, so here you go for the docs http://ruby-doc.org/core-2.3.0/Integer.html#method-i-times
[00:07:59] soLucien: BUT the issue is the tooling and documentation is stopping me from learning the language
[00:08:27] soLucien: plus i'm a Windows user.
[00:08:35] soLucien: so that's probably why
[00:08:49] soLucien: but there is no debugger support in win
[00:09:16] soLucien: no shell session management
[00:09:21] Papierkorb: T2ya: Next on, to your question. You want to replace the '1' digit with a "one", correct? E.g., 14 becomes 'one 4'? You can check if the number begins with a '1' by transforming it into a string first, and then checking if the first character is a '1'.
[00:10:48] soLucien: i would expect that a useful programming language supports both linux and windows environments
[00:11:06] Papierkorb: soLucien: Ruby does support windows and why on earth would anyone like to dev on windows
[00:11:10] Guest59843: is soLucien trolling?
[00:11:25] havenwood: soLucien: Ruby supports the Windows environment. You're mistaken that there's no RVM-like tooling on Windows.
[00:11:45] soLucien: i've asked in this channel multiple times
[00:11:49] Papierkorb: Guest59843: Well, he's spouting sh.. instead of using the time spent on it in a useful manner, like learning ruby or doing whatever
[00:11:57] havenwood: soLucien: https://bitbucket.org/jonforums/uru
[00:11:58] soLucien: "you better try docker out" was what i got
[00:12:21] Guest59843: redhat devops ruby would be aamzing for
[00:12:25] T2ya: In my mind i was thinking of changing the whole number like "14" to a word. like what was done with the multiples 3 and 5. but i think i'll learn what you said first. baby steps.
[00:12:37] T2ya: i am indeed brand new to this. 0 background before a couple days ago.
[00:12:45] havenwood: soLucien: Use the Chocolatey package or the RubyInstaller. But yeah, folk will generally question why you're developing on Windows.
[00:12:52] Papierkorb: T2ya: Okay, good progress thus far then. Everyone starts small :)
[00:13:24] soLucien: i dev on windows because i dev on windows. my clients use windows, i use hyperv, i write a vagrant hyperV plugins and puppet modules that target both Win and Linux
[00:13:28] havenwood: soLucien: JRuby is also a very nice experience on Windows.
[00:13:53] soLucien: i have used the chocolatey package havenwood
[00:14:21] Papierkorb: T2ya: I could tell you how to do it, but I'm not sure if that'd really help you at this point. Don't want to cause too much confusion. What learning material are you using?
[00:14:25] SilverKey: has joined #ruby
[00:14:25] pawnbox: has joined #ruby
[00:15:05] soLucien: i'm not a newbie .. i've done C#/python/js/powershell/bash/php/ruby
[00:15:23] havenwood: soLucien: So you installed Ruby. Good! I'd suggest learning to use the Pry gem. Here's a talk about REPL-driven development with Ruby: https://www.youtube.com/watch?v=D9j_Mf91M0I
[00:15:37] soLucien: but i can honestly say ruby will be the hardest to find documentation on
[00:15:40] soLucien: yes i use Pry
[00:15:50] T2ya: you are correct. I would also personally be guided than just given the answer. Currently i have been using codeacademy.
[00:15:56] havenwood: soLucien: So in Pry, look at the documentation. Or look at the code. It's lovely.
[00:16:05] soLucien: i have, i use pry
[00:16:11] T2ya: i was linked to a list of quizzes by a friend. which is how i ended up created the loop
[00:16:12] Synthead: has joined #ruby
[00:16:34] T2ya: i'm going to attempt to replicate what i created with the while loop using what you linked, before attempting what i had in mind
[00:17:22] soLucien: havenwood this uru looks good , but it is impossible to find
[00:17:26] Papierkorb: T2ya: I'd suggest doing what you had in mind first
[00:17:58] Papierkorb: T2ya: Looking at codecademy (Don't have an account), you're in UNIT 3 right now?
[00:18:01] soLucien: also, what's funny is that it's written in Go
[00:18:30] soLucien: Why wouldn't your friend learn Go instead ? it natively compiles to any platform
[00:18:40] dpkezio: has joined #ruby
[00:18:50] eam: soLucien: well, not any platform
[00:19:01] T2ya: I made up to five so far before stopping and trying to look for resources to practice what theyve taught me.
[00:19:10] soLucien: i am not trolling there are definitely great stuff to do in Ruby
[00:19:16] soLucien: Puppet/Chef/Vagrant
[00:19:20] soLucien: i am sure others as well
[00:19:36] ellisTAA: has joined #ruby
[00:19:42] havenwood: dpkezio: hi
[00:19:43] soLucien: but if you are starting up, why not start with something that's faster, has better tooling
[00:20:24] eam: soLucien: seems like an argument for using rust or C, doesn't it?
[00:20:37] eam: or maybe java
[00:20:51] havenwood: soLucien: Ruby is fast enough and has nice tooling. If you prefer Java or Go then use Java or Go.
[00:20:54] montagne_goat: has joined #ruby
[00:20:55] soLucien: idk about Rust
[00:20:59] soLucien: but C is a pain to write
[00:21:08] soLucien: you are not productive with it
[00:21:13] eam: soLucien: I think you've found your answer there -- ruby is a lot easier to write than go
[00:21:26] Papierkorb: T2ya: Great. Will have to leave now, but let me Welcome you to programming in general. You're of course also welcome to ask any questions here, though sometimes it might take a while until someone responds :)
[00:21:28] soLucien: no it's not , their synthax is similar
[00:21:29] eam: developer productivity is often at odds with runtime efficiency
[00:21:34] havenwood: soLucien: yes, yes it is
[00:21:50] eam: soLucien: I assure you they're quite different. You should write more ruby and more go and develop a more well formed opinion
[00:21:55] zacts: has joined #ruby
[00:22:32] soLucien: ruby is NOT faster to develop .. especially for starters .. Productivity for newcomers comes from auto-correction/synthax checking/ type suggestion/intellisense
[00:22:44] T2ya: Papierkorb : Thanks! and thank you for the input thus far. I'm sure i'll plenty more question.
[00:22:49] havenwood: dpkezio: irb(main):001:0>
[00:22:58] soLucien: that's what makes a language productive
[00:23:10] Papierkorb: soLucien: Please don't recommend that a newcomer uses auto completion right away. They don't learn anything, they only learn how the editor works
[00:24:12] Rubie: has joined #ruby
[00:24:23] marsjaninzmarsa: has joined #ruby
[00:24:31] havenwood: soLucien: It's odd you keep talking about tooling when the Ruby tooling is often copied by other languages and has lead the way on multiple fronts.
[00:24:44] nankyokusei: has joined #ruby
[00:25:24] Guest59843: does soLucien even know any languages
[00:25:30] Guest59843: i think hes just talking crap
[00:25:46] rawillia: has joined #ruby
[00:25:56] eam: not very well, if he thinks go is among the environments with the most well developed tooling
[00:26:11] soLucien: i have not tried Go
[00:26:24] Guest59843: i dont think he knows any language
[00:26:24] soLucien: i just find it funny that uru is written in Go
[00:27:02] soLucien: i don't think you have any arguments to support that. just your feeling
[00:27:27] soLucien: i have an opinion, i braught up a few arguments.
[00:27:37] soLucien: of course this is a Ruby channel and people will be opinionated
[00:27:58] eam: I'm just disappointed you're not acknowledging java
[00:28:11] soLucien: i started up with Java dude
[00:28:15] soLucien: it's too verbose for my taste
[00:28:19] Guest59843: write a calculator app in c# write the code to prove u know c# like u said
[00:28:22] eam: yeah but the tooling
[00:28:33] soLucien: that's what i had in CS 101
[00:28:33] havenwood: Think of the tooling!
[00:28:41] eam: if you don't like verbosity, ruby is a lot less verbose than either go or java
[00:28:46] soLucien: Java has good debug support
[00:28:50] soLucien: and great performance
[00:28:52] Guest59843: LOL hes taken a college class and now thinks hes pro at coding
[00:28:54] eam: but if you like tooling, boy, is java your answer
[00:29:02] havenwood: soLucien: Try JRuby, it's lovely.
[00:29:04] soLucien: plus you can write your own parser in antlr if you want
[00:29:32] soLucien: if you're into DSLs
[00:29:55] soLucien: Guest i'm starting my master's degree in september.
[00:30:06] soLucien: and been programming professionally for 3 years
[00:30:20] Guest59843: what college?
[00:30:28] soLucien: Copenhagen University :)
[00:31:19] eam: that's disappointing, I would've thought an undergrad would be more readily able to absorb the purpose of various languages
[00:31:33] soLucien: eam unbelievable
[00:31:41] eam: I'll have to adjust my new grad expectations yet again
[00:31:56] soLucien: dude i use Ruby for puppet modules and i am writing a Vagrant plugin at the moment
[00:32:04] Guest59843: ppl in undergrand and grad dont really know any programming tbh
[00:32:20] soLucien: you are so far up your own asshole
[00:32:23] Guest59843: they dont really learn the languages but theory and algorithms
[00:32:23] soLucien: it's unbelievable
[00:32:47] soLucien: i am trying to , i really am
[00:32:47] Guest59843: my friend a grad in cs knows little bit of java and thats about it and cant get any jobs
[00:32:59] eam: Guest59843: I've got a couple showing real promise in this year's crop
[00:33:54] Devalo: has joined #ruby
[00:34:27] soLucien: havenwood i would really love to try JRuby , but unfortunately the Ruby i write runs on Vagrant
[00:34:29] Guest59843: i was just stating my own fact taht i have seen with my own soLucien
[00:34:34] Guest59843: so no im not up my own ass
[00:34:47] soLucien: and on windows it's based on MinGW
[00:35:24] pawnbox: has joined #ruby
[00:38:39] sandroqz: has joined #ruby
[00:39:18] soLucien: http://www.virtuouscode.com/2015/07/08/ruby-is-defined-by-terrible-tools/
[00:40:57] soLucien: just an example of the "tooling" support : refactoring
[00:41:12] soLucien: what do you do when you want to change a method name ?
[00:41:35] eam: I think the opinion I take most issue with in that article is that ruby is a better perl than perl
[00:41:54] eam: ruby's great and all, but don't kid yourselves
[00:42:24] Synthead: has joined #ruby
[00:42:28] soLucien: my point is it cannot be semantically parsed
[00:42:30] eam: soLucien: pretty often, newbies get wrapped up in "which is better" and, no offense, it seems like that's where you're stuck right now
[00:42:43] soLucien: i dont care which is better eam
[00:42:56] eam: you're going to find that different languages have different strengths and weaknesses
[00:42:59] soLucien: programming languages are tools
[00:43:22] soLucien: i use c# for web dev, php for CMS stuff
[00:43:27] soLucien: python on my raspberry py
[00:43:33] soLucien: ruby with Vagrant and puppet
[00:43:37] Guest59843: LOL C# for web dev epic
[00:43:51] greister: has joined #ruby
[00:44:01] soLucien: Guest that's what i am paid for mate
[00:44:12] soLucien: you are the one trolling
[00:44:33] spudowiar: has joined #ruby
[00:45:10] eam: not the only one, surely
[00:45:37] Guest59843: im not trolling even in the slightly unlike someone
[00:46:07] eam: soLucien: you know what's neat about ruby? You can change a method name on an instance of an object without modifying the class
[00:46:07] MarkBilk: has joined #ruby
[00:46:17] Guest59843: i do web devel in visual basic
[00:46:28] eam: so, if you want to, you can go ahead and change the method name -- at runtime even -- without having to worry about refactoring any code at all
[00:46:32] eam: what could be easier than that?
[00:46:41] soLucien: maintaining it :D
[00:46:53] eam: oh but see, that's a different concern
[00:47:12] jenrzzz: has joined #ruby
[00:47:12] jenrzzz: has joined #ruby
[00:47:22] eam: this gets back to my point earlier: as your career progresses you'll find that these different strengths and weaknesses have different utility in various contexts
[00:47:42] eam: if you don't understand why a language is as it is, give yourself a few more years of experience
[00:47:42] Guest59843: if i knew any ruby i would question soLuciens actual knowledge on it unfortunately i dont o wells
[00:48:22] al2o3-cr: has joined #ruby
[00:51:49] havenwood: Guest59843: They don't know Ruby. Not that that stops someone from having opinions!
[00:53:22] soLucien: eam the fact that it is impossible to semantically validate things makes it hard to 1) refactor 2) find things 3) work on a existing project.
[00:53:31] eam: yup, all true
[00:53:43] soLucien: if you couple that with bad documentation
[00:53:45] eam: that's a classic tradeoff between static and dynamic languages
[00:53:49] soLucien: you end up with Vagrant
[00:54:00] soLucien: Puppet has good documentation at least
[00:54:15] eam: aha, sorry I'm a bit slow - I see you're frustrated with low quality code in devops tools
[00:54:16] soLucien: but you need to read all of it in order to make sense of it
[00:54:25] soLucien: that's a steep learning curve
[00:54:28] eam: I agree, those projects are super annoying
[00:55:02] eam: but let me tell you, if you're upset with vagrant and puppet you're lucky you weren't old enough to have dealt with cfengine
[00:55:51] Guest59843: all the devops tools were written in ruby except ansible any reason?
[00:56:06] eam: only the hip current crop
[00:56:06] Mattx: has joined #ruby
[00:56:32] eam: bcfg2 is python, isn't it?
[00:56:35] spudowiar: has joined #ruby
[00:56:56] Guest59843: well the popular ones i mean
[00:57:03] Guest59843: ansible is the only popular one that is python instead
[00:57:16] eam: hey bcfg2 was more popular than puppet before puppet existed
[00:57:41] soLucien: ansible is gaining a lot of traction
[00:57:53] soLucien: it's the youngest one
[00:58:13] eam: let's not forget saltstack
[00:58:37] eam: newer than ansible, hipper
[00:58:39] eam: and python!
[00:58:56] soLucien: didn't try that. When i had to decide, a chose the one witht he most public modules
[00:59:04] soLucien: and it was a coinflip between chef and puppet
[00:59:30] Guest59843: i bet you dont know langauges just full time devops
[00:59:48] Guest59843: i was going to go that route too tbh
[01:00:05] Guest59843: probably will but studying one language for the sake of knowing one right now
[01:00:11] soLucien: i hate devops but the altenative is spending one day to test a feature
[01:00:25] Synthead: has joined #ruby
[01:00:58] soLucien: start with something that has types. It will make objects easier to understand
[01:01:57] eam: if you really want to criticize these tools, why not point out that none of them can reliably predict what they'll do ahead of time?
[01:02:12] eam: all the CM systems we just mentioned work by running arbitrary code as root on edge nodes
[01:02:29] Guest59843: still seems ruby/rails > Node, Express, React, Angular
[01:02:54] soLucien: i think puppet first "compiles" the run
[01:03:02] soLucien: so it decides what it will do
[01:03:21] soLucien: when it runs by pulling informatio about the system and comparing it with the required state
[01:03:24] flashpoint9: has joined #ruby
[01:06:22] soLucien: you just mentioned 3 different categories of things in one sentence
[01:07:59] eam: well, not really. It collects the data it's going to use, but on end nodes it's still evaluating erb templates as root at the end of the day
[01:08:20] soLucien: but that's linux's fault
[01:08:30] bkxd: has joined #ruby
[01:08:32] soLucien: it's made out of text files
[01:09:11] eam: hm, that's an odd statement
[01:09:29] soLucien: the idea of unix is : parse a string input , do something about it, output a string
[01:09:32] eam: all filesystems are made out of files, but I don't see how that relates to being able to calculate the resulting state ahead of time
[01:10:33] eam: soLucien: you're familiar with your gripe about static languages from earlier? How you can know the state of a thing without executing it?
[01:10:45] eam: consider that complaint in the context of devops tooling
[01:11:07] eam: wouldn't it be nice to know what /etc/foo might be, without having to execute an agent on the actual node?
[01:11:37] soLucien: i don't think it is possible
[01:11:44] eam: well, sure it is
[01:11:48] soLucien: due to the way Unix is designed
[01:11:59] eam: oh? how so?
[01:12:32] soLucien: in order to do that you would have to syntactiacally then semantically understand the input to a command
[01:12:52] eam: what commands are these?
[01:13:04] soLucien: understand the significance of the unix commands
[01:13:25] eam: what relevance is a unix command when we're discussing the placement of a config file in /etc/foo ?
[01:13:28] cdg: has joined #ruby
[01:14:05] soLucien: the format of the config file (the input) has a certain synthax
[01:14:25] soLucien: it differs for every possible linux utility
[01:14:27] eam: do we need to understand it in order to reliably place it?
[01:14:38] eam: does /bin/cp understand file syntax when copying a file?
[01:15:02] soLucien: yes , bin/cp understands bin/cp synthax
[01:15:24] soLucien: https://docs.oracle.com/cd/E19455-01/806-0624/6j9vek52l/index.html
[01:15:39] soLucien: each command line utility has its own synthax
[01:15:39] eam: if I run /bin/cp /etc/foo /etc/bar, are you suggesting cp understands the syntax of foo and bar?
[01:16:22] eam: I'm not sure why you think utilities are relevant in the context of copying a file
[01:16:23] soLucien: no , my point is if you run /bin/cp foo bar you (the runner) understand how cp works
[01:16:29] eam: ok, but we aren't running /bin/cp
[01:16:40] eam: can you copy a file without running a utility?
[01:17:14] soLucien: no, and each utility has its own synthax . each synthax token maps to the semantics of the utility
[01:17:30] eam: but then how does /bin/cp itself copy a file?
[01:17:37] soLucien: that is why you cannot know ahead of time what the utility will do
[01:17:52] eam: are you sure you're correct about that?
[01:18:08] eam: is it command line utilities all the way down?
[01:18:15] soLucien: i mean of course you can know, but you need to write a semantic model of every command line utility
[01:18:50] eam: soLucien: if /bin/cp uses another utility to copy files, what utility does it use?
[01:18:52] Rubie: has joined #ruby
[01:19:28] soLucien: looking at the man page i just posted, it is possible to write a syntactic mdoel of the cp statement
[01:19:33] Synthead: has joined #ruby
[01:19:39] soLucien: the issue is there are zillions of utilities
[01:19:55] soLucien: i don't know
[01:20:01] soLucien: prolly some linux utility
[01:20:10] eam: soLucien: maybe it doesn't use a utility?
[01:20:15] soLucien: some linux API
[01:20:19] eam: aha! an API!
[01:20:27] soLucien: like win32 on win
[01:20:33] eam: is there a syntactic model of an API?
[01:20:44] eam: I suppose we could say the API *is* the model, yes?
[01:21:12] soLucien: yes you can say that
[01:21:16] riskish: has joined #ruby
[01:21:35] eam: ok, so if my program interacts with an API and not shelling out to random utilities, would you agree that such properties can be known?
[01:21:47] eam: regarding behavior?
[01:22:12] soLucien: that's utopian
[01:22:23] eam: is it? Have you ever used a database?
[01:22:47] soLucien: of course it would be amazing , but it would mean reqriting /bin/cp and all other utilities
[01:22:48] eam: would you say that when I run an INSERT, reliable behavior regarding placing data in files will occur?
[01:23:22] eam: or, maybe cp itself. Would you say that /bin/cp itself can reliably make copies of files? That we can predict that "cp foo bar" will copy foo into bar?
[01:23:33] soLucien: yes, of course, but a database has a grammar
[01:23:50] soLucien: but you need a grammar for that
[01:23:53] soLucien: yes you can , eam
[01:23:56] soLucien: that was my point
[01:23:59] soLucien: look at the help page
[01:24:08] soLucien: write a grammar for the arguments
[01:24:12] eam: so you agree that we can develop a grammar to interact with a system, and that this system can have reliable, predictable behaviors
[01:24:14] soLucien: then write a syntactic model
[01:24:17] memorasus: has joined #ruby
[01:24:29] eam: and that this system can then move around the resulting data in reliable ways?
[01:24:55] soLucien: i agree it is possible
[01:24:57] eam: if you agree, then we've just worked out from a rather basic level how a CM system like puppet might function in a reliable fashion
[01:24:58] soLucien: but utopian
[01:25:05] eam: well, such things exist in practice
[01:25:31] eam: though I'm flattered you hold this sort of thing in such high esteem
[01:25:34] soLucien: eam this means writing a grammar for every possible utility from here on
[01:25:49] eam: well, no -- we don't need any utilities
[01:25:55] eam: we'll interact with an API instead
[01:26:04] soLucien: it exists and it's called Windows PowerShell :D
[01:26:12] soLucien: i use it and i like it a lot
[01:26:28] soLucien: but unix works with strings as far as i know
[01:26:37] soLucien: strings that pipe to utilities
[01:26:38] eam: both unix and powershell work with strings
[01:26:40] soLucien: that pipe to strings
[01:26:51] eam: I should say, both /bin/sh and powershell
[01:26:51] soLucien: no , powershell has an object pipeline
[01:27:06] soLucien: bin/sh pipes strings arounf
[01:27:07] eam: powershell internally parses strings into objects
[01:27:11] soLucien: powershell pipes objects
[01:27:15] eam: but the input to powershell is a string
[01:27:24] spudowiar: has joined #ruby
[01:27:28] jenrzzz: has joined #ruby
[01:27:30] soLucien: it's a string with a grammar and a semantic meaning
[01:27:35] soLucien: which makes it an object
[01:27:51] eam: soLucien: you had mentioned that you know what an API is. Do you think the unix API and the windows API differs significantly in terms of structure and function?
[01:28:03] soLucien: yes they do differ
[01:28:08] soLucien: significantly
[01:28:20] eam: in terms of function? does one follow a radically different paradigm? If so, how so?
[01:29:08] soLucien: security is totally different in windows
[01:29:11] soLucien: so is the file system
[01:29:40] eam: how so?
[01:29:44] nettoweb: has joined #ruby
[01:29:56] soLucien: NTFS vs ext4
[01:30:00] soLucien: it is totally different
[01:30:04] killerkamel: has joined #ruby
[01:30:11] soLucien: they are stored in a different format
[01:30:21] soLucien: the access to the files is done differently
[01:30:33] soLucien: there is no impersonation in Windows
[01:31:29] eam: if it's so totally different, why is it I can mount NTFS on linux, and mount ext4 on windows and still interact with each system?
[01:32:05] eam: perhaps it's the case that, while the APIs do have different conventions, they're mostly exchangable for one another
[01:32:30] eam: such that, both systems have concepts like opening a file, using a descriptor, seeking, reading, writing, and so on
[01:32:54] soLucien: https://collaboration.opengroup.org/omi/
[01:32:55] eam: one might even write a translation layer from one API to the other and call it WINE
[01:34:21] nanoz: has joined #ruby
[01:34:21] nanoz: has joined #ruby
[01:35:09] soLucien: i have only worked with WMI, and never with the linux APIs
[01:35:24] jenrzzz: has joined #ruby
[01:35:33] soLucien: so i am speculating
[01:35:35] eam: soLucien: I think you will find, as you learn more about the systems you work with, that these sorts of ideas aren't "utopian" rather they're every-day things
[01:35:38] soLucien: but i understand how these things work
[01:35:56] soLucien: well this omi is one of those efforts
[01:36:37] rehat: has joined #ruby
[01:36:40] pawnbox: has joined #ruby
[01:36:47] soLucien: and Windows DSC is the other
[01:37:04] soLucien: the issue comes when you want to manage 3rd party applications , not the OS itself
[01:37:50] soLucien: unless the vendor writes the grammar to the command-line interface, you cannot know in advance what will happen
[01:38:27] soLucien: i want to manage Nginx . There's no linux API that can help me there
[01:38:52] eam: well sure there is. The answer is to not use command-line tools at all
[01:38:58] eam: nginx has a plugin api
[01:39:01] enilsen16: has joined #ruby
[01:39:23] eam: in fact it's open source, so not only can you interface with an API, you can interact with its internals directly
[01:39:36] eam: (using its internal API)
[01:39:49] magnesium: has joined #ruby
[01:39:56] RegulationD: has joined #ruby
[01:40:01] soLucien: that would mean rewriting all applications
[01:40:08] eam: no, why would it?
[01:40:29] soLucien: also , what is the point of interacting with the internals directly ?
[01:40:45] havenwood: https://github.com/matsumoto-r/ngx_mruby#readme
[01:40:47] eam: well, one common modification to nginx is to embed ruby
[01:41:41] eam: you can work with ruby internals directly as well, in exactly the same fashion
[01:41:53] soLucien: still .. what is the point of such a herculean effort ?
[01:42:12] eam: is it herculean? Some of us do this as a matter of course
[01:42:28] soLucien: doing it the ruby way is one thing
[01:43:04] eam: certainly working within nginx is less work than writing an entirely new thing that behaves just like nginx, but is slightly different
[01:43:06] nettoweb: has joined #ruby
[01:43:22] T2ya: has joined #ruby
[01:43:23] eam: one might ask: what is the point of writing nginx in the first place?
[01:43:39] soLucien: but adding documentation, compatibility and things expected outside the Ruby world is a herculean effort :P
[01:43:46] eam: the answer is generally something like "because I needed something that did that"
[01:44:35] eam: I'm not sure I'd use the word herculean to describe something so common
[01:44:43] eam: most of the software you use works this way, was developed this way
[01:45:25] eam: maybe being a software engineer is a herculean undertaking?
[01:46:08] eam: Magnesium: hello
[01:46:17] havenwood: Magnesium: hi
[01:46:20] soLucien: writing an all-new linux distribution with builtin state-based configuration is a herculean effort
[01:46:35] eam: why would you write a new linux distribution?
[01:46:48] soLucien: because you don't like /bin/cp
[01:47:09] eam: that doesn't make sense, could you explain why a new distro would be necessary?
[01:47:12] soLucien: you want to use the linux api directly
[01:47:21] soLucien: i called it a new linux distro
[01:47:25] byteflame: has joined #ruby
[01:47:30] eam: I think I'd call it a new "linux program"
[01:47:31] soLucien: i don't know how to call it
[01:47:43] eam: because that's what programs do: they interact with the underlying API
[01:47:56] eam: puppet is one such program
[01:48:04] soLucien: ok a new linux program that somehow can do evrything all other linux programs do
[01:48:07] eam: it's just not a very well designed one ;)
[01:48:24] eam: so you're asking, why create a configuration management program?
[01:48:52] byteflame: has joined #ruby
[01:49:02] soLucien: why create a new CM program that tries to reinvent the linux subsystem
[01:49:11] eam: which linux subsystem are you talking about?
[01:49:12] arescorpio: has joined #ruby
[01:49:23] eam: does puppet reinvent a linux subsystem?
[01:49:37] soLucien: utilities as we know them
[01:49:46] eam: how do utilities relate to any of this?
[01:49:48] soLucien: cp , mv, chmod, all these
[01:52:35] soLucien: and even if it were possible, there are (important) software packages that do not have the same structure as nginx
[01:52:51] eam: well, slow down, all we're talking about doing is placing a file
[01:53:01] eam: that's all configuration management does, right? place files?
[01:53:11] soLucien: place files or run commands
[01:53:16] soLucien: that's what an admin does, right ?
[01:53:22] eam: maybe not run commands?
[01:53:33] eam: what if you never ran a command?
[01:53:40] eam: what if your linux system had no commands?
[01:53:58] soLucien: why would it not ?
[01:54:12] eam: well, you've just raised a bunch of concerns as to their reliability
[01:54:18] eam: maybe they're not necessary?
[01:54:21] Cohedrin: has joined #ruby
[01:54:37] eam: what if we can do everything we want to do by only using an API?
[01:54:56] soLucien: that's Windows Powershell, yes :D
[01:55:08] soLucien: can you on Win ?
[01:55:15] eam: well, no, windows powershell isn't an API
[01:55:21] eam: but the thing underneath it is
[01:55:36] eam: you mentioned the win32 api. Windows also has a posix API
[01:55:52] eam: and linux also has the win32 api as well as a posix compatible API
[01:56:06] eam: it turns out, both systems implement the same interfaces under the hood!
[01:56:49] eam: so we can do things like write a program that compiles on either windows or linux
[01:56:51] KnownSyntax: has joined #ruby
[01:56:52] KnownSyntax: has joined #ruby
[01:57:15] soLucien: i still think the effort is unrealistic
[01:57:20] soLucien: yes, it's a great idea
[01:57:35] eam: you say it's unrealistic, but it's literally how every program on your computer works
[01:58:03] soLucien: yes .. and every possible program on my computer
[01:58:48] soLucien: takes more "human readable" inputs from me and turns them into API calls
[01:59:19] eam: like your C compiler?
[01:59:40] soLucien: no .. like my SSH client
[01:59:43] eam: or C#, or java, or ruby
[01:59:49] eam: well, all of these things do this, right?
[02:00:47] soLucien: i see where you are going
[02:01:31] eam: so when I say "I bet you could write a CM system that computes file contents up front and places them reliably"
[02:02:11] eam: or maybe if I say "I bet you could write a compiler that processes a language syntax and creates executable files"
[02:02:22] soLucien: but still , you want to replace my git client with the API calls that it is comprised of, and reliably determine where it's going to place files
[02:02:31] soLucien: i'll say it is unrealistic
[02:02:35] eam: why your git client?
[02:02:43] eam: is /etc/foo a git repo on your system?
[02:03:04] eam: but, backing up a bit
[02:03:19] eam: someone has already done this: https://libgit2.github.com/
[02:03:56] eam: furthermore, someone has built on both the internals of ruby and the API of libgit2 and provided a ruby gem: https://github.com/libgit2/rugged
[02:04:13] eam: so it turns out, interacting with git internals is very easy in a language like ruby
[02:04:51] flashpoint9: has joined #ruby
[02:05:07] eam: we wouldn't need a CM system to interact with git, but we easily could if we wanted to
[02:06:40] soLucien: you know what i find funny ? someone made a re-implementation of something in Ruby, re-compiled nginx with ruby and i bet there are 1231231123 projects like that
[02:06:53] LoneHermit: has joined #ruby
[02:07:12] soLucien: but this is the only ruby file i could find that would be able to keep a powershell session open https://github.com/puppetlabs/puppetlabs-dsc/blob/master/lib/puppet_x/puppetlabs/powershell_manager.rb
[02:07:27] soLucien: and it's made specifically for the purpose of using DSC
[02:07:38] soLucien: and i would have to use a day to make it usable
[02:08:02] eam: well, like we touched on earlier, powershell isn't an api -- it consumes strings and parses them
[02:08:40] eam: there are probably apis and libraries underpinning powershell, which would let you interact with native object types and so on
[02:09:13] eam: the bummer here is that not a lot of people write software for windows
[02:09:23] eam: so you might have a hard time finding anything sophisticated on that level
[02:09:37] cdg: has joined #ruby
[02:09:45] soLucien: it's one of those things that makes sense to have on any OS
[02:09:53] soLucien: a shell session
[02:10:08] magnesium: Can anybody see why this might be happening? http://hastebin.com/huzugebuca.rb
[02:10:09] soLucien: `Do-Something` is fire-and-forget
[02:10:52] eam: Magnesium: sounds like your ruby program doesn't have "espeak" in the path
[02:10:58] magnesium: or identify if it is an issue with the install or the code
[02:11:38] eam: Magnesium: popen is like backticks or system
[02:12:00] eam: in that it's just running some other program
[02:12:09] magnesium: Should I be installing it into the ruby directory then?
[02:12:12] pawnbox: has joined #ruby
[02:12:30] eam: that I don't know. I assume the gem will have docs on how to find the espeak program (or, maybe just read the source)
[02:13:32] magnesium: It says I need to add it to the gemfile
[02:13:51] soLucien: if i want to use a function from a powershell module in my Vagrant plugin i have to do jsonvar= `import-module psmodule ; get-jsoninformation` . then i have to do `import-module psmodule ; set-something`
[02:13:58] magnesium: trying that
[02:14:19] craysiii: has joined #ruby
[02:16:13] l4v2: has joined #ruby
[02:16:29] gdonald: has joined #ruby
[02:19:25] maloik: has joined #ruby
[02:21:37] magnesium: eam, the code and the error are now this, can you tell if the issue is still because ruby can't find espeak? http://hastebin.com/opibowaven.rb
[02:22:09] eam: you're missing a require "espeak"
[02:22:52] eam: require is what loads the gem into your program, creating the ESpeak class
[02:22:55] magnesium: I need both the 'require: 'espeak'' and 'require 'espeak''?
[02:23:30] magnesium: and now it gives me the original error
[02:23:38] magnesium: I'll try installing into the ruby dir
[02:25:37] nankyokusei: has joined #ruby
[02:25:53] magnesium: that didn't seem to help either
[02:26:24] jetpack_joe: has joined #ruby
[02:31:57] allcentury: has joined #ruby
[02:34:52] veduardo: has joined #ruby
[02:46:50] ur5us: has joined #ruby
[02:47:44] ecnalyr: has joined #ruby
[02:51:37] pawnbox: has joined #ruby
[02:53:35] LoneHerm_: has joined #ruby
[02:53:52] mchelen2: has joined #ruby
[02:55:25] dpkezio: has joined #ruby
[02:55:51] mchelen2: i'm trying to add a gem, but after editing the Gemfile i get an error about trying to install in development mode https://gist.github.com/mchelen/403653b9c58e74f52735439d2fb8f23e
[02:56:23] dpk_: has joined #ruby
[03:00:14] dpkezio_: has joined #ruby
[03:02:16] dpkezio_: has joined #ruby
[03:02:32] dpkezio_: has joined #ruby
[03:03:32] nettoweb: has joined #ruby
[03:04:52] HoW: has joined #ruby
[03:05:38] dpkezio: has joined #ruby
[03:06:55] BillSussman: has joined #ruby
[03:09:10] flashpoint9: has joined #ruby
[03:09:46] ur5us: has joined #ruby
[03:12:16] braincrash: has joined #ruby
[03:16:17] havenwood: dpkezio: hi
[03:16:56] havenwood: mchelen2: If you're in dev, not prod, do as the comment suggests: bundle install --no-deployment
[03:20:42] k3rn31: has joined #ruby
[03:23:12] chouhoulis: has joined #ruby
[03:24:29] matcouto: has joined #ruby
[03:30:50] Es0teric: has joined #ruby
[03:31:44] creaked: has joined #ruby
[03:36:08] bmurt: has joined #ruby
[03:39:06] benlieb: has joined #ruby
[03:39:22] Mattx: do you use the gem config (from rails I believe)?
[03:39:30] Mattx: I'm getting a strange "uninitialized constant Settings"
[03:39:45] Mattx: Shouldn't config define Settings?
[03:40:53] RegulationD: has joined #ruby
[03:42:28] Mattx: never mind
[03:44:05] zacts: has joined #ruby
[03:50:29] jenrzzz: has joined #ruby
[03:50:33] pawnbox: has joined #ruby
[03:55:23] LoneHerm_: has joined #ruby
[03:56:59] allcentury: has joined #ruby
[03:59:23] hk238: has joined #ruby
[04:00:34] qguv: has joined #ruby
[04:05:08] gix: has joined #ruby
[04:09:06] mchelen2: havenwood: i did, it showed the same error
[04:09:52] mchelen2: havenwood: turned out this vm had `BUNDLE_FROZEN: 1` set in ~/.bundle/config
[04:10:09] mchelen2: i had to change that, then the --no-deployment worked
[04:12:30] davedev24: has joined #ruby
[04:18:28] Rubie: has joined #ruby
[04:23:23] flashpoint9: has joined #ruby
[04:26:37] nankyokusei: has joined #ruby
[04:34:18] gdonald: has joined #ruby
[04:35:38] Devalo: has joined #ruby
[04:39:21] magnesium: has joined #ruby
[04:40:07] magnesium: has joined #ruby
[04:41:40] ec0: has joined #ruby
[04:41:51] pawnbox: has joined #ruby
[04:46:56] cibs: has joined #ruby
[04:49:07] the_drow: has joined #ruby
[04:49:08] Derperperd: has joined #ruby
[04:49:16] irfansharif: has joined #ruby
[04:49:29] irfansharif: has left #ruby: ()
[04:50:27] zacts: has joined #ruby
[04:51:55] jenrzzz: has joined #ruby
[04:53:20] byteflame: has joined #ruby
[04:53:59] djbkd_: has joined #ruby
[04:56:51] djbkd_: has joined #ruby
[04:59:55] the_drow: has joined #ruby
[05:00:10] allcentury: has joined #ruby
[05:00:38] benlieb: has joined #ruby
[05:02:31] pawnbox: has joined #ruby
[05:02:37] Es0teric: has joined #ruby
[05:05:48] cdg: has joined #ruby
[05:06:52] ur5us: has joined #ruby
[05:07:03] ur5us: has joined #ruby
[05:08:38] Guest34914: has joined #ruby
[05:11:26] Alina-malina: has joined #ruby
[05:18:18] cibs: has joined #ruby
[05:20:27] yardenbar: has joined #ruby
[05:21:22] Devalo: has joined #ruby
[05:34:20] SilverKey: has joined #ruby
[05:41:45] RegulationD: has joined #ruby
[05:41:53] tax: has joined #ruby
[05:44:10] skweek: has joined #ruby
[05:47:21] craysiii: has joined #ruby
[05:53:46] jackjackdripper: has joined #ruby
[05:53:53] elifoster: has joined #ruby
[06:02:03] hahuang61: has joined #ruby
[06:11:46] djbkd_: has joined #ruby
[06:15:03] alfiemax: has joined #ruby
[06:19:06] allcentury: has joined #ruby
[06:24:12] ecnalyr: has joined #ruby
[06:25:16] flashpoint9: has joined #ruby
[06:27:19] nankyokusei: has joined #ruby
[06:28:11] ponga: has joined #ruby
[06:30:33] jvvargass: has joined #ruby
[06:31:40] capitainIsh: has joined #ruby
[06:34:06] djbkd_: has joined #ruby
[06:34:22] nando293921: has joined #ruby
[06:36:31] jaguarmagenta: has joined #ruby
[06:38:27] dhollinger: has joined #ruby
[06:39:50] jaguarma_: has joined #ruby
[06:42:28] cibs: has joined #ruby
[06:45:01] Devalo: has joined #ruby
[06:45:40] Devalo_: has joined #ruby
[06:46:12] matcouto: has joined #ruby
[06:48:47] cibs: has joined #ruby
[06:50:36] hipertracker: has joined #ruby
[06:53:36] afromankenobi: has joined #ruby
[06:54:20] jenrzzz: has joined #ruby
[06:57:32] Tempesta: has joined #ruby
[07:04:00] Emmanuel_Chanel: has joined #ruby
[07:05:19] jaguarmagenta: has joined #ruby
[07:08:11] comjf: has joined #ruby
[07:12:26] jud: has joined #ruby
[07:15:55] allcentury: has joined #ruby
[07:22:59] jishankai: has joined #ruby
[07:25:06] Gadgetoid: has joined #ruby
[07:25:47] dionysus69: has joined #ruby
[07:26:45] Hyuk: has joined #ruby
[07:27:05] the_drow: has joined #ruby
[07:33:07] MarkBilk: has joined #ruby
[07:33:14] afromankenobi: has left #ruby: ()
[07:37:58] jackjackdripper: has joined #ruby
[07:41:02] Jackneill_: has joined #ruby
[07:42:39] RegulationD: has joined #ruby
[07:48:21] kavanagh: has joined #ruby
[07:52:49] Pumukel: has joined #ruby
[07:53:46] cdg: has joined #ruby
[07:55:04] pawnbox: has joined #ruby
[07:56:01] jenrzzz: has joined #ruby
[07:56:21] craysiii: has joined #ruby
[07:58:40] lxsameer: has joined #ruby
[08:02:42] djbkd_: has joined #ruby
[08:04:08] bumao: has joined #ruby
[08:05:18] pawnbox: has joined #ruby
[08:07:26] lele: has joined #ruby
[08:10:05] toretore: has joined #ruby
[08:11:33] DoubleMalt: has joined #ruby
[08:12:55] cibs: has joined #ruby
[08:16:23] xall: has joined #ruby
[08:16:33] firstdayonthejob: has joined #ruby
[08:17:39] kavanagh: has joined #ruby
[08:18:27] capitainIsh: has joined #ruby
[08:18:47] binaryplease1: has joined #ruby
[08:24:02] chipotle: has joined #ruby
[08:24:55] kavanagh: has joined #ruby
[08:27:42] flashpoint9: has joined #ruby
[08:28:22] nankyokusei: has joined #ruby
[08:30:34] benlieb: has joined #ruby
[08:34:53] Madplatypus: has joined #ruby
[08:35:46] gdonald: has joined #ruby
[08:36:33] dionysus69: has joined #ruby
[08:42:10] kavanagh: has joined #ruby
[08:42:17] pandaant: has joined #ruby
[08:44:22] Mattx: has joined #ruby
[08:45:02] tubuliferous: has joined #ruby
[08:45:18] creat: has joined #ruby
[08:45:19] cibs: has joined #ruby
[08:48:16] P4Titan: has joined #ruby
[08:49:12] P4Titan: Hello all. I call the group_by function on an Array and get a hash. However, how can I set a default value to this hash after it is instantiated by group_by?
[08:49:36] rails: has joined #ruby
[08:49:52] marr: has joined #ruby
[08:50:39] toretore: http://www.rubydoc.info/stdlib/core/Hash#default%3D-instance_method
[08:52:07] P4Titan: If I want to pass a proc however
[08:52:15] P4Titan: can I use the block notation like during initialization
[08:52:21] P4Titan: or do I have to call the proc func?
[08:53:07] cibs: has joined #ruby
[08:54:02] P4Titan: IE: is there a simple way to set the default value to be a newly instantiated empty array every time: { [] }
[08:56:07] jenrzzz: has joined #ruby
[08:57:52] toretore: the answer to your question is on the very same page that i linked to
[09:01:05] djbkd_: has joined #ruby
[09:04:10] chipotle: has joined #ruby
[09:07:11] agit0: has joined #ruby
[09:10:56] snowy: has joined #ruby
[09:13:01] kavanagh: has joined #ruby
[09:15:15] spider-mario: has joined #ruby
[09:17:13] spider-mario: has joined #ruby
[09:18:53] naftilos76: has joined #ruby
[09:22:57] Devalo: has joined #ruby
[09:25:51] Devalo: has joined #ruby
[09:31:09] allcentury: has joined #ruby
[09:38:29] Mia: has joined #ruby
[09:38:30] Mia: has joined #ruby
[09:43:07] sche: has joined #ruby
[09:43:30] RegulationD: has joined #ruby
[09:44:51] dionysus69: has joined #ruby
[09:49:35] harfangk: has joined #ruby
[09:49:51] strigonLeader: has joined #ruby
[09:50:25] Devalo: has joined #ruby
[09:56:55] miqlas-H: has joined #ruby
[09:57:23] jenrzzz: has joined #ruby
[09:58:41] Devalo: has joined #ruby
[10:00:21] kavanagh: has joined #ruby
[10:00:35] ecnalyr: has joined #ruby
[10:03:11] yfeldblum: has joined #ruby
[10:05:23] karapetyan: has joined #ruby
[10:11:55] hipertracker: has joined #ruby
[10:13:27] the_drow: Can I use a thread to execute a subprocess? Will the GVL be released?
[10:13:31] snowy: has joined #ruby
[10:13:43] Nahra: has joined #ruby
[10:15:06] jhass: the_drow: I don't follow, a subprocess doesn't share a GVL with its parent?
[10:15:44] jhass: also it won't run "inside" the parent process, like a thread does, so running it "inside" a thread doesn't make too much sense either
[10:16:07] the_drow: I'm writing a script that runs mongodump in a subprocess
[10:16:19] the_drow: But I'd like to be able to run multiple mongodumps at once
[10:16:28] the_drow: and other I/O related tasks
[10:16:40] jhass: just spawn them, collect their pids and waitpid on all
[10:16:49] the_drow: So I don't want the subprocess to block the main thread.
[10:17:04] jhass: &ri Kernel#spawn Process#waitpid
[10:17:05] `derpy: http://ruby-doc.org/core-2.3.1/Kernel.html#method-i-spawn
[10:17:10] the_drow: But I'd like to queue 8 at a time. I don't want to spawn 50...
[10:17:16] jhass: &ri Process.waitpid
[10:17:17] `derpy: http://ruby-doc.org/core-2.3.1/Process.html#method-c-waitpid
[10:17:23] jhass: then do that?
[10:17:34] the_drow: Figured using a thread pool would be easier.
[10:17:50] jhass: I don't see a difference
[10:18:06] jhass: whether you call Thread#join on a thread or Process.waitpid on a pid
[10:18:25] jhass: seems like the same complexity
[10:21:19] pickandmix: anyone mind decoding this <%= f.label :message %><br> what's this?
[10:21:27] pickandmix: :message is a symbol?
[10:22:10] jhass: PickAndMix: yes, f is a local variable most likely yielded to a block by form_for, label is a method called on it
[10:22:38] pickandmix: jhass: thanks for clarifying :)
[10:22:46] jhass: <%= is erb syntax and embeds the value of the following expression into the document
[10:23:18] pickandmix: jhass: what should i google to be clearer to this concept
[10:23:32] pickandmix: jhass: I have read through this but now that I came across it again, I'm still alittle unclear.
[10:23:34] jhass: which concept in particular?
[10:23:38] pickandmix: This is not hashes right
[10:23:41] pickandmix: the f.label :message part
[10:23:47] jhass: no, there's no hash
[10:24:02] ceritium: has joined #ruby
[10:24:05] jhass: it's just a method called on an object and passed a symbol on an argument
[10:24:15] pickandmix: I'll google on ruby symbols
[10:24:22] jhass: http://devdocs.io/rails~4.2/actionview/helpers/formbuilder#method-i-label this method btw
[10:24:30] ruby[bot]: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[10:24:43] jhass: for when you want to know more about this method in particular
[10:24:48] pickandmix: is that more of a rails thing?
[10:25:05] pickandmix: I completed codeacademy ruby's course yet now that I'm on the rails course, it's still feels unfamiliar.
[10:25:12] jhass: calling a method or symols? not at all, it's very very fundamental to ruby
[10:25:27] pickandmix: okay. perhaps I was missing out on something. I'll go read up on it, thank you jhass
[10:25:58] ruby[bot]: -b Guest_84746!*@*$#ruby-banned
[10:28:26] chosen1_: has joined #ruby
[10:29:02] nankyokusei: has joined #ruby
[10:29:12] flashpoint9: has joined #ruby
[10:29:16] Guest34914: has joined #ruby
[10:33:01] jenrzzz: has joined #ruby
[10:35:57] miqlas-H: Is there any gui addition to ruby?
[10:38:03] allcentury: has joined #ruby
[10:40:49] SCHAAP137: has joined #ruby
[10:46:02] ur5us: has joined #ruby
[10:47:42] leitz: has joined #ruby
[10:49:40] leightski: has joined #ruby
[10:50:39] karapetyan: has joined #ruby
[10:50:44] rajdesai: has joined #ruby
[10:52:55] rajdesai: Hello guys! New to IRC.. Not sure where to start, what to do etc..
[10:53:19] rajdesai: I am learning RoR right now and trying to explore it bit by bit..
[10:54:34] Papierkorb: rajdesai: Hello! This applies to every IRC channel I know of, just /join and ask away. For the first times, a 'hello' is nice too. Also, don't worry about asking in the wrong channel, people will direct you to the appropriate one in this case.
[10:55:09] Papierkorb: rajdesai: Ruby on Rails specific help and discussion happens in #RubyOnRails, #ruby is for ruby-general help and discussion
[10:55:25] rajdesai: Thanks papierkorb! Got it..
[10:55:51] rajdesai: Is there a place where I can learn all commands/shortcuts?
[10:56:20] Papierkorb: For shortcuts, consult the help pages (or configuration dialog) of your IRC client
[10:56:22] Zarthus: for irc, '/quote help' lists most.
[10:56:23] jhass: miqlas-H: Ruby comes with a Tk binding in the standard library, Gtk bindings live in the ruby-gnome2 (Gtk2) project and gir_ffi-gtk (Gtk3) and related gems
[10:56:55] miqlas-H: Ok, thank you.
[10:56:56] jhass: miqlas-H: not sure about a good QT or cocoa binding
[10:57:07] Papierkorb: miqlas-H: There's also `qt-binding` for Qt4. It's no longer in development though :(
[10:57:32] jhass: of course you could also use Java Swing through JRuby
[10:57:43] Papierkorb: miqlas-H: And there's also `shoes-rb`, but I think it requires JRuby
[10:58:55] miqlas-H: As Python have Bethon, it would be grat to have Huby for Haiku GUI.
[10:59:20] miqlas-H: *notmydeskjustmy2cent
[11:02:28] nerium_: has joined #ruby
[11:05:45] Davedev28: has joined #ruby
[11:10:08] Devalo: has joined #ruby
[11:11:02] Papierkorb: jhass: Great, didn't know about the gir_ffi bindings (in fact, didn't know about gir_ffi in general). Maybe I'll put this to use for some small-ish things later
[11:11:07] sdothum: has joined #ruby
[11:14:00] jhass: yeah, gobject-introspection is a pretty nice idea
[11:23:31] ur5us: has joined #ruby
[11:27:00] moredhel: has joined #ruby
[11:30:11] xall: has joined #ruby
[11:30:46] Devalo: has joined #ruby
[11:31:18] leitz: Reading "Practical Object Oriented design in Ruby" and refactoring some more. I'm sure some disdain my choice of Ruby versions, but this is what I have. Currently working on https://github.com/LeamHall/CT_Character_Generator/blob/refactor_career/lib/Career.rb and https://github.com/LeamHall/CT_Character_Generator/blob/refactor_career/lib/Citizen.rb
[11:31:44] ec0: has joined #ruby
[11:34:43] leitz: So far I'm not sure about when to use "self.method()" and just "method()". Still understanding the uses of Modules vs Subclasses.
[11:36:56] Hanmac: has joined #ruby
[11:39:18] Hyuk: has joined #ruby
[11:42:11] harfangk: leitz well my first answer is that self.method() is a class method, and method() is an instance method
[11:42:17] harfangk: is there any other context to it?
[11:42:23] Devalo: has joined #ruby
[11:42:43] BillSussman: has joined #ruby
[11:43:45] symm-: has joined #ruby
[11:44:21] RegulationD: has joined #ruby
[11:45:57] nadir: has joined #ruby
[11:46:11] xall: has joined #ruby
[11:47:22] leitz: harfangk, the program calls the subclass, which inherits many methods from the parent. The program call is just one method, everything else is called from within the subclass to itself or the parent.
[11:49:20] ecnalyr: has joined #ruby
[11:50:48] leitz: For the most part when things break I assume operator error. I still have a lot to learn.
[11:52:19] elomatreb: leitz: Did you understand the def self.method vs def method thing?
[11:53:08] leitz: elomatreb, not really.
[11:53:32] leitz: So far I just add "self." until it works. :(
[11:54:07] elomatreb: If you're doing def self.method, you're defining a method on the class object, not on the instances
[11:55:34] al2o3-cr: leitz: once you've grasped it, everything will become so apparent
[11:55:39] leitz: If A is a subclass of B, and the program calls A, so far A's methods need "self."
[11:56:09] leitz: al203-cr, yeah, but the coffee is slow to kick in this morning....
[11:56:44] elomatreb: See here: https://eval.in/614665
[11:58:25] Emmanuel_Chanel: has joined #ruby
[11:58:57] leitz: So, if I create a Test object the calls don't require "self."? If I just use methods from a class, they do?
[11:59:03] hwcomcn: has joined #ruby
[11:59:53] leitz: Which seems to be how my code is working.
[12:00:21] elomatreb: Are you familiar with how static methods work in some other programming languages? That is (basically) what def self.method does
[12:01:05] leitz: Can't say that I'm a great coder, even after years of trying.
[12:01:32] leitz: Using Ruby to figure out OOP.
[12:02:12] matthewd: leitz: Which language are you most familiar with?
[12:02:16] elomatreb: Could you show an example of code where you feel you have to use def self.method, and don't understand why?
[12:02:36] jhass: let's get some other term straight first, "def foo"/"def self.foo" <- method definition; "foo"/"self.foo"/"something.foo" <- method call
[12:03:22] leitz: elomatreb, https://github.com/LeamHall/CT_Character_Generator/blob/refactor_career/lib/Citizen.rb#L58-L60
[12:03:51] leitz: Citizen is a subclass of Career, and overrides Career.rank()
[12:04:00] matthewd: leitz: Where is that called?
[12:04:33] leitz: matthewd, in the parent class: https://github.com/LeamHall/CT_Character_Generator/blob/refactor_career/lib/Career.rb#L61
[12:04:46] jhass: move https://github.com/LeamHall/CT_Character_Generator/blob/refactor_career/lib/Career.rb#L7-L15 into initialize, remove all self. in def self.foo
[12:05:03] hwcomcn: has joined #ruby
[12:05:07] leitz: ACTION goes to look at what jhass said.
[12:05:07] jhass: https://github.com/LeamHall/CT_Character_Generator/blob/refactor_career/lib/Citizen.rb#L11-L38 make these CONSTANTS
[12:05:18] matthewd: https://github.com/LeamHall/CT_Character_Generator/blob/refactor_career/lib/Career.rb#L18
[12:05:23] matthewd: Does this even run at the moment? :/
[12:05:25] jhass: https://github.com/LeamHall/CT_Character_Generator/blob/refactor_career/lib/Citizen.rb#L40-L50 move these to def initialize
[12:05:30] cyphase: has joined #ruby
[12:06:07] jhass: Also prefer [] over Array.new, {} over Hash.new
[12:06:31] jhass: @muster_out = {"cash" => [], "benefits" => []}
[12:07:00] leitz: ACTION notes jhass types as fast as leitz reads...
[12:07:55] elomatreb: leitz: btw, if you've done anything in bash without wanting to hurt people you're already a great programmer in my book
[12:09:20] leitz: matthewd, I just pushed up the code I'm running, what was up was a few miuntes behind. It runs with "ruby bin/Chargen.rb -c Citizen"
[12:09:33] matthewd: Ah: https://github.com/LeamHall/CT_Character_Generator/blob/efe9c61f73e7482dbbed31b112279ef5efdb5796/test/test_CharacterTools.rb#L33
[12:10:09] leitz: elomatreb, one of the things I'm tying to do is get Ruby more in use in the SysAdmin field. Have to show it works though, which means I have to learn it.
[12:10:20] matthewd: Yeah, I think there are a couple of Os missing from this P.
[12:10:35] leitz: matthewd, those tests predate the current refactor.
[12:11:10] matthewd: If you don't have tests to support it, you're doing "changes", not "refactoring" :|
[12:11:22] leitz: While tests should come frist, I'm already at the edge of my understanding, and trying to take it a bite at a time.
[12:11:35] jhass: and that's totally fine here
[12:12:42] leitz: Thanks! The original code from last year was a monster class that did everything. Trying to break it up while not duplicating code.
[12:12:44] c355E3B: has joined #ruby
[12:13:18] elomatreb: leitz: IIRC there are quite a few admin tools that utilize Ruby, Chef and Vagrant come to mind (maybe also things like Metasploit). Not an admin person though, so idk
[12:14:54] leitz: Yup, Puppet uses a Ruby DSL, just enough to mess you up. That's what pushed me into Ruby, Then I saw how much fun it was.
[12:15:31] leitz: i used to be a (Python, C, Bash) snob but forgot how much fun this could be.
[12:16:28] elomatreb: Yeah, that's something Ruby does quite well
[12:16:32] leitz: jhass, a question about Constants. I'm using the "char" hash to passh things around from method to method. How does that work with a constant?
[12:17:10] elomatreb: You can change that Hash assigned to the constant, although it's a bit of a code smell
[12:17:26] jhass: leitz: I never said you should turn it into a constant
[12:17:33] elomatreb: You can even completely reassign the constant, Ruby only warns you!
[12:17:34] jhass: and actually turn it into an instance variable
[12:17:56] jhass: and don't pass it around as much
[12:17:58] chipotle: has joined #ruby
[12:18:18] matthewd: leitz: Are you familiar with objects & classes in python?
[12:18:22] xall: has joined #ruby
[12:18:56] leitz: Some things don't change, like the muster_out Hash or the skill_options array.
[12:19:10] jhass: and thus they should be constants
[12:19:16] jhass: they're constant, make them constants
[12:19:39] leitz: matthewd, only a little. This is the furthest I've gotten into OOP. More like ooP...
[12:20:08] matthewd: leitz: If I said that "self." in ruby is the opposite of "self, " in the python argument list, would that help?
[12:20:43] matthewd: leitz: `def foo` == `def foo(self):`; `def self.foo` == `def foo:`
[12:22:57] dionysus69: has joined #ruby
[12:24:28] leitz: matthewd, not really. I haven't done Python for a year or more, Ruby has been my focus when I can make time to learn.
[12:24:47] millerti: has joined #ruby
[12:25:58] Devalo: has joined #ruby
[12:30:03] nankyokusei: has joined #ruby
[12:33:23] sdothum: has joined #ruby
[12:34:06] xall: has joined #ruby
[12:35:43] jenrzzz: has joined #ruby
[12:35:43] jenrzzz: has joined #ruby
[12:41:17] Es0teric: has joined #ruby
[12:43:10] cdg: has joined #ruby
[12:45:01] leitz: jhass, I started to play with moving @muster_out into Citizen.initialize, and realized it never gets called. The program creates an object from Character.rb and then just calls the "Citizen.run_career(char)" stuff.
[12:46:00] karapetyan: has joined #ruby
[12:47:40] leitz: I probably need to quit using the same name for a variable and a method. :(
[12:48:45] Yacker: has joined #ruby
[12:49:42] jhass: creating classes is quite pointless if you never instantiate (call .new) them
[12:50:13] xall: has joined #ruby
[12:51:21] leitz: Probably true. I'm going to re-read and try to understand the section on modules; things like "Citizen" just hold different attributes like "@skill_options" and overload a few methods like rank.
[12:52:06] jhass: I do think classes make sense here
[12:52:18] jhass: you just also have to create instances
[12:53:33] leitz: What would an instance of a class do to the Object "Character"? So far i'm just modifying Character with the "run_career" method.
[12:54:13] leitz: Would you pass Character to Citizen.new(object)?
[12:54:58] leitz: And more importantly, would that object be modified so that the resultant object can be passed to another class?
[12:55:58] leitz: The program flow in Chargen is "Create a Character.new, change it with Citizen, and then print it with Presenter."
[12:56:26] leitz: The middle part, Citizen, will vary depending on the Career.
[12:59:38] minotep: has joined #ruby
[12:59:42] leitz: Time to get ready for church. I need to keep my brain on this, and also re-work the test suite to test stuff as I go.
[13:03:00] kavanagh: has joined #ruby
[13:04:27] xblade: has joined #ruby
[13:05:44] Guest34914: has joined #ruby
[13:06:12] xall: has joined #ruby
[13:09:53] skweek: has joined #ruby
[13:17:54] xblade_: has joined #ruby
[13:19:19] minotep: has joined #ruby
[13:20:09] benlieb: has joined #ruby
[13:22:07] xall: has joined #ruby
[13:23:15] Guest34914: has joined #ruby
[13:25:52] Tempesta: has joined #ruby
[13:28:10] karapetyan: has joined #ruby
[13:38:03] xall: has joined #ruby
[13:39:08] Rubie: has joined #ruby
[13:40:44] moeSeth: has joined #ruby
[13:45:15] RegulationD: has joined #ruby
[13:45:52] Davedev28: has joined #ruby
[13:45:53] davidjd: has joined #ruby
[13:53:42] pard: has joined #ruby
[13:54:01] xall: has joined #ruby
[13:54:28] pard: i've got a problem with the void expression semantics
[13:55:06] pard: >> while true; l = false ? break : 12 end #will fail
[13:55:08] ruby[bot]: pard: # => /tmp/execpad-69e0310b39d1/source-69e0310b39d1:2: void value expression ...check link for more (https://eval.in/614719)
[13:55:33] pard: >> while true; l = if false; break else 12 end end #will fail
[13:55:34] ruby[bot]: pard: # => /tmp/execpad-9a2a4a53bf39/source-9a2a4a53bf39:2: void value expression ...check link for more (https://eval.in/614720)
[13:55:51] LoneHermit: has joined #ruby
[13:55:53] pard: >> while true; l = 12 && break end #won't fail
[13:55:54] ruby[bot]: pard: # => nil (https://eval.in/614721)
[13:56:03] pard: is there any reason?
[13:57:24] pard: because as far as i know, (12) - (break) is a void expression, so why shouldn't 12 && break be a void expression like it?
[13:57:53] pard: any ideas?
[13:59:38] pard: >> while true; l = (12 && break) end #won't fail
[13:59:38] ruby[bot]: pard: # => nil (https://eval.in/614722)
[14:00:37] Mon_Ouie: condition && break is just another way of writing 'break if condition', it sounds reasonable enough.
[14:02:36] jhass: l = break if 12 isn't valid either
[14:02:46] jhass: I think you just found another inconsistency in the parser
[14:02:52] pard: >> while true; l = (break if 12) end # Mon_Ouie
[14:02:53] ruby[bot]: pard: # => /tmp/execpad-3bf520bb476f/source-3bf520bb476f:2: void value expression ...check link for more (https://eval.in/614723)
[14:03:06] pard: jhass, thanks!
[14:04:04] jhass: l = (break && 12) fails too
[14:04:05] macsteps: has joined #ruby
[14:05:00] pard: jhass, could i ask whether it is intentional?
[14:05:57] pawnbox: has joined #ruby
[14:06:13] pard: i'm rather new to actual programming in ruby, so i wonder whether it is a common idiom that has been excluded from VVE scrutiny?
[14:06:30] spectrum: has joined #ruby
[14:06:39] jhass: https://github.com/ruby/ruby/commits/trunk/parse.y
[14:07:00] jhass: I've never seen any expression like that before
[14:07:24] jhass: the idiom would be break if cond or perhaps cond and break
[14:07:44] jhass: well and I guess because cond and break is okay cond && break should be okay
[14:07:52] jhass: but with an assignment in front? nope
[14:09:26] cyphase: has joined #ruby
[14:09:30] cir0x: has joined #ruby
[14:09:32] pard: jhass, i guess l = 12 and break should work, as and will merely join statement-level expressions
[14:09:52] pard: >> while true; l = 12 and break end; l
[14:09:54] ruby[bot]: pard: # => 12 (https://eval.in/614724)
[14:10:00] cir0x: Hi. Is there an easy to use json lib like gson for java?
[14:10:00] jhass: I guess, yeah
[14:10:06] xall: has joined #ruby
[14:10:13] jhass: Cir0X: what's wrong with json in stdlib?
[14:10:40] pard: jhass, thanks for the response :)
[14:10:50] jhass: >> require "json"; [1, 2, 3].to_json
[14:10:51] ruby[bot]: jhass: # => "[1,2,3]" (https://eval.in/614725)
[14:10:55] snath: has joined #ruby
[14:11:00] pard: has left #ruby: ("Leaving")
[14:11:05] snath: has left #ruby: ()
[14:12:23] the_drow: Is there an example on how to use IO.nonblock_write with a file?
[14:12:30] the_drow: Is that even useful?
[14:13:06] cashnguns: has joined #ruby
[14:13:47] jhass: it shouldn't be useful, no
[14:13:55] jhass: what issue do you try to solve?
[14:14:04] vagrant1: has joined #ruby
[14:14:46] vagrant1: has left #ruby: ()
[14:14:56] the_drow: I'm trying to serialize writes to a file. I know I can use file.flock
[14:15:05] cir0x: jhass: I want to serialize a simple object (https://gist.github.com/Cir0X/7b14ea371f2c9d747e06dafc7932eb71) to json, but to_json just serializes some object address ("#<Command>:0x3423>"
[14:15:09] the_drow: Just trying to see if there are different ways to do it without locking
[14:15:11] matthewd: It could be useful.. not all filesystems are instant
[14:15:31] the_drow: I have two threads accessing the same file...
[14:15:40] matthewd: I'm not sure how x gets to y there, though
[14:16:03] jhass: Cir0X: define def as_json(options={}); {command: @command, description: @description, unix_command: @unix_command}; end
[14:16:25] jhass: matthewd: doesn't the kernel always buffer the writes though?
[14:17:00] matthewd: jhass: That's true for any IO.. but the kernel buffer has its limits
[14:17:04] jhass: the_drow: doing nonblocking writes sounds like it would only worsen that situation, if having any effect at all
[14:17:09] zacts: has joined #ruby
[14:17:37] matthewd: the_drow: Why would it help?
[14:17:58] jhass: my open(2) says "Note that this flag has no effect for regular files and block devices; that is, I/O operations will (briefly) block when device activity is required, regardless of whether O_NONBLOCK is set."
[14:18:12] matthewd: Ah, fair enough
[14:18:36] nhhc: has joined #ruby
[14:18:40] matthewd: the_drow: Or better, just elaborate on what you need to do
[14:18:50] jhass: (and why flock doesn't cut it)
[14:19:18] the_drow: I'm not sure flock doesn't cut it. I just don't see the performance improvement I'm expecting
[14:19:30] the_drow: I'm dumping data from multiple sources into a file
[14:19:36] nhhc: has joined #ruby
[14:19:54] jhass: why do you expect an improvement if you have to serialize (= block other writers) anyway?
[14:20:17] macsteps: has joined #ruby
[14:20:36] the_drow: Because there is lots of outgoing/incoming I/O from & to the databases
[14:20:49] the_drow: https://gist.github.com/thedrow/037c93b9135b0c20ea543e16e6070578 - Right now this is the code for writing into the file
[14:21:49] jhass: did you consider a single writer thread and a Queue?
[14:21:57] matthewd: the_drow: Show some more code? What's actually going on with the threads?
[14:22:20] jhass: also where's your mutex?
[14:22:24] the_drow: jhass, that could also work
[14:24:20] pawnbox: has joined #ruby
[14:24:29] the_drow: matthewd, not sure I can... They are issuing queries to the database using https://github.com/rroblak/seed_dump
[14:24:37] the_drow: In batches of 1000.
[14:25:49] cir0x: jhass: Thanks so far, but now I need to call command.as_json.to_json (full example: https://gist.github.com/Cir0X/7b14ea371f2c9d747e06dafc7932eb71)
[14:26:00] xall: has joined #ruby
[14:26:11] P4Titan: has joined #ruby
[14:26:29] P4Titan: How can I write this code better: http://pastie.org/10924975
[14:27:52] matthewd: the_drow: Skip the thread body if you must, but at least the outer parts would help show how you're parallelizing
[14:28:06] the_drow: k, Give me a sec.
[14:29:17] jhass: Cir0X: ; is here for brevity, use newlines in your real code
[14:30:49] matthewd: P4Titan: Without any context or indication of higher-level intent, I'm not sure how else one could write that. Use braces instead of do/end? ¯\_(ツ)_/¯
[14:30:53] nankyokusei: has joined #ruby
[14:31:11] P4Titan: matthewd: ooh, Im sorry
[14:31:32] havenwood: P4Titan: Does it do what you're hoping it'll do? What are you trying to do?
[14:31:36] P4Titan: I'm setting a hash's default value to be a process that generates []
[14:32:13] P4Titan: it works, but looks ugly which needless syntax like the |hash, key| which are unused and all
[14:32:18] P4Titan: I want to make it more elegant
[14:32:57] havenwood: P4Titan: You could: grouped_links = Hash.new { |h, k| h[k] = [] }
[14:33:02] cir0x: jhass: good to know. I use this method now alongside with yours: def json; self.as_json.to_json; end.
[14:33:09] matthewd: grouped_links.default_proc = proc { [] }
[14:33:14] havenwood: P4Titan: Try using it as you have it and see what happens.
[14:33:16] jhass: Cir0X: mmh, I thought it would call as_json, perhaps only rails does. And yes, was just about to suggest that
[14:33:23] havenwood: P4Titan: grouped_links.default = []
[14:33:53] matthewd: P4Titan: Though note you more often would want what havenwood said, actually using the parameters
[14:35:14] cir0x: jhass: thanks for your help, didn't find much useful stuff on SO :\
[14:35:19] havenwood: >> grouped_links = {}; grouped_links.default = []; grouped_links[:pies] << 'blueberry'; grouped_links[:oops] # P4Titan
[14:35:20] ruby[bot]: havenwood: # => ["blueberry"] (https://eval.in/614730)
[14:35:29] millerti: has joined #ruby
[14:35:39] havenwood: P4Titan: Try that ^ with the code you have. Is that the result you want?
[14:35:44] jhass: Cir0X: https://p.jhass.eu/4j.rb reformatted into idiomatic code ;)
[14:36:41] hk238: has joined #ruby
[14:37:05] cir0x: jhass: Wow looks much better!
[14:37:11] memorasus: has joined #ruby
[14:37:13] havenwood: P4Titan: (I don't think the default_proc as you have it is what you want. But it's idiomatic to use underscores for unused params.)
[14:37:27] jenrzzz: has joined #ruby
[14:37:38] jhass: Cir0X: https://p.jhass.eu/4k.rb sorry forgot two _ ;)
[14:38:05] dionysus69: has joined #ruby
[14:38:30] havenwood: P4Titan: compare with: grouped_links.default_proc = ->(h, k) { h[k] = [] }
[14:39:13] havenwood: another way to write: grouped_links.default_proc = proc { |h, k| h[k] = [] }
[14:39:17] cats: has left #ruby: ("noodle")
[14:40:28] P4Titan: the reason I stray from using default = [] is because it can be modified
[14:40:54] zacts: ruby is so so cool
[14:40:57] P4Titan: tho in my case, I don't do any modification, I feel like returning and empty list everytime something is referenced that doesn't exist
[14:43:47] havenwood: P4Titan: How are you using it?
[14:44:18] P4Titan: I generate it by the function group_by
[14:44:20] matthewd: P4Titan: If you use `.default = []` or `.default_proc = proc { [] }`, consider freezing the array; with either of those, mutation is going to have unexpected results
[14:45:04] P4Titan: and I extract elements using key values
[14:45:20] P4Titan: but if something isn't present, I want to return [] instead of nil
[14:46:10] RegulationD: has joined #ruby
[14:47:39] anu0_: has joined #ruby
[14:47:56] anu0_: Anyone know how to solve this error: http://imgur.com/a/Z3Hvs
[14:49:34] anu0_: has joined #ruby
[14:49:48] karapetyan: has joined #ruby
[14:50:46] lkba: has joined #ruby
[14:51:11] jhass: anu0: well, install bundler?
[14:51:24] jhass: also please use a pastebin like gist.github.com, not screenshots
[14:52:12] P4Titan: anu0: sidenote, i3 -- I like
[14:53:24] Jahhein0: has joined #ruby
[14:53:51] anu0: jhass: I'm dumb.
[14:54:22] Guest34914: has joined #ruby
[14:54:23] Wildfyr: has joined #ruby
[14:54:23] Wildfyr: has joined #ruby
[14:54:42] the_drow: matthewd, https://gist.github.com/thedrow/ac40f01abbffcb822f52d3c9a615fdcb
[14:55:24] the_drow: Both $pool & $file_writer are ThreadPoolExecutors from concurrent-ruby
[14:56:45] Spami: has joined #ruby
[14:57:04] matthewd: the_drow: Hmm.. if you add some puts calls, can you confirm it's being as concurrent as you expect?
[14:57:17] matthewd: e.g., it's not spending all its time in clean_objects
[14:59:10] minotep: has joined #ruby
[14:59:42] the_drow: clean_objects is run on the main thread
[14:59:50] the_drow: Are you suggesting it's eating up all the resources?
[14:59:58] the_drow: I mean GIL time
[15:00:46] griffindy: has joined #ruby
[15:00:47] matthewd: Ruling out, more than suggesting
[15:01:58] millerti: has joined #ruby
[15:02:43] the_drow: matthewd, https://gist.github.com/thedrow/0863823f347ff3a27229e8343482476c threads are being scheduled both for Products and Profiles
[15:03:17] chipotle: has joined #ruby
[15:04:57] the_drow: matthewd, I know what's blocking. Not sure if it's solveable
[15:06:25] Jackneill_: has joined #ruby
[15:06:54] UserInneed: has joined #ruby
[15:11:07] dennisvennink: has joined #ruby
[15:13:27] CloCkWeRX: has joined #ruby
[15:13:47] xall: has joined #ruby
[15:15:56] pawnbox: has joined #ruby
[15:17:06] creaked: has joined #ruby
[15:18:37] Kuukunen: has joined #ruby
[15:21:49] macsteps: has joined #ruby
[15:25:15] ecnalyr: has joined #ruby
[15:27:43] ss_much: has joined #ruby
[15:28:15] c0mrad3: has joined #ruby
[15:29:14] minotep: has joined #ruby
[15:29:49] xall: has joined #ruby
[15:33:46] benlieb: has joined #ruby
[15:35:51] chipotle: has joined #ruby
[15:36:31] cir0x: has joined #ruby
[15:38:02] ner: has joined #ruby
[15:38:13] jenrzzz: has joined #ruby
[15:38:27] gregf: has joined #ruby
[15:38:50] ner: Any suggestion on gem(s) that makes it possible to simulate virtual memory?
[15:40:03] jhass: not sure what you're thinking of
[15:41:06] vuoto: has joined #ruby
[15:41:16] ner: jhass: I need to map one virtual adress/value (i.e the value 7) to another (say 10)
[15:41:34] ner: with the restrictions involved in such a mapping
[15:41:43] mtkd: has joined #ruby
[15:41:46] ruby[bot]: it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[15:42:00] jhass: what's this for? what's the bigger picture?
[15:42:20] nersoh: has joined #ruby
[15:42:28] jhass: it seems you seek to solve something on a too low level for a language like Ruby
[15:43:20] ner: Mapp virtual rows on a screen
[15:44:13] ner: So if row 10 to 90 is shown row 1 on the screen points to 10 and so on
[15:44:14] LoneHermit: has joined #ruby
[15:44:42] jhass: can't you just use an array and an offset?
[15:44:47] QORRiE: has joined #ruby
[15:45:26] ner: jhass: Just for the storage, yes but there are a lot of restrictions
[15:45:44] xall: has joined #ruby
[15:45:48] davedev24: has joined #ruby
[15:45:50] ner: I.e two virtual rows can't point on the same row
[15:46:18] naftilos76: has joined #ruby
[15:48:17] ner: If anyone got any keywords to search that would be awesome. Can't find much …
[15:50:05] jhass: I would be surprised to find something tbh
[15:51:17] jhass: most people would consider it highly domain specific and you just happen to be able to map your highly domain specific problem to another highly domain specific but much lower level problem with for your usecase matching constraints
[15:51:37] jhass: Ruby is a pretty high level language and so is the thinking of the community
[15:54:48] ner: jhass: Thanks for your input. I'll continue my research
[15:55:10] daivyk: has joined #ruby
[15:56:06] Axy: has joined #ruby
[15:57:05] kavanagh: has joined #ruby
[15:58:57] aryaching: has joined #ruby
[16:00:02] zacts: has joined #ruby
[16:02:52] pawnbox: has joined #ruby
[16:03:21] DoubleMalt: has joined #ruby
[16:03:57] krobzaur: has joined #ruby
[16:04:06] araujo_: has joined #ruby
[16:08:20] karapetyan: has joined #ruby
[16:08:28] alfiemax: has joined #ruby
[16:09:06] macsteps: has joined #ruby
[16:09:18] Qommand0r: has joined #ruby
[16:10:02] Rodya_: has joined #ruby
[16:13:50] nanoz: has joined #ruby
[16:14:34] benlieb: has joined #ruby
[16:16:15] millerti: has joined #ruby
[16:16:47] minimalism: Is there a way to include text inside of a yield with erb so that it only appears if the attribute exists? (apologies if incorrect terminology) Example: <%= account.email "," %> so that the comma only appears if the email does?
[16:18:07] sdothum: has joined #ruby
[16:19:47] moeSeth: has joined #ruby
[16:20:12] banisterfiend: has joined #ruby
[16:21:22] minotep: has joined #ruby
[16:22:34] jhass: more context?
[16:23:22] jhass: <%= [account.email, account.name].compact.join(", ") %>
[16:24:03] soLucien: can't he do account.email + ',' ?
[16:25:08] Papierkorb: >> nil + ','
[16:25:09] soLucien: <%= account.email + ',' %>
[16:25:09] ruby[bot]: Papierkorb: # => undefined method `+' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/614743)
[16:25:22] Papierkorb: Or: ”No”
[16:29:22] Rodya_: has joined #ruby
[16:29:36] Derperperd: has joined #ruby
[16:29:49] astrobun_: has joined #ruby
[16:30:09] bluOxigen: has joined #ruby
[16:30:17] krobzaur: has joined #ruby
[16:31:50] nankyokusei: has joined #ruby
[16:33:29] xall: has joined #ruby
[16:33:29] macsteps: has joined #ruby
[16:33:50] Rodya_: has joined #ruby
[16:33:54] minimalism: jhass: Writing a template to display account information, and you know in the format of an address with "City, State" for exmaple.. the comma has to be there
[16:34:21] minimalism: I only want the comma to display if a specific attribute exists in the account, so it's not a stray "," in the template
[16:39:20] jenrzzz: has joined #ruby
[16:39:50] jhass: I would do <%= account_address(account) %> with def account_address(account); [account.city, account.state].compact.join(", "); end or so
[16:40:49] benlieb: has joined #ruby
[16:43:02] T2ya: has joined #ruby
[16:46:04] thinkvantage: has joined #ruby
[16:47:01] RegulationD: has joined #ruby
[16:47:16] houhoulis: has joined #ruby
[16:49:23] mustmodify: has joined #ruby
[16:49:37] xall: has joined #ruby
[16:50:20] mustmodify: Hey team Ruby. I'm reviewing some code from another dev. I know this is sort of tragic but I can't think of appropriate feedback other than "NO NO NO." Any help? https://gist.github.com/mustmodify/6cd83302af144a344694efc0ceed930a
[16:50:24] swills: has joined #ruby
[16:50:49] millerti: has joined #ruby
[16:52:00] mustmodify: Basically he has two modules that are included in a class. And whichever one runs first defines a method. And the second one appends to the method. I suspect he is trying to just keep the interface the same, which he happens. But it's so not worth the meta. But this guy loves meta, so that argument isn't going to fly with him.
[16:53:04] jhass: suggest prepend + super, it should still feel "cool"
[16:53:10] jhass: no other language has prepend
[16:53:39] harfangk: why is that dev doing this
[16:54:44] mustmodify: harfangk: Originally it was just one of those modules with that one method name. He's trying to preserve the interface.
[16:55:36] harfangk: couldn't he have refactored it to other kind of polymorphism
[16:56:15] mustmodify: He could have done a million things. But I need to specifically say "This is bad because... " rather than just "do it another way" otherwise I'm not helping, IMO.
[16:56:27] Spami: has joined #ruby
[16:56:49] cashnguns: has joined #ruby
[16:57:54] krobzaur: has joined #ruby
[16:59:01] RoYgBiV: has joined #ruby
[16:59:40] jhass: https://carc.in/#/r/154t
[16:59:57] jhass: it's bad because it's verbose and hard to follow
[17:00:06] jhass: it's no longer obvious where the method comes from
[17:00:59] jhass: it adds unused methods to the public interface of the class that potentially don't even have correct behavior when called
[17:01:05] sepp2k: has joined #ruby
[17:02:27] Rubie: has joined #ruby
[17:02:39] Es0teric: has joined #ruby
[17:03:24] Es0teric: has joined #ruby
[17:03:28] mustmodify: jhass: I knew about prepend but I hadn't looked at it as a way to avoid adding methods to the public interface.
[17:03:33] mustmodify: interesting.
[17:03:39] snowy: has joined #ruby
[17:04:05] Es0teric: has joined #ruby
[17:05:35] xall: has joined #ruby
[17:07:33] harfangk: mustmodify yeah my main gripe is that the method will be too inconsistent and context dependent
[17:08:15] nankyokusei: has joined #ruby
[17:08:38] harfangk: what would happen when there's a new module HasRefurbishedParts
[17:09:39] harfangk: you might as well make the order of inclusion some kind of race condition just to spice things up
[17:12:57] dhodgkin: has joined #ruby
[17:13:16] benlieb: has joined #ruby
[17:13:30] minotep: has joined #ruby
[17:14:27] dhodgkin: has joined #ruby
[17:15:31] _richardson_: has joined #ruby
[17:17:48] creaked: has joined #ruby
[17:20:14] thinkvantage: has joined #ruby
[17:21:00] phrozen77: has joined #ruby
[17:21:15] Dysp: has joined #ruby
[17:21:30] xall: has joined #ruby
[17:26:35] Dysp: I have an array: [[x], [y]]. Then I slice! x-array away and end up with [[y]]. How do I remove the outer array? [y] is a little more complicated, it is: [[1, 2, 3...], [4, 5, 6...]] and must stay like this.
[17:26:48] Devalo: has joined #ruby
[17:26:49] Dysp: I've tried flatten!, but doesn't seem to work out like I want.
[17:28:51] Dysp: Yes. I could do work arounds like that.
[17:29:17] toretore: why is it a workaround?
[17:29:17] Dysp: But, I wondered if there was any other ways of doing it.
[17:29:19] Papierkorb: Dysp: a.flatten(1)
[17:29:28] Dysp: Papierkorb: Unfortunately not
[17:30:52] Papierkorb: "Doesn't work" is never a valid problem description
[17:31:31] Dysp: [["hello"], [[1, 2, 3], [4, 5, 6]]] sliced into [[[1, 2, 3], [4, 5, 6]]]
[17:31:34] lupine: except for that one election poster
[17:31:44] Dysp: That was wrong
[17:31:49] Dysp: ["hello", [[1, 2, 3], [4, 5, 6]]] sliced into [[[1, 2, 3], [4, 5, 6]]]
[17:31:51] Dysp: Like that.
[17:32:17] cdg: has joined #ruby
[17:33:21] Rubie: has joined #ruby
[17:33:35] toretore: >> a=["hello", [[1, 2, 3], [4, 5, 6]]]; a.slice!(0,1); a
[17:33:36] ruby[bot]: toretore: # => [[[1, 2, 3], [4, 5, 6]]] (https://eval.in/614752)
[17:34:07] cdg_: has joined #ruby
[17:34:51] vuoto: has joined #ruby
[17:34:54] Dysp: What I am asking for is to remove the outer brackets, so you end up with an array of arrays.
[17:35:19] toretore: >> a=["hello", [[1, 2, 3], [4, 5, 6]]]; a.slice!(0,1); a.flatten!(1); a
[17:35:20] ruby[bot]: toretore: # => [[1, 2, 3], [4, 5, 6]] (https://eval.in/614753)
[17:35:36] dionysus69: has joined #ruby
[17:35:49] Dysp: Alrighty. What I thought too. Must be something else messing it up, then.
[17:35:52] Dysp: Thank you for clarifying
[17:36:04] Devalo: has joined #ruby
[17:36:30] LoneHermit: has joined #ruby
[17:36:34] kirun: has joined #ruby
[17:37:10] mfb2: has joined #ruby
[17:37:29] xall: has joined #ruby
[17:37:49] Synthead: has joined #ruby
[17:46:43] millerti: has joined #ruby
[17:47:44] Majost: Anyone know how to resolve this issue with Ruby 2.1.8? I tried updating rubygems to the latest, but it didn't seem to help. https://www.irccloud.com/pastebin/V7jeiXi0/
[17:47:45] ruby[bot]: Majost: we in #ruby do not like irccloud.com, I reposted your paste to gist for you: https://gist.github.com/6537c876d1fcb7c1d201dc575aee08b4
[17:47:45] ruby[bot]: Majost: irccloud.com has no syntax highlighting, distracting formatting and loads slowly for most.
[17:49:26] Majost: Side note, I think the bot is incorrect about the syntax highlighting in irccloud.
[17:51:28] jhass: the error is pretty clear, rack 2.0 needs Ruby 2.2
[17:51:35] ec\: has joined #ruby
[17:51:39] jhass: either upgrade ruby or use an older version of rack
[17:51:59] Majost: I am constrained by Chef at the moment.
[17:52:18] jhass: apparently not enough, complain to them to lock on rack < 2
[17:52:33] millerti: has joined #ruby
[17:52:42] jhass: or to whatever you're installing if it's isn't rack directly
[17:53:13] Majost: Thats the part which is a little odd
[17:53:29] xall: has joined #ruby
[17:53:30] Majost: I am trying to install the oauth2 gem, but it seems to be pretty loose on the deps
[17:54:52] jhass: https://github.com/intridea/oauth2/pull/226/files it actually intentionally supports rack 2
[17:55:03] jhass: use bundler to lock down the rack version < 2 explicitly
[17:56:43] Vingador: has joined #ruby
[17:56:54] Majost: That was the magic I was looking for
[17:56:57] Majost: thanks! =)
[17:57:11] lizard2010: has joined #ruby
[17:57:35] Majost: jhass: Side note - I know this is not the correct topic for the channel, but crystal looks interesting.
[17:58:00] jhass: We got a #crystal-lang ;)
[17:59:32] PlasmaStar: has joined #ruby
[18:00:38] craigp: has joined #ruby
[18:02:42] PlasmaStar: has joined #ruby
[18:02:49] hipertracker: has joined #ruby
[18:03:29] jaguarmagenta: has joined #ruby
[18:04:16] millerti: has joined #ruby
[18:07:09] jaguarma_: has joined #ruby
[18:09:25] xall: has joined #ruby
[18:09:54] zacts: has joined #ruby
[18:10:06] karapetyan: has joined #ruby
[18:10:16] craysiii: has joined #ruby
[18:10:56] shaman42: has joined #ruby
[18:11:32] jaguarmagenta: has joined #ruby
[18:15:11] solars: has joined #ruby
[18:17:51] RegulationD: has joined #ruby
[18:18:26] aphprentice: has joined #ruby
[18:19:26] jaguarmagenta: has joined #ruby
[18:19:49] elifoster: has joined #ruby
[18:22:39] jaguarma_: has joined #ruby
[18:23:55] d0nn1e: has joined #ruby
[18:25:21] xall: has joined #ruby
[18:25:38] shaman42: has joined #ruby
[18:27:56] karapetyan: has joined #ruby
[18:28:22] AzureStigma: has joined #ruby
[18:28:34] jaguarmagenta: has joined #ruby
[18:31:30] millerti: has joined #ruby
[18:32:56] d0nn1e: has joined #ruby
[18:37:59] allcentury: has joined #ruby
[18:40:01] hipertracker: has joined #ruby
[18:40:18] ledestin: has joined #ruby
[18:40:42] jenrzzz: has joined #ruby
[18:40:42] jenrzzz: has joined #ruby
[18:44:18] hipertracker: has joined #ruby
[18:46:05] roflmyeggo: has joined #ruby
[18:48:59] AzureStigma: has joined #ruby
[18:54:38] k3rn31: has joined #ruby
[18:55:28] AzureStigma: has joined #ruby
[18:57:09] dtoast: has joined #ruby
[18:59:06] LoneHermit: has joined #ruby
[18:59:36] FastJack: has joined #ruby
[19:01:38] ecnalyr: has joined #ruby
[19:04:22] CodingWolf: has joined #ruby
[19:04:24] Rubie: has joined #ruby
[19:10:32] chipotle: has joined #ruby
[19:11:09] memorasus: has joined #ruby
[19:12:11] AzureStigma: has joined #ruby
[19:12:44] tvw: has joined #ruby
[19:12:47] memorasus1: has joined #ruby
[19:13:13] xall: has joined #ruby
[19:17:00] LoneHerm_: has joined #ruby
[19:18:39] krobzaur: has joined #ruby
[19:19:12] AzureStigma: has joined #ruby
[19:21:56] hahuang61: has joined #ruby
[19:23:06] mikeiniowa: has joined #ruby
[19:24:44] MadGrin: has joined #ruby
[19:24:50] JeanCarloMachado: has joined #ruby
[19:27:28] zeroDi: has joined #ruby
[19:29:03] AzureStigma: has joined #ruby
[19:29:08] xall: has joined #ruby
[19:29:54] johnmilton: has joined #ruby
[19:30:58] ruby[bot]: -b coe!*@*$#ruby-banned
[19:31:18] gregf: has joined #ruby
[19:33:28] MadGrin: has joined #ruby
[19:33:48] RegulationD: has joined #ruby
[19:35:01] nankyokusei: has joined #ruby
[19:35:25] Madplatypus: has joined #ruby
[19:40:37] nando293921: has joined #ruby
[19:41:42] gregf: has joined #ruby
[19:43:53] benlieb: has joined #ruby
[19:47:00] Derperperd: has joined #ruby
[19:47:26] macsteps: has joined #ruby
[19:49:49] gregf: has joined #ruby
[19:55:37] yqt: has joined #ruby
[19:55:59] lxsameer: has joined #ruby
[19:56:16] krobzaur: has joined #ruby
[19:56:21] ec\: has joined #ruby
[19:58:36] gregf: has joined #ruby
[19:59:05] leightski: has left #ruby: ()
[19:59:23] alfiemax: has joined #ruby
[20:00:52] pawnbox: has joined #ruby
[20:01:19] killerkamel: has joined #ruby
[20:02:39] flashpoint9: has joined #ruby
[20:04:37] sagax: has joined #ruby
[20:07:07] chipotle: has joined #ruby
[20:11:25] al2o3-cr: has joined #ruby
[20:11:53] diegoviola: has joined #ruby
[20:11:56] soLucien: can a .gemspec "wrap" files that are not necessarily in the ./ directory ?
[20:13:28] soLucien: i have a external module which is located in another folder (../../packages/my-external dependency). I want this to be included in the .gem file in lib/driver
[20:13:32] soLucien: is this possible ?
[20:13:48] soLucien: or should i copy the files into /lib/driver first
[20:14:06] soLucien: then run gem build
[20:14:36] jhass: given files is an array and not a hash, I don't see how rubygems would magically know that you want them in lib/driver
[20:15:04] Macaveli: has joined #ruby
[20:15:54] bluOxigen: has joined #ruby
[20:16:33] soLucien: alright, so copy the external lib at build-time before running gem build
[20:17:40] Rubie: has joined #ruby
[20:17:52] al2o3-cr: has joined #ruby
[20:17:53] soLucien: so they have to be part of s.files
[20:18:36] soLucien: i do s.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
[20:19:06] jhass: yeah, hate that pattern
[20:19:08] soLucien: so then i either add them to git as well (nope)
[20:19:10] toretore: what's with this git ls-files thing
[20:19:11] yardenbar: has joined #ruby
[20:19:17] gregf: has joined #ruby
[20:19:18] jhass: bundler's idea
[20:19:34] toretore: shoulda known
[20:20:16] jhass: s.files = Dir["lib/**/*.{rb,so,dylib}"]
[20:21:47] haxrbyte: has joined #ruby
[20:23:23] aeterne: has joined #ruby
[20:25:01] soLucien: Dir['lib/driver/**'] + Dir['lib/**/*.{rb,erb}']
[20:25:03] yqt: has joined #ruby
[20:25:08] soLucien: and i'm still not happy
[20:25:30] jhass: Dir::[] takes more than one argument iirc
[20:25:46] soLucien: driver/ contains .dll, .ini, .ps1 and others
[20:25:53] soLucien: and it may change without notice
[20:26:04] soLucien: so i don't want to keep track of file extensions in my .gemspec
[20:26:12] soLucien: whenever the driver version changfes
[20:26:54] jhass: Dir["lib/driver/*", "lib/**/*.{rb,erb}"]
[20:27:08] soLucien: yes i did that
[20:27:14] leea: has joined #ruby
[20:27:44] soLucien: cool thanks
[20:28:00] kavanagh: has joined #ruby
[20:28:08] soLucien: dependency on git was a pain in the ass .. had to commit if i added a new file/changed folder structure
[20:29:34] karapetyan: has joined #ruby
[20:29:47] craysiii: has joined #ruby
[20:29:48] nettoweb: has joined #ruby
[20:30:36] JakeP: has joined #ruby
[20:32:19] Rodya_: has joined #ruby
[20:34:14] JakeP: Is anyone able to help me with what seems like a simple issue I'm having with interpolation, trying to add an integer into a string which would increment every loop cycle. It's changing a username by 1 each time, for example Jake1 would change to Jake2, then Jake3, etc.
[20:34:43] jhass: >> "Jake1".succ
[20:34:44] ruby[bot]: jhass: # => "Jake2" (https://eval.in/614826)
[20:37:06] LoneHermit: has joined #ruby
[20:38:44] JakeP: So would it be right for my username string to look like: username = "Jake1".succ to be called further down in my program?
[20:39:33] ur5us: has joined #ruby
[20:42:30] jenrzzz: has joined #ruby
[20:42:35] symm-: has joined #ruby
[20:43:17] Chris3y_RubyNewb: has joined #ruby
[20:43:35] jondot: has joined #ruby
[20:43:43] toretore: JakeP: give more details about what you're trying to do
[20:45:04] JakeP: Sorry, basically I'm trying to loop through a sign up process with the username starting at Jake1, signing up then finishing the loop. As it starts again, the username should be Jake2 while the process completes, etc.
[20:45:41] jhass: show what you have and what it produces instead of the desired result
[20:46:08] sagax: your need a tests
[20:46:29] macsteps: has joined #ruby
[20:48:07] JakeP: https://gist.github.com/anonymous/219cfe34ce81ee3fdcb8f516acdbe99a
[20:49:07] JakeP: The code on line 59 to 63 is what sets the current login details, but when trying many different methods of interpolating the integer into the string, it just causes the program to hang
[20:50:09] toretore: you have to change user to $user
[20:50:14] toretore: that way it'll work
[20:50:16] al2o3-cr: has joined #ruby
[20:50:31] JakeP: Oh really? Wow, have I really been missing something so simple?
[20:50:53] toretore: and put the $user = "O9kG1" at the top
[20:52:37] JakeP: That gives me an undefined local variable
[20:57:46] millerti: has joined #ruby
[20:59:44] freerobby: has joined #ruby
[20:59:54] Dimik: has joined #ruby
[21:00:44] JakeP: I did change the #{user.succ} to #{$user.succ} which would be right when referencing the global variable, right? That gave me an error with succ.
[21:03:46] gregf: has joined #ruby
[21:05:20] xpitr: JakeP that while !email_arrived loop is deadly
[21:05:25] JakeP: Okay the succ error has gone, but the program still hangs when it gets to that part.
[21:05:27] xpitr: maybe thats where it hangs
[21:05:47] Guest34914: has joined #ruby
[21:05:54] xpitr: yes, it will absolutely flood the server, and only sleep if it errors
[21:06:02] leea: has joined #ruby
[21:06:18] JakeP: Ah wow, I did not know that! Any idea how I can make that less intensive?
[21:06:34] xpitr: sleep after/before open()
[21:06:44] JakeP: Ohh that makes sense
[21:07:07] JakeP: Thanks for that, I'd not have spotted that issue!
[21:07:11] vdamewood: has joined #ruby
[21:07:55] soLucien: what's the best place to see the ruby api ?
[21:07:57] xpitr: anyways the main problem i think is that you set user = "something" and then immediately call succ on it
[21:08:08] jhass: soLucien: I like devdocs.io
[21:08:11] xpitr: this works, but next time you call it you again set it to something and again call succ on original string
[21:08:20] xpitr: with each loop it ends up with the same result because it has the same input
[21:09:41] JakeP: Ohh, I did try using i = 0 then using username = "O9kG#{(i += 1).to_s}" to no avail, I'm guessing that would pretty much do the same thing when it loops round though..
[21:10:00] soLucien: i found this for Vagrant http://www.rubydoc.info/github/mitchellh/vagrant/Vagrant/Action/Builder
[21:10:07] xpitr: you can make create_account method take 1 argument and add that to user. eg. def create_account(id) ..... user = "foobar#{id}" . and then in the loop where you call that method, add counter there
[21:10:35] JakeP: I'll give that a try, that makes much more sense! Many thanks
[21:10:44] xpitr: you even have counter variable already
[21:10:55] xpitr: just pass it to the method
[21:11:10] JakeP: Yeah, shouldn't be too difficult, thank you :)
[21:11:21] JakeP: It's been eating at my brain all afternoon haha
[21:16:45] Devalo: has joined #ruby
[21:17:16] johnmilton: has joined #ruby
[21:18:34] zyriuse: has joined #ruby
[21:19:32] bmurt: has joined #ruby
[21:21:06] JakeP: Sorry to be a pest, but I gave the method an argument of (id = 0) as it complained at just (id), which made me assume I had to give it a default value (which would also change with the counter, right?) and I receive no errors, yet my program still hangs before finishing the create_account method
[21:23:36] ruid: has joined #ruby
[21:24:07] Guest92294: has joined #ruby
[21:25:42] zyriuse: i dont understand why i get this error in my code ?
[21:25:44] zyriuse: https://gist.github.com/zyriuse75/c54cea0b789a963e0d7769ab94c7b8f2
[21:26:04] zyriuse: i dont see my error
[21:27:25] JakeP: The only thing I see is, if(defined?(mysql_select).nil? does not have a closing parenthesis
[21:27:40] ur5us: has joined #ruby
[21:27:59] NightMonkey: has joined #ruby
[21:28:01] zyriuse: JakeP: lol...
[21:28:10] zyriuse: i really need to go to sleep
[21:28:14] Papierkorb: JakeP: I do see a redundant opening parantheses :P
[21:28:14] zyriuse: loll.......
[21:28:19] nertzy: has joined #ruby
[21:28:44] JakeP: I didn't read the code, I just scanned through to find the missing, or should I say offending parenthesis :P
[21:29:08] zyriuse: thk men ;)
[21:29:18] JakeP: No problem, a second set of eyes is always good.
[21:30:34] JakeP: Just a shame I can't see why my own code won't work, an error code would make things so much easier..
[21:31:16] Papierkorb: JakeP: Use rubocop, your text editor of choice most likely has an integration for it available
[21:31:37] Rubie: has joined #ruby
[21:31:39] jaguarmagenta: has joined #ruby
[21:33:14] JakeP: I'm fairly new to Ruby, so I'll have to look up an IDE to use Rubocop with, I've just been using notepad++ for my editing needs haha
[21:33:16] macsteps: has joined #ruby
[21:33:54] Papierkorb: JakeP: try Atom Editor
[21:34:02] JakeP: I will do, thank you
[21:34:37] RegulationD: has joined #ruby
[21:35:49] nankyokusei: has joined #ruby
[21:37:44] tAn: has joined #ruby
[21:40:15] Davedev28: has joined #ruby
[21:41:19] pandaant: has joined #ruby
[21:42:46] MarkBilk: has joined #ruby
[21:43:15] jenrzzz: has joined #ruby
[21:44:30] Mirubiri: has joined #ruby
[21:46:37] workmad3: has joined #ruby
[21:46:55] hahuang61: has joined #ruby
[21:48:55] karapetyan: has joined #ruby
[21:48:56] Chris3y_RubyNewb: what's everyones opinion on using () when passing args to methods or class initializers? I come from c# so feel most comfortable using them with commas. Should I try to adopt no parenthesis and use space delimiters instead while learning ruby? The dilema I have is sometiems it looks really nice without them and others it looks really clear with them. Is consistency important in your view? As in,
[21:48:56] Chris3y_RubyNewb: should I pick one and stick with it or go with whatever feels better at the time?
[21:49:21] davedev24: has joined #ruby
[21:49:29] Papierkorb: Chris3y_RubyNewb: you still use commas in ruby
[21:50:10] toretore: Chris3y_RubyNewb: if in doubt, add (), except for empty arg list
[21:50:16] Papierkorb: Chris3y_RubyNewb: If given the choice, I use what I think looks nicer
[21:50:16] jaguarmagenta: has joined #ruby
[21:50:51] Chris3y_RubyNewb: nicer at the time?
[21:50:58] toretore: yes, sometimes () looks better, other times not
[21:51:16] Chris3y_RubyNewb: and it's not some horrendous faux par to mix and match?
[21:51:51] Papierkorb: Not really, no
[21:52:00] toretore: there are two cases that never look good: `obj.method()` and `def method arg1, arg2`
[21:52:22] Papierkorb: except for `super()`
[21:52:26] Mirubiri: yes, I agree with toretore
[21:52:43] Mirubiri: I use always () for method definitions
[21:52:52] LoneHerm_: has joined #ruby
[21:53:27] yxhuvud: ACTION prefer def foo bar, baz=wat
[21:53:39] toretore: old school style
[21:53:56] Papierkorb: unpopular opinion, quick, downvooooote!
[21:54:03] Papierkorb: Oh, wrong platform
[21:54:05] yxhuvud: yeah well, it'd be baz: wat using keywords
[21:54:09] Chris3y_RubyNewb: ok that makes sense and I had come to the same conclusion with def method I'm just trying to be open minded as possible and feel the need to question this stuf!
[21:54:17] Chris3y_RubyNewb: you people are a god-send :)
[21:54:21] toretore: there's a lot of weird old japanese code that uses it
[21:54:29] kriskropd: has joined #ruby
[21:54:36] Papierkorb: >> god.send(:"#ruby")
[21:54:37] ruby[bot]: Papierkorb: # => undefined local variable or method `god' for main:Object (NameError) ...check link for more (https://eval.in/614833)
[21:55:26] JakeP: Rip, rubocop doesn't like tabs.
[21:55:37] toretore: nobody likes tabs
[21:55:57] Papierkorb: JakeP: Ruby as a community only uses 2-spaces for indention
[21:56:02] JakeP: Coming from Java quite a long time ago, it was just habit. haha
[21:56:09] Papierkorb: If there is one thing everyone agrees on, it's this one rule. 2 spaces.
[21:56:21] JakeP: Time to replace all tabs with 2 spaces.
[21:56:52] JakeP: Not sure how to apply that
[21:57:23] Papierkorb: ah well, just use your text editors search and replace functionality if it doesn't have something to replace the current indention
[21:57:43] JakeP: Understood :P
[21:58:45] ecnalyr: has joined #ruby
[22:00:58] karapetyan: has joined #ruby
[22:01:37] banisterfiend: has joined #ruby
[22:02:26] nankyokusei: has joined #ruby
[22:02:41] ytti_: gg=G in vim
[22:02:49] ytti_: to reindent whole file
[22:05:37] nankyoku_: has joined #ruby
[22:05:41] ensyde: has joined #ruby
[22:06:52] Chris3y_RubyNewb: JakeP - the sublime text editor will save you a lot of time for that :)
[22:06:54] cdg: has joined #ruby
[22:07:09] Chris3y_RubyNewb: in bottom right you can easily convert tabs to spaces (and set amount) etc
[22:07:24] JakeP: Already done it, just used alt code 09 then two spaces with find and replace, worked fine xD
[22:07:49] davedev24: has joined #ruby
[22:08:51] moneylotion: has joined #ruby
[22:08:54] moneylotion: has joined #ruby
[22:10:15] Guest34914: has joined #ruby
[22:11:15] pickandmix: has joined #ruby
[22:12:44] karapetyan: has joined #ruby
[22:14:00] symm-: has joined #ruby
[22:18:20] zacts: has joined #ruby
[22:18:51] JakeP: So I've cleaned up my code, fixed errors with spacing/whitespace, extra lines, etc. but I still can't fix my issue hahaha
[22:19:33] nankyokusei: has joined #ruby
[22:19:54] jaguarmagenta: has joined #ruby
[22:20:24] jottr: has joined #ruby
[22:20:24] pickandmix: has joined #ruby
[22:21:00] pickandmix: Guys, I'm trying to use rvm to install ruby version 2.1, but after installing I get this issue http://codepad.org/FWz0WKvp
[22:21:09] pickandmix: it conflicts with weechat somehow, can anyone help?
[22:22:04] jottr: has joined #ruby
[22:23:21] Chris3y_RubyNewb: missing end tags are the worst :z
[22:23:52] sleepee: has joined #ruby
[22:24:47] JakeP: Yes, they are. I remember good old 100 errors in java compilers due to missing end tags.
[22:25:32] cyphase: has joined #ruby
[22:26:37] dreamyspell: has joined #ruby
[22:26:43] JakeP: Guys, why can't I use a global variable with a counter that increments said variable, interpolated within a string.. It does nothing, no errors, it still just hangs my program :(
[22:33:06] JeanCarloMachado: has joined #ruby
[22:34:17] JakeP: Can't even use constant variables with a counter, referenced in my string D:
[22:36:42] cdg: has joined #ruby
[22:37:59] dreamyspell: JakeP: if you've already interpolated the variable, you've converted it to a string and since it's no longer an integer, you can't increment it the same way. using constants for this is farther away from what you want, because a constant is never supposed to change.
[22:38:07] skade: has joined #ruby
[22:38:46] SuperLag: has joined #ruby
[22:38:54] SuperLag: has joined #ruby
[22:38:57] Yacker: has joined #ruby
[22:39:09] JakeP: Yeah, I thought as much. Are you able to shed some light on my issue? I've exhausted everything I can think of so far.
[22:39:25] SuperLag: has joined #ruby
[22:41:21] JakeP: https://gist.github.com/anonymous/141b70887fa594962364aff10c002e08 This is my code so far
[22:41:26] jaguarma_: has joined #ruby
[22:42:16] JeanCarloMachado: has joined #ruby
[22:42:16] JakeP: Lines 9, 58 and 174 are the three that need addressing
[22:43:39] chipotle: has joined #ruby
[22:43:46] T2ya: has joined #ruby
[22:43:47] qguv: has joined #ruby
[22:44:00] dreamyspell: JakeP: undefined local variable or method `integer' for main:Object -- is this the kind of error you're seeing?
[22:44:27] JakeP: Nope, I receive no errors at all, just the program hangs when it comes to the username
[22:44:37] sarbs: has joined #ruby
[22:44:49] JakeP: If it would give me an error, I'd sort of know where to look, but I get no indication
[22:45:29] Mirubiri: has joined #ruby
[22:46:28] JakeP: It's like, I can put random numbers after the username without any issues, but as soon as I want it to count from 1 to 100 as a suffix, it hangs..
[22:47:38] JakeP: username = "O9kG#{5.times.map{ Random.rand(9) }.join}" is how I would do my random sequence of numbers trailing the username, but it's far from clean when it comes to knowing the login details
[22:47:42] hahuang61: has joined #ruby
[22:48:17] dreamyspell: JakeP: i think it's because it's a global variable, lemme check something
[22:48:26] sarbs: has joined #ruby
[22:49:18] soLucien: ok i have a external package that i want to bundle together with my gem
[22:49:30] soLucien: what's the convention for this kind of package? Where is it stored?
[22:49:30] LoneHerm_: has joined #ruby
[22:50:02] soLucien: is it inside the lib folder, or outside ? a vendor folder of some sort ?
[22:50:34] dreamyspell: use your Gemfile to define dependencies
[22:50:53] soLucien: this dependency is a .nupkg
[22:51:23] soLucien: i am sure the dependency resolver cannot resolve nuget packages
[22:51:28] JakeP: dreamyspell: I've tried all sorts, it needs to save the incremented number after every loop, hence the counter, but I can't reference a standard counter in another block.
[22:51:40] dreamyspell: ah, dunno then, soLucien
[22:51:44] soLucien: so what i do i copy it into a folder at build time
[22:51:58] soLucien: just wondering what that folder should be
[22:52:16] akkad: has joined #ruby
[22:53:08] soLucien: fine, i'll place it in lib/driver
[22:53:10] dreamyspell: JakeP: i think it's hanging before line 174, i put a message *before* the increment line and it did not print
[22:53:40] JakeP: Yeah, it's line 58 where it hangs
[22:53:51] kobain: has joined #ruby
[22:54:05] dreamyspell: ah, for me it's 96, because of the rescue block being triggered
[22:54:24] jhack: has joined #ruby
[22:54:46] dreamyspell: but you're right, it does hang after 58
[22:55:06] jaguarmagenta: has joined #ruby
[22:55:49] gregf: has joined #ruby
[22:56:52] memorasus1: has joined #ruby
[22:57:36] synaps3: has joined #ruby
[22:57:36] JakeP: dreamyspell: it's just really confusing me.. I may not have much Ruby experience, but I know other languages pretty well, and this just doesn't add up for me xD
[22:57:38] Es0teric: has joined #ruby
[22:58:28] dreamyspell: i'm not really sure what's up either, sorry. i'm still the beginner myself
[22:59:11] AndyBotwin: has joined #ruby
[23:00:10] pickandmix: has joined #ruby
[23:00:28] dreamyspell: sorry JakeP, i hoped i could help figure it out. maybe someone else will have better luck
[23:00:33] JakeP: It's all good, I really appreciate your help anyway :)
[23:06:34] pickandmix: anyone using arch linux with rvm?
[23:06:49] pickandmix: does rvm use weechat or smth? Why is it that I'm getting errors in the rvm code with regards to weechat.
[23:10:02] nertzy: has joined #ruby
[23:10:33] helllojesus12: has joined #ruby
[23:10:35] zacts: has joined #ruby
[23:12:39] MadGrin: has joined #ruby
[23:13:14] MarkBilk: has joined #ruby
[23:13:43] JeanCarloMachado: has joined #ruby
[23:15:34] hammond: I find ruby to be slow
[23:15:52] zacts: hammond: for what application?
[23:15:53] hammond: I'm trying to take input abut it takes forever and isn't blitz fast
[23:16:03] zacts: what kinds of input?
[23:16:12] hammond: simple one. mine, i have a loop that takes user input, just a string.
[23:16:32] zacts: hammond: well if you are serious, there are ways to buffer input
[23:16:44] hammond: how? I am serious
[23:16:55] zacts: hammond: ok, so what kind of input is it?
[23:17:03] zacts: is it a comma separated value list?
[23:17:06] zacts: is it structured data?
[23:17:14] zacts: is it a string of bytes?
[23:17:22] hammond: I'm using gets to take a simple string like "isConnected"
[23:17:31] hammond: string of chars
[23:17:35] OTORelic: has joined #ruby
[23:17:51] zacts: hammond: would you mind, or are you able to paste any code into a pastebin?
[23:18:05] hammond: let me try
[23:18:22] Devalo: has joined #ruby
[23:20:04] zacts: (note: I didn't mean for that to sound rude. :-))
[23:20:09] zacts: I'm just super multi-tasking right now
[23:21:59] solars: has joined #ruby
[23:22:46] hammond: zacts: http://pastebin.com/b5kKUW5h ok i jst pasted a proto-type i don't want to hear I'm a evil coder.
[23:22:47] ruby[bot]: hammond: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/08399404709cb88b7fe89bd507ccaf90
[23:22:49] ruby[bot]: hammond: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[23:23:07] hammond: I will use GIST next
[23:24:04] hammond: the loop calls functions of threaded Socket classes that aquired connection, but simply inputing the command is a slow process. idk
[23:24:44] sleepee: has joined #ruby
[23:25:46] matthewd: hammond: Can you clarify 'slow'? Is that script, as pasted, 'slow'?
[23:27:07] OTORelic: has joined #ruby
[23:28:15] sleepee: has joined #ruby
[23:28:57] d0nn1e: has joined #ruby
[23:29:49] c355E3B: has joined #ruby
[23:33:27] hipertracker: has joined #ruby
[23:34:50] koooge: has joined #ruby
[23:35:28] RegulationD: has joined #ruby
[23:40:32] byteflame: has joined #ruby
[23:41:30] MarkBilk: has joined #ruby
[23:41:53] hipertracker: has joined #ruby
[23:42:35] karapetyan: has joined #ruby
[23:43:56] Madplatypus: has joined #ruby
[23:47:42] leea: has joined #ruby
[23:49:10] CloCkWeRX: has joined #ruby
[23:50:21] rain1: has joined #ruby
[23:50:34] rain1: my ruby pogram is in an infinite loop, when I hit control C it just quits
[23:50:35] agent_white: has joined #ruby
[23:50:40] rain1: is there a way to find out where it was stuck instead?
[23:56:58] ec0: has joined #ruby
[23:59:48] tmtwd: has joined #ruby