« Back to channel list

#ruby - 20 August 2014

« Back 1 day Forward 1 day »
[00:16:10] bricker`work: >> "{a123}".gsub(/([{}])/) { |m| "\\" + m }
[00:16:10] eval-in: bricker`work => "\\{a123\\}" (https://eval.in/181176)
[00:16:15] bricker`work: Man, that is confusing
[00:16:19] bricker`work: >> puts "{a123}".gsub(/([{}])/) { |m| "\\" + m }
[00:16:19] eval-in: bricker`work => \{a123\} ... (https://eval.in/181177)
[00:17:28] cy: bricker`work: looks complicated
[00:17:49] ari-_-e: bricker`work: what's confusing about it for you?
[00:19:28] bricker`work: ari-_-e: it's confusing that you're trying to escape something, but then IRB is also escaping it, so it looks like your code isn't working
[00:20:02] ari-_-e: bricker`work: String#inspect adds the appropriate escaping
[00:20:06] ari-_-e: that shouldn't be surprising
[00:20:40] ari-_-e: "\{a123\}" wouldn't be correct, because that would imply that the braces are escaped
[00:21:05] ari-_-e: "\\{a123\\}" correctly shows that the backslashes are escapes
[00:21:13] bricker`work: I understand it
[00:21:34] bricker`work: it's just a little confusing
[00:25:25] bzitzow: Are there any recommended courses I could take to dive right into TDD with RSpec?
[00:25:32] toertore: now try escaping \ in a string with a regex
[01:12:14] AlexRussia: i found here doc's about JSON class.How i could make support my object in .to_json or JSON.generate?
[01:13:48] ari-_-e: AlexRussia: add a #to_json method
[01:18:03] ari-_-e: seems that JSON.generate does some really badly documented magic though
[01:45:23] joejoe_: hey jayalb
[02:04:24] iigihu: helloall, i am having problems with string scrub: http://pastebin.com/pjFTZcDa
[02:04:35] iigihu: it says method not found
[02:06:46] jamesfordummies: iigihu: what version of ruby are you using
[02:07:43] iigihu: ruby 2.0.0p481
[02:08:03] jamesfordummies: http://www.ruby-doc.org/core-2.0.0/String.html#method-i-scrub
[02:08:40] havenwood: iigihu: or the string-scrub gem
[02:09:07] havenwood: iigihu: https://github.com/hsbt/string-scrub#readme
[02:13:24] AlexRussia: ari-_-e: lol, badly documented magic....sounds fun :D
[02:13:53] AlexRussia: ari-_-e: #to_json should return supported JSON object, yep
[02:14:07] AlexRussia: ari-_-e: like string, array, hash, number, nil....
[02:14:07] ari-_-e: AlexRussia: it should return a string json in it
[02:14:16] AlexRussia: ari-_-e: ou, lol
[02:15:19] ari-_-e: I'd recommend constructing a ruby object that supports to_json and then just return the result of calling #to_json on that
[02:16:22] ari-_-e: AlexRussia: JSON is a serialization - ruby types that are like the types that can be encoded in json are not json objects
[02:16:53] ari-_-e: the same is true in javascript
[02:16:59] AlexRussia: ari-_-e: yep
[02:19:37] AlexRussia: somebody know what is rangel?
[02:19:53] benzrf: are there any payment services that do things like handle cancellation and switching cards on their end and just tell your app whether a particular id is paying or not
[02:20:06] benzrf: for recurring
[02:20:28] AlexRussia: it seems like java-based language
[02:20:28] benzrf: AlexRussia: do u mean ragel
[02:20:40] benzrf: ragel is a dsl for declaring fsms
[02:20:58] AlexRussia: benzrf: can you make less abbreviations? @_@
[02:21:06] AlexRussia: benzrf: dsl - domain specefic language
[02:21:16] AlexRussia: benzrf: but what is fsms? @_@
[02:21:56] benzrf: fsm = finite state machine
[02:23:33] AlexRussia: ari-_-e: yo, i found sth fine https://github.com/flori/json/tree/5a4331918f61a8a4dbe12df8a12f66e5b4e4811a
[02:23:46] AlexRussia: ari-_-e: even https://github.com/flori/json/
[03:53:22] pontiki: nice tapas from avdi
[03:55:43] pontiki: 230 Black Box
[03:56:01] sevenseacat: ah havent watched that one yet
[03:56:35] pontiki: it's kind of the counterpoint to the previous one
[04:36:53] asdf: hello, my console has weird colors when i run ruby
[04:37:24] asdf: when iterated throgh databank on sqlite3
[04:38:37] asdf: i dump query to screen and some characters are turned different colors than the foreground
[04:38:50] benzrf: why cant ruby have
[04:38:51] benzrf: backcalls
[04:38:55] benzrf: theyre so cool/cool
[04:38:58] benzrf: good/cool
[04:39:01] asdf: what do you mean
[04:39:16] benzrf: ive complained about them here before
[04:39:29] benzrf: theyre just syntactic sugar for unnesting callbacks
[04:39:55] benzrf: u write `foo <- bar' and that translates to `bar do |foo|' plus an implicit extra end at the end of the current syntactic level
[04:40:40] benzrf: so then if you do heavily nested callbackin, instead of:
[04:40:45] benzrf: foo do |result1|
[04:40:47] benzrf: bar do |result2|
[04:40:53] benzrf: result1 + result2
[04:40:56] benzrf: you write:
[04:41:00] benzrf: result1 <- foo
[04:41:02] benzrf: result2 <- bar
[04:41:05] benzrf: result1 + result2
[04:43:04] tlarevo: benzrf: I guess ruby was not designed to implement such I do code both JS and ruby but I have experienced any need of that feature
[04:43:07] asdf: syntatic sugar alright
[04:43:21] asdf: yeah and whats up with the rails server?
[04:44:11] asdf: its easier to make threaded socket listener, than to go through all of rails
[04:45:28] asdf: instead of learning rails, just make your own http server
[04:45:46] sevenseacat: ok not to be taken seriously
[04:45:51] asdf: it can be done in about 20 lines, and you can examine which controller to select with a switch case statement
[04:46:03] asdf: its all in the query line
[04:47:17] asdf: each mvc can be a module, and you do not need to learn all the ruby convention
[04:47:30] asdf: which is a huge waste of time
[04:47:36] sevenseacat: trollolololol
[05:09:48] pontiki: it can be done in 6 lines, you hack
[05:20:12] sevenseacat: sinatra was written in six lines. needing 20 for a server is just extraordinary
[05:34:48] dopie: https://gist.github.com/staycreativedesign/cd33cffab0470c6bc873
[05:35:01] dopie: why isnt my who's_turn(dealer) running
[05:35:23] sevenseacat: i hope you have some kind of tests for this 200 lines of code
[05:35:23] dopie: hey sevenseacat, im reading for a ruby bashing
[05:35:34] dopie: thats next course
[05:35:39] sevenseacat: and you dont expect is to just magically interpret the whole thing
[05:38:30] dopie: what bugs?
[05:38:50] pontiki: there can't be any bugs!
[05:39:05] dopie: yes there can be
[05:40:16] dopie: i fixed it
[05:40:33] sevenseacat: next time, if you want us to help you, you have to tell us whats wrong.
[05:40:57] dopie: #ruby is my ruby duck :P
[05:42:57] havenwood: anyone wanna sanity check a PR?: https://github.com/puma/puma/pull/570
[05:44:58] havenwood: i think that's ^ right, but i swear when i try to add a unit test it shows the existing behavior works
[05:45:01] havenwood: but it doesn't!
[05:47:13] havenwood: i can't think why in test unit the exact same code example works, other than maybe due to overhead the job has a chance to decrement the counter
[05:47:41] havenwood: oh well, maybe some threading edge cases aren't worth testing but are still worth fixing? >.>
[07:15:24] Lightsword: how would I tunnel eventmachine http multi-request traffic through a net-ssh socks5 proxy?
[07:15:48] Lightsword: I???m trying proxy = Net::SSH::Proxy::SOCKS5.new(???user@ip???, 22)
[07:15:59] Lightsword: and multi.add e, EventMachine::HttpRequest.new("http://" + e + "/", :connect_timeout => 1, :inactivity_timeout => 1, :proxy => proxy).get
[07:16:56] Lightsword: but I???m getting the error /em-http-request-1.1.2/lib/em-http/http_connection_options.rb:25:in `initialize': undefined method `[]' for #<Net::SSH::Proxy::SOCKS5:0x00000102a968e0> (NoMethodError)
[07:19:28] Lightsword: I think I???m setting the proxy correctly in eventmachine but I???m not sure what I???m doing wrong
[07:19:40] Lightsword: I mean incorrectly
[07:23:48] Lightsword: is there a way to tunnel non-ssh traffic over this proxy? http://rubydoc.info/github/net-ssh/net-ssh/Net/SSH/Proxy/SOCKS5
[07:25:27] sevenseacat: irc is possibly the worst medium for sharing code
[07:33:22] ari-_-e: does anyone with experience with the mysql2 gem know if it's possible to access two columns from different tables with the same names without renaming them?
[07:33:35] sevenseacat: thats got nothing to do with the mysql gem
[07:34:32] ari-_-e: yeah it does... I looked at the mysql wire protocol and it tells you which table each column is from
[07:34:57] ari-_-e: I'm sure the C api gives you access to this information
[07:36:43] ari-_-e: as it stands, if I make a query which returns two "id" columns from two tables, the hash only has pair
[07:36:56] ari-_-e: and results.fields -> ['id', 'id']
[07:58:56] Lightsword: how would I open a socks5 tunnel over ssh using ruby?
[09:55:17] adac: Is it advised to use single quotes or double ones by default?
[09:57:00] cjk101010: doesn't matter, imho
[09:57:01] tlarevo_: if you need String interpolation use double quotes otherwise single quotes :)
[09:57:02] banister: adac use the one that makes you feel most at home
[09:57:05] tobiasvl: the jury is out on that. use what you want
[09:57:30] adac: I actually love single quotes :) so maybe I'll stick with that
[09:57:32] tobiasvl: http://stackoverflow.com/a/20870770 lists some style guides and their recommendations (it's a tie)
[09:57:46] georgesmith: string interpolation is explained well here - http://stackoverflow.com/questions/6395288/ruby-double-vs-single-quotes
[09:58:01] tobiasvl: adac: but be sure you know the difference between them! I assume you mean which ones to use when interpolation and escaping don't matter.
[09:58:48] adac: tobiasvl, yes exactly I mean those. the other ones need double ones as you say
[10:03:13] tlarevo: I'm not sure there could be advantages in using single quotes and double quotes rather than using all double quotes in terms or memory usage and management
[10:09:28] jhass: in theory single quotes are faster to parse since they don't need to be checked for interpolation. But that's probably hardly measurable
[10:11:44] tlarevo: But I guess when you have lots of strings used it matters isnt it ?
[10:12:14] ptrrr: also, escaping is affected
[10:12:15] jhass: I wouldn't bother tbh.
[10:12:31] banister: tlarevo that's a micro optimization x 1 billion, forget about it
[10:12:33] jhass: choose them for their semantic differences as needed
[10:12:34] ptrrr: ???\n??? != ???\n"
[10:14:21] tlarevo: banister: I see :)
[10:23:52] banister: tlarevo https://www.youtube.com/watch?v=7slK2O8YrDk
[10:25:00] Mon_Ouie: Not to mention parsing speed only affects that: parse time, something which only happens when you load your code, not while it is running
[10:25:10] Mon_Ouie: (unless you're constantly using eval :p)
[10:25:45] matti: Mon_Ouie: Ohai
[10:25:47] jhass: so eval makes my code faster? :o
[10:25:48] matti: Mon_Ouie: LTNS
[10:25:48] tlarevo: banister: :D
[10:26:00] matti: jhass: It makes everything faster!
[10:26:04] Mon_Ouie: 'alut matti :)
[10:26:17] matti: jhass: For moar power, try double-eval.
[10:26:55] jhass: >> eval("eval('eval(%[eval(?h?i)])')")
[10:26:55] eval-in: jhass => (eval):1: syntax error, unexpected ')', expecting ':' ... (https://eval.in/181309)
[10:27:52] banister: Mon_Ouie what's up
[10:28:02] jhass: >> eval("eval('eval(%{eval([?h, ?i].join)})')")
[10:28:02] eval-in: jhass => undefined local variable or method `hi' for main:Object (NameError) ... (https://eval.in/181310)
[10:28:22] jhass: doesn't feel any faster matti
[10:28:36] Mon_Ouie: I still don't know what to answer to that
[10:29:12] shevy: those embedded evals are like those russiand dolls, matrushka or whatever the name was
[10:29:25] matti: >> eval 'eval "p \'Hi\'"'
[10:29:26] eval-in: matti => "Hi" ... (https://eval.in/181311)
[10:31:18] matti: jhass: It was so fast, it shevy's sock off ;p
[10:32:33] shevy: my poor sock
[11:10:30] mikecmpbll: eh, can i access a class method from a method of an included module?
[11:11:26] workmad3: mikecmpbll: self.class.method
[11:11:40] mikecmpbll: aw shite, what do you know
[11:12:01] workmad3: mikecmpbll: I assume you included the module as instance methods anyway ;)
[11:12:12] workmad3: mikecmpbll: so yeah... same as you'd do in a normal method :P
[11:12:57] mikecmpbll: yeah that was stupid.
[11:14:02] gaussblurinc1: simple question: is this true: files are equal <=> one.stat == two.stat? (in terms of linux general file)
[11:16:39] adac: Does someone know how to set the "referer" with mechnaize? I tried agent.referer = "http://example.com" but that doesn't seem to do the trick
[11:25:43] ibotexo: hi all. i have to add an argument (:rev_to) to a hash if my variable is not null. is there a special syntax for passing it? https://github.com/redmine/redmine/blob/master/app/helpers/application_helper.rb#L778
[11:28:26] Fractional: If I have a instance of a class called Foo within another class called Bar. How do I access Bar from Foo?
[11:28:59] Fractional: Is there a way without passing a reference?
[11:29:55] gaussblurinc1: ibotexo: heh, you mean hash[:rev_ro] = val ? val : nil? but it creates a key, yes
[11:30:32] gaussblurinc1: Fractional: yes, you could access to ram and with offset magic find a class???
[11:30:48] ibotexo: more like hash[rev_to] = val unless val.nil?
[11:31:08] jhass: Fractional: Bar.new ?
[11:31:10] ibotexo: but is there a syntax to do it inside these brackets {}?
[11:31:21] jhass: ibotexo: nope
[11:31:22] Fractional: gaussblurinc1: Do you have any resources which I could read about this?
[11:32:03] ibotexo: like {:arg1 => x, :rev_to => y unless y.nil?,:arg2 = y}
[11:32:13] jhass: Fractional: he was joking. You don't want to do this in a script that's longer than what it takes to do it (i.e. show that it might be possible and how dangerous it is)
[11:32:17] Fractional: jhass: I meant like: class Foo; def initialize; Bar.new; end; end; and then in Bar I want to do something like puts Foo.class without having to pass Foo as a argument.
[11:32:37] jhass: Fractional: not possible and a sign of broken OO design
[11:33:22] Fractional: jhass: So the solution would be to pass it by reference?
[11:35:10] gaussblurinc1: Fractional: the good way to start is http://en.wikipedia.org/wiki/Software_design_pattern
[11:38:05] gaussblurinc1: ibotexo: and what is the point of 'key' existence? you could check item by nil value: item[:rev_to] # nil
[12:04:26] shachar: Hi Guys , a very small and simple question about ruby constructor. i have created a setter which validates date , how can i call this set method during object initialization? Please have a look here http://pastebin.com/yD6LUrzV THANKS
[12:06:07] apeiros: shachar: that code is not valid
[12:06:23] apeiros: shachar: you'd call it via self.set_day = day_value
[12:06:53] shachar: apeiros , the setter is not valid?
[12:06:58] apeiros: your code is not valid
[12:07:02] apeiros: in your pastebin, line 10, `if day.between?(1,31) do` - there's no `do` after an if. either nothing, or a `then`
[12:07:20] apeiros: line 12 you terminate the if with an end, but line 13 you have an else. that doesn't work.
[12:07:43] shachar: ok i understand
[12:08:01] apeiros: assuming day() is an attr_reader :day, then line 15 does nothing
[12:08:09] shachar: but if there is a way to pass the constuctor directly to the setter method?
[12:08:39] shachar: to validate during object initialization?
[12:08:41] apeiros: and last: note that 01 is octal literal. it works with 01, but if you had e.g. 08 or 09, it'd raise.
[12:09:02] apeiros: what do you mean, "pass the constructor"?
[12:10:03] shachar: if i initialiaze an object with invalid date , i won't get over to the resetting_value method , it will be exeucted only if i`ll try to set an invalid date
[12:11:47] shachar: apeiros , can you please paste your version to this? i didn't quite understood all your comments
[12:17:38] apeiros: shachar: what did you not understand?
[12:22:17] arup_r: can any one help me , why my stub not working ? https://gist.github.com/aruprakshit/bb44165c3b40f4689fb9
[12:24:47] stan_br: I'm trying to make a rails 4 application that is as fallow: a recipe has_many tags. Many tags are _already_ in the database on its own table. When the user creates a new Recipe, it should be able to select many tags. I was trying to do that with nested attributes, but since I'm not creating new Tags, I guess thats not the right way to do it. Any tips?
[12:30:35] apeiros: stan_br: #rubyonrails
[12:31:37] stan_br: nice tip ehe ;)
[12:38:20] bMalum: Hey Guys i try to write a Gem ??? i strated with bundle gem bMarmot and i have ???require "bMarmot/version" in my /lib/bMarmot and in /lib/bMarmot/version.rb ther Version File ??? whats wrong?
[12:38:51] jhass: bMalum: nothing
[12:39:17] bMalum: jhass - so why do i get this line?
[12:39:32] bMalum: ???/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bMarmot/version (LoadError)???
[12:39:46] jhass: what command are you running?
[12:40:21] bMalum: ruby ./lib/bMarmot.rb -> told in the Turial from my School ...
[12:40:29] bMalum: i think there is the problem right?
[12:41:46] jhass: try bundle exec ruby lib/bMarmot.rb
[12:42:09] jhass: we tend to use snake_case for filenames btw
[12:42:40] bMalum: jhass - nice - worked! - you mean b_Marmot?
[12:43:13] jhass: b_marmot. Given that file includes a class or module named BMarmot
[12:43:35] jhass: s/includes/contains
[12:44:43] bMalum: okey :) thank you very much!
[12:45:13] workmad3: bMalum: to run without the bundle exec, you need to do 'ruby -I lib lib/bMarmot.rb' btw
[12:45:46] workmad3: bMalum: as the problem is that your gem's lib/ directory isn't on the $LOAD_PATH in ruby, which is used to find relative files with 'require'
[12:46:11] workmad3: bMalum: 'bundle exec' sorts that out, and rubygems also sorts it out for you when the gem is installed normally
[12:46:24] workmad3: bMalum: it's just the one case where you're outside of both those mechanisms that you hit :)
[12:51:41] bMalum: workmad3: oh now i get it why this happened - do you have a gem in you mind which i could use to look at for help? Just switched from Java and Ocaml to Ruby :D
[13:07:29] jhass: don't worry about asking too many questions here ;)
[13:16:58] arup_r: jhass: thank you :-)
[13:17:10] arup_r: to allow us questions as many as possible here
[13:55:17] gaussblurinc1: is this design good enough: https://gist.github.com/lolgear/116937f7925b514bfd7e
[14:00:40] jhass: gaussblurinc1: don't make that abstract, show your concrete usecase
[14:05:23] gaussblurinc1: jhass: https://gist.github.com/lolgear/a033764ad4fbdf299b62
[14:06:45] workmad3: gaussblurinc1: class methods aren't in the method lookup for instances
[14:06:57] workmad3: gaussblurinc1: so you need to call them explictly on the class, not implicitly
[14:07:16] jhass: ^ but seems fine if you really need that both ways
[14:08:17] workmad3: jhass: he wants to use the class method in the instance method implementation ;)
[14:08:42] gaussblurinc1: jhass: and what's wrong here? I don't want to duplicate code
[14:09:18] jhass: workmad3: he asked whether that's okay design. gaussblurinc1 I didn't say it's wrong, only that you need to be sure you need it both ways
[14:09:40] gaussblurinc1: jhass: heh, thanks, it is clear now
[14:10:24] workmad3: jhass: ah, I was personally commenting on the fact that the (pseudo-)ruby there wouldn't work :)
[14:11:28] tlarevo_: Hi, what is the optimum length of a ruby method i read it should be like 10 lines but isn't that too extreme ?
[14:11:53] gaussblurinc1: workmad3: you are right, I miss self.class.relativePath in instance implementation
[14:11:56] Hanmac: tlarevo_: as long as she needed to be ,P
[14:12:14] workmad3: tlarevo_: as short as you can make it
[14:12:22] gaussblurinc1: tlarevo_: I prefer names that I could understand
[14:12:26] jhass: tlarevo_: shorter is better but not always possible. Make it something to stick to, not a dogma. A second stronger border is one screen size
[14:12:31] Hanmac: for PHP and other languages are code style guides, but imo i do not trust them
[14:13:09] workmad3: jhass: I quite liked one anecdote I came across with a coder who used 'no larger than my head' as a metric
[14:13:27] workmad3: jhass: by which he put his head against the screen, and the height could be no longer than his head :)
[14:13:41] jhass: oh, that's awesome
[14:13:44] jhass: I should adopt that
[14:14:08] jhass: damn, my head is bigger than my laptop screen :(
[14:14:19] tlarevo_: I see thanks, so 15-20 lines would be cool right but if you use rubocop it tries to force you to have 10 lines
[14:14:41] jhass: rubocop's default config is very... opinionated
[14:14:56] tlarevo_: jhass: ya :)
[14:15:32] Hanmac: tlarevo_: like i said i do not trust such guides ... it might say that a class has to much methods .. (imo such things are bullshit)
[14:17:04] jhass: tlarevo_: what that means is that you can have your own opinions, it doesn't define dogmatic rules, ymmw
[14:17:22] tlarevo_: Hanmac: I agree but still if you follow them to some extent you get clean and nice code isn't it ? i did some refactoring and new code looks nice
[14:19:21] sonOfRa: https://gist.github.com/sonOfRa/b74537228b44820ebc01 I've got this piece of code, and it got a little convoluted. It does exactly what it should do (set ldap attributes, and stop setting any more attributes if setting any attribute failed)
[14:19:48] sonOfRa: I can't think of a way to make it look less convoluted, apart from if-blocks for every single statement
[14:19:57] sonOfRa: Which really isn't that much less convoluted
[14:21:54] jhass: sonOfRa: build a hash with attribute_name => value, so {:cn => user.cn, and so on. Then iterate over that }.each do |attribute, value| set; break/raise unless success
[14:22:38] jhass: btw we tend to use underscore_case for method names
[14:22:55] sonOfRa: old habits die hard :/ Most of my methods are underscore_case
[14:35:46] jhass: sonOfRa: I think I'd do http://paste.mrzyx.de/p7c0b1283/
[14:36:45] sonOfRa: That looks far more readable indeed
[14:36:47] sonOfRa: Thank you!
[14:37:16] TieSoul: How would I pick the first object out of an array that has a certain value in one of its variables? All elements in the array are the same class and have a non-nil value in the variable I'm looking for.
[14:37:38] DefV: TieSoul: detect
[14:37:53] jhass: or its quicker to type alias find
[14:38:11] DefV: >> [{a: 1}, {a: 2}, {a: 3}].detect {|hash| hash[:a] == 2 }
[14:38:11] eval-in: DefV => {:a=>2} (https://eval.in/181352)
[14:38:37] DefV: I like the detect / select / reject methods
[14:38:39] DefV: over find
[14:41:07] jhass: mmh, I categorize detect to the weird ones and have find, select, reject one group :P
[14:41:35] Hanmac: DefV: or shorter ;P
[14:41:35] Hanmac: >> [{a: 1}, {a: 2}, {a: 3}].detect {|a:| a == 2 }
[14:41:36] eval-in: Hanmac => {:a=>2} (https://eval.in/181354)
[14:59:18] cschneid: For anybody who uses ruby-install - is there an uninstall command?
[15:01:40] ivko: Hi all. I've got a segfault on 2.1.2 with rspec when wrote some strange code, so, Ruby told me to file a bugreport. So, I've got a huge pile of questions: Should I do so? And if I do, is segfault a possible security issue? So, should I mail it to security@, or they have more important things to do? =)
[15:06:01] pontiki: just file the bug report
[15:06:06] pontiki: include the core dump
[15:06:37] ivko: ok, thank you
[15:17:08] dorei: let's say I want to return an array from a method but I want that array to have my custom #<< method. Should I create a new class that would encapsulate Array, define my custom #<< method there and return objects of that class or should I add on the fly that method to the array (using metaprogramming) ?
[15:18:07] speakingcode: dorei: either approach would work i believe.
[15:18:32] apeiros: dorei: proper class IMO
[15:18:38] jhass: dorei: use a class
[15:18:45] apeiros: you're breaking expectations by redefining some methods
[15:19:21] dorei: magic always breaks expectations :)
[15:19:35] speakingcode: the latter (dynamically adding the method) might cause unexpected issues tho by changing an already used methods meaning
[15:19:35] dorei: anyway, i'll use a class :)
[15:19:45] speakingcode: ^^ what they said
[15:19:50] apeiros: then you're using bad magic
[15:57:03] sonOfRa: is it discouraged to use the value of another parameter as a default for an optional parameter?
[15:57:41] jhass: wouldn't say so, what's your usescase though? (gist the entire method)
[15:58:11] sonOfRa: https://gist.github.com/sonOfRa/7b4c32a1d0bc89ed4060
[15:58:45] sonOfRa: ldap thingy for mail aliases, by default, the mail-address of the alias should be the commonname of the alias
[15:58:47] jhass: I think in this case I'd do mag=nil and mag || name
[15:59:02] sonOfRa: any specific reason?
[15:59:08] jhass: just style
[15:59:20] jhass: can't really say why even
[16:00:26] jhass: I think it makes the intention clearer for me, it's not hidden in the defaults
[16:36:28] bricker`work: So ruby 2.2 will GC symbols created at runtime... which symbols *won't* be GC'd, then?
[16:36:45] havenwood: bricker`work: system internal ones, i think
[16:37:29] havenwood: bricker`work: "Exclude a symbol which is translated ID in C-level from GC-able symbols"
[16:37:30] Hanmac: also symbols you created yourself with the C interface with rb_intern
[16:39:34] havenwood: bricker`work: check Static vs Dynamic symbol description: https://bugs.ruby-lang.org/issues/9634
[16:39:35] bricker`work: So what reason is there to use a string vs. symbol, or vice versa, when you have the option inside your program?
[16:41:17] bricker`work: I guess it's still less work for the GC
[16:42:05] jhass: probably still guaranteed to be the same object if it has the same name and less memory consumption
[16:42:31] bricker`work: unless it's been GC'd :)
[16:42:38] havenwood: bricker`work: there's still the `Array.new(100) { :hi.object_id }` versus `Array.new(100) { 'hi'.object_id }` distinction ^
[16:42:39] havenwood: listhpy symbols
[16:45:43] havenwood: static Symbol, dynamic pinned Symbol, dynamic Symbol, frozen String, String
[16:46:41] havenwood: would you like your internment walked through a warm room or burnt to a crisp?
[16:46:59] pipework: havenwood: what are
[16:47:27] pipework: havenwood: what are "... dynamic pinned Symbol, dynamic Symbol ..." ?
[16:47:56] Hanmac: havenwood: Strings could also be different that 2 String objects with different object ids have the same internal String pointer though sharing
[16:47:59] havenwood: pipework: dynamic symbols are the new GCable Ruby 2.2 ones
[16:48:06] pipework: havenwood: oh neat.
[16:48:14] pipework: havenwood: What's a dynamic pinned symbol then?
[16:48:20] havenwood: pipework: they don't get collected
[16:48:32] pipework: havenwood: How is that different from a symol?
[16:48:32] havenwood: pipework: kinda like converting a dynamic to a static type
[16:48:47] havenwood: converting a 2.2 sym to an oldschool one
[16:49:06] havenwood: SYM2ID or rb_intern
[16:49:27] pipework: Alright, so a dynamic symbol is one that can be GC'd, but is otherwise immutable, right?
[16:50:42] havenwood: pipework: as far as i understand it, same old symbol, just GC considers the dynamic type sweepable
[16:50:50] pipework: havenwood: That's pretty neat.
[16:51:14] havenwood: nice to prevent ooming with symbol spam!
[16:51:31] havenwood: lets rails drop a bunch of symbol to string guards
[16:52:15] pipework: havenwood: Yeah, I bet this'll only be useful in practice for libraries. Oh, and the kind of people who turn user input into keys.
[16:53:43] pipework: havenwood: Here's a cute picture as reward for edutating me. http://i.imgur.com/rSx651f.jpg
[16:54:30] shevy: is that how you look in reallife pipework
[16:54:46] shevy: when you don't shave
[17:00:44] Hanmac: shevy!!! https://play.google.com/store/apps/details?id=jp.co.mediac3.nanacacrash&hl=de
[17:02:55] shevy: https://github.com/Dobiasd/programming-language-subreddits-and-their-choice-of-words/blob/master/README.md
[17:02:59] shevy: PHP leads the list
[17:09:56] waxjar: when a `gem build` fails because your certificate is no longer valid, what should you do?
[17:10:02] waxjar: just create a new certificate?
[17:11:09] _sillymarkets: Is anyone familiar with Viewpoint?
[17:12:20] apeiros: is that the ews client?
[17:12:44] _sillymarkets: yeah, the ews client
[17:13:06] _sillymarkets: I'm getting an error in /ews_soap_response.rb "envelope" : undefined method []
[17:13:07] apeiros: is it finally multi-tenant capable?
[17:13:25] _sillymarkets: I think the latest version allows delegates to access
[17:13:39] apeiros: wrote our own ews client _sillymarkets. I only know it from evaluating others.
[17:17:28] _sillymarkets: apeiros , https://gist.github.com/sillymarketing/af21633212e350510684 | It fails at line 13, saying envelope is nil
[17:17:46] _sillymarkets: can you take a quick look?
[17:18:13] apeiros: I don't think I can help with that, sorry
[17:18:45] _sillymarkets: ok, thanks though
[17:32:51] gr33n7007h: Is this a problem "unable to convert "\xDA" from ASCII-8BIT to UTF-8 for lib/pry-doc/core_docs_21/object_types, skipping"
[17:33:45] apeiros: gr33n7007h: yes, because \xDA is not defined as a character in ascii
[17:34:08] apeiros: hm??? then again - what exactly are you asking?
[17:34:22] gr33n7007h: It happened when I installed pry and pry-doc
[17:34:40] gr33n7007h: or is it something and nothing
[17:34:55] apeiros: not enough information
[17:35:09] apeiros: but I assume it happened during doc generation
[17:35:20] apeiros: and then it just means that at worst your docs are garbled/incomplete.
[17:35:44] gr33n7007h: apeiros, how can I fix this?
[17:36:17] apeiros: gr33n7007h: with that little information you gave - no idea.
[17:36:42] gr33n7007h: apeiros, what info would you need?
[17:38:16] TC`: How I should I modify RakeFile, to give it arguments 'rake run anyFile.filetype' ?
[17:40:49] gr33n7007h: I guess it's not that much of a biggie
[17:41:09] CuriousMind: Hello everyone, I have completed my first independent project in Ruby.
[17:43:11] fschuindt: Guys, how can I use objects to interact with external methods? Something like this: https://gist.github.com/fschuindt/7a7f35aa62443e38852b
[17:44:00] CuriousMind: I am 17 and I am a beginner in programming. I created a Blackjack game, please feel free to give me advice and comments.
[17:44:01] CuriousMind: https://github.com/Osagiede/BlackJack
[17:44:12] apeiros: fschuindt: you pass the object as an argument
[17:44:16] jhass: fschuindt: push the end from the class definition behind the end form the method definition
[17:44:20] CuriousMind: Thank you. By the way, I am Noob101.
[17:44:51] apeiros: jhass: that somewhat beats the "outside method" part :)
[17:45:02] fschuindt: apeiros: thank you, I tough that was a way like this.
[17:45:16] jhass: apeiros: I go by code and he wants to call it on the object
[17:46:37] TC`: fschuindt, in free time read and learn: https://github.com/bbatsov/ruby-style-guide
[17:46:49] TC`: oh so fschuindt , not for you
[17:47:05] TC`: CuriousMind, read in spare time https://github.com/bbatsov/ruby-style-guide
[17:47:37] CuriousMind: ACTION gulps 
[17:47:47] CuriousMind: TC`, did I do something wrong? :(
[17:47:49] apeiros: CuriousMind: congrats, well done
[17:48:37] TC`: CuriousMind, good job! Ruby style guide lets you learn to write easy readable code.
[17:48:42] apeiros: CuriousMind: does slowText really work for you? I don't see synch or flush
[17:48:45] CuriousMind: apeiros: Thank you, that took be maybe two months or something. I don't remember but I took my laptop every with me, git a lot of git add, git commits.
[17:49:16] CuriousMind: I don't know a lot of methods, no one taught me that there are methods that do this or that so I created my own.
[17:49:33] apeiros: I think the style guide suggestions is a good one
[17:49:34] CuriousMind: TC`: Ah ok, the guide should teach me convention! THANKS!!!!!
[17:49:43] CuriousMind: apeiros: Thank you!!!!
[17:49:52] apeiros: I'd also try to migrate towards classes
[17:50:11] shevy: CuriousMind you seem to intend the code when you don't need to intend
[17:51:09] CuriousMind: shevy: What does that mean? Intend?
[17:51:12] shevy: CuriousMind also on Arrays, << is simpler than .push()
[17:51:23] shevy: yeah I meant indent
[17:51:36] CuriousMind: I am going to write down everyone's ideas in a different file, keep em coming!!!
[17:51:44] shevy: CuriousMind if you look at line 98 you have no indent there
[17:52:06] shevy: CuriousMind but at line 9 you have a big indent - both should be on the same level though
[17:52:56] ntrophimov: Can somebody help me with this question -- http://stackoverflow.com/questions/25402135/how-to-properly-work-with-curseskey-backspace-in-ruby
[17:53:01] apeiros: CuriousMind: line 445-533 can be condensed in probably ~15 lines
[17:53:12] jhass: ntrophimov: do not crosspost. If you do at least tell
[17:53:17] apeiros: CuriousMind: also use if/elseif instead of case; when
[17:53:44] apeiros: ACTION wonders how long he should wait???
[17:54:07] apeiros: I'll give him 3 minutes. that's IMO fair.
[17:57:08] ntrophimov: I have some other questions about curses in ruby too. Is there somebody who works with it?
[17:57:59] pipework: apeiros: Why use elsif over case with lambdas?
[17:58:05] dorei: curses are like a curse :p
[17:58:19] pipework: curses is impossible to write tests for.
[17:58:43] eval-in: Mon_Ouie => "\b" (https://eval.in/181414)
[17:59:02] ntrophimov: Well, ok. Another help request -- can somebody please do a review for the following code
[17:59:02] ntrophimov: https://bitbucket.org/ntrophimov/anonymous_chat
[17:59:05] Mon_Ouie: I don't know what the KEY_BACKSPACE is supposed to be but that seems normal
[17:59:18] apeiros: pipework: there are no lambdas involved. re why no case/when without case expression: style.
[17:59:33] pipework: apeiros: ah preference
[18:00:00] apeiros: apeiros kicked ntrophimov: somebody even tells you to tell in all channels that you are cross-posting - I haven't seen you doing that???
[18:00:13] apeiros: pipework: yes
[18:00:16] apeiros: -o apeiros
[18:03:02] ntrophimov: Guys, I'm NOT cross-posting. That happens only with ONE message
[18:03:18] ntrophimov: And I'm sorry about that
[18:03:39] shevy: an unbeliever!
[18:03:43] shevy: kick him again!!!
[18:04:34] apeiros: ntrophimov: yes, you did cross-post.
[18:04:50] apeiros: ntrophimov: and you got told to say so in all channels. you did not.
[18:04:59] dorei: when I forward a method to an ivar, should I use forwardable and def_delegators?
[18:05:09] ntrophimov: With one message only
[18:05:32] apeiros: and "one" makes it magically not a crosspost?
[18:05:36] apeiros: sorry lad, that's not how it works.
[18:05:37] workmad3: dorei: depends on how much you're doing IMO
[18:05:52] dorei: a couple of methods max
[18:05:57] workmad3: dorei: if you're only forwarding one or two methods, pulling in the delegator is probably not worth the effort
[18:06:02] ntrophimov: As you wish. You may kick me again
[18:06:07] workmad3: dorei: so I'd just hand-roll the methods
[18:06:12] workmad3: ACTION kicks ntrophimov 
[18:06:17] workmad3: not gonna miss an opportunity like that :P
[18:06:23] apeiros: ntrophimov: if you do it again, I will.
[18:06:51] shevy: ntrophimov please do it again
[18:09:46] ntrophimov: So, what about code review? Is everyone busy?
[18:10:32] shevy: that is not very convenient to browse
[18:10:53] CuriousMind: apeiros: Why you say it like this, "~15 lines" o-o
[18:11:00] jhass: also cursed.. er curses code
[18:11:09] CuriousMind: I am looking at everyone's suggestions, I am analyzing everyone's information
[18:11:53] ntrophimov: This is my first Ruby project, so I need to hear the suggestions to make it better
[18:12:09] CuriousMind: By the way people, I use Ruby 1.9.3
[18:12:56] jhass: ntrophimov: let's talk about architecture. How do you guarantee anonymity?
[18:13:10] CuriousMind: Thank you TC` apeiros shevy for the advice
[18:13:11] shevy: first ruby project using curses
[18:13:20] ericwood: stay away from curses
[18:13:33] pipework: curses is hard
[18:13:41] ericwood: there was a CLI GUI lib posted the other day that works more like a web framework
[18:13:54] ericwood: try that instead
[18:14:02] dorei: oracle forms used to be curses :p
[18:14:08] ericwood: https://github.com/gavinlaking/vedeu
[18:14:55] ntrophimov: jhass: Other users can't see any nicknames or any additional info about user (IP addresses, etc)
[18:15:25] jhass: but the server still can
[18:15:32] jhass: so anyone with access to the server
[18:15:38] jhass: or the connections to the server
[18:16:12] ntrophimov: jhass: Yep, you're right, ofc
[18:16:36] pipework: ntrophimov: https://bitbucket.org/ntrophimov/anonymous_chat/src/ddd766b37465ea76fc607eb7c096834dd1d06652/os.rb?at=dev there's better code for this
[18:17:10] pipework: It's not remotely anonymous, as jhass pointed out. Also, logging doesn't exactly instill confidence.
[18:17:33] jhass: ntrophimov: so maybe strike that anonymous_ from the name for now
[18:17:37] ericwood: logging is responsible for a lot of deforrestation
[18:17:43] ericwood: save the trees :'(
[18:17:44] pipework: Neat curses stuff though.
[18:17:48] jhass: ntrophimov: code wise all your $globals want to be CONSTANTS
[18:18:21] jhass: ntrophimov: don't do open rescue's, always list the exceptions you expect and want to handle
[18:18:34] jhass: I see no reason for your wrapper around at_exit
[18:19:17] ntrophimov: pipework: Where can I find the better code for this?
[18:19:28] pipework: ntrophimov: minitest has some
[18:19:38] jhass: I prefer to break out of loops instead of using throw/catch
[18:19:58] ntrophimov: jhass: Is there constants in Ruby unlike Python? Ok, I'll google it
[18:20:20] ntrophimov: jhass: Why? Because I can rescue some system exceptions like Ctrl-C?
[18:20:20] jhass: THIS_IS_A_CONSTANT = value
[18:20:23] jhass: simple as that
[18:20:51] ericwood: if it's all caps it's a constant
[18:20:55] CuriousMind: Hello everyone, I have a quesition
[18:20:55] jhass: ntrophimov: because you'll notice if you encounter exceptions you might not expect and need to handle differently
[18:20:59] ericwood: CuriousMind: do tell
[18:21:35] jhass: ericwood: ntrophimov actually if it starts with caps is sufficient, but we use CamlCase only for module and class names
[18:21:38] ntrophimov: jhass: Ah, RubyMIne tells me that it's non-Ruby way to name variables like this
[18:21:52] CuriousMind: ericwood: Is there a web application that allows me and another person to edit code in the editor instantaneously?
[18:22:07] ericwood: CuriousMind: there's things like typewith.me
[18:22:12] CuriousMind: ericwood: As I type code in the console, the other person can see.
[18:22:21] CuriousMind: ericwood: It's an editor that does any programming language?
[18:22:37] ericwood: CuriousMind: probably best to address the whole channel and not just me
[18:22:50] ericwood: I'd google "collaborative code editors"
[18:22:52] CuriousMind: HELLO EVERYONE.
[18:23:01] ntrophimov: Ok, is there smth else?
[18:23:07] ntrophimov: Thanks a lot btw :)
[18:23:40] pipework: CuriousMind: I use screenhero so that I can share a display with someone and we each get our own mousen on the screen.
[18:24:21] jhass: ntrophimov: I'd probably try to have short methods, more classes and decouple the network stuff from the curses stuff, but that's inherently structural
[18:24:30] CuriousMind: pipework: I used screenhero before.
[18:24:37] CuriousMind: pipework: Thank you for the suggestion.
[18:24:41] ntrophimov: And why are u guys so wonder that I use curses for the first Ruby project? What's wrong with it?
[18:24:50] jhass: ntrophimov: if not / if ! -> unless
[18:24:58] ericwood: ntrophimov: curses has a really really archaic API and is confusing as hell
[18:25:03] jhass: curses API is just ugly ;P
[18:25:04] ntrophimov: jhass: Ok, I'll think about that too
[18:25:08] pipework: ntrophimov: Nothing, it's just a pain to do well because you either use the translated API or a crappy wrapper.
[18:25:09] CuriousMind: http://collabedit.com/tc27n come join me
[18:25:20] CuriousMind: http://collabedit.com/tc27n this is where I am coding, come along. :) Welcome
[18:25:20] ericwood: you're basically writing C code, it's just a wrapper
[18:25:34] ericwood: ntrophimov: I saw this yesterday, maybe worth looking into! https://github.com/gavinlaking/vedeu
[18:26:16] ericwood: a year ago I tried writing pong in curses and it caused me physical pain :|
[18:26:30] ntrophimov: Can I ask one more question about curses, guys?
[18:26:36] ericwood: I'll allow it
[18:27:34] ntrophimov: How can I add the Unicode support in the script that uses curses in Windows? It seems that the standard curses module can't do it anyway...
[18:27:48] jhass: ntrophimov: sometimes you use casecmp and sometimes .downcase, be at least consistent
[18:28:06] ntrophimov: jhass: Where?
[18:28:31] jhass: the command parsing in the server
[18:28:47] pipework: The hardest part of curses is writing tests for it, imo.
[18:29:16] CuriousMind: http://collabedit.com/tc27n
[18:29:22] CuriousMind: Feel free to join me :)
[18:30:01] pipework: CuriousMind: Stop advertising repeatedly please.
[18:30:29] CuriousMind: pipework: Ok sorrym I'm just a 17 year old rubyist that's trying to get IRC support
[18:30:39] CuriousMind: I completed my first ruby project
[18:30:57] tlarevo_: vedeu looks pretty kools thanks a lot :)
[18:33:40] ntrophimov: Ok, thanks a lot again, guys
[18:58:41] _sillymarkets: Anyone online that is familiar with Viewpoint gem ? EWS?
[19:09:04] nobitanobi: If I write into a Tempfile, why do I need to close it before I try to access its contents?
[19:09:45] Hanmac: nobitanobi: because without close the file writing is not finished
[19:09:48] MarcWeber: Are there existing tools for dumping/loading databases so that you can convert from mysql to firebird or postgres easily?
[19:09:57] nobitanobi: Hanmac: interesting
[19:10:20] pipework: MarcWeber: What does that have to do with ruby?
[19:10:35] MarcWeber: eventually written in ruby :)
[19:12:23] apeiros: MarcWeber: trivial with sequel
[19:12:27] apeiros: I think it even has an example
[19:12:37] apeiros: but probably far less performant than something like a csv dump+load
[19:13:18] MarcWeber: Its not that trivial if you want to keep foreign key constraints .. then loading/dumping of data depends on order to be valid. I'd be fine with adding constraints afterwards ..
[19:14:05] apeiros: MarcWeber: only if you're so silly as not to deactivate the constraints during load
[19:14:28] apeiros: you generally want to drop indices and constraints while loading large sets of data
[19:14:58] MarcWeber: Which is why I want to use an existing library so that I have to code this only once.
[19:15:11] MarcWeber: Or write that librayr.
[19:19:58] dopie: user.name
[19:20:03] dopie: you are calling the name method on the user which is the receiver
[19:20:12] dopie: is that correct?
[19:21:22] apeiros: dopie: yes
[19:21:49] apeiros: dopie: if you want to be pedantic, then the object referenced by user (or to which user evaluates, in case of it being a method) is the receiver
[19:28:01] dopie: user.name = "Joe"
[19:28:10] dopie: #the object object user is calling the name setter instance method and changing the value of name to "Joe"
[19:32:54] shevy: two times object?
[19:34:04] CoffeeDrivenC0de: Anyone here that can answer a question on merging git branches?
[19:34:22] jhass: CoffeeDrivenC0de: #git doesn't answer?
[19:42:50] jcrubino: I am trying out barebones sinatra on ec2 but cannot get an external connection to the listening port 4567
[19:43:14] jcrubino: ubuntu 14, ufw is dissabled, and all tcp ports on ec2 are open
[19:44:24] jcrubino: anybody with some hints
[19:44:59] dorei: jcrubino: do you have shell access there?
[19:45:28] jcrubino: yes.. I wrote the helloWorld in vim on the instance
[19:45:34] dorei: try a netstat -ntlp
[19:45:49] dorei: to see what listens on what ip/port
[19:47:32] jcrubino: it appears 4567 is being used by ruby
[19:48:12] jcrubino: in golang if I set the port as "localhost:4567" there is no external access
[19:48:18] jcrubino: could it be something similar
[19:48:19] eam: "cannot get a connection" => what is the specific tcp error?
[19:48:36] eam: jcrubino: yes the interface matters
[19:48:44] eam: you need to check the ip and the port
[19:49:06] jcrubino: eam: chrome says a webpage is not available
[19:49:21] eam: don't use chrome, what does netcat or telnet say?
[19:49:21] jcrubino: set :port 4567
[19:49:31] jcrubino: how do I set ip? :ip
[19:50:16] shevy: what is that
[19:50:41] eam: shevy: I heard you're working on a ruby linux distro
[19:50:55] dopie: 3. What's the difference between class variables and instance variables?
[19:51:09] noshi: dopie: an @
[19:51:15] noshi: ba dum psh.
[19:51:36] dopie: Class variables are scoped to the class level and are identified with @@ and a instance variable is identified with @ and is not scoped to the class level and is used to pass variables through methods
[19:51:39] apeiros: instance variables are scoped to a single object
[19:51:59] dopie: single object
[19:52:03] apeiros: class variables are scoped to a class/module, all its instances, all its descendants and all its descendants' instances
[19:52:05] shevy: eam not really, I only use ruby scripts to compile stuff and so on
[19:52:07] noshi: dopie: there are also class instance variables, mind
[19:53:12] noshi: dopie: which are the same as instance variables, only bound to the class object
[19:54:15] jcrubino: set :bind, '0.0.0.0'
[20:08:39] Pulpie: does anyone know a super easy way to clone an entire production environment and put it on my laptop
[20:09:03] Pulpie: or does that sound completely insane
[20:09:09] apeiros: Pulpie: go to the server room, pull the server out, get a diesel generator
[20:09:10] Pulpie: like I thought it did
[20:09:12] apeiros: very mobile
[20:09:27] Pulpie: apeiros: ahh I said clone :)
[20:10:02] Pulpie: my boss comes over "yeah odd, the server is missing?" big generator running behind me "no clue where it went but I got my dev environment setup finally."
[20:10:09] jhass: Pulpie: pull out the model next to it and clone the DD. Then what apeiros said
[20:10:43] Pulpie: jhass: the server also has network settings that I need
[20:10:51] jhass: get some long cables for the same network environment though
[20:11:08] Pulpie: but my boss is just like "why not just deploy your code to the production server under a test branch to see if it works?"
[20:11:11] yottanami: I have this data structure http://dpaste.com/3FT9JMW how can I access content of tag ?\
[20:11:46] Pulpie: Which is dumb because at that point it's like, k my code is on production servers, pulling production data, pushing into production databases and sending production emails.
[20:11:46] jhass: yottanami: hash["advertise"]["tag"]
[20:12:02] Pulpie: but instead of the script running in /github/prod/ its in /github/test
[20:12:11] Pulpie: YUP TOTALLY NOT TESTING IN PRODUCTION HERE!
[20:12:36] Pulpie: we didn't put the code into master
[20:12:39] Pulpie: its not production yet
[20:13:55] yottanami: jhass: I can not use has[:advertise] ?
[20:14:20] jhass: yottanami: no, that's a different key
[20:14:37] jhass: yottanami: :advertise and "advertise" don't even have the same type
[20:14:44] phi-sd: I have ruby 1.8.6 and in irb i can do : require ???net/ssh??? , but I cant do that in a script. It says `require': no such file to load -- net/ssh (LoadError)
[20:14:59] Pulpie: phi-sd: gem install net-ssh
[20:15:15] phi-sd: Pulpie: I???ve already done that. No errors
[20:15:36] jhass: phi-sd: ruby 1.8.6 completely out of support by anybody, we're at 2.1.2 now
[20:15:36] Pulpie: phi-sd: your environment your gem is installing into might differ from what you are running
[20:15:49] Pulpie: phi-sd: are you on windows?
[20:15:57] jhass: phi-sd: ruby 1.8.7 and 1.9.2 are out of support too by now
[20:15:58] apeiros: jhass: rails' HWIA uses the same inspect as a normal hash, though
[20:15:58] phi-sd: i am on osx
[20:16:06] Pulpie: oh thats a pain good luck
[20:16:18] Pulpie: might be easier to use get virtual box and get some linux on there
[20:16:32] phi-sd: It???s a build server, and I don???t want to change the environment too much
[20:16:46] Pulpie: ruby on windows sucks, ruby on OSX. going to be a huge issue.
[20:17:27] Pulpie: Ruby really needs a Linux environment to shine
[20:18:04] apeiros: Pulpie: huh?
[20:18:14] banister: Pulpie ruby works fine on osx, and i think osx ruby developers are on osx
[20:18:19] apeiros: I'm using ruby on both, osx and linux, and it's quite smooth on both
[20:18:35] Pulpie: ahh from my experience thats not been the case
[20:18:47] apeiros: phi-sd: there are plenty of options to get newer rubies on osx. use one of rvm, ruby-installer, rbenv or chruby
[20:19:09] apeiros: Pulpie: 1 line to install rvm. 1 line to install newest ruby. done.
[20:19:10] Pulpie: I'd say if your using rvm on a server, your going to have a bad time
[20:19:27] apeiros: we're doing just that for >5y now. no hickups at all so far.
[20:19:28] Pulpie: rvm with cron and things like that becomes a real pain
[20:19:34] apeiros: Pulpie: lulwat?
[20:19:43] apeiros: make a wrapper. the tool comes with rvm.
[20:19:57] apeiros: simpler than making pie.
[20:19:59] Pulpie: or just install ruby according to your OS.
[20:20:17] Pulpie: which places it in the correct place with the right path.
[20:28:19] phi-sd: my bash is not new enough for rvm :(
[20:29:03] phi-sd: Should i mangle my path to make net/ssh available?
[20:29:36] apeiros: no. install a modern ruby. install the net/ssh gem and it should "just work".
[20:29:56] jhass: I'd consider to accidentally the machine
[21:05:55] SloggerKhan: when I sudo ruby related things all disapear from my path
[21:06:16] apeiros: your sudo probably has different env
[21:07:18] SloggerKhan: Is there a guide to get it working?
[21:22:22] havenwood: SloggerKhan: I don't know of a specific guide but maybe search for visudo, sudoers, and env_keep.
[21:22:53] havenwood: SloggerKhan: Checkout: man sudoers | grep -C4 env_keep
[21:27:19] havenwood: SloggerKhan: Or avoid sudo. Make sure there's good reason to go there in the first place.
[21:27:45] SloggerKhan: havenwood: I ended up using IP tables instead, actually.
[21:28:11] havenwood: SloggerKhan: ;)
[22:36:09] jayalb: helllllllllo iss anyone there
[22:37:14] jayalb: fuck all of u
[22:37:27] jayalb: going back to javascript
[22:37:35] ericwood: please come back
[22:52:16] amh345: evening. does anyone have any recommendations for query json? I'm using JsonPath right now.. but it's less than ideal.
[22:53:00] amh345: basically I'm using redid to store a large (json) configuration file. and i really would like to be able to query this redid db.
[22:53:21] amh345: i've been using JsonPath for the last day- but it's been a nightmare, overall.
[23:27:26] sonofflynn: quick question. I see in a gemfile you can specify the ruby version. Can you specify "at least" a ruby version? Like it needs 1.9.3 or higher?
[23:54:54] zenspider: sonofflynn: yup. it takes a version dep just like anything else
[23:55:21] zenspider: doesn't make sense to say "this only works with 1.8.7" (unless it does)
[23:57:17] zenspider: what's your average time per test?
[23:58:52] waxjar: no idea, fast enough :p
[23:59:39] zenspider: :P also helpful