« Back to channel list

#ruby - 23 March 2017

« Back 1 day Forward 1 day »
[00:01:28] skweek: has joined #ruby
[00:06:48] Azure|dc: has joined #ruby
[00:07:05] jeffreylevesque: has joined #ruby
[00:07:16] Channel6: has joined #ruby
[00:10:20] jdm: has joined #ruby
[00:10:25] jhack: has joined #ruby
[00:10:29] jhack: has joined #ruby
[00:13:45] BabyMario: has joined #ruby
[00:15:34] hays_: has joined #ruby
[00:15:34] hays_: has joined #ruby
[00:17:25] cagomez: has joined #ruby
[00:19:57] ElDoggo: has joined #ruby
[00:21:19] Verity: @name = name
[00:24:09] Verity: is ruby wild and crazy
[00:24:50] allisio: It used to be.
[00:27:18] Verity: SHould I really go with 2.2.6
[00:27:35] Verity: I'm looking at the windows installer
[00:27:47] Verity: Am I missing out on the latest features
[00:29:14] Disavowed: Verity: I understand that there have been some performance improvements in 2.4.0 but which version won't matter much to you when starting out. Just get the latest one for your platform and get coding!
[00:29:21] ascio: has joined #ruby
[00:29:23] jeffreylevesque: has joined #ruby
[00:30:33] Verity: I have Ruby.
[00:32:21] Disavowed: Woooo! You've come a long way this morning!
[00:33:00] Verity: it really has been 7 hours and thats all I've accomplished...
[00:33:06] allisio: Pretty stupid.
[00:33:40] houhoulis: has joined #ruby
[00:33:46] Verity: no, allisio
[00:33:48] Verity: now I'm sure
[00:33:54] matthewd: Verity: I'd suggest your first priority now is to ensure the gem we looked at earlier actually works to talk to a serial port
[00:34:03] Disavowed: I don't know about that. I mean you weighed up a couple of different languages, created at least 3 IRC accounts, looked at some tutorials to work out if the language was for you, learned about blocks, etc
[00:34:08] Verity: leave the ad hominem to the people in #python and escially ##c++
[00:34:31] Verity: I learned about the history of languages
[00:34:38] Verity: unit testing
[00:34:53] Verity: the more I read ruby syntax, the more I like it
[00:35:02] Verity: I want to either go lower level, asm, c, c++
[00:35:04] Verity: or higher, but python
[00:35:07] Verity: it tells me what to do
[00:35:08] Verity: I dont like that
[00:35:13] Verity: I once spent an hour debugging
[00:35:14] allisio: You were shitting on yourself (with good reason), and I decided to join the fun.
[00:35:17] allisio: That's not ad hominem.
[00:35:17] Verity: it was a tab instead of 4 spaces
[00:35:22] matthewd: (the "Windows" factor makes me nervous)
[00:35:23] allisio: You're noise.
[00:35:42] coatezy: has joined #ruby
[00:35:43] Verity: more ad homimen
[00:36:14] Verity: matthewd, I don't prefer windows, I use linux just as much
[00:36:34] Disavowed: Verity: Everyone in this channel will recommend you do Ruby development on Ruby
[00:36:44] Disavowed: sorry, need my lunch!
[00:36:51] Verity: why is that?
[00:37:00] Verity: is windows less supported
[00:37:03] matthewd: .. or Mac, or BSD, or anything else that's not windows
[00:37:26] Disavowed: It is (was?) much easier to get up and running. Plus Windows tends to be something of a second class citizen with most of these langauges
[00:37:36] matthewd: Everything *should* work, but you're far more likely to run into things that just haven't been used on Windows, and no-one's noticed it's broken
[00:37:48] Disavowed: I normally end interviews as soon as I find out I'm expected to use windows for development ;)
[00:38:18] jeffreylevesque: has joined #ruby
[00:38:26] Verity: I'll consider this
[00:38:39] matthewd: In this case, the danger-zone for that is going to be the serial library, because that's unusual, and OS-level: thus checking it first
[00:38:56] Disavowed: I gather windows 10 emulates Bash, but I don't know that all things being equal, I'd bother.
[00:39:30] brent__: has joined #ruby
[00:39:34] Verity: I'll try it now
[00:39:38] Verity: its so easy with ruby
[00:41:13] Disavowed: Verity: The other factor is that if you plan to use us as a source of counsel, then you're going to be better off using a platform that we use (and that you're likely to deploy on).
[00:41:38] tolerablyjake: has joined #ruby
[00:42:18] matthewd: Disavowed: It being an assignment, I suspect "deploy on" might point toward Windows
[00:42:45] Disavowed: matthewd: I was thinking that as I wrote it!
[00:42:55] Verity: gem install rubyserial; require 'rubyserial'; sp = Serial.new("COM1"); sp.write; sp.read
[00:42:57] Verity: thats really not bad
[00:43:14] Verity: well previously we have been forced to use C# and windows
[00:43:22] cfec0b8d: has joined #ruby
[00:43:24] Verity: but this time we can choose any language
[00:43:26] Verity: this is rare
[00:43:29] Verity: and also gui or cli
[00:43:34] brent__: has joined #ruby
[00:43:37] Verity: so I chose cli + ruby/python... looking like ruby
[00:43:44] Verity: I've always wanted to learn ruby
[00:43:47] Verity: and I know its used in msf
[00:44:15] Verity: this seemed like a great opportunity
[00:44:30] Verity: what better motivation to learn than a deadline and a grade
[00:45:16] BabyMario: A deadline a work, which requires overtime if you're too slow I guess
[00:45:20] Disavowed: Verity: You'll go far!
[00:45:26] BabyMario: that motivates me a lot more than a uni grade ever did
[00:45:51] Disavowed: BabyMario: try charging by the hour ;)
[00:46:12] BabyMario: lol, I wish
[00:46:46] Verity: I hope you're not being sarcastic, Disavowed. I'm still trying to figure out how I'll transition to the work world. I have a mandatory internship as part of my final semester so I expect that will lead somewhere if I choose wisely and prepare
[00:46:55] bmurt: has joined #ruby
[00:47:14] ozcanesen: has joined #ruby
[00:47:47] Verity: I never liked capitalizing true and false
[00:47:49] Disavowed: Verity: No I was being serious. I mean you've eschewed the usual crap to try somethign new and are throwing yourself into it. You'll do great
[00:48:16] Disavowed: Verity: You'll be fine. I'm a dropout and I earn more than all my friends :)
[00:48:17] Verity: the other students are writing the application in C# so it should be interesting to see them comminicate with the common protocol over rs232
[00:48:24] Verity: Disavowed, =D
[00:49:19] ascio: has joined #ruby
[00:50:02] JeanCarloMachado: has joined #ruby
[00:53:34] montanonic: has joined #ruby
[00:56:02] nobitanobi: has joined #ruby
[00:57:10] __Yiota: has joined #ruby
[00:57:13] al2o3-cr: has joined #ruby
[00:57:25] olivier__: has joined #ruby
[01:02:38] Disavowed: Verity does hit on an interesting point - this channel is much nicer than #python. I scarcely contribute in there because they're such a miserable bunch. Mind you, I probably would be too if I was stuck coding Python all day ^ ^
[01:02:58] duckpupp1: has joined #ruby
[01:03:44] matthewd: We save all the real horribleness for #rubyonrails ;)
[01:04:27] BabyMario: yeah, I accidentally said 'lol' once in #python
[01:04:57] BabyMario: the thing which python has, is AWS lambda support. I really hope they add ruby as a language
[01:06:29] cliluw: has joined #ruby
[01:06:59] shinnya: has joined #ruby
[01:06:59] erebel55: has joined #ruby
[01:07:02] Verity: I'm sold on ruby, I'm still reading and trying
[01:07:05] cliluw: What's the difference between IO.foreach() and File.foreach()?
[01:07:41] cagomez: has joined #ruby
[01:07:59] Disavowed: BabyMario: They got rid of that stupid lol bot.
[01:08:11] Disavowed: Verity: Wait until you writeyour first Rails app - you'll love Ruby!
[01:08:13] Verity: gem install digest-crc; require 'digest/crc8'; Digest::CRC8.hexdigest('hello')
[01:08:21] Verity: coming from C++, thats shocking
[01:08:23] matthewd: cliluw: Nothing, IIRC
[01:08:36] Verity: one line to get an 8 bit crc
[01:09:06] Verity: I instantiate the object and call its method in the same statement?
[01:09:14] Verity: or there is no object
[01:09:16] Verity: its a static method
[01:09:35] matthewd: >> File.method(:foreach)
[01:09:36] ruby[bot]: matthewd: # => #<Method: File(IO).foreach> (https://eval.in/759406)
[01:09:46] Verity: I've tried flask for python, Disavowed. I always wondered about django vs rails
[01:09:52] matthewd: cliluw: ^^ literally the same method
[01:10:09] cliluw: matthewd: How can you tell it's the same method?
[01:10:43] Disavowed: Verity: I've been doing Django for 8 years. I won't touch it now unless I'm paid - Rails is an absolute joy to work with in comparison
[01:11:04] matthewd: Verity: It's a class method; you are calling the method on an object, but the object in question is the class itself. There's no instance.
[01:11:07] Disavowed: But Flask is very different to even Django
[01:11:24] matthewd: (it might actually be a module, not a class, but that's neither here nor there)
[01:11:51] Verity: google tells me ruby has sinatra
[01:11:57] PaulCape_: has joined #ruby
[01:12:06] Disavowed: Sinatra is closer to Flask, yes
[01:12:32] Verity: I like that I can guess about how to do something and it works
[01:12:33] Disavowed: There's tons of tiny Ruby microframeworks that just wrap Rack and let you roll your own everything. I quite like Cuba for that
[01:12:37] Verity: that didnt work out in python
[01:13:07] matthewd: cliluw: "File(IO)" means it's on File, but was inherited from IO
[01:13:13] Disavowed: It seldom does. If you look at the Python docs, there's pages and pages with few examples. Ruby I've found it much easier to find what I want
[01:13:22] cliluw: matthewd: Ohhh, good catch.
[01:13:39] cliluw: ACTION feels like an idiot now
[01:13:39] Disavowed: Stupid Ruby question: If my texst class inherits from ActiveSupport::TestCase, is it fair to assume I'm running minitest?
[01:14:04] Disavowed: cliluw: I wouldn't - I didn't get that either :)
[01:14:26] Verity: is everything tested in ruby
[01:14:30] Verity: what is all of this testing about
[01:14:48] Verity: as I browse these repos
[01:14:59] matthewd: cliluw: I started from "foreach isn't mentioned in the File docs", so was then looking for/expecting it :)
[01:15:47] matthewd: Disavowed: Yes; AS::TestCase inherits from Minitest::Test
[01:16:11] l4v2: has joined #ruby
[01:16:21] Disavowed: matthewd: Thank you so much
[01:16:54] matthewd: Verity: Good libraries (and good applications) will have a test suite, yes
[01:17:37] Disavowed: Verity: In fact Ruby is big on Test Driven Development (TDD), which is where you literally just write unit tests and then add the functionality to make those tests pass (theoretically)
[01:17:51] matthewd: Verity: I'd argue that's widely true for "good", really.. but it's pretty culturally indoctrinated in ruby, so most things you'll encounter will have at least reasonable coverage
[01:18:26] Verity: why do they do this?
[01:18:36] Verity: is this done in c++? I don't recall hearing much about it
[01:18:49] Verity: the benefits outweigh the extra work I'm assuming
[01:18:51] Hanmac: has joined #ruby
[01:19:41] Disavowed: Verity: I know that I can refactor my code and know immediately if I've broken anything. It's a very tight feedback loop that lends itself very well to writing good quality software
[01:21:27] Verity: arr = "15hello"; arr[7] = Digest::CRC8.hexdigest(arr);
[01:21:31] RenatoSilva: it's sad that sometimes tests are used to hide bad programming skills
[01:21:32] millerti_: has joined #ruby
[01:21:37] Verity: appends the 8 bit crc of the packet to the end, just as I would hope
[01:21:43] Verity: incredible
[01:21:56] Disavowed: renatosilva: How so?
[01:22:05] Verity: are they really?
[01:22:21] matthewd: Verity: arr << Digest::CRC8..etc
[01:22:36] Verity: is that shorthand to append?
[01:22:36] matthewd: Verity: Also don't call it arr: it's a string, not an array
[01:23:49] RenatoSilva: Disavowed: passing 100% the unit tests is no way ensuring good quality, only if the code and the tests are good, if they're crappy code then your green bar is meaningless
[01:24:00] montanonic: has joined #ruby
[01:24:19] elomatreb: Any tests are better than no tests
[01:25:48] matthewd: Yeah, while I'd much prefer well written code in general... average code + average tests > excellent code + no tests
[01:26:11] Verity: packet = Soh+msg+Digest::CRC8(Soh+msg)
[01:26:25] Verity: string concatenation?
[01:26:28] jaequery: has joined #ruby
[01:26:28] RenatoSilva: elomatreb: a bad test for bad code is not better than no test for good code
[01:26:33] Disavowed: renatosilva: That's a fair comment
[01:26:50] Verity: it was so close to being pure magic
[01:26:54] Verity: or as close as I've seen
[01:26:59] elomatreb: If you have no tests, how do you know it's good code?
[01:27:03] Disavowed: I'm a little insecure about my testing. I was never formally taught, so I've sort of made-it-up-as-I-go over the years.
[01:27:28] RenatoSilva: elomatreb: well, by reading it?
[01:28:10] elomatreb: Reading + understanding untested code is just as much work as rewriting it usually in my experience
[01:29:04] __Yiota: has joined #ruby
[01:29:21] LBRapid: has joined #ruby
[01:29:30] roamingdog: has joined #ruby
[01:29:48] RenatoSilva: I think sometimes much more work reading than write, also sometimes you can write a dozen lines in a few seconds, or take a couple hours to write one single line
[01:30:20] roamingdog: has joined #ruby
[01:30:35] ascio: has joined #ruby
[01:30:41] djbkd: has joined #ruby
[01:31:03] bmurt: has joined #ruby
[01:31:05] roamingdog: has joined #ruby
[01:31:55] roamingdog: has joined #ruby
[01:32:41] roamingdog: has joined #ruby
[01:33:28] roamingdog: has joined #ruby
[01:34:15] olivier__: has joined #ruby
[01:34:19] roamingdog: has joined #ruby
[01:34:57] chopin: has joined #ruby
[01:36:00] jenrzzz: has joined #ruby
[01:36:01] jenrzzz: has joined #ruby
[01:38:08] Pumukel: has joined #ruby
[01:45:01] JeanCarloMachado: has joined #ruby
[01:45:03] Verity: packet = Soh+msg+Digest::CRC8.hexdigest(Soh+msg.length+msg)
[01:45:08] Verity: any idea how I can pull this off?
[01:45:14] Verity: msg.length is an int
[01:45:21] Verity: but string concatenation wants strings
[01:45:27] Verity: and if I quote it... its a static string
[01:45:35] Verity: (of course)
[01:46:07] Hanmac: has joined #ruby
[01:46:25] allisio: >> str = 'foo'; "#{str.size}#{str}"
[01:46:26] ruby[bot]: allisio: # => "3foo" (https://eval.in/759407)
[01:47:16] matthewd: msg.length.to_s
[01:47:26] __Yiota: has joined #ruby
[01:47:38] roflmyeggo: has joined #ruby
[01:47:44] matthewd: Put spaces around + for readability
[01:48:54] matthewd: You could also use "#{a}#{b}" as allisio suggests.. but for pure concatenation (no surrounding static strings involved), it feels noisy to me
[01:49:36] ecuanaso: has joined #ruby
[01:50:41] matthewd: If msg.length should be in the left part as well, then I'd split it in two lines: `packet = Soh + msg.length.to_s + msg; packet += Digest::CRC8.hexdigest(packet)`
[01:54:10] RenatoSilva: Verity: the kind of thing ruby allows you to do: http://vpaste.net/2n2WR
[01:59:37] Jameser: has joined #ruby
[01:59:40] aryaching: has joined #ruby
[02:03:55] Verity: that does seem to read better
[02:06:15] Verity: I do have a slight issue now
[02:06:33] Verity: I think I can solcve it though
[02:06:59] Verity: actually, its not an issue
[02:07:04] Verity: the packets are a fixed length
[02:07:13] Verity: if they werent, anything over 9 for length becomes two chars when it should be one
[02:07:24] Verity: when I transform the string into bytes
[02:07:29] Verity: that would be useful to solve for the future
[02:07:42] Verity: but for now, its fixed length in that byte and its under 10
[02:07:50] Verity: so no problem
[02:09:00] Verity: ty for the link, matthewd
[02:09:26] zacstewart: has joined #ruby
[02:09:33] allisio: Your binary data protocol passes lengths as ASCII-encoded decimal?
[02:10:10] zacstewart: has left #ruby: ()
[02:12:10] Verity: now its fixed length
[02:12:56] banisterfiend: has joined #ruby
[02:16:21] arescorpio: has joined #ruby
[02:16:24] NightMonkey: has joined #ruby
[02:17:24] d^sh: has joined #ruby
[02:17:33] KnownSyntax: has joined #ruby
[02:20:01] knight33: has joined #ruby
[02:24:13] jaequery: has joined #ruby
[02:28:26] LBRapid: has joined #ruby
[02:30:13] Pumukel: has joined #ruby
[02:31:01] Pumukel: has joined #ruby
[02:31:49] Pumukel: has joined #ruby
[02:32:29] tolerablyjake: has joined #ruby
[02:32:37] Pumukel: has joined #ruby
[02:33:25] Pumukel: has joined #ruby
[02:39:37] Jayson_Virissimo: has joined #ruby
[02:40:20] cibs: has joined #ruby
[02:45:26] pwnd_nsfw`: has joined #ruby
[02:46:07] Verity: incredible
[02:47:13] Limix: has joined #ruby
[02:49:29] Disavowed: Verity: Are you feeling like you made the right choice of language?
[02:50:42] JoshS: has joined #ruby
[02:50:55] Verity: do I need to declare an array ahead of time
[02:51:07] Verity: I'm having trouble adding an element to itwithout doing that
[02:52:00] matthewd: You need to make the array before you can add elements to it, yes
[02:52:05] Disavowed: >> v = []; v.append(3)
[02:52:06] ruby[bot]: Disavowed: # => undefined method `append' for []:Array (NoMethodError) ...check link for more (https://eval.in/759416)
[02:52:14] Disavowed: Oops! Too much Python today
[02:52:20] claw: has joined #ruby
[02:52:22] matthewd: >> array = [1, 2]; array << 3
[02:52:23] ruby[bot]: matthewd: # => [1, 2, 3] (https://eval.in/759417)
[02:52:30] allisio: >> (a = [1]) << 2
[02:52:31] ruby[bot]: allisio: # => [1, 2] (https://eval.in/759418)
[02:54:08] roamingdog: has joined #ruby
[02:55:23] Verity: 9 lines of code to build an array of crc'd packets from a file
[02:55:35] Verity: a couple more to send them out
[02:57:45] tolerablyjake: has joined #ruby
[02:58:24] Radar: Verity: put your code on gist.github.com.
[02:59:14] Verity: https://gist.github.com/anonymous/10d2d117b093b91c67f45a4507e81648
[02:59:19] Verity: I messed up, though
[02:59:20] Verity: I'm debugging
[02:59:34] Verity: its adding each character 7 times instead of eating 7 chars from the file
[02:59:43] claw: has joined #ruby
[02:59:50] Verity: 1eeeeeee13
[02:59:51] Verity: like this
[02:59:53] RenatoSilva: welcome to the ruby feeling
[03:00:44] Verity: do I really need to create the intermediate buff
[03:00:46] Disavowed: Verity: It would - that's what you've written! Look into slicing
[03:00:58] matthewd: Cool, that doesn't look too far off from idiomatic
[03:01:35] aupadhye: has joined #ruby
[03:01:37] matthewd: No, you don't seem to need that variable: you're only using its value in one place
[03:02:16] astrobunny: has joined #ruby
[03:02:47] Verity: I had an error when I tried 7.times do packet << file.read(1) end
[03:02:52] Verity: int to string error
[03:02:58] Verity: I tried to cast, but no luck
[03:03:44] duckpupp1: has joined #ruby
[03:04:09] matthewd: I'd need an actual error, I think; that doesn't seem obviously wrong
[03:04:16] matthewd: I guess I'd ask: why read 1 byte 7 times, instead of just reading 7 bytes?, though
[03:06:05] eclecticjohny: has joined #ruby
[03:07:08] libastral: has joined #ruby
[03:07:20] Verity: I'm fixing that now :)
[03:08:28] Verity: matthewd, no implicit conversion of nil into String (TypeError)
[03:08:37] Verity: 7.times do packet << file.read(1) end
[03:08:48] olivier__: has joined #ruby
[03:09:16] matthewd: Right; file.read(1) can return nil (on EOF)
[03:09:22] allisio: >> '' << nil rescue $!
[03:09:23] ruby[bot]: allisio: # => #<TypeError: no implicit conversion of nil into String> (https://eval.in/759419)
[03:09:30] allisio: And `nil` can't be shoveled.
[03:09:42] jenrzzz: has joined #ruby
[03:09:42] jenrzzz: has joined #ruby
[03:20:04] lucasr: has joined #ruby
[03:21:56] astrobunny: has joined #ruby
[03:22:16] Verity: 7.times do buf = file.read(1) packet << buf end
[03:22:53] allisio: That should just be `packet << file.read(7)`.
[03:24:12] Verity: I understand now
[03:24:17] Verity: is there a way to do it with .times?
[03:24:21] Verity: like I was trying to
[03:24:29] Verity: even though perhaps this way makes more sense
[03:25:16] paradisaeidae: has joined #ruby
[03:25:17] Verity: I needed to have two statements inside that block
[03:25:22] matthewd: 7.times do buf = file.read(1); packet << buf if buf; end
[03:25:32] paradisaeidae_: has joined #ruby
[03:26:00] matthewd: Use newlines in real code, thoughf
[03:26:52] jaequery: has joined #ruby
[03:26:59] matthewd: Or: 7.times do; break if file.eof?; packet << file.read(1); end
[03:27:34] milardovich: has joined #ruby
[03:28:17] ishigoya: has joined #ruby
[03:28:21] RenatoSilva: has joined #ruby
[03:28:33] Verity: aha, I see
[03:28:39] Verity: and the ; are newlines in the real code
[03:28:44] Verity: because ruby needs no ;
[03:29:02] paul374: has joined #ruby
[03:29:06] matthewd: You can use them to join lines together. But don't. :)
[03:30:45] Verity: packetList.each do |packet| sp.write(packet) end
[03:30:51] Verity: should this be on one line?
[03:30:55] Verity: or an indented block
[03:31:00] Verity: for best practice
[03:31:31] lucasr: Hi, good eveening, i starting to learn ruby, could you help me?
[03:31:39] allisio: `packetList.each &sp.method(:write)`
[03:31:40] Verity: of course, lucas.
[03:31:46] allisio: (But probably don't actually do that.)
[03:32:41] zacts: has joined #ruby
[03:32:43] matthewd: I'd generally only use a single-line block when 1) using braces, not do/end, and 2) it's a value-returning block, rather than an action-doing one
[03:33:34] lucasr: i user linux. And alredy install the necessary applications. i like to know where to pratice
[03:33:44] lucasr: cummunity, sites, e-books
[03:33:57] allisio: Do the Koans: http://rubykoans.com/
[03:34:08] jaequery: has joined #ruby
[03:34:23] paul374: has joined #ruby
[03:34:33] LBRapid: has joined #ruby
[03:35:05] lucasr: Great, allisio
[03:36:04] lucasr: sorry for english, i am not fluent.
[03:36:58] Disavowed: lucas_: You speak fine :)
[03:37:36] hutch34: has joined #ruby
[03:40:04] Derperperd: has joined #ruby
[03:41:25] rakm: has joined #ruby
[03:42:33] NightMonkey: has joined #ruby
[03:42:51] KereaLaptop: has joined #ruby
[03:44:32] lacrymology: has joined #ruby
[03:49:31] tolerablyjake: has joined #ruby
[03:53:34] Derperperd: has joined #ruby
[03:54:45] Derperperd: has joined #ruby
[04:01:00] astrobunny: has joined #ruby
[04:02:23] Derperperd: has joined #ruby
[04:02:41] dasher00: has joined #ruby
[04:02:44] muelleme: has joined #ruby
[04:06:29] cibs: has joined #ruby
[04:08:31] Derperperd: has joined #ruby
[04:10:31] xenops: has joined #ruby
[04:11:31] mim1k: has joined #ruby
[04:11:36] thebaffoon: has joined #ruby
[04:12:42] raspado: has joined #ruby
[04:12:49] paul374: has joined #ruby
[04:13:44] astrobunny: has joined #ruby
[04:15:04] harfangk: has joined #ruby
[04:15:11] nofxx: has joined #ruby
[04:16:49] roflmyeggo: has joined #ruby
[04:20:40] milardovich: has joined #ruby
[04:21:53] gix: has joined #ruby
[04:23:21] b4rbz: has joined #ruby
[04:24:19] solocshaw: has joined #ruby
[04:24:39] Derperperd: has joined #ruby
[04:28:03] paradisaeidae__: has joined #ruby
[04:28:22] paradisaeidae___: has joined #ruby
[04:30:30] cibs: has joined #ruby
[04:30:57] etehtsea: has joined #ruby
[04:31:07] aaooki: has joined #ruby
[04:31:07] paul374: has joined #ruby
[04:31:39] LBRapid: has joined #ruby
[04:32:40] olivier__: has joined #ruby
[04:33:23] bocaneri: has joined #ruby
[04:36:39] chopin_: has joined #ruby
[04:37:30] bocaneri: has joined #ruby
[04:38:50] BTRE: has joined #ruby
[04:41:14] xenops: has joined #ruby
[04:46:52] milardovich: has joined #ruby
[04:50:52] leito: has joined #ruby
[04:52:34] pankaj_: has joined #ruby
[04:53:24] pankaj_: Is anybody there?
[04:54:07] pankaj_: Rador: I want some help for my Rails installation.
[04:54:46] kliu: has joined #ruby
[04:55:09] pankaj_: Rador: Hello
[04:55:35] kliu: has left #ruby: ()
[04:56:13] ineb: pankaj_: there is #rubyonrails for more specific rails questions
[04:56:15] pwnd_nsfw: has joined #ruby
[04:57:07] pankaj_: ineb: So how do I join the channel?
[05:03:31] muelleme: has joined #ruby
[05:04:29] duckpupp1: has joined #ruby
[05:04:36] jdm: has joined #ruby
[05:08:28] anisha: has joined #ruby
[05:12:34] milardovich: has joined #ruby
[05:16:42] paul374: pankaj_: /join #rubyonrails
[05:16:45] paul374: pankaj_: the same way you joined this channel but with rubyonrails instead of ruby lol
[05:17:34] pankaj_: paul374: I joined it. Their was some issue about Registration but I fixed it. Thanks
[05:17:59] paul374: oh okay good
[05:21:13] wkoszek: has joined #ruby
[05:22:57] pankaj_: Is anybody there?
[05:26:06] l4v2: has joined #ruby
[05:31:14] Pumukel: has joined #ruby
[05:37:49] chagel: has joined #ruby
[05:38:04] hutch34: has joined #ruby
[05:38:30] renchan: has joined #ruby
[05:44:02] brent__: has joined #ruby
[05:44:48] armyriad: has joined #ruby
[05:46:00] paul374: has joined #ruby
[05:49:04] solocshaw: has joined #ruby
[05:57:22] _aeris_: has joined #ruby
[05:59:15] jenrzzz: has joined #ruby
[05:59:15] jenrzzz: has joined #ruby
[05:59:49] Fridtjof: has joined #ruby
[06:03:07] dubalubdub: has joined #ruby
[06:05:18] wkoszek_: has joined #ruby
[06:05:22] astrobunny: has joined #ruby
[06:05:56] raatiniemi: has joined #ruby
[06:06:47] nibbo: has joined #ruby
[06:08:21] chamunks: has joined #ruby
[06:08:54] majuscul1: has joined #ruby
[06:08:56] sunya7a__: has joined #ruby
[06:08:58] govg_: has joined #ruby
[06:09:21] Sp4rKy: has joined #ruby
[06:09:24] miah__: has joined #ruby
[06:09:27] dikaio_: has joined #ruby
[06:09:43] funnel_: has joined #ruby
[06:11:58] mim1k: has joined #ruby
[06:12:24] cydrobolt_: has joined #ruby
[06:12:30] vifino-: has joined #ruby
[06:12:31] bier_: has joined #ruby
[06:12:35] fedruantine: has joined #ruby
[06:12:41] ekem: has joined #ruby
[06:13:18] xMopxShell: has joined #ruby
[06:13:50] scrooloose: has joined #ruby
[06:13:56] _aeris_: has joined #ruby
[06:13:57] cibs: has joined #ruby
[06:14:20] Fridtjof: has joined #ruby
[06:14:34] tsunamie: has joined #ruby
[06:14:51] Biohazard: has joined #ruby
[06:15:18] montanonic: has joined #ruby
[06:16:19] SuperLag: has joined #ruby
[06:21:33] charliesome: has joined #ruby
[06:24:57] d^sh_: has joined #ruby
[06:30:46] lightheaded: has joined #ruby
[06:35:39] dhollinger: has joined #ruby
[06:35:42] paul374: has left #ruby: ("WeeChat 1.0.1")
[06:36:35] cfec0b8d: has joined #ruby
[06:39:57] charliesome: has joined #ruby
[06:40:00] hvn0413: has joined #ruby
[06:42:43] certainty: has joined #ruby
[06:42:55] gaussblurinc1: has joined #ruby
[06:43:04] igniting: has joined #ruby
[06:48:38] jenrzzz: has joined #ruby
[06:50:46] milardovich: has joined #ruby
[06:52:25] muelleme: has joined #ruby
[06:55:33] Fridtjof: has joined #ruby
[06:55:54] lightheaded: has joined #ruby
[07:01:00] meshsmith: has joined #ruby
[07:01:01] chouhoulis: has joined #ruby
[07:01:47] Tau: has joined #ruby
[07:02:54] adaedra: has joined #ruby
[07:04:27] Sp4rKy_: has joined #ruby
[07:04:31] D9: has joined #ruby
[07:04:39] perryh: has joined #ruby
[07:04:39] perryh: has joined #ruby
[07:08:23] jasondotstar: has joined #ruby
[07:08:33] justinmrkva: has joined #ruby
[07:08:53] _aeris_: has joined #ruby
[07:10:37] jgnagy: has joined #ruby
[07:11:05] moufl: has joined #ruby
[07:11:22] duckpupp1: has joined #ruby
[07:11:49] tvw: has joined #ruby
[07:13:57] rhyselsmore: has joined #ruby
[07:18:27] cagomez: has joined #ruby
[07:19:20] pLaTo0n: has joined #ruby
[07:20:05] rippa: has joined #ruby
[07:20:49] ElDoggo: has joined #ruby
[07:23:01] Pumukel: has joined #ruby
[07:27:07] faces: has joined #ruby
[07:27:24] conta: has joined #ruby
[07:36:37] aryaching: has joined #ruby
[07:39:43] jamesaxl: has joined #ruby
[07:40:10] last_staff1: has joined #ruby
[07:40:30] olivier__: has joined #ruby
[07:41:09] xenops: has joined #ruby
[07:42:34] lele: has joined #ruby
[07:45:17] johnzorn: has joined #ruby
[07:51:25] roshanavand: has joined #ruby
[07:52:20] TvL: has joined #ruby
[07:53:04] last_staff1: has joined #ruby
[07:57:47] aufi: has joined #ruby
[07:58:16] Sp4rKy: has joined #ruby
[08:01:15] electrostat: has joined #ruby
[08:03:36] s2013: has joined #ruby
[08:08:26] certainty: has joined #ruby
[08:10:00] Arpanet69: has joined #ruby
[08:10:53] Mortomes|Work: has joined #ruby
[08:10:58] Mortomes|Work: has joined #ruby
[08:10:58] Mortomes|Work: has joined #ruby
[08:12:23] mim1k: has joined #ruby
[08:15:18] last_staff1: has joined #ruby
[08:18:45] ragesoss: has joined #ruby
[08:19:20] dasher00: has joined #ruby
[08:21:56] Qchmqs: has joined #ruby
[08:22:30] kiltzman: has joined #ruby
[08:23:04] mark_66: has joined #ruby
[08:23:12] TomyWork: has joined #ruby
[08:26:24] prions: has joined #ruby
[08:26:40] etehtsea: has joined #ruby
[08:26:42] irivqu: has joined #ruby
[08:26:46] doublemalt__: has joined #ruby
[08:27:16] nobitanobi: has joined #ruby
[08:27:25] andikr: has joined #ruby
[08:30:00] Psy-Q: what are good ideas for making a script packageable for e.g. debian? i have some relative includes to './lib/foo/bar', i'm guessing when packaging those libs would go completely elsewhere and the includes break?
[08:30:21] adaedra: Wrap it in a gem
[08:32:00] nowhere_man: has joined #ruby
[08:32:25] Psy-Q: can i wrap multiple things to include in a single gem?
[08:33:47] Psy-Q: ah yes, gemspec docs seem to indicate that
[08:33:54] Psy-Q: thanks, i'll give that a try, maybe i can package it with gem2deb
[08:34:56] adaedra: well you can probably take a look at how other gems are packaged
[08:35:29] vali: has joined #ruby
[08:35:42] adaedra: but you can put all you need in a gem, includes, executables
[08:36:36] Psy-Q: ah, awesome. if i can put the executable there too and figure out where debian likes to put it, i could put the entire thing in one gem
[08:37:37] adaedra: iirc rails is packaged as a .deb too, so it's definitely possible.
[08:38:50] tAn: has joined #ruby
[08:39:34] antgel: has joined #ruby
[08:41:35] naftilos76: has joined #ruby
[08:42:20] jenrzzz: has joined #ruby
[08:43:07] milardovich: has joined #ruby
[08:46:13] pulkit4tech: has joined #ruby
[08:46:24] anisha: has joined #ruby
[08:48:27] naftilos76: Does anybody kno if i can create an image file containing a number out of a number string? I want to implement my own captcha service.
[08:48:49] tAn: has joined #ruby
[08:49:26] adaedra: There are surely gems allowing you to draw on images
[08:51:57] chagel: has joined #ruby
[08:53:09] mim1k: has joined #ruby
[08:58:31] dangerousdave: has joined #ruby
[08:59:34] snickers: has joined #ruby
[09:00:41] mikecmpbll: has joined #ruby
[09:03:19] naftilos76: adaedra, thanks
[09:06:32] teddysmoker: has joined #ruby
[09:06:43] pandaant: has joined #ruby
[09:12:06] duckpupp1: has joined #ruby
[09:15:28] maattdd: has joined #ruby
[09:17:37] IpyCreator: has joined #ruby
[09:18:27] jsrn_: has joined #ruby
[09:18:41] milardovich: has joined #ruby
[09:20:37] IpyCreator: Hello , i am new to web development and developing iOS application since more than 2 years . i need to develop web site for large amount of video and audio processing . Is Ruby is good for me or i should go for other options.
[09:20:44] cibs: has joined #ruby
[09:20:50] pLaTo0n: has joined #ruby
[09:21:39] IpyCreator: in future i also want to use App of this Web site version .
[09:21:48] Silthias: has joined #ruby
[09:26:14] nofxxx: has joined #ruby
[09:26:18] Ishido: has joined #ruby
[09:27:43] flying: has joined #ruby
[09:29:18] patarr: has joined #ruby
[09:30:17] aupadhye: has joined #ruby
[09:32:02] Psy-Q: this gemspec stuff isn't nearly as complicated as i thought
[09:32:36] Psy-Q: took only about 10 minutes and two changes of paths, now i have it integrated with the Gemfile and i can run the same code either via bundler for development or install using gem, and it'll even do the right thing with the executable
[09:36:13] gaussblurinc1: has joined #ruby
[09:36:16] dminuoso: so.. is there anything exciting in 2.4.1?
[09:36:48] burgestrand: has joined #ruby
[09:36:57] Jameser: has joined #ruby
[09:37:12] Psy-Q: fixes for interesting bugs
[09:37:23] biberu: has joined #ruby
[09:37:27] dminuoso: Bugs are boring.
[09:37:34] Psy-Q: but they're good bugs, infinite loops, segfaults...
[09:37:40] dminuoso: I have Fiddle in my production code, Im used to seg faults.
[09:38:13] dminuoso: Also POSIX folks should be shot.
[09:38:26] dminuoso: I want SIGPFV instead of SIGSEGV
[09:38:47] dionysus69: has joined #ruby
[09:38:47] dminuoso: Or SIGPF actually just.
[09:42:30] neuraload: has joined #ruby
[09:44:28] tomphp: has joined #ruby
[09:47:35] howdoi: has joined #ruby
[10:00:37] lxsameer: has joined #ruby
[10:00:40] brent__: has joined #ruby
[10:02:58] Ishido: has joined #ruby
[10:04:19] anisha: has joined #ruby
[10:06:44] Beams: has joined #ruby
[10:15:28] Jameser: has joined #ruby
[10:16:19] darix: dminuoso: why not just SIG[A-Z]
[10:16:59] pLaTo0n: has joined #ruby
[10:17:32] milardovich: has joined #ruby
[10:18:00] dionysus69: has joined #ruby
[10:18:28] doublemalt_: has joined #ruby
[10:20:13] biberu: has joined #ruby
[10:25:21] aganov: has joined #ruby
[10:26:34] Jameser: has joined #ruby
[10:27:58] leitz: has joined #ruby
[10:29:55] fivmo: has joined #ruby
[10:32:07] duckpupp1: has joined #ruby
[10:32:54] Jameser: has joined #ruby
[10:41:43] GodFather: has joined #ruby
[10:44:36] lightheaded: has joined #ruby
[10:45:21] Terens: has joined #ruby
[10:46:51] workmad3: has joined #ruby
[10:49:45] jaruga: has joined #ruby
[10:50:51] fivmo: has joined #ruby
[10:51:02] rikkipitt: has joined #ruby
[10:52:03] lightheaded: has joined #ruby
[10:52:51] ferr1: has joined #ruby
[10:53:27] rhyselsmore: has joined #ruby
[10:54:49] yqt: has joined #ruby
[10:57:05] toretore: has joined #ruby
[10:58:42] p0p0pr37: has joined #ruby
[11:01:00] valentinul: has joined #ruby
[11:01:32] tomphp: has joined #ruby
[11:01:52] lightheaded: has joined #ruby
[11:02:00] TheHodge: has joined #ruby
[11:02:16] vali: https://gist.github.com/valentinul/6bbdef9b9b4382ca77f3632e75c7adaf
[11:03:31] toretore: what are you trying to run, how are you trying to run it
[11:03:42] vali: dnssec_monitor.rb --help
[11:04:14] KnownSyntax: has joined #ruby
[11:04:14] KnownSyntax: has joined #ruby
[11:04:27] toretore: what is dnssec_monitor.rb
[11:04:44] vali: https://github.com/opendnssec/dnssec-monitor
[11:07:05] toretore: there's no xsd/datatypes in there, so it must be coming from somewhere else
[11:08:23] vali: that is everything which i'm trying to run
[11:09:26] olivier__: has joined #ruby
[11:10:13] toretore: http://opendnssec-user.opendnssec.narkive.com/5KrVP2ve/issues-when-building-opendnssec-1-2-ruby-xsd-datatypes-not-found#post4
[11:12:03] jgnagy: has joined #ruby
[11:12:51] vali: toretore, thank you. that was the issue
[11:13:09] patarr: has joined #ruby
[11:14:16] duckpupp1: has joined #ruby
[11:15:40] pLaToOn: has joined #ruby
[11:15:46] senayar: has joined #ruby
[11:15:46] senayar: has joined #ruby
[11:18:20] Qchmqs: has joined #ruby
[11:23:04] tomphp: has joined #ruby
[11:23:40] fivmo: has joined #ruby
[11:26:38] Jameser: has joined #ruby
[11:34:19] olivier__: has joined #ruby
[11:38:33] ldnunes: has joined #ruby
[11:39:35] JeanCarloMachado: has joined #ruby
[11:41:18] Beams: has joined #ruby
[11:46:02] HoierM: has joined #ruby
[11:49:53] milardovich: has joined #ruby
[11:50:01] cibs: has joined #ruby
[11:54:59] lightheaded: has joined #ruby
[11:56:08] byte512: has joined #ruby
[11:57:28] gaussblurinc1: has left #ruby: ()
[11:57:33] olivier__: has joined #ruby
[11:58:32] synthroid: has joined #ruby
[11:59:56] Qchmqs: has joined #ruby
[12:03:14] __Yiota: has joined #ruby
[12:03:30] swills: has joined #ruby
[12:08:32] nadir: has joined #ruby
[12:09:53] erebel55: has joined #ruby
[12:10:15] lightheaded: has joined #ruby
[12:13:05] Fernando-Basso: has joined #ruby
[12:14:22] mzo: has joined #ruby
[12:14:22] anisha: has joined #ruby
[12:17:16] brent__: has joined #ruby
[12:19:53] EugenMayer: has joined #ruby
[12:20:31] EugenMayer: For anybody using Intellij / Rubymine with Ruby, could you please vote on that issue https://youtrack.jetbrains.com/issue/RUBY-19347 - guess its on the interest of all rubiests
[12:20:34] marr: has joined #ruby
[12:23:12] kobain: has joined #ruby
[12:26:03] milardovich: has joined #ruby
[12:26:23] milardovich: has joined #ruby
[12:30:33] milardovich: has joined #ruby
[12:33:08] maloik: has joined #ruby
[12:36:03] Jameser: has joined #ruby
[12:43:21] hutch34: has joined #ruby
[12:44:22] brent__: has joined #ruby
[12:45:44] enterprisey: has joined #ruby
[12:47:02] avrelaun: has joined #ruby
[12:47:28] nowhere_man: has joined #ruby
[12:48:15] oncall-pokemon: has joined #ruby
[12:48:22] Verity: Digest::CRC8.hexdigest(packet).hex
[12:48:26] Verity: how does that work
[12:48:30] Verity: is the result an object and not a value
[12:48:52] Verity: it outputs the result in decimal instead of a string of two hex characters
[12:49:04] matthewd: Everything is an object
[12:49:28] matthewd: >> "1f".hex
[12:49:29] ruby[bot]: matthewd: # => 31 (https://eval.in/759798)
[12:53:05] Verity: fascinating
[12:53:37] Verity: can I get the names of the special ascii chars
[12:54:17] Verity: or do I need to name them
[12:54:54] leito: has joined #ruby
[12:55:12] matthewd: You mean BEL and friends?
[12:55:20] Verity: ack nack soh etc
[12:56:08] matthewd: I don't know of anything built in; there might be a gem that sets some constants, but at that point it might be easier to just set them yourself
[12:57:15] Verity: it looks like SOH = "\x06"
[12:57:20] Verity: will do what I need, SOH.ord seems to confirm
[12:57:55] nobitanobi: has joined #ruby
[12:58:32] ramortegui: has joined #ruby
[13:02:16] nofxxxx: has joined #ruby
[13:04:26] Verity: ruby should have let me use argv
[13:04:35] Verity: programmer choice, and all that
[13:04:47] JeanCarloMachado: has joined #ruby
[13:04:54] Verity: (had to be capitalized)
[13:05:10] Verity: thats my only real complaint so far
[13:05:30] Verity: other than that its great. I feel like its really staying out of my way. I can think about the idea more than how to make it work int he code
[13:05:43] Verity: definitely a better first impression than python in that regard
[13:05:55] Jameser: has joined #ruby
[13:10:36] armyriad: has joined #ruby
[13:13:04] certainty: has joined #ruby
[13:13:43] solocshaw: has joined #ruby
[13:15:06] Jameser: has joined #ruby
[13:16:16] millerti: has joined #ruby
[13:18:55] meshsmith: has joined #ruby
[13:19:53] bmurt: has joined #ruby
[13:21:05] t-recx: has joined #ruby
[13:25:21] lightheaded: has joined #ruby
[13:29:44] hutch34: has joined #ruby
[13:31:27] Verity: I do have this fear deep inside that it will leave me stranded
[13:31:37] Verity: but fingers are crossed this serial library will work as it claims
[13:31:46] Verity: I know when I get to modifying for TCP it shoulndt be an issue
[13:31:51] olivier__: has joined #ruby
[13:31:56] Verity: I would think thats 100% supported
[13:32:05] Verity: through current gems
[13:32:39] Verity: it looks like its working, I'm testing later today. it claims its writing bytes to serial port
[13:32:58] Verity: I can't read them though because its not looping back, not sure what controls that or why/when it happens
[13:34:03] dionysus69: has joined #ruby
[13:34:13] olivier__: has joined #ruby
[13:34:43] cibs: has joined #ruby
[13:35:13] DLSteve: has joined #ruby
[13:37:59] ecuanaso: has joined #ruby
[13:38:18] SuperLag: has joined #ruby
[13:38:47] Parabola: has joined #ruby
[13:39:34] Parabola: hey folks, using the RestClient, with .execute, why would ":verify_ssl => false" or ":verify_ssl => OpenSSL::SSL::VERIFY_NONE" not actually work? I'm still getting "certificate verify failed"
[13:40:32] olivier__: has joined #ruby
[13:41:09] ozcanesen: has joined #ruby
[13:42:44] lightheaded: has joined #ruby
[13:42:49] jaruga: has joined #ruby
[13:44:54] Parabola: .execute and .new both do it, is there a non shitty rest library?
[13:45:51] knight33: has joined #ruby
[13:46:38] cibs: has joined #ruby
[13:50:06] agent_white: has joined #ruby
[13:51:34] Jameser: has joined #ruby
[13:51:51] Verity: http://pastebin.com/f8QzKn8W I'm having an absolute blast =D
[13:51:53] ruby[bot]: Verity: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/75629845e5930bce9f9ab5cd78e23462
[13:51:53] ruby[bot]: Verity: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[13:51:54] agent_white: Mornin' folks
[13:52:02] vali: has joined #ruby
[13:53:59] ruby-lang426: has joined #ruby
[13:54:45] Verity: I'm not sure it makes a lot of sense to try to learn ruby by learning rails
[13:55:02] Verity: I have a friend who was trying to learn rails, with no coding or ruby experience... it was a disaster
[13:55:03] roflmyeggo: has joined #ruby
[13:55:09] Verity: perhaps its better to learn the language and then the framework
[13:55:32] Verity: just realized "no coding or ruby experience" is redundant
[13:55:36] Verity: but you get the idea
[13:56:38] nofxxxx: Verity, so true, actually most ppl I've introduced to ruby started with rails w/o any tutorial book
[13:58:33] avrelaun: has joined #ruby
[13:58:49] jaruga: has joined #ruby
[13:58:52] Verity: until file.eof?
[13:58:55] jrafanie: has joined #ruby
[13:59:05] Verity: is this the equivalent of an if test there, if(file.eof) then break
[13:59:17] Verity: it works, just trying to figure out specifically how
[13:59:32] matthewd: until x == while !x
[14:00:48] Verity: matthewd, if you have a moment, could you tell me if my code is structured well and if I'm following ruby best practices?
[14:01:00] Verity: confirmation would be great before I build the rest
[14:01:01] Verity: https://gist.github.com/anonymous/ca2a7c2d87716c8e6f71d4ec3cd524a1
[14:01:03] Verity: if ytou do have time
[14:01:12] Verity: or anyone
[14:01:32] __Yiota: has joined #ruby
[14:01:59] Verity: I used the constants insteadof ARGV directly because my professor suggested not hard coding numbers like ARGV[1]
[14:03:04] matthewd: I'd be more concerned about the 1.chr as a magic value that should have a constant to name it
[14:03:22] nofxxxx: Verity, looks good... except CamelCase cosntants, use CAPITAL_SCREAM
[14:03:40] matthewd: I'd make those values variables, not constants, though
[14:04:01] nofxxxx: yeah, might look better
[14:04:26] nofxxxx: Verity, CamelCase makes a rubyst brain link to a class, not constant
[14:04:32] Verity: alright, any reason to make them vars and not constants?
[14:04:45] Verity: they shouldnt be able to change after its launched
[14:04:47] avrelaun: has joined #ruby
[14:04:52] matthewd: Even though they don't change, in ruby constants have different scoping implications, so any local value is a variable
[14:04:54] Verity: I'll fix the naming convention error regardless
[14:05:27] matthewd: On naming conventions, packetList -> packet_list
[14:05:27] chagel: has joined #ruby
[14:05:34] nofxxxx: Verity, hehe... good point. Actually the 'correct' way lets say, will be use some optparse thing/gem
[14:06:03] nofxxxx: since it's already a (to keep simple) hack no much change in constant/var
[14:06:07] millerti: has joined #ruby
[14:07:10] nofxxxx: Verity, oh.. and packet_list...camel case on vars is worst than cosntants! hehe... ThisIsClass, THIS_IS_CONSTANT, this_is_var
[14:07:28] Verity: even lowerCamelCase isnt good?
[14:07:36] matthewd: Other than that my only observation is that it's getting about time for some methods, if not classes
[14:07:54] matthewd: No; Ruby uses snake_case by convention
[14:08:11] matthewd: That's just a thing that varies between languages, for no good reason ¯\_(ツ)_/¯
[14:08:16] nofxxxx: Verity, inline/inside your editor rubocop is ruby started best friend
[14:08:43] nofxxxx: ruby won't warn or err on anything like that, but other fellows like those conventions ... A LOT
[14:08:52] nofxxxx: ruby starter*
[14:08:56] olivier__: has joined #ruby
[14:09:12] Verity: rubocop looks interesting, thank you
[14:09:32] nofxxxx: Verity, it'll tell you all we just did.. but INLINE heheh =D
[14:09:40] mzo: has joined #ruby
[14:09:41] Verity: technically I'm supposed to create a base class for sending data and derived classes for sending over serial or tcp but I didn't want to overwhelm myself first starting out. I started to read about it and it said there are no pure virtual // abstract functions in ruby? or I wouldnt use derived classes like that?
[14:09:47] Verity: so I skipped even using classes for now
[14:10:15] Verity: matthewd,
[14:10:37] Verity: everyone else is using C# xD
[14:10:42] matthewd: def foo; raise "oi, you should override this"; end # abstract function
[14:11:25] Verity: http://stackoverflow.com/questions/512466/how-to-implement-an-abstract-class-in-ruby
[14:11:30] Verity: this is the link that confused the hell out of me
[14:11:42] Verity: its also 8 years old, not sure if that matters
[14:14:13] Verity: the purpose of doing this would be to easy chanfge my program from sending via serial to sending via TCP
[14:15:53] matthewd: It's basically just not necessary in ruby
[14:16:26] matthewd: An abstract function is a thing you can't call, but the compiler will let you call (on the assumption you're invoking it on a subclass)
[14:16:55] matthewd: Ruby will let you try to call anything on any object, without needing any declaration on the base class
[14:18:30] Verity: ACTION contemplates
[14:18:55] Verity: I probably should have a better understanding of why I would have needed them in C++ or C# in order to understand why I don't need them now
[14:19:32] Verity: it had something to do with enforcing upon myself the creation of a set of functions that would be the same for each derived class, so I could just swap which class I use and it will send tcp instead of serial
[14:19:36] Verity: at least thats my understanding
[14:20:47] dionysus69: has joined #ruby
[14:24:44] matthewd: Yeah.. Ruby would more likely force you to implement it via a common test suite, or the simple fact it blows up at runtime if you try to use an incomplete implementation
[14:25:17] cpruitt: has joined #ruby
[14:25:27] lacrymology: has joined #ruby
[14:26:51] Qchmqs: has joined #ruby
[14:27:06] matthewd: You *could* implement a stricter approach, but that assumes a more adversarial approach with the subclass-implementer than we would consider conventional (or realistic, tbh)
[14:27:53] cpruitt: has joined #ruby
[14:29:26] olivier__: has joined #ruby
[14:30:12] olivier__: has joined #ruby
[14:30:41] phaul: has joined #ruby
[14:36:06] Verity: matthewd, what do you recommend?
[14:36:11] Verity: just make two classes?
[14:36:33] Verity: and enforce the identical function prototypes myself
[14:39:10] jdm: has joined #ruby
[14:41:05] houhoulis: has joined #ruby
[14:41:41] tenderlo_: has joined #ruby
[14:42:28] xenops: has joined #ruby
[14:43:02] asdfaa: has joined #ruby
[14:43:15] benjwadams: has joined #ruby
[14:43:42] benjwadams: How can I generate a range of dates with a start and end time separated by months?
[14:45:25] asdfaa: does someone find www.railstutorial.org useful?
[14:48:20] viuo: has joined #ruby
[14:48:25] qthwyx: has joined #ruby
[14:50:29] Justin_: has joined #ruby
[14:51:57] Justin_: howdy, ruby noob and trying to get a gem to install that i cloned the source for. I've run bundle install and all its dependencies came in fine, but the gem itself doesn't get installed to the user gem list.
[14:53:57] burgestrand: justin_ is there a reason to why you're trying to install it from source and not from the rubygems package manager?
[14:55:10] bmurt: has joined #ruby
[14:55:40] Verity: 5.times { puts say }
[14:55:52] Verity: so I should be doing this instead of 5.times do puts say end
[14:55:58] Verity: or this is part of my choice
[14:56:02] Verity: the beauty of ruby
[14:56:02] burgestrand: Verity your choice!
[14:56:18] Verity: fantastic.
[14:56:20] burgestrand: Verity different people have different rules when they decide to use {} or `do/end`
[14:56:28] Verity: can I mix and match?
[14:56:30] Verity: or is that just poor form
[14:56:45] burgestrand: Verity you certainly can, people have different rules for that too :)
[14:56:49] hxegon: You can, but I'd say it's generally accepted to use {} for inline blocks and do/end for multiline
[14:56:56] burgestrand: Verity e.g. some people use {} for single-lines, do/end for multiline
[14:56:59] hxegon: also good morning Verity, and #ruby
[14:57:14] Verity: same to you, hxegon
[14:57:31] burgestrand: Verity personally I'm more for {} when I consider my block an expression, and do/end when I consider it an action
[14:57:44] burgestrand: (e.g. primarily for return value or side effect)
[14:58:27] olivier__: has joined #ruby
[14:59:22] patarr: has joined #ruby
[15:00:45] pankaj_: has joined #ruby
[15:01:24] hxegon: Verity: are packets supposed to be length 9 or 8 in your gist Verity?
[15:01:28] jtreminio: has joined #ruby
[15:01:51] armyriad: has joined #ruby
[15:01:52] Verity: 10 with the crc, but I can't remember so those are placeholders until I look at the requirements doc again
[15:01:52] lightheaded: has joined #ruby
[15:01:56] jtreminio: Hello friends. What is the recommended way of serving Ruby applications over web? fcgi/passenger/{something_else}?
[15:03:01] matthewd: jtreminio: I'd recommend puma, unicorn, or passenger
[15:03:37] jtreminio: I'd rather serve it behind apache/nginx; looks like puma is a web server all its own
[15:03:45] cdg: has joined #ruby
[15:04:38] cibs: has joined #ruby
[15:04:48] matthewd: Yes, for puma & unicorn, one generally uses nginx or apache as a proxy in front of the local process
[15:04:57] toretore: 1) that doesn't matter 2) it's an "app server"
[15:05:23] jtreminio: oh, perfect, so puma/unicorn are similar to php's php-fpm?
[15:06:11] lightheaded: has joined #ruby
[15:06:54] hxegon: Verity: https://gist.github.com/hxegon/a3da5e9f963bce97edab750ca9459957
[15:07:19] matthewd: HTTP just happens to be the protocol used to talk to the backend
[15:07:50] olivier__: has joined #ruby
[15:07:55] amargherio: has joined #ruby
[15:07:59] igniting: has joined #ruby
[15:08:01] Verity: 29 in braces instead of do end, and a better way to pad my packets to proper size?
[15:08:05] Verity: thank you, hxegon
[15:08:20] Verity: well, only the final packet will need padding
[15:08:37] Verity: so I should have said packet
[15:08:48] hxegon: no problem. Be wary that 24 will cut off any chars beyond length 10 though
[15:08:50] slackR: has joined #ruby
[15:09:06] matthewd: It won't do anything, actually
[15:09:28] hxegon: really? I must have misread the docs
[15:09:50] jtreminio: thanks matthewd, will look into puma first
[15:10:04] hxegon: >> ["foo".ljust(1), "foo".rjust(1)]
[15:10:05] ruby[bot]: hxegon: # => ["foo", "foo"] (https://eval.in/759949)
[15:10:06] matthewd: hxegon: It discards the return value
[15:11:08] Verity: hxegon, is that a problem with this way of doing it but not how I had it?
[15:11:35] hxegon: I don't think so Verity
[15:13:28] jgnagy: has joined #ruby
[15:14:36] ElDoggo: has joined #ruby
[15:15:52] asfa: has joined #ruby
[15:16:40] ecuanaso: has joined #ruby
[15:16:53] cagomez: has joined #ruby
[15:17:10] milardovich: has joined #ruby
[15:18:36] thebaffoon: has joined #ruby
[15:18:59] hxegon: Also, ljust uses spaces by default, but I'd consider making a constant PACKET_PADDING_CHAR = ' ' and changing it to ljust(PACKET_PADDING_CHAR) Just to be explicit/intention revealing, but that's just my personal taste.
[15:19:44] jtreminio: has left #ruby: ("Linkinus - http://linkinus.com")
[15:20:04] antoniobeyah: has joined #ruby
[15:20:05] snockerton: has joined #ruby
[15:24:50] neuraload: has joined #ruby
[15:25:45] cagomez: has joined #ruby
[15:26:14] sepp2k: has joined #ruby
[15:27:12] hxegon: hmm... Something got added to the regexp engine in 2.4.1? https://medium.com/rubyinside/the-new-absent-operator-in-ruby-s-regular-expressions-7c3ef6cd0b99#.v0h687ny1
[15:27:37] bweston92: has joined #ruby
[15:31:08] millerti: has joined #ruby
[15:31:42] Limix: has joined #ruby
[15:32:16] jgnagy: has joined #ruby
[15:34:09] brent__: has joined #ruby
[15:34:10] chihhsin: has joined #ruby
[15:34:48] cdg_: has joined #ruby
[15:36:07] snickers: has joined #ruby
[15:37:01] [Butch]: has joined #ruby
[15:42:22] mim1k: has joined #ruby
[15:42:55] pankaj_: has joined #ruby
[15:46:35] Derperperd: has joined #ruby
[15:46:53] neuraload: has joined #ruby
[15:51:01] AnomalousBit: has joined #ruby
[15:54:12] esObe_: has joined #ruby
[15:55:08] millerti: has joined #ruby
[15:58:07] kies: has joined #ruby
[15:59:11] mim1k: has joined #ruby
[15:59:24] amclain: has joined #ruby
[16:00:40] cagomez: how do I return an array of hashes after mapping over an array? I have column_names.map { |column| { column => bar.send(column) } } , is this the same as if I was using Symbols for the keys?
[16:03:49] cfec0b8d: has joined #ruby
[16:03:50] hutch34: has joined #ruby
[16:04:23] burgestrand: has joined #ruby
[16:04:59] chaos95: has joined #ruby
[16:08:09] SeepingN: has joined #ruby
[16:09:28] havenwood: cagomez: You can use what you'd like for Hash keys in Ruby.
[16:09:45] havenwood: cagomez: They're often Symbols but don't have to be.
[16:11:00] cagomez: does my code above return Symbols as keys? I can't tell with Pry
[16:11:30] cagomez: they look like {"foo" => nil}, and I'm not sure if "foo" is a symbol or a string, or if that even makes a difference
[16:11:35] matthewd: cagomez: It uses whatever column_names contains
[16:11:37] matthewd: That's a string
[16:19:15] Tralin: has joined #ruby
[16:19:49] raspado: has joined #ruby
[16:25:04] gusrub: has joined #ruby
[16:36:36] neuraload: has joined #ruby
[16:38:52] Verity: Installing arch again :D
[16:38:56] Nahra: has joined #ruby
[16:41:12] oded: has joined #ruby
[16:41:23] cagomez: has joined #ruby
[16:41:27] whtn12: has joined #ruby
[16:41:51] whtn12: s/heu/hey
[16:42:02] cagomez: has joined #ruby
[16:43:19] Limix: has joined #ruby
[16:43:38] rakm: has joined #ruby
[16:43:41] baweaver: havenwood ^
[16:44:35] hxegon: <USER HAS ENTERED THE CHANNEL> <USER HAS LEFT THE CHANNEL>
[16:44:51] araujo: has joined #ruby
[16:44:51] araujo: has joined #ruby
[16:48:25] thadtheman: has joined #ruby
[16:48:39] thadtheman: Hello where can I find documentation on ruby-mustache?
[16:49:58] lacrymology: has joined #ruby
[16:50:34] kobain: has joined #ruby
[16:52:12] jrafanie_: has joined #ruby
[16:53:53] Parabola: has left #ruby: ()
[16:56:27] marxarelli: has joined #ruby
[16:57:39] cloaked1: has joined #ruby
[16:58:24] burgestrand: has joined #ruby
[16:58:44] Cyrus: thadtheman: Have you tried Google per chance?
[16:59:27] mcantor: has joined #ruby
[17:00:20] montanonic: has joined #ruby
[17:01:23] cagomez: has joined #ruby
[17:03:43] centrx: has joined #ruby
[17:05:37] gnufied: has joined #ruby
[17:05:45] cagomez: has joined #ruby
[17:05:53] AgentVenom: has joined #ruby
[17:06:47] cagomez: has joined #ruby
[17:08:16] waltair: has joined #ruby
[17:10:55] hxegon: Cyrus: http://mustache.github.io/mustache.5.html
[17:11:08] Cyrus: thadtheman: ^
[17:11:19] hxegon: whoops, sorry Cyrus
[17:12:25] Cyrus: np. Moar coffee. :D
[17:13:02] xzhao: has joined #ruby
[17:13:18] casper_: has joined #ruby
[17:13:47] chopin: has joined #ruby
[17:13:58] _djbkd: has joined #ruby
[17:14:01] kobain: has joined #ruby
[17:15:15] xzhao: has joined #ruby
[17:16:08] kobain: has joined #ruby
[17:16:39] hxegon: and more sleep o.0
[17:17:06] zinbio: has joined #ruby
[17:18:31] skweek: has joined #ruby
[17:22:00] zinbio: Does procs has some limitations when yield is used? I am trying to evaluate these few lines of code and LocalJumpError is raised for not good reason (at last for my brain!): https://eval.in/760033
[17:23:55] matthewd: zinbio: That's equivalent to `yield 2` on its own, in the outer scope
[17:24:03] zinbio: Passing block directly to #call like this $p.call(&block) doesn't work either.
[17:25:40] Bish: has joined #ruby
[17:26:13] matthewd: yield is a keyword, like return; they both act on the current method scope
[17:26:54] yehowyada: has joined #ruby
[17:27:15] zinbio: Why, then, "no block given" is thrown when calling method with block?
[17:30:41] zinbio: It seems like when I wrap proc call with return statement in another method it works OK.
[17:31:38] toretore: your `yield` is expecting the block to be given to the proc
[17:32:45] toretore: $p.call{|n| n }
[17:33:36] zinbio: toretore: Tried it also. It doesn't work: https://eval.in/760056
[17:39:37] pankaj: has joined #ruby
[17:39:47] nowhere_man: has joined #ruby
[17:41:05] tercenya_: has joined #ruby
[17:41:27] toretore: zinbio: ¯\_(ツ)_/¯
[17:44:53] AndBobsYourUncle: has joined #ruby
[17:46:24] blackwind_123: has joined #ruby
[17:46:40] olivier__: has joined #ruby
[17:51:38] hxegon: hmmm: https://eval.in/760059
[17:51:53] hxegon: this returns 2 in pry, but nothing in eval.in
[17:52:47] marcdel: has joined #ruby
[17:56:55] knight33: has joined #ruby
[17:58:21] wkoszek_: Would anyone be intereted in testing the latest Ruby packages I've made? https://github.com/wkoszek/ruby_packages/releases
[17:58:40] wkoszek_: This was done in the frustration of not being able to bootstrap my VPS with Ansible + RVM easily.
[17:59:17] wkoszek_: The whole build is done in a reproducible and traceable way, via Travis Ci, with a build log linked to the release itself.
[17:59:34] havenwood: wkoszek_: nice
[18:18:51] Limix: has joined #ruby
[18:19:20] selfadhesivefilm: has joined #ruby
[18:21:37] TomyLobo2: has joined #ruby
[18:22:32] wkoszek_: havenwood: Looking for testers :-)
[18:24:35] cibs: has joined #ruby
[18:27:35] Verity: has joined #ruby
[18:27:38] Verity: arch or debian?
[18:27:45] Verity: I've used both but can't decide now
[18:28:03] Verity: arch seems to be a PITA and break a lot for me
[18:28:07] adam12: wkoszek_: Did you ever check out the Ubuntu PPA stuff?
[18:28:12] Verity: and I find I'm spendintg too much time fixing it and not coding
[18:28:15] adam12: I've been loving openSUSE Leap lately.
[18:28:18] Verity: but I don't want to miss the latest and greatest
[18:29:07] hxegon: Verity: you could try archbang
[18:29:19] hxegon: A lot simpler to set up, and breaks less in my experience
[18:29:28] Verity: I just tried arch-anywhere
[18:29:38] Verity: but its some mystery location now and windows booted again instead of grub...
[18:29:43] Verity: so I'm considering my options
[18:29:50] duderonomy: has joined #ruby
[18:29:52] gusrub: has joined #ruby
[18:30:13] Verity: I thought I installed it to 2nd partition, but it didnt boot
[18:31:29] Lord_of_Life: has joined #ruby
[18:31:41] jenrzzz: has joined #ruby
[18:31:41] jenrzzz: has joined #ruby
[18:32:03] tomphp: has joined #ruby
[18:33:44] Verity: this opensuse doesnt look half bad
[18:34:35] dhollinger: has joined #ruby
[18:40:19] synthroid: has joined #ruby
[18:40:23] wkoszek_: adam12: I need to push the deb there. I'm waiting for my launchpad accounts to get merged.
[18:40:28] Disavowed: Verity: I found I spent more time maintaining my distro than I did actually working when I had Arch, but I was a lot newer to Linux back then. I like Elementary OS or Mint when I'm on Linux these days.
[18:41:31] Verity: have you tried opensuse, Disavowed
[18:41:35] MTecknology: has joined #ruby
[18:41:37] Verity: I find arch was a pain to maintain
[18:42:05] Verity: I want to spend time learning the code, not getting the editor working
[18:42:10] Disavowed: I must confess I never have used OpenSuse.
[18:42:30] hxegon: We should probably move this to #ruby-offtopic to keep the channel clear
[18:42:31] Disavowed: Verity: Precisely. The other thing I notice about you, and don't take this the wrong way, is that you worry a lot about missing the latest and greatest features
[18:42:37] Disavowed: hxegon: You got it
[18:42:52] Disavowed: Verity: /join ruby-offtopic
[18:44:34] MTecknology: I'm trying to move a ruby app from it's current home to a new system and I'm having two issues with installing gems. I'm getting this error when I try to run bundle install - http://dpaste.com/2XN3GKH
[18:44:45] JeanCarloMachado: has joined #ruby
[18:46:33] timvisher: has joined #ruby
[18:47:04] timvisher: is there a way to check whether a filesystem exists on an unmounted blockdevice from ruby?
[18:48:22] lightheaded: has joined #ruby
[18:48:36] renchan: has joined #ruby
[18:48:50] adam12: timvisher: I'd probably use something from guestfs - virt-filesystems or something...
[18:49:25] adam12: but it's a heavy dependency just for that :\
[18:50:53] matthewd: timvisher: There's https://github.com/ManageIQ/manageiq-gems-pending/tree/master/lib/gems/pending/fs and surrounds if you want to get extreme
[18:51:34] MTecknology: It looks like fastthread is a legacy thing, but I don't see where it's getting pulled in
[18:51:36] timvisher: hmm… i'd like to change what i'm doing to not have to care about this anymore then :)
[18:52:10] Tau: has joined #ruby
[18:53:03] bmurt: has joined #ruby
[18:55:46] cibs: has joined #ruby
[18:57:16] __Yiota: has joined #ruby
[18:59:33] jenrzzz: has joined #ruby
[19:01:47] cibs: has joined #ruby
[19:02:20] JeanCarloMachado: has joined #ruby
[19:02:40] _djbkd: has joined #ruby
[19:02:55] electrostat: has joined #ruby
[19:05:12] gdonald: has joined #ruby
[19:08:19] jenrzzz: has joined #ruby
[19:11:55] roger_rabbit: has joined #ruby
[19:17:02] __Yiota: has joined #ruby
[19:17:17] _djbkd: has joined #ruby
[19:18:16] __Yiota: has joined #ruby
[19:18:57] pLaTo0n: has joined #ruby
[19:19:53] derp10327: has joined #ruby
[19:20:19] derp10327: Ready to start teaching myself some Ruby :D
[19:21:10] adam12: derp10327: Enjoy!
[19:21:17] derp10327: thanks adam12
[19:21:59] Lord_of_Life: has joined #ruby
[19:23:49] solocshaw: has joined #ruby
[19:24:12] derp10327: I'm using RubyMine for now, since I work in Jetbrains IDEs for all my other languages-- Except C#, but tbh I might not ever code in C# again until Rider is out of beta. Unless I have to take a C# class for college.
[19:24:53] adam12: derp10327: RubyMine is fine. Editor likely doesnt matter much in the grand scheme of things
[19:25:27] derp10327: adam12, exactly, I just prefer not needing to learn new hotkeys. I also have grown accustomed to seeing their Darcula theme
[19:25:42] GodFather: has joined #ruby
[19:26:01] derp10327: So in the new project menu, under Ruby, I have two options: New application OR New Gem
[19:26:22] derp10327: What is the main difference between these two in the simplest of words?
[19:26:31] adam12: Well, I have no idea what layout New Application will give, but the New Gem layout is likely similar to what's explained on Rubygems.org.
[19:26:51] adam12: SImplest of words - Gems are libraries, applications are not. If you're not building a library (likely not today), you probably want Application.
[19:27:16] adam12: But as I don't use Rubymine, I'm not sure what the Application option will give you.
[19:27:26] derp10327: adam12, thanks :)
[19:27:31] igniting: has joined #ruby
[19:28:48] derp10327: adam12, Correct me if I'm wrong here (just want to make sure I'm understanding this right) if I'm building a library, I'm building something I import/include/etc into an application in the future?
[19:29:05] adam12: derp10327: Usually, yep.
[19:29:40] derp10327: The only Ruby code I've ever seen before has been modules made for Metasploit.
[19:30:18] derp10327: Is ruby commonly used in proprietary/commercial software?
[19:30:50] adam12: Some applications - but there is no good source obfuscation method for Ruby, which some companies require
[19:31:08] adam12: But Ruby runs both Gitlab and Github, some parts of Redhat, Shopify, etc.
[19:31:13] canton7: you'll see a fair amount of web stuff done in ruby
[19:32:02] derp10327: canton7, a la ruby on rails?
[19:32:29] canton7: I'd guess mainly rails, but there are other frameworks in use
[19:33:27] derp10327: Pretty sure Ruby runs Groupon
[19:33:43] adam12: Yeah - some parts of YellowPages too, IIRC. And probably hundreds of other companies.
[19:34:54] derp10327: It will be nice to learn a (non-webserver) language that can also be used for web development
[19:35:04] Silthias: has joined #ruby
[19:38:07] d5sx43: has joined #ruby
[19:42:27] Verity: ruby is great for everything
[19:44:03] Verity: I'm writing an rs232 file transfer application
[19:44:48] brent__: has joined #ruby
[19:45:16] enterprisey: has joined #ruby
[19:45:25] dionysus69: has joined #ruby
[19:48:26] cagomez: has joined #ruby
[19:49:30] Yiota: has joined #ruby
[19:50:25] Emmanuel_Chanel: has joined #ruby
[19:51:04] nofxxxx: derp10327, A WHOLE LOT... you guys are forgetting SaaS
[19:52:21] nofxxxx: 90 -> exe installers , 00 -> web saas, 10 -> web saas with offline support hehe
[19:52:46] workmad3: has joined #ruby
[19:53:39] kubunto: has joined #ruby
[19:54:04] kubunto: is it possible to stand a ruby on rails server on the raspberry pi?
[19:54:40] havenwood: kubunto: yes
[19:54:46] ecuanaso: has joined #ruby
[19:55:17] kubunto: ill have to google around again because i had trouble with it when i tried
[19:55:25] nofxxxx: kubunto, prob actually is disk writing... or database. Not webserver
[19:55:27] kubunto: (i dont recall the exact problems i had)
[19:55:33] nofxxxx: use redis with a very high write timeout
[19:55:56] kubunto: nofxxxx: i couldnt get a default page to show up
[19:56:11] kubunto: like i said i dont remember what went wrong
[19:56:55] nofxxxx: kubunto, prob nothing to do with the pi itself... it's just linux on that regard
[19:57:29] kubunto: the pi3 has a good processor but the earlier versions not so much
[19:58:10] derp10327: So I've made a class Parity
[19:58:27] derp10327: defined a method in Parity, even_or_odd
[19:58:37] centrx: good work!
[19:58:38] derp10327: how do I call that method in the same .rb file?
[19:58:52] kubunto: tyvm for the info, if i run into issues ill stop by
[19:58:55] kubunto: has left #ruby: ()
[19:59:08] davorb: has joined #ruby
[19:59:16] allisio: >> class Parity; def self.parity n; %i[even odd][n % 2] end end; Parity.parity 42
[19:59:17] ruby[bot]: allisio: # => :even (https://eval.in/760117)
[20:00:05] derp10327: Thanks allisio :)
[20:01:05] derp10327: My mistake was not using def self.parity
[20:01:12] derp10327: "self." that is
[20:01:20] allisio: I thought that might be it.
[20:01:46] lxsameer: has joined #ruby
[20:02:04] allisio: There are all sorts of ways to "namespace" some set of convenience methods, and sticking them on a Class that won't ever actually be instantiated isn't the best.
[20:03:05] allisio: Using a Module and #module_function is certainly better, possibly ideal: https://eval.in/760118
[20:05:06] ascio: has joined #ruby
[20:06:47] cdg: has joined #ruby
[20:10:09] ascio: Hi #ruby. I'm trying to reason about a set of classes and decide on an inheritance/composition scheme and I'm looking for some guidance. I am going to have multiple kinds of Browsers - say, a GraphicalBrowser and a TextBrowser, for starters. All Browsers will implement things like #open!, #close!, #goto!, #url, and some other general methods; but only GraphicalBrowser will have #screenshot. If I make TextBrowser and GraphicalBrowser each i
[20:11:14] olivier__: has joined #ruby
[20:11:19] ascio: My idea is that for the most operations (navigation, locating elements, etc) a client should not need to know what kind of Browser is being used, so I am worried it can be confusing having some kinds of Browser implement a method, and others not
[20:13:13] t-recx: has joined #ruby
[20:15:23] Limix: has joined #ruby
[20:16:03] despai: has joined #ruby
[20:16:20] pankaj: has joined #ruby
[20:17:28] cagomez: has joined #ruby
[20:17:33] Rodya_: has joined #ruby
[20:17:35] ecuanaso: has joined #ruby
[20:17:57] kitikonti: has joined #ruby
[20:18:11] hxegon: Just throwing this out there, this could be a terrible idea
[20:18:59] Sammichmaker: has joined #ruby
[20:20:42] derp10327: So in (many) programming languages you can call different methods in the following ways: "foo.method()" or "method(foo)"
[20:21:15] derp10327: Are there names for those two types of methods
[20:22:16] ujjain: has joined #ruby
[20:22:16] ujjain: has joined #ruby
[20:22:29] derp10327: examply str.gsub(parameters)
[20:22:50] hxegon: ascio: hold on, trying to find some old code
[20:23:08] allisio: derp10327: When there's a receiver, it's a method. Otherwise, it's generally called a function.
[20:23:19] allisio: But there's always a receiver in Ruby, so Ruby doesn't really have functions.
[20:23:45] ytti_: thank goodness
[20:23:52] gdonald: has joined #ruby
[20:23:53] ytti_: len(str) sorted(ary)
[20:24:08] derp10327: allisio, is "self" the receiver of self.method()?
[20:24:20] allisio: derp10327: Yeah, and there's always an implicit `self`.
[20:24:31] allisio: >> self # even at top-level
[20:24:32] ruby[bot]: allisio: # => main (https://eval.in/760125)
[20:24:33] derp10327: Thank you :)
[20:24:39] allisio: Happy to help. :)
[20:24:44] ascio: hxegon: "(04:18:10 PM) hxegon: Just throwing this out there, this could be a terrible idea"
[20:24:50] ascio: am i correct in assuming this is in response to my question?
[20:25:19] hxegon: ascio: It's the disclaimer to answer I'll give in a minute
[20:25:32] ascio: ahh ok, sorry don't mean to be impatient
[20:26:01] TTilus: has joined #ruby
[20:27:36] muelleme: has joined #ruby
[20:29:23] derp10327: allisio, How do I define a method so that it takes a receiver other than 'self', I can't seem to find this in the docs. For example 'hello'.method() or str.method()
[20:30:41] patarr: Why does "Excon::Errors::BadRequest".constantize give me a Class?
[20:31:12] patarr: "...".constantize.kind_of? StandardError doesn't seem to work right
[20:31:13] dminuoso: derp10327: You can't.
[20:31:44] dminuoso: derp10327: The only thing you can control is what you define it on. There's a couple global options available.
[20:31:57] dminuoso: Defining methods in top level space will put them into the (main) objects singleton class.
[20:32:56] cibs: has joined #ruby
[20:33:19] derp10327: dminuoso, how would I write a method that is called as such: 'foo.method()'
[20:33:35] derp10327: It has to be possible because there are built-in methods such as foo.gsub()
[20:33:53] dminuoso: derp10327: define it in any of foo.class.ancestors
[20:34:12] dminuoso: or inject a module between any of them
[20:34:38] hxegon: derp10327: or use refinements
[20:34:56] dminuoso: refinements are not an alternative but an augmented solution.
[20:35:07] allisio: derp10327: You're getting a lot of good but perfectly irrelevant advice. :P
[20:35:10] Disavowed: Rubocop is giving me gyp: "Use nested module/class definitions instead of compact style.". What does it mean?
[20:35:23] allisio: You can invoke `foo.gsub` when `foo` is a String, because #gsub is one of String's instance methods.
[20:35:38] dminuoso: Disavowed: class Foo::Bar can be a pit
[20:35:49] dminuoso: Disavowed: The reason has to do with how nesting and things like constant lookup works
[20:35:59] conta: has joined #ruby
[20:36:02] dminuoso: Disavowed: If you are aware of it and know the implications it's perfectly fine though.
[20:36:12] derp10327: allisio, so I need to write an instance method of my own to accomplish my goal then right?
[20:36:17] dminuoso: If you don't, use nested definitions instead.
[20:36:25] dminuoso: (They are less likely to trip you up)
[20:37:06] dminuoso: Disavowed: Don't trust rubocop blindly though. Configure it explicitly to warn you about what you care about.
[20:37:11] hxegon: ascio: still thinking, could you give me some more detail? What is your ideal behaviour if a client asks a text browser for a gui browser feature? Is that something that should even be possible? What is the client?
[20:37:12] allisio: Disavowed: https://eval.in/760128
[20:37:15] dminuoso: Don't just use it with default settings.
[20:37:46] derp10327: allisio, my current code is in the following form: https://hastebin.com/ihaluwozuf.rb
[20:37:48] Disavowed: dminuoso: Newish to idiomatic Ruby so I guess there's an element of blindly following. You're not the first to tell me not to follow it dogmatically actually, perhaps I should look at it less.
[20:37:53] dminuoso: allisio, Disavowed: https://eval.in/760129
[20:37:55] dminuoso: allisio: meant to post this.
[20:38:10] hxegon: ascio: also, I'm going to lunch, but I'll read whatever you send me and get back to you.
[20:38:31] cagomez: if I have class Foo; def self.some_method(bar); new(bar).some_other_method; . is new(bar) calling itself
[20:38:33] Disavowed: allisio: That's much clearer. Thank you!
[20:39:07] Disavowed: Sorry, mistag. dminuoso, thank you!
[20:39:10] allisio: cagomez: Yeah.
[20:39:14] Disavowed: (Although thank you too, allisio)
[20:39:43] allisio: derp10327: As it stands, you can invoke your #foo method on instances of the String class.
[20:39:45] dminuoso: Disavowed: Well you should thank allisio. I just corrected his less representative eval.in :)
[20:39:59] derp10327: allisio alright :)
[20:40:23] dminuoso: Disavowed: Personally I use compact style everywhere because I cant be fucked to waste whitespace for no good reason.
[20:40:31] cagomez: allisio: so new(bar).some_other_method is the same as initialize(bar) ?
[20:40:42] allisio: cagomez: No, not quite.
[20:40:47] Disavowed: dminuoso: I'll probably follow your lead then - I've enough of whitespace wastage coming from Python
[20:40:56] dminuoso: Disavowed: Just be careful if you use Rails.
[20:40:57] cagomez: *initialize(bar).some_other_method ?
[20:41:03] allisio: You generally don't invoke #initialize directly, since you also want the #allocate that gets implicitly called when you say `.new`.
[20:41:07] derp10327: Finally figured it out
[20:41:09] dminuoso: Disavowed: Do you use Rails?
[20:42:31] ascio: hxegon: thanks for taking the time to think about the problem, i appreciate your help. the long-term plan for this project is to intelligently analyze the calls made for a given Browser object in a given script, and determine from those calls which Browser type is appropriate to instantiate
[20:42:34] ascio: hxegon: (i.e. if methods like #screenshot are called, then a GraphicalBrowser is required to execute that properly). so building up to that, I was thinking of making an abstract Browser class with all possible browser actions raising NotImplementedError, and specific Browser subclasses defining which methods are appropriate. (sorry if this is unclear, I can try to rephrase)
[20:42:41] ascio: hxegon: however this doesn't feel like idiomatic ruby to me
[20:42:48] dminuoso: Disavowed: If you do, you should really stick to the nested syntax or stop right now and learn how autoloading works.
[20:42:50] Disavowed: dminuoso: On occasion. I'm a big fan
[20:43:02] dminuoso: Disavowed: Then dont use it with Rails or learn about how the autoloader works.
[20:43:20] Disavowed: I'll stick, but I think learning how autoloader works is a smart play. I need to hit the books with Ruby again I think
[20:44:55] dminuoso: Disavowed: The real mean pitfall in Rails is that if you specify Foo::Bar and use Quux inside it, it will *not* check Foo:: for Quux.
[20:44:55] ascio: hxegon: if it helps understand any, the inspiration/idea for this project is, basically, a common interface between libraries like watir/mechanize/nokogiri/etc that defaults to whichever libary is least resource intensive while fulfilling requirements
[20:45:03] dminuoso: Disavowed: This can lead to really surprising bugs.
[20:45:32] dminuoso: Disavowed: Essentially Rails checks for missing constants in all autoloaded dirs with the nesting in the spot it was used in in mind.
[20:46:41] dminuoso: (A common case is when you have some Admin namespace that you use to separate user and admin stuff. Something like Admin::ActionController using User could have some unwanted side-effects. ;-)
[20:55:10] derp10327: what does '&:' mean in '&:capitalize'
[20:56:05] AndBobsYourUncle: has joined #ruby
[20:56:30] allisio: It's invoking the #to_proc method on the Symbol `:capitalize`, which in turn prepares it to be used like a block.
[20:56:53] allisio: >> a = ['foo', 'bar']; a.map(&:capitalize) == a.map { |s| s.capitalize }
[20:56:54] ruby[bot]: allisio: # => true (https://eval.in/760133)
[20:57:58] derp10327: >> a= 'aren\'t'; a.gsub(/\w+/, &:capitalize)
[20:58:01] ruby[bot]: derp10327: # => "Aren'T" (https://eval.in/760136)
[20:58:17] derp10327: I need to check just for '^' and '[ ]'
[20:58:52] allisio: derp10327: Several other default classes come with a moderately useful #to_proc already defined, but Symbol's is far and away the most commonly used and useful.
[20:58:53] milardovich: has joined #ruby
[20:59:36] allisio: >> h = {a: 1, b: 2}; [:a, :b, :c].map(&h) # Hash recently got one that proxies to Hash#[].
[20:59:37] ruby[bot]: allisio: # => [1, 2, nil] (https://eval.in/760138)
[21:00:03] derp10327: >> a = 'aren\'t'; a.gsub(/(?:^|(?<=[ ]))[a-z]/, &:capitalize)
[21:00:04] ruby[bot]: derp10327: # => "Aren't" (https://eval.in/760139)
[21:00:53] ecuanaso: has joined #ruby
[21:01:09] derp10327: Well thanks for all the help and info, I gotta get going to class now :)
[21:01:14] derp10327: catch you all later
[21:01:18] derp10327: has left #ruby: ("Leaving")
[21:01:40] milardovich: has joined #ruby
[21:05:32] ghoti: has joined #ruby
[21:05:34] araujo: has joined #ruby
[21:05:54] jrafanie: has joined #ruby
[21:06:31] AndBobsYourUncle: has joined #ruby
[21:10:39] loincloth: has joined #ruby
[21:13:07] ascio: additionally - another unrelated problem - I want to test that some code executes within a certain block; specifically, I want to make sure that a method's code is wrapped in a mutex#synchronize block. currently, i am testing that a method is synchronous by expecting #synchronize to be called on a dependency-injected mutex, but another user here pointed out to me yesterday that this does not test that the relevant code is actually called -
[21:13:25] AndBobsYourUncle: has joined #ruby
[21:14:40] milardovich: has joined #ruby
[21:17:48] xenops: has joined #ruby
[21:18:40] milardovich: has joined #ruby
[21:19:55] sunya7a__: has left #ruby: ()
[21:20:06] olivier__: has joined #ruby
[21:20:26] sunya7a: has joined #ruby
[21:21:39] d5sx43: has joined #ruby
[21:26:37] cibs: has joined #ruby
[21:30:10] elifoster: has joined #ruby
[21:31:08] GodFather: has joined #ruby
[21:32:27] AndBobsYourUncle: has joined #ruby
[21:37:53] olivier__: has joined #ruby
[21:38:00] AndBobsYourUncle: has joined #ruby
[21:38:25] _djbkd: has joined #ruby
[21:38:28] hxegon: ascio: back. Just read your... comments? posts? messages? messages. I have an idea, give me a minute to write it up.
[21:39:22] nyuszika7h: has joined #ruby
[21:39:24] CGibsonmm: has joined #ruby
[21:40:27] nicolai86: has joined #ruby
[21:42:06] kobain: has joined #ruby
[21:42:10] duckpupp1: has joined #ruby
[21:43:19] hxegon: ascio: just going to put it in a gist
[21:44:11] workmad3: has joined #ruby
[21:44:56] hxegon: also going to assume you wanted the mutex thing in the browsers, but it should be easy to take out if that's not the case
[21:48:40] cibs: has joined #ruby
[21:49:03] CGibsonmm: has joined #ruby
[21:51:07] tomphp: has joined #ruby
[21:51:08] ascio: hxegon: hey, sorry had to step away. again thanks for taking the time to help me reason about this
[21:52:27] kirun: has joined #ruby
[21:52:34] Tau: has joined #ruby
[21:52:55] hxegon: no problem ascio, this is somewhat similar to another problem I had to think a long time about :)
[21:53:23] Tau: has joined #ruby
[21:55:40] Rodya_: has joined #ruby
[21:56:56] hxegon: almost there ascio
[21:59:59] Lord_of_Life: has joined #ruby
[22:00:10] despai: has joined #ruby
[22:00:55] Rodya__: has joined #ruby
[22:01:52] mikecmpbll: has joined #ruby
[22:02:42] roamingdog: has joined #ruby
[22:04:48] JeanCarloMachado: has joined #ruby
[22:05:26] millerti: has joined #ruby
[22:06:22] hxegon: scratch that, realized I was coding metaprogramming cthulhu and currently fixing that part of the design 0.0
[22:06:27] rikkipitt: has joined #ruby
[22:07:43] cibs: has joined #ruby
[22:10:37] Tau: has joined #ruby
[22:11:35] alphor: has joined #ruby
[22:12:24] TheHodge: has joined #ruby
[22:13:59] AndroUser123: has joined #ruby
[22:14:16] d5sx43: has joined #ruby
[22:14:26] AndroUser123: my code is too slow again another example
[22:14:26] AndroUser123: https://gist.github.com/anonymous/41fd131cf60410e8f9dfe04a1b534f85
[22:14:32] AndroUser123: for this https://www.hackerrank.com/challenges/circular-array-rotation
[22:14:38] AndroUser123: simple rotation
[22:16:38] milardovich: has joined #ruby
[22:16:55] SeepingN: has joined #ruby
[22:17:36] baweaver: ACTION grumbles about learning indentation
[22:18:09] avrelaun: has joined #ruby
[22:18:22] baweaver: https://gist.github.com/anonymous/41fd131cf60410e8f9dfe04a1b534f85#gistcomment-2036111 - Consistent indentation
[22:18:55] AndroUser123: ok thanks but why is this code too slow
[22:19:49] hxegon: alright, think I fixed it. making basic implementation ascio
[22:20:28] olivier__: has joined #ruby
[22:21:30] olivier__: has joined #ruby
[22:22:02] postmodern: has joined #ruby
[22:22:05] catbusters: has joined #ruby
[22:22:37] baweaver: Do you actually need to transform the array?
[22:23:10] baweaver: hint: no, modulo is a great thing
[22:23:17] baweaver: work from that
[22:23:36] ascio: hxegon: hey thanks, i'm currently trying to expect a method call within a stub to solve the mutex testing probem but no dice
[22:23:40] AndroUser123: but what would i do with modulo here
[22:23:50] baweaver: think about it for a bit.
[22:24:39] Tau: has joined #ruby
[22:27:48] AndroUser123: its easier to change the array
[22:31:25] AndroUser123: everything moves k places right
[22:33:15] AndroUser123: every element moves n%k to the right
[22:34:02] mim1k: has joined #ruby
[22:34:12] Tau: has joined #ruby
[22:35:19] baweaver: AndroUser123: easier for you or easier for the computer?
[22:35:39] baweaver: then you have an issue
[22:36:09] baweaver: Assume you cannot change the array in any way shape or form
[22:36:12] baweaver: build from there.
[22:36:15] Tau: has joined #ruby
[22:36:30] AndroUser123: like a[n%k+....[
[22:37:24] Limix: has joined #ruby
[22:37:27] baweaver: give it a try.
[22:37:55] baweaver: Loops get expensive. If you can do it mathematically it's a substantial reduction in time.
[22:39:20] AndroUser123: any more hints
[22:40:08] baweaver: get back to coding and try those previous hints out
[22:40:20] NightMonkey: has joined #ruby
[22:41:22] AndroUser123: also my code was also slow here
[22:41:23] AndroUser123: https://www.hackerrank.com/challenges/climbing-the-leaderboard
[22:42:05] AndroUser123: https://gist.github.com/anonymous/949d390acab9b1bbffa5efeb779255b1
[22:42:23] AndroUser123: i removed each_with_index in real code and optimized it a little
[22:42:55] AndroUser123: but still its very slow for 5mb txt test case
[22:43:37] ascio: hxegon: i am going to need to leave soon, is there a chance i can talk to you later about this problem?
[22:43:59] hxegon: Yes, let me link you to my gist in progress and you can check on it later
[22:44:25] hxegon: ascio: https://gist.github.com/hxegon/e4b5bd34344d99b7fe6c0b1bf6c60955
[22:44:55] Rodya_: has joined #ruby
[22:45:11] sarbs_: has joined #ruby
[22:45:17] Jayson_Virissimo: has joined #ruby
[22:45:56] AndroUser123: baweaver any hints on second one
[22:46:18] RenatoSilva: has joined #ruby
[22:46:40] ascio: thanks hxegon! really appreciate the work/thought you put into helping me
[22:47:09] bmurt: has joined #ruby
[22:47:43] enterprisey: has joined #ruby
[22:48:00] hxegon: ascio: no problem, I like design challenges. Hopefully someone will tear it apart when I post the link to the finished version
[22:48:48] ascio: do you have any issues with me cannibalizing this code?
[22:48:54] hxegon: not at all
[22:49:02] ascio: awesome, thank you very much
[22:49:09] ascio: i'll let you know later what i end up doing with it
[22:49:13] ascio: if you're interested
[22:49:29] hxegon: consider it under the WTFPL license
[22:50:00] hxegon: cool, even if I'm afk you can mention me and I'll see it later
[22:50:53] ascio: haha first i've heard of this license, simple enough
[22:51:49] hahuang61: has joined #ruby
[22:53:09] houhoulis: has joined #ruby
[22:54:03] NightMonkey: has joined #ruby
[22:54:32] davorb: has joined #ruby
[22:55:10] hays: has joined #ruby
[22:56:05] ahrs: has joined #ruby
[22:57:18] hxegon: ascio: also, check out the comment in .def_synchr_action and comment if you think it would work. I'm heading out, but I'll work on it more in a bit and be back on.
[22:58:16] agent_white: has joined #ruby
[23:01:10] ujjain: has joined #ruby
[23:01:10] ujjain: has joined #ruby
[23:01:14] maattdd: has joined #ruby
[23:02:26] CloCkWeRX: has joined #ruby
[23:03:59] roamingdog: has joined #ruby
[23:06:53] doublemalt_: has joined #ruby
[23:10:11] rakm: has joined #ruby
[23:10:53] aryaching_: has joined #ruby
[23:19:47] zeddan: has joined #ruby
[23:22:26] bronson_: has joined #ruby
[23:29:56] JeanCarloMachado: has joined #ruby
[23:30:25] cagomez: has joined #ruby
[23:31:38] swills_: has joined #ruby
[23:32:46] RenatoSilva: has joined #ruby
[23:33:12] cagomez_: has joined #ruby
[23:33:51] cibs: has joined #ruby
[23:34:37] kiki_lamb: has joined #ruby
[23:35:25] charliesome: has joined #ruby
[23:35:31] pankaj: has joined #ruby
[23:38:14] roamingdog: has joined #ruby
[23:39:01] Limix: has joined #ruby
[23:40:15] cibs: has joined #ruby
[23:42:56] duckpupp1: has joined #ruby
[23:45:17] hutch34: has joined #ruby
[23:45:19] alibby: has joined #ruby
[23:47:37] Rodya_: has joined #ruby
[23:48:56] JeanCarloMachado: has joined #ruby
[23:50:16] eclm: has joined #ruby
[23:50:35] milardovich: has joined #ruby
[23:54:17] SeepingN: has joined #ruby
[23:54:29] hutch34: has joined #ruby
[23:56:17] swills_: has joined #ruby
[23:59:23] charliesome: has joined #ruby