« Back to channel list

#ruby - 20 July 2016

« Back 1 day Forward 1 day »
[00:00:16] davedev24: has joined #ruby
[00:00:26] leea: how would I get better at testing?
[00:01:27] Nawn: has joined #ruby
[00:01:32] shevy: not sure, you have to ask those who are good at tests. I found it very boring to write tests
[00:01:45] shevy: I guess it may be easier to integrate them from the get go
[00:02:01] Nawn: talking about TDD?
[00:02:03] Mirubiri: testing is fun
[00:02:16] banisterfiend: has joined #ruby
[00:02:39] elomatreb: I was sold on writing solid tests for my applications after a "bundle update" broke one and I had to debug for hours
[00:02:40] shevy: one obvious benefit, aside from the disadvantage that it may be boring, is that you can ensure a certain sense of realiability of your code, that, at the least during the conditions that you tested for and evaluate, it would work in a reproducible manner
[00:03:32] Nawn: I liked that I could change any code, and with one line in the command line, I can make sure that Everything I have already checked for still is
[00:03:44] Nawn: still works*
[00:04:09] shevy: also have a look at the graphics at https://wiki.debian.org/ReproducibleBuilds - while this has not much to do with testing in ruby, it has a little bit to do with managing packages in general in a reproducible manner; it's also why I think the NixOS philosophy is cool and how fpm vaguely taps into it; nixos should promise that you can re-build any target-set of packages that go along together and work
[00:05:28] Mirubiri: BDD is the way to go in enterprise ruby development
[00:06:15] SuperLag: has joined #ruby
[00:10:36] blackmesa: has joined #ruby
[00:10:48] cyphase: has joined #ruby
[00:12:29] leea: is it possible to stub ARGV?
[00:13:05] Guest60828: has joined #ruby
[00:16:17] shevy: not sure, you can handle it as regular input to methods
[00:16:34] shevy: either like in a class: def initialize(commandline = ARGV); Foobar.new(ARGV)
[00:16:44] shevy: it is tainted input by default though
[00:20:31] ledestin: has joined #ruby
[00:20:38] l4v2: has joined #ruby
[00:20:39] mjuszczak: has joined #ruby
[00:21:18] Mirubiri: has joined #ruby
[00:22:01] drbrain: leea: yes, it's just a constant: $ ruby -e 'p ARGV; ARGV.replace ["bye"]; p ARGV' -- hello
[00:29:55] mattwashere: has joined #ruby
[00:36:05] karapetyan: has joined #ruby
[00:38:31] flashpoint9: has joined #ruby
[00:38:50] Dimik: has joined #ruby
[00:40:11] freeman1337: has joined #ruby
[00:40:41] macsteps: has joined #ruby
[00:41:15] minimalism: has joined #ruby
[00:43:24] dunpeal: I have an array of Hahses. In an RSpec test, how do I make sure they are all (recursively) equal?
[00:44:39] dunpeal: (They only contain simple core Ruby objects: either Strings, or Arrays/Hashes of Arrays, Hashes, or Strings.
[00:45:03] mattwashere: has joined #ruby
[00:47:32] flashpoint9: has joined #ruby
[00:49:49] drewo: has joined #ruby
[00:52:28] jackjackdripper: has joined #ruby
[00:52:34] SilverKey: has joined #ruby
[00:52:38] xall: has joined #ruby
[00:52:41] freeman1337: Hey dunpeal, I'm curious about this as well. Does the array structure change atall?
[00:52:41] dminuoso: has joined #ruby
[00:53:18] drbrain: array.reduce(:==).reduce(:&) ?
[00:53:36] drbrain: as in [{a: 1}, {a: 1}, {b: 1}] ?
[00:53:59] dunpeal: freeman1337: what do you mean?
[00:54:01] dunpeal: drbrain: yes
[00:54:17] dunpeal: what does .reduce(:&) do?
[00:54:24] dunpeal: oh, logical end.
[00:54:34] drbrain: yes, since && is syntax
[00:57:03] drbrain: if you want to see which one is non-equal use: array.each_cons(2).with_index { |(a, b), i| puts "pair #{i} is not equal" unless a == b }
[00:57:20] drbrain: ↑ more user-friendly
[00:57:22] dvinciguerra_: has joined #ruby
[00:58:29] Mirubiri: expect([{a:1},{a:1}, {a:1}}).to all include({a:1}) something like that dunpeal ?
[00:58:45] araujo_: has joined #ruby
[00:59:57] isberg: has joined #ruby
[01:00:49] araujo_: has joined #ruby
[01:02:49] drbrain: this is why I'm not a big fan of rspec, instead of just writing some ruby and being done I have to wrap my problem in an API that is less expressive than ruby
[01:03:51] flashpoint9: has joined #ruby
[01:04:03] Mirubiri: drbrain: why less expressive?
[01:04:56] lunaelli: has joined #ruby
[01:12:43] blackmesa: has joined #ruby
[01:13:45] roamingdog: has joined #ruby
[01:18:49] RegulationD: has joined #ruby
[01:21:15] hutch34_: has joined #ruby
[01:21:19] Ropeney: has joined #ruby
[01:27:34] jaguarmagenta: has joined #ruby
[01:28:42] speakingcode: has joined #ruby
[01:28:54] ur5us: has joined #ruby
[01:31:13] CloCkWeRX: has joined #ruby
[01:31:50] cdg: has joined #ruby
[01:34:20] sucks: has joined #ruby
[01:37:58] Hobogrammer: has joined #ruby
[01:38:22] nando293921: has joined #ruby
[01:44:44] cd-rum_: has joined #ruby
[01:47:54] DoubleMalt: has joined #ruby
[01:48:37] leea: has joined #ruby
[01:48:41] cd-rum: has joined #ruby
[01:48:58] giz|work: has joined #ruby
[01:49:00] ng-repeat: has joined #ruby
[01:49:16] ng-repeat: im trying to run a cucumber step from within the at_exit function
[01:49:29] ng-repeat: its working from the Before block
[01:49:48] ng-repeat: steps %Q{Given this is my step}
[01:50:17] ng-repeat: but i get undefined method 'steps' when i include that same line inside at_exit
[01:51:09] ng-repeat: any ideas how i can call a cucumber step definition at the end of a test run?
[01:51:16] mitt3ns: has joined #ruby
[01:51:34] Kus: has joined #ruby
[01:52:06] mitt3ns: Evenin' folks.
[01:53:56] flashpoint9: has joined #ruby
[01:56:21] DeltaHeavy: has joined #ruby
[01:58:13] skweek: has joined #ruby
[01:59:30] flashpoint9: has joined #ruby
[01:59:58] moeabdol: has joined #ruby
[02:03:01] A_Drone: has joined #ruby
[02:05:13] LvcasX1: has joined #ruby
[02:06:31] nadir: has joined #ruby
[02:06:52] dminuoso: has joined #ruby
[02:08:14] sent-hil: has joined #ruby
[02:08:16] leea: has joined #ruby
[02:12:29] devbug: has joined #ruby
[02:14:01] blackmesa: has joined #ruby
[02:14:58] macsteps: has joined #ruby
[02:18:36] speakingcode: has joined #ruby
[02:19:17] enterprisey: has joined #ruby
[02:21:00] A_Drone: has joined #ruby
[02:21:01] griffindy: has joined #ruby
[02:23:24] LoneHerm_: has joined #ruby
[02:26:22] mattwashere: has joined #ruby
[02:26:51] dunpeal: drbrain: thanks, nice code.
[02:28:16] DanKnox: has joined #ruby
[02:35:08] shevy: has joined #ruby
[02:40:53] DeltaHeavy: has joined #ruby
[02:43:26] JesseH: has joined #ruby
[02:44:53] bmn: has joined #ruby
[02:45:40] rpad: has joined #ruby
[02:46:30] A_Drone: has joined #ruby
[02:46:45] A_Drone: has joined #ruby
[02:52:07] Bish: has joined #ruby
[02:53:17] matp: has joined #ruby
[03:03:19] Cohedrin_: has joined #ruby
[03:03:39] araujo__: has joined #ruby
[03:06:00] mattwashere: has joined #ruby
[03:06:09] ekem: has joined #ruby
[03:07:33] smathy: has joined #ruby
[03:07:39] dminuoso: has joined #ruby
[03:09:12] unforgiven512: has joined #ruby
[03:09:46] justinmcp: has joined #ruby
[03:11:00] Nilium: has joined #ruby
[03:11:14] pipework: has joined #ruby
[03:11:14] crystal77: has joined #ruby
[03:11:45] cdg: has joined #ruby
[03:12:00] Thai_: has joined #ruby
[03:12:25] Dimik--: has joined #ruby
[03:12:42] perry: has joined #ruby
[03:12:42] perry: has joined #ruby
[03:12:56] Lightsword: has joined #ruby
[03:13:10] fullstack: has joined #ruby
[03:15:24] blackmesa: has joined #ruby
[03:15:28] guacamole: has joined #ruby
[03:18:14] fullstack: has joined #ruby
[03:19:24] RegulationD: has joined #ruby
[03:20:37] ericlee: has joined #ruby
[03:20:58] k3rn31: has joined #ruby
[03:22:15] Voxxit: has joined #ruby
[03:22:19] braincras: has joined #ruby
[03:26:07] gbailey: has joined #ruby
[03:32:11] A_Drone: has joined #ruby
[03:33:53] Bish: has joined #ruby
[03:37:23] mclee: has joined #ruby
[03:39:12] ericlee: has joined #ruby
[03:39:35] lxsameer: has joined #ruby
[03:44:23] Guest60828: has joined #ruby
[03:46:47] Bish: has joined #ruby
[03:48:15] LoneHerm_: has joined #ruby
[03:50:19] hk238: has joined #ruby
[03:53:06] theery: has joined #ruby
[03:54:14] jishankai: has joined #ruby
[03:54:32] Guest60828: has joined #ruby
[03:55:13] Bish: has joined #ruby
[03:57:02] steve: has joined #ruby
[03:58:49] gix: has joined #ruby
[03:59:31] jenrzzz: has joined #ruby
[03:59:32] SilverKey: has joined #ruby
[03:59:36] mattwashere: has joined #ruby
[04:01:00] flashpoint9: has joined #ruby
[04:01:57] leea: has joined #ruby
[04:04:18] whathappens: has joined #ruby
[04:04:51] craigp: has joined #ruby
[04:08:23] dminuoso: has joined #ruby
[04:09:48] tapa: has joined #ruby
[04:11:21] smathy: has joined #ruby
[04:11:41] rodorgas: has joined #ruby
[04:12:00] tapa: has joined #ruby
[04:12:42] karapetyan: has joined #ruby
[04:13:30] pawnbox: has joined #ruby
[04:13:31] zacts: has joined #ruby
[04:13:52] isberg: has joined #ruby
[04:16:47] blackmesa: has joined #ruby
[04:17:10] pawnbox: has joined #ruby
[04:17:51] eljimbo: has joined #ruby
[04:19:27] yfeldblum: has joined #ruby
[04:19:46] tapa_: has joined #ruby
[04:19:59] RegulationD: has joined #ruby
[04:29:07] p0p0pr37_: has joined #ruby
[04:31:37] aibot: has joined #ruby
[04:32:14] dunpeal: has joined #ruby
[04:32:28] k3rn31: has joined #ruby
[04:35:21] enterprisey: has joined #ruby
[04:36:35] theery: has joined #ruby
[04:36:37] GnuYawk: has joined #ruby
[04:37:51] roamingdog: has joined #ruby
[04:41:02] Mirubiri: has joined #ruby
[04:48:13] ur5us: has joined #ruby
[04:49:36] LoneHermit: has joined #ruby
[04:51:10] Bish: has joined #ruby
[04:52:33] jenrzzz: has joined #ruby
[04:52:33] jenrzzz: has joined #ruby
[04:54:15] rikai: has joined #ruby
[04:55:42] astrobun_: has joined #ruby
[04:57:19] djbkd: has joined #ruby
[04:58:52] alfiemax: has joined #ruby
[05:03:32] underplank: has joined #ruby
[05:03:33] pawnbox: has joined #ruby
[05:09:10] dminuoso: has joined #ruby
[05:10:39] BTRE: has joined #ruby
[05:12:17] tmtwd: has joined #ruby
[05:16:00] ponga: has joined #ruby
[05:16:37] speakingcode: has joined #ruby
[05:18:11] blackmesa: has joined #ruby
[05:22:34] skade: has joined #ruby
[05:25:28] kentnl: has joined #ruby
[05:27:12] djbkd: has joined #ruby
[05:27:36] douglascorrea: has joined #ruby
[05:28:44] chipotle: has joined #ruby
[05:32:11] moeabdol: has joined #ruby
[05:33:13] rann: has joined #ruby
[05:41:04] aupadhye: has joined #ruby
[05:41:06] lightheaded: has joined #ruby
[05:43:13] sucks: has joined #ruby
[05:44:32] tvw: has joined #ruby
[05:50:16] giz|work: has joined #ruby
[05:51:22] LoneHermit: has joined #ruby
[05:52:26] Bish: has joined #ruby
[05:53:24] yfeldblum: has joined #ruby
[05:53:58] Guest60828: has joined #ruby
[05:54:01] yfeldblum: has joined #ruby
[05:56:23] pawnbox_: has joined #ruby
[05:56:34] tapa: has joined #ruby
[05:57:19] zotherstupidguy: has joined #ruby
[05:58:57] tapa: has joined #ruby
[05:59:06] aufi: has joined #ruby
[05:59:08] Dimik--: has joined #ruby
[06:00:31] KnownSyntax: has joined #ruby
[06:00:31] KnownSyntax: has joined #ruby
[06:00:39] solars: has joined #ruby
[06:04:03] flashpoint9: has joined #ruby
[06:04:11] eljimmy: has joined #ruby
[06:05:33] Macaveli: has joined #ruby
[06:10:13] pawnbox: has joined #ruby
[06:17:39] nmollerup: has joined #ruby
[06:19:32] blackmesa: has joined #ruby
[06:21:45] A_Drone: has joined #ruby
[06:23:38] cyphase: has joined #ruby
[06:25:27] dminuoso: has joined #ruby
[06:25:50] firstdayonthejob: has joined #ruby
[06:29:09] A_Drone: has joined #ruby
[06:29:59] conta: has joined #ruby
[06:36:10] finnnnnnnnnnn: has joined #ruby
[06:36:19] Silthias: has joined #ruby
[06:37:23] moeabdol: has joined #ruby
[06:39:36] Silthias1: has joined #ruby
[06:42:14] isberg: has joined #ruby
[06:43:51] mark_661: has joined #ruby
[06:45:19] andikr: has joined #ruby
[06:45:31] Cohedrin: has joined #ruby
[06:46:51] Bish: has joined #ruby
[06:51:18] dionysus69: has joined #ruby
[06:53:07] T2: has joined #ruby
[06:53:25] Nahra: has joined #ruby
[06:54:13] shevy: has joined #ruby
[06:55:05] dminuoso: has joined #ruby
[06:58:45] solars: has joined #ruby
[06:59:08] lizard2010: has joined #ruby
[06:59:20] Bish: has joined #ruby
[07:01:00] anisha: has joined #ruby
[07:01:43] Dimik: has joined #ruby
[07:04:03] finnnnnnnnnnn: has joined #ruby
[07:04:19] AlexJakeGreen: has joined #ruby
[07:05:21] raeoks: has joined #ruby
[07:05:23] flashpoint9: has joined #ruby
[07:05:59] hakunin: has left #ruby: ()
[07:06:27] rann: has joined #ruby
[07:07:49] rbr: has joined #ruby
[07:10:09] alfiemax: has joined #ruby
[07:10:14] edwinvdgraaf: has joined #ruby
[07:10:21] Hounddog: has joined #ruby
[07:11:51] TomyWork: has joined #ruby
[07:13:10] jegarcia: has joined #ruby
[07:15:17] Couch: has joined #ruby
[07:15:47] the_drow: has joined #ruby
[07:16:59] A_Drone_: has joined #ruby
[07:20:15] aganov: has joined #ruby
[07:20:52] moeabdol: has joined #ruby
[07:20:55] blackmesa: has joined #ruby
[07:24:19] antgel: has joined #ruby
[07:25:57] howdoi: has joined #ruby
[07:26:35] iMadper: has joined #ruby
[07:28:31] giz|work: has joined #ruby
[07:29:00] jaguarmagenta: has joined #ruby
[07:31:55] LoneHerm_: has joined #ruby
[07:34:21] AlexJakeGreen: has joined #ruby
[07:35:08] shevy: has joined #ruby
[07:39:11] blaxter: has joined #ruby
[07:41:18] alfiemax: has joined #ruby
[07:42:06] craigp: has joined #ruby
[07:45:56] kab: has joined #ruby
[07:46:19] kab: has joined #ruby
[07:47:29] armyriad: has joined #ruby
[07:47:44] kab: has joined #ruby
[07:51:33] multi_io: has joined #ruby
[07:55:21] harrisi: I know there's no good reason to do this, but I'm having trouble doing something like this: https://gist.github.com/harrisi/a7a8ec19b24ee6187f6f55a24c4151d2
[07:55:59] harrisi: is it possible to do that? As silly of an example as that is, it seems like it's possible, I just don't know what is wrong with that format.
[07:57:46] blackmesa: has joined #ruby
[07:59:16] Zarthus: that code highlighting is really offputting
[08:00:08] harrisi: https://gist.githubusercontent.com/harrisi/a7a8ec19b24ee6187f6f55a24c4151d2/raw/77fc76ca8657f68f6fdba241f0173f3e5f889bf4/foo.rb
[08:00:33] harrisi: I did also try it with different indentation, but that seemed to not do anything.
[08:00:40] Zarthus: I cna't say I precisely know what you're going for
[08:01:08] aswen: has joined #ruby
[08:01:42] mikecmpbll: has joined #ruby
[08:04:17] harrisi: there are better ways to do it, I just got into this weird situation and I was wondering if there was a way to have a case statement inside of a string interpolated heredoc.
[08:04:56] harrisi: I suppose specifically, is it possible to have a multiline expression be the expression used in the interpolated piece of a heredoc
[08:05:31] harrisi: not that I think that's a good idea, I just didn't know what exactly was stopping me from doing what that code is doing
[08:06:13] atomx: has joined #ruby
[08:06:24] ljarvis_: harrisi: yes it's possible
[08:06:30] Cohedrin: has joined #ruby
[08:06:56] harrisi: ljarvis_: could you tell me what's wrong with the code I linked to?
[08:07:08] ljarvis_: nothing, what's your error(s)?
[08:08:52] lizard2010: harrisi, why not prepare variable outside heredoc and insert it as usual?
[08:10:03] harrisi: lizard2010: that's what I will do, this is just a random curiosity
[08:10:20] marr: has joined #ruby
[08:10:27] codecop: has joined #ruby
[08:11:22] ljarvis_: https://eval.in/608439
[08:11:47] madgen: has joined #ruby
[08:12:24] Jet4Fire: has joined #ruby
[08:13:08] Es0teric: has joined #ruby
[08:13:34] harrisi: https://gist.github.com/harrisi/600f792d4dde3dffb4129b5cefca0656
[08:13:37] harrisi: ^ that fails for me
[08:14:15] ljarvis_: yes that's not valid
[08:16:21] ljarvis_: because of the indentation, try moving the block back (de-indent) 1
[08:16:51] ljarvis_: you probably want <<-ENDDOC
[08:17:29] ljarvis_: the << style heredoc requires the delimiter is on the first column iirc
[08:17:42] harrisi: ah! okay. that makes sense.
[08:17:50] devbug: has joined #ruby
[08:17:57] ljarvis_: so you could just de-indent ENDOC (the last one)
[08:17:59] harrisi: I thought it was expecting it to be indented at the same level as it began
[08:18:02] ljarvis_: but <<- is better anyway
[08:18:06] harrisi: yeah, I get it now.
[08:18:30] ljarvis_: also ruby 2.3 has <<~ I think
[08:19:37] harrisi: what is that
[08:19:42] giz|work: has joined #ruby
[08:20:07] harrisi: I can't seem to find <<~
[08:20:08] ljarvis_: i guess it removes the indentation, obviously not helpful for your example since you're using a tab prefix anyway
[08:20:33] roshanavand: has joined #ruby
[08:23:02] RegulationD: has joined #ruby
[08:25:23] govg: has joined #ruby
[08:27:19] cyphase: has joined #ruby
[08:30:17] douglasc_: has joined #ruby
[08:30:38] raeoks: has joined #ruby
[08:32:34] snory: has joined #ruby
[08:36:08] Pupp3tm4st3r: has joined #ruby
[08:37:49] giz|work: has joined #ruby
[08:39:58] A_Drone: has joined #ruby
[08:40:04] M-shine: has joined #ruby
[08:41:27] raeoks: has joined #ruby
[08:41:37] jaruga___: has joined #ruby
[08:42:11] dumdedum: has joined #ruby
[08:42:52] dumdedum: has joined #ruby
[08:43:40] toretore: has joined #ruby
[08:45:52] TheHodge: has joined #ruby
[08:47:33] eizua: has joined #ruby
[08:47:37] A_Drone: has joined #ruby
[08:48:52] workmad3: has joined #ruby
[08:52:27] madgen: has joined #ruby
[08:53:59] troulouliou_div2: has joined #ruby
[08:55:32] Devalo: has joined #ruby
[08:57:01] tmtwd: has joined #ruby
[08:57:17] McSoFake: has joined #ruby
[08:57:55] douglascorrea: has joined #ruby
[08:59:27] flashpoint9: has joined #ruby
[09:01:59] gregf_: has joined #ruby
[09:02:37] Silthias: has joined #ruby
[09:04:16] Volis: has joined #ruby
[09:04:58] Kedare: has joined #ruby
[09:05:26] tvw: has joined #ruby
[09:05:48] Moneristo: has joined #ruby
[09:06:16] biberu: has joined #ruby
[09:06:49] A_Drone: has joined #ruby
[09:08:27] haxrbyte_: has joined #ruby
[09:08:31] c355E3B: has joined #ruby
[09:09:19] Technodrome: has joined #ruby
[09:09:36] pawnbox: has joined #ruby
[09:11:23] ryez: has joined #ruby
[09:14:05] senayar: has joined #ruby
[09:17:59] douglascorrea: has joined #ruby
[09:18:06] conta1: has joined #ruby
[09:20:19] DaniG2k: has joined #ruby
[09:22:05] ruby-lang786: has joined #ruby
[09:24:39] aries_liuxueyang: has joined #ruby
[09:27:01] Macaveli_: has joined #ruby
[09:27:10] trif: has joined #ruby
[09:27:52] douglascorrea: has joined #ruby
[09:30:06] Mia: has joined #ruby
[09:30:06] Mia: has joined #ruby
[09:31:14] LoneHerm_: has joined #ruby
[09:31:37] jaguarmagenta: has joined #ruby
[09:35:14] pandaant: has joined #ruby
[09:35:33] inukshuk: has joined #ruby
[09:36:21] kavanagh: has joined #ruby
[09:37:07] karapetyan: has joined #ruby
[09:39:27] astrobun_: has joined #ruby
[09:39:38] Silthias1: has joined #ruby
[09:40:45] Silthias2: has joined #ruby
[09:40:55] yfeldblum: has joined #ruby
[09:42:56] ur5us: has joined #ruby
[09:43:24] Volis: Hello, I'm setting my website using jekyll and there seems to be a little problem here.
[09:43:42] Silox|: has joined #ruby
[09:44:01] Volis: The base_path resolves to "http://website.domain//"
[09:44:18] Volis: that makes the URLs "http://website.domain//css/stylesheet.css"
[09:44:48] Volis: I looked up the file that's responsible for setting this, it has one line `{% capture base_path %}{{ site.url }}{{ site.baseurl }}{% endcapture %}`
[09:45:11] Volis: I changed the baseurl value to "" but the problem persists
[09:45:51] Volis: What should I set the baseurl to avoid this problem?
[09:47:30] flashpoint9: has joined #ruby
[09:48:17] conta1: has joined #ruby
[09:50:59] andikr: has joined #ruby
[09:56:01] skweek: has joined #ruby
[09:56:48] anisha_: has joined #ruby
[09:57:39] alfiemax: has joined #ruby
[09:59:49] madgen: has joined #ruby
[09:59:55] lightheaded: has joined #ruby
[10:01:25] douglascorrea: has joined #ruby
[10:04:10] hipertracker: has joined #ruby
[10:05:59] tmtwd: has joined #ruby
[10:07:10] lacce: has joined #ruby
[10:08:35] giz|work: has joined #ruby
[10:08:45] rodfersou: has joined #ruby
[10:12:48] Nahra: has joined #ruby
[10:17:45] ledestin: has joined #ruby
[10:17:48] karapetyan: has joined #ruby
[10:18:21] M-mistake: has joined #ruby
[10:18:41] lightheaded: has joined #ruby
[10:21:06] ryez: has left #ruby: ()
[10:22:16] Macaveli: has joined #ruby
[10:23:14] Wildfyr: has joined #ruby
[10:23:51] RegulationD: has joined #ruby
[10:29:38] mdw: has joined #ruby
[10:30:42] mdw: has joined #ruby
[10:30:48] douglascorrea: has joined #ruby
[10:33:47] LoneHerm_: has joined #ruby
[10:33:57] conta: has joined #ruby
[10:35:05] blackmesa: has joined #ruby
[10:39:26] douglascorrea: has joined #ruby
[10:40:10] seth: has joined #ruby
[10:42:14] w0lf: has joined #ruby
[10:42:17] w0lf: hi there
[10:42:32] w0lf: when i try to run bundle install it says no such command
[10:43:27] roamingdog: has joined #ruby
[10:44:35] Wildfyr: try `which bundle`
[10:45:36] roamingdog: has joined #ruby
[10:46:28] haxrbyte: has joined #ruby
[10:47:35] Mon_Ouie: Did you install the bundler gem?
[10:47:52] skade: has joined #ruby
[10:48:20] harfangk: has joined #ruby
[10:49:58] conta1: has joined #ruby
[10:50:34] sdothum: has joined #ruby
[10:50:41] eprasad: has joined #ruby
[10:52:15] hipertracker: has joined #ruby
[10:53:08] chipotle: has joined #ruby
[10:54:03] Guest60828: has joined #ruby
[10:54:43] moeabdol: has joined #ruby
[10:56:24] bhaak: has joined #ruby
[10:59:13] GodFather: has joined #ruby
[10:59:20] pawnbox: has joined #ruby
[10:59:41] w0lf: Mon_Ouie, yes i did
[10:59:49] w0lf: gem install bundler
[11:00:41] Pupp3tm4st3r: has joined #ruby
[11:00:55] Mon_Ouie: Then your PATH environment variable is probably not set up correctly. `gem' warns you when you about this when you install a gem that has executables.
[11:00:58] jhass: w0lf: how did you install Ruby?
[11:01:07] w0lf: Successfully installed bundler-1.12.5
[11:01:08] w0lf: Parsing documentation for bundler-1.12.5
[11:01:08] w0lf: Done installing documentation for bundler after 7 seconds
[11:01:17] w0lf: jhass, using rvm
[11:01:24] douglasc_: has joined #ruby
[11:01:42] jhass: make a gist with your rvm info and gem env output please
[11:01:44] ruby[bot]: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[11:02:41] dumdedum: has joined #ruby
[11:02:59] nadir: has joined #ruby
[11:03:13] Guest60828: has joined #ruby
[11:04:04] DeltaHeavy: has joined #ruby
[11:05:20] alfiemax: has joined #ruby
[11:06:05] Diabolik: has joined #ruby
[11:07:07] Diabolik: has joined #ruby
[11:07:26] LoneHerm_: has joined #ruby
[11:07:38] Diabolik: has joined #ruby
[11:09:01] yoongkang: has joined #ruby
[11:09:21] astrobun_: has joined #ruby
[11:09:27] JeanCarloMachado: has joined #ruby
[11:10:07] astrobun_: has joined #ruby
[11:13:42] platzhirsch: has joined #ruby
[11:13:43] johnmilton: has joined #ruby
[11:14:41] w0lf: no its not rvm i installed it using yum
[11:14:51] matp: has joined #ruby
[11:16:41] chipotle: has joined #ruby
[11:16:41] blackmesa: has joined #ruby
[11:17:49] blackgoat: has joined #ruby
[11:18:06] jhass: w0lf: still show gem env then please
[11:18:08] zotherstupidguy: has joined #ruby
[11:18:08] zotherstupidguy: has joined #ruby
[11:18:20] w0lf: jhass, ok
[11:20:11] w0lf: jhass, http://pastebin.com/mpXkKCCL
[11:20:12] ruby[bot]: w0lf: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/651951bd85fc71d9ea34825d6592aae2
[11:20:12] ruby[bot]: w0lf: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[11:20:55] w0lf: jhass, https://gist.github.com/anonymous/651951bd85fc71d9ea34825d6592aae2
[11:21:36] JeanCarloMachado: has joined #ruby
[11:22:21] jhass: w0lf: ok I guess that ancient rubygems version doesn't print the warning Mon_Ouie was talking about yet, ensure /home/w0lf/bin is in your path
[11:22:36] jhass: also note that Ruby 2.0 is officially end of life
[11:22:46] karapetyan: has joined #ruby
[11:22:54] w0lf: jhass, so if i see yum i dont find any updated version of ruby
[11:23:06] harfangk: has joined #ruby
[11:23:12] jhass: that's something to complain to your OS about
[11:23:29] w0lf: jhass, lols
[11:23:36] w0lf: jhass, ok if i use rvm
[11:23:43] w0lf: i guess i will be bale ot upgrade it
[11:23:50] jhass: yes, sure
[11:23:59] w0lf: jhass, but upgradation through rvm will not do anything bad to my running application yeah ?
[11:24:05] w0lf: which are using jruby
[11:24:16] jhass: just make sure to install RVM as a user, not as root
[11:24:27] jhass: and everything will be fine
[11:24:51] moeabdol1: has joined #ruby
[11:24:52] w0lf: and those application i am running are as user too
[11:25:09] LoneHermit: has joined #ruby
[11:32:00] eatsfoobars: has joined #ruby
[11:32:20] jaguarmagenta: has joined #ruby
[11:32:51] cyphase: has joined #ruby
[11:34:29] zotherstupidguy: has joined #ruby
[11:34:40] Pupp3tm4st3r: has joined #ruby
[11:35:28] conta1: has joined #ruby
[11:36:07] chipotle: has joined #ruby
[11:40:00] conta1: has joined #ruby
[11:40:12] eatsfoobars: has joined #ruby
[11:41:47] Hanmac: has joined #ruby
[11:42:52] eatsfoobars: has joined #ruby
[11:43:53] chipotle: has joined #ruby
[11:46:30] LoneHerm_: has joined #ruby
[11:47:55] snowy: has joined #ruby
[11:54:31] conta1: has joined #ruby
[11:55:52] abhinavmehta: has joined #ruby
[11:56:16] abhinavmehta: where should I ask rails questions? Is this is the right channel?
[11:56:24] yoongkang: has joined #ruby
[11:56:32] ruby[bot]: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[11:57:12] speaking1ode: has joined #ruby
[11:59:07] kavanagh: has joined #ruby
[12:00:31] yoongkang: has joined #ruby
[12:00:33] KaliLinuxGR: has joined #ruby
[12:02:38] w0lf: jhass, what version of ruby i should install using rvm now
[12:04:14] yoongkang: has joined #ruby
[12:04:54] yoongkang: has joined #ruby
[12:05:23] synthroid: has joined #ruby
[12:07:43] pawnbox_: has joined #ruby
[12:09:01] raeoks: has joined #ruby
[12:11:55] raeoks: has joined #ruby
[12:16:06] craigp: has joined #ruby
[12:16:39] rann: has joined #ruby
[12:17:20] eprasad: has joined #ruby
[12:18:48] conta: has joined #ruby
[12:21:08] tvw: has joined #ruby
[12:21:39] griffindy: has joined #ruby
[12:22:42] madgen: has joined #ruby
[12:23:07] rapha: has joined #ruby
[12:23:23] rapha: has joined #ruby
[12:23:23] AngryBuzzy: has joined #ruby
[12:23:28] snowy: has joined #ruby
[12:23:35] rapha: has left #ruby: ()
[12:24:45] RegulationD: has joined #ruby
[12:26:38] conta: has joined #ruby
[12:27:32] karapetyan: has joined #ruby
[12:28:17] dminuoso_: has joined #ruby
[12:28:55] harfangk: has joined #ruby
[12:29:34] DeltaHeavy: has joined #ruby
[12:30:22] dionysus69: has joined #ruby
[12:32:31] shevy: new method Enumerator::Lazy#uniq. [Feature #11090]
[12:32:42] shevy: ACTION is the inofficial ruby changelog bot.
[12:34:33] ICantCook: has joined #ruby
[12:34:39] Zarthus: But what about Enumerator::WorkingHard#uniq
[12:35:37] blackmesa: has joined #ruby
[12:36:31] zacts: has joined #ruby
[12:37:12] w0lf: has left #ruby: ("Leaving")
[12:38:01] LoneHerm_: has joined #ruby
[12:38:31] karapetyan: has joined #ruby
[12:39:08] karapetyan: has joined #ruby
[12:40:55] Madplatypus: has joined #ruby
[12:41:16] craigp: has joined #ruby
[12:45:56] the_drow: has joined #ruby
[12:48:55] tulak: has joined #ruby
[12:51:54] MrBusiness: has joined #ruby
[12:52:04] zotherstupidguy: has joined #ruby
[12:55:54] DaniG2k: has joined #ruby
[12:56:31] l4v2: has joined #ruby
[12:58:12] Es0teric: has joined #ruby
[12:59:30] dminuoso: has joined #ruby
[13:01:37] skade: has joined #ruby
[13:06:08] dvinciguerra_: has joined #ruby
[13:06:16] mbreedlove: has joined #ruby
[13:07:14] malconis: has joined #ruby
[13:09:21] aegis3121: has joined #ruby
[13:09:24] mbreedlove: has joined #ruby
[13:09:48] Xentil: has joined #ruby
[13:10:07] shevy: creating/starting a new project is so much more work than adapting something :(
[13:10:17] aupadhye: has joined #ruby
[13:10:38] tango: has joined #ruby
[13:11:22] tango: anyone using chrystal-lang ? is it the future of ruby ?
[13:11:39] malconis: has joined #ruby
[13:11:43] dminuoso: has joined #ruby
[13:12:44] blasius: has joined #ruby
[13:13:15] ChiefAlexander: has joined #ruby
[13:14:17] ruby-lang253: has joined #ruby
[13:16:09] LoneHerm_: has joined #ruby
[13:17:33] mozzarella: has joined #ruby
[13:20:25] Es0teric: has joined #ruby
[13:21:04] flashpoint9: has joined #ruby
[13:21:37] hipertracker: has joined #ruby
[13:22:40] ramortegui: has joined #ruby
[13:23:57] guardian: hello, I don't code in ruby often. On Debian Jessie I'm stuck with Ruby 2.1. Should I use rvm or rbenv? What's today's stance?
[13:24:50] dminuoso: guardian: The common way (and least intrusive) is to use ruby-install either alone or in tandem with chruby.
[13:24:56] JakFrist: has joined #ruby
[13:25:09] cdg: has joined #ruby
[13:25:23] Papierkorb: guardian: I use chruby in such cases. Guide: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you//
[13:25:38] Papierkorb: works the same on debian jessie
[13:26:02] guardian: ah nice thanks
[13:26:20] JeanCarloMachado: has joined #ruby
[13:26:24] jhass: guardian: that said, tbf the differences between 2.1 and 2.3 are not thaat big, it's just that 2.1 officially EOLs Feb 2017
[13:26:56] guardian: I've been pointed to https://gorails.com/setup/ubuntu/14.04 but preferred to ask
[13:27:05] no_gravity: has joined #ruby
[13:27:17] no_gravity: Hello! How would this look in Ruby? foreach($users as $user) echo $user->name;
[13:27:23] guardian: jhass: some packages like guard dropped support for Ruby 2.1
[13:27:32] jhass: ah well, yeah
[13:27:45] jhass: no_gravity: users.each do |user| user.name
[13:27:53] jhass: er, puts user.name
[13:29:03] jaruga___: has joined #ruby
[13:29:41] AgentVenom: has joined #ruby
[13:29:59] shevy: no_gravity anything unclear?
[13:30:07] no_gravity: Yup, everything.
[13:30:23] no_gravity: I wonder how this oneliner would look in Ruby: foreach($users as $user) echo $user->name;
[13:30:24] GodFather: has joined #ruby
[13:30:45] shevy: do you not read
[13:31:09] no_gravity: Hmm... this chan seems to be unfriendly.
[13:31:25] hirvi: users.each do |user| puts user.name
[13:31:30] lizard2010: [15:27:45] <jhass> no_gravity: users.each do |user| puts user.name
[13:31:31] hirvi: like jhass already said
[13:31:44] lizard2010: what is not frienly?
[13:31:57] no_gravity: lizard2010: That gives me: (repl):2: syntax error, unexpected end-of-input, expecting keyword_end
[13:32:13] shevy: just add the missing "end"
[13:32:20] hirvi: no_gravity: try users.each do {|user| puts user.name }
[13:32:23] CybrGhost: has joined #ruby
[13:32:26] lolex_: has joined #ruby
[13:32:29] lizard2010: or users.each do { |user| puts user.name }
[13:32:35] hirvi: sorry, remove the do
[13:32:38] no_gravity: hirvi: (repl):1: syntax error, unexpected '|', expecting '}'
[13:32:43] lizard2010: or users.each { |user| puts user.name }
[13:32:44] ldnunes: has joined #ruby
[13:32:46] hirvi: users.each {|user| puts user.name }
[13:32:50] shevy: a bit of fails ongoing here ;)
[13:33:00] shevy: but we are there now!
[13:33:01] lizard2010: how made 3 errors in one line ©
[13:33:07] jaguarmagenta: has joined #ruby
[13:33:12] no_gravity: lizard2010: undefined method `name' for {:name=>"some"}:Hash
[13:33:18] no_gravity: I'm giving up :)
[13:33:29] shevy: well your example used $user->name
[13:33:39] no_gravity: I created the user array like this:
[13:33:44] no_gravity: users=[{name:"joe"},{name:"hans"}]
[13:33:51] no_gravity: Should I user => instead of : ?
[13:33:53] shevy: so we can conclude that it was an object that had this method or slot? If it is a hash though, you can use .fetch()
[13:34:05] no_gravity: well, users is an array
[13:34:17] no_gravity: And I thought that by using {} the users are objects..
[13:34:21] hirvi: no_gravity: try user['name'] instead of user.name
[13:34:27] lizard2010: array of hashes
[13:34:36] no_gravity: ":" makes a hash?
[13:34:46] lizard2010: read the docs? (=
[13:34:48] shevy: you have put [{}] there
[13:34:57] shevy: so a hash put into an array
[13:35:08] shevy: if you don't need the array, it may be simpler to just work with the hash
[13:35:19] giz|work: Hash.new definately makes a hash
[13:35:44] A124: has joined #ruby
[13:35:59] no_gravity: Well, in JS this creates an array of objects: users=[{name:"joe"},{name:"hans"}]
[13:36:09] moei: has joined #ruby
[13:36:16] no_gravity: Would you not use an array of objects in ruby?
[13:36:25] lizard2010: In ruby - all are objects
[13:36:53] Papierkorb: no_gravity: Ruby is not broken like JS in that regard.
[13:37:07] Papierkorb: no_gravity: Create a proper class if you want something like that
[13:37:33] no_gravity: Proper classes are so 90s.
[13:37:58] no_gravity: Can't I use this? users=[{name:"joe"},{name:"hans"}]
[13:38:02] daivyk: has joined #ruby
[13:38:10] lizard2010: you can use this
[13:38:31] no_gravity: So what do I have then?
[13:38:39] blackmesa: has joined #ruby
[13:38:51] lizard2010: ACTION shrug
[13:39:07] no_gravity: In JS I have an array with two objects.
[13:39:12] lizard2010: array of hashes.
[13:39:33] lizard2010: every hashes and array at total are objects
[13:39:55] no_gravity: so ok, i have an array of hashes.
[13:39:56] lizard2010: so you can call @users.count
[13:40:05] pdoherty: has joined #ruby
[13:40:07] no_gravity: Would that be a good choice to store a bunch of users?
[13:40:11] jhass: no_gravity: users is an array of hashes, {name: "joe"} is a shortcut to {:name => "joe"}. You iterate the array with .each, you access the hash value by its key with [], so users.each do |user| puts user[:name]; end
[13:40:16] lizard2010: or same other objects method
[13:40:42] no_gravity: jhass: damn, that worked!
[13:40:54] jhass: no_gravity: probably fine for now, turn it into a an array of instances of your own class User once you feel the desire to call methods on it
[13:41:32] no_gravity: I have to say this does not look too elegant to me: users.each do |user| puts user[:name]; end
[13:41:37] no_gravity: It feels a bit like bash.
[13:41:46] lizard2010: if you declare User's class metod's (=
[13:42:10] lizard2010: hah, continue use php (=
[13:42:16] no_gravity: What does the |user| part do?
[13:42:37] lizard2010: declare cycle variable
[13:43:16] dminuoso: no_gravity: I recommend you start with a Ruby book or guide.
[13:43:18] ledestin: has joined #ruby
[13:43:20] lizard2010: analog of your «as $user)»
[13:43:22] dminuoso: It beats asking us about all the basic syntax things.
[13:43:29] lizard2010: from foreach
[13:43:45] lizard2010: +1 for dminuoso
[13:43:46] no_gravity: What if I create my users like this? users=[["name"=>"joe"],["name"=>"doe"]]
[13:43:53] no_gravity: Is it then easier to iterate over them?
[13:43:57] moei: has joined #ruby
[13:44:13] lizard2010: and after metaprogramming for full love ruby
[13:44:39] lizard2010: no_gravity, same level
[13:44:55] jhass: no_gravity: that's the same as [[{"name" => "joe"}], [{"name" => "doe"}]]
[13:45:24] hirvi: why do you consider users.each {|user| puts user[:name]} inelegant?
[13:45:24] pawnbox: has joined #ruby
[13:45:28] no_gravity: jhass: And I still have to |jump| through; all those [:hoops] to iterate?
[13:45:38] jhass: even more then
[13:47:03] mikecmpb_: has joined #ruby
[13:47:05] jhass: >> ["foreach($users as $user)", "users.each do |user|"].map {|s| [s, s.size] }.to_h # btw
[13:47:06] ruby[bot]: jhass: # => {"foreach($users as $user)"=>24, "users.each do |user|"=>20} (https://eval.in/608759)
[13:47:17] jhass: it's shorter
[13:47:40] mdw: has joined #ruby
[13:48:11] lizard2010: he likes foreach more (=
[13:48:39] pawnbox: has joined #ruby
[13:48:49] no_gravity: Yeah, foreach is how I like it.
[13:49:00] mdw: has joined #ruby
[13:50:14] jhass: you'll get over it, for starters try to write the above snippet in PHP
[13:50:30] jhass: my last one?
[13:50:38] no_gravity: What does it do?
[13:50:43] Akuma: has joined #ruby
[13:51:07] jhass: I don't think you even spend 5 seconds on trying to understand
[13:51:21] mbreedlove: has joined #ruby
[13:51:22] no_gravity: You think wrong.
[13:51:36] jhass: well, look at its output, reproduce it
[13:52:01] araujo: has joined #ruby
[13:52:04] no_gravity: It outputs some weird stuff.
[13:53:38] kavanagh: has joined #ruby
[13:53:52] iMadper`: has joined #ruby
[13:55:48] davedev24: has joined #ruby
[13:56:33] edwinvdgraaf: has joined #ruby
[13:57:17] mattwashere: has joined #ruby
[13:57:36] shevy: it outputs what you tell it to output
[13:57:41] no_gravity: has left #ruby: ()
[13:58:30] et09: has joined #ruby
[13:58:40] lizard2010: php have eat hin
[13:59:12] macsteps: has joined #ruby
[13:59:17] mikecmpbll: has joined #ruby
[14:00:12] EXCHGR: has joined #ruby
[14:00:18] mattwashere: has joined #ruby
[14:00:56] snowy: has joined #ruby
[14:01:17] georgedrummond: has joined #ruby
[14:01:49] mattwashere: has joined #ruby
[14:03:00] synthroid: has joined #ruby
[14:04:22] SilverKey: has joined #ruby
[14:05:43] pxqxvk: has joined #ruby
[14:09:37] conta1: has joined #ruby
[14:10:02] l4v2: has joined #ruby
[14:10:14] freeman1337: has joined #ruby
[14:12:08] ddffg: has joined #ruby
[14:12:51] Okuu: has joined #ruby
[14:13:13] conta: has joined #ruby
[14:15:40] Ropeney: has joined #ruby
[14:16:32] cdg: has joined #ruby
[14:24:56] yardenbar: has joined #ruby
[14:24:59] armyriad: has joined #ruby
[14:25:39] RegulationD: has joined #ruby
[14:26:04] mbreedlove: has joined #ruby
[14:28:48] mbreedlove: has joined #ruby
[14:29:19] mattwashere: has joined #ruby
[14:29:45] jhack: has joined #ruby
[14:30:04] mattwashere: has joined #ruby
[14:32:58] ChiefAlexander: has joined #ruby
[14:34:43] devster31: has joined #ruby
[14:36:09] ruby[bot]: -b roflovski!*@*$#ruby-banned
[14:37:19] alexherbo2: has joined #ruby
[14:38:18] tvw: has joined #ruby
[14:38:56] eljimbo: has joined #ruby
[14:39:20] flashpoint9: has joined #ruby
[14:40:16] underplank: has joined #ruby
[14:42:49] dminuoso: has joined #ruby
[14:45:25] mattwashere: has joined #ruby
[14:46:04] blackmesa: has joined #ruby
[14:46:57] raldu: what is the best way to package a small script that can be installed to, say, /usr/local/bin/, and that is *not* a gem?
[14:47:30] CharlesN: has joined #ruby
[14:52:04] shevy: have it a single .rb file, let the user copy it to that path; you can provide an internal way to copy it to that path too, on first run, unless it is not already there
[14:52:50] rippa: has joined #ruby
[14:53:01] raldu: shevy: thanks for the idea. what about setup.rb? the script may also have a configuration file and tests. but it is still a single file script.
[14:53:41] DeltaHeavy: has joined #ruby
[14:54:20] shevy: your requirement was /usr/local/bin
[14:55:09] shevy: setup.rb will use the local path at where site dir is, e. g. if someone has ruby at /Programs/Ruby/2.3.1, it will... I think... go to /Programs/Ruby/2.3.1/lib/ruby/site_ruby/2.3.0/ - something like that
[14:55:16] dionysus69: has joined #ruby
[14:55:30] shevy: unsure whether you can use setup.rb to install into some other target area
[14:55:43] jhass: raldu: just make it a gem
[14:56:06] shevy: hmm setup.rb supports --installdirs= and --rubypath=path
[14:56:17] freeman1337: https://github.com/phusion/traveling-ruby
[14:56:32] freeman1337: Or some kind of a packaging gem or tool might be of some use
[14:56:40] raldu: jhass: I think it would be possible to make it a gem without exposing it to the rubygems repository
[14:57:18] jhass: raldu: it is
[14:57:24] raldu: shevy: thanks
[14:57:25] jhass: just distribute the built .gem file
[14:57:52] jhass: tell people to gem install it, done
[14:58:30] bmn: has joined #ruby
[14:58:56] raldu: by using the --local switch, right?
[14:59:59] shevy: gem install ./foobar.gem should work, I think
[15:00:08] raldu: thanks everyone. I think I'll make it a gem. freeman1337 I have been looking for something like this too, thanks.
[15:02:21] skade: has joined #ruby
[15:03:41] agent_white: has joined #ruby
[15:04:23] SilverKey: has joined #ruby
[15:04:33] macsteps: has joined #ruby
[15:04:51] KCmetro: has joined #ruby
[15:05:07] craigp: has joined #ruby
[15:06:14] whathappens: has joined #ruby
[15:07:14] abhinavmehta: has joined #ruby
[15:07:30] haxrbyte: has joined #ruby
[15:10:48] flashpoint9: has joined #ruby
[15:13:38] blackmesa: has joined #ruby
[15:14:06] lolex: has joined #ruby
[15:15:15] ChiefAlexander: has joined #ruby
[15:17:10] LoneHermit: has joined #ruby
[15:19:30] ur5us: has joined #ruby
[15:21:12] Amnez777: has joined #ruby
[15:22:01] bmn: has joined #ruby
[15:23:54] speakingcode: has joined #ruby
[15:24:30] synthroid: has joined #ruby
[15:25:11] davedev24: has joined #ruby
[15:26:22] davedev24: has joined #ruby
[15:26:33] RegulationD: has joined #ruby
[15:27:04] dionysus69: has joined #ruby
[15:27:55] sepp2k: has joined #ruby
[15:28:17] mostlybadfly: has joined #ruby
[15:28:49] flashpoint9: has joined #ruby
[15:30:03] davedev24: has joined #ruby
[15:31:02] Vingador: has joined #ruby
[15:33:03] macsteps: has joined #ruby
[15:33:51] DaniG2k: has joined #ruby
[15:34:21] jegarcia: has left #ruby: ("WeeChat 1.3")
[15:34:34] govg: has joined #ruby
[15:34:55] SilverKey: has joined #ruby
[15:35:39] mistermocha: has joined #ruby
[15:35:53] yoongkang: has joined #ruby
[15:37:56] malconis: has joined #ruby
[15:40:04] lxsameer: has joined #ruby
[15:40:50] cyphase: has joined #ruby
[15:41:23] jhass: now how the hell does this happen:
[15:41:25] jhass: ldd vendor/bundle/ruby/2.2.0/extensions/x86_64-linux/2.2.0/pg-0.18.4/pg_ext.so | grep ruby
[15:41:27] jhass: libruby.so.2.3 => /usr/lib/libruby.so.2.3 (0x00007ff27fad2000)
[15:42:47] jhack: has joined #ruby
[15:43:05] mbreedlove: has joined #ruby
[15:43:14] craigp: has joined #ruby
[15:44:55] kareeoleez: has joined #ruby
[15:45:01] jhass: https://bitbucket.org/ged/ruby-pg/issues/229/pg_ext-improperly-linked-when-using-rvm ugh
[15:45:01] xall: has joined #ruby
[15:45:13] smathy: has joined #ruby
[15:46:13] kavanagh: has joined #ruby
[15:48:14] armyriad: has joined #ruby
[15:49:19] moeabdol2: has joined #ruby
[15:49:28] jhack: has joined #ruby
[15:51:54] yoongkang: has joined #ruby
[15:52:19] fmcgeough: has joined #ruby
[15:55:21] [Butch]: has joined #ruby
[15:57:04] Bugboy1028: has joined #ruby
[15:59:42] amclain: has joined #ruby
[16:00:53] lolex_: has joined #ruby
[16:01:36] giz|work: has joined #ruby
[16:01:47] ramfjord: has joined #ruby
[16:02:13] harfangk: has joined #ruby
[16:02:42] c0mrad3: has joined #ruby
[16:05:20] AndrewIsHere: has joined #ruby
[16:06:24] tulak: has joined #ruby
[16:08:49] diegoviola: has joined #ruby
[16:09:27] DeltaHeavy: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[16:11:22] memorasus: has joined #ruby
[16:14:21] douglascorrea: has joined #ruby
[16:14:37] dminuoso: has joined #ruby
[16:15:03] araujo: has joined #ruby
[16:15:03] araujo: has joined #ruby
[16:15:30] giz|work|2: has joined #ruby
[16:15:50] abhinavmehta: has joined #ruby
[16:16:14] hightower4: has joined #ruby
[16:17:10] macsteps: has joined #ruby
[16:17:35] pawnbox: has joined #ruby
[16:17:43] jhack: has joined #ruby
[16:18:22] LoneHerm_: has joined #ruby
[16:18:30] mistermocha: has joined #ruby
[16:19:30] dionysus69: has joined #ruby
[16:19:57] davedev24: has joined #ruby
[16:20:12] Cohedrin: has joined #ruby
[16:20:34] SilverKey: has joined #ruby
[16:21:30] mdw: has joined #ruby
[16:23:12] devbug: has joined #ruby
[16:26:19] Pupp3tm4st3r: has joined #ruby
[16:27:32] Devalo: has joined #ruby
[16:28:49] hipertracker: has joined #ruby
[16:28:56] SCHAAP137: has joined #ruby
[16:29:56] anisha: has joined #ruby
[16:30:28] kitikonti: has joined #ruby
[16:30:31] mdw: has joined #ruby
[16:32:42] killerkamel: has joined #ruby
[16:33:57] Underdogg: has joined #ruby
[16:34:02] roshanavand: has joined #ruby
[16:35:04] anisha_: has joined #ruby
[16:35:41] zacts: has joined #ruby
[16:39:21] zacts: I've decided to not use rvm as much as possible
[16:39:25] americanboy: has joined #ruby
[16:39:26] zacts: I've switched to chruby
[16:39:50] zacts: (but that's just my personal preference)
[16:40:14] zotherstupidguy: has joined #ruby
[16:40:37] drahosj_: has joined #ruby
[16:42:32] futilegames: has joined #ruby
[16:42:58] jaguarmagenta: has joined #ruby
[16:43:04] whathappens: has joined #ruby
[16:43:21] Guest60828: has joined #ruby
[16:44:06] JeanCarloMachado: has joined #ruby
[16:46:00] SilverKey: has joined #ruby
[16:47:29] centrx: has joined #ruby
[16:49:37] dikaio: has joined #ruby
[16:50:10] fredolinhares: has joined #ruby
[16:50:20] davedev24: has joined #ruby
[16:50:34] araujo: has joined #ruby
[16:52:01] Pupp3tm4st3r: has joined #ruby
[16:52:04] leea: has joined #ruby
[16:52:52] yoongkang: has joined #ruby
[16:54:10] mdw: has joined #ruby
[16:55:25] futilegames: has left #ruby: ()
[16:56:15] mdw7: has joined #ruby
[16:57:07] mistermocha: has joined #ruby
[16:58:31] mikecmpbll: has joined #ruby
[16:58:39] pawnbox: has joined #ruby
[16:58:53] fmcgeough: has joined #ruby
[16:59:15] dvinciguerra_: has joined #ruby
[16:59:18] pawnbox: has joined #ruby
[16:59:38] jaguarmagenta: has joined #ruby
[17:00:08] macsteps: has joined #ruby
[17:00:22] Contigi: has joined #ruby
[17:01:36] replay: has joined #ruby
[17:02:57] iWaffles: has joined #ruby
[17:04:04] Guest60828: has joined #ruby
[17:04:16] zotherstupidguy: has joined #ruby
[17:06:20] pawnbox: has joined #ruby
[17:09:50] conta: has joined #ruby
[17:10:11] shinnya: has joined #ruby
[17:10:48] craigp: has joined #ruby
[17:16:13] polishdub: has joined #ruby
[17:16:21] ChiefAlexander: has joined #ruby
[17:17:13] abhinavmehta: has joined #ruby
[17:17:58] antgel: has joined #ruby
[17:18:07] Eiam: has joined #ruby
[17:19:40] djbkd: has joined #ruby
[17:19:50] chipotle: has joined #ruby
[17:22:35] jaguarmagenta: has joined #ruby
[17:23:00] speakingcode: has joined #ruby
[17:23:08] craigp: has joined #ruby
[17:24:23] aryaching: has joined #ruby
[17:25:28] davedev24: has joined #ruby
[17:27:15] rcvalle: has joined #ruby
[17:27:31] SilverKey: has joined #ruby
[17:27:36] RegulationD: has joined #ruby
[17:28:33] pawnbox: has joined #ruby
[17:28:47] govg: has joined #ruby
[17:31:34] nanoz: has joined #ruby
[17:32:47] Guest60828: has joined #ruby
[17:33:29] zacts: has joined #ruby
[17:33:58] dylankarr: has joined #ruby
[17:36:15] whathappens: has joined #ruby
[17:36:17] mistermocha: has joined #ruby
[17:36:44] hahuang65: has joined #ruby
[17:36:59] hipertracker: has joined #ruby
[17:37:07] Madplatypus: has joined #ruby
[17:37:22] pawnbox: has joined #ruby
[17:37:59] RegulationD: has joined #ruby
[17:38:00] karapetyan: has joined #ruby
[17:39:01] postmodern: has joined #ruby
[17:39:21] whathapp_: has joined #ruby
[17:44:36] whathappens: has joined #ruby
[17:44:58] mdw: has joined #ruby
[17:45:57] tango: has joined #ruby
[17:46:23] madgen: has joined #ruby
[17:47:10] douglasc_: has joined #ruby
[17:47:45] xall: has joined #ruby
[17:52:02] CodeAleks: has joined #ruby
[17:52:08] hipertracker: has joined #ruby
[17:53:02] darkxploit: has joined #ruby
[17:56:04] araujo: has joined #ruby
[17:58:17] araujo: has joined #ruby
[17:59:42] sucks: has joined #ruby
[18:02:54] jaguarmagenta: has joined #ruby
[18:02:57] sergey_makagon: has joined #ruby
[18:03:55] karapetyan: has joined #ruby
[18:06:27] JeanCarloMachado: has joined #ruby
[18:10:49] duoi: has joined #ruby
[18:12:00] Technodrome: has joined #ruby
[18:12:09] elifoster: has joined #ruby
[18:12:31] Pupp3tm4st3r: has joined #ruby
[18:13:14] spider-mario: has joined #ruby
[18:13:27] kirun: has joined #ruby
[18:14:28] dminuoso: chrisseaton: One thing that confuses me, is where most of the performance is lost in CRuby in comparison to graalvm/truffle
[18:15:31] dminuoso: After the initial warm up, I did not expect graalvm/truffle to perform 40x faster than CRuby - at all.
[18:15:44] headius: CRuby doesn't even have a JIT
[18:16:14] dminuoso: headius: Perhaps it's my ignorance of why JIT actually works that well.
[18:16:55] headius: well apart from getting the overhead of an interpreter out of the way, you can inline methods and get better optimization of the whole
[18:17:36] dminuoso: Well CRuby isn't really interpreted either since the VM.
[18:17:46] headius: it's definitely interpreted
[18:18:23] dminuoso: headius: You could technically precompile a file and load the InstructionSequence from file and execute it.
[18:18:34] headius: yes, and it runs in the interpreter
[18:18:42] Papierkorb: dminuoso: From my understanding, Graal understands the intention when you do "[ 4, 5 ].max" to not create an array, but actually just do the operation you had in mind. Stuff like this really adds up
[18:18:43] headius: it's a bytecode interpreter, similar to JVM
[18:19:06] headius: unlike JVM or JRuby or Truffle, they don't proceed on to a JIT ever
[18:19:17] pawnbox: has joined #ruby
[18:19:19] LoneHerm_: has joined #ruby
[18:19:23] Papierkorb: headius: on this topic, how's Graal coming along? Is there any easy to use JAR I could try without installing extra/special software?
[18:19:51] headius: Papierkorb: chrisseaton knows the current status but I believe there's still hoops to jump through
[18:20:11] headius: last time I saw someone try to play with it they had to build Graal themselves
[18:20:33] headius: things are moving rather fast but it's still a good ways out from general use
[18:21:17] Papierkorb: headius: Will be really interesting to see how it compares performance-wise against Elixir and Crystal
[18:21:39] headius: I wouldn't expect Elixir to compare at all
[18:21:54] jhass: I think [4, 5].max is not the best example, it needs to be special cased either way (and will be in CRuby 2.4)
[18:22:14] headius: jhass: it's more than that specific pattern
[18:22:24] Papierkorb: People were like "Wow, Elixir is 6x faster than ruby!". Wasn't as impressed *hides*
[18:22:26] headius: it could be [a, b, c, d, e].max and it still optimizes through it
[18:22:28] dminuoso: headius: Do such JIT compilers actually reorder bytecode, or are the optimizations locally on the machine code generated?
[18:22:32] karapetyan: has joined #ruby
[18:22:37] lupine: only 6x as fast?
[18:22:39] headius: Papierkorb: heh, JRuby's 5-10x faster than CRuby already
[18:22:44] lupine: that's pretty disappointing
[18:22:47] headius: for compute-heavy loads
[18:22:54] Papierkorb: lupine: I /heard/, never tried as I'm not interested really in that language eitherway
[18:23:44] lupine: least it's not crystal ^^
[18:24:01] chipotle: has joined #ruby
[18:24:03] finisherr: has joined #ruby
[18:24:04] araujo_: has joined #ruby
[18:24:05] memorasus: has joined #ruby
[18:24:30] douglascorrea: has joined #ruby
[18:24:31] Papierkorb: headius: I think I wrote a micro benchmark lately where JRuby performed pretty badly compared to MRI. Should I still forward such to you over there? (Wasn't I/O bound)
[18:24:42] headius: you absolutely should
[18:24:45] headius: that's almost always a bug
[18:25:17] Mimorial: has joined #ruby
[18:25:37] headius: Papierkorb: there are a few specific areas where we have trouble matching perf, but most stuff should be much faster in JRuby
[18:25:45] zacts: has joined #ruby
[18:25:47] kab: has joined #ruby
[18:25:59] headius: dminuoso: they may, yes
[18:26:11] symm-: has joined #ruby
[18:26:12] Papierkorb: I was surprised too. Expected it to be even. But can't even think of what I really did, have to look at work next week if I still have the .rb lying around
[18:26:24] iWaffles: has joined #ruby
[18:26:27] swills: has joined #ruby
[18:26:35] headius: the most popular JVM JIT, Hotspot, has its own internal representation that it optimizes before proceeding to machine code
[18:26:43] blackmesa: has joined #ruby
[18:26:44] headius: and then the machine code gets some different sorts of optimization passes
[18:26:52] mattwashere: has joined #ruby
[18:27:32] dminuoso: headius: Ah, so when some area of code is repeatedly executed, it can optimize more and more on each pass?
[18:27:34] headius: Papierkorb: well please do ping me here or in #jruby
[18:27:59] headius: dminuoso: most JITs gather profile information while the code is interpreting, and then use that to optimize the code well
[18:28:23] lupine: headius: I was wondering if jruby made any efforts to persist that profile information between runs, actually
[18:28:32] headius: so if you have a loop calling obj.to_s all the time and it turns out "obj" is an Array, we can just check that and inline Array#to_s right there
[18:28:37] lupine: might not be worth it
[18:28:50] headius: lupine: we do not yet but have talked about doing it in the future
[18:28:54] jhack: has joined #ruby
[18:28:59] roshanavand: has joined #ruby
[18:29:03] headius: it's difficult to know if that profile is still valid between runs, though
[18:29:14] skweek: has joined #ruby
[18:29:15] Papierkorb: Would be great, I think .Net does something similar to speed up starting performance
[18:29:21] yfeldblum: has joined #ruby
[18:29:22] Papierkorb: Or they tried or something. Not a .Net dev.
[18:29:42] chosen1: has joined #ruby
[18:29:43] lupine: mm, can't imagine ruby makes it easy
[18:29:48] dminuoso: headius: It sounds like an interesting topic, perhaps I should dig a little deeper by reading a book or two on the subject.
[18:29:52] banisterfiend: has joined #ruby
[18:32:19] SilverKey: has joined #ruby
[18:33:24] douglasc_: has joined #ruby
[18:33:34] headius: Papierkorb: .NET does a one-time compile from IL to native, and never optimizes again
[18:33:59] headius: at least, last I read about it they didn't ever optimize again, and had no profiling happening in that generated binary
[18:34:16] headius: CLR generally starts faster but runs slower than JVM
[18:35:59] hipertracker: has joined #ruby
[18:37:53] douglascorrea: has joined #ruby
[18:37:56] dminuoso: has joined #ruby
[18:39:10] chrisseaton: dminuoso: hello
[18:39:59] chrisseaton: dminuoso: you understand that a C program and a Ruby program could have the same output but the C program be much simpler and so much faster? Well that's because the Ruby interpreter does things in a more complicated way than necessary. Our JIT tries to figure out what work isn't needed and avoids doing it.
[18:40:33] dionysus69: has joined #ruby
[18:40:37] chrisseaton: dminuoso: I presented a deliberately extreme example in this blog post (half way down, 'The Acid Test') http://chrisseaton.com/rubytruffle/pushing-pixels/
[18:41:00] chrisseaton: dminuoso: the output of this benchmark is 22, but you can see how much Ruby code runs to work that out
[18:41:35] solars: has joined #ruby
[18:41:35] chrisseaton: dminuoso: a JIT can think about all that Ruby code, and simplify it to the single value 22, and output a single machine instruction to return that result, instead of executing any code (I'm simplifying, it's not quite like that in reality)
[18:41:46] zacts: has joined #ruby
[18:41:47] zapata: has joined #ruby
[18:42:31] chrisseaton: dminuoso: if you are still interested in knowing more I can talk you through some more examples in DM
[18:43:08] postapocallyptic: has joined #ruby
[18:44:27] postapocallyptic: http://pastebin.com/4HExeUDr <--- this code doesn't output the desired results. How can I fix this?
[18:44:27] ruby[bot]: postapocallyptic: as I told you already, please use https://gist.github.com
[18:45:06] whathappens: has joined #ruby
[18:45:48] postapocallyptic: I want to create an array of the class Print_number and then I want to run the printme command in a thread, but for some reason it doesn't execute properly. only a few instances of the elements in the array gets their method called.
[18:45:56] cdg: has joined #ruby
[18:49:35] rubyist429: has joined #ruby
[18:49:47] angrycat: has joined #ruby
[18:50:24] angrycat: Hi, are all exceptional events considered exceptions?
[18:50:40] macsteps: has joined #ruby
[18:51:37] Ishido: has joined #ruby
[18:51:52] jhass: ymmv, for most people probably yes
[18:52:14] jhass: there usually has to be a "can't handle it here" character to them too
[18:52:27] alfiemax: has joined #ruby
[18:52:37] ffgghhj: has joined #ruby
[18:53:39] dminuoso: chrisseaton: Thank you for your response. I just finished reading through that blog post, and there quite a few interesting bits in there.
[18:55:05] dminuoso: chrisseaton: Perhaps we could talk about this further on another day, as I'm about to leave.
[18:55:34] yoongkang: has joined #ruby
[18:56:43] dennisvennink: has joined #ruby
[18:57:46] roshanavand: has joined #ruby
[19:00:10] mdw: has joined #ruby
[19:00:19] jaguarmagenta: has joined #ruby
[19:01:33] SilverKey: has joined #ruby
[19:02:06] blackmesa: has joined #ruby
[19:03:00] Guest60828: has joined #ruby
[19:04:15] weaksauce: has joined #ruby
[19:10:00] skade: has joined #ruby
[19:13:34] chipotle: has joined #ruby
[19:13:45] Dimik: has joined #ruby
[19:14:48] chipotle: has joined #ruby
[19:15:08] bgmarx: has joined #ruby
[19:15:29] johnmilton: has joined #ruby
[19:15:29] JStoker: has joined #ruby
[19:15:43] EvilJStoker: has joined #ruby
[19:15:50] bgmarx: has left #ruby: ()
[19:16:33] rubyist429: Hi, I'm having a really weird issue with extending Nokogiri::XML::Document. I'd like to call the superconstructor with no arguments, but that only works if the child constructor doesn't take any arguments either. Here's a minimal example: https://gist.github.com/anonymous/2478c472c1866a8c0b4f2c00705443cf (I haven't been able to reproduce it when defining the classes myself, without Nokogiri)
[19:16:44] skade: has joined #ruby
[19:18:33] kitikonti: has joined #ruby
[19:19:40] rubyist429: It almost seems like the superconstructor is eating all arguments, regardless of what the child constructor is doing. I tried calling "super" and "super()", too, which doesn't make any difference. I'm running ruby 2.3.1p112. Any help is much appreciated!
[19:19:42] apeiros: rubyist429: Nokogiri::XML::Document implements its own ::new as it seems
[19:19:57] jhass: why do you want to subclass?
[19:20:01] jhass: why can't you wrap?
[19:20:41] johnmilton: has joined #ruby
[19:20:51] rubyist429_: has joined #ruby
[19:21:30] papercode: has joined #ruby
[19:21:37] craigp: has joined #ruby
[19:22:57] SilverKey: has joined #ruby
[19:23:13] pdoherty: has joined #ruby
[19:23:20] rubyist429_: Sorry about that, I got disconnected for some reason. apeiros, I searched the source code but couldn't find anything; I didn't even know you could do that.
[19:23:37] apeiros: new is just a method too
[19:23:46] rubyist429_: jhass, I wanted to store the XML document's path without having to access an extra method every time I needed to read XML data
[19:24:16] rubyist429_: I searched for "def self.new" but couldn't find anything :(
[19:24:29] apeiros: it's native
[19:24:31] apeiros: http://www.rubydoc.info/github/sparklemotion/nokogiri/master/Nokogiri/XML/Document#new-class_method
[19:24:41] pawnbox: has joined #ruby
[19:25:17] thejoecarroll: has joined #ruby
[19:25:20] rubyist429_: Ha; well, that's annoying, thank you very much for finding this.
[19:26:05] moeabdol2: has joined #ruby
[19:26:10] rubyist429_: Is there any way to work around that or does that mean I also have to define my own "new" method?
[19:26:13] synthroid: has joined #ruby
[19:26:15] SilverKey: has joined #ruby
[19:26:19] wald0: has joined #ruby
[19:26:21] jhass: rubyist429_: just forward all other methods, see SimpleDelegator from delegate stdlib
[19:28:09] moeabdol3: has joined #ruby
[19:29:06] imperator: has joined #ruby
[19:29:11] nertzy: has joined #ruby
[19:30:16] marxarelli: has joined #ruby
[19:31:05] rubyist429_: Looks great, I'll experiment with it. Thanks a lot, I never would've figured this out on my own!
[19:33:08] pawnbox: has joined #ruby
[19:34:07] ChiefAlexander: has joined #ruby
[19:34:08] rubyist429_: Works great, thank you so much!
[19:38:13] mrgrieves: has joined #ruby
[19:40:10] zacts: apeiros: have you tried the oga gem?
[19:40:15] zacts: (as an alternative to nokogiri)
[19:40:27] firstdayonthejob: has joined #ruby
[19:42:49] pior: has joined #ruby
[19:45:46] singalaut: has joined #ruby
[19:46:11] havenwood: zacts: yorickpeterse has tried it ;)
[19:46:45] havenwood: zacts: it compiles reliably! that's a real win. :-)
[19:48:37] troulouliou_div2: has joined #ruby
[19:49:22] solars: has joined #ruby
[19:49:50] wald0: has joined #ruby
[19:50:28] jenrzzz: has joined #ruby
[19:50:28] jenrzzz: has joined #ruby
[19:51:33] JeanCarloMachado: has joined #ruby
[19:52:58] nerium: has joined #ruby
[19:53:56] RegulationD: has joined #ruby
[19:54:11] yorickpeterse: the author is a bit of a dick though, he's very picky when reviewing changes
[19:54:14] yorickpeterse: 2/10 would not submit PR again
[19:55:33] tercenya: has joined #ruby
[19:56:21] yoongkang: has joined #ruby
[19:56:22] jhass: just fork it to crystal already instead!
[19:56:23] lupine: yorickpeterse: oh hi :)
[19:56:55] lupine: ACTION files that quote away for future reference
[19:57:06] kavanagh: has joined #ruby
[19:58:32] imperator: yorickpeterse, you still maintaining oga?
[19:59:07] jhass: btw is it o.g.a. or oger?
[19:59:41] oleksandr: has joined #ruby
[19:59:50] imperator: Undefined prefix Oga::XML: found (REXML::UndefinedNamespaceException) - that doesn't look right
[20:00:08] blackmesa: has joined #ruby
[20:00:17] zotherst1: has joined #ruby
[20:00:42] blackgoat: has joined #ruby
[20:01:20] futilegames: has joined #ruby
[20:01:45] yorickpeterse: imperator: yes?
[20:02:46] jhass: not sure that answers the question for me :o
[20:02:54] twinklerock: has joined #ruby
[20:03:11] yorickpeterse: It's just "Oga"
[20:03:18] jhass: so oger :P
[20:03:25] yorickpeterse: "Oga: A large two-person saw used for ripping large boards in the days before power saws. One person stood on a raised platform, with the board below him, and the other person stood underneath them."
[20:03:27] vuoto: has joined #ruby
[20:03:36] yorickpeterse: The name is a pun on Nokogiri."
[20:03:39] yorickpeterse: From the README :P
[20:03:52] yorickpeterse: or did you mean how to pronounce it?
[20:04:11] jhass: yes and no, all good
[20:04:33] yorickpeterse: imperator: if you were wondering why there aren't many commits, that's because there isn't really any need for it
[20:04:48] yorickpeterse: Users aren't really reporting bugs, and I'm satisfied with the API as-is
[20:05:40] imperator: not sure i understand some of the .to_s vs .to_xml implementations
[20:05:51] imperator: but i'm working with it
[20:06:01] DoubleMalt: has joined #ruby
[20:06:13] yorickpeterse: imperator: what exactly do you not understand? How they're implemented, or why there's to_s and to_xml?
[20:06:40] imperator: why they return what they return
[20:07:02] yorickpeterse: to_xml is generally recursive, so that may make things a bit confusing
[20:07:05] chipotle: has joined #ruby
[20:07:09] djbkd: has joined #ruby
[20:07:15] yorickpeterse: to_s is only used in very few places, mostly for getting the text of text nodes
[20:07:31] imperator: so, let me give you an example
[20:09:48] imperator: https://gist.github.com/djberg96/9bd301987a328ce693c50eb237e88721
[20:09:50] isberg: has joined #ruby
[20:10:20] yorickpeterse: So Oga never defines #to_s and has it return XML
[20:10:26] yorickpeterse: if you want XML you have to explicitly use to_xml
[20:10:33] strass: has joined #ruby
[20:10:42] _djbkd: has joined #ruby
[20:10:42] yorickpeterse: .xpath returns a NodeSet, which doesn't have a custom #to_s
[20:10:51] jaguarmagenta: has joined #ruby
[20:10:55] imperator: but, neither does it have .to_xml
[20:11:25] imperator: ok, so what's the oga way here?
[20:11:26] strass: I am trying to get serve working to compile haml and sass. I used html2haml to convert .erbs to .haml files, but now when I try to load localhost it says it cant find index.html
[20:11:36] strass: I have haml in my gemfile, so I thought it'd be able to find it
[20:11:39] yorickpeterse: Since a NodeSet can contain nodes from all over a document I'm not sure if serializing them back to XML in-order would be the right way to go
[20:11:40] Amnez777: has joined #ruby
[20:11:44] yorickpeterse: hence I decided not to add #to_xml
[20:12:04] yorickpeterse: if you want the nodes as XML in-order the easiest way at the moment is to use .each(&:to_xml).join('')
[20:12:17] strass: I even copied over the views folder wholesale from a bootstrap project that uses haml
[20:12:49] Mirubiri: has joined #ruby
[20:12:51] yorickpeterse: also there's the interesting case that if a NodeSet contains an Element and a Text, you'd get something like "<foo />bar" which isn't valid XML
[20:13:46] yorickpeterse: It's a bit of a double edged sword. Oga requires you to make certain decisions (instead of doing that for you) which can be both a blessing and a curse depending on what you're used to
[20:13:52] seventy: has joined #ruby
[20:14:22] rubyist429_: I just switched my project over to Oga, by the way. I love how it's more strict than Nokogiri and the classes are less polluted. And I really don't need the performance (and potential for dangerous bugs) of native C :-)
[20:14:39] strass: here's the error: http://pastebin.com/raw/wtm4Z3SF
[20:14:39] ruby[bot]: strass: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[20:15:41] SilverKey: has joined #ruby
[20:16:13] yorickpeterse: rubyist429_: I think for most it should be fast enough
[20:16:16] imperator: doing .each(&:to_xml).join('') gives me an Oga::XML::Element
[20:16:24] yorickpeterse: and chances are if you need it to be faster you're probably not using Nokogiri's DOM API anyway
[20:16:29] imperator: yorickpeterse, i'm in the "I just wanna get shit done" camp
[20:16:32] yorickpeterse: imperator: sorry I meant .map(&:to_xml).join('')
[20:16:47] sucks: has joined #ruby
[20:17:46] djbkd: has joined #ruby
[20:17:58] imperator: i thought collect_concat would do that, but i guess not
[20:18:05] weaksauce: has joined #ruby
[20:18:21] rubyist429_: It does seem pretty fast (at least I couldn't notice a difference even though I'm parsing ~ 500 relatively large files)
[20:18:25] rubyist429_: thank you for this awesome project <3
[20:18:52] yorickpeterse: imperator: collect_concat?
[20:19:01] yorickpeterse: rubyist429_: np
[20:19:34] imperator: yorickpeterse, seems to be a node method - but it's objects, not text
[20:20:08] yorickpeterse: collect_concat isn't an Oga method
[20:20:12] yorickpeterse: maybe something else snuck it in?
[20:20:34] jhass: imperator: collect_concat is just flat_map, no?
[20:21:12] LoneHerm_: has joined #ruby
[20:21:15] imperator: oh, is it just an alias?
[20:21:50] jhass: map is aliased as collect so they had to alias flat_map to collect_concat because....
[20:23:46] jhass: I like how the doc example for collect_concat just uses flat_map
[20:24:20] djbkd: has joined #ruby
[20:25:48] whathappens: has joined #ruby
[20:26:00] nankyokusei: has joined #ruby
[20:26:22] hipertracker: has joined #ruby
[20:26:24] jaguarmagenta: has joined #ruby
[20:28:32] killerkamel: has joined #ruby
[20:31:07] JakFrist: has joined #ruby
[20:33:13] postapocallyptic: http://pastebin.com/4HExeUDr <--- this code doesn't output the desired results. How can I fix this?
[20:33:13] ruby[bot]: postapocallyptic: as I told you already, please use https://gist.github.com
[20:33:39] zeroDi: has joined #ruby
[20:34:59] davedev24: has joined #ruby
[20:35:24] Nahra: has joined #ruby
[20:35:56] gchucky: has joined #ruby
[20:36:38] gchucky: when using UnixSocket.pair, how do you associate the two sockets to a domain socket?
[20:36:51] gchucky: like, something with Dir.pwd + "/server.sock"
[20:37:18] postapocallyptic: on line 38 ruby should create 10 different intances of the class, which will be accessed by each instance of the t.join call later on.
[20:37:45] postapocallyptic: it it looks like ruby doesn't create anything until t.join is called, which is too late.
[20:37:58] Nawn: has joined #ruby
[20:38:04] RegulationD: has joined #ruby
[20:38:50] c355E3B: has joined #ruby
[20:40:32] bgmarx: has joined #ruby
[20:41:19] jhass: gchucky: you mean create a file for them? Are you sure that's possible at all, I mean is there a syscall to do that?
[20:42:19] jhass: and why would you do that over a standard UnixServer and UnixSocket?
[20:43:02] gchucky: jhass: i... im not entirely sure if it's possible, tbh
[20:43:10] gchucky: basically i need two different processes to talk to each other.
[20:43:34] gchucky: figured i could do that using unix sockets.
[20:43:36] jhass: use DRb? :P
[20:43:57] mbreedlove: has joined #ruby
[20:44:06] gchucky: ooh, i see.
[20:44:06] jhass: http://devdocs.io/ruby~2.3/drb
[20:45:28] gchucky: and if one of the other processes was php...
[20:45:50] gchucky: i doubt there's a php interpreter for DRb..
[20:46:20] jhass: heh, I guess
[20:46:33] jhass: so elect one as the server and one as the client
[20:46:41] JeanCarloMachado: has joined #ruby
[20:46:42] jhass: use UnixServer and UnixClient respectively
[20:47:08] gchucky: so don't try to use UNIXSocket.pair?
[20:47:09] postapocallyptic: I should probably make printme method a thread!
[20:47:38] gchucky: i guess i don't understand the function of .pair, then
[20:47:48] SCHAAP137: has joined #ruby
[20:47:50] gchucky: http://docs.cs.up.ac.za/programming/ruby/ruby_2_2_0_stdlib/libdoc/socket/rdoc/UNIXSocket.html#method-c-pair implies that one can be used as server and one as client.
[20:49:50] rubyist429_: yonatankoren: one thing I noticed though -- I'm using some_node_set.to_a.select { |e| e.respond_to? :name && e.name.eql? 'something' } all over the place, wouldn't it make sense to have something like that as a method in NodeSet? Or am I doing something wrong?
[20:50:11] rubyist429_: I guess I {c,sh}ould use xpath
[20:50:41] jaguarmagenta: has joined #ruby
[20:50:53] jhass: gchucky: it's for when you fork one process of the other
[20:51:23] jhass: you close one end in the fork and the other in the parent process and then use the respectively other one in the fork and parent
[20:51:23] ur5us: has joined #ruby
[20:52:13] rubyist429_: Yeah, this is stupid, I'll use xpath instead
[20:52:15] JeanCarloMachado: has joined #ruby
[20:52:38] jhass: so in theory you could fork off your PHP process from the Ruby and pass it the FD, given PHP allows to pass an FD into their unix socket wrapper API
[20:52:44] pawnbox: has joined #ruby
[20:53:06] gchucky: sorry, FD?
[20:53:12] Papierkorb: filedescriptor
[20:53:18] gchucky: thought so
[20:53:34] gchucky: sockets can't be bidirectional, right?
[20:53:41] Papierkorb: sure they can
[20:53:52] jhass: they usually are
[20:53:54] jhass: pipes can't
[20:54:22] havenwood: gchucky: what are you sending back and forth?
[20:54:44] gchucky: json for now.
[20:55:13] gchucky: right now i have ruby writing to a tmp file and having php read it, but that's wonky.
[20:55:19] jhass: an alternative to IPC is a shared database, either a full RDBMS or something more specialized, say Redis
[20:55:25] Mon_Ouie: has joined #ruby
[20:56:01] gchucky: true. i was hoping to avoid having a new bunch of infrastructure to spin up and maintain..
[20:57:16] yoongkang: has joined #ruby
[20:57:24] kavanagh: has joined #ruby
[20:57:26] gchucky: arguably i could do this with a rabbitmq install.
[20:57:54] jhass: Redis is pretty good at a simple queue too
[20:58:44] jhass: The clear advantage is that you're less likely to loose messages when the message consumer dies
[21:00:14] havenwood: gchucky: or a plain ole REST API
[21:00:16] gchucky: maybe i need to go back to the drawing board on this.
[21:00:40] jhass: well, not saying your idea can't be appropriate
[21:01:02] jhass: it's all always cost/benefit evaluation
[21:01:21] maloik: has joined #ruby
[21:01:32] gchucky: maybe TCPSocket to ensure ack..
[21:01:41] havenwood: gchucky: would POSTing JSON back and forth suffice?
[21:01:50] gchucky: well, it's a bit heavy for what i'm trying to do.
[21:02:11] gchucky: basically i need a way for a ruby script to pass data to a long-running php process, and then return the response back to ruby.
[21:02:21] gchucky: super gross and ugly, but that's a whole other story.
[21:03:04] mbreedlo_: has joined #ruby
[21:03:42] AngryBuzzy: has joined #ruby
[21:03:57] jhass: UNIXSocket is basically TCP, you have the same guarantees
[21:04:11] jhass: it just skips the whole wrapping into IP and what not
[21:05:03] jhass: so your PHP script should be the server role
[21:05:28] mbreedlove: has joined #ruby
[21:06:44] gchucky: yeah, that's true.
[21:06:49] gchucky: alright, i gotta run.
[21:06:56] gchucky: thanks much for the help~
[21:07:12] gchucky: has left #ruby: ()
[21:09:21] blackmesa: has joined #ruby
[21:10:19] SilverKey: has joined #ruby
[21:12:11] Salve: has joined #ruby
[21:17:14] djbkd: has joined #ruby
[21:17:19] macsteps: has joined #ruby
[21:17:37] marr: has joined #ruby
[21:18:33] karapetyan: has joined #ruby
[21:18:58] ule: has joined #ruby
[21:22:02] djbkd: has joined #ruby
[21:23:18] eljimbo: has joined #ruby
[21:25:33] spudowiar: has joined #ruby
[21:26:25] seventy: has joined #ruby
[21:27:26] mikecmpbll: has joined #ruby
[21:28:46] dunpeal: drbrain: [1, 1, 1].reduce(:==) #=> false
[21:29:37] jhass: dunpeal: true == 1 is false
[21:32:05] seventy: has joined #ruby
[21:34:07] SilverKey: has joined #ruby
[21:34:26] shevy: but what about true == 42
[21:38:36] dunpeal: jhass: yeah, drbrain suggested this as a way to check if all elements in an array are unique: arr.reduce(:==).reduce(:&)
[21:38:57] jhass: eh, yeah, that doesn't work
[21:39:08] futilegames: has joined #ruby
[21:40:22] yfeldblum: has joined #ruby
[21:41:01] jhass: .uniq.size == 1 or .each_cons(2).all? {|a, b| a == b }
[21:41:57] babblebre: has joined #ruby
[21:42:13] neanderslob: has joined #ruby
[21:42:38] kareeoleez: has joined #ruby
[21:43:02] yoongkang: has joined #ruby
[21:44:26] drbrain: dunpeal: oops, my followup seems better, though
[21:44:33] drbrain: each_cons(2).with_index …
[21:46:28] arup_r: has joined #ruby
[21:46:30] ddffg: has joined #ruby
[21:46:37] arup_r: has left #ruby: ()
[21:47:11] hadyen: has joined #ruby
[21:47:44] whathappens: has joined #ruby
[21:48:29] hadyen: Hello - I'm writing a simple script to go through a directory (and all subfolders) and modifying files. If I want a progress bar for this, what's the best method for doing so? Not sure how to quickly get a count of all files without traversing everything first
[21:49:08] jhass: you can't
[21:49:39] jhass: you need to list and descend into all directories to get a count
[21:50:05] hipertracker: has joined #ruby
[21:50:06] twinklerock: `find . -type f | wc -l`
[21:50:35] jhass: doubt that'll be significantly faster than doing it in Ruby
[21:50:38] drbrain: even rsync does it that way
[21:51:31] isberg: has joined #ruby
[21:52:16] hadyen: I'm not really a CS guy and don't know anything about algorithms, is there any special way I should traverse directories for maximum speed? Or is glob as fast as it gets?
[21:52:35] drbrain: require 'find'; Find.find
[21:53:02] jhass: glob does have some overhead, since it fnmatch'es each entry
[21:53:05] drbrain: CS people use libraries first
[21:53:23] drbrain: (source: I'm a CS person)
[21:53:25] hadyen: drbrain: what library would you recommend?
[21:53:32] drbrain: hadyen: Find from stdlib ↑
[21:53:41] cd-rum: has joined #ruby
[21:53:54] hadyen: oh okay, thanks, didn't realize that was a library. Pretty new to Ruby
[21:55:19] whathappens: has joined #ruby
[21:55:30] jgrevich: has joined #ruby
[21:56:20] cd-rum: has joined #ruby
[21:58:02] yfeldblum: has joined #ruby
[21:59:15] edwinvdgraaf: has joined #ruby
[22:06:18] cd-rum: has joined #ruby
[22:06:36] pawnbox: has joined #ruby
[22:07:17] LoneHermit: has joined #ruby
[22:09:09] blackmesa: has joined #ruby
[22:11:46] BaconOverflow: has joined #ruby
[22:12:08] jenrzzz: has joined #ruby
[22:12:09] jenrzzz: has joined #ruby
[22:16:55] hadyen: Can memfs be used with Test::Unit? It's readme only mentions using with rspec
[22:18:07] Avinty-L: has joined #ruby
[22:18:12] braderhart: has joined #ruby
[22:18:35] _djbkd: has joined #ruby
[22:18:47] strass: has left #ruby: ("Leaving")
[22:19:05] daffy_duck_3: has joined #ruby
[22:19:21] Avinty-L_: has joined #ruby
[22:19:31] nando293921: has joined #ruby
[22:20:18] jaguarmagenta: has joined #ruby
[22:21:27] renderful: has joined #ruby
[22:22:12] marr123: has joined #ruby
[22:25:45] raja: has joined #ruby
[22:25:53] djbkd: has joined #ruby
[22:26:22] Sashimi: has joined #ruby
[22:26:51] nankyokusei: has joined #ruby
[22:27:36] drbrain: oh, https://github.com/simonc/memfs
[22:27:44] dunpeal: has joined #ruby
[22:27:46] drbrain: I don't see why not
[22:27:56] drbrain: put setup stuff in the setup method and teardown stuff in the teardown method
[22:28:22] jenrzzz: has joined #ruby
[22:30:23] raja: has left #ruby: ()
[22:32:08] RajSahae: has joined #ruby
[22:32:53] djbkd: has joined #ruby
[22:34:05] jaguarmagenta: has joined #ruby
[22:34:16] djbkd: has joined #ruby
[22:36:48] Dreamer3: has joined #ruby
[22:38:46] GodFather: has joined #ruby
[22:43:39] JeanCarl1Machado: has joined #ruby
[22:43:47] swills: has joined #ruby
[22:46:29] neanderslob: has joined #ruby
[22:46:56] A124: has joined #ruby
[22:48:32] raja: has joined #ruby
[22:49:13] raja: has left #ruby: ()
[22:49:20] raja: has joined #ruby
[22:50:33] raja: has left #ruby: ()
[22:50:54] raja: has joined #ruby
[22:51:19] djbkd: has joined #ruby
[22:52:27] wald0: has joined #ruby
[22:54:26] isberg: has joined #ruby
[22:56:11] pandaant: has joined #ruby
[22:56:23] isberg: has joined #ruby
[23:04:03] A124: has joined #ruby
[23:04:12] GnuYawk: has joined #ruby
[23:04:18] nerium: has joined #ruby
[23:05:36] statelesscode: has joined #ruby
[23:05:50] douglascorrea: has joined #ruby
[23:08:19] solars: has joined #ruby
[23:08:43] jenrzzz: has joined #ruby
[23:08:54] jenrzzz: has joined #ruby
[23:09:08] Nawn: has joined #ruby
[23:09:38] neanderslob: has joined #ruby
[23:09:52] djbkd: has joined #ruby
[23:13:18] djbkd: has joined #ruby
[23:13:27] yfeldblum: has joined #ruby
[23:20:21] ramfjord: has joined #ruby
[23:21:49] whathapp_: has joined #ruby
[23:22:48] whathapp_: has joined #ruby
[23:23:43] whathapp_: has joined #ruby
[23:24:02] jhack: has joined #ruby
[23:24:06] abhinavmehta: has joined #ruby
[23:24:25] JeanCarloMachado: has joined #ruby
[23:26:17] rickmasta: has joined #ruby
[23:30:53] jenrzzz: has joined #ruby
[23:30:53] jenrzzz: has joined #ruby
[23:33:24] cliluw: has joined #ruby
[23:33:49] devbug: has joined #ruby
[23:36:06] smathy: has joined #ruby
[23:37:08] douglascorrea: has joined #ruby
[23:37:20] skweek: has joined #ruby
[23:37:24] Asher: has joined #ruby
[23:37:57] wrkrcoop: has joined #ruby
[23:38:04] wrkrcoop: how do i add something to my path?
[23:39:14] elomatreb: wrkrcoop: In Ruby or in your shell?
[23:39:38] wrkrcoop: in my shizell
[23:39:57] elomatreb: Unix (Linux/OS X) or Windows?
[23:40:32] wrkrcoop: i opened up my ~/.bash_profile
[23:41:10] elomatreb: basically like this: PATH=$PATH:"/some/path"
[23:41:12] wrkrcoop: i’ve got export PATH= but then i dont understand what comes next
[23:41:18] wrkrcoop: then i just put the path to my file?
[23:41:34] elomatreb: PATH is just a long list of directories in which the shell looks for commands
[23:41:41] wrkrcoop: so export PATH=$PATH:”/Users/martee/Documents/scala-2.11.8/bin”
[23:41:41] elomatreb: Separated by colons
[23:41:47] wrkrcoop: what is $PATH?
[23:42:01] elomatreb: $PATH is the value of the PATH variable in that context
[23:42:10] elomatreb: Try echo $PATH
[23:42:50] wrkrcoop: what does export do
[23:43:06] wrkrcoop: yesss it worked
[23:43:50] ramfjord: has joined #ruby
[23:43:53] elomatreb: exported variables get passed to child processes iirc
[23:45:24] jhack: has joined #ruby
[23:49:10] Devalo: has joined #ruby
[23:50:03] killerkamel: has joined #ruby
[23:52:13] KnownSyntax: has joined #ruby
[23:52:13] KnownSyntax: has joined #ruby
[23:52:15] wrkrcoop: im trying to set an environment variable: export $SCALA_HOME=/usr/local/share/scala
[23:52:29] koooge: has joined #ruby
[23:52:48] wrkrcoop: it says ‘export: `=/usr/local/share/scala': not a valid identifier'
[23:54:51] chosen1: has joined #ruby
[23:55:25] raja: wrkrcoop: don't put the dollar sign ($) in frost of SCALA_HOME when you do the export
[23:55:48] raja: it should just be `export SCALA_HOME=/usr/local/share/scala`
[23:55:52] weaksauce: has joined #ruby
[23:56:29] Uranio: has joined #ruby
[23:56:33] xall: has joined #ruby
[23:57:59] nfsnobody: has joined #ruby
[23:59:43] xpitr: has joined #ruby