« Back to channel list

#ruby - 16 March 2016

« Back 1 day Forward 1 day »
[00:00:10] godzillaenlacasa: has joined #ruby
[00:01:18] sp4rrow: has joined #ruby
[00:01:53] pawnbox: has joined #ruby
[00:06:10] stannard: has joined #ruby
[00:06:39] [gmi]: has joined #ruby
[00:08:04] mleung: has joined #ruby
[00:14:10] ensyde__: has joined #ruby
[00:14:47] dling: has joined #ruby
[00:15:36] jkahn: has joined #ruby
[00:16:45] linoj: has joined #ruby
[00:17:59] binaryplease1: has joined #ruby
[00:19:27] Abrin_AWAY2: has joined #ruby
[00:22:44] binaryplease: has joined #ruby
[00:24:34] tummy: has joined #ruby
[00:24:50] trosborn: has joined #ruby
[00:27:00] sneakerhax: has joined #ruby
[00:27:11] vikas027: has joined #ruby
[00:27:16] hahuang65: has joined #ruby
[00:27:56] ben_vulpes: has joined #ruby
[00:28:45] d0nn1e: has joined #ruby
[00:29:12] Don_John: has joined #ruby
[00:29:16] ben_vulpes: i have a the dumb question: would like to run a gem with a specific, non-system version of ruby on a server. would really like to not use rbenv or the like, because this is going to get called via shelling out from another language entirely. is there a decent way to get a ruby (say 2.3.0) on a system and then `/opt/the-ruby-i-want gem *args`?
[00:31:20] Ox0dea: ben_vulpes: https://github.com/postmodern/ruby-install
[00:32:13] havenwood: ben_vulpes: +1 ruby-install
[00:33:33] robbyoconnor: has joined #ruby
[00:33:56] Don_John_: has joined #ruby
[00:34:11] ruby-lang188: has joined #ruby
[00:34:22] ruby-lang188: Does anyone know how to install reuters models for the treat gem?
[00:34:47] skweek: has joined #ruby
[00:36:02] marchelzo: has joined #ruby
[00:36:21] havenwood: ruby-lang188: see if this comment or followup are relevant: https://github.com/louismullie/treat/issues/7#issuecomment-5639192
[00:37:56] marchelzo: hi could someone write a program in ruby that reads from stdin line by line, splits the line on whitespace, filters to keep only words matching /\w+/, and increments the value in a hashmap with that word as the key. then at the end, print the top 10 words in the format '<word>: count'
[00:38:28] Ox0dea: marchelzo: You could! :)
[00:38:37] Ox0dea: Sounds like you've got all the ingredients.
[00:38:50] marchelzo: Ox0dea: I don't know ruby very well
[00:39:02] Ox0dea: marchelzo: But it seems you know it enough.
[00:39:33] marchelzo: I want to make sure it's written in an idiomatic style, because I'd like to compare its performance against implementations in a couple of other languages.
[00:39:42] ruby-lang188: Thanks for responding havenwood. That website is currently down. Would you happen to know anywhere else I could get those files?
[00:39:47] marchelzo: I will write one, and could you tell me if it looks good?
[00:40:02] ruby-lang188: Also there isn't an archive on account of the robots.txt for that site so thats a no go
[00:40:15] Ox0dea: marchelzo: Sounds good.
[00:40:46] fullofca_: has joined #ruby
[00:40:47] Ox0dea: marchelzo: If you're familiar with Python's defaultdict, we just pass a value to Hash.new to get (roughly) the same semantics in Ruby.
[00:41:15] marchelzo: I used defaultdict(int) for the python implementation :)
[00:41:27] Ox0dea: marchelzo: That'll be `Hash.new(0)` in the Ruby one. :)
[00:41:39] havenwood: marchelzo: Check in here with Gists if you run into problems!
[00:42:46] d0nn1e: has joined #ruby
[00:43:26] havenwood: Or questions or whatever else.
[00:43:52] bronson: has joined #ruby
[00:44:44] havenwood: ruby-lang188: Nope, sorry I don't.
[00:45:16] ruby-lang188: Ah, thanks anyway
[00:45:16] swills: has joined #ruby
[00:47:14] CloCkWeRX: has joined #ruby
[00:47:56] sapslaj: has joined #ruby
[00:48:45] tenderlove: has joined #ruby
[00:49:44] fullofcaffeine: has joined #ruby
[00:49:54] marchelzo: How does this look? http://sprunge.us/giBF?ruby
[00:50:06] Moosashi: has joined #ruby
[00:50:13] stannard: has joined #ruby
[00:51:28] pawnbox: has joined #ruby
[00:51:41] CloCkWeRX: has left #ruby: ()
[00:51:54] drbrain: marchelzo: looks good
[00:52:29] marchelzo: is there anything I could do to significantly increase performance?
[00:52:31] cdg: has joined #ruby
[00:52:32] ben_vulpes: Ox0dea: how does one then execute a gem with a specific version of ruby? $HOME/.rubies/.../ruby $(which my-gem) doesn't work as expected.
[00:52:50] gbgdev_: has joined #ruby
[00:53:19] diegoviola: has joined #ruby
[00:53:29] drbrain: ben_vulpes: if the gem is installed in a version-specific ruby directory you'll need to set GEM_HOME too
[00:53:30] marchelzo: I changed the sort_by to sort_by! and it takes slightly longer. That is odd, isn't it?
[00:53:51] ben_vulpes: drbrain: nah it's in /usr/local/bin
[00:54:00] Ox0dea: marchelzo: You might not be benchmarking properly.
[00:54:03] drbrain: ben_vulpes: the executable is, but the library stuff
[00:54:30] ben_vulpes: li...brary stuff?
[00:54:32] drbrain: marchelzo: you can get another speed boost by using String#scan
[00:54:45] marchelzo: drbrain: ah, good idea
[00:54:54] drbrain: ben_vulpes: the executable is a stub that points into the gem install directory
[00:55:05] drbrain: where the, err, "library stuff" exists
[00:55:10] Xeago: has joined #ruby
[00:55:35] marchelzo: wow, that's a _huge_ speed up
[00:56:00] drbrain: yeah, you don't create nearly as many objects that way
[00:56:41] ben_vulpes: drbrain: so GEM_HOME needs to be ~/.rubies/2.3.0/<whatnow?>
[00:57:21] drbrain: ben_vulpes: `gem env home` with the ruby you used to install the gem will spit out the right value
[00:58:01] drbrain: marchelzo: you might get another speed boost by replacing L10 with ws = d.sort_by { |w,| -d[w] }
[00:58:05] ben_vulpes: i should probably rip that gem out and reinstall it with the correct version of ruby though, right?
[00:58:10] Radar: How do I get BigDecimal to show me the "full" version of it?
[00:58:18] Radar: >> 12971293712871239871239871239817239.to_d
[00:58:19] ruby[bot]: Radar: # => undefined method `to_d' for 12971293712871239871239871239817239:Bignum ...check link for more (https://eval.in/537218)
[00:58:26] Radar: >> require 'bigdecimal/util'; 12971293712871239871239871239817239.to_d
[00:58:27] ruby[bot]: Radar: # => undefined method `BigDecimal' for 12971293712871239871239871239817239:Bignum (NoMethodError) ...check link for more (https://eval.in/537219)
[00:58:35] marchelzo: drbrain: what does that do?
[00:58:41] Radar: ruby[bot]: I thought you loved me :(
[00:58:51] havenwood: >> require 'bigdecimal'; require 'bigdecimal/util'; 12971293712871239871239871239817239.to_d
[00:58:52] ruby[bot]: havenwood: # => #<BigDecimal:40597a78,'0.1297129371 2871239871 2398712398 17239E35',36(45)> (https://eval.in/537220)
[00:58:58] drbrain: ben_vulpes: it would make your life easier
[00:59:01] ramortegui: has joined #ruby
[00:59:17] ben_vulpes: sure great next step telling gem to use the new ruby
[00:59:48] drbrain: marchelzo: d.keys.sort_by makes a new Array with all the keys in it then sorts that
[01:00:13] drbrain: d.sort_by avoids that
[01:00:14] Didac: has joined #ruby
[01:00:39] marchelzo: drbrain: I see, and the comma just means "ignore the value" in the block?
[01:00:56] drbrain: I think it returns an array of arrays, so line 12 would change too, to: do |word, count|
[01:01:01] drbrain: marchelzo: correct
[01:02:33] crowell: has joined #ruby
[01:02:35] [gmi]: has joined #ruby
[01:03:14] havenwood: Radar: What would the full output be? Like a String representation that included all the decimal digits?
[01:03:22] Radar: havenwood: yes
[01:03:46] Ox0dea: marchelzo: My take: https://eval.in/537222
[01:03:55] Ox0dea: Radar: Isn't that what `to_s('F')` is for?
[01:04:16] Gmi_: has joined #ruby
[01:04:28] Radar: Ox0dea: I love you (in a purely platonic way)
[01:05:38] graffix: has joined #ruby
[01:05:44] aaeron: has joined #ruby
[01:06:21] sp4rrow_: has joined #ruby
[01:06:33] diegoviola: has joined #ruby
[01:06:35] marchelzo: Ox0dea: very nice
[01:06:56] Us54er: has joined #ruby
[01:08:13] aaeron: has joined #ruby
[01:08:19] rkazak: has joined #ruby
[01:08:52] Xeago: has joined #ruby
[01:09:07] `tim`: has joined #ruby
[01:09:17] chouhoulis: has joined #ruby
[01:09:37] Ox0dea: Performance-wise, there's nothing to be done for it that wouldn't violate Knuth's premature optimization rule.
[01:10:04] marchelzo: scan vs splt then filter is huge
[01:10:18] jkahn: has joined #ruby
[01:10:22] Ox0dea: If your input was massive, it might be worth maintaining some kind of sliding window into the ten most frequent words.
[01:10:24] Mon_Ouie: has joined #ruby
[01:10:30] marchelzo: I just changed my other implementation to use that, and it cut the time in half.
[01:10:38] Ox0dea: How are you benchmarking?
[01:11:17] Vingador: has joined #ruby
[01:11:34] frustrum: has joined #ruby
[01:11:54] marchelzo: just using a large input and doing a bunch of runs with time(1)
[01:12:03] duckpuppy: has joined #ruby
[01:12:40] pawnbox: has joined #ruby
[01:12:46] marchelzo: it's not perfect, but with a large enough input you can easily learn things
[01:12:53] sp4rrow: has joined #ruby
[01:13:25] solocshaw: has joined #ruby
[01:13:56] Guest96677: has joined #ruby
[01:14:29] uglybandersnatch: has joined #ruby
[01:14:56] aaeron: has left #ruby: ()
[01:16:33] TechToniK: has joined #ruby
[01:17:08] johnmilton: has joined #ruby
[01:17:19] Burnzoire: has joined #ruby
[01:17:35] Burnzoire: #rails doesn't exist anymore?
[01:17:46] sp4rrow: has joined #ruby
[01:17:54] havenwood: Burnzoire: #rubyonrails
[01:18:02] havenwood: TechToniK: hi
[01:18:16] TechToniK: has anyone experienced any issues with openssl since the latest update?
[01:18:31] TechToniK: hi havenwood
[01:18:31] havenwood: TechToniK: Use the latest version of Ruby for your MAJOR.MINOR.
[01:18:51] havenwood: TechToniK: 2.1.8, 2.2.4 or 2.3.0
[01:19:09] poerror: has joined #ruby
[01:19:32] A124: has joined #ruby
[01:19:46] TechToniK: i'm trying to use 2.2.4 because the gems i'm using don't work in 2.3
[01:20:01] havenwood: TechToniK: What error are you running into?
[01:20:31] neanderslob: has joined #ruby
[01:21:01] TechToniK: sorry the long post.. /opt/ruby2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': /opt/ruby2.2/lib/ruby/2.2.0/x86_64-linux/openssl.so: undefined symbol: SSLv2_method - /opt/ruby2.2/lib/ruby/2.2.0/x86_64-linux/openssl.so (LoadError)
[01:22:14] Ox0dea: TechToniK: Distro?
[01:22:31] Burnzoire: has left #ruby: ()
[01:22:43] sp4rrow_: has joined #ruby
[01:23:12] tenderlove: has joined #ruby
[01:23:18] havenwood: Radar: Or #to_digits
[01:23:52] Ox0dea: havenwood: On BigDecimal?
[01:23:59] TechToniK: netrunner rolling
[01:24:08] Radar: havenwood: neato
[01:24:11] TechToniK: based off of majaro
[01:24:17] TechToniK: manjaro sorry
[01:24:22] ReK2: has joined #ruby
[01:24:22] ReK2: has joined #ruby
[01:24:35] Ox0dea: So, yeah, your OpenSSL is "too new".
[01:24:49] phredus: has joined #ruby
[01:24:55] TechToniK: i should be able to "roll back" yes?
[01:25:02] Ox0dea: Do you want to?
[01:25:02] havenwood: Ox0dea: yeah, i ran my "Ferret" code finding code and it came up with: [[:to_digits], [:to_s, "F"], [:to_s, "f"]]
[01:25:57] TechToniK: Ox0dea: if i can run my code then yea ... :)
[01:26:05] phredus: Hello, I've unistalled rails, bundler Trying to start fresh. I ran gem update I get
[01:26:08] EdwardIII: has joined #ruby
[01:26:08] Ox0dea: havenwood: Ah, right, it's from '/util'.
[01:26:22] Ox0dea: TechToniK: Well, better would be to use a Ruby compiled against your new OpenSSL.
[01:26:50] Ox0dea: Maybe raise an issue with the Netrunner folks and ask for a rebuild?
[01:27:10] phredus: Hello, I've unistalled rails, bundler Trying to start fresh. I ran gem update I get "ERROR: While executing gem ... (TypeError) no implicit conversion of nil into String"
[01:28:04] TechToniK: Ox0dea: a Ruby compiled OpeenSSL ?
[01:28:34] Us54er: has joined #ruby
[01:29:10] Ox0dea: TechToniK: That function was recently removed from the OpenSSL package shipped by Arch and friends. All of the relevant packages should've received an upgrade.
[01:29:16] solocshaw: has joined #ruby
[01:29:50] tjbiddle: has joined #ruby
[01:30:07] fullofcaffeine: has joined #ruby
[01:30:31] TechToniK: Ox0dea: yes there was just an upgrade, how can i use a Ruby Compiled OpenSSL?
[01:30:33] mnrmnaugh: has joined #ruby
[01:31:26] moeabdol: has joined #ruby
[01:32:19] dopie: has joined #ruby
[01:32:43] Uo9er_: has joined #ruby
[01:32:47] darix: TechToniK: just reinstall ruby
[01:34:14] TechToniK: darix: that will recompile OpenSLL ?
[01:34:27] darix: you need to recompile the openssl extension for ruby
[01:34:37] darix: not openssl itself
[01:35:21] Maletor: has joined #ruby
[01:35:24] havenwood: TechToniK: When Ruby builds it statically or dynamically links against libraries.
[01:36:32] darix: havenwood: statically linked he wouldnt have that problem.
[01:36:32] fullofcaffeine: has joined #ruby
[01:36:33] jkahn: has joined #ruby
[01:36:51] darix: anyway... lots of discussion about something with a very simple solution
[01:37:34] Ox0dea: Recompilation does seem very simple from behind the veil of knowledge.
[01:37:55] havenwood: Simply recite the exact incantation required!
[01:38:01] Ox0dea: Twice, maybe.
[01:38:28] Tref: has joined #ruby
[01:38:42] Ox0dea: We have a winner.
[01:39:00] DmitryBochkarev: has joined #ruby
[01:39:18] jenrzzz: has joined #ruby
[01:41:56] phredus: Hello is anyone here?
[01:42:03] havenwood: phredus: they are!
[01:42:21] graffix: has joined #ruby
[01:42:25] Tref: Hey guys, I have been tasked with writing a Ruby program that: (1) Assembles a collection of student records by parsing data from 3 different files (delimeted by the following delimeters: "," "|" and "$". And (2) Displays the collection 3 times, sorted 3 different ways. From an OOP organizational perspective what's the best way to do this? I was thinking a "Student" class that either extends or includes an "Importer" module.
[01:43:18] phredus: havenwood: Hello there, new at this dont know much correct etiquette on asking questions.
[01:43:24] Tref: But I generally have a hard time figuring out whether or not my module should be extended or included in my including class.
[01:43:25] havenwood: phredus: ask away
[01:43:56] Ox0dea: tref: `include` is for instance methods.
[01:44:03] Ox0dea: They start with the same two letters, so it's easy to remember. :)
[01:44:16] phredus: I've unistalled rails and bundler, I'm trying to start fresh. I ran gem update I get "ERROR: While executing gem ... (TypeError) no implicit conversion of nil into String"
[01:44:19] havenwood: phredus: the etiquette is to say if you crosspost in multiple channels, Gist more than three lines, and try to show the code and errors :)
[01:44:35] Tref: Ox0dea: well that makes it easy to remember
[01:44:37] havenwood: phredus: What version of Ruby and Rails?
[01:45:02] Tref: Ox0dea: but from a higher level does this seem like the right way to go?
[01:45:13] havenwood: phredus: Oh, starting fresh? You're getting that from?: gem update
[01:45:42] Ox0dea: tref: You should certainly have a Student class, but Importer is a little suspect.
[01:46:00] Tref: Or should I have a separate StudentImporter class that simply requires the Student model and performs these operations?
[01:46:36] Ox0dea: tref: Well, what you really have is a Parser, wouldn't you say?
[01:47:01] Tref: Ox0dea: yeah so im importing three files, parsing and sorting them
[01:47:33] havenwood: phredus: show us?: gem update --backtrace
[01:47:34] phredus: havenwood: Thank I will follow the rules. ruby 2.1.7p400, No rails yet, starting fresh but want latest rails. I ran "gem update" to make sure all is well with ruby before installing rails.
[01:48:16] Tref: Ox0dea: here are the requirements https://gist.github.com/Tref/7c2b8c1ac9d424fb1170
[01:48:17] Ox0dea: tref: Is it three files per student, or each student appears in all three files?
[01:48:41] phredus: havenwood: I have been tinkering with ruby, rails, and bundler las couple of days, now uninstalled rails and bundler and want to make sure ruby is not broken before I proceed
[01:48:47] Tref: Ox0dea: we can skip the testing portion for now
[01:48:54] havenwood: phredus: what do you get for?: gem update --backtrace
[01:49:12] phredus: havenwood: doing it now thanks
[01:50:19] Ox0dea: tref: Are you meant to avoid using the CSV library in your solution?
[01:50:25] chouhoulis: has joined #ruby
[01:50:52] Tref: Ox0dea: no, since CSV is part of the std lib
[01:51:35] Tref: Ox0dea: and I can just specify :col_sep for the delimeter
[01:52:01] phredus: havenwood: http://wklej.org/id/2116401 I've remoded and installed a few gems in an effort to get past the errors, How do restore the originals, I want to go back to default?
[01:52:11] Tref: Ox0dea: i’m less concerned about the implementation of the parser than I am about the overall design
[01:52:22] phredus: havenwood: *removed
[01:52:27] mallu: has joined #ruby
[01:52:47] havenwood: phredus: Rails 5 requires Ruby 2.2.2+.
[01:53:28] Tref: Ox0dea: but if you see in the description each of the data sources has a different column order
[01:53:29] phredus: havenwood: I want to stay with 2.1
[01:53:38] havenwood: phredus: Then no Rails 5 for you!
[01:54:07] Ox0dea: tref: Ah, I was going to say that Importer might be overkill, but the disparity in column order changes that somewhat.
[01:54:24] havenwood: phredus: (It's just a hard dep.)
[01:54:46] Tref: Ox0dea: Right, for good measure I want to separate the Importer/Parser from the Student model
[01:55:03] phredus: havenwood: yes, I just want to go back to fresh starting point before I install rails and its ok I will stay with 2.1 for a while. hard dep?
[01:55:07] Tref: Ox0dea: I’m just unsure what it should be, Class or Module (included or extended)
[01:55:38] Ox0dea: tref: Student doesn't need to know anything about Importer.
[01:55:45] havenwood: phredus: An option is to: gem uninstall --all
[01:55:54] Tref: Ox0dea: but importer needs to know about student
[01:55:56] phredus: havenwood: is there a simple way to refresh ruby and especially the gems it comes with default gems?
[01:56:04] Ox0dea: tref: It needs to know how to initialize one, sure.
[01:56:27] havenwood: phredus: If by "refresh" you mean "nuke from orbit" then: gem uninstall --all
[01:56:44] phredus: havenwood: ok just saw that gem uninstall --all, ok. Then how do I put the default ones back?
[01:56:45] Ox0dea: tref: OpenStruct is also in the standard library. :)
[01:56:52] havenwood: phredus: Another option that wouldn't work in this case is: gem pristine --all
[01:57:23] havenwood: phredus: The default ones won't go away.
[01:57:30] Tref: Ox0dea: https://robots.thoughtbot.com/object-oriented-file-importing-and-parsing
[01:57:36] Tref: that looks like a good starting point
[01:57:36] stannard: has joined #ruby
[01:57:46] Tref: Ox0dea: but its from 2012
[01:57:56] phredus: havenwood: I gem pristine --all, all night and installed and removed gems over 20 by hand then I gave up and unistalled rails and bundler.
[01:58:21] havenwood: phredus: If you want to restore the gems to factory default you'll want to: gem uninstall --all
[01:58:38] phredus: havenwood: ok doing that now, thanks
[01:58:45] mdih: has joined #ruby
[01:58:50] Ox0dea: tref: Yeah, seems good. I was going to advise against actually using OpenStruct and have Students be initializable from Hashes, which is what they're advocating for here with CSVParser#rows.
[01:59:44] Tref: Ox0dea: So they’re not using modules here at all
[02:00:20] Ox0dea: tref: Well, other than ActiveModel.
[02:00:54] ruby-lang428: has joined #ruby
[02:01:03] Tref: Ox0dea: What are they using ActiveModel::Conversion for?
[02:01:44] ramortegui: has joined #ruby
[02:01:54] Tref: Ox0dea: Since I wont have access to rails modules I wont have that available to me
[02:02:18] pawnbox: has joined #ruby
[02:02:33] Ox0dea: tref: They're not. I guess that just kinda slipped in.
[02:02:39] lessless: has joined #ruby
[02:02:51] Tref: Ox0dea: thaaaaaats what she said….
[02:02:58] Tref: Ox0dea: sorry, couldnt help it
[02:03:27] Tref: yeah I wasnt seeing it being used but it seems like you’re ahead of me on understanding how this whole thing works
[02:04:10] Tref: Ox0dea: I see them using `if valid?`
[02:04:20] arescorpio: has joined #ruby
[02:04:21] Tref: Ox0dea: but what’s this import_factory
[02:04:23] Ox0dea: tref: That's from ActiveModel::Validations, though.
[02:04:32] Tref: Ox0dea: yeah that’s what i meant
[02:04:46] Tref: I don’t necessarily need that and I can write my own validator for that
[02:05:12] ramortegui_: has joined #ruby
[02:05:27] Tref: Ox0dea: I see where they’re defining import_factory
[02:05:31] Tref: overlooked that
[02:05:38] Ox0dea: Importer is written to only import valid "types", and it's using the passed "type" to resolve to an actual Class.
[02:07:06] Ox0dea: Using disparate "types" to refer to your different input formats would be overkill.
[02:07:20] Tref: Ox0dea: but since i’m only working with one type `Student` that seems to be superfluous
[02:07:56] phredus: havenwood: http://wklej.org/id/2116460 ok "gem uninstall --all" ran w/o issues. I expected more default gems only 3, and I think I installed these 3 manually.
[02:10:10] Tref: Ox0dea: and since there’s no requirement to parse any of the files separately im wondering if I need the CSVParser class
[02:10:25] mnrmnaugh: has joined #ruby
[02:10:39] Tref: Ox0dea: and where / how to include the implementation of the different row orders
[02:11:05] Ox0dea: tref: The row orders don't actually matter if you have your importer return an Array of Hashes, and you should definitely do that.
[02:11:35] Tref: Ox0dea: Sorry I dont mean row orders
[02:11:40] Tref: Ox0dea: I mean column orders
[02:11:49] freerobby: has joined #ruby
[02:11:53] Ox0dea: tref: And that's how I interpreted your question. :)
[02:12:18] wilbert: has joined #ruby
[02:12:31] Ox0dea: Keying into a Hash is order-independent.
[02:12:50] mdih: has joined #ruby
[02:12:53] Tref: Ox0dea: Im unclear on how Im supposed to assign the proper keys to the proper attributes then if theyre coming in different orders
[02:13:11] Tref: Ox0dea: right but the files have no headers
[02:13:21] Tref: And therefore no column names
[02:13:37] mdih: has joined #ruby
[02:14:30] Ox0dea: tref: Oh, right. That is something you'll need an abstraction for, then.
[02:14:36] Guest97782: has joined #ruby
[02:14:48] tjbiddle: has joined #ruby
[02:15:20] Tref: Ox0dea: I’ve done this in the past using something like this https://gist.github.com/Tref/763f6d8bd1a77201ef4e but it seems hideous
[02:15:36] Tref: Ox0dea: Take it easy on me, I’m still fairly new ;)
[02:15:45] Tref: Ox0dea: :) not ;)
[02:16:08] Ox0dea: tref: That is a little unpleasant, but it's the damned input's fault for not having headers. :P
[02:16:14] blackmesa: has joined #ruby
[02:16:18] DrCode: has joined #ruby
[02:16:25] Tref: Ox0dea: well that’s part of the exercise
[02:16:32] Tref: It was done that way intentionally
[02:16:39] Tref: Its for a class
[02:16:44] ensyde: has joined #ruby
[02:17:06] Tref: Ox0dea: Do you see a cleaner way to do it?
[02:17:07] Ox0dea: I've gathered as much, but the deliberate lack of headers borders on the sadistic.
[02:17:23] linoj: has joined #ruby
[02:17:46] ensyde: has joined #ruby
[02:17:57] AnoHito_: has joined #ruby
[02:18:54] TechToniK: thanks all .. worked like a charm!!
[02:18:59] Ox0dea: tref: OpenStruct would let you initialize students with arbitrary data, but your keys have to come from somewhere.
[02:19:24] TechToniK: i'm off have a good night all!!
[02:19:27] Ox0dea: TechToniK: Glad you got it sorted. :)
[02:20:17] ade: has joined #ruby
[02:20:18] mleung: has joined #ruby
[02:20:39] huddy: has joined #ruby
[02:23:08] i8igmac: i feelstupid, while true <--- fails
[02:23:20] Abrin_AWAY: has joined #ruby
[02:23:32] johnmilton: has joined #ruby
[02:24:58] BrianJ: has joined #ruby
[02:26:10] sucks: has joined #ruby
[02:26:51] BrianJ: I'm trying to make a rest API call to a teamcity server and I'm getting #<Net::HTTPBadRequest:0x007fcd595c0138> Can anyone take a quick look at my code and let me know if I'm doing something obviously wrong? https://gist.github.com/BrianJakovich/afcb65cc636836d6a76a
[02:27:08] Tref: Ox0dea: Alright then I think that might be enough for me to get started on this
[02:27:48] Ox0dea: tref: Importer#initialize(columns, delimiter) + Importer#load(filename) -> [Hash] -> [Student]
[02:27:55] mistermocha: has joined #ruby
[02:28:01] chagel: has joined #ruby
[02:28:06] c_nick: has joined #ruby
[02:28:09] c_nick: how can we represent a number based on the significant bits Eg:- 456897.12358 i want to represent this in only 3 significant difits
[02:28:18] ensyde: has joined #ruby
[02:28:25] Ox0dea: tref: Throw OpenStruct and Forwardable in there if you're feeling fancy. :)
[02:28:30] mistermocha: has joined #ruby
[02:28:40] Tref: Ox0dea: not familiar with Forwardable but I can look it up
[02:29:01] Tref: Ox0dea: and not familiar with OpenStruct if that’s different than Struct
[02:29:05] Tref: but I’ll look both of them up
[02:29:10] Ox0dea: c_nick: Rounding okay?
[02:29:54] Ox0dea: tref: OpenStruct lets you not specify the attributes explicitly, but all conveniences their price.
[02:30:58] Tref: Ox0dea: you lost me on the last part
[02:31:20] Uber|Dragon: has joined #ruby
[02:31:31] c_nick: Ox0dea, the number has 11 significant bits i need to make this 3 .. if i round it off it wll still be 456897.0 6 bits
[02:31:56] mdih: has joined #ruby
[02:31:57] Ox0dea: c_nick: You're not using the word "bits" correctly, and it's confusing things.
[02:31:59] Ropeney: has joined #ruby
[02:32:13] pawnbox: has joined #ruby
[02:32:15] Ox0dea: You want to go from 456897.12358 to...?
[02:32:33] Ox0dea: tref: Well, OpenStruct lets you do things "willy-nilly", which makes errors harder to catch if you're not careful.
[02:33:03] c_nick: Ox0dea, significant bits in 456897.12358 are 11 (width). I want this to be down to 3
[02:33:09] Tref: Ox0dea: ah so you dont have to predefine the structure of OpenStructs
[02:34:02] Ox0dea: tref: Right, they're essentially Hashes with accessors defined in terms of the keys.
[02:34:15] Ox0dea: It's nice, but it's got teeth.
[02:34:56] Tref: Ox0dea: in this instance im not sure of the benefit that would provide me over a regular Struct since I already know what the order is
[02:36:21] Ox0dea: tref: You've got three different Structs in your example there; that's arguably two too many.
[02:36:29] c_nick: Ox0dea, eg: 1.434 i want this down to 2 then that would be 1.4
[02:37:18] c_nick: its just set width but without losing out on the numbers
[02:37:37] Ox0dea: c_nick: So in your original example, you want to go from 456897.12358 to... 456?
[02:37:41] Tref: Ox0dea: I’m not sure how I would reduce that down to 1
[02:37:53] U7se6: has joined #ruby
[02:38:13] c_nick: Ox0dea, thats the thing 456 is not really the number if i round off i still have 456897.0 so we will lose out on 897
[02:38:47] c_nick: i could always do a string parsing and only pick up for first 3 chars but that would lose out on info
[02:38:59] c_nick: what if i make everything to e^ (scientific) ones
[02:39:47] stannard: has joined #ruby
[02:40:07] Ox0dea: tref: You only need the one Student class, initialized with a Hash (from Importer#load).
[02:40:27] hahuang61: has joined #ruby
[02:42:23] mistermocha: has joined #ruby
[02:48:02] Moosashi: has joined #ruby
[02:49:30] chagel: has joined #ruby
[02:50:37] linoj: has joined #ruby
[02:51:28] mistermocha: has joined #ruby
[02:55:25] mleung: has joined #ruby
[02:57:54] tjbiddle: has joined #ruby
[03:00:11] chagel: has joined #ruby
[03:01:58] trosborn: has joined #ruby
[03:02:34] Moosashi: has joined #ruby
[03:03:18] Suntzu: has joined #ruby
[03:06:40] uglybandersnatch: has joined #ruby
[03:06:47] chagel: has joined #ruby
[03:11:46] chagel: has joined #ruby
[03:12:28] frustrum: has joined #ruby
[03:15:41] x77686d: has joined #ruby
[03:15:56] wreet: has joined #ruby
[03:16:45] chagel: has joined #ruby
[03:17:12] blackmesa: has joined #ruby
[03:21:04] Xeago: has joined #ruby
[03:21:29] dopamean_: has joined #ruby
[03:22:43] Moosashi: has joined #ruby
[03:29:25] chagel: has joined #ruby
[03:33:50] stannard: has joined #ruby
[03:34:16] Uo9er_: has joined #ruby
[03:34:40] frustrum: has joined #ruby
[03:35:26] djbkd: has joined #ruby
[03:36:01] Pupp3tm4st3r: has joined #ruby
[03:36:06] Us54er: has joined #ruby
[03:36:07] mistermocha: has joined #ruby
[03:36:15] poerror: has joined #ruby
[03:37:39] jenrzzz: has joined #ruby
[03:39:44] chagel: has joined #ruby
[03:40:52] RIK: hello ruby people! i have need to download a gem, and compile it against non-standard libraries. how do i do that?
[03:43:01] dmarr_: has left #ruby: ()
[03:44:04] duncannz: has joined #ruby
[03:44:47] LoneHermit: has joined #ruby
[03:45:31] jenrzzz_: has joined #ruby
[03:45:51] RegulationD: has joined #ruby
[03:46:47] zast: has joined #ruby
[03:50:22] jenrzzz: has joined #ruby
[03:53:32] Moosashi: has joined #ruby
[03:54:13] ruind: has joined #ruby
[03:55:32] Uo9er_: has joined #ruby
[03:56:13] ukazap: has joined #ruby
[03:57:23] ukazap: hello rubyists, greetings from indonesia
[03:57:48] nanoz: has joined #ruby
[03:59:31] godzillaenlacasa: has joined #ruby
[04:02:12] configged-: has joined #ruby
[04:03:11] kith_: has joined #ruby
[04:04:01] Keltia: has joined #ruby
[04:04:09] plonk: has joined #ruby
[04:04:09] plonk: has joined #ruby
[04:07:00] jokke: has joined #ruby
[04:07:12] fedexo: has joined #ruby
[04:09:54] inukshuk: has joined #ruby
[04:10:12] ukazap: nobody want to talk?
[04:11:23] Xeago: has joined #ruby
[04:11:54] jenrzzz: has joined #ruby
[04:12:38] ukazap: havenwood: hi there
[04:12:54] heinrich5991: has joined #ruby
[04:12:55] braincrash: has joined #ruby
[04:18:43] RIK: it does appearto be quite quiet
[04:19:55] ukazap: rik: let's burn this place down to make it noisy (kidding)
[04:20:14] blackmesa: has joined #ruby
[04:20:37] RIK: well, i need help with making a gem do wht i want ...
[04:20:43] RIK: so i don't want to burn this place down yet
[04:20:47] chagel: has joined #ruby
[04:21:49] ijij: has joined #ruby
[04:22:26] ukazap: rik: hey, i made a gem
[04:22:46] RIK: exellent
[04:23:03] RIK: i want DataMapper's sqlite provider to use sqlcipher, instead of sqlite.
[04:23:10] RIK: but i have no idea how to achieve this.
[04:23:10] ukazap: so what do you want to accomplish with your gem?
[04:23:50] ukazap: never heard sqlcipher
[04:23:51] RIK: (it's backwards compatible, but i don't know how to get it to build against it)
[04:25:17] davee_: has joined #ruby
[04:25:50] RIK: i hav efound it, i think.
[04:26:25] ukazap: dm sqlcipher adapter?
[04:26:50] ukazap: can't find one: https://github.com/datamapper/dm-core/wiki/Adapters
[04:27:09] aupadhye: has joined #ruby
[04:28:36] barajasfab: has joined #ruby
[04:30:31] treaki__: has joined #ruby
[04:37:27] konsolebox: has joined #ruby
[04:38:39] codezomb: has joined #ruby
[04:39:48] shevy: has joined #ruby
[04:40:01] Moosashi: has joined #ruby
[04:40:51] fullofca_: has joined #ruby
[04:45:58] merida: has joined #ruby
[04:46:30] norc: has joined #ruby
[04:47:23] bronson: has joined #ruby
[04:49:57] ruind: has joined #ruby
[04:51:01] Eaven: has joined #ruby
[04:56:48] gix: has joined #ruby
[05:02:42] uglybandersnatch: has joined #ruby
[05:04:14] chagel: has joined #ruby
[05:07:15] hahuang61: has joined #ruby
[05:07:22] moeabdol: has joined #ruby
[05:07:34] bronson: has joined #ruby
[05:12:02] pawnbox: has joined #ruby
[05:12:38] Xeago: has joined #ruby
[05:12:53] Babos: has joined #ruby
[05:12:58] rickmasta: has joined #ruby
[05:13:46] Babos: has left #ruby: ()
[05:15:38] Pupp3tm4st3r: has joined #ruby
[05:18:31] Chagel_: has joined #ruby
[05:21:06] Maletor: has joined #ruby
[05:22:44] biberu: has joined #ruby
[05:22:45] blackmesa: has joined #ruby
[05:24:08] chagel: has joined #ruby
[05:27:59] howdoi: has joined #ruby
[05:30:09] hxegon: has joined #ruby
[05:30:39] frustrum: has joined #ruby
[05:32:30] LoneHermit: has joined #ruby
[05:33:00] Moosashi: has joined #ruby
[05:36:59] poerror: has joined #ruby
[05:38:07] rkazak: has joined #ruby
[05:38:23] Infra-Red: has joined #ruby
[05:40:26] spacemud: has joined #ruby
[05:40:50] niksrc: has joined #ruby
[05:42:30] Infra-Red: has joined #ruby
[05:44:56] chagel: has joined #ruby
[05:45:08] tomatoes: has joined #ruby
[05:45:24] yeoh: has joined #ruby
[05:46:47] merida: has joined #ruby
[05:47:18] astrobun_: has joined #ruby
[05:49:04] sauvin: has joined #ruby
[05:52:03] totalkunt6969: has joined #ruby
[05:52:06] totalkunt6969: is this chat dead?
[05:54:30] chagel: has joined #ruby
[05:55:23] grill: has joined #ruby
[05:55:29] stannard: has joined #ruby
[05:56:11] paatalaBhairavi: has joined #ruby
[05:57:02] paatalaBhairavi: has joined #ruby
[05:59:59] chagel: has joined #ruby
[06:01:27] mahk: has joined #ruby
[06:02:53] hyperdrive: has joined #ruby
[06:06:36] Radar: !ban totalkunt6969
[06:06:36] ruby[bot]: +bbb $a:totalkunt6969$#ruby-banned totalkunt6969!*@*$#ruby-banned *!*@gateway/web/freenode/ip.45.32.154.9$#ruby-banned
[06:06:36] ruby[bot]: ruby[bot] kicked totalkunt6969: offense, see http://ruby-community.com/pages/user_rules
[06:08:58] U7se6: has joined #ruby
[06:08:59] PlasmaStar: has joined #ruby
[06:09:36] baweaver: has joined #ruby
[06:10:14] aufi: has joined #ruby
[06:10:34] Infra-Red: has joined #ruby
[06:10:55] yeoh: has joined #ruby
[06:12:18] Tref: has joined #ruby
[06:12:55] mburns: has joined #ruby
[06:13:00] Tref: hey guys having a hard time getting started with some boilerplate for this exercise: https://gist.github.com/Tref/7c2b8c1ac9d424fb1170
[06:14:38] Infra-Red: has joined #ruby
[06:14:56] rffleaie: has joined #ruby
[06:16:22] uglybandersnatch: has joined #ruby
[06:18:10] baweaver: tref: what have you tried so far?
[06:18:23] astrobun_: has joined #ruby
[06:18:33] jolts: has joined #ruby
[06:18:49] nando293921: has joined #ruby
[06:19:28] paatala_bhairavi: has joined #ruby
[06:19:32] baweaver: Show us what you have so far.
[06:19:44] iMadper: has joined #ruby
[06:19:55] jolts: has joined #ruby
[06:20:21] Tref: baweaver: let me post it
[06:20:27] Tref: I’ll create a new repo
[06:21:42] Tref: baweaver: I dont have much. Like I said Im having a hard time with structure and getting started
[06:22:41] Tref: baweaver: Im not really planning on using what I have https://github.com/Tref/delimeter_parser
[06:22:52] Tref: so theres not much point in looking just yet
[06:23:00] ur5us: has joined #ruby
[06:23:16] Tref: the only thing in there that’s of any use so far is https://github.com/Tref/delimeter_parser/blob/master/bin/import.rb
[06:23:55] baweaver: https://coderpad.io/RE6AK2PT
[06:24:03] baweaver: That'll help us step through some of it together
[06:24:08] mistermocha: has joined #ruby
[06:24:12] htmldrum: has joined #ruby
[06:24:14] hyperdrive: has joined #ruby
[06:24:20] Tref: Im more having difficulty with file organization, what should go where, modules vs classes etc
[06:24:46] mistermocha: has joined #ruby
[06:28:20] n00bDev: has joined #ruby
[06:28:28] aganov: has joined #ruby
[06:29:12] ohaibbq: has joined #ruby
[06:29:22] pawnbox: has joined #ruby
[06:30:24] tristanp: has joined #ruby
[06:31:06] jenrzzz: has joined #ruby
[06:34:11] Ahmer: has joined #ruby
[06:39:27] kp666: has joined #ruby
[06:42:59] blackmesa: has joined #ruby
[06:43:14] Moosashi: has joined #ruby
[06:44:20] rmulliga`: has joined #ruby
[06:45:27] mistermocha: has joined #ruby
[06:45:30] last_staff: has joined #ruby
[06:46:13] ereslibre: has joined #ruby
[06:47:59] ben_vulpes: how do i shell out to a ruby gem, specifying ruby executeable and gem?
[06:48:21] ben_vulpes: as in from an entirely non-ruby stack
[06:49:26] kp666: has joined #ruby
[06:52:12] terminal_: has joined #ruby
[06:54:34] emilkarl: has joined #ruby
[06:54:42] bronson: has joined #ruby
[06:55:19] tvw: has joined #ruby
[06:55:49] moeabdol: has joined #ruby
[06:56:45] chipotle: has joined #ruby
[06:59:08] pawnbox: has joined #ruby
[06:59:37] nanoz: has joined #ruby
[07:00:38] skade: has joined #ruby
[07:00:39] Pupp3tm4st3r: has joined #ruby
[07:03:25] chagel: has joined #ruby
[07:04:33] solars_: has joined #ruby
[07:08:23] chagel: has joined #ruby
[07:08:38] lxsameer: has joined #ruby
[07:09:17] djbkd: has joined #ruby
[07:09:30] Ox0dea: tref: Is a delimeter for measuring sandwiches?
[07:10:26] Tref: Ox0dea: My sausage is 12 delimeters
[07:11:01] Ox0dea: Google is resisting my efforts to have that converted to Planck lengths. :/
[07:12:04] voidsta: has left #ruby: ()
[07:13:00] beergineer: has joined #ruby
[07:15:18] bricker: has joined #ruby
[07:15:21] Infra-Red: has joined #ruby
[07:15:46] schaary: has left #ruby: ()
[07:16:21] mrgrieves: has joined #ruby
[07:18:24] emesa: has joined #ruby
[07:18:24] ayonkhan: has joined #ruby
[07:20:43] dionysus69: has joined #ruby
[07:25:18] _blizzy_: has joined #ruby
[07:25:23] pawnbox: has joined #ruby
[07:25:27] nerium: has joined #ruby
[07:27:44] kam270: has joined #ruby
[07:28:14] hk238: has joined #ruby
[07:29:15] reprazent: has joined #ruby
[07:29:31] a11: has joined #ruby
[07:31:41] terlar: has joined #ruby
[07:31:46] kam270: has joined #ruby
[07:36:38] yardenbar: has joined #ruby
[07:37:52] jenrzzz: has joined #ruby
[07:38:28] firstdayonthejob: has joined #ruby
[07:38:37] andikr: has joined #ruby
[07:38:41] EdwardIII: has joined #ruby
[07:38:56] Moosashi: has joined #ruby
[07:39:01] poerror: has joined #ruby
[07:39:09] davee_: has joined #ruby
[07:39:30] anisha: has joined #ruby
[07:41:36] cpup: has joined #ruby
[07:42:08] biberu: has joined #ruby
[07:43:10] sphex: has joined #ruby
[07:44:06] mistermocha: has joined #ruby
[07:44:24] Polysics_: has joined #ruby
[07:44:47] blackmesa: has joined #ruby
[07:45:35] systemsgotyou: has joined #ruby
[07:47:20] RegulationD: has joined #ruby
[07:49:19] ruby-lang151: has joined #ruby
[07:53:35] chagel: has joined #ruby
[07:54:17] blackms: has joined #ruby
[07:54:46] Couch: has joined #ruby
[07:54:58] jas02: has joined #ruby
[07:55:22] emilkarl: has joined #ruby
[07:56:52] binaryplease: has joined #ruby
[07:57:34] Ishido: has joined #ruby
[07:58:44] mrgrieves: has joined #ruby
[07:58:58] jaruga: has joined #ruby
[07:59:38] yardenbar: has joined #ruby
[08:01:17] chagel: has joined #ruby
[08:03:15] atmosx: has joined #ruby
[08:03:29] roshanavand: has joined #ruby
[08:03:48] graffix: has joined #ruby
[08:03:59] GriffinHeart: has joined #ruby
[08:04:10] fexilal: has joined #ruby
[08:07:00] roshanavand: has joined #ruby
[08:08:53] ensyde: has joined #ruby
[08:09:03] Uo9er_: has joined #ruby
[08:11:10] duncannz: has joined #ruby
[08:11:34] emilkarl: has joined #ruby
[08:12:41] ruby-lang708: has joined #ruby
[08:13:55] rdark: has joined #ruby
[08:14:25] roshanavand: has joined #ruby
[08:15:11] Acontius: has joined #ruby
[08:19:32] Suntzu: has joined #ruby
[08:20:13] SCHAAP137: has joined #ruby
[08:20:46] mja: has joined #ruby
[08:22:31] Ropeney: has joined #ruby
[08:22:33] kireevco: anyone has an idea how to convert a python dict object to a valid json in ruby?
[08:22:34] Kedare: has joined #ruby
[08:22:44] vdamewood: has joined #ruby
[08:23:29] emilkarl: has joined #ruby
[08:23:48] astrobun_: has joined #ruby
[08:24:18] danjack_: Hey guys, I want to install a gem, but the extconf fails
[08:24:23] CloCkWeRX: has joined #ruby
[08:24:41] danjack_: I thought of changing the extconf script to not fail, but if I try to rerun 'gem install' it just overwrites my changes
[08:24:57] danjack_: any thoughts on how I could just run the configuration of already downloaded gem?
[08:26:34] binaryplease: has joined #ruby
[08:26:49] roshanavand: has joined #ruby
[08:27:05] codecop: has joined #ruby
[08:27:10] codecop_: has joined #ruby
[08:28:32] Ox0dea: kireevco: Ew. Just have the Python script emit JSON.
[08:29:02] kireevco: I can't. I'm parsing a log, can't control input
[08:29:03] TvL2386: has joined #ruby
[08:29:04] Ox0dea: danjack_: You can say `gem install some_local_file.gem`.
[08:30:05] Moosashi: has joined #ruby
[08:31:29] matp: has joined #ruby
[08:31:49] Ox0dea: You'll want to do that after `gem build foo.gemspec`, of course.
[08:32:13] b|ackwolf: is it possible that a class has more than one constructor?
[08:32:41] b|ackwolf: for example; Date.parse() and Date.new().
[08:34:32] kireevco: b|ackwolf: can't you just have one canonical and call it from an alias method?
[08:34:48] kireevco: or oyu want different ones?
[08:35:33] kireevco: make an alias to call your canonical constructor with a parameter
[08:36:20] Ox0dea: b|ackwolf: Date.parse calls Date.new, the latter being the only "constructor" in the technical sense.
[08:36:35] b|ackwolf: Ox0dea, thanks
[08:36:36] gregf_: b|ackwolf: if you've got a constructor like so def initialize *args, **kwargs;end <== is that not sufficient
[08:37:07] b|ackwolf: gregf_, kireevco: thanks to you too. that's reasonable.
[08:37:12] roshanavand: has joined #ruby
[08:38:03] Ox0dea: Appropriately named convenience "constructors" are fine, but they should pretty much always delegate to the "real" constructor at the end.
[08:38:47] ben_vulpes: has left #ruby: ("WeeChat 1.1.1")
[08:38:52] Ox0dea: That said, "If you have a procedure with 10 parameters, you probably missed some."
[08:40:11] Xeago: has joined #ruby
[08:40:29] riotjones: has joined #ruby
[08:44:45] igam: has joined #ruby
[08:45:05] agit0: has joined #ruby
[08:45:30] AnoHito: has joined #ruby
[08:46:33] blackmesa: has joined #ruby
[08:46:37] roshanavand: has joined #ruby
[08:46:58] norc: has joined #ruby
[08:47:38] norc: So Im wondering how to people here interactively develop their gems? Do you just create a separate bundle specifying your gem via a local path, and then just fire up a pry shell from there?
[08:48:45] queequeg1: has joined #ruby
[08:49:20] anthony: has joined #ruby
[08:49:29] tAn: has joined #ruby
[08:49:44] DoubleMalt: has joined #ruby
[08:51:56] sphex_: has joined #ruby
[08:54:32] baweaver: has joined #ruby
[08:54:51] tao_: has joined #ruby
[08:55:43] tjbiddle: has joined #ruby
[08:56:28] merida: has joined #ruby
[08:57:05] htmldrum: has joined #ruby
[08:58:56] skade: has joined #ruby
[08:59:38] n008f4g_: has joined #ruby
[09:00:14] bricker: has joined #ruby
[09:00:44] soahccc: norc: Depends but I've done that before. I think it was our capistrano wrapper where I used that method a lot
[09:02:37] snowy: has joined #ruby
[09:05:19] norc: In my last gem I tried to avoid interactive shells entirely, spending the time to specify the behaviour I intend to test in RSpec instead.
[09:05:45] norc: But at some point I realized I was testing far more than I should have.
[09:06:02] the_drow: has joined #ruby
[09:06:23] moeabdol: has joined #ruby
[09:08:04] atmosx: has joined #ruby
[09:09:44] gbgdev: has joined #ruby
[09:10:53] skade: has joined #ruby
[09:11:01] mark3: has joined #ruby
[09:12:42] emilkarl: has joined #ruby
[09:14:22] decaff: has joined #ruby
[09:16:13] cpup: has joined #ruby
[09:18:08] bluOxigen: has joined #ruby
[09:21:32] Stan: has joined #ruby
[09:22:29] htmldrum: has joined #ruby
[09:22:38] bronson: has joined #ruby
[09:24:09] mrgrieves: has joined #ruby
[09:24:52] forgot: has joined #ruby
[09:24:56] GreyHands: has joined #ruby
[09:25:59] drptbl: has joined #ruby
[09:27:06] scepticulous: has joined #ruby
[09:27:11] triangles: has joined #ruby
[09:27:41] baweaver: has joined #ruby
[09:27:58] the_drow: has joined #ruby
[09:28:03] tAn: has joined #ruby
[09:29:43] marr: has joined #ruby
[09:29:47] Pupp3tm4st3r: has joined #ruby
[09:32:01] Pupp3tm4st3r: has joined #ruby
[09:32:11] blackmesa: has joined #ruby
[09:35:41] Pupp3tm4_: has joined #ruby
[09:35:55] snowy: has joined #ruby
[09:35:57] andrewvos: has joined #ruby
[09:38:09] mja: has joined #ruby
[09:40:31] nocontrol: has joined #ruby
[09:40:46] devoid: has joined #ruby
[09:40:57] Xeago: has joined #ruby
[09:42:50] devoid: I've discovered that using @varname for instance variables means that if I mistype a variable name it's not detected, and just resolves to an empty string. The only alternative seems to be to define an accessor and use that, even from class member functions. Is that right?
[09:43:21] Gasher: has joined #ruby
[09:44:02] platzhirsch: has joined #ruby
[09:44:24] Ox0dea: devoid: Undefined instance variables evaluate to `nil`, but you should have tests that explode if you misspell one.
[09:44:30] platzhirsch: has left #ruby: ()
[09:46:05] ziyadb: has joined #ruby
[09:46:30] devoid: Yes, but if you use it in a string "hello #{@varname}" and @varname isn't defined, it expands silently to an empty string. Where "hello #{undefined_var}" causes an error immediately
[09:47:14] Ox0dea: >> nil.to_s # devoid
[09:47:16] ruby[bot]: Ox0dea: # => "" (https://eval.in/537398)
[09:47:35] ready: has joined #ruby
[09:47:57] pec: has joined #ruby
[09:47:58] Ox0dea: If you want to catch misspellings at runtime rather than test time, that's your prerogative.
[09:48:53] kam270: has joined #ruby
[09:49:37] stannard: has joined #ruby
[09:50:06] Cohedrin: has joined #ruby
[09:50:08] devoid: it's the different behaviour between undefined instance variables '@xxx' and undefined local variables 'xxx' is the problem. Is there some other way to detect mistyped member var names? you can never guarantee that all such cases will be caught in tests.
[09:50:53] tAn: has joined #ruby
[09:51:18] Rahul_Roy: has joined #ruby
[09:51:36] Dimik: has joined #ruby
[09:51:55] Ox0dea: devoid: There are IDEs that'll red-flag misspellings, but if all your tests pass even if you've used a bad instance variable, that's a paddlin'.
[09:52:08] sepp2k: has joined #ruby
[09:53:57] devoid: true but it's something so easy to check in the parser. One of the bugs today was in a log message. The log message was missing an important bit of information, which didn't affect the program operation in any way, but an external process was expecting to see the message at regular intervals.
[09:54:58] Ox0dea: In the parser, you say?
[09:55:26] mikhael_k33hl: has joined #ruby
[09:55:36] mikhael_k33hl: is there anyway to enable ci_reporter without using rake?
[09:56:01] platzhirsch: has joined #ruby
[09:56:54] Ox0dea: mikhael_k33hl: Looks pretty Rake-oriented.
[09:57:21] devoid: so the only way to get ruby to detect accesses to variables that have never been initialised seems to be to define an accessor for every instance variable and use those rather than the '@' variables for all accesses to the data.
[09:57:40] Ox0dea: Or write tests.
[09:58:02] Ox0dea: Ruby is inherently resistant to static analysis.
[09:59:28] drptbl_: has joined #ruby
[10:00:27] evidex: has joined #ruby
[10:02:01] shevy: devoid I sorta tend to do that anyway, seems easier to keep track of when any ivar is changed. problem is that method calls are slower than when one directly uses @foo = 5
[10:02:37] devoid: I have tests, but tests are never complete. You build them up over time as you discover more things that go wrong. Detecting access to a variable that's never been initialised should be trivial?? Going the accessor route will mean that mistyped var names should never be missed.
[10:03:25] Ox0dea: Well, they won't be variable names anymore, but yes, you'll get runtime errors.
[10:03:48] devoid: performance isn't a problem for the things we're using ruby for. predictability is more of a problem.
[10:03:55] maner: has joined #ruby
[10:04:27] devoid: I would prefer a visible error than silent surprises. It depends what you're doing I guess.
[10:04:30] shevy: the did-you-mean gem can detect a few misspellings, perhaps you can dig into it when you need to test things https://github.com/yuki24/did_you_mean#displaying-a-warning-when-initialize-is-incorrectly-typed
[10:05:18] lsmola: has joined #ruby
[10:05:26] Ox0dea: devoid: It's hardly as trivial as you seem to think; instance variables can be defined all sorts of ways at any time.
[10:05:54] Ox0dea: We have #instance_variable_{get,set,defined?} for doing all sorts of wacky things.
[10:06:25] TheIdea: has joined #ruby
[10:06:45] Pupp3tm4st3r: has joined #ruby
[10:07:46] norc: devoid: Think in terms of interfaces and test only then.
[10:07:53] devoid: Yep, I have no idea how ruby internals work, but it must maintain some type of symbol table at runtime that could be used to detect accesses? Anyway, for me now I just want a way to make it more likely that a mistyped @var name will show up as an error during testing, rather than slipping through into production
[10:08:26] tAn: has joined #ruby
[10:08:28] norc: devoid: If you access an uninitialized variable whether it throws a variable or not, it probably has an effect on your interface somehow.
[10:08:51] U7se6: has joined #ruby
[10:09:15] hamed_r: has joined #ruby
[10:09:30] norc: devoid: There is some real whacky magic going on under the hood when it comes to dispatching methods and variable access in CRuby.
[10:10:00] Ox0dea: devoid: Right, an object's instance variable table is essentially just a Hash under the hood; undefined ivars resolve to `nil` the same way Hash#[] does with a nonexistent key.
[10:10:25] devoid: norc: these scripts are being used for backend processes that churn away all day every day. So problems may not get noticed for a while.
[10:10:52] Ox0dea: They should get noticed as soon as you run your tests.
[10:11:15] norc: Which is my point. Test your interfaces, not the internals.
[10:12:44] noway_: has joined #ruby
[10:12:54] Xeago: has joined #ruby
[10:14:02] norc: Ox0dea: honestly though, Im not a big fan of access to non initialized ivars not throwing a NameError.
[10:14:03] poerror: has joined #ruby
[10:14:26] Sero: has joined #ruby
[10:14:53] norc: asm>> @f
[10:14:54] ruby[bot]: norc: I have disassembled your code, the result is at https://eval.in/537433
[10:15:21] tAn: has joined #ruby
[10:15:31] Ox0dea: norc: Would that be trivial to amend?
[10:15:38] devoid: tests are great but in my experience never perfect. given that and the fact that we can't guarantee that ruby will throw an error for a @varname typo, I guess the accessor thing is the only way.
[10:16:13] devoid: actually the main cause of the error is that nil.to_s returns "". If that threw an error, the problem may be solved?
[10:16:34] TheIdea: I kind of have found a concept that I belive could solve a lot of our problems worldwide but it could also have very negative effects. Since my IQ is not too high I'd like to discuss this with some smart individuals. It involves cryptocurrencies, crowdfunding, voting, organizing, copyrights etc. It could enable people to earn money by just doing the things thay love to do but also making sure that everything else is done. Anyone here up for it
[10:16:34] TheIdea: ? If not it would be awesome if you could redirect me somewhere where I can discuss it.
[10:17:06] norc: devoid: If you turn Ruby into verbose mode you should get a warning at least.
[10:17:17] norc: Ox0dea: Fairly trivial.
[10:17:37] norc: Ox0dea: Looks like just a small patch to vm_insnhelper.c would be needed.
[10:18:17] stardiviner: has joined #ruby
[10:18:25] norc: devoid: no that actually is working as intended.
[10:18:40] norc: devoid: If you have some behavior you rely on, put it behind an interface. And test it.
[10:18:49] norc: Tests catch these things.
[10:19:00] Ox0dea: norc: But surely the same semantics would need to be applied to class variables and globals?
[10:19:02] norc: If you do not write tests, you might as well pick another language.
[10:19:16] ruby[bot]: norc: # => /tmp/execpad-eb7ec3d7aad3/source-eb7ec3d7aad3:2: warning: class variable access from toplevel ...check link for more (https://eval.in/537446)
[10:19:21] Ox0dea: Just globals, then.
[10:19:31] Ox0dea: Well, no.
[10:19:36] norc: Well, yes.
[10:19:56] drptbl: has joined #ruby
[10:20:14] Ox0dea: The ivar magic is quite deliberate, then; I wonder at the rationale.
[10:21:06] norc: Ox0dea: Lazy people. Uninitialized lvar makes perfect sense to throw an error because its scoped to a small space.
[10:21:18] devoid: I am pedantic about tests. I write them first and run them before I even start entering the program. But I am not the only one working on this code. So tests are of varying quality, and as I have said before they are never perfect.
[10:21:28] norc: Ox0dea: But to initialize every damn variable, well coming from C++ I know that it can be annoying at times.
[10:21:42] norc: Which is why MSVC is so great because it automatically does all that boilerplate for oyu.
[10:21:47] TheIdea: has left #ruby: ("Leaving")
[10:22:06] norc: devoid: If your team has problems with good test coverage, that is your real problem then.
[10:22:16] norc: Not some Ruby quirks. ;-)
[10:22:55] shevy: you people need to write better code
[10:23:42] Ox0dea: devoid: If you really think blowing up on interpolated `nil` would help, you might consider doing it with a refinement.
[10:24:04] Ox0dea: Redefining NilClass#to_s to explode, to clarify.
[10:24:14] manveru: or just use #to_str
[10:24:32] Spami: has joined #ruby
[10:24:52] devoid: that is A problem. but tools can help! and tools can be made more consistent that humans. I don't have a problem with however ruby wants to do things. but if I can have a tool that spots problems, that is better than relying on humans to spot them.
[10:25:20] manveru: then you probably want another tool than ruby :)
[10:26:06] devoid: that would make things easier. I've been running rubocop over all the code and it doesn't spot access to undefined @vars.
[10:26:31] manveru: because @vars can come from elsewhere too
[10:26:41] ready: shit offtopic
[10:28:12] FooMunki: has joined #ruby
[10:28:33] norc: devoid: You basically want some data-flow analysis functionality baked into Rubocop there. ;-)
[10:29:52] manveru: there are so many languages that give you those guarantees... and it's not something you can analyze very well in ruby
[10:30:47] norc: manveru: Really? C/C++ is a rather popular language that does not give you a guarantee here. ;-)
[10:30:57] norc: *two rather popular langauges.
[10:31:10] manveru: i didn't talk about popular, nor about C/C++
[10:31:28] norc: Fair enough.
[10:31:50] manveru: i don't consider those very soundly typed... more like syntactic sugar on top of ASM
[10:32:00] andrewvos: has joined #ruby
[10:32:11] decaff: has joined #ruby
[10:33:25] manveru: >> ObjectSpace.each_object{|o| o.instance_variable_set(:@hi, :there) unless o.frozen? }; ARGV.instance_variable_get(:@hi)
[10:33:26] ruby[bot]: manveru: # => :there (https://eval.in/537452)
[10:33:28] norc: To consider C++ not very soundly typed is a bold statement, but I do not feel like arguing over this.
[10:34:41] devoid: manveru: yep but scripts these days seem to be done in ruby, python or bash. I've never liked C of any variant. I don't like python because of the ways that different developers with different vim settings can screw up the indenting. compiled software is where I came from, but scripting languages are useful and responsive. But coming from a place where typos are detecting, to somewhere they are not, seems to be a step backwards.
[10:34:41] mr_robot_: has joined #ruby
[10:35:01] gbgdev: has joined #ruby
[10:35:19] norc: >> const_get("fatal")
[10:35:20] ruby[bot]: norc: # => undefined method `const_get' for main:Object (NoMethodError) ...check link for more (https://eval.in/537454)
[10:35:26] norc: >> Module.const_get("fatal")
[10:35:27] ruby[bot]: norc: # => wrong constant name fatal (NameError) ...check link for more (https://eval.in/537455)
[10:35:32] norc: ruby[bot]: Now you just hate me...
[10:36:46] Ox0dea: norc: Er, it's not a constant, is it?
[10:37:01] norc: Ox0dea: What is it then?
[10:37:16] Ox0dea: norc: Well, I know it's the name of a class.
[10:37:21] Ox0dea: So I guess it must be?
[10:37:37] norc: Think we should try and find where its defined to be sure
[10:38:11] manveru: devoid: yeah, when i want something like that i usually use Go
[10:38:21] Ox0dea: norc: rb_eFatal = rb_define_class("fatal", rb_eException);
[10:38:41] norc: Ox0dea: and rb_define_class uses rb_const_set
[10:39:20] Ox0dea: Too right you are.
[10:39:47] norc: >> raise ObjectSpace.each_object(Class).find { |c| c.name == "fatal" }
[10:39:48] ruby[bot]: norc: # => fatal (fatal) ...check link for more (https://eval.in/537456)
[10:39:51] norc: There we go!
[10:39:55] norc: Cant hide it from me.
[10:41:06] FooMunki: has joined #ruby
[10:41:13] Ox0dea: trunk $ ag rb_obj_hide | wc -l
[10:42:50] norc: Ox0dea: Well, as long as its still in memory its still accessible via Fiddle. ;-)
[10:43:02] joonty: has joined #ruby
[10:43:17] norc: And you can safely poke the entire memory now that we have a way to rescue from SegFaults.
[10:43:31] Ox0dea: Still, so finicky.
[10:46:07] FooMunki: has joined #ruby
[10:46:12] norc: Ox0dea: Neat, never knew about silver searcher.
[10:46:14] c355E3B: has joined #ruby
[10:46:20] norc: That is definitely gonna be a helpful tool. :)
[10:46:40] DEac-: has joined #ruby
[10:47:33] chagel: has joined #ruby
[10:48:27] Moosashi: has joined #ruby
[10:48:39] norc: Well, I spent a lot of time working with MSVC - that gives you a different perspective on tooling.
[10:49:44] Ox0dea: I suppose that's fair.
[10:50:51] norc: It was not until a few weeks ago that I truly began to use tmux everywhere, after I got finally fed up with the shortcomings of iTerm2.
[10:51:22] norc: But on the brightside, it gives me this wonderful experience to constantl discover "new and amazing" things. ;-)
[10:51:39] norc: Things you might take for granted.
[10:51:42] GioVdK: has joined #ruby
[10:52:21] lenwood: has joined #ruby
[10:53:51] GioVdK: Hello, I read that Iconv is deprecated in the newest versions of Ruby, is this correct?
[10:54:34] Ox0dea: GioVdK: It's not been part of the standard library since 2.0.
[10:55:39] johnmilton: has joined #ruby
[10:55:39] GioVdK: thanks Ox0dea and I should use string.encode instead, right?
[10:56:06] Ox0dea: GioVdK: There are a few other relevant methods, but yeah, that's the big'n.
[10:56:46] adaedra: I think apeiros has a whole guide on Ruby and encodings
[10:56:52] Ox0dea: He totally does.
[10:57:17] Ox0dea: https://gist.github.com/apeiros/39acc5b486f932403638
[10:57:30] GioVdK: thanks, going to have a look
[10:58:01] ukazap: has joined #ruby
[10:58:03] baweaver: has joined #ruby
[10:58:10] GioVdK: what I'm trying to do is convert the body part of an email, and with Iconv I found this snippet that worked: Iconv.conv('UTF-8', email.html_part.charset, email.html_part.body.to_s)
[10:58:34] GioVdK: but email.html_part.body.to_s.encode(Encoding::UTF_8) isn't as happy
[11:02:15] decaff: has joined #ruby
[11:02:18] TheHodge: has joined #ruby
[11:03:01] rodfersou: has joined #ruby
[11:03:20] bricker: has joined #ruby
[11:04:51] uglybandersnatch: has joined #ruby
[11:05:55] trinaldi: has joined #ruby
[11:06:00] GioVdK: ok found it -> .encode(Encoding::UTF_8, @email.html_part.charset)
[11:06:57] GioVdK: I initially missed the second parameter: encode(dst_encoding, src_encoding [, options] ) ;)
[11:09:31] arlek: has joined #ruby
[11:13:57] last_staff: has joined #ruby
[11:14:35] snowy: has joined #ruby
[11:14:48] FooMunki: has joined #ruby
[11:15:43] mfaeh: has joined #ruby
[11:17:06] mahk: has joined #ruby
[11:18:04] duckpuppy: has joined #ruby
[11:19:29] Felix444: has joined #ruby
[11:22:06] drptbl_: has joined #ruby
[11:32:48] shevy: >> "\x68\x65\x6c\x6c\x6f".b + ' world!'
[11:33:19] Ox0dea: Ten points from Gryffindor.
[11:33:45] poerror: has joined #ruby
[11:34:53] krz: has joined #ruby
[11:38:14] shevy: Ox0dea you made me google for Gryffindor... now I am reading up on hairy potter ... :(
[11:38:36] ldnunes: has joined #ruby
[11:39:00] CloCkWeRX: has joined #ruby
[11:39:08] adaedra: Ox0dea: did you mean Hufflepuff?
[11:40:20] Ox0dea: shevy: I believe you. :(
[11:40:33] Ox0dea: adaedra: His nick's red here.
[11:40:46] adaedra: Fair enough.
[11:40:58] Ox0dea: I see whence you came, though.
[11:41:44] ukazap: has joined #ruby
[11:42:38] workmad3: shevy: http://cdn.memes.mugglenet.com/2013/12/9/memes.mugglenet.com_4227_1386717800.jpg hairy potter!
[11:42:59] adaedra: Yer a gorilla, Hairy.
[11:43:06] emilkarl: has joined #ruby
[11:44:05] Ox0dea: Oh, wow, MuggleNet is still a thing.
[11:44:35] unseatingbread: has joined #ruby
[11:47:21] workmad3: Ox0dea: I'm not sure how much I'd class "Has an image on a CDN still" as "Still a thing" :)
[11:47:45] Ox0dea: workmad3: Well, no, but the site does indeed still exist.
[11:47:54] Ox0dea: Internet 2.0 has not been kind to it, in my estimation.
[11:48:35] shevy: workmad3 hah
[11:48:55] RegulationD: has joined #ruby
[11:48:57] atmosx: has joined #ruby
[11:49:39] stannard: has joined #ruby
[11:51:24] Xeago: has joined #ruby
[11:54:44] moeabdol: has joined #ruby
[11:55:21] astrobun_: has joined #ruby
[11:55:59] Pupp3tm4st3r: has joined #ruby
[11:59:19] but3k4: has joined #ruby
[12:01:59] blackmesa: has joined #ruby
[12:03:00] vondruch: has joined #ruby
[12:03:59] Hanmac: has joined #ruby
[12:04:13] Pupp3tm4st3r: has joined #ruby
[12:04:34] nanoz]: has joined #ruby
[12:05:01] bricker: has joined #ruby
[12:05:49] decaff: has joined #ruby
[12:06:14] merida: has joined #ruby
[12:06:24] ukazap: has joined #ruby
[12:06:44] godzillaenlacasa: has joined #ruby
[12:06:49] aryaching: has joined #ruby
[12:08:54] tvw: has joined #ruby
[12:08:59] Uo9er_: has joined #ruby
[12:09:20] Spami_: has joined #ruby
[12:09:21] norc: I have a set of objects that give me a slight delay when I try to invoke a not existing method. No method_missing was defined, and the only thing I can see being related to this is that deeper down in the instance variables there is a telnet connection somewhere that is a bit slow.
[12:09:44] norc: How can I sensibly get to the bottom of this?
[12:10:21] nanoz]: has joined #ruby
[12:11:51] synthroid: has joined #ruby
[12:12:21] hs366: has joined #ruby
[12:12:41] mg^: has joined #ruby
[12:13:08] andrewvos: use pry maybe
[12:13:37] shevy: weird error
[12:13:45] third: has joined #ruby
[12:13:58] shevy: do these objects read any data from a harddisc at runtime?
[12:14:52] andrewvos: how slight of a delay
[12:16:00] aryaching_: has joined #ruby
[12:16:04] freakcoder: has joined #ruby
[12:16:14] patrick_star_2: has joined #ruby
[12:19:40] Mon_Ouie: has joined #ruby
[12:20:09] tknz: has joined #ruby
[12:20:16] guest805: has joined #ruby
[12:20:30] stannard: has joined #ruby
[12:20:53] chouhoul_: has joined #ruby
[12:21:10] emilkarl: has joined #ruby
[12:21:18] rapha: has joined #ruby
[12:21:55] rapha: Is it possible that the return value of such an expression: "(plans & plan_types[locale.to_sym]).empty?" has changed somewhere between Ruby 1.8 and 2.3?
[12:23:00] darix: rapha: you would need to tell us the types of the variables
[12:23:56] rapha: darix: sorry, plans is an array containing integers. plan_types is a hash containing arrays containing integers. locale may be a string or a symbol.
[12:24:18] bronson: has joined #ruby
[12:25:13] JohnBat26: has joined #ruby
[12:27:00] Pupp3tm4st3r: has joined #ruby
[12:27:22] jottr: has joined #ruby
[12:28:10] rapha: darix: i'm trying to figure out why in the world I wrote "unless (plans & plan_types[locale.to_sym]).empty?" and expected it to get me into the unless's block when "plans" contained the right number or numbers.
[12:28:22] blackmesa: has joined #ruby
[12:29:09] liquid-silence: has joined #ruby
[12:29:09] liquid-silence: has joined #ruby
[12:29:14] nfk|laptop: has joined #ruby
[12:30:03] rapha: hmm wait it does exactly what it's supposed to do, and even does it correctly
[12:30:10] rapha: ACTION hates debugging his own years-old self
[12:31:14] shevy: rapha hah
[12:31:38] shevy: I hate doing rewrites of large old codebases the most
[12:32:15] ukazap: has joined #ruby
[12:32:29] guest805: has joined #ruby
[12:33:44] decaff: has joined #ruby
[12:34:20] ddv: u love it
[12:34:32] ddv: it makes u feel like a special snowflake
[12:34:56] shevy: it takes so much time away!
[12:35:21] adaedra: that's why you're stuck with ISO-8859-1 and CGI?
[12:36:19] rapha: i would actually *love* to be able to rewrite this whole thing. just i wanna be paid to do it. but i'm only being paid to maintain it.
[12:36:36] drptbl: has joined #ruby
[12:36:37] guest8051: has joined #ruby
[12:36:58] norc: adaedra: Things are really dire when you turn around and your collegue is pulling out a brand new PDH service unit out of the closet as a replacement... that is when you look at your outdated codebase and still smile.
[12:36:59] shevy: adaedra why do you write "stuck"?
[12:37:36] MrDoctor: has joined #ruby
[12:38:14] freakcoder: has joined #ruby
[12:39:46] shevy: rapha I found that especially in the late stage of a rewrite, I tend to more readily throw away the few things that seem too boring to still port
[12:40:29] rapha: shevy: let's call it "evolution through minimisation"
[12:41:51] shevy: for instance, I once had a disco prompt in something that interactively reads user input
[12:42:03] shevy: but I question how useful this really is...
[12:47:11] meinside: has joined #ruby
[12:47:15] safe: has joined #ruby
[12:47:35] callen92: has joined #ruby
[12:47:45] JohnBat26: has joined #ruby
[12:48:09] skade: has joined #ruby
[12:48:35] zotherstupidguy: has joined #ruby
[12:48:38] zotherstupidguy: has joined #ruby
[12:49:06] rahc: has joined #ruby
[12:49:25] rahc: $ sudo su -c 'RAILS_ENV="production" RAILS_ROOT="/srv/www/obs/webui/" rake -v --trace db:setup' www-data
[12:49:28] rahc: This account is currently not available.
[12:50:05] rahc: how can I get more useful information about what rake is failing to do?
[12:50:19] rahc: I've searched the web and the rake documentation but I can't find anything helpful
[12:51:00] freerobby: has joined #ruby
[12:51:00] rahc: hmm$ sudo su -c 'RAILS_ENV="production" RAILS_ROOT="/srv/www/obs/webui/" ls' www-data
[12:51:03] rahc: This account is currently not available.
[12:51:47] irick: has joined #ruby
[12:52:56] drptbl: has joined #ruby
[12:53:10] merida: has joined #ruby
[12:54:03] moeabdol: has joined #ruby
[12:54:31] lessless: has joined #ruby
[12:54:39] thomasfedb: has joined #ruby
[12:54:39] thomasfedb: has joined #ruby
[12:55:03] chagel: has joined #ruby
[12:55:09] sesquipedalian: has joined #ruby
[12:55:15] Dreamer3: has joined #ruby
[12:55:43] brixen: has joined #ruby
[12:56:18] mnms_: has joined #ruby
[12:56:30] tvw: has joined #ruby
[12:57:20] Dreamer3: has joined #ruby
[12:57:33] matp: has joined #ruby
[12:59:06] nanoz]: has joined #ruby
[12:59:11] baweaver: has joined #ruby
[12:59:56] vondruch_: has joined #ruby
[13:00:14] rapha: darix: shevy: figured it out. Apparently the code wasn't really at fault, but I was being too intolerant about time and didn't take into account that the user's clock might be out of sync with the server's clock.
[13:02:40] mnms_: Hi. I use sambal gem and I get "Unknown Process Failed!! (can't get Master/Slave device)". What could be the cause ? Permission problem ?
[13:04:11] mnms_: I get this when I try to connect to samba resource
[13:04:17] xaxisx: has joined #ruby
[13:04:56] joxer: has joined #ruby
[13:05:02] mfaeh: has joined #ruby
[13:06:01] davedev24: has joined #ruby
[13:07:07] gbgdev: has joined #ruby
[13:09:29] shredding: has joined #ruby
[13:10:17] Pupp3tm4st3r: has joined #ruby
[13:14:23] shevy: rapha a simple bug is a better bug than a heisenberg schroedinger-cat bug!
[13:14:37] freakcoder: has joined #ruby
[13:14:47] liquid-silence: has joined #ruby
[13:14:47] liquid-silence: has joined #ruby
[13:14:55] shevy: mnms_ I don't think many people here know how the sandal gem works
[13:15:03] Xeago: has joined #ruby
[13:15:50] nerium: has joined #ruby
[13:16:02] mnms_: shevy: I was counting that someone use this gem :)
[13:16:42] mnms_: shevy: this line is problematic
[13:16:43] mnms_: PTY.spawn("COLUMNS=#{options[:columns]} smbclient \"//#{options[:host]}/#{options[:share]}\" '#{options[:password]}' -W \"#{options[:domain]}\" -U \"#{options[:user]}\" -p #{options[:port]}")
[13:19:32] dionysus69: has joined #ruby
[13:20:15] astrobun_: has joined #ruby
[13:20:44] hs366: has joined #ruby
[13:23:39] Xeago: has joined #ruby
[13:27:17] vondruch: has joined #ruby
[13:28:42] Xeago_: has joined #ruby
[13:30:14] yeticry_: has joined #ruby
[13:30:48] malconis: has joined #ruby
[13:31:19] anagha_: has joined #ruby
[13:32:03] shevy: mnms_ it is best to build up into a variable, then output it so that all these interpolations are replaced
[13:32:43] GriffinHeart: has joined #ruby
[13:33:40] third: has joined #ruby
[13:34:05] norc: Hi. Given these two (simplified) tables, how can I select all ports, left joining only the last (largest by id) port_data rows? https://gist.github.com/anonymous/d94c5e3e069e2f81ff4f
[13:34:12] norc: Oh. Wrong channel indeed.
[13:34:33] solars: has joined #ruby
[13:34:37] rbennacer: has joined #ruby
[13:35:23] malconis: has joined #ruby
[13:36:10] guest805: has joined #ruby
[13:38:58] swills: has joined #ruby
[13:41:10] jrafanie: has joined #ruby
[13:41:51] Pupp3tm4st3r: has joined #ruby
[13:42:19] victortyau: has joined #ruby
[13:42:58] drptbl: has joined #ruby
[13:44:06] grill: has joined #ruby
[13:44:15] `tim`: has joined #ruby
[13:45:26] stannard: has joined #ruby
[13:45:57] Acontius: has joined #ruby
[13:45:58] skweek: has joined #ruby
[13:47:21] sdothum: has joined #ruby
[13:48:01] bluOxigen_: has joined #ruby
[13:48:15] CloCkWeRX: has joined #ruby
[13:48:49] yeticry: has joined #ruby
[13:49:57] RegulationD: has joined #ruby
[13:50:01] emilkarl: has joined #ruby
[13:50:02] sdothum: has joined #ruby
[13:50:38] blandflakes: has joined #ruby
[13:51:00] davedev24: has joined #ruby
[13:52:12] griffindy: has joined #ruby
[13:54:06] davedev24: has joined #ruby
[13:54:18] freakcoder: has joined #ruby
[13:54:49] ferr: has joined #ruby
[13:54:54] yeticry_: has joined #ruby
[13:55:34] paatala_bhairavi: has joined #ruby
[13:55:34] paatalaBhairavi: has joined #ruby
[13:56:28] hxegon: has joined #ruby
[13:59:50] aegis3121: has joined #ruby
[14:00:40] davedev24: has joined #ruby
[14:00:45] eurialo: has joined #ruby
[14:00:54] whippythellama: has joined #ruby
[14:06:52] Xeago: has joined #ruby
[14:06:53] zarubin: has joined #ruby
[14:06:54] qhp_: has joined #ruby
[14:06:55] SenpaiSilver_: has joined #ruby
[14:06:55] idle_task: has joined #ruby
[14:06:55] bricker: has joined #ruby
[14:06:55] Abrin_AWAY: has joined #ruby
[14:08:10] SenpaiSilver_: has joined #ruby
[14:08:37] aryaching: has joined #ruby
[14:08:48] ruind: has joined #ruby
[14:08:54] haylon: has joined #ruby
[14:09:29] axl_: has joined #ruby
[14:10:44] zarubin: has joined #ruby
[14:11:01] agit0: has joined #ruby
[14:11:03] dgncn: has joined #ruby
[14:12:24] freerobby: has joined #ruby
[14:12:38] emilkarl: has joined #ruby
[14:12:40] spintronic: has joined #ruby
[14:12:56] jgpawletko: has joined #ruby
[14:14:05] decoponio: has joined #ruby
[14:14:33] snowy: has joined #ruby
[14:14:50] hxegon: has joined #ruby
[14:15:16] joonty: has joined #ruby
[14:17:09] snowy: has joined #ruby
[14:18:02] FooMunki: has joined #ruby
[14:18:44] FooMunki: has joined #ruby
[14:18:58] jottr: has joined #ruby
[14:19:01] poerror: has joined #ruby
[14:23:15] VeryBewitching: has joined #ruby
[14:23:53] fullofcaffeine: has joined #ruby
[14:24:02] bry4n_: has joined #ruby
[14:24:16] cpup: has joined #ruby
[14:25:10] snowy: has joined #ruby
[14:25:19] nando293921: has joined #ruby
[14:25:36] iamvery: has joined #ruby
[14:26:23] Acontius: ACTION waves at VeryBewitching
[14:27:17] bronson: has joined #ruby
[14:27:55] chouhoulis: has joined #ruby
[14:28:26] skade: has joined #ruby
[14:28:30] roshanavand: has joined #ruby
[14:30:31] LiquidInsect: has joined #ruby
[14:32:22] krz: has joined #ruby
[14:33:05] daivyk: has joined #ruby
[14:33:25] blackmesa: has joined #ruby
[14:34:27] Karix: has joined #ruby
[14:35:02] dionysus69: has joined #ruby
[14:35:08] hxegon: has joined #ruby
[14:35:31] shevy: <yorickpeterse> omg stop casting spells on us
[14:35:57] mrmortondk: has joined #ruby
[14:36:15] spintronic: has joined #ruby
[14:38:07] beergineer: has joined #ruby
[14:39:23] mallu: has joined #ruby
[14:40:11] beergineer: hey, what's the difference between class A; def self.method; end ;end and class << self; def method; end; end? What are the use common use cases of each?
[14:40:51] fostertheweb: has joined #ruby
[14:42:06] freakcoder: has joined #ruby
[14:42:18] tjohnson: has joined #ruby
[14:42:29] DaniG2k: has joined #ruby
[14:43:45] moeabdol: has joined #ruby
[14:43:48] workmad3: beergineer: between those examples? nothing (they both define a method on the singleton class of A). `class << self` lets you do some extra stuff though, like `class A; class << self; attr_accessor :foobar; end; end` for setting up A.foobar and A.foobar=
[14:44:55] DmitryBochkarev: has joined #ruby
[14:45:20] crowell: has joined #ruby
[14:45:27] Xentil: has joined #ruby
[14:46:46] beergineer: workmad3: hmmn, but can't I do the same with to class A; attr_accesor :foobar; end as well?
[14:47:21] beergineer: beergineer: is it just a matter of syntax preference or there's more into it?
[14:47:30] Maletor: has joined #ruby
[14:47:33] workmad3: beergineer: that would define foobar and foobar= on instances of A, not on A itself
[14:47:47] Xeago: has joined #ruby
[14:48:08] beergineer: workmad3: aahh, that make sense. thanks
[14:48:21] workmad3: beergineer: or, in normal convention, A#foobar and A#foobar= rather than A.foobar and A.foobar= :)
[14:49:24] spintronic: has joined #ruby
[14:50:08] beergineer: workmad3: so, class A; def self.foobar=(x); end; def self.foobar; end; end is the same as class << self attr_accessor :foobar ;end?
[14:50:13] andrewvos: has joined #ruby
[14:50:27] workmad3: beergineer: essentially, yes
[14:51:11] beergineer: workmad3: gotcha, wonderful. One blunder cleared :)
[14:52:48] pawnbox: has joined #ruby
[14:53:07] iamvery: has joined #ruby
[14:53:24] RIK: anyone wanna build me a marginally-custom gem?
[14:53:34] marxarelli: has joined #ruby
[14:53:46] flazz: has left #ruby: ("WeeChat 1.4")
[14:53:53] RIK: or teach me how?
[14:54:00] inukshuk_: has joined #ruby
[14:54:34] freerobby: has joined #ruby
[14:55:06] polishdub: has joined #ruby
[14:55:34] halfamind: has joined #ruby
[14:56:56] rippa: has joined #ruby
[14:57:31] tomatoes: has joined #ruby
[14:57:59] merida: has joined #ruby
[14:59:54] baweaver: has joined #ruby
[15:00:44] resin: has joined #ruby
[15:01:55] hogetaro: has joined #ruby
[15:02:01] krz: has joined #ruby
[15:02:33] aegis3121: has joined #ruby
[15:03:31] freakcoder: has joined #ruby
[15:04:36] skade: has joined #ruby
[15:04:47] _stu_: has joined #ruby
[15:06:01] vondruch_: has joined #ruby
[15:06:41] uglybandersnatch: has joined #ruby
[15:08:20] Xeago: has joined #ruby
[15:08:40] roshanavand: has joined #ruby
[15:09:09] bricker: has joined #ruby
[15:09:45] EdwardIII: sorry for the baity question but... is there a rough consensus on which tool to use to get a nice new version of ruby running? i've used chruby on my app, but i'm now preparing ansible (and maybe cap) jobs to deploy into prod
[15:11:14] apeiros: EdwardIII: no
[15:11:32] EdwardIII: so just pick one and use it then i guess
[15:11:42] apeiros: there's rough consensus that you should use one of (I think) 3, but there's little to no consensus on which to use
[15:11:46] havenwood: EdwardIII: Usually one only needs a single version of Ruby in production so there's no need for a Ruby version switcher. A nice modern package manager Ruby is preferred. Or you can ruby-install to /usr/local with: ruby-install --latest --system
[15:11:54] madhatter: has joined #ruby
[15:11:58] apeiros: I think chruby is nowadays the most "advertized"
[15:12:04] havenwood: And best! :P
[15:12:06] apeiros: I myself use rvm and am happy with it
[15:12:08] EdwardIII: hrm with ubuntu lts i'm not going to get a nice modern version fo ruby
[15:12:31] Snowy_: has joined #ruby
[15:12:33] platzhirsch: has joined #ruby
[15:12:35] apeiros: and rbenv is the one I hear about the thirdmost about it. not sure about how good it is.
[15:12:36] havenwood: EdwardIII: Brightbox maintains up-to-date Ruby packages for Ubuntu: https://www.brightbox.com/docs/ruby/ubuntu/
[15:12:57] EdwardIII: one thing about chruby that i'm not so wild about, everyone seems to use it as root-by-default, whereas local::lib and virtualenv are always my-user-by-default
[15:12:59] shinnya: has joined #ruby
[15:13:08] apeiros: and +1 re havenwood's ruby-install if you're on a prod box which only needs a single ruby
[15:13:10] havenwood: EdwardIII: Create a .ruby-version file.
[15:13:12] EdwardIII: (or perlbrew might be a better comparision)
[15:13:21] EdwardIII: apeiros: ruby-install... without chruby?
[15:13:26] EdwardIII: apeiros: and just install as root?
[15:13:39] apeiros: EdwardIII: not necessarily as root. havenwood certainly has a better idea there.
[15:13:56] x77686d: has joined #ruby
[15:14:10] EdwardIII: mmm brightbox looks like quite a nice solution
[15:14:11] havenwood: EdwardIII: ruby-install --system to install Ruby into /usr/local (where it will be in your PATH)
[15:14:18] havenwood: EdwardIII: Brightbox is a nice solution!
[15:15:17] RIK: andrewvos: oops. sorry - just switched back. HAve you seen sqlcipher? It's a fork of sqlite that adds some pragma commands to deal with block encryption on the whole database.
[15:15:47] RIK: i would very much like to make use of this with Sequel.
[15:16:38] platzhirsch: has left #ruby: ()
[15:16:53] RIK: it *should* be as simple as linking against the sqlcipher libraries and using their headers, with no code changes - at least from me browsing the C headers last night.
[15:17:14] RIK: but i've never made a ruby gem before, and it's not what i want to get side-tracked learning right now.
[15:17:34] agit0: has joined #ruby
[15:18:48] slawrence00: has joined #ruby
[15:18:48] EdwardIII: yeah let's use brightbox hehe
[15:18:54] woodruffw: has joined #ruby
[15:18:55] EdwardIII: ACTION uninstalls chruby
[15:20:33] jottr: has joined #ruby
[15:20:57] DaniG2k_: has joined #ruby
[15:21:46] neilhwatson: has joined #ruby
[15:22:38] `tim`: has joined #ruby
[15:23:48] gbgdev: has joined #ruby
[15:24:09] Pupp3tm4st3r: has joined #ruby
[15:24:23] kies: has joined #ruby
[15:24:30] hxegon: has joined #ruby
[15:25:14] manveru: EdwardIII: nix :)
[15:25:59] andrewvos: chruby is the best
[15:26:12] andrewvos: it's never given me even the tiniest bit of a problem
[15:26:28] Skelz0r: has joined #ruby
[15:26:39] dhollinger: has joined #ruby
[15:27:21] andrewvos: also ruby-install
[15:27:33] manveru: ACTION uses nix-shell + direnv for all development
[15:27:44] manveru: and nix + nixops for deployment
[15:27:54] andrewvos: don't listen to manveru
[15:28:04] washt: has joined #ruby
[15:28:05] duderonomy: are there use cases where rbenv has pain points that do not exist in chruby ?
[15:28:29] andrewvos: use rbenv if you want to be unhappy
[15:29:27] andrewvos: probably don't use a version manager in production though
[15:29:43] andrewvos: actually definitely don't
[15:29:58] manveru: why's that?
[15:30:06] cdg: has joined #ruby
[15:30:17] DaniG2k: has joined #ruby
[15:30:42] andrewvos: cause then your provisioning becomes more painful?
[15:30:49] djbkd: has joined #ruby
[15:30:50] snowy: has joined #ruby
[15:30:52] nando293921: has joined #ruby
[15:30:53] manveru: yours, sure
[15:31:07] andrewvos: unless you like working with ansible or puppet or whatever is in vogue atm
[15:31:07] RIK: y'know those times where you realize ... maybe you've been going about something the wrong way?
[15:31:09] manveru: i specify even the checksums for the gems i use
[15:31:10] RIK: i think i just realized that.
[15:31:24] snockerton: has joined #ruby
[15:31:53] havenwood: duderonomy: Having to reshim, slowness when shimming over so much that rbenv ships with a C ext replacing a shell builtin, shipping it's own openssl ignoring your package manager's, etc.
[15:32:19] weemsledeux: has joined #ruby
[15:32:23] rahc: has left #ruby: ()
[15:32:47] andrewvos: doesn't sound like fun that manveru :)
[15:32:54] andrewvos: is nix-shell nice/
[15:33:03] manveru: i wrote https://github.com/manveru/bundix for that
[15:33:27] mleung: has joined #ruby
[15:33:32] manveru: sure, it basically gives you completely separate environments for each project
[15:33:41] duderonomy: thanks havenwood
[15:33:50] andrewvos: sounds nice
[15:34:16] manveru: and direnv has the `use nix` directive, which makes it start automatically when you cd into the directory
[15:34:50] andrewvos: how does it isolate apps?
[15:34:52] manveru: from there i spawn a tmux for each project
[15:34:54] andrewvos: I mean dependencies
[15:35:53] manveru: it builds them and stores them in /nix/store
[15:36:07] manveru: each dependency is hashed so there are no collisions
[15:36:10] Abrin_AWAY: has joined #ruby
[15:36:24] andrewvos: so, like, this uses a package manager or it has its own?
[15:36:39] manveru: so you can build nokogiri against 5 different libxml versions and just use a specific one
[15:36:45] andrewvos: it's not using containers is it?
[15:36:58] manveru: no, just an insane amount of symlinks
[15:37:07] manveru: and yes, it uses the nix package manager
[15:37:32] manveru: i'm also running NixOS, but was using the same before on Void Linux and OSX
[15:38:10] manveru: and this way my development and deployment flow really nicely :)
[15:38:19] manveru: no need for containers
[15:38:20] b|ackwolf: has joined #ruby
[15:38:26] emilkarl: has joined #ruby
[15:38:43] b|ackwolf: is there any name for #{} token?
[15:38:44] havenwood: I thought it was trolling when I first saw that rbenv was replacing realpath with a C extension... but nope: https://github.com/rbenv/rbenv/tree/master/src
[15:38:59] andrewvos: imagine it would be hard if you're freelance and jumping around a few projects though
[15:39:02] adaedra: b|ackwolf: interpolation?
[15:39:04] EdwardIII: i'm working iwth ansible
[15:39:11] EdwardIII: switched from chef, i've had some good results
[15:39:26] manveru: andrewvos: yeah, it's probably not for the faint of heart
[15:39:28] b|ackwolf: adaedra, not the subject. I mean a name for the symbol.
[15:39:29] platzhirsch: has joined #ruby
[15:39:35] EdwardIII: i'd go insane without some kind of tool like that to bring systems into sync
[15:39:40] ixti: has joined #ruby
[15:39:53] b|ackwolf: adaedra, like, hash rocket =>.
[15:40:02] manveru: andrewvos: but i like making nixops definitions of a clients deployment and run them in a container or virtualbox locallyy
[15:40:47] EdwardIII: man i've not even heard of nix package manager
[15:41:01] EdwardIII: brew-killer!?
[15:41:03] manveru: mostly it's just stuff like {services = {redis.enable = true; memcached.enable = true; ...}
[15:41:15] EdwardIII: that's be nice, there's been a big gap for something like this in the 'market' for a loooong time
[15:41:45] manveru: EdwardIII: yeah, osx support is better than ever :)
[15:42:01] EdwardIII: i'm kinda married to brew now though
[15:42:09] manveru: understandable
[15:42:23] manveru: it also doesn't have a lot of brews packages yet
[15:42:38] dikaio: has joined #ruby
[15:42:45] manveru: and you need a case sensitive drive
[15:43:58] whippythellama: has joined #ruby
[15:44:03] kobain: has joined #ruby
[15:44:26] dikaio_: has joined #ruby
[15:44:31] manveru: something quite cool is this: https://gist.github.com/travisbhartwell/f972aab227306edfcfea
[15:44:34] Uber|Dragon: has joined #ruby
[15:45:06] manveru: i should write some tutorials for ruby :)
[15:47:22] RIK: well ... damn
[15:47:28] RIK: looks like i was going about things the hard way.
[15:50:46] RegulationD: has joined #ruby
[15:51:28] Xeago: has joined #ruby
[15:51:41] digitalcakes: has joined #ruby
[15:52:05] axl_: has joined #ruby
[15:53:23] unreal: has joined #ruby
[15:53:37] Pupp3tm4st3r: has joined #ruby
[15:53:53] `tim`: has joined #ruby
[15:54:31] kappy: has joined #ruby
[15:56:33] pawnbox_: has joined #ruby
[15:57:15] norc: has joined #ruby
[15:57:40] jgpawletko: has left #ruby: ()
[15:58:12] n008f4g_: has joined #ruby
[15:58:17] merida: has joined #ruby
[15:58:32] synthroid: has joined #ruby
[15:59:27] amclain: has joined #ruby
[15:59:31] mfaeh: has joined #ruby
[16:00:47] d0nn1e: has joined #ruby
[16:01:31] dikaio: has joined #ruby
[16:02:25] shevy: manveru oh i see you have found the gobolinux way :) though granted that nixos is more sophisticated
[16:02:26] `tim`: has joined #ruby
[16:02:38] manveru: shevy: yeah :)
[16:02:52] manveru: nixos is gobolinux done right
[16:03:18] dikaio: has joined #ruby
[16:04:32] manveru: also, it's less dead
[16:04:47] mostlybadfly: has joined #ruby
[16:06:35] mark3: has left #ruby: ("PART #RubyOnRails :PART #jquery :PART #reactjs :PART ##javascript :PART #elixir-lang :PART #debian :PART #zsh :PART #nethunter :QUIT :Leaving.")
[16:06:50] dopamean_: has joined #ruby
[16:07:13] frustrum: has joined #ruby
[16:08:25] babblebre: has joined #ruby
[16:10:28] stunder001: has joined #ruby
[16:11:29] fostertheweb: has joined #ruby
[16:11:43] callen92: has joined #ruby
[16:11:49] jottr: has joined #ruby
[16:13:34] dgncn: has joined #ruby
[16:13:34] andrewvos: has joined #ruby
[16:13:51] bluOxigen: has joined #ruby
[16:14:19] mallu: has joined #ruby
[16:14:19] ixti: has joined #ruby
[16:15:06] aryaching: has joined #ruby
[16:15:16] mistermocha: has joined #ruby
[16:16:01] iamvery: has joined #ruby
[16:16:10] mistermocha: has joined #ruby
[16:16:56] mrgrieve1: has joined #ruby
[16:17:06] crayon: how can i run wpscan for example as a hosted service that end users can call from a web page?
[16:17:07] crayon: https://github.com/wpscanteam/wpscan
[16:19:15] siaW: has joined #ruby
[16:20:15] apeiros: crayon: I've seen this question before and pondered to answer. in case you wonder why nobody replies, here's why that's probably the case:
[16:20:19] apeiros: the question is far too broad
[16:20:36] apeiros: it's similar to the famous "how do I build a videogame" question.
[16:21:09] crayon: i disagree. i think it's quite straightforward. i want to host a command line tool, wpscan namely, as a web accessible service.
[16:21:25] apeiros: ok then, here a similarly broad answer as your question:
[16:21:26] siaW: hello. i want to write a method that will do execute e method after say every hour without using #sleep. this is what i have so far. https://gist.github.com/siaw23/3e3f6a6e97b14ef42b01 how can i accomplish this easy task?
[16:21:40] siaW: that will execute a method****
[16:21:43] crayon: i'm not sure how to go about doing this because wpscan is a cli ruby tool and is not normally deployed as a web service
[16:21:43] apeiros: build a webapp using any of the many available frameworks, then run either shell out to the executable from it, or use the library code directly.
[16:22:06] crayon: that answers my question
[16:22:14] BrianJ: has joined #ruby
[16:23:22] apeiros: *then either shell out to run… - somehow when rearranging the phrase, the word kept stuck.
[16:23:45] apeiros: crayon: you can disagree with me all you want - fact is you didn't get an answer. and there's usually two options for that: nobody knows, or your question is bad.
[16:23:46] andrewvos: there's probably a french word for that
[16:24:10] shevy: siaw you can use .send to invoke a method on any given object
[16:24:23] apeiros: s/.send/.public_send/ please
[16:24:47] apeiros: siaw: what's that arbitrary "without sleep" requirement?
[16:25:20] siaW: apeiros: i want to do the same thing, prolly with a “more effiecient” method than #sleep if there is
[16:25:32] apeiros: what makes you think sleep was inefficient?
[16:25:37] shevy: sleep is very efficient
[16:25:45] shevy: it does nothing but wait for the specified duration!
[16:26:12] apeiros: it actually does something - it informs the scheduler that it doesn't need to be scheduled. which makes it tons better than a busyloop.
[16:26:24] siaW: apeiros: i was thinking, that if i use this in my code. and there are say 20million users on my site using this method, i’ll have some problems, no?
[16:26:51] apeiros: if 20 million users hit that code, then yes, and then you're doing something wrong. you want to background that.
[16:27:07] apeiros: things like sidekiq, resque etc. are your friends for that
[16:27:25] siaW: exactly! that’s why i asked. i’m no expect (not yet :p)
[16:27:41] siaW: thanks anyway apeiros and shevy :)
[16:28:31] tamole: has joined #ruby
[16:28:43] bluOxigen_: has joined #ruby
[16:29:03] apeiros: siaw: but do you have 20mio users? or will it be 2?
[16:29:08] bronson: has joined #ruby
[16:29:22] siaW: apeiros: 0 users actually. i’m just playing :D :D
[16:29:23] apeiros: also - users? so that code is in a webapp?
[16:30:01] siaW: apeiros: i’m trying to use the Twitter api to post to a twitter account from a list of tweets, after say each hour
[16:30:23] apeiros: and from where? cli app? webapp? something else?
[16:30:37] apeiros: then you won't have 20mio users
[16:30:42] siaW: no i won't
[16:30:46] siaW: it’s a test app
[16:30:47] apeiros: you'll have precisely *one*
[16:30:50] siaW: i’m building it slowly
[16:30:51] siaW: from cli
[16:30:53] snowy: has joined #ruby
[16:30:53] siaW: later to web
[16:31:38] siaW: so i’m learning to build the api client by testing functionality first, in the cli and later to heroku
[16:31:42] tomchapin: has joined #ruby
[16:33:26] apeiros: siaw: ok. then I'd make sure you cleanly separate the scheduling part from the API interaction part.
[16:34:27] siaW: and if i do separate it, that’s when sidekiq comes in right?
[16:35:17] apeiros: whichever scheduler works on heroku.
[16:35:35] apeiros: heroku will probably be the limiting factor there. so best you figure out what will work there and what won't.
[16:36:28] elifoster: has joined #ruby
[16:36:44] yqt: has joined #ruby
[16:37:08] sneakerhax: has joined #ruby
[16:38:31] davee_: has joined #ruby
[16:40:32] Dimik: has joined #ruby
[16:40:53] bluOxigen: has joined #ruby
[16:42:04] andrewvos: has joined #ruby
[16:43:25] trinaldi: has joined #ruby
[16:43:26] htmldrum: has joined #ruby
[16:43:56] bezhermoso: has joined #ruby
[16:44:48] Peteykun: has joined #ruby
[16:45:28] tubulife-: has joined #ruby
[16:45:46] nerium: has joined #ruby
[16:46:36] decaff: has joined #ruby
[16:48:45] aegis3121: has joined #ruby
[16:50:11] crowell: has joined #ruby
[16:50:11] crowell: has joined #ruby
[16:52:59] blackmesa: has joined #ruby
[16:53:20] freakcoder: has joined #ruby
[16:53:37] minimalism: has joined #ruby
[16:53:59] washt: has joined #ruby
[16:55:00] bmalum: has joined #ruby
[16:55:15] Karunamon: has joined #ruby
[16:55:16] agit0: has joined #ruby
[16:58:16] chouhoul_: has joined #ruby
[16:58:34] woodruffw: has joined #ruby
[16:58:46] fullofcaffeine: has joined #ruby
[16:58:56] sucks: has joined #ruby
[16:59:04] woodruffw: has joined #ruby
[16:59:18] poerror: has joined #ruby
[16:59:34] pietr0: has joined #ruby
[17:01:31] kalopsian: has joined #ruby
[17:01:33] lxsameer: has joined #ruby
[17:01:39] mallu: has joined #ruby
[17:01:53] darix: siaw: https://github.com/mperham/sidekiq/wiki/Deployment
[17:03:44] bzb: has joined #ruby
[17:05:03] djbkd: has joined #ruby
[17:05:30] terminal_: has joined #ruby
[17:05:31] baweaver: has joined #ruby
[17:06:33] choke: has joined #ruby
[17:07:53] washt: has joined #ruby
[17:08:41] weemsledeux: has joined #ruby
[17:08:44] symm-: has joined #ruby
[17:09:20] Infra-Red: has joined #ruby
[17:15:16] aegis3121: has joined #ruby
[17:15:52] optimaleatscout: has joined #ruby
[17:17:33] aspiers: has joined #ruby
[17:18:01] Uo9er_: has joined #ruby
[17:18:44] snowy: has joined #ruby
[17:20:55] Xeago: has joined #ruby
[17:22:19] Devalo: has joined #ruby
[17:24:22] joonty: has joined #ruby
[17:24:38] SenpaiSilver: has joined #ruby
[17:24:55] Devalo: I'm making a little hangman game, where I want to reveal the letters of the word once the player guesses the right letter. I have a method called reveal_some_of_word with puts @word.gsub(@word, "-" * @word.length). How can I change one of the '-' to the correct letter?
[17:28:15] canton7: instead of substituting @word, instead substitute only letters which the user hasn't guessed yet
[17:28:16] shevy: Devalo many ways. one is to store your word as array instead
[17:28:18] darix: @word.gsub(/[^#{guessed_letters}]*/, '-')
[17:28:29] canton7: alternatively, loop through each letter in the word, and either add it or "-" to the string to display the user
[17:28:29] chouhoulis: has joined #ruby
[17:29:05] darix: @word.gsub(/[^#{guessed_letters}]*/g, '-')
[17:29:07] darix: you will find out
[17:30:10] bronson: has joined #ruby
[17:31:23] Karix: has joined #ruby
[17:31:24] emilkarl: has joined #ruby
[17:34:15] tvw: has joined #ruby
[17:35:01] aegis3121: has joined #ruby
[17:36:42] emilkarl: has joined #ruby
[17:37:39] Devalo: darix: thanks. First one is almost working.
[17:37:41] baweaver: has joined #ruby
[17:38:55] darix: Devalo: before setting guessed_letters i would check if it is actually contained in @word
[17:40:11] wreet: has joined #ruby
[17:40:14] Devalo: darix: yep. I'm calling this method after I've checked that the word contains the letter
[17:40:30] SCHAAP137: has joined #ruby
[17:41:07] fexilal: http://infraruby.com/blog/infraruby-4.0-released <--- exciting?
[17:41:22] apeiros: Devalo: str.tr("^#{guessed}", "-")
[17:41:33] apeiros: similar to gsub
[17:42:48] apeiros: fexilal: interesting at least
[17:44:15] symm-: has joined #ruby
[17:44:27] Mon_Ouie: has joined #ruby
[17:44:29] Devalo: apeiros: Didnt know about tr. That's fantastic. Thanks.
[17:45:07] weemsledeux: has joined #ruby
[17:45:09] nofxx: has joined #ruby
[17:45:18] blackmesa: has joined #ruby
[17:45:45] jackjackdripper: has joined #ruby
[17:45:48] Elenka: has joined #ruby
[17:46:07] Elenka: What's the website called
[17:46:09] Elenka: where you can check
[17:46:36] Elenka: internet flaws etc like security
[17:46:53] mox: has joined #ruby
[17:47:05] freakcoder: has joined #ruby
[17:47:20] apeiros: Elenka: https://cve.mitre.org ?
[17:47:29] rbennacer: has joined #ruby
[17:52:17] diegoviola: has joined #ruby
[17:52:37] halfamind: Hi. I am curious if anyone's customized IRB to be copy+paste-able into runnable Ruby. E.g., with the outputs printed as comments.
[17:52:55] halfamind: Alternatively, I'd love to get pointers to help me build such a thing.
[17:53:29] halfamind: (I find myself editing IRB transcripts to be syntax-highlightable and runnable as ruby.)
[17:53:40] apeiros: halfamind: a) use pry, b) in both pry & irb you can change the printed value
[17:53:41] codecop: has joined #ruby
[17:53:43] codecop_: has joined #ruby
[17:53:54] mr_robot_: has joined #ruby
[17:54:28] stunder001: has joined #ruby
[17:54:35] _ChiefAlexander: has joined #ruby
[17:54:52] drale2k: has joined #ruby
[17:55:14] wldcordeiro: has joined #ruby
[17:55:28] _blizzy_: has joined #ruby
[17:55:32] halfamind: apeiros: Thanks, interesting. I've done a little IRB customization for https://github.com/joeyAghion/console_color, but didn't see clear ways to reach into all of the output formatting.
[17:55:49] apeiros: halfamind: for irb, http://tagaholic.me/2009/05/29/exploring-how-to-configure-irb.html has some pointers. search for inspect mode
[17:56:06] ChiefAlexander: has joined #ruby
[17:56:09] apeiros: for pry, just read the wiki. iirc it has an entry on how to modify the inspect mode.
[17:57:05] halfamind: Thanks will check it out.
[17:57:43] choke: has joined #ruby
[17:57:57] apeiros: hm, interesting. seems I never updated my pryrc the way I did my irbrc. I had "=> <inspect>" replaced with "# => <inspect>" back in irb days.
[17:58:14] apeiros: which would actually be exactly what you're asking for.
[18:00:49] halfamind: Yes, exactly. Plus, would need to modify the prompt, and maybe a few other things.
[18:01:13] trinaldi: has joined #ruby
[18:02:22] stunder001: has joined #ruby
[18:03:10] woodruffw: has joined #ruby
[18:03:37] ruby2016: has joined #ruby
[18:03:40] woodruffw: has joined #ruby
[18:03:43] woodruffw: has joined #ruby
[18:04:55] ruby2016: Hey can I having trouble with this https://www.reddit.com/r/dailyprogrammer/comments/341c03/20150427_challenge_212_easy_r%C3%B6varspr%C3%A5ket/cqqc85a
[18:05:09] Pupp3tm4st3r: has joined #ruby
[18:05:31] ruby2016: basically I get errors with this $ ruby 212e.rb input | ruby 212e2.rb | cmp input && echo 'It works!'
[18:05:40] last_staff: has joined #ruby
[18:07:04] apeiros: "I get errors" is a horribly bad description.
[18:07:26] apeiros: when you get errors - *always* gist the full exception.
[18:08:05] manveru: ruby2016: and then ping Ox0dea :)
[18:08:40] janzo: has joined #ruby
[18:08:48] firstdayonthejob: has joined #ruby
[18:09:49] apeiros: oh. wow. til /[[] && []]/
[18:10:07] apeiros: how come I never knew that?
[18:10:11] Zarthus: apeiros: as a regex?
[18:10:16] Zarthus: to me that seems redundant :P
[18:10:29] hyperdrive: has joined #ruby
[18:10:30] apeiros: Zarthus: useful if one is a negation and the other isn't
[18:10:56] Zarthus: yeah, that's not a valid regex
[18:11:11] Zarthus: I get warnings
[18:11:13] apeiros: >> "hello" =~ /[[^aeiou] && [a-z]]/
[18:11:14] ruby[bot]: apeiros: # => 0 (https://eval.in/537669)
[18:11:21] Zarthus: ooh, it's not supposed to be used as empty
[18:12:05] ChiefAlexander: has joined #ruby
[18:12:24] riceandbeans: headius: I'm not sure about the jruby version, it's loading as a jar if that changes anything
[18:12:26] siaW: has joined #ruby
[18:12:44] riceandbeans: drbrain: I can't post the yaml file because it has secrets in it needed for the vendor software
[18:12:48] Zarthus: >> Regexp.new('[[^aeiou] && [a-z]]').to_s
[18:12:57] apeiros: ruby2016: ok, I guess the problem is not important to you.
[18:12:59] apeiros: ACTION off
[18:13:03] Zarthus: ruby[bot]: :(
[18:13:23] apeiros: grmbl, I need to fix that
[18:13:32] Zarthus: => "(?-mix:[[^aeiou] && [a-z]])"
[18:13:32] Zarthus: can't say I've come across that before
[18:13:42] ruby[bot]: has left #ruby: ("leaving")
[18:13:43] ruby[bot]: has joined #ruby
[18:13:43] ChanServ: +o ruby[bot]
[18:13:46] apeiros: Zarthus: try again
[18:13:50] Zarthus: >> Regexp.new('[[^aeiou] && [a-z]]').to_s
[18:13:52] ruby[bot]: Zarthus: # => "(?-mix:[[^aeiou] && [a-z]])" (https://eval.in/537680)
[18:13:57] cjbottaro: has joined #ruby
[18:14:16] apeiros: (?-mix: … ) is // with -imx flags
[18:14:26] apeiros: (?mix: … ) would be //mix
[18:14:35] mallu: has joined #ruby
[18:14:38] kriskropd: has joined #ruby
[18:14:41] Zarthus: ah, of course. I thought it was a special keyword
[18:14:52] apeiros: >> a = /foo/m; b = /bar/i; c = /#{a}#{b}/; [a, b, c]
[18:14:53] ruby[bot]: apeiros: # => [/foo/m, /bar/i, /(?m-ix:foo)(?i-mx:bar)/] (https://eval.in/537683)
[18:15:06] apeiros: >> a = /foo/m; b = /bar/i; c = /#{a}#{b}/; [/#{a}/, /#{b}/, c]
[18:15:08] ruby[bot]: apeiros: # => [/(?m-ix:foo)/, /(?i-mx:bar)/, /(?m-ix:foo)(?i-mx:bar)/] (https://eval.in/537684)
[18:15:34] apeiros: allows you to compose regexen
[18:15:36] apeiros: very handy.
[18:15:44] weemsledeux: has joined #ruby
[18:15:53] apeiros: that's the way I build my ~20 line regexen (where I have them - so far only irc & email)
[18:15:58] Zarthus: I feel like I've written too much PCRE that I don't appreciate whatever special regex ruby might support
[18:16:08] apeiros: I'm not even sure it's special
[18:16:16] apeiros: (?:) is non-capturing in most
[18:16:31] Zarthus: I don't think [[] && []] is in PCRE
[18:16:33] apeiros: and I could imagine that (?flags-negflags:…) is also supported by others. I don't know, though.
[18:16:43] apeiros: ah, yeah, that might well not be PCRE :)
[18:16:44] ruby2016: Hey Im sorry for my bad english, can someone help me out with this https://www.reddit.com/r/dailyprogrammer/comments/341c03/20150427_challenge_212_easy_r%C3%B6varspr%C3%A5ket/cqqc85a
[18:16:51] IrishGringo: has joined #ruby
[18:17:11] skade: has joined #ruby
[18:17:13] ruby2016: I keep getting an error for '$ ruby 212e.rb input | ruby 212e2.rb | cmp input && echo 'It works!''
[18:17:22] poerror: has joined #ruby
[18:17:29] apeiros: ACTION rolls eyes
[18:17:31] darix: apeiros: for things like parsing protocols ... he mentioned a tool that takes RFC ebnf and outputs validation code https://www.youtube.com/watch?v=GenjU6iRb6o
[18:18:37] apeiros: darix: for protocols I tend to stick with smaller regexen and use strscan
[18:18:55] AlexRussia: has joined #ruby
[18:18:59] darix: apeiros: just validating email addresses with regexp can be fun already :p
[18:19:05] kriskropd: has joined #ruby
[18:19:11] apeiros: I have a list of emails my regex rejects
[18:19:28] jenrzzz: has joined #ruby
[18:19:36] apeiros: specifically emails with comments (valid), with whitespace (valid) with only a local part (valid), and some others
[18:20:34] apeiros: and in the default config it only validates the length of the domain name, not the format. instead of doing that it does a dns lookup for AAAA, A, C and MX.
[18:24:06] toretore: has joined #ruby
[18:24:17] Vlat-: has joined #ruby
[18:26:01] arlek: has joined #ruby
[18:26:41] spider-mario: has joined #ruby
[18:27:31] rbennacer: has joined #ruby
[18:29:05] Vlat-: hi! sorry for maybe newbie question, but is there a way in Ruby to pass same argument to multiple functions? Like ->> in Clojure or .Set method in C# (or with statement in pascal flavors) ?
[18:30:04] emilkarl: has joined #ruby
[18:31:10] bronson: has joined #ruby
[18:31:46] solars: has joined #ruby
[18:33:22] jenrzzz_: has joined #ruby
[18:33:24] wreet: has joined #ruby
[18:34:29] Ox0dea: Vlat-: We tend to just chain method calls.
[18:35:14] davedev24: has joined #ruby
[18:35:16] riceandbeans: quick question, anyone here used monit/god/bluepill?
[18:35:38] riceandbeans: I've used monit/god and I'm just curious about opinions on bluepill in comparison to them
[18:35:50] Vlat-: Ox0dea: thx
[18:35:53] Xeago: has joined #ruby
[18:35:55] Ox0dea: >> 0.upto(Float::INFINITY).lazy.map { |x| x * x }.select(&:even?).take(10).reduce(:+)
[18:35:56] ruby[bot]: Ox0dea: # => 1140 (https://eval.in/537686)
[18:36:09] Ox0dea: Vlat-: There's a translation of the first example from https://clojuredocs.org/clojure.core/-%3E%3E
[18:36:46] Papierkorb: And I thought Erlang has insane syntax
[18:36:52] riceandbeans: I failed pretty bad at clojure, also leinengen runtimes made me cry
[18:36:53] Papierkorb: erlang is still worse though
[18:37:05] Ox0dea: riceandbeans: Drip helps.
[18:37:22] Vlat-: Ox0dea: in fact I did the same in my ruby project. Just missed a neat clojure-ish "->" macro in ruby. But blocks do the same in fact, just with other syntax
[18:37:41] crowell: has joined #ruby
[18:37:44] riceandbeans: I think clojure is just too functional for my brain
[18:37:44] Ox0dea: riceandbeans: For running on a persistent JVM.
[18:37:52] LoneHerm_: has joined #ruby
[18:37:57] Ox0dea: Ruby is extremely functional if you want it to be.
[18:37:57] riceandbeans: I found rust much easier to comprehend
[18:37:59] ldnunes: has joined #ruby
[18:38:06] haylon_: has joined #ruby
[18:38:15] riceandbeans: I tried ocaml too, had a hell of a time with that
[18:38:36] riceandbeans: you can't write ruby like you can something in the ML family
[18:38:46] Ox0dea: How do you mean?
[18:38:49] riceandbeans: or if you can, I've never seen it or heard of it
[18:39:04] Vlat-: riceandbeans: I think clojure is just too functional for my brain
[18:39:07] Vlat-: high five :)
[18:39:41] Vlat-: I love clojure, but I caught myself, that I'm spending three hours of thinking, about how to write function the most functional way
[18:39:43] riceandbeans: Vlat-: I'm not saying I dislike clojure, I'm just saying I couldn't get it when I tried, I'll probably come back to it later, for now though my free time is learning rust
[18:40:01] riceandbeans: rust is kinda functional but not full on ML functional
[18:40:08] Ox0dea: I feel like you must not be doing Ruby right if you find yourself with so tenuous a grasp of functional programming. :(
[18:40:17] Vlat-: In ruby I can do the same thing in 15 minutes.
[18:40:34] Vlat-: But... after clojure ruby seems too imperative. :)
[18:41:13] Ox0dea: Vlat-: The translation I posted is "functional" in every meaningful sense of the term.
[18:41:35] IrishGringo: has joined #ruby
[18:41:52] Ox0dea: Ruby just gives us what feels like a firmer foundation (objects).
[18:42:07] siaW: has joined #ruby
[18:42:22] [Butch]: has joined #ruby
[18:42:30] yuung: has joined #ruby
[18:42:37] olspookishmagus: has joined #ruby
[18:43:25] Vlat-: Ox0dea: oh, I didn't meant to offend Ruby :) It's my most favorite non-esoteric lang. :) And I completely agree with that functional code can be written in Ruby. It's all about language expressiveness.
[18:43:27] KanKava: has joined #ruby
[18:43:32] KanKava: has left #ruby: ()
[18:43:40] KanKava: has joined #ruby
[18:44:00] Ox0dea: You done done it now. What's your favorite esolang?
[18:44:18] Maletor: has joined #ruby
[18:44:21] Vlat-: Ox0dea: well... Common Lisp :)
[18:44:27] Ox0dea: Cheeky. :P
[18:44:51] yuung: why is lisp an esoteric language?
[18:45:09] Vlat-: prefix notation maybe
[18:45:25] Vlat-: but after couple of weeks it become your best friend, in fact
[18:46:23] yuung: Vlat- i would argue that it's been around too long to be an esoteric language
[18:46:40] yuung: Vlat- /used by a lot of institutions. but idk, it's a subjective term
[18:48:20] Vlat-: yuung: well, IMHO "esoteric" term is only a question of belief. If someone feels comfortable with brainf*ck - it's can't count as "esoteric" for such one. I rely on wikipedia, which counts lisp-family as "esoteric"
[18:49:35] blandflakes: has joined #ruby
[18:50:09] platzhirsch: has left #ruby: ()
[18:50:37] baweaver: has joined #ruby
[18:50:50] jackjackdripper: has joined #ruby
[18:52:08] Vlat-: btw, never supposed, that my dumb question about stacking methods will cause such polemic. :)
[18:52:40] Ox0dea: Vlat-: Do you read Wikipedia in a language other than English?
[18:52:58] Vlat-: Ox0dea: yep, it was in russian section
[18:53:16] Vlat-: functional programming -> russian
[18:54:28] crowell: has joined #ruby
[18:56:16] Ox0dea: Vlat-: https://eval.in/537692
[18:56:37] zapata: has joined #ruby
[18:56:56] Ox0dea: (->> cake have eat)
[18:56:58] Vlat-: btw, my bad. I re-read russian version of FP now, and can't find a mention about lisp family is esotheric.
[18:57:24] Ox0dea: Do be careful about turning your biases into "facts".
[18:57:58] jackjackdripper: has joined #ruby
[18:58:24] Vlat-: I was 100% sure. But too much (or few) coffee can make a bad favor for one like me
[18:58:36] Vlat-: sorry for disinformation anyway
[18:59:03] ChiefAlexander: has joined #ruby
[18:59:08] _blizzy_: has joined #ruby
[18:59:44] Vlat-: Ox0dea: the code you sent is just great :) hope I can master ruby such way one day :)
[19:00:22] Ox0dea: Shame about the backslashes. :\
[19:00:42] Ox0dea: Could just mush it all on one line, but that's not as powerful an illusion.
[19:00:47] Vlat-: really, almost oneliner turn ruby into lisp-dialect, it's awesome
[19:01:57] Vlat-: I did read "Metaprogramming Ruby 2 (2nd edition)" couple of month ago, but never suppsed that method_missing can be used such interesting way
[19:02:35] Ox0dea: #method_missing is Voldemort.
[19:03:40] djellemah: Ox0dea: why do you regard objects as a firmer foundation? (I have some ideas along those lines, but I'm curious to hear your thinking)
[19:03:47] woodruffw: has joined #ruby
[19:05:23] Ox0dea: djellemah: It's difficult to say precisely, and I do realize that all the paradigms are equivalently powerful.
[19:05:42] Ox0dea: Just kinda feels like there's some implicit structure to begin molding.
[19:06:20] dionysus69: has joined #ruby
[19:06:37] bjpenn: has joined #ruby
[19:06:52] blandflakes: has joined #ruby
[19:06:59] Ox0dea: If your thinking's the other way round, I'm interested. :)
[19:08:16] uglybandersnatch: has joined #ruby
[19:08:28] Xeago: has joined #ruby
[19:08:29] WebDawg: has joined #ruby
[19:08:49] tomatoes: has joined #ruby
[19:08:59] Ox0dea: Vlat-: More chameleon code: https://eval.in/537695
[19:10:04] Vlat-: about objects... in CL there's CLOS, which is one of the most advanced object model. In functional pardigm.
[19:10:49] skade: has joined #ruby
[19:10:54] djellemah: In one sentence - objects have an inside and an outside.
[19:11:56] Vlat-: Ox0dea: you rock. :)
[19:12:55] davedev24: has joined #ruby
[19:13:19] stunder001: has joined #ruby
[19:13:26] Ox0dea: djellemah: I suppose that's fair, but closures do the same thing; it's just the wall "feels" thinner.
[19:13:35] PedramT: has joined #ruby
[19:13:38] Ox0dea: To my mind, at any rate.
[19:15:12] jbueza: has joined #ruby
[19:16:01] crowell: has joined #ruby
[19:16:30] djellemah: After that an object can be used in many ways - as a closure over a specified subset of values (the params to initialize), as auto-multi-monad (every method can take a block), as partially-applied function (and relatedly as a locus for memoisation), as a container for state.
[19:17:05] bakedb: has joined #ruby
[19:17:37] nano-: has joined #ruby
[19:17:58] Ox0dea: This Ruby thing sounds really good! :)
[19:18:53] U7se6: has joined #ruby
[19:19:13] nano-: Trying to use rdoc to document a some C bindings that are split across multiple files. Noticed that it's broken - only a fraction of the methods are included in the docs. Tried workaround to cat everything into the same file which does generate docs for everything, but everything is in the top level namespace rather than in sub modules.
[19:19:16] davedev24: has joined #ruby
[19:19:35] emilkarl_: has joined #ruby
[19:19:43] Vlat-: about memoisation... can Ruby play into laziness? :)
[19:19:54] djellemah: But I also find it difficult to say precisely.
[19:20:34] fostertheweb: has joined #ruby
[19:20:38] nano-: I found this workaround from 2013 - https://jmkeyes.github.io/post/using-rdoc-with-ruby-c-extensions/ .. but that looks hacky - hoping there's another way.
[19:21:25] yqt: has joined #ruby
[19:21:41] nano-: or is it fine to define the same module multiple times?
[19:23:08] Ox0dea: nano-: Reopening a module is totally kosher.
[19:23:10] darkf: has joined #ruby
[19:23:40] Ox0dea: Ah, but you're talking about invoking rb_define_module() with the same name.
[19:23:58] platzhirsch: has joined #ruby
[19:24:06] djellemah: Vlat-: class Locus; def lazy; @lazy ||= :some_value end end is one way to do memoisation (except the value is nil). There are also lazy collections see docs for Enumerable#lazy
[19:24:22] djellemah: *when the value is nil
[19:24:30] Ox0dea: Vlat-: Memoization is quite different from laziness, mind, but Ruby certainly supports both.
[19:24:48] nano-: Ox0dea: yeah.. if that can exist there without the ifdef. I would like to avoid the ifdef there if possible to remove extra noise for the buildsystem.
[19:25:14] nano-: But maybe that messes up the type system.
[19:25:26] bjpenn: has joined #ruby
[19:25:34] Vlat-: djellemah & Ox0dea thx
[19:25:58] Ox0dea: nano-: TFA explains why this hack is necessary, but I couldn't say whether it's since been obviated.
[19:25:59] choke: has joined #ruby
[19:26:03] Ox0dea: (Probably not. :P)
[19:26:36] Vlat-: really apreciate your help for newbie.
[19:28:11] Vlat-: and a final question. Is there anything like lisp "macros" in Ruby, to completely fsck up with AST ? :)
[19:28:15] nano-: Ox0dea: TFA? I understand the workaround - was just hoping for a better solution. And lack of one, I was pondering if it would be an issue to define the top module always - rather than only for rdoc - thus avoiding the ifdef. But I guess I could just try it out instead of bothering people here with silly questions.
[19:28:50] snowy: has joined #ruby
[19:28:51] stunder001: has joined #ruby
[19:29:50] baweaver: has joined #ruby
[19:30:29] Ox0dea: nano-: TFA is "the fuzzy article".
[19:30:49] aegis3121: has joined #ruby
[19:31:29] fmcgeough: has joined #ruby
[19:32:44] Ox0dea: Since RDoc doesn't understand C, you have to play by its rules and give it an rb_define_module() to match before it'll proceed to document the relevant methods.
[19:34:05] freakcoder: has joined #ruby
[19:34:19] Ox0dea: Vlat-: You can play with virtually everything but the AST.
[19:34:20] djellemah: Vlat-: No macros - http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/179642 but you can do a lot with method_missing and instance_eval and define_method and so on.
[19:34:29] adaedra: Poor C, no one understand it.
[19:36:12] jackjackdripper: has joined #ruby
[19:36:35] Vlat-: djellemah: I'll save this link. It describe Ruby by a few words, but worth a 100+ page book. :)
[19:37:12] washt: has joined #ruby
[19:37:13] linoj: has joined #ruby
[19:37:48] djellemah: adaedra: C is OK, provided you have #include "ruby.h" :-p
[19:38:35] jackjackdripper: has joined #ruby
[19:38:52] stunder001: has joined #ruby
[19:39:03] Ox0dea: Vlat-: Memoization and laziness in a neat little bundle: https://eval.in/537715
[19:39:54] Coldblackice: has joined #ruby
[19:40:04] Ox0dea: It only calculates the next in the sequence when you ask it to (but it'll do so forever), and it uses Hash.new's block form (maybe my favorite method) to avoid re-computing known values.
[19:40:06] Vlat-: Ox0dea: now that was a quite 'functional' :)
[19:40:07] jbueza: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[19:41:06] Ox0dea: Vlat-: Ah, well, I am re-assigning `i` there, but close enough. :P
[19:41:23] bjpenn: has joined #ruby
[19:41:25] wreet: has joined #ruby
[19:41:31] ljames: any way to load a file (like 'require') as if it was typed directly into irb - keeping the local variables as is? some sort of instance_eval or module_eval?
[19:42:06] shevy: ljames not sure
[19:42:17] Ox0dea: ljames: Er, why not just `eval`? Also, please reconsider.
[19:42:30] shevy: you could have a look how irb loads ruby code
[19:43:25] agit0: has joined #ruby
[19:43:40] Vlat-: Ox0dea: however, I think we both can admit, that it's a dirty hack :)
[19:43:40] Papierkorb: ljames: *cough* binding.eval
[19:44:12] Ox0dea: Vlat-: No, I can't say I agree there.
[19:44:28] Vlat-: Ox0dea: yep, it works, but the whole language concept will protest about such code
[19:44:52] Ox0dea: Vlat-: I concede that it doesn't align terribly well with convention, but it's not out of place either.
[19:44:59] shevy: Ox0dea suggested eval before!
[19:45:22] Ox0dea: Papierkorb: That doesn't permit the introduction of new locals.
[19:46:47] htmldrum: has joined #ruby
[19:47:14] Ox0dea: >> foo = 1; binding.eval 'foo = 2; bar = 3'; [foo, (bar rescue :/)]
[19:47:15] ruby[bot]: Ox0dea: # => [2, :/] (https://eval.in/537731)
[19:47:22] benlieb: has joined #ruby
[19:48:20] al2o3-cr: has joined #ruby
[19:48:52] roshanavand: has joined #ruby
[19:49:35] jackjackdripper: has joined #ruby
[19:49:48] baweaver: has joined #ruby
[19:50:15] callen92: has joined #ruby
[19:50:47] Ox0dea: The Elixir folks really like that stream operator; they use it in a lot of their artwork.
[19:50:53] moeabdol: has joined #ruby
[19:51:00] Ox0dea: (I don't blame them. :x)
[19:51:45] wreet: has joined #ruby
[19:51:48] yuung: has joined #ruby
[19:54:41] stunder001: has joined #ruby
[19:55:35] Vlat-: Ox0dea: one know about Erlang^W Elexir! Can I ask you about your oppinion of the language?
[19:55:52] Terens: has joined #ruby
[19:55:59] Ox0dea: Vlat-: I don't know it past the surface.
[19:56:15] Terens: I am having a problem. I am trying to downgrade rubygems
[19:56:24] Terens: when I do everything brakes
[19:57:20] bjpenn: has joined #ruby
[19:57:22] Ox0dea: Terens: How come?
[19:57:27] Vlat-: Terens: please, define "everything". What exactly doesn't act as supposed to act?
[19:57:33] blackmesa: has joined #ruby
[19:57:48] siaW: has joined #ruby
[19:58:01] Terens: Sorry I am trying 4 hours to solve it
[19:58:32] Terens: rails:22:in `<main>': undefined method `activate_bin_path' for Gem:Module (NoMethodError)
[19:58:32] Terens:         from /home/vagrant/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
[19:58:32] Terens:         from /home/vagrant/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
[19:58:35] IrishGringo: has joined #ruby
[19:58:41] Terens: whatever I call
[19:58:46] Terens: gem install X i get this
[20:00:53] snowy: has joined #ruby
[20:01:12] jenrzzz: has joined #ruby
[20:01:25] govg: has joined #ruby
[20:02:06] Icey: has joined #ruby
[20:02:41] Vlat-: Terens: gem install rubygems-update ?
[20:02:51] poerror: has joined #ruby
[20:02:56] Terens: didnt try that...
[20:03:19] Vlat-: or rvm reinstall <version> (it's all from stackoverflow, i did never faced such error)
[20:03:51] Vlat-: version is about your ruby runtime
[20:03:57] Abrin_AWAY: has joined #ruby
[20:04:02] SG045734: has joined #ruby
[20:04:11] SenpaiSilver: has joined #ruby
[20:04:26] woodruffw: has joined #ruby
[20:04:34] Terens: https://github.com/rubygems/rubygems/issues/1420
[20:04:36] skade: has joined #ruby
[20:04:40] Terens: this is the reason for downgrade
[20:05:00] woodruffw: has joined #ruby
[20:05:53] woodruffw: has joined #ruby
[20:06:04] stunder001: has joined #ruby
[20:08:10] digitalcakes: has joined #ruby
[20:09:23] washt: has joined #ruby
[20:09:43] mrgrieves: has joined #ruby
[20:11:48] al2o3-cr1: has joined #ruby
[20:13:20] bjpenn: has joined #ruby
[20:13:36] nano-: has left #ruby: ()
[20:14:39] jottr: has joined #ruby
[20:14:57] cjbottaro: has joined #ruby
[20:16:30] Suntzu: has joined #ruby
[20:16:36] _stu_: has joined #ruby
[20:17:11] mistermo_: has joined #ruby
[20:18:23] solars: has joined #ruby
[20:19:50] bjpenn: has joined #ruby
[20:20:17] wreet: has left #ruby: ("Leaving")
[20:20:28] hxegon: has joined #ruby
[20:23:19] ixti: has joined #ruby
[20:24:07] ur5us: has joined #ruby
[20:24:47] al2o3-cr: has joined #ruby
[20:25:01] Vlat-: has joined #ruby
[20:26:06] freakcoder: has joined #ruby
[20:26:25] cdg: has joined #ruby
[20:26:49] pawnbox: has joined #ruby
[20:27:44] mistermo_: has joined #ruby
[20:29:56] LoneHerm_: has joined #ruby
[20:31:44] aryaching_: has joined #ruby
[20:33:00] bronson: has joined #ruby
[20:33:44] Xeago: has joined #ruby
[20:34:46] darix: Terens: to which version of rubygems did you downgrade?
[20:35:23] darix: i would probably stick to the rubygems version that comes with 2.3
[20:35:25] ldnunes_: has joined #ruby
[20:38:36] darix: Terens: tbh i would use tenderlove's monkey patch :p
[20:41:52] rhg135: has joined #ruby
[20:43:00] zacstewart: has joined #ruby
[20:43:04] mwlang: has joined #ruby
[20:43:32] rhg135: has joined #ruby
[20:44:16] guest805: has joined #ruby
[20:45:47] siaW: has joined #ruby
[20:47:03] pawnbox: has joined #ruby
[20:47:43] shevy: would someone stop patching those poor monkeys!
[20:49:26] kobain: has joined #ruby
[20:50:09] IanMalcolm: has joined #ruby
[20:51:43] baweaver: has joined #ruby
[20:54:40] chrisja: has joined #ruby
[20:54:40] lemur: has joined #ruby
[20:56:00] guest805: has joined #ruby
[20:56:53] LoneHermit: has joined #ruby
[21:03:56] poerror: has joined #ruby
[21:04:51] mostlybadfly: has joined #ruby
[21:04:59] woodruffw: has joined #ruby
[21:07:52] roshanavand: has joined #ruby
[21:08:19] guest805: has joined #ruby
[21:09:10] bricker: has joined #ruby
[21:09:11] Xeago: has joined #ruby
[21:09:41] drptbl: has joined #ruby
[21:10:52] varesa: has joined #ruby
[21:14:06] Uber|Dragon: has joined #ruby
[21:14:49] ChiefAlexander: has joined #ruby
[21:15:13] jwinder: has joined #ruby
[21:17:31] bjpenn: has joined #ruby
[21:19:23] _stu_: has joined #ruby
[21:19:55] Uo9er_: has joined #ruby
[21:20:14] Cohedrin: has joined #ruby
[21:23:07] sepp2k: has joined #ruby
[21:23:54] Don_John: has joined #ruby
[21:24:25] choke: has joined #ruby
[21:24:27] jottr: How could I do something like this: User.find(1..10) ? < This is obviously not possible, but is there some similar construct?
[21:25:16] Ox0dea: jottr: You... want the first 10 Users?
[21:25:25] LoneHermit: has joined #ruby
[21:25:31] jottr: Ox0dea: yep
[21:25:50] Ox0dea: jottr: I bet there's a dedicated method for that. ;)
[21:26:11] jottr: Ox0dea: you bet, or know?
[21:26:43] Ox0dea: jottr: Note the winky face.
[21:26:46] rattatmatt: has joined #ruby
[21:27:00] jottr: Ah. first takes a parameter
[21:27:16] jottr: Good to know. :)
[21:27:25] jottr: One more question:
[21:27:52] Ox0dea: jottr: I suppose that is a little surprising the first time round; #take is a little more appropriate without any context.
[21:28:10] djbkd: has joined #ruby
[21:29:39] flopsec: has joined #ruby
[21:29:40] jottr: So, I do the following: F.all.each do |u| hsh = { uid: user.id }
[21:29:48] jottr: sorry. let me try again:
[21:30:40] Ox0dea: Sounds like you might want #map.
[21:30:41] jottr: Foo.all.each do |f| hsh = { foo_id: foo.id, count: foo.users.count } end
[21:31:11] Ox0dea: Why count the users more than once?
[21:31:11] skade: has joined #ruby
[21:31:47] ctrlrsf: has joined #ruby
[21:32:27] jottr: This is just a conrtived example. What I want is to iterate over Foo, and store each foo.id and the number of users associated with foo in a hash.
[21:32:36] tvon: has joined #ruby
[21:34:18] blackgoat: has joined #ruby
[21:34:25] jzigmund: has joined #ruby
[21:35:09] jottr: Ox0dea: ^
[21:35:25] Ox0dea: jottr: Needs less contrivance.
[21:37:23] johnmilton: has joined #ruby
[21:42:47] wreet: has joined #ruby
[21:45:04] lsmola: has joined #ruby
[21:45:08] vondruch_: has joined #ruby
[21:45:23] gagrio: has joined #ruby
[21:46:35] pawnbox: has joined #ruby
[21:48:32] poerror: has joined #ruby
[21:50:38] ruby312: has joined #ruby
[21:52:11] uglybandersnatch: has joined #ruby
[21:53:23] ruby312: not sure if this is the right place for this. new to Ruby. if I have multiple versions of rbenv installed. which is the appropriate directory if I'm using zshrc -- usr/local/bin or Users/admin?
[21:53:34] RegulationD: has joined #ruby
[21:53:47] adaedra: Multiple versions of _rbenv_? Why?
[21:54:18] ruby312: not sure how it happened...
[21:54:38] adaedra: Maybe you want to clean all this mess
[21:54:56] adaedra: Because it sounds like the best idea to have problems
[21:55:03] johnmilton: has joined #ruby
[21:55:05] junixbr: has joined #ruby
[21:55:14] ruby312: but I'm trying to upgrade my Ruby build and I'm not able to get access to the latest build...
[21:56:03] ruby312: so if I were starting from scratch what directory path would I use for rbenv?
[21:56:17] junixbr: I'm trying to install rails in my server, but when I try to install "gem install bundler", I've got the error: 'ERROR: While executing gem ... (OpenSSL::BNError) PRNG not seeded'
[21:56:37] adaedra: You seem to be on a mac, I think homebrew (if you use it) can take care of installing it for you, iirc
[21:56:48] junixbr: doesn't matter my source
[21:56:52] junixbr: https or not
[21:56:57] mintux: has joined #ruby
[21:57:11] ruby312: yeah, used Homebrew, but still having the problem...
[21:57:34] adaedra: junixbr: you seem to have something eating your entropy or not having enough entropy source.
[21:58:02] ruby312: when I run `brew upgrade rbenv ruby-build` its not giving me access to all the builds... 2.3.0 is still the dev version...
[21:58:31] ruby312: need 2.3.0
[21:58:39] ruby312: getting 2.3.0-dev
[21:58:51] junixbr: adaedra: this is a chrooted environment
[21:58:55] adaedra: what does `which rbenv` gives, ruby312?
[21:59:13] adaedra: junixbr: have you mounted /dev in it or at least provided /dev/{,u}random ?
[21:59:27] platzhirsch: has joined #ruby
[21:59:54] junixbr: adaedra: I have no random
[22:00:22] Noxilex: has joined #ruby
[22:00:25] flopsec: has joined #ruby
[22:00:34] adaedra: junixbr: seems like this is your problem here. Either bind mount a /dev, either create {,u}random devices in your chrooted environment.
[22:00:44] ctrlrsf: has joined #ruby
[22:00:59] junixbr: adaedra: thanks, I'm gonna try
[22:01:33] roshanavand: has joined #ruby
[22:01:52] ruby312: not getting a path when I run 'which rbenv'
[22:02:09] adaedra: ruby312: try `/usr/bin/which rbenv`
[22:02:20] adaedra: should bypass the function
[22:02:57] adaedra: anyway, I would recommend you to find and destroy all rbenv installed, then do a clean, brew controller install of it (or better — but I'm being partial here — switch to chruby)
[22:03:04] baweaver: has joined #ruby
[22:03:04] junixbr: adaedra: /proc/sys/kernel/random/entropy_avail is 167
[22:03:24] ruby312: getting /usr/local/bin/rbenv
[22:03:28] adaedra: junixbr: if your chrooted environment has no access to the random device, this is no use
[22:03:40] junixbr: adaedra: ok
[22:03:44] junixbr: I'll fix it
[22:03:46] adaedra: ruby312: sounds like brew-controlled one. Did you try updating ruby-build too?
[22:04:00] ruby312: which is one of the paths I get when I curl rbenv-doctor...
[22:04:31] stannard: has joined #ruby
[22:05:11] ruby312: yep, ran 'brew update' first... then `brew upgrade rbenv ruby-build`
[22:05:35] adaedra: and still no 2.3.0 available in rbenv?
[22:05:44] ruby312: then `rbenv install -l`
[22:05:57] ruby312: nope only got 2.3.0-dev
[22:06:01] adaedra: and if you do rbenv install 2.3.0 anyway?
[22:06:13] ruby312: yep, threw and error.
[22:07:05] guest8051: has joined #ruby
[22:07:25] adaedra: I don't remember rbenv well enough at this point.
[22:07:28] Ox0dea: Definitely a bug, right? https://eval.in/537751
[22:07:44] Ox0dea: Refinements aren't supposed to active for "indirect" invocations, but that seems pretty direct by my lights.
[22:07:57] ruby312: I get this when I run `rbenv install 2.3.0` -- `ruby-build: definition not found: 2.3.0 The following versions contain `2.3.0' in the name: 2.3.0-dev rbx-2.3.0 See all available versions with `rbenv install --list'. If the version you need is missing, try upgrading ruby-build:`
[22:08:43] darix: junixbr: install haveged
[22:08:49] ruby312: also force uninstalled ruby-build and reinstalled. still no dice...
[22:08:55] junixbr: darix: in chroot?
[22:09:02] darix: on the host probably
[22:09:05] woodruffw: has joined #ruby
[22:09:31] ruby312: got adaedra, thx for trying to help tho...
[22:09:35] woodruffw: has joined #ruby
[22:09:57] ruby312: got you adaedra, thx for trying to help tho...
[22:09:58] adaedra: ruby312: what I said about chruby (and its friend ruby-install) still holds :p
[22:10:20] skade: has joined #ruby
[22:10:21] ruby312: missed that part. could you repeat... :-)
[22:10:44] adaedra: You can remove rbenv (and ruby-build) totally and switch to chruby+ruby-install.
[22:10:56] adaedra: It's even capable of using your rbenv installed rubies.
[22:11:03] Xeago: has joined #ruby
[22:11:53] ruby312: aha, got you. thx, I'll look into that.
[22:12:49] jenrzzz: has joined #ruby
[22:14:05] platzhirsch: has left #ruby: ()
[22:14:35] braincrash: has joined #ruby
[22:15:03] amclain_: has joined #ruby
[22:15:24] hplar_: has joined #ruby
[22:15:36] iNeedHelp: has joined #ruby
[22:15:36] canton7_: has joined #ruby
[22:15:39] zenlot: has joined #ruby
[22:15:42] badeball: has joined #ruby
[22:15:43] Karunamon: has joined #ruby
[22:16:05] FifthWall_: has joined #ruby
[22:16:18] rvchangue: has joined #ruby
[22:16:50] Koshian_: has joined #ruby
[22:17:00] DylanJ: has joined #ruby
[22:17:04] tvon: has joined #ruby
[22:17:11] mintux: has left #ruby: ()
[22:17:15] mleung: has joined #ruby
[22:18:06] shevy: ruby ruby ruby
[22:18:17] shevy: what is up with jhass ... he is so quiet since like 8 months... :(
[22:19:34] Queeniebee: has joined #ruby
[22:19:38] tigarcia: has joined #ruby
[22:20:14] dwyn: has joined #ruby
[22:21:21] junixbr: adaedra: mount -o bind /dev /virtual/dev/ solve my problem
[22:21:26] darix: shevy: you scared jhass
[22:21:29] junixbr: thank you darix
[22:21:34] darix: junixbr: uhm
[22:21:42] darix: junixbr: mknod would have been enough i think
[22:21:48] darix: with just dev/urandom
[22:21:49] baweaver: has joined #ruby
[22:21:58] darix: + /dev/null /dev/zero
[22:22:28] junixbr: darix: probably
[22:22:35] adaedra: depending on the requirements, the full bind may be quicker for the same results
[22:22:48] darix: adaedra: maybe
[22:22:59] tvon: has joined #ruby
[22:23:01] darix: i usually "chroot" apps with apparmor+syscall filter
[22:23:14] adaedra: if you have a chroot for security requirements, on the other hand, rather go for manual creation, sure
[22:23:33] adaedra: but at least, this could confirm what the problem is :)
[22:24:00] darix: i would still install haveged ... your entropy_avail was low
[22:24:05] darix: and it will help with that.
[22:26:13] DylanJ: has joined #ruby
[22:27:50] WebDawg: has joined #ruby
[22:29:21] freakcoder: has joined #ruby
[22:29:47] Ox0dea: Could've just twiddled his mouse a bit.
[22:30:28] Ox0dea: How many bits of entropy to the mickey?
[22:30:53] govg: has joined #ruby
[22:30:55] adaedra: Depends, they may be between a ssh.
[22:32:00] htmldrum: has joined #ruby
[22:32:54] Ox0dea: Mickeys on the Wire.
[22:33:30] darix: Minnie doesnt like when Mickey is on the wire. she always screams
[22:34:11] bronson: has joined #ruby
[22:34:12] solocshaw: has joined #ruby
[22:37:53] rnda: has joined #ruby
[22:38:52] urunda: has joined #ruby
[22:39:21] baweaver: has joined #ruby
[22:40:24] zenlot6: has joined #ruby
[22:40:32] LoneHermit: has joined #ruby
[22:40:36] ziyadb: has joined #ruby
[22:41:46] nando293921: has joined #ruby
[22:42:43] snockerton: has joined #ruby
[22:45:22] Mattx: has joined #ruby
[22:46:04] yuung: has joined #ruby
[22:47:27] jaruga: has joined #ruby
[22:49:18] aibot: has joined #ruby
[22:50:48] weemsledeux: has joined #ruby
[22:54:11] mrgrieves: has joined #ruby
[22:55:12] Mattx: has joined #ruby
[22:55:52] gregf: has joined #ruby
[22:56:12] digitalcakes: has left #ruby: ()
[22:56:30] uglybandersnatch: has joined #ruby
[22:57:37] govg: has joined #ruby
[22:58:57] tvon: has joined #ruby
[23:00:01] wldcordeiro: has joined #ruby
[23:02:09] uglybandersnatch: has joined #ruby
[23:02:59] platzhirsch: has joined #ruby
[23:03:01] jottr: has joined #ruby
[23:05:32] Moosashi: has joined #ruby
[23:09:30] jdreaver: has joined #ruby
[23:10:06] jdreaver: I'm trying to use standalone_migrations to make a migration, and for some reason it ignores a "GRANT USAGE" command. Has anyone used this tool for GRANT USAGE?
[23:10:10] woodruffw: has joined #ruby
[23:10:45] tubulife-: has joined #ruby
[23:10:52] bezhermo_: has joined #ruby
[23:13:18] tvon: has joined #ruby
[23:13:41] lxsameer: how can i get time in microsecond
[23:14:09] dikaio: has joined #ruby
[23:15:06] aeterne: has joined #ruby
[23:15:08] Ox0dea: >> Time.now.to_f # lxsameer
[23:15:09] ruby[bot]: Ox0dea: # => 1458170108.8641977 (https://eval.in/537770)
[23:15:22] rbennacer: has joined #ruby
[23:15:37] Ox0dea: Or even #to_r if you need Rationality.
[23:15:54] lxsameer: Ox0dea: thanks
[23:16:02] havenwood: >> time = Time.now; [time.to_f, time.tv_usec]
[23:16:04] ruby[bot]: havenwood: # => [1458170163.2357304, 235730] (https://eval.in/537771)
[23:16:09] rbennacer: has joined #ruby
[23:16:15] jkahn: has joined #ruby
[23:16:15] kalopsian: has joined #ruby
[23:16:19] johnmilton: has joined #ruby
[23:17:11] DLSteve: has joined #ruby
[23:17:13] rbennacer: has joined #ruby
[23:18:29] intrigueD: has joined #ruby
[23:18:31] guest805: has joined #ruby
[23:18:38] intrigueD: has joined #ruby
[23:18:53] havenwood: >> time = Time.now; [time.usec, time.tv_usec, time.strftime('%6N').to_i]
[23:18:54] ruby[bot]: havenwood: # => [997169, 997169, 997169] (https://eval.in/537772)
[23:19:10] U7se6: has joined #ruby
[23:21:04] nullFxn: has joined #ruby
[23:21:50] PlasmaStar: has joined #ruby
[23:25:18] nfk: has joined #ruby
[23:26:39] phredus: havenwood: Thank you very mudch for the help yesterday, the discussion with you helped me understand how rails is put together. I was able to get my system working well and without errors.
[23:26:39] phredus: I also found this great video https://www.youtube.com/watch?v=4DqzaqeeMgY detailed explanation of what Bundler does. Thanks again
[23:26:52] kam270: has joined #ruby
[23:28:33] nano-: has joined #ruby
[23:28:45] nano-: How do I convince rdoc to generate documentation for constants?
[23:28:54] symm-: has joined #ruby
[23:29:11] nano-: I like the default theme, but it doesn't emit any constants. If I change to another theme, I get constants - but they look nasty.
[23:29:15] nano-: Am I missing any option?
[23:29:33] sondnm: has joined #ruby
[23:29:41] Gasher^: has joined #ruby
[23:31:42] woodruffw: has joined #ruby
[23:32:52] babblebre: has joined #ruby
[23:33:06] wldcordeiro: has joined #ruby
[23:33:14] jottr: has joined #ruby
[23:33:59] guest8051: has joined #ruby
[23:35:03] darix: tried yard or sdoc?
[23:38:46] platzhirsch: has left #ruby: ()
[23:41:34] gbgdev: has joined #ruby
[23:42:21] rkazak: has joined #ruby
[23:46:22] nano-: darix: yes, yard looked like crap. should look at sdoc then.
[23:46:37] nano-: darix: do you know of any page that reviews yard templates?
[23:47:19] n008f4g_: has joined #ruby
[23:47:59] nano-: darix: sdoc doesn't emit constants either. although yard does.
[23:48:48] marchelz1: has joined #ruby
[23:49:28] htmldrum: has joined #ruby
[23:51:23] radgeRayden: has joined #ruby
[23:52:00] marchelz1: hi, what is the point of the each_with_object method on Array? is there some in particular that makes it interesting/necessary, or is it just a convenience thing?
[23:52:12] marchelz1: s/some/something/
[23:52:22] endash: has joined #ruby
[23:52:28] havenwood: >> [].public_method(:each_with_object).owner
[23:52:30] ruby[bot]: havenwood: # => Enumerable (https://eval.in/537780)
[23:52:32] yuung: has joined #ruby
[23:52:59] marchelz1: ok, Enumerable
[23:53:54] Pathfinder: has joined #ruby
[23:54:34] Ox0dea: marchelz1: It's "just" a convenience.
[23:55:05] Ox0dea: It's good for "pipelines" and the like.
[23:56:01] havenwood: marchelz1: When you want the same arbitrary object for each iteration that then gets returned at the end.
[23:56:13] kobain: has joined #ruby
[23:56:31] Ox0dea: And don't like mutable state without referential transparency.
[23:56:39] roshanavand: has joined #ruby
[23:57:19] CloCkWeRX: has joined #ruby
[23:57:38] tomatoes: has joined #ruby
[23:57:48] pawnbox: has joined #ruby
[23:58:14] Nawn: has joined #ruby
[23:58:44] Ropeney: has joined #ruby
[23:58:48] jyaworski: has joined #ruby