« Back to channel list

#ruby - 11 August 2018

« Back 1 day Forward 1 day »
[00:05:36] thy0: has joined #ruby
[00:07:12] Creatornator: has joined #ruby
[00:22:51] Caerus: has joined #ruby
[00:44:56] Caerus: has joined #ruby
[00:46:37] cthu|: has joined #ruby
[01:02:53] herbmillerjr: has joined #ruby
[01:09:18] DarthGandalf: has joined #ruby
[01:14:06] vonfry: has joined #ruby
[01:20:51] arekushi: has joined #ruby
[01:26:23] Creatornator: has joined #ruby
[01:32:44] arescorpio: has joined #ruby
[01:42:54] bmurt: has joined #ruby
[02:02:43] duderonomy: has joined #ruby
[02:04:55] sauvin: has joined #ruby
[02:08:18] scientes: has joined #ruby
[02:08:28] scientes: how would i convert 76b8e0ada0f13d90405d6ae55386bd28bdd219b8a08ded1aa836efcc8b770dc7da41597c5157488d7724e03fb8d84a376a43b8f41518a11cc387b669b2ee6586 into 0xff, 0xff, 0xff ?
[02:11:33] Zarthus: as a string or a hex
[02:12:35] scientes: string, i've got it, i was just lazy
[02:13:53] Zarthus: because it's already hexadecimal you could .split(/../).map { |v| '0x'+v }
[02:14:09] scientes: .split(/../) thats what i was looking for
[02:15:39] scientes: doesn't work
[02:15:44] scientes: the split(/../)
[02:22:19] havenwood: scientes: '76b8e0ada0'.scan(/../) #=> ["76", "b8", "e0", "ad", "a0"]
[02:36:11] tty: has joined #ruby
[02:37:35] kapil___: has joined #ruby
[02:58:02] Emmanuel_Chanel: has joined #ruby
[03:00:31] cadillac_: has joined #ruby
[03:09:59] braincrash: has joined #ruby
[03:10:16] mroutis: has joined #ruby
[03:14:59] samort7: has joined #ruby
[03:18:38] samort7: How would I put a colon in a symbol? Is there a way to escape it, say, when making a hash?
[03:19:13] samort7: Like, this is invalid: attributes = { api:id: 'SKU',
[03:19:13] samort7: api:name: 'Item_Name' }
[03:20:30] mroutis: samort7, try something like :'api:name'
[03:20:36] havenwood: samort7: 'api:name': 'samort7'
[03:20:38] mroutis: >>puts :'api:name'
[03:20:39] ruby[bot]: mroutis: # => api:name ...check link for more (https://eval.in/1046641)
[03:20:45] samort7: ah, ok. Thanks!
[03:20:58] mroutis: >>puts { 'api:name': 'samort7' }
[03:20:59] ruby[bot]: mroutis: # => /tmp/execpad-3743ed528847/source-3743ed528847:2: syntax error, unexpected ':', expecting '}' ...check link for more (https://eval.in/1046642)
[03:21:14] havenwood: samort7: {'api:name': 'samort7'} #=> {:"api:name"=>"samort7"}
[03:21:38] havenwood: samort7: :"api:name".class #=> Symbol
[03:22:31] samort7: Ah neat. Why did mroutis' fail?
[03:22:44] mroutis: puts was trippin' with the hash
[03:22:58] mroutis: >> puts { a: 1 }
[03:22:59] ruby[bot]: mroutis: # => /tmp/execpad-dd7d5d519cfe/source-dd7d5d519cfe:2: syntax error, unexpected ':', expecting '}' ...check link for more (https://eval.in/1046643)
[03:23:05] samort7: oh. It doesn't like that I guess
[03:25:57] samort7: >> outer_hash = { x: [] }; inner_hash = { dog: 'bark'}; outer_hash['x'].push(inner_hash); puts outer_hash;
[03:25:58] ruby[bot]: samort7: # => undefined method `push' for nil:NilClass ...check link for more (https://eval.in/1046644)
[03:27:57] mroutis: what are you trying to achieve, samort7 ?
[03:28:18] mroutis: it's clear, sorry
[03:28:22] samort7: I'm trying to add inner_hash as an element of the array x inside outer_hash
[03:29:26] mroutis: samort7: you are naming the keys of your outer_hash with symbols, you should reference them as symbols, not strings
[03:29:38] mroutis: outer_hash[:x].push...
[03:29:54] samort7: ah dang, that makes sense
[03:29:57] samort7: Stupid mistake
[03:30:13] samort7: >> outer_hash = { x: [] }; inner_hash = { dog: 'bark'}; outer_hash[:x].push(inner_hash); puts outer_hash;
[03:30:14] ruby[bot]: samort7: # => {:x=>[{:dog=>"bark"}]} ...check link for more (https://eval.in/1046645)
[03:30:20] mroutis: no, is not, in Rails is pretty common to use HashWithIndiferenceAccess or something like that
[03:30:59] samort7: Ooh, good to know :) Thanks!
[03:31:21] mroutis: samort7: https://api.rubyonrails.org/classes/ActiveSupport/HashWithIndifferentAccess.html
[03:32:09] samort7: Haha, that's cool! I love that Ruby has so many "convenience" things!
[03:32:34] samort7: when I first learned you could call .first or .last on a hash, I was blown away haha
[03:33:30] mroutis: .values and .keys are useful too
[03:34:03] mroutis: and recently, the .transform_keys and .transform_values
[03:35:02] Nicmavr: has joined #ruby
[03:58:01] samort7: oh, thats awesome too!
[04:06:11] _whitelogger: has joined #ruby
[04:07:00] havenwood: 'oh, thats awesome too!'.each_char.group_by(&:itself).transform_values(&:size)
[04:07:09] havenwood: #=> {"o"=>4, "h"=>2, ","=>1, " "=>3, "t"=>3, "a"=>2, "s"=>2, "w"=>1, "e"=>2, "m"=>1, "!"=>1}
[04:20:45] mroutis: that could be an interview question, havenwood; "get the occurence of every character in a string"
[04:24:35] mojtaba: has joined #ruby
[04:43:15] nowhereman_: has joined #ruby
[04:50:06] reber: has joined #ruby
[04:53:38] cadillac_: has joined #ruby
[05:18:23] duderonomy: has joined #ruby
[05:20:08] Creatornator: has joined #ruby
[05:21:45] \void: has joined #ruby
[05:33:22] t0x: has joined #ruby
[05:36:32] alex``: has joined #ruby
[05:41:03] orbyt_: has joined #ruby
[05:45:00] quazimodo: has joined #ruby
[05:48:20] mojtaba: has joined #ruby
[06:14:45] camilasan: has joined #ruby
[06:17:00] ShekharReddy: has joined #ruby
[06:25:17] aniarya82: has joined #ruby
[06:27:17] tdy: has joined #ruby
[06:39:41] aniarya82: has joined #ruby
[06:39:44] DTZUZO: has joined #ruby
[06:43:52] pskosinski: has joined #ruby
[06:52:56] pskosinski: has joined #ruby
[07:00:57] j416: has joined #ruby
[07:13:24] argoneus: has joined #ruby
[07:26:11] za1b1tsu: has joined #ruby
[07:27:23] maryo: has joined #ruby
[07:27:53] maryo: Some pointers on this ruby exception would be helpful -> https://dpaste.de/G6tu
[07:31:37] havenwood: maryo: It looks like you have a String when a URI or something else that responds to #host is expected.
[07:31:49] havenwood: maryo: require 'uri'; URI("http://192.168.2.19:8080/").host #=> "192.168.2.19"
[07:32:27] havenwood: maryo: "http://192.168.2.19:8080/".host #!> NoMethodError: undefined method `host' for "http://192.168.2.19:8080/":String
[07:33:36] maryo: havenwood, here is the actual code https://dpaste.de/7cuO looks like it is in the expected format. Please correct me if I am wrong
[07:40:37] eckhardt_: has joined #ruby
[07:41:13] vondruch: has joined #ruby
[07:41:36] havenwood: maryo: In the code you're showing it appears you're defining JENKINS_URI last on line 33 correctly as a URI. It looks like twice above that you defined it as a String, but one of those is commented and the other should get stomped on. Sanity check with p-based debugging: p JENKINS_URI
[07:41:59] havenwood: maryo: (It's not good practice to redefine constants. They'll warn if you do.)
[07:44:58] maryo: havenwood, thank you for the pointers. I will check that o/
[07:53:20] Puffball: has joined #ruby
[08:01:36] psychicist__: has joined #ruby
[08:04:28] funnel: has joined #ruby
[08:05:22] maryo: has joined #ruby
[08:06:13] clemens3: has joined #ruby
[08:06:38] DTZUZO: has joined #ruby
[08:07:46] maryo: havenwood, I have tried adding the p-based debugging to see what value it holds and I got this https://dpaste.de/2P6z and here is how I have added p debugging https://dpaste.de/pFKL just wondering what went wrong. Some inputs from you would help.
[08:16:23] Radar: That's quite a lot of code.
[08:16:38] Radar: Can you create a MCVE? https://stackoverflow.com/help/mcve
[08:18:20] Radar: maryo: seems like you're trimming the port number off your URL too
[08:26:22] alex``: Is there a way to chain each in one imbrication?
[08:27:37] alex``: I have 3 imbrications
[08:28:59] alex``: client.lines.each(line) in line.queues.each(queue) in queue.agents.each.with_index(1)(agent, position)
[08:29:01] funnel: has joined #ruby
[08:29:16] alex``: Is there a way to condense in one imbrication
[08:29:34] maryo: Radar, sure
[08:29:39] lypsis: has joined #ruby
[08:29:47] alex``: giving (client, line, queue, agent, position)
[08:29:56] alex``: in one block
[08:30:02] alex``: instead of the 3 imbrications
[08:35:44] jackrandom: has joined #ruby
[08:40:47] funnel: has joined #ruby
[08:44:16] mn3m: has joined #ruby
[08:45:57] baweaver: alex``: imbrication?
[08:46:14] baweaver: What's an imbrication?
[08:46:22] alex``: client.lines.each do |line|
[08:46:31] alex``: line.queues.each do |queue|
[08:46:48] alex``: queue.agents.each.with_index(1) do |agent, position|
[08:47:00] alex``: I would like:
[08:47:25] alex``: {chaining} do |line, queue, agent, position|
[08:47:36] alex``: instead of the 3 imbrications
[08:47:57] baweaver: Where are you getting the word imbrication from?
[08:48:29] alex``: France XD
[08:48:42] baweaver: That was going to bug me all night otherwise.
[08:48:45] alex``: It’s not an english word as well?
[08:49:08] baweaver: Kind of. It's archaic verbiage for an overlapping edge, like a scale
[08:49:17] baweaver: but I've never heard it in relation to programming
[08:49:34] alex``: What the correct word
[08:49:57] baweaver: Nested? THat's a good question
[08:50:16] baweaver: Both "what's a better word" and "how the devil do I do this?"
[08:51:12] baweaver: My first inclination would be some form of Enumerator hack.
[08:51:20] alex``: Actually I would like this working functionnaly
[08:51:31] baweaver: because it'd essentially be a dive down into nested array-like structures.
[08:51:35] alex``: like giving queue.agents.map.with_index
[08:52:02] alex``: to return the list of agents with the context (line, queue, position)
[08:52:08] baweaver: Gimme a few minutes to write out a test case
[08:54:12] mn3m: has joined #ruby
[08:54:17] alex``: baweaver: Is is related to Enumarator?
[08:54:31] alex``: I would expect to work with any block
[08:54:45] alex``: client.lines.tap
[08:55:58] baweaver: The idea is to treat each depth traversal as a single flattened list
[08:56:02] baweaver: Writing it though...
[08:56:10] alex``: We have an initial object, and send to it a list of methods with blocks, accumulate the blocks arguments to the final call and returns value
[08:57:52] alex``: baweaver: Maybe there could be a hack with |(a,b,c)| ?
[08:58:24] baweaver: Y'know this isn't a trivial write in 20 seconds
[08:58:41] alex``: [[1,2,3],[4,5,6]].map { |(a,b,c)| a+b+c }
[09:02:07] dhollin3: has joined #ruby
[09:03:21] baweaver: >> agents = %w(bob jill sue sam); queue = proc { OpenStruct.new(agents: agents.sample(3)) }; line = proc { OpenStruct.new(queues: 3.times.map(&queue)) }; client = proc { OpenStruct.new(lines: 3.times.map(&line)) }; client.call
[09:03:22] ruby[bot]: baweaver: # => uninitialized constant OpenStruct ...check link for more (https://eval.in/1046660)
[09:03:25] baweaver: Sample data
[09:03:58] baweaver: >> require 'ostruct'; agents = %w(bob jill sue sam); queue = proc { OpenStruct.new(agents: agents.sample(3)) }; line = proc { OpenStruct.new(queues: 3.times.map(&queue)) }; client = proc { OpenStruct.new(lines: 3.times.map(&line)) }; client.call
[09:03:59] ruby[bot]: baweaver: # => #<OpenStruct lines=[#<OpenStruct queues=[#<OpenStruct agents=["sue", "bob", "sam"]>, #<OpenStruct ag ...check link for more (https://eval.in/1046661)
[09:04:26] baweaver: A client has 3 lines, which all have 3 queues, which all have 3 agents
[09:04:39] baweaver: Which I just named after people, because why not
[09:04:57] baweaver: Now that we have that we can test some fun
[09:05:00] baweaver: ACTION goes back to pry
[09:11:49] ruschlem: has joined #ruby
[09:14:14] ruschlem: has left #ruby: ()
[09:25:10] baweaver: >> agents=%w(bob jill sue sam);queue=proc{OpenStruct.new(agents:agents.sample(3))};line=proc{OpenStruct.new(queues:3.times.map(&queue))};client=proc{OpenStruct.new(lines:3.times.map(&line))};def dive(obj, *ps)ps.empty? ? obj:obj.public_send(ps[0]).flat_map{|v|dive(v, *ps[1..-1])}end;dive(client.call, :lines, :queues, :agents)
[09:25:11] ruby[bot]: baweaver: # => uninitialized constant OpenStruct ...check link for more (https://eval.in/1046678)
[09:25:20] baweaver: ...ok, I asked for that one
[09:25:30] baweaver: >> require 'ostruct';agents=%w(bob jill sue sam);queue=proc{OpenStruct.new(agents:agents.sample(3))};line=proc{OpenStruct.new(queues:3.times.map(&queue))};client=proc{OpenStruct.new(lines:3.times.map(&line))};def dive(obj, *ps)ps.empty? ? obj:obj.public_send(ps[0]).flat_map{|v|dive(v, *ps[1..-1])}end;dive(client.call, :lines, :queues, :agents)
[09:25:31] ruby[bot]: baweaver: # => ["jill", "sue", "bob", "jill", "sam", "bob", "jill", "sue", "bob", "bob", "sue", "jill", "bob", "sam ...check link for more (https://eval.in/1046679)
[09:26:13] kent\n: has joined #ruby
[09:27:35] sameerynho: has joined #ruby
[09:28:23] Inline: has joined #ruby
[09:29:38] baweaver: alex``: https://repl.it/repls/CompetitiveButteryProcesses
[09:30:19] baweaver: The idea is to keep digging until you hit the bottom of the "path" you want to follow. Once you do, those are the values you want to iterate on.
[09:33:14] Puffball: has joined #ruby
[09:34:26] tag: has joined #ruby
[09:37:09] vondruch: has joined #ruby
[09:38:06] agent_white: Happy Friday/Saturday/Weekend folks. G'night!
[09:38:08] agent_white: has left #ruby: ()
[09:38:29] baweaver: Drive by pleasantries! The fiend!
[09:48:02] vondruch: has joined #ruby
[09:51:04] nicesignal: has joined #ruby
[09:51:36] vondruch: has joined #ruby
[09:52:02] snuz: has joined #ruby
[09:57:16] j416: has left #ruby: ("o/")
[10:02:32] vondruch: has joined #ruby
[10:06:10] tristanp: has joined #ruby
[10:06:34] drale2k_: has joined #ruby
[10:07:46] DTZUZO: has joined #ruby
[10:23:36] cats: has joined #ruby
[10:28:00] AJA4350: has joined #ruby
[10:30:20] za1b1tsu: has joined #ruby
[10:34:06] gheegh: has joined #ruby
[10:36:36] mikecmpbll: has joined #ruby
[10:42:14] alex``: baweaver: Nice !!
[10:42:40] alex``: The intermidiate data could be preserved with a third argument no?
[10:42:57] alex``: def dive(object, paths, data = [object])
[10:47:39] za1b1tsu: has joined #ruby
[10:56:41] snuz: has joined #ruby
[11:00:16] funnel: has joined #ruby
[11:01:39] alex``: baweaver: Do you think the function is useful, or better to organize the code diffently to don’t need imbrication?
[11:02:35] alex``: I think `paths` could be renamed in `def-list` or something to handle arguments
[11:02:58] alex``: list = [:foo, :bar, :baz]
[11:03:35] alex``: list = [:foo, [:arg1, arg2], :bar, { x: 1, y: 2}, :baz]
[11:05:07] maryo: instead of port 8080, can someone tell why the following ruby code takes only port 80 please -> https://dpaste.de/2pN7
[11:08:17] thinkpad: has joined #ruby
[11:14:34] gheegh: has joined #ruby
[11:14:46] Dbugger: has joined #ruby
[11:17:43] ciro: has joined #ruby
[11:24:16] gheegh: has joined #ruby
[11:25:57] apeiros: maryo: because that's what you tell it to?
[11:26:14] apeiros: JENKINS_URI.to_s[0..21] # => "http://192.168.2.19:80"
[11:26:23] apeiros: JENKINS_URT.port # => 80
[11:26:58] apeiros: I have no idea why you do .to_s on a string, and i have no idea either why you perform that slicing there.
[11:32:16] ellcs: has joined #ruby
[11:32:35] minimal_life: has joined #ruby
[11:39:37] apeiros: maryo: got to go, others can certainly help you too :)
[11:51:42] gheegh: has joined #ruby
[11:54:48] FernandoBasso: has joined #ruby
[11:59:09] mikecmpbll: has joined #ruby
[12:01:54] aspiers: has joined #ruby
[12:03:59] mojtaba: has joined #ruby
[12:04:50] gix: has joined #ruby
[12:11:12] Inline: has joined #ruby
[12:11:59] Inline: has joined #ruby
[12:14:00] Inline: has joined #ruby
[12:17:41] Inline: has joined #ruby
[12:22:23] Inline: has joined #ruby
[12:23:19] mojtaba: has joined #ruby
[12:28:26] thinkpad: has joined #ruby
[12:45:52] maryo: has joined #ruby
[13:01:15] unshackled: has left #ruby: ("Leaving")
[13:07:28] funnel: has joined #ruby
[13:13:04] mikecmpbll: has joined #ruby
[13:13:49] thy0: has joined #ruby
[13:18:51] DLSteve: has joined #ruby
[13:30:53] aniarya82: has joined #ruby
[13:31:18] mojtaba: has joined #ruby
[13:34:49] savolla: has joined #ruby
[13:42:36] thinkpad: has joined #ruby
[13:42:50] Some-body_: has joined #ruby
[13:48:40] mojtaba: has joined #ruby
[13:53:14] alfiemax: has joined #ruby
[14:01:57] Emmanuel_Chanel: has joined #ruby
[14:08:17] bmurt: has joined #ruby
[14:10:12] alfiemax: has joined #ruby
[14:14:42] Nicmavr: has joined #ruby
[14:16:18] apeiros: has joined #ruby
[14:21:15] c_nick: has joined #ruby
[14:21:44] c_nick: Whenever I open my team city triggered runs to looks at the results, I want to provide a tab where I can see my Ruby-Sinatra web server.Ideally that should result in a Same Domain Error because team city tabs are i-frames, If I give a html page with a hyper link to the web server.How can I go about it
[14:27:52] Mike11: has joined #ruby
[14:27:59] Mike11: hello all
[14:28:13] Mike11: is there a more idiomatic way to write something like this: https://ideone.com/H7LNEM
[14:28:52] Mike11: I am concerned about having to store match_data in a separate variable and having to use it to access every match
[14:29:48] Mike11: I like how /\$(?<dollars>\d+)\.(?<cents>\d+)/ =~ '$3.67' stores local variables for each group
[14:30:19] Mike11: but I am not sure why if r =~ s then doesn't do that in my case...
[14:30:24] gheegh: has joined #ruby
[14:30:35] Mike11: do I need to use the regular expression literal here
[14:35:07] havenwood: Mike11: One trick is that when you have the regexp first, the named captures get automatically assigned to local variables.
[14:35:22] gheegh: has joined #ruby
[14:35:22] havenwood: >> /\$(?<dollars>\d+)\.(?<cents>\d+)/ =~ '$3.67'; dollars #=> "3"
[14:35:27] ruby[bot]: havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[14:35:55] mojtaba: has joined #ruby
[14:38:15] desperek: has joined #ruby
[14:38:16] Mike111: has joined #ruby
[14:38:44] Mike111: sorry, did I miss anything?
[14:39:22] Mike111: havenwood: https://ideone.com/H7LNEM doesn't seem to work
[14:40:06] havenwood: Mike11: Ah, I see what you're asking. Yeah, it's a janky syntax so I'd avoid it. Sec.
[14:40:31] Sembei: has joined #ruby
[14:42:05] havenwood: Mike111: You might consider: dollars, cents = r.match(s).captures
[14:42:30] Mike111: havenwood: is there a way to fit that into an if expression?
[14:42:35] Mike111: because I have an else clause
[14:43:12] Mike111: which should be invoked if the regular expression does not match the string
[14:43:32] havenwood: Mike111: puts dollars, cents if dollars
[14:44:05] havenwood: Mike111: Your original checks if *either* of the named captures exists. Is that what you want, or both?
[14:44:13] havenwood: Mike111: puts dollars, cents if dollars && cents
[14:44:22] Mike111: havenwood: no, I need both
[14:44:33] havenwood: Mike111: dollars, cents = r.match(s).captures; puts dollars, cents if dollars && cents
[14:44:57] Mike111: match_data = r.match(s) followed by if match_data was working for me
[14:45:21] Mike111: they are like 5-6 groups to be matched :(
[14:45:38] Mike111: so, repeating the names twice doesn't look good either
[14:46:12] havenwood: Mike111: Ah, I can show a better way then. But doesn't your original return truthy when *any* not *all* captures are found?
[14:46:25] Creatornator: has joined #ruby
[14:47:26] havenwood: Mike111: Ah, no, you're right.
[14:47:58] Mike111: havenwood: this is exactly what I want https://ideone.com/72hduy
[14:48:20] Mike111: havenwood: does this code look bad for a ruby a programmer?
[14:49:05] havenwood: Mike111: Just get rid of the `then`. It looks good!
[14:49:07] Mike111: and what if there are like 5-6 variables
[14:49:20] havenwood: Mike111: puts match_data.captures
[14:49:27] havenwood: (To avoid repeating yourself.)
[14:49:33] Mike111: sorry if I sound a bit fastidous
[14:49:44] havenwood: Mike111: I think you're right to carefully consider it.
[14:49:58] Mike111: mmm, I am accessing them to store them into structures actually
[14:50:14] Mike111: outputting them to puts is here for the purposes of this minimal example
[14:50:18] havenwood: Mike111: You can get a hash back with: match.named_captures
[14:50:39] havenwood: Mike111: If it's useful, there's also: match.values_at(:cents, :etc)
[14:51:18] havenwood: Mike111: If you can share the full example it might reveal more opportunities - but other than the `then` what you have looks good to me.
[14:51:18] Mike111: I am passing these arguments to another class's constructor
[14:51:32] havenwood: Mike111: Positional or keyword args?
[14:51:37] Mike111: e.g. using MyClass.new(match[:dollars], match[:cents], ....)
[14:52:05] havenwood: Mike111: If they're in the same order, you could: MyClass.new(*match.captures)
[14:52:08] Mike111: so, I have about 6 arguments to that constructor (rubocop complains about this, and I have no idea how I can tackle that)
[14:52:25] Mike111: havenwood: oh, that looks really cool if it works
[14:52:27] havenwood: Mike111: Or if they were keyword arguments, the order doesn't matter: MyClass.new(**match.named_captures)
[14:53:10] Mike111: havenwood: in case of about six mandatory arguments to construct an object, would you use positional or keyword arguments?
[14:53:23] havenwood: These days, I'd always recommend considering keyword arguments. Naming tends to be a very nice way to couple code compared to position.
[14:53:41] havenwood: Mike111: I would recommend keywords there.
[14:54:05] havenwood: Mike111: It'll tend to be a bit more verbose but a lot easier to read!
[14:54:10] Mike111: havenwood: can keyword arguments be mandatory? (sorry if this sounds like a stupid question)
[14:54:22] havenwood: Mike111: Not a stupid question, and yes, you can!
[14:54:54] Mike111: aha, so, I'll read about them and use the **match.named_captures syntax you suggested
[14:55:00] Mike111: thank you very much havenwood
[14:55:07] havenwood: def initialize madatory:, another_mandatory:, optional: 42, another_optional: nil
[14:55:13] havenwood: Mike111: You're welcome!
[15:05:26] snuz: has joined #ruby
[15:10:32] thinkpad: has joined #ruby
[15:24:04] snuz: has joined #ruby
[15:24:26] alfiemax: has joined #ruby
[15:27:23] drale2k_: has joined #ruby
[15:35:36] kapil___: has joined #ruby
[15:45:41] tristanp: has joined #ruby
[15:46:21] Xiti: has joined #ruby
[15:49:07] User458764: has joined #ruby
[16:01:48] ciro: has joined #ruby
[16:03:14] raynold: has joined #ruby
[16:21:15] ciro: has joined #ruby
[16:21:31] Creatornator: has joined #ruby
[16:23:43] duderonomy: has joined #ruby
[16:25:05] UserOO7: has joined #ruby
[16:28:19] drale2k_: has joined #ruby
[16:28:28] c0ncealed2: has joined #ruby
[16:30:09] juiko: has joined #ruby
[16:31:39] alfiemax: has joined #ruby
[16:35:36] User458764: has joined #ruby
[16:37:35] User458764: has joined #ruby
[16:39:35] User458764: has joined #ruby
[16:41:35] User458764: has joined #ruby
[16:43:35] User458764: has joined #ruby
[16:45:35] User458764: has joined #ruby
[16:45:41] hays: should each class have its own file?
[16:46:26] therealGent: has joined #ruby
[16:47:03] drale2k_: has joined #ruby
[16:47:34] User458764: has joined #ruby
[16:47:36] ineb: hays: its not required but makes sense in most cases imho
[16:49:31] User458764: has joined #ruby
[16:51:59] User458764: has joined #ruby
[16:53:49] cadillac_: has joined #ruby
[16:53:56] User458764: has joined #ruby
[16:54:24] hays: im finding that when i write code, I have a real hard time going back to it and figuring out what is happening
[16:54:36] hays: with maybe a 2 month gap in looking at it
[16:55:02] hays: trying to figure out how to remedy that
[16:55:28] ineb: i would say by practicing
[16:55:45] ineb: havin a good structure in the first case helps here ofc
[16:55:57] User458764: has joined #ruby
[16:56:28] hays: recently i was using a nokogiri object, and one class created the object and passed it to another, for it to be used.. coming back to it, it was hard to tell how to use it
[16:57:22] UserOO7: has joined #ruby
[16:57:28] hays: I guess my problem there is I should have made a stronger interface.. instead of passing back a nokogiri object, pass back my own object with clearer interfaces
[16:57:45] ineb: i would say there is not much you can do here but relearning how nokogiri works again :)
[16:57:57] User458764: has joined #ruby
[16:58:05] ineb: defining an interface makes sense if you dont need a full featured nokogiri interface object
[16:58:39] ineb: but if you need to do html/xml operations it doesnt make sense to create an interface
[16:58:56] noobineer: has joined #ruby
[16:59:41] hays: right, but if i am really wanting to not be aware of xml i should also create an interface
[16:59:57] User458764: has joined #ruby
[17:00:37] ineb: yes, its an good idea. but in your case it sounds like you have not implemented the logic two months ago
[17:00:51] ineb: so the only thing you can do now is learning nokogiri and write the interface
[17:01:30] User458764: has joined #ruby
[17:03:30] User458764: has joined #ruby
[17:05:30] User458764: has joined #ruby
[17:05:50] hays: how do you draw out your design? UML?
[17:07:30] User458764: has joined #ruby
[17:07:43] desperek: has joined #ruby
[17:09:34] User458764: has joined #ruby
[17:11:21] User458764: has joined #ruby
[17:11:54] mroutis: has joined #ruby
[17:13:21] User458764: has joined #ruby
[17:15:21] User458764: has joined #ruby
[17:17:21] User458764: has joined #ruby
[17:17:40] tty: has joined #ruby
[17:19:21] User458764: has joined #ruby
[17:21:22] User458764: has joined #ruby
[17:23:25] User458764: has joined #ruby
[17:24:33] UserOO7: has joined #ruby
[17:25:25] User458764: has joined #ruby
[17:27:09] ptx0: has joined #ruby
[17:27:25] User458764: has joined #ruby
[17:29:25] User458764: has joined #ruby
[17:31:25] User458764: has joined #ruby
[17:32:50] SeepingN: has joined #ruby
[17:33:06] houhoulis: has joined #ruby
[17:33:20] User458764: has joined #ruby
[17:35:20] User458764: has joined #ruby
[17:36:38] drale2k_: has joined #ruby
[17:37:21] User458764: has joined #ruby
[17:39:05] MyMind: has joined #ruby
[17:39:21] User458764: has joined #ruby
[17:41:20] User458764: has joined #ruby
[17:43:13] User458764: has joined #ruby
[17:43:52] cadillac_: has joined #ruby
[17:44:12] Pisuke: has joined #ruby
[17:44:52] ineb: hays: just my head :/
[17:45:11] User458764: has joined #ruby
[17:45:30] Mike11: has joined #ruby
[17:47:10] User458764: has joined #ruby
[17:49:09] User458764: has joined #ruby
[17:51:06] User458764: has joined #ruby
[17:53:07] User458764: has joined #ruby
[17:54:08] herbmillerjr: has joined #ruby
[17:55:06] User458764: has joined #ruby
[17:57:07] User458764: has joined #ruby
[17:58:56] User458764: has joined #ruby
[18:00:57] User458764: has joined #ruby
[18:02:57] User458764: has joined #ruby
[18:04:49] User458764: has joined #ruby
[18:06:49] User458764: has joined #ruby
[18:08:46] User458764: has joined #ruby
[18:10:45] User458764: has joined #ruby
[18:17:02] liushooter: has joined #ruby
[18:26:52] dviola: has joined #ruby
[18:51:28] orbyt_: has joined #ruby
[18:54:40] gheegh: has joined #ruby
[19:12:05] impermanence: has joined #ruby
[19:13:23] aniarya82: has joined #ruby
[19:19:02] chouhoulis: has joined #ruby
[19:20:14] scrptktty: has joined #ruby
[19:21:27] ellcs: has joined #ruby
[19:23:01] tristanp: has joined #ruby
[19:29:17] cagomez: has joined #ruby
[19:36:49] t0x: has joined #ruby
[19:37:53] herbmillerjr: has joined #ruby
[19:44:55] snuz: has joined #ruby
[19:57:20] snuz: has joined #ruby
[20:03:45] snuz: has joined #ruby
[20:09:07] snuz: has joined #ruby
[20:12:07] maryo: has joined #ruby
[20:19:59] fmcgeough: has joined #ruby
[20:52:01] orbyt_: has joined #ruby
[20:52:21] kapil___: has joined #ruby
[20:53:20] apeiros: has joined #ruby
[20:57:46] tty: has joined #ruby
[20:58:28] AJA4350: has joined #ruby
[20:59:53] UserOO7: has joined #ruby
[21:00:19] ur5us: has joined #ruby
[21:04:53] maryo: has joined #ruby
[21:06:24] apeiros: has joined #ruby
[21:10:11] UserOO7: has joined #ruby
[21:11:36] bmurt: has joined #ruby
[21:14:49] aniarya82: has joined #ruby
[21:16:11] apeiros: has joined #ruby
[21:18:03] c0ncealed2: has joined #ruby
[21:23:26] Vapez: has joined #ruby
[21:29:27] Sembei: has joined #ruby
[21:34:10] quazimodo: has joined #ruby
[21:37:00] djuber: has joined #ruby
[21:37:11] MyMind: has joined #ruby
[22:15:33] apeiros: has joined #ruby
[22:22:07] bmurt: has joined #ruby
[22:23:21] za1b1tsu: has joined #ruby
[22:38:41] nicesignal: has joined #ruby
[22:39:56] rootsudo: has joined #ruby
[23:01:43] Azure: has joined #ruby
[23:01:56] t0xik: has joined #ruby
[23:09:58] patr0clus: has joined #ruby
[23:19:21] gheegh: has joined #ruby
[23:32:03] UserOO7: has joined #ruby
[23:34:05] mroutis: has joined #ruby
[23:42:02] nickjj: has joined #ruby
[23:59:37] UserOO7: has joined #ruby