« Back to channel list

#ruby - 31 March 2017

« Back 1 day Forward 1 day »
[00:04:36] nOwz: has joined #ruby
[00:10:01] Channel6: has joined #ruby
[00:11:10] patarr: has joined #ruby
[00:12:36] gdonald: has joined #ruby
[00:16:27] __Yiota: has joined #ruby
[00:19:42] dlitvak: has joined #ruby
[00:21:28] mim1k: has joined #ruby
[00:21:29] Disavowed: Afternoon all. What is the idiomatic way to have optional arguments in Ruby? In Python my function signature would look like this: def test(a, b, c=None) - is the Ruby equivalent the way to go or is there a neater way?
[00:21:34] meshsmith: has joined #ruby
[00:25:16] nofxxxx: Disavowed, same.... but I guess None is nil
[00:25:23] nofxxxx: dunno python
[00:25:28] RenatoSilva: has left #ruby: ("http://renatosilva.net")
[00:26:10] rakm: has joined #ruby
[00:26:47] nofxxxx: Disavowed, there's also this way -> https://robots.thoughtbot.com/ruby-2-keyword-arguments
[00:27:22] agent_white: has joined #ruby
[00:27:38] Disavowed: This is exactly what I've been googling for! Don't know how I didn't hit upon it. Thank you so much
[00:27:48] patarr: has joined #ruby
[00:28:21] nofxxxx: Disavowed, some call 'named parameters', first time I've seen 'keyword arguments' I believe hehe
[00:29:53] Disavowed: keyword arguments seems more familiar to me but maybe whoever wrote this also came from a Python background
[00:30:57] Disavowed: (optional named arguments would be this in Python: `def test (a, b, **kwargs):` but kwargs is just a convention.
[00:34:19] nofxxxx: Disavowed, in ruby -> def test(a, b, *opts) or def test(a, b, opts = {})
[00:34:27] nofxxxx: opts also convention
[00:34:54] acrux09: has joined #ruby
[00:35:10] Disavowed: Oh neat - I wouldn't have known that were it not for you. Thank you.
[00:35:11] nofxxxx: believe ** and * same... we call it 'splat'
[00:35:19] Disavowed: Same I think :)
[00:35:33] nofxxxx: cool, no prob
[00:35:38] bocaneri: has joined #ruby
[00:36:21] cow[baby]: has joined #ruby
[00:36:28] Disavowed: I think I might take influence from your IRC handle and break out a little NOFX to get me through the rest of my Friday afternoon... it's been a while!
[00:37:25] adam12: Jeez. Haven't heard that name in a while
[00:37:51] Disavowed: Oh I have another remedial question: how can I ensure at least one value in a list is truthy? Like Python's any() builtin
[00:37:57] Disavowed: adam12: Same
[00:38:17] adam12: Disavowed: I'm having flashbacks to IRC circa 98/99?
[00:38:30] nofxxxx: hehe download mIRC for that
[00:38:42] nofxxxx: Disavowed, foo.any?
[00:38:57] nofxxxx: know the interrogation thing right? always returns bool Disavowed
[00:39:09] nofxxxx: so if you're looking for bool, you're looking for a question hehe
[00:39:10] Disavowed: nofxxxx: that was so obvious - I can't believe I didn't think of it
[00:39:15] CloCkWeRX: has joined #ruby
[00:39:32] nofxxxx: Disavowed, ops..wait, I always confuse if it's a rails thing... if it doesn't work you need to: !foo.empty?
[00:39:35] Disavowed: interogration thing is anything suffixed with a '?' ?
[00:39:56] adam12: any? is a thing
[00:40:00] adam12: but you might need an arg for it?
[00:40:09] nofxxxx: Disavowed, but I believe it's been added to ruby in 2.3 or 2.4 Disavowed
[00:40:21] adam12: >> [false, false].any?
[00:40:22] ruby[bot]: adam12: # => false (https://eval.in/764931)
[00:40:30] nofxxxx: adaedra, nope, it's just empty? negation
[00:40:31] adam12: Guess not.
[00:40:39] Disavowed: adam12: I didn't discover IRC until about 6 years ago so I can't reminisce with you there I'm afraid. I did listen to it on my own around that time though!
[00:40:43] nofxxxx: actually very handy for readability
[00:40:58] nofxxxx: !foo.empty? looks like ill written spanish
[00:41:01] Disavowed: nofxxxx: you're a saint. Thank you. That behaves exactly as I expected it
[00:41:06] TPug: has joined #ruby
[00:41:38] adam12: Disavowed: I was in a HUGE irc channel back in the mid-late 90s for the area I lived in. It was impressive to see 1000's of people chatting, over dialup mostly, in the afternoons/evenings. I bet I met (IRL) a few hundred people over the time I spent on IRC.
[00:41:39] Disavowed: From an English guy who doesn't know much about Spanish, it absolutely does!
[00:41:40] Nicmavr: has joined #ruby
[00:41:47] Roa: has joined #ruby
[00:41:55] Disavowed: adam12: See, that's the internet I miss
[00:42:02] adam12: Disavowed: Anyways, I think NOFX was a thing back then, and someone had a nick to that regard.
[00:42:42] Disavowed: adam12: I'm with you. It ties in well. I think NOFX are still going as a band!
[00:42:51] adam12: Had no idea.
[00:43:10] adam12: Thew me back just seeing it mentioned - like I was running BitchX on Slackware.
[00:43:29] nofxxxx: adam12, also, you make contact with ppl different than you.. that's a win win, social networks insanely tries to "match" friends for you
[00:43:29] adam12: Anyways, probably more suitable for ruby-offtopic :P
[00:44:03] patarr: has joined #ruby
[00:45:32] Disavowed: The thing I like about this channel is that it's much more accomodating of these particular slides. This would never fly in Python.
[00:46:02] Papierkorb: adam12, Disavowed, y'all welcome in #ruby-offtopic no one's even hangman-ing in there right now!
[00:46:16] Disavowed: Papierkorb: I'm lurking!
[00:46:28] Disavowed: It's much quieter than python-offtopic
[00:47:38] LuckyABA: has joined #ruby
[00:49:06] duckpupp1: has joined #ruby
[00:50:49] Verity: has joined #ruby
[00:51:04] milardovich: has joined #ruby
[00:52:49] Rodya_: has joined #ruby
[00:52:54] Verity: refers to packet more than self, maybe move it to a class? what is this reek error all abhout
[00:54:37] matthewd: Verity: It's accusing your method of feature envy
[00:55:13] Disavowed: Could anyone point me in the direction of the smart way of handling hashes in rspec? I am mutating unintentionally.
[00:55:50] Disavowed: Oh is it let binding?
[00:56:55] benlieb: has joined #ruby
[00:57:00] patarr: has joined #ruby
[01:02:56] patarr: has joined #ruby
[01:04:56] alibby: has joined #ruby
[01:07:23] postmodern: has joined #ruby
[01:08:06] davorb: has joined #ruby
[01:13:29] bkxd: has joined #ruby
[01:15:45] patarr: has joined #ruby
[01:16:37] juggler: has joined #ruby
[01:23:30] Verity: matthewd, I dont know what that is
[01:23:34] Verity: should I be moving to a class now?
[01:23:37] Verity: I'm still loving ruby, btw
[01:23:48] Verity: even if its made this assignment more difficult in the short term
[01:26:03] hndk: has joined #ruby
[01:27:06] agent_white: Disavowed: How are you mutating them?
[01:27:32] Verity: !showcode
[01:27:35] agent_white: !helloweneedthecode
[01:27:45] allisio: !allyourcodearebelongtous
[01:28:41] agent_white: !iswearithoughtyousaidtacos
[01:29:09] agent_white: Disavowed: Srsly doe. Feed us.
[01:31:01] Verity: https://gist.github.com/anonymous/43c9dd2255ce594dab4e5a1e682c5439
[01:31:02] Verity: have at it
[01:31:11] Verity: I'd love to know how I could improve
[01:31:34] Verity: forget the fact that sendpacket doesnt actually SEND them correctly yet, it does print them though
[01:33:29] harfangk: has joined #ruby
[01:34:42] JeanCarloMachado: has joined #ruby
[01:35:30] adam12: I'd say you definitely have at least a Packet class, and probably some sort of Packet collection
[01:36:11] patarr: has joined #ruby
[01:36:38] matthewd: I'd start with the packet-building duplication in build_packet_array
[01:39:06] agent_white: Hehe line 84. I like how it looks
[01:40:34] houhoulis: has joined #ruby
[01:42:27] agent_white: Verity: 63 just for debugging? Wonder why you didn't nest.
[01:43:16] agent_white: I like your code doe. Nice and neat. Like fresh shower neat.
[01:44:19] Verity: let me go over the suggestions
[01:44:30] JeanCarloMachado: has joined #ruby
[01:46:11] DTZUZO: has joined #ruby
[01:55:41] Rodya_: has joined #ruby
[01:56:27] patarr: has joined #ruby
[01:57:20] JeanCarloMachado: has joined #ruby
[01:59:13] Vile`: has joined #ruby
[01:59:38] d^sh: has joined #ruby
[02:05:26] nOwz: has joined #ruby
[02:05:41] retozon: has joined #ruby
[02:06:09] ozcanesen: has joined #ruby
[02:07:38] libastral: has joined #ruby
[02:11:10] edgr: has joined #ruby
[02:11:17] znz_jp: has joined #ruby
[02:11:27] havenwood: retozon: hi
[02:11:35] Jameser: has joined #ruby
[02:12:49] JeanCarloMachado: has joined #ruby
[02:16:04] _aeris_: has joined #ruby
[02:18:25] astrobunny: has joined #ruby
[02:21:24] bmurt: has joined #ruby
[02:21:56] mim1k: has joined #ruby
[02:26:52] Rodya_: has joined #ruby
[02:28:21] gnufied: has joined #ruby
[02:33:17] JeanCarloMachado: has joined #ruby
[02:33:45] Verity: there is a differentce though, matthewd
[02:34:30] jeyraof^mbpr: has joined #ruby
[02:36:58] matthewd: I see the difference in the padding, if that's what you mean.. but that just sounds wrong to me
[02:38:20] Verity: its for the case where the last packet has a message the full size
[02:38:41] JeanCarloMachado: has joined #ruby
[02:38:50] Verity: then eot cant fit, so a final packet must be crafted consisting of SOHEOTPADPADPADPADCRC
[02:39:11] skweek: has joined #ruby
[02:41:19] gnufied: has joined #ruby
[02:43:36] matthewd: Verity: I know what it's doing, and I know what I said.. can you clarify what you heard?
[02:44:05] JeanCarloMachado: has joined #ruby
[02:45:14] CloCkWeRX: has joined #ruby
[02:49:48] duckpupp1: has joined #ruby
[02:52:15] JeanCarloMachado: has joined #ruby
[02:54:14] JoshS: has joined #ruby
[02:57:31] knight33: has joined #ruby
[02:58:25] allisio: Verity: May I offer a potentially brutal piece of constructive criticism?
[02:58:49] charliesome: has joined #ruby
[02:59:17] bkxd: has joined #ruby
[02:59:28] Verity: allisio, sure
[03:00:14] allisio: Verity: Line 84 strikes me as plainly indicative of the fact that you simply don't pay close enough attention to what you're doing while programming. That's going to be a continual source of frustration and disappointment for you if you don't nip it in the bud.
[03:01:41] Verity: I'll consider that
[03:02:01] allisio: Thank you.
[03:09:40] __Yiota: has joined #ruby
[03:09:49] gigetoo: has joined #ruby
[03:13:06] gix: has joined #ruby
[03:22:33] m1911: has joined #ruby
[03:27:54] akkad: has joined #ruby
[03:31:48] charliesome: has joined #ruby
[03:39:30] Joufflu: has joined #ruby
[03:39:32] shad0: has joined #ruby
[03:39:49] shad0: anybody got much experience mixing bundler with docker?
[03:46:52] claw: has joined #ruby
[03:49:45] TPug: has joined #ruby
[03:53:36] agent_white: has joined #ruby
[03:55:25] retozon: what everone doing this evening
[03:56:58] retozon: i have this app idea I have been working on... just not sure where to put it.... I am certified in ruby but unsure of how to put it in layout format
[03:57:50] retozon: also been working with python i am so confused right now
[04:01:50] raspado: has joined #ruby
[04:02:46] Rodya_: has joined #ruby
[04:04:52] charliesome: has joined #ruby
[04:05:11] xall: has joined #ruby
[04:06:18] nOwz: has joined #ruby
[04:13:27] djbkd: has joined #ruby
[04:13:59] _djbkd: has joined #ruby
[04:21:52] milardovich: has joined #ruby
[04:22:27] mim1k: has joined #ruby
[04:24:02] herbmillerjr: has joined #ruby
[04:25:27] benlieb: has joined #ruby
[04:30:05] bkxd: has joined #ruby
[04:34:44] meinside: has joined #ruby
[04:36:59] renchan: has joined #ruby
[04:50:35] duckpupp1: has joined #ruby
[04:52:42] SeepingN: has joined #ruby
[04:52:50] Arpanet69: has joined #ruby
[04:59:11] username1: has joined #ruby
[05:03:29] charliesome: has joined #ruby
[05:04:53] Rodya_: has joined #ruby
[05:08:14] bungoman: has joined #ruby
[05:08:41] davorb: has joined #ruby
[05:11:04] Pumukel: has joined #ruby
[05:11:23] Maven: has joined #ruby
[05:14:02] JoshS: has joined #ruby
[05:33:14] benlieb: has joined #ruby
[05:33:49] djbkd: has joined #ruby
[05:35:18] milardovich: has joined #ruby
[05:41:31] aufi: has joined #ruby
[05:48:27] meshsmith: has joined #ruby
[05:50:29] dionysus69: has joined #ruby
[05:52:52] rhyselsmore: has joined #ruby
[05:58:19] meshsmith_: has joined #ruby
[06:05:36] jusa: has joined #ruby
[06:05:41] Rodya_: has joined #ruby
[06:07:10] nOwz: has joined #ruby
[06:08:01] charliesome: has joined #ruby
[06:22:52] mim1k: has joined #ruby
[06:22:53] aganov: has joined #ruby
[06:26:25] cfec0b8d: has joined #ruby
[06:26:57] patarr: has joined #ruby
[06:30:49] bkxd: has joined #ruby
[06:32:55] jenrzzz: has joined #ruby
[06:33:49] andikr: has joined #ruby
[06:35:29] conta: has joined #ruby
[06:42:32] last_staff: has joined #ruby
[06:48:33] muelleme_: has joined #ruby
[06:49:04] nOwz: has joined #ruby
[06:49:46] PaulCapestany: has joined #ruby
[06:49:56] djbkd: has joined #ruby
[06:51:39] duckpupp1: has joined #ruby
[06:52:54] SeepingN: has joined #ruby
[06:54:42] fmartingr: has joined #ruby
[07:04:13] bkxd: has joined #ruby
[07:06:19] kegster: has joined #ruby
[07:08:50] Yzguy: has joined #ruby
[07:10:23] grillon: has joined #ruby
[07:10:35] jgnagy: has joined #ruby
[07:11:29] bkxd: has joined #ruby
[07:12:50] ensyde: has joined #ruby
[07:13:22] mazeinmaze_: has joined #ruby
[07:19:16] AnoHito_: has joined #ruby
[07:20:52] maattdd: has joined #ruby
[07:21:33] jaequery: has joined #ruby
[07:22:03] mim1k: has joined #ruby
[07:22:21] grh: has joined #ruby
[07:24:06] nOwz: has joined #ruby
[07:24:44] snickers: has joined #ruby
[07:26:39] weualo: has joined #ruby
[07:32:43] enterprisey: has joined #ruby
[07:33:07] jusa: has joined #ruby
[07:36:13] charliesome: has joined #ruby
[07:37:06] djbkd: has joined #ruby
[07:38:31] maattdd_: has joined #ruby
[07:39:34] uncertainty: has joined #ruby
[07:40:06] rhyselsmore: has joined #ruby
[07:43:25] Arpanet69: has joined #ruby
[07:45:04] chuff: has joined #ruby
[07:51:45] AnoHito: has joined #ruby
[07:54:23] kernelPaniq: has joined #ruby
[07:56:34] aglorei1: has joined #ruby
[08:02:35] uncertainty: has joined #ruby
[08:03:30] raspado: has joined #ruby
[08:05:39] hurricanehrndz: has joined #ruby
[08:07:06] Rodya_: has joined #ruby
[08:11:22] astrobunny: has joined #ruby
[08:12:01] kevinfagan: has joined #ruby
[08:12:14] mim1k: has joined #ruby
[08:17:26] dysfigured: has joined #ruby
[08:18:47] dysfigured: has joined #ruby
[08:21:11] ByronJohnson: has joined #ruby
[08:22:58] vondruch: has joined #ruby
[08:23:21] tvw: has joined #ruby
[08:27:45] patarr: has joined #ruby
[08:29:52] marr: has joined #ruby
[08:31:56] mikecmpbll: has joined #ruby
[08:33:07] nofxxx: has joined #ruby
[08:40:47] flying: has joined #ruby
[08:45:08] esObe_: has joined #ruby
[08:47:12] ddffg: has joined #ruby
[08:49:13] Jameser`: has joined #ruby
[08:52:25] duckpupp1: has joined #ruby
[08:53:11] lxsameer: has joined #ruby
[08:53:29] Silthias1: has joined #ruby
[08:57:34] djbkd: has joined #ruby
[08:57:42] AnoHito: has joined #ruby
[09:01:02] pwnd_nsfw`: has joined #ruby
[09:01:21] nOwz: has joined #ruby
[09:02:19] dhollin3: has joined #ruby
[09:04:10] jaruga: has joined #ruby
[09:05:47] spicerack: has joined #ruby
[09:06:03] Beams: has joined #ruby
[09:08:15] davorb: has joined #ruby
[09:09:09] GreySunshine: has joined #ruby
[09:11:05] mim1k: has joined #ruby
[09:11:19] jgnagy: has joined #ruby
[09:14:13] maattdd: has joined #ruby
[09:15:21] maloik: has joined #ruby
[09:15:58] bkxd: has joined #ruby
[09:20:03] rgtk: has joined #ruby
[09:23:22] biberu: has joined #ruby
[09:25:15] jenrzzz: has joined #ruby
[09:29:34] nOwz: has joined #ruby
[09:30:59] bkxd: has joined #ruby
[09:34:18] jusa: has joined #ruby
[09:35:19] workmad3: has joined #ruby
[09:39:17] vuoto: has joined #ruby
[09:39:31] DARPA: has joined #ruby
[09:45:49] Silthias: has joined #ruby
[09:45:57] bkxd: has joined #ruby
[09:47:25] cfec0b8d: has joined #ruby
[09:48:03] Arpanet69: has joined #ruby
[09:50:40] Terens: I have a template for a file (erb)
[09:50:43] Terens: where should I store it?
[09:51:22] gdonald: has joined #ruby
[09:59:26] Jameser: has joined #ruby
[10:00:20] pandaant: has joined #ruby
[10:00:59] bkxd: has joined #ruby
[10:06:44] jamesaxl: has joined #ruby
[10:08:43] Rodya_: has joined #ruby
[10:08:45] xall_: has joined #ruby
[10:09:26] bkxd: has joined #ruby
[10:10:24] ddffg: in memory
[10:15:56] bkxd: has joined #ruby
[10:18:33] chuff: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[10:27:56] ferr1: has joined #ruby
[10:28:38] patarr: has joined #ruby
[10:28:39] gnufied: has joined #ruby
[10:30:59] bkxd: has joined #ruby
[10:37:42] vali: has joined #ruby
[10:45:56] bkxd: has joined #ruby
[10:46:23] jusa: has joined #ruby
[10:47:12] vali: has joined #ruby
[10:51:55] darix: terens: /usr/share/yourscript/
[10:52:03] darix: if you want to install it systemwide
[10:52:11] Terens: no within app
[10:53:06] duckpupp1: has joined #ruby
[10:54:40] tvw: has joined #ruby
[10:59:24] djbkd: has joined #ruby
[11:01:04] bkxd: has joined #ruby
[11:07:13] HoierM: has joined #ruby
[11:07:29] xall: has joined #ruby
[11:07:54] bkxd: has joined #ruby
[11:08:38] burgestrand: has joined #ruby
[11:08:52] davorb: has joined #ruby
[11:09:17] KnownSyntax: has joined #ruby
[11:09:17] KnownSyntax: has joined #ruby
[11:09:25] Rodya_: has joined #ruby
[11:09:36] ssinghi: has joined #ruby
[11:11:24] j3ll3: has joined #ruby
[11:12:07] jgnagy: has joined #ruby
[11:12:45] j3ll3: has left #ruby: ("WeeChat 1.7")
[11:12:48] TomyWork: has joined #ruby
[11:13:57] username1: has joined #ruby
[11:18:49] TomyWork: i want to write a little script that keeps track of when /tmp files are created or deleted. in order to query that from within another script, i need a lightweight (local?) key-value storage, preferably one that i dont need to install. I can only think of sqlite, but is there a more fitting choice maybe?
[11:18:53] TomyWork: only has to work with ruby
[11:19:55] darix: TomyWork: sqlite seems fine... but you can also just store it in memory.
[11:20:00] darix: TomyWork: and use inotify
[11:20:16] darix: (or similar things one other platforms)
[11:21:08] darix: e.g. https://github.com/thibaudgg/rb-fsevent#readme on osx
[11:22:38] adaedra: There may be a generic gem that wraps different method to have a cross-platform solution
[11:24:03] mim1k: has joined #ruby
[11:24:25] duckpupp1: has joined #ruby
[11:26:37] darix: adaedra: ... rb-fsevent would be a good name for it ...
[11:26:50] darix: but sadly there doesnt seems to be the generic wrapper module yet
[11:28:42] adaedra: You mean like https://github.com/guard/listen ?
[11:31:24] kke: i have a thing with a kind of interactive console thing that goes like "while buf = Readline.readline(..) { run_command(buf) }" .. now i'm thinking that it needs to work with input like "((command1 || command2) && command3) && command4; command5". i'm guessing my best choice is to split(';'), regex replace the commands with "run_command('${command}')" and eval the whole thing
[11:32:14] adaedra: are you trying to write a shell?
[11:32:25] kke: kind of
[11:32:28] Lord_of_Life: has joined #ruby
[11:32:39] adaedra: I suggest you write a real parser for your commands then
[11:32:50] adaedra: eval()ing user-provided data is not a good idea
[11:32:58] kke: that's what i'm thinking too
[11:33:32] adaedra: and regexp'ing what you wrote above looks like a nightmare
[11:33:35] t-recx: has joined #ruby
[11:33:38] kke: but if i escape it, i don't see how you could "break out"
[11:33:44] kke: yes it does
[11:35:36] darix: kke: you will find a lot of fun with different quoting things and such
[11:36:06] TomyWork: darix yes my plan was to use inotify. but you know what, i figured out that what i want to implement is essentially already done by the FS in the mtime field :)
[11:36:24] nowhere_man: has joined #ruby
[11:36:44] kke: i think i only need to escape any single quotes
[11:37:24] kke: the run_command thing itself doesn't do anything dangerous
[11:37:39] kke: so as long as the user input remains inside that, it should be safe
[11:38:05] ldnunes: has joined #ruby
[11:43:34] darix: kke: if you call your commands via a shell
[11:43:56] darix: then i can have fun with $() or `` or \
[11:44:51] darix: kke: https://github.com/thoughtbot/cocaine
[11:45:29] Pumukel: has joined #ruby
[11:45:57] JeanCarloMachado: has joined #ruby
[11:47:54] kke: my commands are internal to the app and don't shell out
[11:48:59] kke: it splits the input by whitespace, finds a command using first word, and does command.new(args).run
[11:54:35] SimpleIRC_VLBcT: has joined #ruby
[11:56:11] TomyWork: kke you may not shell out, but if you eval my user input, i will shell out for you :)
[12:04:58] raspado: has joined #ruby
[12:08:03] kke: maybe, but i'm curious to see how
[12:08:26] kke: > x = "hello"; x.gsub!(/['\\]/) { |match| "\\#{match}" }; eval("puts '#{x}'")
[12:08:34] kke: >> x = "hello"; x.gsub!(/['\\]/) { |match| "\\#{match}" }; eval("puts '#{x}'")
[12:09:35] mim1k: has joined #ruby
[12:09:48] kke: anyways, can you escape the puts?
[12:10:18] Rodya_: has joined #ruby
[12:10:47] kke: >> %w(1 2 3).join("..")
[12:10:58] kke: ruby[bot]: why you no work
[12:11:17] kke: >> p %w(1 2 3).join("..")
[12:12:14] matthewd: If you're just turning it into a static string, what's the point of the eval?
[12:12:44] Pumukel: has joined #ruby
[12:13:31] Pumukel: has joined #ruby
[12:22:44] kke: thinking about turning something like "(foo || bar) && baz" into eval("(perform('foo') || perform('bar')) && perform('baz')")
[12:23:15] kke: unless you can come up with a way to break out of the '..'
[12:27:18] esObe_: has joined #ruby
[12:28:03] Pumukel: has joined #ruby
[12:29:30] patarr: has joined #ruby
[12:30:35] loechel: has joined #ruby
[12:32:38] Pumukel: has joined #ruby
[12:33:30] charliesome: has joined #ruby
[12:34:08] vondruch: has joined #ruby
[12:39:01] vuoto: has joined #ruby
[12:39:37] charliesome: has joined #ruby
[12:41:41] ikopico: Hey peep-chaps, can someone suggest which is preffered, $stderr/STDERR ($stdout/STDOUT)?
[12:43:37] kke: ikopico: $
[12:43:37] Verity: allisio, I don't see the issue with line 84 unless you just mean the fact thats its rather poor checking of proper usage
[12:44:02] ikopico: Thanks kke, can you please explain why?
[12:44:03] Verity: as in, I only check if the proper # of args have been entered, but nothing beyond that
[12:45:31] Verity: matthewd, are you suggesting that I rewrite that function such that it takes two variables
[12:45:37] kke: ikopico: $ you can change. for example in tests or something you might want to do something like output = StringIO.new; $stdout = output; run_command(); $stdout.rewind; expect($stdout.read).to match(/foofoo/)
[12:45:52] Verity: one the packet list to return, and another to either build a data packet or final eot packet
[12:45:53] ytti: $stderr/STDERR is tricky one
[12:45:58] ikopico: Awesome kke, thanks a lot.
[12:46:00] ytti: on principle i hate all global variables
[12:46:01] matthewd: ikopico: Kernel#puts, #warn, etc use $stdout/$stderr
[12:46:10] Verity: then I just run my eot sent test using global var and call the func with true or false for 2nd arg
[12:46:13] ytti: but then again, you can change $stderr
[12:46:20] Verity: but that doesnts eem much better, maybe if it were inside a class and had state
[12:46:21] ytti: but i'm s till gonna go with STDERR and STDOUT
[12:46:43] ytti: i don't think ruby code should have single global variable in them
[12:47:04] Verity: and finally, adam12 could you give me a couple tips about how I might structure such a class? I'm not quite sure how to tell when I need a class, and how to structure and use one when i do
[12:47:09] ikopico: ytti: yes, but you can say also that having STDERR as const it's unnatural
[12:47:34] matthewd: Verity: I think you want a function that takes a <= 5 character string and returns a built packet
[12:47:43] ikopico: matthewd: thanks
[12:47:43] matthewd: Verity: You're doing that twice at the moment.
[12:47:44] canton7: ytti, the normal approach (irrc) is to use the globals, since you can e.g. fiddle them for testing, and the constants are to be used as "backups" to reset the globals
[12:47:48] kke: $stderr and $stdout are going to point to STDERR and STDOUT unless something deliberately wants to redirect ouput.
[12:48:08] kke: in that case, i suppose it's annoying that your thing didn't respect $stdout/err but insisted on using the real STDOUT/ERR
[12:48:24] ytti: i disagree
[12:48:36] ytti: if i want code where i intend err/out to be changable
[12:48:47] ytti: i'll create my own outputter, which can be instansiated with arbitrary outputs
[12:48:51] arquebus: has joined #ruby
[12:48:57] CloCkWeRX: has joined #ruby
[12:49:03] ytti: if i strictly mean STDOUT/STDERR, i'll use those
[12:49:13] ytti: $stderr, $stdout are ambiguous
[12:49:19] ytti: does the developer mean strictly those
[12:49:31] ytti: or just use them as well known, pre-assigned variables?
[12:49:39] ikopico: ytti: I think that it's more of changable for testing, not for usage
[12:49:40] ytti: but of course this is higly opinionated stuff
[12:50:03] matthewd: ytti: How are the constants truly different from the globals for that? Someone could equally change those.
[12:50:33] ytti: it's just style issue, no one expects STDOUT/STDERR to be changed
[12:50:42] ytti: the code communicates by haivng those 'these are static'
[12:50:46] ytti: which may or may not be true
[12:50:52] ytti: but that is the implicit promise
[12:50:54] CGibsonmm: has joined #ruby
[12:51:27] kke: do you expect $stdout/$stderr to contain something that is not intentional?
[12:51:54] synthroid: has joined #ruby
[12:52:13] kke: since the kernel methods use those too, if you're messing with $stdout/err you will break kernel stuff too.
[12:52:32] noem: has joined #ruby
[12:52:52] ytti: i don't know what developer means when they use those
[12:52:59] ytti: did they choose them, because they fully intend to change them
[12:53:09] ytti: or did they choose then, but fully intend to use them verbatim
[12:57:03] jrafanie: has joined #ruby
[13:01:06] x0F: has joined #ruby
[13:01:58] ikopico: Can we settle on IO.new(1)/IO.new(2)? :)
[13:02:42] knight33: has joined #ruby
[13:02:49] cow[baby]: has joined #ruby
[13:06:13] zapata: has joined #ruby
[13:10:13] cats: has joined #ruby
[13:11:12] CloCkWeRX: has joined #ruby
[13:13:25] Bozo: has joined #ruby
[13:13:32] mim1k: has joined #ruby
[13:14:37] patarr: has joined #ruby
[13:16:49] aupadhye: has joined #ruby
[13:22:19] Verity: I'll think this over
[13:23:04] Verity: I think the most important suggestion of all is that its likely time for a class
[13:23:13] Verity: migrating to that without breaking my program will be the key
[13:23:26] Verity: I've never designed or used my own classes, only others
[13:23:39] Verity: well, once or twice a while back in C++
[13:23:47] Verity: I did make a linked list class
[13:24:34] Verity: so I want to create a class that represents a serial connection? and contains the packet array and functions that operate on it?
[13:24:44] Verity: and the constructor will open the serial port
[13:24:51] Verity: and take the com port as arg
[13:25:37] canton7: constructors shouldn't normally do things that make take a long time or randomly fail
[13:25:47] canton7: you'd normally see an 'open' method to open the port
[13:28:14] Verity: hmm, ok. Lots to consider here
[13:28:40] s2013: has joined #ruby
[13:29:08] jrafanie: has joined #ruby
[13:32:15] bmurt: has joined #ruby
[13:33:12] gnufied: has joined #ruby
[13:33:21] yurikoles: has joined #ruby
[13:35:26] banisterfiend: has joined #ruby
[13:39:07] jrafanie: has joined #ruby
[13:39:14] aupadhye: has joined #ruby
[13:41:12] harfangk: has joined #ruby
[13:41:46] deviation: has joined #ruby
[13:42:52] Verity: I also need to consider that this will be changed to TCP from serial later
[13:43:09] Verity: it would be nice if through classes that was an easy switch (thats one of the main points of the lab)
[13:43:59] millerti: has joined #ruby
[13:44:47] uncertainty: has joined #ruby
[13:45:19] Verity: so in C++//C# we would have made a base class port with abstract methods and then derived two new classes from it, serialport and tcpport class
[13:45:46] Verity: then I would set them up so they take the same args, connection string to determine type of conn. then methods the same like read and write
[13:45:59] Verity: but in ruby, I read you wouldn't do it the same way
[13:46:04] s2013: has joined #ruby
[13:46:25] Verity: the goal being a universal interface between the two classes
[13:46:29] Verity: so they are interchangeable
[13:46:36] Verity: at least this is my understanding of it all
[13:48:00] Verity: I'm going to work on ASM lab for a while, back later hopefully someone has some advice for me
[13:48:21] enterprisey: has joined #ruby
[13:48:37] fuzzyhorns: has joined #ruby
[13:51:01] sepp2k: has joined #ruby
[13:52:14] __Yiota: has joined #ruby
[13:53:16] Jameser: has joined #ruby
[14:07:04] spicerack: has joined #ruby
[14:11:31] manveru: Verity: there's no reason why you wouldn't do it the same in ruby
[14:11:38] Rodya_: has joined #ruby
[14:11:53] manveru: for example see the IO family...
[14:12:10] planigan: has joined #ruby
[14:14:43] Rodya_: has joined #ruby
[14:21:09] Bish: has joined #ruby
[14:21:20] Bish: im writing the best ruby app there ever is / will be
[14:21:24] Bish: how does it log?
[14:21:38] borodin: has joined #ruby
[14:24:15] jaruga: has joined #ruby
[14:24:56] CGibsonmm: has joined #ruby
[14:27:12] manveru: Bish: you could try to use Logger
[14:27:51] Bish: well, okay, i will be more specific
[14:27:53] flying: has joined #ruby
[14:28:08] Bish: im writing an application, running in docker, on many machines, many instances
[14:28:17] Bish: which has no logging as of yet
[14:28:35] Bish: i was about to send myself udp packets and store them somewhere, to which i thought
[14:28:42] Bish: "i should do this correctly"
[14:28:49] Bish: ah, and i use a lot of aws
[14:29:05] Bish: so.. what can i do there.. i want it to be centralized somehow
[14:29:13] arthurl: has joined #ruby
[14:29:59] manveru: there are services for that, like papertrailapp
[14:30:20] x0F: has joined #ruby
[14:30:31] manveru: i used logentries.com in the past as well
[14:30:44] Bish: hm, is there something i don't need to pay money for ;;
[14:30:57] patarr: has joined #ruby
[14:31:17] Bish: what do i actually log, i don't have experience in that
[14:31:19] manveru: there are probably a few hundred results if you google for "docker log aggregation" :)
[14:31:25] Bish: erorrs only, all data between client<=>server
[14:31:41] bmurt: has joined #ruby
[14:31:41] Bish: manveru: exactly, should i print to stdout and collect them in docker
[14:31:45] Bish: should i send packets somewhere!?
[14:31:51] Bish: is there a gem!?
[14:31:53] Bish: why is this shit so hard
[14:32:53] enterprisey: has joined #ruby
[14:32:56] manveru: well, try https://www.fluentd.org/ then
[14:33:52] manveru: i'd just log everything... until you run out of space, then you can become more selective using filters in fluentd
[14:34:11] Bish: my servers speaks fluent'd
[14:34:17] Bish: eh.ehhe..
[14:34:39] Bish: sigh that looks like something that will eat my time
[14:34:49] manveru: https://docs.docker.com/engine/admin/logging/overview/#fluentd
[14:35:20] manveru: you could also try remote syslog... but that might be a bit more complex
[14:35:37] Bish: manveru: well i already did that.. a docker container i used did that by default
[14:35:42] manveru: oh look, there's awslogs driver
[14:35:47] Bish: sending udp packets to another docker.. which then wrote them to a file
[14:35:51] Bish: WHATS THAT
[14:35:56] manveru: https://docs.docker.com/engine/admin/logging/overview/#awslogs
[14:36:08] manveru: no idea, but it sounds like logs for aws
[14:36:09] Bish: THAT SOUNDS LIKE NO WORK
[14:36:33] Bish: AWS CloudWatch logs for Humans™
[14:36:41] Bish: haha, that fitting name
[14:37:08] Bish: so workflow would be: print to stdout, let amazon log everything, until the bill gets too high
[14:37:11] manveru: "AWS Free Tier includes 10 Metrics, 10 Alarms, and 1,000,000 API requests with Amazon CloudWatch."
[14:37:37] ResidentBiscuit: has joined #ruby
[14:37:40] manveru: should be enough to get started and locked in a bit more to AWS ;)
[14:37:45] Bish: well, would i be able to select a type of log that way?
[14:38:06] Bish: my logs would be tied to the docker container.. which could throw all sorts of errors
[14:38:20] Bish: i imagine logging to be like [auth] user tried to login
[14:38:33] Bish: [hw] my core is at 10%
[14:38:48] manveru: usually you can filter those lines
[14:38:55] Bish: ah.. so i do the filtering on the lines
[14:38:57] Bish: yeah that'd be clever.
[14:39:09] manveru: then set alerts for things like "Segfault"
[14:39:09] Bish: okay cool thanks alot manveru
[14:39:19] Bish: ruby doesn't segfault right
[14:39:26] Rodya_: has joined #ruby
[14:39:35] Bish: it's like macbooks
[14:39:36] Bish: they dont break
[14:39:41] manveru: exactly :D
[14:39:54] Bish: how do you know im sarcastic :D i've heard people saying that
[14:40:14] manveru: well, i've seen enough broken ones
[14:40:26] manveru: the case though, that probably won't break
[14:40:27] Bish: when i was studying it, there was a tv channel visiting my uni (where i worked)
[14:40:33] Bish: and a guy, that had windows on his macbook
[14:40:48] Bish: the cameraman asked him "why do you have windows on your macbook"
[14:41:21] Bish: $itdude "my macbook just reset itself, due to a hardware issue, yadda yadda, not using osx since then"
[14:41:36] Bish: cameraman "no, thats your fault, you must've done something wrong, macbooks dont break"
[14:41:59] Bish: he said to the guy, nearly finished with his phd in cs
[14:43:59] manveru: well, about ruby, it'll of course segfault sometimes, especially if you use gems with C extensions
[14:44:35] Tau: has joined #ruby
[14:46:46] tvw: has joined #ruby
[14:52:18] mim1k: has joined #ruby
[14:52:40] GreySunshine: has left #ruby: ()
[14:55:11] Bish: i think i saw one segfault in ruby
[14:55:15] Bish: and many in rubinius
[14:55:27] haylon_: has joined #ruby
[14:57:19] mim1k: has joined #ruby
[14:57:58] jrafanie: has joined #ruby
[15:00:51] DLSteve: has joined #ruby
[15:03:07] armando: has joined #ruby
[15:06:29] itsdaflash: has joined #ruby
[15:06:45] Mon_Ouie: has joined #ruby
[15:08:34] davorb: has joined #ruby
[15:10:11] benlieb: has joined #ruby
[15:10:15] jeanlinux: has joined #ruby
[15:11:14] xall: has joined #ruby
[15:11:22] enterprisey: has joined #ruby
[15:13:08] itsdaflash: Hi, I was curious if anyone may be able to offer some insight. I am trying to complete two things. I'd like to search an array called rmq_federation_nodes which contains the following elements ["rabbitmq1.devops.local", "rabbitmq2.devops.local", "rabbitmq3.devops.local"] and grab out an element matching the first part of the regex pattern (as the environment in this case devops could change).
[15:13:08] itsdaflash: Example, the element matching rabbit1, I assign to a variable rabbit1, and rabbit2, to variable rabbit2...etc. Second, id like to pull out the element matching that same regex pattern and convert it to a string and assign to a separate variable. I completed the below:
[15:13:08] itsdaflash: nodeA = rmq_federation_nodes.select {|a| a.match(/^rabbitmq1/)}
[15:13:08] itsdaflash: nodeB = rmq_federation_nodes.select {|a| a.match(/^rabbitmq2/)}
[15:13:08] itsdaflash: nodeC = rmq_federation_nodes.select {|a| a.match(/^rabbitmq3/)}
[15:13:09] itsdaflash: rabbitmq1.arxdevops.local
[15:13:10] itsdaflash: rabbitmq2.arxdevops.local
[15:13:10] itsdaflash: rabbitmq3.arxdevops.local
[15:13:11] itsdaflash: The above gives me the string, from what I can tell, but is there a way to get select the actual element also?
[15:13:40] jgnagy: has joined #ruby
[15:13:58] Lord_of_Life: has joined #ruby
[15:15:11] renchan: has joined #ruby
[15:15:23] Mon_Ouie: What do you mean by "the actual element"?
[15:15:32] Bish: i think he wants the match, too, maybe?
[15:15:49] Mon_Ouie: Also, please use gist when pasting three lines of code or more
[15:16:10] renchan: has joined #ruby
[15:16:25] itsdaflash: Sorry, by element I just mean that I would like to obtain ["rabbitmq1.arxdevops.local"] if it matches rabbitmq1*
[15:16:53] Mon_Ouie: That's what select is returning here
[15:16:56] Bish: but you get the elements that match in an array
[15:16:58] itsdaflash: ideally, i'd like one to remain a single element array and the other a string
[15:17:25] Bish: well, it's not given that only one string matches your rule, and all of those are strings
[15:17:29] Mon_Ouie: >> ["rabbitmq1.stuf", "rabbitmq2.stuff"].select { |x| x.match(/^rabbitmq1/) }
[15:17:30] Bish: so what do you mean by saying element
[15:17:30] ruby[bot]: Mon_Ouie: # => ["rabbitmq1.stuf"] (https://eval.in/765570)
[15:18:07] Bish: >> ["there","is","find","also"].find { |x| x =~ /^a/ }
[15:18:18] Bish: >> ["there","is","find","also"].find { |x| x =~ /^a/ }
[15:18:19] ruby[bot]: Bish: # => "also" (https://eval.in/765572)
[15:18:50] LuckyABA: has joined #ruby
[15:18:54] Bish: but find is actually returning the first it finds, it doesn't make sure there is only one
[15:19:00] itsdaflash: sorry, maybe I am confusing element. I just mean i'd like to search the array and find a match for rabbit1*, if it matches then id like to store that attribute. I'd then also like to complete the same search but strip the [" "] part and store as a string
[15:19:41] grh: has joined #ruby
[15:19:42] Bish: store? where, what is an attribute :D
[15:19:56] jusa: has joined #ruby
[15:20:02] Bish: and what [" "] part
[15:21:09] itsdaflash: My array being rmq_federation_nodes = ["rabbitmq1.arxdevops.local", "rabbitmq2.arxdevops.local", "rabbitmq3.arxdevops.local"]. Pull out this from the array ["rabbitmq1.arxdevops.local"] based on a regex match and store as a single element array, then also search the same array and store as rabbitmq1.arxdevops.local
[15:21:32] s2013: has joined #ruby
[15:21:36] Bish: >My array being rmq_federation_nodes = ["rabbitmq1.arxdevops.local", "rabbitmq2.arxdevops.local", "rabbitmq3.arxdevops.local"]. Pull out this from
[15:21:39] Bish: the array ["rabbitmq1.arxdevops.local"] based on a regex match and store as a single element array
[15:21:42] Bish: thats what your code does already
[15:21:53] Bish: the second part of that question i still dont get
[15:21:59] Bish: store as "rabbitmq1.arxdevops.local"
[15:22:37] polishdub: has joined #ruby
[15:22:40] Mon_Ouie: You can just use #first to get the first/only element of the array
[15:23:49] itsdaflash: Yeah, I was pulling it out as rmq_federation_nodes[0], but in chef sometimes not all the nodes will registered, so I was having an issue where the position could change, even with a sort
[15:24:12] itsdaflash: So, I was recoding it to instead search the array for the fqdn
[15:24:28] jrafanie: has joined #ruby
[15:25:02] itsdaflash: and assign that as a variable for later use in my recipe. Problem is, my recipe needs that fqdn as an actual attribute in one section to determine what to actually apply and in another it requires it as a string
[15:30:31] antgel: has joined #ruby
[15:31:49] grillon: has joined #ruby
[15:33:01] jrafanie: has joined #ruby
[15:34:50] gdonald: has joined #ruby
[15:36:11] vcavallo: has joined #ruby
[15:37:13] snickers: has joined #ruby
[15:40:07] DLSteve: has joined #ruby
[15:41:13] ResidentBiscuit: has joined #ruby
[15:42:07] enterprisey: has joined #ruby
[15:42:30] deviation: has joined #ruby
[15:43:10] jrafanie: has joined #ruby
[15:43:28] Lord_of_Life: has joined #ruby
[15:43:52] loveablelobster: has joined #ruby
[15:45:30] [Butch]: has joined #ruby
[15:46:19] bmurt: has joined #ruby
[15:47:34] rakm: has joined #ruby
[15:47:56] ozcanesen: has joined #ruby
[15:51:34] djbkd: has joined #ruby
[15:52:28] vuoto: has joined #ruby
[15:53:10] synbit: has joined #ruby
[15:53:43] vuoto: has joined #ruby
[15:54:43] destructure: has joined #ruby
[15:55:10] username1: has joined #ruby
[15:56:06] igeaod: has joined #ruby
[15:58:19] visudo: has joined #ruby
[15:59:25] CGibsonmm: has joined #ruby
[16:00:08] amclain: has joined #ruby
[16:05:07] adam12: Anybody have a preferred option parser outside of `OptionParser` in stdlib? Something that can change the options depending on ARGV[0] (or equiv)
[16:05:59] nadir: has joined #ruby
[16:06:23] adam12: (git style subcommands)
[16:06:40] raspado: has joined #ruby
[16:07:28] grh: has joined #ruby
[16:07:36] manveru: adam12: i think people usually use thor for that
[16:08:13] CGibsonmm: has joined #ruby
[16:08:48] adam12: You might be right - I don't care for Thor tho. I just want to parse ARGV. I think Thor wants me to structure commands a lot differently.
[16:09:05] adam12: Maybe trollop?
[16:09:28] skweek: has joined #ruby
[16:09:44] adam12: or commander? Lots of options I guess.
[16:09:56] armyriad: has joined #ruby
[16:11:52] rwb: has joined #ruby
[16:12:07] bmurt: has joined #ruby
[16:13:42] enterprisey: has joined #ruby
[16:13:55] havenwood: adam12: Slop for simple options. Thor for more complex, git-like options.
[16:14:17] aryaching: has joined #ruby
[16:14:53] marcdel: has joined #ruby
[16:16:29] Yzguy: has joined #ruby
[16:18:17] adam12: I'll re-look at Thor - thanks for feedback.
[16:18:31] ruby[bot]: -b *!*@gateway/web/freenode/ip.216.114.94.31$#ruby-banned
[16:19:39] millerti: has joined #ruby
[16:23:52] gusrub: has joined #ruby
[16:24:58] xall: has joined #ruby
[16:25:24] CGibsonmm: has joined #ruby
[16:26:14] nitric: has joined #ruby
[16:27:45] mustmodify: has joined #ruby
[16:27:45] millerti: has joined #ruby
[16:28:11] muelleme_: has joined #ruby
[16:28:38] mustmodify: What method on hash gives you a hash with just the named keys? {a: 1, b: 2, c: 3}.some(:a, :b) => {a: 1, b: 2}
[16:30:01] A124: has joined #ruby
[16:35:22] d^sh: has joined #ruby
[16:38:35] millerti: has joined #ruby
[16:38:54] s2013: has joined #ruby
[16:39:32] thistle: has joined #ruby
[16:42:13] jgnagy: has joined #ruby
[16:42:40] Asher1: has joined #ruby
[16:44:57] A124: has joined #ruby
[16:45:47] swills: has joined #ruby
[16:46:23] Asher: has joined #ruby
[16:46:53] raspado: has joined #ruby
[16:48:39] shinnya: has joined #ruby
[16:49:00] x0F: has joined #ruby
[16:49:46] rippa: has joined #ruby
[16:52:33] jenrzzz: has joined #ruby
[16:53:05] montanonic: has joined #ruby
[16:54:05] houhoulis: has joined #ruby
[16:54:28] ruby-lang508: has joined #ruby
[16:57:38] jrafanie: has joined #ruby
[16:58:45] boombox_: has joined #ruby
[17:00:00] pwnd_nsfw: has joined #ruby
[17:03:18] benlieb: has joined #ruby
[17:04:38] jrafanie: has joined #ruby
[17:06:27] gusrub: has joined #ruby
[17:07:24] Fernando-Basso: has joined #ruby
[17:10:01] azwieg103: has joined #ruby
[17:12:04] Vile`: has joined #ruby
[17:13:59] cow[baby]: has joined #ruby
[17:15:08] djbkd: has joined #ruby
[17:16:08] nowhere_man: has joined #ruby
[17:17:56] ltem: has joined #ruby
[17:18:56] ltem: has joined #ruby
[17:19:34] jud: has joined #ruby
[17:20:54] ltem: has joined #ruby
[17:21:08] nowhere_man: has joined #ruby
[17:22:32] rakm: has joined #ruby
[17:23:55] rakm_: has joined #ruby
[17:27:58] nowhere_man: has joined #ruby
[17:29:38] whathappens: has joined #ruby
[17:34:22] A124: has joined #ruby
[17:35:37] Vile`: has joined #ruby
[17:36:31] s2013: has joined #ruby
[17:37:39] _sfiguser: has joined #ruby
[17:38:36] Fernando-Basso: has joined #ruby
[17:45:20] synthroid: has joined #ruby
[17:45:20] deviation: has joined #ruby
[17:48:16] Asher: has joined #ruby
[17:48:38] dionysus69: has joined #ruby
[17:50:03] duderonomy: has joined #ruby
[17:51:06] jrafanie: has joined #ruby
[17:54:57] kirun: has joined #ruby
[17:59:25] enterprisey: has joined #ruby
[18:01:52] gusrub: has joined #ruby
[18:03:02] rgtk: has joined #ruby
[18:06:45] jenrzzz: has joined #ruby
[18:06:45] jenrzzz: has joined #ruby
[18:07:06] thistle: has joined #ruby
[18:07:27] duderono_: has joined #ruby
[18:10:32] gdonald: has joined #ruby
[18:11:03] gusrub: has joined #ruby
[18:11:40] MittelDank: has joined #ruby
[18:13:41] Vile`: has joined #ruby
[18:15:53] TomyLobo2: has joined #ruby
[18:16:48] jrafanie: has joined #ruby
[18:22:18] Ericx2x: has joined #ruby
[18:24:14] Violentr: has joined #ruby
[18:24:34] cfec0b8d: has joined #ruby
[18:27:47] AndBobsYourUncle: has joined #ruby
[18:29:52] SeepingN: has joined #ruby
[18:32:06] gusrub: has joined #ruby
[18:33:30] jusa: has joined #ruby
[18:35:44] pabelanger: has joined #ruby
[18:36:14] pabelanger: has left #ruby: ("WeeChat 1.6")
[18:36:47] jrafanie: has joined #ruby
[18:37:32] giraffe: has joined #ruby
[18:38:24] tpendragon: has joined #ruby
[18:39:39] yurikoles: has joined #ruby
[18:39:55] jrafanie: has joined #ruby
[18:43:42] gusrub: has joined #ruby
[18:43:44] Guest96: has joined #ruby
[18:45:08] x0F: has joined #ruby
[18:46:39] jrafanie: has joined #ruby
[18:46:56] migge: has joined #ruby
[18:47:11] mikecmpbll: has joined #ruby
[18:49:13] marr: has joined #ruby
[18:49:52] xall: has joined #ruby
[18:50:17] gusrub: has joined #ruby
[18:50:37] gusrub: has joined #ruby
[18:51:02] yurikoles: has joined #ruby
[19:01:46] Rodya_: has joined #ruby
[19:04:41] binaryplease: has joined #ruby
[19:04:49] ineb: has joined #ruby
[19:07:32] coredump: has joined #ruby
[19:08:10] thistle: has joined #ruby
[19:10:54] jackjackdripper: has joined #ruby
[19:13:33] grillon: has joined #ruby
[19:19:08] jrafanie: has joined #ruby
[19:24:45] xall: has joined #ruby
[19:24:46] chichou: has joined #ruby
[19:29:44] binaryplease: has joined #ruby
[19:30:42] Tharbakim: has joined #ruby
[19:30:43] Tharbakim: has joined #ruby
[19:33:04] d5sx43: has joined #ruby
[19:41:38] yqt: has joined #ruby
[19:42:43] ozcanesen: has joined #ruby
[19:46:10] deviation: has joined #ruby
[19:49:50] DTZUZO: has joined #ruby
[19:57:48] username1: has joined #ruby
[20:00:57] chichou: has joined #ruby
[20:08:44] futilegames: has joined #ruby
[20:09:01] Guest96_: has joined #ruby
[20:09:12] thistle: has joined #ruby
[20:09:55] futilegames: has left #ruby: ()
[20:10:03] kirun: has joined #ruby
[20:11:03] rakm: has joined #ruby
[20:12:31] spicerack: has joined #ruby
[20:13:48] cava: has joined #ruby
[20:15:03] Yzguy: has joined #ruby
[20:15:45] hahuang61: has joined #ruby
[20:19:59] chichou: has joined #ruby
[20:24:06] tolerablyjake: has joined #ruby
[20:25:07] govg: has joined #ruby
[20:30:36] Yzguy: has joined #ruby
[20:31:10] pupsicle: has joined #ruby
[20:33:14] gdonald: has joined #ruby
[20:35:14] thistle: has joined #ruby
[20:35:26] Verity: if anyone responded my scrollback doesnt go far enough
[20:35:30] Verity: !give verity log
[20:35:54] Vadi: has joined #ruby
[20:36:12] Vadi: I don't know Ruby and I'm having real difficulty with one script. Does open(url).read from 'open-uri' cache the response?
[20:36:33] Vadi: I'm looking at the json it is fetching vs json in chrome and ruby is getting the wrong json somehow. I have verified the URLs.
[20:38:10] gloscombe_: has joined #ruby
[20:38:53] elomatreb: Verity: Channel log is linked in the topic
[20:39:15] KevinMGranger: How are you confirming that? And where does the json come from?
[20:39:25] elomatreb: Vadi: I don't think open-uri caches, but I don't think it will follow redirects
[20:39:27] KevinMGranger: Could they be changing the response based on user-agent?
[20:39:40] olivier__: has joined #ruby
[20:39:55] benlieb: has joined #ruby
[20:39:59] Vadi: json is https://api.launchpad.net/1.0/mudlet?ws.op=searchTasks
[20:40:28] Vadi: and I'm just looking at the total_size key and it keeps coming out wrong in Ruby
[20:40:46] Vadi: it will randomly change to be the right value (and that's how I confirm it's the right data) but I have not found a pattern as to when
[20:41:07] Vadi: At this point I am attempting to just stuff the json response as-is into ruby instead of having it download
[20:41:22] KevinMGranger: Hmm, it comes out differently when I curl it versus in the browser. You should try setting your user-agent or simply say it's their fault and not yours :P
[20:41:35] Vadi: Yeah I need it for a migration script
[20:41:38] benlieb: has joined #ruby
[20:42:13] elomatreb: If it's like KevinMGranger describes there's little you can do about it, besides setting your useragent to something resembling a desktop browser
[20:42:25] elomatreb: And I don't know if open-uri supports that
[20:43:05] Verity: allisio, never replied, what is wrong with line 84 other than being a poor test of proper input args
[20:43:40] Vadi: I'll just a random param at the end. That seemed to work on the first try
[20:44:15] pupsicle: has joined #ruby
[20:47:21] pifon: has joined #ruby
[20:57:36] _sfiguser: guys if i want to do a text editor... and want to implement the "undo" operation... should i use the memento pattern ?
[21:05:01] Verity: _sfiguser, you doing code audits
[21:05:50] jusa: has joined #ruby
[21:08:11] DTZUZO: has joined #ruby
[21:08:56] rwb: has joined #ruby
[21:09:34] JoshS: has joined #ruby
[21:10:08] JoshS: has joined #ruby
[21:11:03] JoshS: has joined #ruby
[21:12:12] zipace: has joined #ruby
[21:13:57] olivier__: has joined #ruby
[21:14:46] tvw: has joined #ruby
[21:16:01] mim1k: has joined #ruby
[21:19:25] Papierkorb: _sfiguser: That's a complex name for a stack structure ;) but yes, that's basically what I'd do too
[21:21:22] rgtk: has joined #ruby
[21:22:14] itsdaflash: has left #ruby: ()
[21:30:44] chichou: has joined #ruby
[21:34:02] Emmanuel_Chanel: has joined #ruby
[21:35:00] ozcanesen: has joined #ruby
[21:35:24] aglorei1: has joined #ruby
[21:39:15] Yzguy: has joined #ruby
[21:39:58] cdg: has joined #ruby
[21:40:14] lxsameer: has joined #ruby
[21:41:19] t-recx: has joined #ruby
[21:45:18] chichou: has joined #ruby
[21:46:52] deviation: has joined #ruby
[21:48:04] pilne: has joined #ruby
[21:48:56] thistle: has joined #ruby
[21:49:46] thistle: has joined #ruby
[21:49:56] adam12: Anybody using a service for private gems? (outside of geminabox)
[21:50:05] houhoulis: has joined #ruby
[21:51:58] Verity: I need to add a pure virtual method
[21:53:21] Verity: http://www.studytonight.com/cpp/abstract-class-and-pure-virtual.php
[21:54:41] adam12: def method; end
[21:54:59] lupine: has joined #ruby
[21:59:39] Xiti: has joined #ruby
[22:04:34] Verity: adam12, are you saying I won't need to do anything special for the method, like define outside of class or special keywords
[22:04:40] chouhoulis: has joined #ruby
[22:04:43] Verity: and then I will just be able to create derived class + use normally?
[22:04:48] Verity: (this is all new to me, even in c++)
[22:04:53] adam12: I'm not sure to be honest with you. I'm not a C++ developer.
[22:05:22] adam12: The description said a method with no definition - that seemed close enough.
[22:06:29] elomatreb: You can still instantiate that class without a definition though, and the method will just silently return nil if called unless you put like a raise in it
[22:08:51] blackwind_123: has joined #ruby
[22:09:25] banisterfiend: has joined #ruby
[22:10:17] Azure: has joined #ruby
[22:11:25] claw: has joined #ruby
[22:12:32] jenrzzz: has joined #ruby
[22:12:33] jenrzzz: has joined #ruby
[22:25:26] mikecmpbll: has joined #ruby
[22:26:06] pytuger: has joined #ruby
[22:26:11] enterprisey: has joined #ruby
[22:26:25] FoX_77: has joined #ruby
[22:26:39] djbkd: has joined #ruby
[22:26:53] rgtk: has joined #ruby
[22:28:04] DTZUZO: has joined #ruby
[22:33:02] gusrub: has joined #ruby
[22:34:11] tfitts: has joined #ruby
[22:38:37] kith: has joined #ruby
[22:40:10] snappy_: has joined #ruby
[22:41:51] snappy_: Can anyone tell me why this method always returns the argument? Thanks! https://gist.github.com/anonymous/7d7e5f2e1290cef5b9f78f13f1ce1129
[22:42:26] adam12: snappy_: Ruby has an implicit return.
[22:42:45] adam12: >> puts "foo"
[22:42:46] ruby[bot]: adam12: # => foo ...check link for more (https://eval.in/765706)
[22:42:49] Rodya_: has joined #ruby
[22:42:58] adam12: and puts apparently returns the value passed to it.
[22:43:05] adam12: Which is the value you get back :)
[22:43:24] Verity: read ruby in 20 minutes =)
[22:43:26] Verity: it cover this
[22:43:44] snappy_: adam12: but the variable returned ought to be different than the argument, no?
[22:44:03] adam12: snappy_: Oh. You are re-using `n`
[22:44:09] adam12: snappy_: Is that what you're getting at?
[22:44:48] adam12: I'd stop shadowing local variables by your block variable
[22:45:15] Verity: ACTION goes to run the code
[22:46:23] snappy_: adam12: Here's what the method is supposed to do: flip a coin. heads = double the amount, tails = halve it. repeat 5000 iterations and return number.
[22:46:48] Verity: is the problem the algorithm itself
[22:47:18] adam12: snappy_: Maybe just leave the argument to the times block off? 5000.times do - do you need 1..5000?
[22:47:21] Verity: the n outside the 5000.times
[22:47:25] Verity: that n is different, isnt it?
[22:47:34] Verity: after the 5000 times loop ends isnt n just the original amount
[22:47:40] Verity: due to scope
[22:48:22] gbaptista: has joined #ruby
[22:48:35] Verity: one n is on line 2 and 10, the other is inside the loop
[22:48:36] Verity: thats my theory
[22:48:41] Verity: let me know if I'm wrong :)
[22:50:06] snappy_: Ah, okay. Removing n as a block argument fixed it.
[22:50:16] snappy_: It's not needed.
[22:51:15] gbaptista: has joined #ruby
[22:57:05] devp__: has joined #ruby
[22:57:26] devp__: anyone here
[22:57:29] havenwood: devp__: yes
[22:57:32] Verity: welcome to #ruby, devp__
[22:57:56] devp__: installed from ruby from source and comipiled successfully and run succesfully
[22:58:54] CGibsonmm: has joined #ruby
[22:59:09] devp__: then transferred comipiled coit to remote machine and but gem still pointing to ruby install of previous machine on which ruby is comipiled
[22:59:30] devp__: how to point gem to search ruby in new location
[23:00:46] devp__: giving some error like -bash /home/bs/.localpacks/bin/gem: /home/user/.localpacks/bin/ruby: bad interpreter: No such file or directory
[23:00:55] cyphase: has joined #ruby
[23:01:44] devp__: here you can see gem still finding ruby in /home/user, and ruby is now available in /home/bs
[23:02:22] devp__: so how to point gem to search ruby in /hom/bs/.localpacks/bin
[23:02:23] havenwood: devp__: You can build a gem with --env-shebang flag and the gem binary will use `#!/usr/bin/env ruby` instead of hardcoding the route.
[23:02:38] tercenya: has joined #ruby
[23:02:42] devp__: not root install
[23:03:38] havenwood: devp__: No matter how Ruby is installed, the gem bin files need to point to the Ruby interpreter. You can use --env-shebang so that it points to the current Ruby rather than hardcoding.
[23:03:41] devp__: "bs" user is on vps where ruby is not comipiling due to constratint resource
[23:04:01] kristofferR: has joined #ruby
[23:04:08] havenwood: devp__: you can also compile Ruby to be moveable (so it doesn't care about its own relative directory)
[23:04:10] Verity: snapp_'s problem was not knowing how to use ruby?
[23:04:25] SeepingN: ...whhhhhhy don't you just call the vps provider and ask them to install ruby
[23:04:35] Verity: isnt there a package for your distro?
[23:04:44] devp__: i do things on my own
[23:04:48] Verity: time for a new distro
[23:04:52] havenwood: devp__: You can also use `bundle package` to package the gems in the repo yourself.
[23:05:10] Verity: <devp__> i do things on my own
[23:05:14] Verity: then why are you in here asking for help =P
[23:05:27] devp__: the ruby guys
[23:05:40] havenwood: devp__: or you can build the gem yourself on the server, there are many options
[23:05:59] devp__: gem -env-shebang gives same error
[23:06:39] jusa: has joined #ruby
[23:06:40] devp__: giving some error like -bash /home/bs/.localpacks/bin/gem: /home/user/.localpacks/bin/ruby: bad interpreter: No such file or directory
[23:06:46] hahuang61: has joined #ruby
[23:07:12] devp__: just want to know gem config file location
[23:07:23] havenwood: devp__: Compare the output of: gem install bundler --env-shebang && head -n1 $(command -v bundle)
[23:07:29] havenwood: devp__: with: gem install bundler --no-env-shebang && head -n1 $(command -v bundle)
[23:07:33] devp__: i will manually change location there to point to new ruby location
[23:08:24] devp__: gem first checks for ruby installation
[23:08:46] devp__: since it just loking at old location, gem giving error
[23:08:51] havenwood: devp__: RubyGems itself? If you're moving the whole of Ruby you need a moveable build.
[23:08:51] devp__: same error
[23:09:33] devp__: ok try for yourself
[23:09:33] havenwood: CONFIGURE_OPTS=--enable-shared
[23:09:42] devp__: this is the script location
[23:09:44] devp__: https://gist.github.com/devprashant/8fe8499ed44804605911dcafc13ceea2
[23:09:54] devp__: make a new user
[23:09:59] devp__: then run script
[23:10:24] rgtk: has joined #ruby
[23:10:29] devp__: then tar cf .localpacks ruby-packs-bin.tar.gx
[23:10:35] havenwood: devp__: This looks like a ruby-install-esque script. You can configure with --enable-shared
[23:10:36] devp__: then tar cf .localpacks ruby-packs-bin.tar.gz
[23:11:03] devp__: its a script i created to install ruby from source
[23:11:12] Verity: you do it all yourself, I like that
[23:11:42] havenwood: devp__: I read the script. You still need to configure with --enable-shared if you want to move Ruby and gems with --env-shebang if you want their binaries to point at that moved Ruby.
[23:12:10] devp__: ok recomipling
[23:12:29] Verity: should the hard coded urls be variables for best practices? or no
[23:13:25] devp__: configured on fly
[23:13:37] devp__: or used from .bashrc
[23:14:00] nchambers: has joined #ruby
[23:15:30] username1: has joined #ruby
[23:16:26] mim1k: has joined #ruby
[23:23:56] nowhere_man: has joined #ruby
[23:29:04] meshsmith: has joined #ruby
[23:29:28] kristofferR: has joined #ruby
[23:31:57] spicerack: has joined #ruby
[23:33:23] jen_: has joined #ruby
[23:33:25] kristofferR: has joined #ruby
[23:33:29] jen_: has left #ruby: ()
[23:35:40] duderonomy: has joined #ruby
[23:37:04] cyphase: has joined #ruby
[23:38:30] devp__: @havenwood --enable-shared not working
[23:38:34] devp__: same error
[23:38:48] devp__: new error on remote "bs" machine
[23:38:59] devp__: ruby -v error
[23:39:47] devp__: ruby: error while loading shared libraries: libruby.so.2.4: cannot open shared object file: no such file or directory
[23:39:57] Verity: the file doesnt exist
[23:40:13] devp__: on compilation machine its working
[23:40:20] devp__: same location
[23:41:01] Verity: I'm not sure, thats just what that error was saying
[23:41:04] Verity: havenwood, is the one to talk to
[23:41:07] ovaltine: has joined #ruby
[23:41:21] devp__: ssh bs@70.32.24.249 -p 7822 pass: 123
[23:41:27] devp__: check for yourself
[23:44:23] QualityAddict: has joined #ruby
[23:45:19] SeepingN: malware deployed
[23:45:53] devp__: havenwood
[23:47:04] Verity: libruby isnt installed or cant be found, is my guess
[23:47:16] Verity: what is the result of sudo find / -name libruby.so.2.4
[23:47:30] devp__: no root allowed
[23:47:32] ecksit: has joined #ruby
[23:47:35] devp__: that whats happening
[23:47:43] deviation: has joined #ruby
[23:48:15] SeepingN: thus my suggestion
[23:48:27] SeepingN: when you don't have root, you can't always "do things yourself" properly
[23:52:34] devp__: only need to know where gem looks for its config file to search for ruby installation
[23:52:35] cyphase: has joined #ruby
[23:52:42] devp__: its not a Gemfile :)
[23:52:44] CGibsonmm: has joined #ruby
[23:52:54] leitz: has joined #ruby
[23:54:04] deviation: has joined #ruby
[23:54:51] devp__: how gem search for ruby installation directory??
[23:55:10] devp__: its not searches .bashrc by default
[23:55:30] devp__: location is hardcoded in file
[23:55:43] devp__: which is that file and where can it be located
[23:55:59] devp__: compiling ruby from source as non-root