« Back to channel list

#ruby - 14 July 2016

« Back 1 day Forward 1 day »
[00:01:20] skalfyfan: has joined #ruby
[00:01:47] mikeiniowa: has joined #ruby
[00:02:11] hahuang61: has joined #ruby
[00:02:37] Dimik--: has joined #ruby
[00:02:49] Asher: has joined #ruby
[00:02:53] dragon9783: has joined #ruby
[00:03:46] skalfyfan: has joined #ruby
[00:05:15] colegatron_origi: has joined #ruby
[00:06:32] hipertracker: has joined #ruby
[00:09:54] Niandalu: has joined #ruby
[00:11:56] mattwashere: has joined #ruby
[00:12:16] Xiti`: has joined #ruby
[00:13:17] tristanp: has joined #ruby
[00:18:31] roamingdog: has joined #ruby
[00:23:37] postmodern: has joined #ruby
[00:24:20] hipertracker: has joined #ruby
[00:24:45] mistermocha: has joined #ruby
[00:25:21] flyinprogrammer: has left #ruby: ()
[00:27:12] ramfjord: has joined #ruby
[00:28:51] tristanp: has joined #ruby
[00:29:01] nettoweb: has joined #ruby
[00:31:57] mrmargolis: has joined #ruby
[00:32:32] Asher: has joined #ruby
[00:34:21] hipertracker: has joined #ruby
[00:35:08] nettoweb: has joined #ruby
[00:35:12] blackmesa: has joined #ruby
[00:39:38] sucks: has joined #ruby
[00:44:10] mistermocha: has joined #ruby
[00:44:13] hipertracker: has joined #ruby
[00:44:45] karapetyan: has joined #ruby
[00:45:10] tristanp: has joined #ruby
[00:45:13] coffeecupp: has joined #ruby
[00:48:41] roamingdog: has joined #ruby
[00:54:11] hipertracker: has joined #ruby
[00:57:12] zacts: has joined #ruby
[00:57:28] bweston92: has joined #ruby
[00:58:59] shakes: has joined #ruby
[00:59:35] nankyokusei: has joined #ruby
[00:59:54] tristanp: has joined #ruby
[01:02:13] weaksauce: has joined #ruby
[01:03:02] hahuang61: has joined #ruby
[01:04:18] crystal77: has joined #ruby
[01:07:36] SilverKey: has joined #ruby
[01:11:34] macsteps: has joined #ruby
[01:13:34] hipertracker: has joined #ruby
[01:13:40] tristanp: has joined #ruby
[01:14:18] hutch34_: has joined #ruby
[01:16:10] zacts: I'm getting through rubymonk
[01:16:13] zacts: it's cool
[01:16:28] zacts: I feel kind of like Thelonious Monk's Ruby my Dear
[01:16:33] zacts: for sures...
[01:20:27] hipertracker: has joined #ruby
[01:23:56] ryez: has joined #ruby
[01:24:09] cdg: has joined #ruby
[01:24:25] ramfjord: Heya guys - Anyone know how to (in rspec) make sure that a varargs method is called, and each of it's arguments fit a matcher? This gist should provide an example: https://gist.github.com/ramfjord/1f7a9f3809d644563994b811fb375487
[01:25:23] Ropeney: has joined #ruby
[01:26:09] ramfjord: if I pass in an array it's easy to do .with(all(starts_with("hello"))) - but that doesn't seem to work with varargs
[01:26:23] ramfjord: not sure what this (paren, syntax) is indicating in the error
[01:26:42] GinoMan2440: has joined #ruby
[01:29:46] ramfjord: nvm, finally got a google search that showed me a working syntax using receive(:method) do |*args|
[01:30:01] tristanp: has joined #ruby
[01:31:20] colegatron_origi: has joined #ruby
[01:35:39] mistermocha: has joined #ruby
[01:36:52] blackmesa: has joined #ruby
[01:37:06] LoneHerm_: has joined #ruby
[01:37:36] enterprisey: has joined #ruby
[01:40:58] allstar: has joined #ruby
[01:41:21] dkam: has joined #ruby
[01:41:48] Asher: has joined #ruby
[01:43:05] hipertracker: has joined #ruby
[01:44:22] huser: has joined #ruby
[01:45:49] allstar: has joined #ruby
[01:46:41] tristanp: has joined #ruby
[01:48:18] Spami: has joined #ruby
[01:51:01] skalfyfan: has joined #ruby
[01:53:18] tossup__: has joined #ruby
[01:54:44] hipertracker: has joined #ruby
[01:54:59] jenrzzz: has joined #ruby
[01:56:11] rstacruz: has joined #ruby
[01:58:02] karapetyan: has joined #ruby
[01:59:31] hutch34_: has joined #ruby
[02:03:30] tristanp: has joined #ruby
[02:06:24] tossup: has joined #ruby
[02:07:40] mattwashere: has joined #ruby
[02:07:55] moeabdol: has joined #ruby
[02:14:19] hipertracker: has joined #ruby
[02:14:33] mistermocha: has joined #ruby
[02:16:12] macsteps: has joined #ruby
[02:17:56] macsteps: has joined #ruby
[02:20:07] nettoweb: hey guys, is it possible to create a similar script to setup a app but with ruby? this one is created with python: https://github.com/evanplaice/sublime-text-seed/blob/master/setup.py
[02:21:26] hutch34_: has joined #ruby
[02:22:01] mistermocha: has joined #ruby
[02:23:54] tristanp: has joined #ruby
[02:24:03] roamingdog: has joined #ruby
[02:25:48] A_Drone: has joined #ruby
[02:25:56] al2o3-cr: sure, why not
[02:29:22] Sebastian1408: has joined #ruby
[02:30:12] akira616: has joined #ruby
[02:30:24] Mia: has joined #ruby
[02:30:24] Mia: has joined #ruby
[02:31:48] Sebastian1408: has left #ruby: ()
[02:33:18] ElFerna: has joined #ruby
[02:33:44] claw: has joined #ruby
[02:34:03] hipertracker: has joined #ruby
[02:36:41] mattwashere: has joined #ruby
[02:37:40] blackmesa: has joined #ruby
[02:39:09] tmtwd: has joined #ruby
[02:39:40] mattwashere: has joined #ruby
[02:42:46] tristanp: has joined #ruby
[02:42:48] shevy: looks very straightforward
[02:43:00] shevy: subprocess.call(['sudo', 'id', '-nu'], stdout=subprocess.PIPE)
[02:43:17] shevy: in ruby... begin/rescue, and system or ``
[02:46:17] ecksit: has joined #ruby
[02:49:10] mindcrimes: has joined #ruby
[02:49:33] mindcrimes: activesupport requires Ruby version >= 2.2.2.
[02:49:55] mindcrimes: any idea what this error means?
[02:51:45] eam: mindcrimes: it means the gem requires a version of ruby 2.2.2 or newer
[02:51:54] mk92: has joined #ruby
[02:51:58] eam: sometimes gems have dependencies on the version of ruby itself
[02:52:52] mk92: has joined #ruby
[02:53:04] mrmargolis: has joined #ruby
[02:53:12] havenwood: mindcrimes: Preferably use Ruby 2.2.5 or 2.3.1 (the latest versions of the supported releases).
[02:53:41] ecksit: has joined #ruby
[02:53:44] mindcrimes: any idea how to install ruby 2.2.5 on centos?
[02:53:46] nettoweb: has joined #ruby
[02:54:11] hipertracker: has joined #ruby
[02:54:28] coffeecupp: has joined #ruby
[02:54:36] shevy: you can try things such as https://github.com/postmodern/chruby
[02:55:41] havenwood: mindcrimes: Do you just need one Ruby for production or are you going to be switching between Rubies?
[02:56:35] xall: has joined #ruby
[02:57:40] shevy: one gem to rule them
[02:57:42] coffeecupp: has joined #ruby
[02:57:45] Rodya_: has joined #ruby
[02:57:52] shevy: one gem to find them
[02:58:20] howdoi: has joined #ruby
[02:58:59] drewo: has joined #ruby
[03:00:17] Rodya_: has joined #ruby
[03:00:26] AndyBotwin: has joined #ruby
[03:00:28] nankyokusei: has joined #ruby
[03:01:03] Xiti: has joined #ruby
[03:02:44] havenwood: mindcrimes: You could use ruby-install to install to /usr/local/ for your one Ruby: https://github.com/postmodern/ruby-install
[03:02:51] eizua: has joined #ruby
[03:03:03] tristanp: has joined #ruby
[03:03:11] havenwood: mindcrimes: sudo ruby-install --latest --system ruby-2.2.5
[03:03:41] havenwood: mindcrimes: ^ that will install Ruby 2.2.5 to /usr/local
[03:03:43] havenwood: /usr/local/bin
[03:04:00] hahuang61: has joined #ruby
[03:05:10] mindcrimes: bash: ruby-install: command not found
[03:05:42] havenwood: mindcrimes: you'd just have to install ruby-install first
[03:05:50] havenwood: mindcrimes: https://github.com/postmodern/ruby-install#install
[03:09:34] Asher: has joined #ruby
[03:11:14] kavanagh: has joined #ruby
[03:11:59] macsteps: has joined #ruby
[03:12:40] memorasus1: has joined #ruby
[03:13:10] roamingdog: has joined #ruby
[03:13:11] nettoweb: has joined #ruby
[03:13:32] hipertracker: has joined #ruby
[03:13:33] mindcrimes: didnt seem to work
[03:13:39] mindcrimes: >>> Successfully installed ruby 2.2.5 into /usr/local
[03:13:39] mindcrimes: [root@BlackQuarterback ruby-install-0.6.0]# gem install discordrb
[03:13:39] mindcrimes: ERROR: Error installing discordrb: activesupport requires Ruby version >= 2.2.2.
[03:13:39] mindcrimes: [root@BlackQuarterback ruby-install-0.6.0]#
[03:13:56] mindcrimes: sorry for this giant wall of text
[03:14:33] shevy: you still have the old ruby?
[03:15:04] mindcrimes: should i uninstall it?
[03:17:25] karapetyan: has joined #ruby
[03:18:14] shevy: dunno, up to you, the issue probably is that your $PATH has the old ruby first
[03:18:34] shevy: have a look into /usr/local first, if the above was correct, there should be a bin/ruby there
[03:18:39] shevy: and also a gem
[03:18:49] shevy: you can try to put /usr/local first on $PATH to see if that changes it
[03:22:38] moeabdol1: has joined #ruby
[03:25:19] tristanp: has joined #ruby
[03:28:40] treaki_: has joined #ruby
[03:31:35] ryez: has joined #ruby
[03:32:01] mindcrimes: so ruby -v shows ruby 2.2.5p319 but i still get the same error
[03:32:20] tmtwd: has joined #ruby
[03:35:20] A_Drone: has joined #ruby
[03:37:36] hipertracker: has joined #ruby
[03:38:26] blackmesa: has joined #ruby
[03:38:37] arooni-mobile: has joined #ruby
[03:38:40] arooni-mobile__: has joined #ruby
[03:38:49] shevy: gem --version shows?
[03:39:38] LoneHerm_: has joined #ruby
[03:39:57] mindcrimes: nvm i fixed it
[03:40:07] mindcrimes: found a script that installs the needed version
[03:41:09] tristanp: has joined #ruby
[03:41:25] moeabdol2: has joined #ruby
[03:41:41] arescorpio: has joined #ruby
[03:45:12] moeabdol3: has joined #ruby
[03:51:31] gusrub: has joined #ruby
[03:51:42] elifoster: has joined #ruby
[03:54:36] ramfjord: has joined #ruby
[03:56:31] mattwashere: has joined #ruby
[03:56:36] tristanp: has joined #ruby
[03:57:45] hipertracker: has joined #ruby
[03:59:17] mattwashere: has joined #ruby
[03:59:27] leea: has joined #ruby
[03:59:55] mattwashere: has joined #ruby
[04:00:01] allstar: has joined #ruby
[04:00:17] A_Drone: has joined #ruby
[04:04:26] singalaut: has joined #ruby
[04:05:02] hahuang61: has joined #ruby
[04:05:22] gix: has joined #ruby
[04:06:24] macsteps: has joined #ruby
[04:09:14] gusrub: has joined #ruby
[04:11:22] yadobujo: has joined #ruby
[04:14:18] underplank: has joined #ruby
[04:17:18] moeabdol3: has joined #ruby
[04:18:14] dfinninger: has joined #ruby
[04:20:52] karapetyan: has joined #ruby
[04:23:01] djbkd: has joined #ruby
[04:26:51] hipertracker: has joined #ruby
[04:30:50] mindcrimes: has left #ruby: ()
[04:30:52] moeabdol3: has joined #ruby
[04:32:01] mistermocha: has joined #ruby
[04:34:18] astrobun_: has joined #ruby
[04:34:57] tristanp_: has joined #ruby
[04:39:26] roamingdog: has joined #ruby
[04:39:26] mk92: has joined #ruby
[04:40:33] blackmesa: has joined #ruby
[04:40:50] tvw: has joined #ruby
[04:42:40] enterprisey: has joined #ruby
[04:43:36] mk92: has joined #ruby
[04:45:06] tmtwd: has joined #ruby
[04:48:53] zacts: has joined #ruby
[04:52:38] conta: has joined #ruby
[04:58:28] alfiemax: has joined #ruby
[04:59:41] Gooer: has joined #ruby
[05:01:05] pawnbox: has joined #ruby
[05:01:20] nankyokusei: has joined #ruby
[05:02:06] d5sx43: has joined #ruby
[05:02:27] et09: has joined #ruby
[05:02:32] hahuang61: has joined #ruby
[05:02:44] et09: lambda{|x| foobar(x)} === ->(x){ foobar(x)} correct?
[05:04:03] singalaut: has joined #ruby
[05:04:55] mk92: has joined #ruby
[05:06:53] craigp_: has joined #ruby
[05:07:05] tmtwd: has joined #ruby
[05:08:59] mattwashere: has joined #ruby
[05:09:17] et09: hey Radar long time no see
[05:10:39] Bugboy1028: has joined #ruby
[05:14:45] harfangk: has joined #ruby
[05:15:39] Bugboy1028: has joined #ruby
[05:20:38] Bugboy1028: has joined #ruby
[05:22:03] LoneHermit: has joined #ruby
[05:22:51] pwnd_nsfw: has joined #ruby
[05:22:55] bluOxigen: has joined #ruby
[05:29:30] monoprotic: has joined #ruby
[05:29:44] travisxcode: has joined #ruby
[05:30:54] jenrzzz: has joined #ruby
[05:31:13] mk92: has joined #ruby
[05:33:25] ramfjord: has joined #ruby
[05:37:21] pawnbox: has joined #ruby
[05:41:02] ljc: has joined #ruby
[05:41:31] blackmesa: has joined #ruby
[05:42:05] aryaching: has joined #ruby
[05:42:52] pawnbox: has joined #ruby
[05:43:35] xall: has joined #ruby
[05:43:53] mk92: has joined #ruby
[05:44:04] RequireDragon: has joined #ruby
[05:45:21] RequireDragon: has joined #ruby
[05:48:07] andikr: has joined #ruby
[05:49:29] mk92: has joined #ruby
[05:50:43] moeabdol: has joined #ruby
[05:53:35] mk92: has joined #ruby
[05:56:40] Gooer: has joined #ruby
[05:58:38] Cohedrin: has joined #ruby
[05:58:55] Oclair: has joined #ruby
[06:00:25] yadobujo: has joined #ruby
[06:00:26] xlegoman: has joined #ruby
[06:02:27] yadobujo: has joined #ruby
[06:02:37] zacts: has joined #ruby
[06:03:22] Dimik--: has joined #ruby
[06:04:03] atomx: has joined #ruby
[06:05:25] Macaveli: has joined #ruby
[06:07:37] craigp_: has joined #ruby
[06:08:21] mk92: has joined #ruby
[06:09:00] jakkn: has joined #ruby
[06:09:03] wldcordeiro: has joined #ruby
[06:13:22] Agashard: has joined #ruby
[06:14:50] raeoks: has joined #ruby
[06:15:19] Rodya_: has joined #ruby
[06:18:16] crdpink: has joined #ruby
[06:18:38] solars: has joined #ruby
[06:18:59] dionysus69: has joined #ruby
[06:21:57] rstacruz: has joined #ruby
[06:23:03] hipertracker: has joined #ruby
[06:24:23] harfangk: has joined #ruby
[06:26:45] toretore: has joined #ruby
[06:27:00] roamingdog: has joined #ruby
[06:27:34] aganov: has joined #ruby
[06:27:38] Silthias1: has joined #ruby
[06:28:59] firstdayonthejob: has joined #ruby
[06:34:07] karapetyan: has joined #ruby
[06:34:08] fujinuma: has joined #ruby
[06:35:07] fujinuma: I just completed reading "Practical Object-Oriented in Ruby" book, what is your suggestion for next step?
[06:35:12] fujinuma: design patterns?
[06:37:18] djbkd: has joined #ruby
[06:37:28] conta: has joined #ruby
[06:38:10] hipertracker: has joined #ruby
[06:39:00] finnnnnnnnnnn: has joined #ruby
[06:41:46] jsaak: has joined #ruby
[06:42:18] blackmesa: has joined #ruby
[06:43:58] tristanp: has joined #ruby
[06:44:19] sujith: has joined #ruby
[06:47:03] karapetyan: has joined #ruby
[06:47:14] mark_661: has joined #ruby
[06:47:31] rstacruz: has joined #ruby
[06:54:02] jsaak: has joined #ruby
[06:59:06] jolamb: has joined #ruby
[06:59:24] lkb: has joined #ruby
[07:00:34] eregon: has joined #ruby
[07:01:14] the_drow: has joined #ruby
[07:01:17] hakunin: has joined #ruby
[07:02:12] nankyokusei: has joined #ruby
[07:03:27] yfeldblum: has joined #ruby
[07:04:07] yfeldblum: has joined #ruby
[07:04:27] isberg: has joined #ruby
[07:05:28] dminuoso: has joined #ruby
[07:05:54] rstacruz: has joined #ruby
[07:09:54] zacts: fujinuma: how many apps have you written?
[07:10:06] zacts: along with reading, I would write tons of Ruby apps
[07:10:17] zacts: that's what I've had to do
[07:10:23] zacts: I'm just starting with Ruby
[07:11:15] blaxter: has joined #ruby
[07:11:19] fujinuma: zacts: I can write apps but I don't have idea :?
[07:11:57] biberu: has joined #ruby
[07:12:05] TomyWork: has joined #ruby
[07:12:51] navneet: has joined #ruby
[07:14:12] jsaak: has joined #ruby
[07:15:25] dragon9783: has joined #ruby
[07:17:59] monoprotic: has joined #ruby
[07:19:29] rstacruz: has joined #ruby
[07:20:47] jsaak: has joined #ruby
[07:21:45] dionysus69: has joined #ruby
[07:21:54] hipertracker: has joined #ruby
[07:23:15] karapetyan: has joined #ruby
[07:23:27] lxsameer: has joined #ruby
[07:24:34] antgel: has joined #ruby
[07:25:55] aufi: has joined #ruby
[07:26:57] DoubleMalt: has joined #ruby
[07:27:14] blackmesa: has joined #ruby
[07:27:34] rstacruz: has joined #ruby
[07:28:24] Kedare: has joined #ruby
[07:29:15] harrisi: has joined #ruby
[07:31:38] jsaak: has joined #ruby
[07:33:33] Hounddog: has joined #ruby
[07:34:04] codecop: has joined #ruby
[07:36:09] jud^: has joined #ruby
[07:36:25] rstacruz: has joined #ruby
[07:38:10] Madplatypus: has joined #ruby
[07:38:23] fujinuma: has left #ruby: ("WeeChat 1.5")
[07:39:20] hipertracker: has joined #ruby
[07:41:02] pawnbox: has joined #ruby
[07:43:10] mistermocha: has joined #ruby
[07:43:27] coffeecupp: has joined #ruby
[07:44:01] rstacruz: has joined #ruby
[07:44:14] pawnbox: has joined #ruby
[07:46:25] Silthias: has joined #ruby
[07:47:43] jenrzzz: has joined #ruby
[07:48:15] alem0lars: has joined #ruby
[07:50:24] shevy: write ruby code!!!
[07:50:50] multi_io: has joined #ruby
[07:51:30] anisha: has joined #ruby
[07:52:17] drewo: has joined #ruby
[07:52:43] shevy: why do we not have .sample for hashes?
[07:53:17] edwinvdgraaf: has joined #ruby
[07:53:41] shevy: hash.to_a.sample(1).to_h
[07:53:45] shevy: bit weird but works
[07:54:47] jsaak: has joined #ruby
[07:54:49] LoneHerm_: has joined #ruby
[07:55:02] al2o3-cr: shevy: not for symbols :(
[07:56:01] marr: has joined #ruby
[07:56:12] jaruga___: has joined #ruby
[07:57:02] al2o3-cr: shevy: :) it does
[07:59:22] shevy: I think we did not have .sample on 1.8.x
[07:59:38] shevy: or was it .shuffle... or both... either way I remember to have used workarounds to obtain a random element back then
[08:00:04] mikecmpbll: has joined #ruby
[08:00:25] atomx: has joined #ruby
[08:00:41] haxrbyte: has joined #ruby
[08:00:44] al2o3-cr: 18>> [1,2,3].sample
[08:00:45] ruby[bot]: al2o3-cr: # => undefined method `sample' for [1, 2, 3]:Array (NoMethodError) ...check link for more (https://eval.in/604968)
[08:00:51] al2o3-cr: 18>> [1,2,3].shuffle
[08:00:52] ruby[bot]: al2o3-cr: # => [3, 2, 1] (https://eval.in/604969)
[08:01:01] al2o3-cr: yep, sample
[08:01:28] shevy: useful bot :)
[08:01:40] Couch: has joined #ruby
[08:02:17] Klumben: has joined #ruby
[08:02:50] xall: has joined #ruby
[08:03:25] rstacruz: has joined #ruby
[08:06:29] jsaak: has joined #ruby
[08:11:22] troulouliou_div2: has joined #ruby
[08:11:25] roshanavand: has joined #ruby
[08:15:30] snowy: has joined #ruby
[08:15:35] wazzat: has joined #ruby
[08:15:41] wazzat: has left #ruby: ()
[08:18:17] jud: has joined #ruby
[08:18:28] Silthias1: has joined #ruby
[08:21:14] omphe: has joined #ruby
[08:21:32] hipertracker: has joined #ruby
[08:21:44] mikecmpb_: has joined #ruby
[08:24:05] xue: has joined #ruby
[08:25:12] stephan_: has joined #ruby
[08:25:25] ReK2: has joined #ruby
[08:26:09] stephan_: Hey, i got an really odd error. i always get "undefined method `each' for nil:NilClass" for this snippet of code: http://pastebin.com/cukxkJNF
[08:26:10] ruby[bot]: stephan_: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/79fbb8bc2cac849e324cd29e329134a0
[08:26:10] ruby[bot]: stephan_: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[08:26:39] stephan_: but on line two, puts returns "Array" as the class of event_ligen
[08:26:39] TomyWork: not as terrible as hastebin :)
[08:26:43] LoneHerm_: has joined #ruby
[08:26:44] stephan_: how can this possibly be?
[08:27:48] stephan_: is this a bug in ruby?!
[08:28:51] hemangpatel: has joined #ruby
[08:29:17] TomyWork: stephan_ https://eval.in/604983 works for me
[08:29:29] hemangpatel: When run gem build fro this spec i got error, undefined method `metadata=' for #<Gem::Specification:0x00000001b408b0>
[08:29:42] hemangpatel: this is spec, https://github.com/lukewaite/logstash-input-cloudwatch-logs/blob/master/logstash-input-cloudwatch_logs.gemspec
[08:30:04] hemangpatel: gem version 1.8.23
[08:30:09] stephan_: TomyWork, yeah, thats the strange thing, sometimes it works, sometimes it doesnt... would i get the same error if the array was empty?
[08:30:14] aryaching: has joined #ruby
[08:30:31] stephan_: TomyWork, nah, obviously not, thats what you did
[08:32:00] hemangpatel: I'm php dev so i have no idea. I'm working on logstash plugin
[08:33:00] edwinvdgraaf: has joined #ruby
[08:33:47] hipertracker: has joined #ruby
[08:33:55] stephan_: it also works when i debug it using pry... REALLY strange
[08:34:51] rstacruz: has joined #ruby
[08:35:01] TomyWork: stephan_ what i'm trying to tell you is that we need more of your code to be able to tell you what the problem is
[08:35:07] al2o3-cr: hemangpatel: try updating rubygems with gem update --system (that version is old)
[08:35:15] allstar: has joined #ruby
[08:35:27] stephan_: TomyWork, sure, wait a sec
[08:35:56] TomyWork: stephan_ a number of things can be the cause: broken libraries, broken libraries that monkey-patch in strange ways
[08:36:07] hemangpatel: al2o3-cr, gem update --system is disabled on Debian. I don't want to break my system. Is there any standalone binary available ?
[08:36:18] TomyWork: it is unlikely to be a problem with ruby itself
[08:36:59] stephan_: https://gist.github.com/anonymous/3d6187ea524773c3b1a3663f60f02083
[08:37:05] stephan_: thats the whole method
[08:37:34] stephan_: what is strange, for the statement in line 6 i get two returns
[08:37:48] TomyWork: then your code runs twice
[08:37:49] stephan_: fist "Array", then "NilClass", even though i just use one "puts"
[08:38:00] al2o3-cr: hemangpatel: https://rubygems.org/pages/download/
[08:38:07] govg: has joined #ruby
[08:38:12] TomyWork: stephan_ wild guess, favicon.ico?
[08:38:33] ReK2GnULinuX: has joined #ruby
[08:38:33] ReK2GnULinuX: has joined #ruby
[08:38:38] stephan_: TomyWork, what do you mean?
[08:38:49] TomyWork: it's really just a wild guess, i dont even know which framework you're in
[08:38:57] stephan_: TomyWork, no framework
[08:39:02] TomyWork: i.e. what calls "hole_fixtures"
[08:39:14] stephan_: fixtures = pinnacle.hole_fixtures "https://api.pinnacle.com/v1/fixtures?sportid=29&islive=0", pinnacle.header
[08:39:19] TomyWork: also german names suck :)
[08:39:38] stephan_: thats the line that calls "hole_fixtures"... yeah, sorry for that. the code was just for myself
[08:40:29] ramfjord: has joined #ruby
[08:40:35] jishankai: has joined #ruby
[08:40:41] stephan_: is there some sort of introspection where i can see why it gets called twice?
[08:41:07] TomyWork: you can probably get a stack trace
[08:41:18] hemangpatel: al2o3-cr, inside bin directory i tried ./gem --version but it show me old version
[08:41:20] TomyWork: http://stackoverflow.com/questions/11122233/get-current-stack-trace-in-ruby-without-raising-an-exception
[08:41:33] shevy: stephan_ require 'pp'; pp caller() in the method that you consider strange
[08:41:42] stephan_: thanks, ill try and report back then
[08:41:46] hemangpatel: al2o3-cr, here https://github.com/rubygems/rubygems/tree/master/bin
[08:42:06] TomyWork: shevy why pp and why the ()? :)
[08:42:40] jenrzzz: has joined #ruby
[08:42:50] shevy: pp is awesome, caller() I like for it being explicit
[08:43:11] TomyWork: so who is calling your stuff? :)
[08:43:12] chip_: has joined #ruby
[08:43:36] shevy: http://ruby-doc.org/core-2.3.1/Kernel.html#method-i-caller
[08:43:43] stephan_: it get called twice, it seems like the first call doesnt wait for the hhtp request to end and instead sends the http request and doesnt wait for an answer
[08:43:52] stephan_: is there some way to force this?
[08:43:54] govg: has joined #ruby
[08:44:17] TomyWork: stephan_ what http request?
[08:44:39] karapetyan: has joined #ruby
[08:44:39] stephan_: "hole_fixtures" sends a http get request to an api
[08:45:05] TomyWork: and what does that have to do with how many times your function is being invoked?
[08:45:09] stephan_: but doesnt wait until the request is completet, instead it continus executing my script
[08:45:10] al2o3-cr: hemangpatel: download the zip
[08:45:58] al2o3-cr: What makes you say it's disabled on debian?
[08:46:01] al2o3-cr: ^ hemangpatel
[08:46:26] drewo: has joined #ruby
[08:46:47] stephan_: really strange but it seems to run that way, look thats the code that calls it: https://gist.github.com/anonymous/b3d03e27985562694a1edec967fab164
[08:47:00] stephan_: it gets called in line 1 and 18
[08:47:27] stephan_: but doesnt wait until line 1 is finished
[08:48:42] stephan_: i am on the wrong path
[08:48:54] stephan_: the second call is the problem
[08:49:19] TomyWork: of course it is
[08:49:32] TomyWork: if the first call was the problem, it wouldnt get to the second call
[08:50:19] TomyWork: and i think your assumption is wrong. if line 1 didnt finish, line 1 wouldnt work
[08:50:26] TomyWork: line 1 works, ergo line 1 did finish
[08:52:16] akira616`: has joined #ruby
[08:52:32] stephan_: yeah it does
[08:52:44] stephan_: all this asynchronous programming stuff made me paraoid ;)
[08:53:05] TomyWork: your program doesnt look terribly asynchronous to me, btw
[08:53:25] stephan_: TomyWork, my first project with ruby ;)
[08:53:40] TomyWork: and by "not terribly", i mean "not at all"
[08:53:55] tristanp: has joined #ruby
[08:53:59] stephan_: yeah i know
[08:54:36] stephan_: i got it now, thanks for your input TomyWork, the program crashed if the http response is empty whis is what i will fix now
[08:55:07] nhhc: has joined #ruby
[08:55:33] aryaching: has joined #ruby
[08:55:34] akira616`: has left #ruby: ()
[08:55:45] akira616: has joined #ruby
[08:56:02] TheHodge: has joined #ruby
[08:56:31] aredridel: has joined #ruby
[08:56:38] TomyWork: remember to always check your assumptions :)
[08:56:53] jsaak: has joined #ruby
[09:00:21] der-landgraf: has joined #ruby
[09:00:43] xall: has joined #ruby
[09:01:08] lacce: has joined #ruby
[09:03:01] nankyokusei: has joined #ruby
[09:04:11] akira616`: has joined #ruby
[09:06:02] zacts: shevy: I'm making a few web scrapers and spiders, also a web bookmarks cli app using the gli gem
[09:06:23] al2o3-cr: 19>> Gem::Specification.instance_methods.grep /meta/
[09:06:23] ruby[bot]: al2o3-cr: # => [] (https://eval.in/605011)
[09:07:06] Tele: has joined #ruby
[09:10:22] aryaching: has joined #ruby
[09:10:40] jhass: al2o3-cr: what's the question?
[09:11:36] al2o3-cr: must be using 1.9
[09:14:53] deuterium: has joined #ruby
[09:15:33] Guest683: has joined #ruby
[09:15:40] jhass: al2o3-cr: ?
[09:15:52] al2o3-cr: hey, what question
[09:16:14] rstacruz: has joined #ruby
[09:16:52] jhass: oh, there was so much stuff in between
[09:17:08] jhass: I'd expected you'd highlight the other person it was an answer to something
[09:17:24] jhass: so I took it as a question
[09:17:36] al2o3-cr: i should of done really
[09:18:09] Gooer: has joined #ruby
[09:18:37] burgestrand: has joined #ruby
[09:19:06] tvw: has joined #ruby
[09:21:10] Kuukunen: has joined #ruby
[09:22:07] jsaak: has joined #ruby
[09:22:49] wazzat: has joined #ruby
[09:27:39] dangerousdave: has joined #ruby
[09:27:46] LoneHermit: has joined #ruby
[09:29:40] edwinvdgraaf: has joined #ruby
[09:30:16] rstacruz: has joined #ruby
[09:31:32] aryaching: has joined #ruby
[09:34:27] Oclair: has joined #ruby
[09:35:05] xall: has joined #ruby
[09:36:34] jsaak: has joined #ruby
[09:39:17] macsteps: has joined #ruby
[09:40:35] drewo: has joined #ruby
[09:41:45] andikr: has joined #ruby
[09:42:57] xall_: has joined #ruby
[09:43:27] Devalo: has joined #ruby
[09:44:02] cd-rum: has joined #ruby
[09:47:00] cd-rum_: has joined #ruby
[09:47:35] rstacruz: has joined #ruby
[09:48:54] crdpink: where would I submit stdlib documentation fixes to these days?
[09:49:12] dminuoso: crdpink: bugs.ruby-lang.org
[09:49:27] crdpink: dminuoso: cheers!
[09:49:33] dminuoso: crdpink: Or you can simply try a pull request on github, but generally you should get feedback first.
[09:49:46] dminuoso: Or actually!
[09:49:54] dminuoso: crdpink: Documentation fixes, just make a pull request on github. :)
[09:50:28] crdpink: dminuoso: ok I will do that. Been a while since I did this and couldn't remember which way was preferred then.
[09:51:12] hipertracker: has joined #ruby
[09:51:16] jsaak: has joined #ruby
[09:52:25] dminuoso: crdpink: Well, if it's obvious things that don't require peer review you can always just make a pull request - even for code stuff.
[09:52:58] dminuoso: But the moment when you modify existing behavior or are applying some non-trivial fix, open a ticket first.
[09:53:06] crdpink: it's really simple - just the name of a couple of arguments out of date.
[09:53:12] dminuoso: Yeah that's perfectly fine. :)
[09:54:06] pawnbox: has joined #ruby
[09:54:23] reaVer: has joined #ruby
[09:54:25] bruce_lee: has joined #ruby
[09:55:14] sdothum: has joined #ruby
[09:56:27] pawnbox: has joined #ruby
[09:56:38] blackgoat: has joined #ruby
[09:56:39] Klumben: has joined #ruby
[09:57:02] ramfjord: has joined #ruby
[09:57:14] alem0lars: has joined #ruby
[10:01:59] jsaak: has joined #ruby
[10:03:18] Wildfyr: has joined #ruby
[10:04:28] Mia: has joined #ruby
[10:04:28] Mia: has joined #ruby
[10:05:44] c355E3B: has joined #ruby
[10:05:45] Gooer: has joined #ruby
[10:06:57] jsaak: has joined #ruby
[10:07:11] giz|work: has joined #ruby
[10:15:13] harfangk: has joined #ruby
[10:16:07] Daneel: has joined #ruby
[10:17:00] Daneel: i am not a ruby man nor a windows man but i would like to use ruby on a windows to make a big search on all disks of a file with pattern matching
[10:17:31] Daneel: Dir.glob("*pattern")
[10:17:49] jsaak: has joined #ruby
[10:18:39] Daneel: but does it search on all the disks ?
[10:19:07] Wildfyr: i don't think so
[10:19:13] Mon_Ouie: That searches only in the current directory
[10:19:23] Mon_Ouie: You can do something like '/**/*pattern'
[10:19:45] craigp_: has joined #ruby
[10:20:13] bkxd: has joined #ruby
[10:20:48] Daneel: Mon_Ouie, with ** it will use all drives ?
[10:21:18] Daneel: like '**/*pattern'
[10:21:38] Daneel: without root /
[10:21:51] Daneel: it does not means something with windows
[10:22:02] freerobby: has joined #ruby
[10:22:26] Mon_Ouie: No, that would look for *pattern within the current directory all its subdirectories (recursively)
[10:22:41] Mon_Ouie: Well, what does Dir.entries("/") return?
[10:24:10] coffeecupp: has joined #ruby
[10:25:10] elomatreb: Does not work across drives for me on W10
[10:25:46] Mon_Ouie: okay, then I don't know I'm affraid
[10:26:09] Daneel: i found this http://stackoverflow.com/questions/3258518/ruby-get-available-disk-drives
[10:26:17] Daneel: i hope i will be able to use this
[10:26:26] Daneel: i can not test for the moment
[10:26:36] Daneel: thank you for your help
[10:30:14] hk238: has joined #ruby
[10:34:25] nettoweb: has joined #ruby
[10:37:47] johnmilton: has joined #ruby
[10:38:05] dsuper7: has joined #ruby
[10:41:44] colegatron_origi: has joined #ruby
[10:42:38] hemangpatel: has left #ruby: ("Leaving")
[10:45:00] sullyj3: has joined #ruby
[10:45:44] sullyj3: I notice ruby doesn't have zipwith. Is there a more idiomatic way to do `[3,2,1].zip([2,1,0]).map { |a,b| a-b }` ?
[10:46:08] sullyj3: = [1,1,1]?
[10:46:49] ljarvis_: that looks idiomatic to me
[10:47:39] sullyj3: in that case, is there a nicer way? In haskell, It's `zipWith (-) [3,2,1] [2,1,0]`
[10:48:02] craigp: has joined #ruby
[10:48:29] dminuoso: sullyj3: a.zip(b).map { |a| a - b } # if you remove the literals it becomes quite obvious that it's quite elegant already.
[10:49:11] dminuoso: And of course it should be |(a, b)|
[10:49:18] omphe: has joined #ruby
[10:49:36] manveru: it actually doesn't matter in this case
[10:50:04] dminuoso: Interesting, did not know that.
[10:50:50] manveru: you need it for example for [3,2,1].zip([2,1,0]).each_with_index.map{|(a,b),i| [a,b,i]}
[10:51:04] jhass: dminuoso: semantically Hash#each yields an array ;)
[10:52:41] dminuoso: jhass: Yeah but def f(a, b); end; f([1, 2]); will produce an error, I did not know block args would splat the array if possible
[10:53:14] manveru: aye, block args are fun :)
[10:53:39] Mon_Ouie: It mostly works like an assignment, 'a, b = [1, 2]' also deconstructs the array
[10:54:18] deadnull: has joined #ruby
[10:54:30] manveru: >> [3,2,1].map{|a,b=rand| [a,b]}
[10:54:31] ruby[bot]: manveru: # => [[3, 0.4285513179763143], [2, 0.5087079773158356], [1, 0.6709102363259049]] (https://eval.in/605174)
[10:56:58] giz|work: has joined #ruby
[10:58:22] dionysus69: has joined #ruby
[10:59:27] tristanp: has joined #ruby
[11:03:23] rodfersou: has joined #ruby
[11:03:34] craigp: has joined #ruby
[11:03:57] nankyokusei: has joined #ruby
[11:04:08] dminuoso: Mon_Ouie: It feels a bit clunky. Consider [[1,2]].each { |a, b=0| p b }
[11:06:01] EDT: has joined #ruby
[11:07:49] edwinvdg_: has joined #ruby
[11:08:09] isberg: has joined #ruby
[11:09:39] jsaak: has joined #ruby
[11:10:06] shevy: you guys indeed have fun with block arguments
[11:10:27] moeabdol: has joined #ruby
[11:14:05] omphe: has joined #ruby
[11:14:39] Ropeney: has joined #ruby
[11:14:46] aryaching: has joined #ruby
[11:17:02] hipertracker: has joined #ruby
[11:21:36] jsaak: has joined #ruby
[11:23:18] aryaching: has joined #ruby
[11:24:01] hipertracker: has joined #ruby
[11:24:37] hipertracker: has joined #ruby
[11:28:33] drewo: has joined #ruby
[11:33:37] harfangk: has joined #ruby
[11:36:28] alfiemax: has joined #ruby
[11:37:53] dfinninger: has joined #ruby
[11:39:58] kavanagh: has joined #ruby
[11:42:02] blackmesa: has joined #ruby
[11:42:42] AngryBuzzy: has joined #ruby
[11:42:56] Hanmac: has joined #ruby
[11:45:01] Jet4Fire: has joined #ruby
[11:47:11] JeanCarloMachado: has joined #ruby
[11:47:59] Mimorial: has joined #ruby
[11:49:41] blackgoat: has joined #ruby
[11:51:25] astrobun_: has joined #ruby
[11:53:01] xall_: has joined #ruby
[11:53:23] nocco: has joined #ruby
[11:53:31] mk92: has joined #ruby
[11:54:06] omphe: has joined #ruby
[11:54:42] bkxd: has joined #ruby
[11:55:40] AngryBuzzy: has joined #ruby
[11:58:42] mistermocha: has joined #ruby
[11:58:59] ramfjord: has joined #ruby
[11:59:19] workmad3: has joined #ruby
[12:00:05] ldnunes: has joined #ruby
[12:00:25] hipertracker: has joined #ruby
[12:00:30] yardenbar: has joined #ruby
[12:01:21] dennisvennink: has joined #ruby
[12:02:50] A_Drone: has joined #ruby
[12:03:46] statelesscode_: has joined #ruby
[12:03:53] synthroid: has joined #ruby
[12:04:07] lacce: has joined #ruby
[12:05:58] omphe: has joined #ruby
[12:07:38] giz|work: has joined #ruby
[12:08:37] dminuoso: has joined #ruby
[12:11:18] nocco: has joined #ruby
[12:12:21] GinoManWorks: has joined #ruby
[12:13:13] workmad3: has joined #ruby
[12:13:32] mdw: has joined #ruby
[12:13:39] wazzat: has joined #ruby
[12:14:11] edwinvdgraaf: has joined #ruby
[12:21:30] astrobun_: has joined #ruby
[12:22:49] drewo: has joined #ruby
[12:26:12] chip_: has joined #ruby
[12:26:40] omphe: has joined #ruby
[12:26:41] haxrbyte: has joined #ruby
[12:28:02] johnny56: has joined #ruby
[12:33:58] mikecmpb_: has joined #ruby
[12:34:36] Miesco: has joined #ruby
[12:35:26] Miesco: Hi. I need a language that is readable, that doesn't have characters before variables when you define them ($, @, etc), and is good for one liners. Is this the language?
[12:36:26] blackmesa: has joined #ruby
[12:37:25] giz|work: has joined #ruby
[12:37:45] tristanp: has joined #ruby
[12:38:21] aupadhye: has joined #ruby
[12:38:37] Gooer: has joined #ruby
[12:40:28] ewelina: has joined #ruby
[12:43:02] dminuoso: miesco: If you want a language that is great for one liners than readability is probably not important to you. ;-)
[12:43:07] valkyrka_: has joined #ruby
[12:43:34] Miesco: ruby isn't good for one liners?
[12:43:40] kavanagh: has joined #ruby
[12:44:24] dminuoso: Oh its superb for one liners.
[12:44:32] dminuoso: Even quite readable ones at times
[12:44:53] dminuoso: And for short compact code you probably don't need instance variables (@ivar) anyway.
[12:45:09] dminuoso: But what do I know, Im a Ruby guy - Ill sell Ruby to you even if you want Perl.
[12:45:14] the_drow: has joined #ruby
[12:45:26] gloscombe: has joined #ruby
[12:45:40] ngw: has joined #ruby
[12:46:34] modin: has joined #ruby
[12:46:37] lupine: it's ok, they look quite similar ^^
[12:47:00] xall_: has joined #ruby
[12:48:40] the_drow: has joined #ruby
[12:48:47] Miesco: So what is ruby lacking out of what I mentioned?
[12:51:42] dminuoso: miesco: Well, Ruby comes with global variables ($foo) but you rarely if ever use them, and instance variables (which well ruby code should have) start with @.
[12:52:00] dminuoso: But for short code that does not rely on classes/object oriented design that last one shouldn't matter to you.
[12:52:24] dminuoso: And the way that Ruby uses blocks makes it pretty easy to use for long one liners without getting confused
[12:52:25] mattwashere: has joined #ruby
[12:53:07] craigp: has joined #ruby
[12:54:37] umdstu: has joined #ruby
[12:55:13] deuterium: has joined #ruby
[12:57:13] haxrbyte_: has joined #ruby
[12:58:18] JeanCarloMachado: has joined #ruby
[12:58:56] camilasan: has joined #ruby
[13:02:32] jaiks: has joined #ruby
[13:04:47] nankyokusei: has joined #ruby
[13:05:41] aupadhye: has joined #ruby
[13:05:58] l4v2: has joined #ruby
[13:07:26] ryez: has joined #ruby
[13:10:15] pawnbox: has joined #ruby
[13:11:43] Macaveli: has joined #ruby
[13:12:08] dfinninger: has joined #ruby
[13:12:16] pawnbox: has joined #ruby
[13:13:21] jhass: they left but tbf pseudo globals are not uncommon in one liners
[13:13:26] jhass: $~, $_ etc
[13:14:21] malconis: has joined #ruby
[13:15:16] jrafanie: has joined #ruby
[13:16:06] anisha_: has joined #ruby
[13:16:43] mattwashere: has joined #ruby
[13:16:58] drewo: has joined #ruby
[13:18:05] shevy: miesco have you found such a language yet
[13:19:05] hipertracker: has joined #ruby
[13:19:28] jhass: oh, wait, they didn't leave, ewelina confused me :P
[13:20:20] tAn: has joined #ruby
[13:20:28] Miesco: shevy: I think ruby does all of that. I don't care if you have to use sigals for class variables and such.
[13:20:43] Miesco: ruby = real perl 6
[13:20:49] lupine: don't forget, some globals are actually thread-local-globals
[13:20:51] lupine: and some are not
[13:20:59] mrmargolis: has joined #ruby
[13:21:19] shevy: now I see what you mean
[13:21:32] shevy: like perl 5 my $foo = "black cat";
[13:22:23] GinoManWorks: has joined #ruby
[13:22:38] Miesco: shevy: Yea, and I don't even mind using a '$' as long as its in a quote, but if its outside a quote...
[13:23:33] Miesco: I guess the only problem with ruby is it can only do 40 recursive nests
[13:23:51] edwinvdgraaf: has joined #ruby
[13:23:56] toretore: i did 41 once
[13:25:29] ramortegui: has joined #ruby
[13:26:59] memorasus: has joined #ruby
[13:27:03] spiette: has joined #ruby
[13:27:48] tesuji: has joined #ruby
[13:30:09] sepp2k: has joined #ruby
[13:32:58] peteretep: has joined #ruby
[13:33:31] peteretep: Do all of Ruby's testing tools basically just raise errors on failure?
[13:34:59] fmcgeough: has joined #ruby
[13:35:07] peteretep: It seems that Test::Unit's assertions, and Spec::Expectations, they just `raise` to signal an assertion failure
[13:35:17] dvinciguerra_: has joined #ruby
[13:35:18] peteretep: I'm guessing this is the standard Ruby mechanism?
[13:36:07] toretore: you mean in their implementation?
[13:37:22] zapata: has joined #ruby
[13:37:44] toretore: are you referring to this? https://github.com/seattlerb/minitest/blob/master/lib/minitest/assertions.rb#L139
[13:38:29] peteretep: As one example, yes
[13:39:58] toretore: well, that's implementation specific, is it a problem for your use case?
[13:40:10] roamingdog: has joined #ruby
[13:41:16] xall_: has joined #ruby
[13:41:54] peteretep: It would seem there's no sensible interoperability mechanism between these libraries
[13:42:05] peteretep: They all use their own exception classes
[13:43:46] Tempesta: has joined #ruby
[13:43:50] Silthias1: has left #ruby: ()
[13:44:03] swills: has joined #ruby
[13:44:15] peteretep: If I wanted to use something like hashdiff, I'd have to write library-specific glue for each testing library I wanted to use it with
[13:44:36] rstacruz: has joined #ruby
[13:45:23] toretore: probably, yes
[13:45:25] nersoh: has joined #ruby
[13:45:31] pard: has joined #ruby
[13:45:45] peteretep: And impossible to interoperate between different test libraries
[13:46:10] pard: >> eval(":\\ne")
[13:46:11] ruby[bot]: pard: # => (eval):1: syntax error, unexpected $undefined, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_ ...check link for more (https://eval.in/605369)
[13:46:15] the_drow: has joined #ruby
[13:46:28] pard: >> eval(":#\ne")
[13:46:30] ruby[bot]: pard: # => (eval):1: syntax error, unexpected ':' (SyntaxError) ...check link for more (https://eval.in/605370)
[13:48:04] pard: in irb2, i can have a comment after : and have 'e' come after it, and it would still be a sym
[13:48:15] pard: has it been a bug
[13:48:27] ascarter: has joined #ruby
[13:49:26] pard: >> eval("print :#\ne") // like this
[13:49:27] ruby[bot]: pard: # => /tmp/execpad-788815e522ef/source-788815e522ef:2: unterminated regexp meets end of file ...check link for more (https://eval.in/605372)
[13:49:49] pard: oh sorry
[13:50:03] pard: >> eval("print :#\ne") # like this
[13:50:04] ruby[bot]: pard: # => (eval):1: syntax error, unexpected ':', expecting end-of-input ...check link for more (https://eval.in/605373)
[13:50:10] cdg: has joined #ruby
[13:50:13] pard: thanks a lot
[13:50:22] toretore: you're welcome
[13:50:35] pard: apologies for asking
[13:51:25] toretore: pard: i would be surprised if this were supported by ruby
[13:51:47] toretore: it's likely been something in the way your repl parses the input
[13:51:47] nettoweb: has joined #ruby
[13:51:53] JeanCarloMachado: has joined #ruby
[13:52:04] pard: toretore, i was actually surprise too; but I also testd it with ruby 2.0 and it parsed
[13:52:17] toretore: >> eval(":\\\nfoo")
[13:52:18] ruby[bot]: toretore: # => :foo (https://eval.in/605374)
[13:52:42] toretore: well, in any case, i don't think it's something you should do or rely on
[13:53:09] astrobun_: has joined #ruby
[13:53:17] pard: >> eval(":#this is a comment\\ne") # toretore
[13:53:18] ruby[bot]: pard: # => (eval):1: syntax error, unexpected ':' ...check link for more (https://eval.in/605376)
[13:53:41] pard: looks like it has been resolved actually
[13:53:46] toretore: >> eval(":\\#you can do this\nfoo")
[13:53:47] ruby[bot]: toretore: # => (eval):1: syntax error, unexpected $undefined, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_ ...check link for more (https://eval.in/605377)
[13:53:51] toretore: or maybe not
[13:54:11] sjums: has joined #ruby
[13:54:23] toretore: >> eval(":#comment\\\nfoo")
[13:54:24] ruby[bot]: toretore: # => (eval):1: syntax error, unexpected ':' ...check link for more (https://eval.in/605378)
[13:54:34] toretore: ok, enough bot abuse
[13:54:54] pard: toretore, thanks; is there any way to use a particular version of ruby with >> ?
[13:55:31] toretore: 20>> RUBY_VERSION
[13:55:32] ruby[bot]: toretore: # => "2.0.0" (https://eval.in/605379)
[13:55:51] toretore: but you should use your own, the bot is not for experimenting with
[13:56:02] toretore: eval.in should work
[13:56:36] stephenmac7: has joined #ruby
[13:57:02] stephenmac7: How would I go about zipping two arrays of different length without getting nils at the end?
[13:57:39] roamingdog: has joined #ruby
[13:57:46] al2o3-cr: has joined #ruby
[13:57:47] dminuoso: stephenmac7: What semantic do you want instead?
[13:57:48] pard: toretore, thanks a lot; actually, i wantd to make sure this is a bug in irb, not on my local irb only; looks like it is mine
[13:58:15] stephenmac7: dminuoso: [1,2,3].zip [1,2] -> [[1,1], [2,2]]
[13:58:18] pard: i guess it's a bug in irb, inrepreting comments a line-continuations
[13:58:54] dminuoso: stephenmac7: I don't see a compact way of doing it.
[13:59:47] ramfjord: has joined #ruby
[14:00:28] stephenmac7: dminuoso: [1,2].zip([1,2,3]).map &:reverse seems a little inefficient
[14:01:08] dminuoso: stephenmac7: truncate the longer one first, then zip.
[14:01:37] dminuoso: stephenmac7: In about 548 cases out of 560 when people talk about efficiency it is premature optimization.
[14:01:46] dminuoso: Also 90% of all statistics are made up
[14:02:15] JakFrist: has joined #ruby
[14:02:33] stephenmac7: dminuoso: Yup, and that's probably one of them
[14:02:55] dminuoso: It doesn't invalidate my point though.
[14:03:04] stephenmac7: (a case of premature optimization) Plus, if I was working somewhere that actually cared about speed I wouldn't be using ruby
[14:03:17] depesz: has left #ruby: ("WeeChat 1.5-dev")
[14:03:32] mattwashere: has joined #ruby
[14:03:32] stephenmac7: So something like a.take(a.size - 1).zip(a.drop(1)) is better than the reverse approach
[14:03:42] [74]HELLth: has joined #ruby
[14:03:46] alfiemax: has joined #ruby
[14:05:07] dminuoso: stephenmac7: It at also clearly documents the intent.
[14:05:54] Gooer: has joined #ruby
[14:07:40] mdw: has joined #ruby
[14:07:41] stephenmac7: dminuoso: Yes, thanks for the help!
[14:08:45] AngryBuzzy: has joined #ruby
[14:09:43] Es0teric: has joined #ruby
[14:09:48] roshanavand: has joined #ruby
[14:10:11] tristanp: has joined #ruby
[14:11:03] drewo: has joined #ruby
[14:12:24] eljimmy: has joined #ruby
[14:14:31] The_Phoenix: has joined #ruby
[14:15:37] JeanCarloMachado: has joined #ruby
[14:15:44] flughafen_: has joined #ruby
[14:17:06] The_Phoenix: has joined #ruby
[14:17:15] mistermocha: has joined #ruby
[14:18:11] The_Phoenix: has joined #ruby
[14:19:31] The_Phoenix: has joined #ruby
[14:20:02] Polysics: has joined #ruby
[14:20:08] ItSANgo: has joined #ruby
[14:20:56] The_Phoenix: has joined #ruby
[14:25:23] mdw: has joined #ruby
[14:25:40] aupadhye: has joined #ruby
[14:29:05] yadobujo: has joined #ruby
[14:30:34] hipertracker: has joined #ruby
[14:31:57] giz|work: has joined #ruby
[14:35:31] LBRapid: has joined #ruby
[14:37:19] mrmargolis: has joined #ruby
[14:38:05] chenillen: has joined #ruby
[14:38:24] nettoweb: guys, I installed RVM, but it was all ok, but then I installed fish shell, and now it dont recognize rvm command. I need to change some config so fish can detect previous rvm installed?
[14:40:12] the_drow: has joined #ruby
[14:40:24] adam12: nettoweb: Likely need to download the fish integration. https://rvm.io/integration/fish
[14:41:40] nettoweb: adam12 thanks
[14:43:50] skweek: has joined #ruby
[14:44:24] dminuoso: has joined #ruby
[14:46:14] mattwashere: has joined #ruby
[14:46:23] j0bk: has joined #ruby
[14:46:55] j0bk: has joined #ruby
[14:47:26] nettoweb: adam12 ok, and I had already installed a bunch of gems with bundle install, changing the shell I need to reinstall these gems?
[14:47:35] mattwash_: has joined #ruby
[14:47:45] AngryBuzzy: has joined #ruby
[14:47:48] underplank: has joined #ruby
[14:48:10] gregf: has joined #ruby
[14:48:17] adam12: nettoweb: I'm not familiar with rvm but you shouldn't. I believe it stores them in a shared path, regardless of shell used.
[14:49:06] nettoweb: ok, I'll confirm it
[14:49:44] sullyj3: has joined #ruby
[14:49:58] smathy: has joined #ruby
[14:51:17] M4dH4TT3r: has joined #ruby
[14:51:59] agent_white: has joined #ruby
[14:52:32] LBRapid: has joined #ruby
[14:54:50] Wildfyr: has joined #ruby
[14:55:43] polishdub: has joined #ruby
[14:56:51] rstacruz: has joined #ruby
[14:58:38] SilverKey: has joined #ruby
[15:00:40] bmurt: has joined #ruby
[15:00:49] rippa: has joined #ruby
[15:01:12] joneshf-laptop: has joined #ruby
[15:01:17] yadobujo: has joined #ruby
[15:03:45] dionysus69: has joined #ruby
[15:03:49] yadobujo: has joined #ruby
[15:04:15] dfinninger: has joined #ruby
[15:05:11] drewo: has joined #ruby
[15:05:39] nankyokusei: has joined #ruby
[15:06:10] underplank: has joined #ruby
[15:07:03] LBRapid: has joined #ruby
[15:08:05] mistermocha: has joined #ruby
[15:08:24] JakFrist: has joined #ruby
[15:08:29] cschneid_: has joined #ruby
[15:09:26] blackmesa: has joined #ruby
[15:11:17] SilverKey: has joined #ruby
[15:12:10] dhollinger: has joined #ruby
[15:12:29] jzigmund: has joined #ruby
[15:12:42] Pumukel: has joined #ruby
[15:14:14] mattwashere: has joined #ruby
[15:14:20] mistermocha: has joined #ruby
[15:14:53] dfinninger: has joined #ruby
[15:15:21] xue: has joined #ruby
[15:21:05] ramfjord: has joined #ruby
[15:22:38] tristanp: has joined #ruby
[15:24:18] mistermocha: has joined #ruby
[15:26:28] davedev24: has joined #ruby
[15:26:32] edev: has joined #ruby
[15:27:33] Bish: has joined #ruby
[15:28:08] pontiki: has joined #ruby
[15:28:18] TomyLobo: has joined #ruby
[15:29:41] xall_: has joined #ruby
[15:30:44] djbkd: has joined #ruby
[15:31:05] LBRapid: has joined #ruby
[15:32:48] Guest60828: has joined #ruby
[15:32:55] SilverKey: has joined #ruby
[15:32:58] k13nox: has joined #ruby
[15:34:37] dfinninger: has joined #ruby
[15:35:18] dfinninger: has joined #ruby
[15:37:46] jsaak: has joined #ruby
[15:38:39] rbr: has joined #ruby
[15:40:47] moredhel: has joined #ruby
[15:42:11] Devalo: has joined #ruby
[15:42:50] yadobujo: has joined #ruby
[15:43:38] dionysus69: has joined #ruby
[15:43:38] Miesco: has left #ruby: ()
[15:48:52] troulouliou_divn: has joined #ruby
[15:51:20] symm-: has joined #ruby
[15:53:20] finnnnnnnnnnn: has joined #ruby
[15:53:58] nettoweb: has joined #ruby
[15:54:42] yadobujo_: has joined #ruby
[15:54:48] arooni-mobile: has joined #ruby
[15:54:54] arooni-mobile__: has joined #ruby
[15:55:00] mdw: has joined #ruby
[15:57:01] mattwashere: has joined #ruby
[15:57:26] dminuoso: has joined #ruby
[15:57:31] mattwashere: has joined #ruby
[15:57:34] lacce: has joined #ruby
[15:58:14] mistermocha: has joined #ruby
[15:58:59] zacts: has joined #ruby
[15:59:14] drewo: has joined #ruby
[16:01:05] Miron: has joined #ruby
[16:03:00] amclain: has joined #ruby
[16:03:02] JohnBat26: has joined #ruby
[16:03:21] hipertracker: has joined #ruby
[16:04:12] T2_: has joined #ruby
[16:04:58] finnnnnnnnnnn: has joined #ruby
[16:06:39] LBRapid: has joined #ruby
[16:06:57] Bish: has joined #ruby
[16:07:26] JakFrist: has joined #ruby
[16:08:04] omphe: has joined #ruby
[16:09:02] govg: has joined #ruby
[16:09:29] centrx: has joined #ruby
[16:11:48] yeticry: has joined #ruby
[16:12:19] blackmesa: has joined #ruby
[16:12:23] Daneel: how to do in ruby the same as in bash : cat file | wc -l
[16:12:26] T2_: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[16:12:41] chris2: File.read("file").count("\n")
[16:12:53] Guest60828: has joined #ruby
[16:13:08] shinnya: has joined #ruby
[16:13:10] Miron: has joined #ruby
[16:13:12] Daneel: chris2, even if the file is with microsoft end of file ?
[16:13:33] chris2: if it consistently uses \r\n...
[16:13:44] chris2: probably File.read transcodes on windows
[16:13:48] xue: has joined #ruby
[16:14:07] Daneel: chris2, thank you
[16:14:53] gizmore: has joined #ruby
[16:15:15] Mirubiri: has joined #ruby
[16:16:09] tristanp: has joined #ruby
[16:17:08] Mirubiri: has joined #ruby
[16:17:10] diegoviola: has joined #ruby
[16:17:48] [Butch]: has joined #ruby
[16:18:02] Mirubiri: has joined #ruby
[16:18:19] nersoh: has joined #ruby
[16:18:35] Es0teric: has joined #ruby
[16:19:12] loveablelobster: has joined #ruby
[16:22:14] d5sx43: has joined #ruby
[16:22:19] lupine: note that that won't do too well with ginormous files
[16:22:32] jsaak: has joined #ruby
[16:22:53] swills: has joined #ruby
[16:22:59] jhass: File.foreach("file").count should however
[16:23:04] troulouliou_div2: has joined #ruby
[16:23:30] Mirubiri: has joined #ruby
[16:23:45] lupine: I'd gotten as far as `File.open("/vmlinuz", "r").each_line.inject(0) {|acc,_| acc + 1 }` :D
[16:24:01] Azure|dc: has joined #ruby
[16:24:14] xall_: has joined #ruby
[16:24:28] Mirubiri: has left #ruby: ()
[16:24:36] Daneel: in a string like /my/path/for/a/file, i would like have 'file' in a variable. How to call the variable in the string ? like /my/path/for/a/$myvariable ?
[16:25:24] lupine: yeah, foreach is better
[16:25:26] Daneel: ah perhaps #{myvariable} ?
[16:25:29] Cohedrin: has joined #ruby
[16:26:01] jhass: Daneel: generically yes, in this case however just File.join("/my/path/for/a", myvariable)
[16:26:02] lupine: Daneel: yep, although you might one to use File.join to avoid a platform dependency
[16:26:20] chris2: so it runs on vms? :P
[16:26:35] jhass: all ruby code must!
[16:26:45] AndyBotwin: has joined #ruby
[16:27:02] jhass: but no, so you don't have to deal with trailing/leading / in the variable yourself
[16:27:41] swills: has joined #ruby
[16:27:43] whathappens: has joined #ruby
[16:28:03] flashpoint9: has joined #ruby
[16:28:23] burgestrand: has joined #ruby
[16:29:13] swills: has joined #ruby
[16:29:31] d5sx43: has joined #ruby
[16:29:35] isjaylee: has joined #ruby
[16:30:16] Daneel: my best ruby code i ever produced : https://gist.github.com/Dan33l/87cff30e215a4a43667cccd451c1bbbf
[16:30:20] Daneel: thank you all :D
[16:31:13] Daneel: does this code will run on windows ?
[16:31:18] Daneel: i am testing on a linux
[16:31:34] Daneel: but i would like to run it under windows
[16:32:43] mistermocha: has joined #ruby
[16:32:49] Guest60828: has joined #ruby
[16:34:33] gizmore: Daneel: find . -iname "*passwd*" | wc -l
[16:35:08] Daneel: gizmore, my question is not to do in in bash underlinux but with ruby under windows
[16:37:12] gizmore: i made a package in ruby that would work like this: Filewalker.traverse_files("which_dir", "passwd") do |file|; count += 1; end;
[16:39:00] lupine: last I checked, windows *would* take /
[16:42:05] nb_bez___: has joined #ruby
[16:42:33] SCHAAP137: has joined #ruby
[16:42:40] Miron: has joined #ruby
[16:43:48] aazsdk: has joined #ruby
[16:45:48] Ishido: has joined #ruby
[16:45:59] _djbkd: has joined #ruby
[16:46:14] Coldblackice: has joined #ruby
[16:47:47] LuckyABA: has joined #ruby
[16:47:58] drale2k: has joined #ruby
[16:51:24] blackmesa: has joined #ruby
[16:51:54] jakkn: has joined #ruby
[16:52:39] d5sx43: has joined #ruby
[16:53:20] drewo: has joined #ruby
[16:54:30] ramfjord: has joined #ruby
[16:57:10] JimK_: has joined #ruby
[16:57:31] Elvin: has joined #ruby
[16:59:42] smathy: has joined #ruby
[17:00:06] sumobob: has joined #ruby
[17:00:10] nettoweb: has joined #ruby
[17:00:14] freerobby: has joined #ruby
[17:00:23] d5sx43_: has joined #ruby
[17:00:39] LoneHermit: has joined #ruby
[17:02:34] whathappens: has joined #ruby
[17:03:02] tristanp: has joined #ruby
[17:04:46] burgestrand: has joined #ruby
[17:06:29] nankyokusei: has joined #ruby
[17:09:49] gregf: has joined #ruby
[17:11:39] queequeg1: has joined #ruby
[17:13:08] c0mrad3: has joined #ruby
[17:13:17] drbrain: Daneel: it should work on Windows
[17:13:30] firstdayonthejob: has joined #ruby
[17:13:37] drbrain: so long as you have a /tmp on the current drive
[17:13:47] CybrGhost: has joined #ruby
[17:15:29] SilverKey: has joined #ruby
[17:15:53] JimK: has joined #ruby
[17:16:35] dionysus69: has joined #ruby
[17:17:04] xaxisx: has joined #ruby
[17:17:13] lupine: Might want Dir::tmpdir as well
[17:17:19] yardenbar: has joined #ruby
[17:18:53] codecop: has joined #ruby
[17:19:17] JimK12: has left #ruby: ()
[17:22:14] Miron: has joined #ruby
[17:23:55] Silthias: has joined #ruby
[17:24:14] zenlot: has joined #ruby
[17:25:26] Dimik: has joined #ruby
[17:25:27] JakFrist: has joined #ruby
[17:25:33] arooni-mobile__: has joined #ruby
[17:25:55] queequeg1: has joined #ruby
[17:26:09] arooni-mobile__: has left #ruby: ()
[17:27:35] drewo: has joined #ruby
[17:28:18] burgestrand: has joined #ruby
[17:28:30] drewo: has joined #ruby
[17:29:52] CybrGhost: has joined #ruby
[17:30:02] astrobun_: has joined #ruby
[17:31:52] finnnnnnnnnnn: has joined #ruby
[17:32:35] arooni-mobile: has joined #ruby
[17:33:07] isjaylee: has left #ruby: ()
[17:33:20] xaxisx_: has joined #ruby
[17:33:32] d5sx43: has joined #ruby
[17:34:05] queequeg1: has joined #ruby
[17:34:15] SilverKey: has joined #ruby
[17:35:01] mikecmpbll: has joined #ruby
[17:40:44] finnnnnnnnnnn: has joined #ruby
[17:43:07] Stan: has joined #ruby
[17:43:51] Rodya_: has joined #ruby
[17:45:15] smathy: has joined #ruby
[17:47:21] Es0teric: has joined #ruby
[17:47:25] elifoster: has joined #ruby
[17:47:42] Silthias: has joined #ruby
[17:48:04] pard: has joined #ruby
[17:49:36] omphe: has joined #ruby
[17:49:43] pard: is there any reason 'print (def l() 12 end)' is a valid construct, while 'def l() 12 end; print (undef l)' is not actually?
[17:50:15] ascarter: has joined #ruby
[17:50:19] jhass: so you can private def foo
[17:50:26] pard: i'm asking it because 'l = (undef l)' looks to be valid
[17:50:41] jhass: probably just a edgecase in the grammar
[17:50:47] pard: jhass, thanks :)
[17:51:05] dopamean_: has joined #ruby
[17:51:18] pard: jhass, as for the answer i received, could i ask you elaborate?
[17:51:51] anisha_: has joined #ruby
[17:52:15] jhass: the value of a method definition expression is the name of the method as symbol
[17:52:34] jhass: private is a method that takes a method name as symbol and marks the corresponding method as private
[17:53:20] pard: thanks a lot :) so undef is not an expression?
[17:53:31] Oclair_: has joined #ruby
[17:53:35] jhass: everything is
[17:53:44] jhass: I think __END__ was the only one without value
[17:53:46] pard: even aliat?
[17:54:24] pard: >> l = def e() 12 end; print l
[17:54:25] ruby[bot]: pard: # => enil (https://eval.in/605470)
[17:54:55] jhass: btw use p, not print or puts for debug printing
[17:55:05] pard: i though the 'def' thing returns 'nil'
[17:55:14] pard: jhass, apologies
[17:55:15] jhass: it did until ruby 2.0
[17:55:38] pard: i'm way behind others then
[17:55:58] tristanp: has joined #ruby
[17:57:16] pard: jhass, could we say that 'print (undef l)' not parsing is an inconsistency? specially because the '(undef l)' thing looks to be correct?
[17:57:41] jhass: I'd argue so
[17:57:45] jhass: hence I called it edgecase
[17:57:47] pard: thanks :)
[17:57:59] jhass: thing is I can't imagine any real world usecase ;)
[17:58:11] pard: there :)
[17:58:21] pard: i'm writing a parser
[17:58:28] jhass: for ruby?
[17:58:36] AngryBuzzy: has joined #ruby
[17:58:36] jhass: for fun or...?
[17:59:05] pard: jhass, that is what i actually asked on this channel last week :\
[17:59:19] umdstu: i recently updated to rest-client 2.0 and response.cookies isn’t being populated by the cookie field in the response headers for some reason. anyone run across this?
[18:00:20] pard: jhass, i'm really eager to find a real-world usage for it though; it is a recursive descent parser, and i could say it is arguably simpler
[18:01:31] blackmesa: has joined #ruby
[18:03:15] hutch34: has joined #ruby
[18:03:31] bb010g: has joined #ruby
[18:04:31] zekriad: has joined #ruby
[18:05:33] replay: has joined #ruby
[18:05:44] zacts: has joined #ruby
[18:05:51] hipertracker: has joined #ruby
[18:05:58] wixad_: has joined #ruby
[18:06:15] replay: has joined #ruby
[18:06:59] replay: has joined #ruby
[18:08:45] Klumben: has joined #ruby
[18:09:19] naftilos76: has joined #ruby
[18:09:54] LBRapid: has joined #ruby
[18:10:09] JeanCarloMachado: has joined #ruby
[18:10:24] last_staff: has joined #ruby
[18:11:27] skweek: has joined #ruby
[18:12:42] xall_: has joined #ruby
[18:15:17] jmarinelli: has joined #ruby
[18:16:05] alem0lars: has joined #ruby
[18:19:39] maloik: has joined #ruby
[18:23:38] smathy: has joined #ruby
[18:24:01] sneakers: has joined #ruby
[18:24:47] whathappens: has joined #ruby
[18:27:44] banisterfiend: has joined #ruby
[18:30:41] astrobun_: has joined #ruby
[18:31:34] k13nox: has joined #ruby
[18:31:41] conta: has joined #ruby
[18:34:42] lkba: has joined #ruby
[18:35:53] bmurt: has joined #ruby
[18:36:21] blackmesa: has joined #ruby
[18:36:22] spider-mario: has joined #ruby
[18:38:55] ramfjord: has joined #ruby
[18:44:26] dionysus69: has joined #ruby
[18:45:09] augcesar: has joined #ruby
[18:46:21] SilverKey: has joined #ruby
[18:46:34] nankyokusei: has joined #ruby
[18:48:01] rcvalle: has joined #ruby
[18:48:07] marxarelli: has joined #ruby
[18:54:29] omphe: has joined #ruby
[18:55:20] jakkn: has joined #ruby
[18:55:28] jackjackdripper: has joined #ruby
[18:55:31] jackjackdripper1: has joined #ruby
[18:55:47] mistergibson: has joined #ruby
[18:55:50] wixad_: how can i write a DiceSet class that an instance of is not nil and can call a method roll(n) on it
[18:56:19] jhass: what did you try so far?
[18:56:26] aryaching: has joined #ruby
[18:57:02] wixad_: create the class then a method roll with an array
[18:57:10] ruby[bot]: We can't help you without your code, please post it to https://gist.github.com
[18:59:07] wixad_: class DiceSet def roll(n) res = [] co=rand(1..6) n.times do res << co end; end;
[18:59:59] nemish: has joined #ruby
[19:00:38] swills: has joined #ruby
[19:00:49] aep-shoutlet: has joined #ruby
[19:01:14] nemish: I have probably a simple question... I have a server that I did a "gem install FOO" on and it went and installed the gem and it's dependencies... now few months later when i do a "gem install FOO" it downloads newer versions of the dependencies even though it's same version of the FOO gem but some of those children require ruby 2.2 :(
[19:01:44] wixad_: my problem is that i cant access the array from outside
[19:01:46] nemish: is there a way I can use a Gemfile or something to install system gems instead of bundled gems
[19:02:21] whathappens: has joined #ruby
[19:02:35] jhass: wixad_: you need to return it from the method
[19:02:35] Gooer: has joined #ruby
[19:03:03] wixad_: and the array is being filled with the same number
[19:03:03] gizmore: has joined #ruby
[19:03:06] jhass: or store it in an instance variable and provide further methods to operate on it
[19:03:24] jhass: well yes, you only generate one random number and add it n times
[19:03:31] catphish: has joined #ruby
[19:03:54] aibot: has joined #ruby
[19:04:40] catphish: is "#read_nonblock(9999999)" a reasonable way to throw away all data in an IO buffer?
[19:05:31] jhass: I'd question the need to do any such thing in the first place
[19:05:31] wixad_: n is suposed to be the number of rolls and the array should store the number
[19:05:57] smathy_: has joined #ruby
[19:06:59] flashpoint9: has joined #ruby
[19:08:30] catphish: jhass: how so?
[19:09:06] finisherr: has joined #ruby
[19:09:50] Mirubiri: has joined #ruby
[19:09:57] jakkn: I'm working on a Rakefile where I would like to transform files from .yml to whatever the old extension was. I don't care what the old extension was, could be foo.bar.yml or foo.baz.yml, I just want to apply the tranformation to the files and create foo.bar and foo.baz. I've been wringing my brain but can't come up with a clever way to do this..
[19:10:07] tristanp: has joined #ruby
[19:10:17] aakira616: has joined #ruby
[19:10:47] JeanCarloMachado: has joined #ruby
[19:11:07] jhass: catphish: not knowing how much data you need to discard is kinda weird
[19:11:26] aakira616: has left #ruby: ()
[19:12:42] yfeldblum: has joined #ruby
[19:13:33] akira616: has joined #ruby
[19:14:21] catphish: jhass: well sometimes things send data during their boot which you arent interested in, but don't know its quantity, so you just want to empty the rx buffer before sending your first command
[19:14:30] freerobby: has joined #ruby
[19:14:52] catphish: it's not an ideal situation certainly, but with serial connections, sometimes junk just ends up in the buffer before you get started
[19:14:59] jhass: never seen any where you wouldn't be able to properly figure out how much that was
[19:15:43] jakkn: does anyone have any clues on how to accomplish what I described above? I thought about having a rule where the name came from a lambda function, but that failed and I guess reasonably so.
[19:16:40] djbkd_: has joined #ruby
[19:16:58] catphish: anyway, that aside, any idea what the best way might be to discard the entire rx buffer?
[19:17:53] huyderman: has joined #ruby
[19:18:46] chip_: has joined #ruby
[19:19:07] Tachikomas: has joined #ruby
[19:20:23] bmurt: has joined #ruby
[19:21:44] Mirubiri: has joined #ruby
[19:21:44] bmurt: has joined #ruby
[19:21:52] yadobujo_: has joined #ruby
[19:22:05] xall_: has joined #ruby
[19:22:09] Mirubiri: has left #ruby: ()
[19:23:02] kirun: has joined #ruby
[19:23:57] u235psycho: has joined #ruby
[19:24:15] vuoto: has joined #ruby
[19:24:53] jackjackdripper: has joined #ruby
[19:25:10] al2o3-cr: catphish: #nread will tell you how many bytes can be read
[19:28:47] k13nox: has joined #ruby
[19:28:47] vuoto: has joined #ruby
[19:30:22] JakFrist: has joined #ruby
[19:31:11] nofxx: has joined #ruby
[19:31:28] astrobun_: has joined #ruby
[19:32:00] nofxx: [:foo, :bar].is_there_something_for_this(1, 2) => { foo: 1, bar: 2 } ?
[19:32:45] nofxx: hsh_maker heh
[19:32:59] Madplatypus: has joined #ruby
[19:33:01] spudowiar: has joined #ruby
[19:33:13] havenwood: >> [:foo, :bar].zip([1, 2]).to_h
[19:33:14] ruby[bot]: havenwood: # => {:foo=>1, :bar=>2} (https://eval.in/605476)
[19:33:35] nofxx: havenwood, my crazy oneliner is saved! ty
[19:33:36] havenwood: >> [:foo, :bar].map.with_index(1).to_h
[19:33:37] ruby[bot]: havenwood: # => {:foo=>1, :bar=>2} (https://eval.in/605477)
[19:34:01] havenwood: nofxx: de nada
[19:34:17] Mirubiri: has joined #ruby
[19:36:50] helpa: has joined #ruby
[19:36:51] nofxx: or de nada too, spanish?
[19:37:05] mikecmpbll: has joined #ruby
[19:37:36] Mirubiri: has joined #ruby
[19:38:48] nofxx: al2o3-cr, thanks again...how dumb,I was trying transpose, totally forgot [:a, 1].to_h
[19:38:54] cdg: has joined #ruby
[19:39:28] Nawn: has joined #ruby
[19:39:40] Nawn: has left #ruby: ()
[19:40:31] cdg: has joined #ruby
[19:43:31] dionysus69: has joined #ruby
[19:44:28] k13nox: has joined #ruby
[19:45:12] AndrewIsHere: has joined #ruby
[19:45:42] troulouliou_div2: has joined #ruby
[19:45:43] flughafen_: has joined #ruby
[19:49:00] singalaut: has joined #ruby
[19:52:51] yqt: has joined #ruby
[19:53:35] pawnbox_: has joined #ruby
[19:54:21] Synthead: has joined #ruby
[19:55:31] VerrNum: has joined #ruby
[19:55:47] mistermocha: has joined #ruby
[19:57:00] whathappens: has joined #ruby
[19:59:29] isberg: has joined #ruby
[20:02:20] tristanp: has joined #ruby
[20:04:33] nekomune: has joined #ruby
[20:04:41] burgestrand: has joined #ruby
[20:04:51] Nawn: has joined #ruby
[20:05:51] Es0teric: has joined #ruby
[20:06:00] SilverKey: has joined #ruby
[20:10:47] Ishido: has joined #ruby
[20:13:46] l4v2: What does the * and & mean in the docs that say this for create create(*args, &block)
[20:13:51] l4v2: is that the splat?
[20:14:07] l4v2: and block address>
[20:15:00] kavanagh: has joined #ruby
[20:15:02] diegoviola: has joined #ruby
[20:15:31] havenwood: l4v2: that signifies that the parameter is being passed as a block
[20:15:43] weaksauce: has joined #ruby
[20:16:20] Nawn: has joined #ruby
[20:16:22] mistermocha: has joined #ruby
[20:16:22] firstdayonthejob: has joined #ruby
[20:17:21] l4v2: havenwood thank you. Hey do you get paid to do this lol
[20:17:33] postmodern: has joined #ruby
[20:18:21] jhass: yes, I handle the transactions, that'll be $30
[20:19:29] dminuoso: So I was actually going to say "One dereferneces, one takes the address - duh". Good thing I wasn't so quick.
[20:20:00] al2o3-cr: has joined #ruby
[20:20:01] havenwood: l4v2: We unfortunately don't get paid for answering questions on irc. :-)
[20:20:07] mistermocha: has joined #ruby
[20:20:28] tristanp: has joined #ruby
[20:20:36] _djbkd: has joined #ruby
[20:20:56] l4v2: Trying to learn how to read the docs
[20:21:13] DoubleMalt: has joined #ruby
[20:21:26] blackgoat: has joined #ruby
[20:22:12] diegoviola: has joined #ruby
[20:22:54] burgestrand: has joined #ruby
[20:23:24] jenrzzz: has joined #ruby
[20:23:25] jenrzzz: has joined #ruby
[20:24:07] shevy: l4v2 many similar questions are asked, the more common ones are simpler to answer. I guess * is within the top 20, aka people don't know that it is called "splat" and if they don't know that, they can not too easily google/search for it (it's mostly advanced users who can search for * as the token)
[20:24:52] l4v2: So when I see that in a doc it jsut means any number of args right?
[20:25:31] havenwood: l4v2: the parameter with the * is a catch-all argument and the parameter with the & is a block
[20:26:34] l4v2: how would those be used in ActiveRecords Create class?
[20:27:35] havenwood: l4v2: Link to the docs for the method you're talking about?
[20:27:35] l4v2: create method ^
[20:28:01] havenwood: l4v2: Like?: http://api.rubyonrails.org/classes/ActiveRecord/Persistence/ClassMethods.html#method-i-create
[20:28:17] l4v2: http://api.rubyonrails.org/classes/ActiveRecord/AssociationRelation.html#method-i-create
[20:28:42] xall_: has joined #ruby
[20:29:17] spudowiar: has joined #ruby
[20:29:29] catphish: al2o3-cr: cool! i'll try that, thanks
[20:30:16] zeroDi: has joined #ruby
[20:31:12] shevy: l4v2 this page may have a nice example, look at the second one with & http://mudge.name/2011/01/26/passing-blocks-in-ruby-without-block.html
[20:32:16] astrobun_: has joined #ruby
[20:32:46] yuung: has joined #ruby
[20:36:57] pocketprotector: has joined #ruby
[20:40:19] Mirubiri: has joined #ruby
[20:40:30] _djbkd: has joined #ruby
[20:42:19] shum: has joined #ruby
[20:43:18] tvw: has joined #ruby
[20:43:34] pawnbox: has joined #ruby
[20:45:03] ramfjord: has joined #ruby
[20:47:24] nankyokusei: has joined #ruby
[20:49:45] cschneid_: has joined #ruby
[20:53:35] JeanCarloMachado: has joined #ruby
[20:54:31] replay: has joined #ruby
[20:57:21] akira616`: has joined #ruby
[20:57:34] eljimmy: has joined #ruby
[20:57:35] whathappens: has joined #ruby
[20:57:40] jetpackjoe: has joined #ruby
[20:59:05] hahuang61: has joined #ruby
[21:00:10] tristanp: has joined #ruby
[21:01:35] akira616: has joined #ruby
[21:01:50] aupadhye: has joined #ruby
[21:03:30] yuung: has joined #ruby
[21:06:27] flashpoint9: has joined #ruby
[21:07:09] Mirubiri: has joined #ruby
[21:12:05] Parko: has joined #ruby
[21:12:32] finnnnnnnnnnn: has joined #ruby
[21:12:38] hipertracker: has joined #ruby
[21:18:52] AlexRussia: has joined #ruby
[21:19:53] aupadhye: has joined #ruby
[21:21:54] akira616: has joined #ruby
[21:23:16] symm-: has joined #ruby
[21:24:38] Rodya_: has joined #ruby
[21:26:59] LoneHerm_: has joined #ruby
[21:27:15] tAn: has joined #ruby
[21:27:40] flashpoint9: Hey, are symbols used as hash keys because they dont change? Why do I see symbols used as hash keys so often?
[21:28:18] minimalism: has joined #ruby
[21:29:29] jhass: Symbol#== is a simple identity check, Symbol#hash is simply based on their object id, Symbol's are globally (per process) unique
[21:29:34] jhass: :foo and :foo is always the same object
[21:29:51] jhass: so it's faster and requires less storage
[21:29:59] drbrain: there have been improvements to ruby to make String keys behave like symbols when frozen
[21:29:59] jhass: and less to type
[21:30:05] eam: jhass: is that true given symbol gc?
[21:31:00] drbrain: if your input data is strings (like HTTP uploads) use strings
[21:31:15] jhass: yes, I should mention in doubt use strings
[21:31:20] jhass: eam: what do you mean?
[21:31:22] drbrain: if your input data is static (built into the program) use symbols
[21:31:54] eam: jhass: I mean post 2.2 a symbol can be gc'd, so :foo might not be :foo at a later point in time
[21:31:54] catphish: has left #ruby: ("Leaving")
[21:31:56] drbrain: converting one key type to the other will always be slower
[21:32:00] lupine: I model symbols as erlang atoms, myself. anywhere I'd use an atom, I use a symbol
[21:32:05] drbrain: eam: if there's a :foo it can't be GC'd
[21:32:27] lupine: I guess that's not much help if you've never erlanged
[21:32:36] drbrain: so a = :foo; a = nil; [GC runs]; b = :foo may have different IDs
[21:32:52] eam: drbrain: yeah
[21:32:54] drbrain: lupine: yes, a symbol is like an atom (in many languages)
[21:32:58] astrobun_: has joined #ruby
[21:33:31] jhass: pretty sure [gets.to_sym, gets.to_sym] for the same input will return the same objects too
[21:33:44] eam: jhass: yeah but not if you GC.start in between
[21:33:59] eam: (on ruby 2.2 or newer)
[21:34:01] jhass: eh I guess
[21:34:07] mdw: has joined #ruby
[21:34:28] jhass: but then if you store the .object_id only or so, any problem is just your stupidity IMO
[21:34:36] eam: hey no argument there
[21:34:47] jhass: so conceptually the statement holds
[21:35:43] jhass: as long as you have a symbol compare to and another, if they're equal they're the same object
[21:36:05] eam: remember that bug where comparing symbols was slower than comparing strings?
[21:36:34] shevy: a feature!
[21:36:47] jhass: uh, no :P
[21:37:54] flashpoint9: Awesome listening to you guys discuss this, learning a ton thanks
[21:39:22] drbrain: flashpoint9: also, frozen strings have most of the properties of symbols
[21:39:37] drbrain: and using a string as a hash key means the string gets frozen automatically
[21:40:15] eam: jhass: https://www.omniref.com/blog/2014/11/12/making-ruby-faster/
[21:40:24] yfeldblum: has joined #ruby
[21:40:30] drbrain: >> a = 'a'; pre_frozen = a.frozen?; h = {a => true}; [pre_frozen, h.keys.first.frozen?]
[21:40:31] ruby[bot]: drbrain: # => [false, true] (https://eval.in/605508)
[21:40:44] flashpoint9: drbrain: So are frozen strings meant to replace symbols in a hash or is it just a boost for cases where you have/want to use a string as a key in a hash
[21:40:51] tristanp: has joined #ruby
[21:41:06] drbrain: flashpoint9: frozen strings are not meant to replace symbols
[21:41:23] eam: due to optomization for certain key class types
[21:41:30] drbrain: they may be a boost for use as hash keys, and may improve memory efficiency if you have lots of tiny strings
[21:41:38] eam: optimization, even
[21:42:10] flashpoint9: so in general stick with symbols for hash keys
[21:42:31] drbrain: flashpoint9: use what's "natural"
[21:42:53] drbrain: if you're using hashes in your program and don't accept user input to reference the hash keys, symbols are great
[21:43:04] drbrain: if you use user input to pick values out of a hash, use strings
[21:43:07] flashpoint9: ok, and sorry if this is a nub question, what makes a symbol "natural" in a case vs a string for hash keys?
[21:43:24] flashpoint9: sorry hadnt scrolled down
[21:43:33] akira616: has joined #ruby
[21:44:22] drbrain: maybe you have a drawing API with a constant COLORS = { red: '#ff0000;', … }
[21:44:32] drbrain: then you could have pen.color :red
[21:44:56] drbrain: so symbols would be natural because it's all code
[21:45:20] drbrain: but if it was: puts "what color do you want to draw with?"; color = gets.strip
[21:45:24] drbrain: then you would want to use strings
[21:46:14] eam: you can conceptually replace the gets() with "data from json" for example
[21:46:19] eam: json doesn't have a Symbol type
[21:46:28] drbrain: or data from an HTTP form field
[21:46:41] nankyokusei: has joined #ruby
[21:50:18] blackmesa: has joined #ruby
[21:51:25] LoneHerm_: has joined #ruby
[21:55:40] SilverKey: has joined #ruby
[21:57:47] _djbkd: has joined #ruby
[21:59:38] xall_: has joined #ruby
[22:02:01] babblebre: has joined #ruby
[22:03:41] _djbkd: has joined #ruby
[22:03:45] solars: has joined #ruby
[22:04:33] _djbkd: has joined #ruby
[22:07:22] mattwashere: has joined #ruby
[22:09:03] _djbkd: has joined #ruby
[22:09:18] [Muslim]: has joined #ruby
[22:12:45] SCHAAP137: has joined #ruby
[22:13:44] drew: has joined #ruby
[22:15:57] tristanp: has joined #ruby
[22:17:34] SilverKey: has joined #ruby
[22:24:50] whathappens: has joined #ruby
[22:25:05] gizless: has joined #ruby
[22:27:10] k13nox: has joined #ruby
[22:28:15] pontiki: has joined #ruby
[22:29:10] shortdudey123: anyone have a suggestions for a gem that will be faster than Zlib::GzipReader?
[22:30:32] [Muslim]: has left #ruby: ()
[22:31:16] neohunter: has joined #ruby
[22:31:35] LoneHerm_: has joined #ruby
[22:32:45] jhass: your bottleneck probably is Ruby there tbh
[22:32:56] jhass: it just binds libz already
[22:32:58] zenlot6: has joined #ruby
[22:33:20] moeabdol: has joined #ruby
[22:33:34] flashpoint9: jhass: should he use a different language?
[22:33:43] astrobun_: has joined #ruby
[22:33:51] jhass: perhaps, it depends on what's actually done
[22:33:52] hipertracker: has joined #ruby
[22:34:01] jhass: there might be a faster implementation thereof in Ruby too
[22:34:22] jhass: so that was actually going to be my next question, what are you doing and how?
[22:35:07] flashpoint9: has joined #ruby
[22:36:43] aredridel: has joined #ruby
[22:38:22] JeanCarloMachado: has joined #ruby
[22:40:12] mistermocha: has joined #ruby
[22:40:45] gizmore: has joined #ruby
[22:43:57] flashpoint9: has joined #ruby
[22:45:21] tristanp: has joined #ruby
[22:45:22] sung: has joined #ruby
[22:50:16] LoneHerm_: has joined #ruby
[22:54:38] postmodern: has joined #ruby
[22:54:52] djbkd_: has joined #ruby
[22:55:44] dvinciguerra_: has joined #ruby
[23:02:36] SilverKey: has joined #ruby
[23:02:48] mistermocha: has joined #ruby
[23:03:18] Guest60828: has joined #ruby
[23:04:04] CloCkWeRX: has joined #ruby
[23:05:15] finnnnnnnnnnn: has joined #ruby
[23:05:21] memorasus1: has joined #ruby
[23:09:08] cd-rum: has joined #ruby
[23:11:14] edwardly: has joined #ruby
[23:11:14] edwardly: has joined #ruby
[23:11:51] hipertracker: has joined #ruby
[23:12:41] pwnd_nsfw`: has joined #ruby
[23:13:08] cd-rum_: has joined #ruby
[23:14:23] Mirubiri: has joined #ruby
[23:16:35] tristanp: has joined #ruby
[23:17:44] shortdudey123: jhass: taking a gz file, reading a line at a time, and doing something with the line
[23:19:53] shortdudey123: Zlib::GzipReader.new(open(filename)).each_line do |line|
[23:20:35] wrkrcoop: has joined #ruby
[23:20:54] wrkrcoop: anyone know how to stub a class method?
[23:20:58] wrkrcoop: not an instance of a class
[23:21:00] flashpoint9: has joined #ruby
[23:23:07] singalaut: has joined #ruby
[23:24:59] hipertracker: has joined #ruby
[23:25:23] RushPL: has joined #ruby
[23:30:14] Nawn: has joined #ruby
[23:32:14] Nawn: has joined #ruby
[23:33:01] mattwashere: has joined #ruby
[23:34:29] astrobun_: has joined #ruby
[23:36:14] leea: has joined #ruby
[23:38:02] _djbkd: has joined #ruby
[23:39:02] _djbkd: has joined #ruby
[23:42:16] mattwashere: has joined #ruby
[23:44:32] dminuoso: has joined #ruby
[23:44:33] Guest60828: has joined #ruby
[23:45:11] xall_: has joined #ruby
[23:45:29] unreal_: has joined #ruby
[23:47:28] nankyokusei: has joined #ruby
[23:48:00] dopamean_: has joined #ruby
[23:48:30] tristanp: has joined #ruby
[23:53:34] gregf: has joined #ruby
[23:54:48] Oclair: has joined #ruby
[23:54:56] mattwashere: has joined #ruby
[23:55:19] dopamean_: has joined #ruby
[23:55:50] SilverKey: has joined #ruby
[23:56:31] yfeldblum: has joined #ruby
[23:56:32] yeticry: has joined #ruby
[23:56:49] cdg: has joined #ruby