« Back to channel list

#ruby - 16 March 2017

« Back 1 day Forward 1 day »
[00:00:15] raul782: has joined #ruby
[00:01:16] tmtwd: has joined #ruby
[00:01:20] jshjsh: has joined #ruby
[00:03:43] UserJosh: has joined #ruby
[00:04:49] cibs: has joined #ruby
[00:05:21] ElDoggo: has joined #ruby
[00:06:48] charliesome: has joined #ruby
[00:10:38] griffindy: has joined #ruby
[00:19:44] JeanCarloMachado: has joined #ruby
[00:26:42] last_staff: has joined #ruby
[00:28:38] dasher00: has joined #ruby
[00:31:13] nofxx: Nice, last I saw rubymotion was iOS only... nice, alternatives to cordova
[00:33:17] nofxx: ouch, $200 to remove a splash screen
[00:34:27] roamingdog: has joined #ruby
[00:36:41] __Yiota: has joined #ruby
[00:37:36] gnufied: has joined #ruby
[00:39:11] whiteline: has joined #ruby
[00:41:24] d0nn1e: has joined #ruby
[00:42:50] nOwz: has joined #ruby
[00:43:26] brent__: has joined #ruby
[00:43:54] nofxx: There's a ruby terminal thing to create some curses dashboard... graphs and such... can't remember the name... help
[00:45:00] dar123: has joined #ruby
[00:45:43] pawnbox: has joined #ruby
[00:47:42] bmurt: has joined #ruby
[00:49:42] allisio: nofxx: https://piotrmurach.github.io/tty/
[00:50:15] allisio: Specifically, tty-table.
[00:52:03] cdg: has joined #ruby
[00:53:33] l4v2: has joined #ruby
[00:53:36] raul782: has joined #ruby
[00:55:24] nofxx: allisio, thank you, that looks nice. Found what I was thinking, it's 'blessed' , but not ruby, node.js. Good for 'charts', but kinda of double-edged sword... charts looks awful on terminal..
[00:56:05] cpruitt: has joined #ruby
[00:57:08] nettoweb: has joined #ruby
[00:57:09] mula: has joined #ruby
[00:57:33] rizonz: allisio: I fixed it
[00:57:46] Rodya_: has joined #ruby
[00:58:10] allisio: rizonz: What was the fix?
[01:00:30] rizonz: allisio: add the second line and change the params to some other name
[01:00:41] rizonz: so actually a copy of the line
[01:00:52] rizonz: you can use both then
[01:01:06] rizonz: and I never did any ruby
[01:01:10] rizonz: it looks quite clear
[01:01:22] rizonz: ok I do some puppet erbs
[01:03:17] cschneid_: has joined #ruby
[01:04:45] duderonomy: has joined #ruby
[01:06:18] djbkd: has joined #ruby
[01:11:49] mula: has joined #ruby
[01:15:17] PaulCapestany: has joined #ruby
[01:15:28] pawnbox: has joined #ruby
[01:15:48] Vingador: has joined #ruby
[01:15:58] ahrs_: has joined #ruby
[01:16:24] hutch34: has joined #ruby
[01:17:10] jgnagy: has joined #ruby
[01:31:36] hotpancakes: has joined #ruby
[01:31:41] hotpanca_: has joined #ruby
[01:31:47] edliss: has joined #ruby
[01:34:29] nofxx: rizonz, there's no lang clearer or simpler than ruby
[01:35:37] pawnbox: has joined #ruby
[01:39:19] cyphase: has joined #ruby
[01:39:41] cahoots_: has joined #ruby
[01:41:04] cahoots_: hi, i'm creating a long-running process with periodic output that i spawn from a ruby script. i want to print out anything that this process sends to stdout as soon as it is sent. if i do "puts `sh script.sh`", it will wait for the script to terminate before giving me back all of the output, which is too long. any ideas?
[01:41:28] BiHi: has joined #ruby
[01:46:10] mzo: cahoots_: Process.spawn
[01:46:38] olivier__: has joined #ruby
[01:49:18] eclecticjohny: has joined #ruby
[01:56:41] JohnDoe2: has left #ruby: ()
[01:57:20] cibs: has joined #ruby
[01:58:27] eclecticjohny: has joined #ruby
[02:04:12] ahrs: has joined #ruby
[02:04:15] eclecticjohny: has joined #ruby
[02:05:37] jhack_: has joined #ruby
[02:05:50] edliss: has joined #ruby
[02:06:03] orangeman702: has joined #ruby
[02:07:18] patarr: has joined #ruby
[02:07:37] JeanCarloMachado: has joined #ruby
[02:08:27] eclecticjohny: has joined #ruby
[02:09:26] zach: has joined #ruby
[02:09:51] devn: has joined #ruby
[02:10:03] Azure|dc: has joined #ruby
[02:11:06] devn: Hey folks. I have an endpoint in a rails app that spawns a thread for a long-running task. I want to ensure that if that thread hasn't finished its work, it doesn't spawn another.
[02:23:35] marcoecc: has joined #ruby
[02:24:10] d^sh: has joined #ruby
[02:26:21] eclecticjohny: has joined #ruby
[02:32:57] mula: has joined #ruby
[02:33:08] baweaver: devn: #RubyOnRails and http://stackoverflow.com/questions/8296170/what-is-a-pid-file-and-what-does-it-contain
[02:38:04] olivier__: has joined #ruby
[02:41:03] BabyMario: has joined #ruby
[02:42:38] charliesome: has joined #ruby
[02:43:24] nOwz: has joined #ruby
[02:43:58] sleetdrop: has joined #ruby
[02:44:25] jenrzzz: has joined #ruby
[02:46:46] cibs: has joined #ruby
[02:47:22] jgnagy: has joined #ruby
[02:47:29] whiteline: has joined #ruby
[02:49:18] ichthys: has joined #ruby
[02:51:21] hotpancakes: has joined #ruby
[02:54:02] mula: has joined #ruby
[02:54:20] sneakerhax: has joined #ruby
[02:54:52] mula: has joined #ruby
[02:55:42] mula: has joined #ruby
[02:55:46] roflmyeggo: has joined #ruby
[02:56:27] mula: has joined #ruby
[02:57:17] mula: has joined #ruby
[02:58:02] mula: has joined #ruby
[02:58:52] mula: has joined #ruby
[02:59:35] eclecticjohny: has joined #ruby
[03:01:46] astrobunny: has joined #ruby
[03:02:04] astrobunny: has joined #ruby
[03:02:32] midacts: has joined #ruby
[03:04:23] ahrs: has joined #ruby
[03:04:50] libastral: has joined #ruby
[03:06:18] astrobunny: has joined #ruby
[03:06:29] BTRE: has joined #ruby
[03:06:48] adam12: Bleh. Had a tab open but it's gone. Looking for a Ruby HTTP library that does a bit of metaprogramming. So client.users gets transformed into http://thehost/users, which is then chain-able from there. Ring a bell with anybody?
[03:07:25] adam12: And not httparty .. :)
[03:13:46] olivier__: has joined #ruby
[03:14:40] pawnbox: has joined #ruby
[03:17:10] ajsharma: has joined #ruby
[03:17:30] eclecticjohny: has joined #ruby
[03:17:55] hutch34: has joined #ruby
[03:25:28] allisio: adam12: The github_api gem does that, but it's not something Faraday provides out of the box.
[03:25:53] adam12: allisio: Thanks. I think this was a new and upcoming gem I found a few weeks ago. Maybe in r/reddit or awesomeruby
[03:25:58] adam12: but it's gone, so I'll stick with HTTP.rb for now.
[03:26:11] jasondotstar: has joined #ruby
[03:26:28] charliesome: has joined #ruby
[03:26:30] JohnDoe2: has joined #ruby
[03:27:36] ChickeNES: has joined #ruby
[03:27:41] Rodya__: has joined #ruby
[03:28:20] JohnDoe2: quick question, forgive me if this is the wrong channel to ask: I'm using sshkit to run remote commands. My local environment does not match the remote one, and I have mapped a command. The issue is that the same command is used for both local and remote in the scripts, thus wrongfully trying to execute from the wrong path on local machine. Is there any way to map commands per host?
[03:33:02] Tau: has joined #ruby
[03:38:42] Channel6: has joined #ruby
[03:43:09] cahoots: has joined #ruby
[03:44:19] pawnbox: has joined #ruby
[03:48:31] milardovich: has joined #ruby
[03:52:31] JohnDoe2: has left #ruby: ()
[03:56:57] pawnbox: has joined #ruby
[03:58:21] pulkit4tech: has joined #ruby
[03:58:56] gnufied: has joined #ruby
[03:59:36] mula: has joined #ruby
[04:00:31] Rodya_: has joined #ruby
[04:00:33] cschneid_: has joined #ruby
[04:04:45] cibs: has joined #ruby
[04:04:58] enterprisey: has joined #ruby
[04:08:06] patarr: has joined #ruby
[04:10:34] JoshS: has joined #ruby
[04:18:12] charliesome: has joined #ruby
[04:19:35] gusrub: has joined #ruby
[04:20:28] blackwind_123: has joined #ruby
[04:20:34] roflmyeggo: has joined #ruby
[04:20:59] pawnbox: has joined #ruby
[04:26:03] CloCkWeRX: has joined #ruby
[04:27:51] pawnbox: has joined #ruby
[04:28:48] ElDoggo: has joined #ruby
[04:29:53] pawnbox: has joined #ruby
[04:30:02] gix: has joined #ruby
[04:31:08] djbkd: has joined #ruby
[04:31:39] BTRE: has joined #ruby
[04:32:03] al2o3-cr: >> [x, y = a = x, b = y].map &:__id__
[04:32:04] ruby[bot]: al2o3-cr: # => undefined local variable or method `x' for main:Object (NameError) ...check link for more (https://eval.in/755464)
[04:33:34] al2o3-cr: >> x, y = a = x, b = y; [x, y = a = x, b = y].map &:__id__
[04:33:35] ruby[bot]: al2o3-cr: # => [4, 4, 4] (https://eval.in/755467)
[04:34:46] allisio: >> nil.__id__
[04:34:46] ruby[bot]: allisio: # => 4 (https://eval.in/755470)
[04:35:05] allisio: No surprises there?
[04:36:07] mzo: >> false.__id__
[04:36:09] ruby[bot]: mzo: # => 0 (https://eval.in/755471)
[04:36:16] enterprisey: has joined #ruby
[04:37:49] nadir: has joined #ruby
[04:40:12] al2o3-cr: >> ->{nil.object_id}.yield
[04:40:18] ruby[bot]: al2o3-cr: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[04:42:12] allisio: That's weird.
[04:44:44] pawnbox: has joined #ruby
[04:45:37] govg: has joined #ruby
[04:46:21] al2o3-cr: >> (require'fiddle';Fiddle::Pointer[Fiddle.dlwrap('ruby')][1] |= ~ 1<<3).frozen?
[04:46:22] ruby[bot]: al2o3-cr: # => true (https://eval.in/755476)
[04:46:29] jackjackdripper: has joined #ruby
[04:48:29] jackjackdripper: has joined #ruby
[04:48:52] al2o3-cr: >> ->{nil.object_id}.yield
[04:48:58] ruby[bot]: al2o3-cr: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[04:49:38] al2o3-cr: lets make a finalizer
[04:52:49] jimeh: has joined #ruby
[04:53:04] hahuang65: has joined #ruby
[04:53:24] grant: has joined #ruby
[04:54:06] DukeDave: has joined #ruby
[04:55:25] hahuang65: has joined #ruby
[04:56:44] Suslov: has joined #ruby
[04:57:05] pawnbox: has joined #ruby
[04:57:20] A124: has joined #ruby
[05:02:01] knowtheory: has joined #ruby
[05:02:26] charliesome: has joined #ruby
[05:02:29] jackjackdripper: has joined #ruby
[05:02:35] last_staff: has joined #ruby
[05:04:25] hahuang61: has joined #ruby
[05:06:48] hotpanca_: has joined #ruby
[05:09:14] pawnbox: has joined #ruby
[05:10:33] nofxxx: has joined #ruby
[05:13:19] rhyselsmore: has joined #ruby
[05:17:14] __Yiota: has joined #ruby
[05:18:53] aupadhye: has joined #ruby
[05:20:05] hutch34: has joined #ruby
[05:20:41] tercenya: has joined #ruby
[05:27:02] lightheaded: has joined #ruby
[05:27:38] lightheaded: has joined #ruby
[05:28:46] ByronJohnson: has joined #ruby
[05:34:29] gusrub: has joined #ruby
[05:38:25] milardovich: has joined #ruby
[05:40:44] renchan: has joined #ruby
[05:41:06] pawnbox: has joined #ruby
[05:43:08] pawnbox: has joined #ruby
[05:44:35] edliss: has joined #ruby
[05:46:24] JoshS: has joined #ruby
[05:46:44] JoshS: has joined #ruby
[05:50:01] Rodya_: has joined #ruby
[05:51:13] lightheaded: has joined #ruby
[05:57:21] edliss: has joined #ruby
[05:57:51] raul782: has joined #ruby
[06:03:32] hotpancakes: has joined #ruby
[06:03:37] mula: has joined #ruby
[06:07:36] hotpancakes: has joined #ruby
[06:09:01] patarr: has joined #ruby
[06:10:08] grant: has joined #ruby
[06:11:24] biubiubiu: has joined #ruby
[06:12:20] biubiubiu: what is the rule of name? can I use ? or = in names?
[06:13:11] biubiubiu: function name is same with variable name?
[06:16:10] hotpancakes: has joined #ruby
[06:16:28] CloCkWeRX: has joined #ruby
[06:18:11] lightheaded: has joined #ruby
[06:21:53] jeyraof^mbpr: has joined #ruby
[06:23:43] jackjackdripper1: has joined #ruby
[06:25:19] hotpancakes: has joined #ruby
[06:26:12] edliss: has joined #ruby
[06:29:29] cschneid_: has joined #ruby
[06:33:31] dar123: has joined #ruby
[06:35:39] allisio: biubiubiu: Method names can end with a single '?' or '=', but not other identifiers.
[06:35:49] allisio: #== and #=== are also valid method names, though.
[06:36:47] biubiubiu: allisio: what about - and .
[06:36:57] allisio: biubiubiu: Try it.
[06:37:17] enterprisey_: has joined #ruby
[06:37:50] biubiubiu: I just wonder is there a doc that said what you can use and what you cant
[06:38:11] biubiubiu: name rules should be chapter one
[06:39:30] allisio: It's all in here: https://ruby-doc.org/docs/ruby-doc-bundle/Manual/man-1.4/syntax.html
[06:41:10] jacksoon: has joined #ruby
[06:42:36] biubiubiu: no, it doesnt say I can use ?
[06:44:06] raul782: has joined #ruby
[06:45:02] nOwz: has joined #ruby
[06:47:09] juggler: has joined #ruby
[06:49:11] tAn: has joined #ruby
[06:50:44] Rodya_: has joined #ruby
[06:51:42] __Yiota: has joined #ruby
[06:54:47] lightheaded: has joined #ruby
[06:55:07] akkad: has joined #ruby
[06:56:11] pytuger: has joined #ruby
[06:56:23] pytuger: has joined #ruby
[06:57:18] tAn: has joined #ruby
[06:58:20] ajsharma: has joined #ruby
[06:59:15] maloik: has joined #ruby
[06:59:49] djbkd: has joined #ruby
[07:01:45] _djbkd: has joined #ruby
[07:02:33] uncertainty: has joined #ruby
[07:02:42] zenspider: has joined #ruby
[07:03:59] meinside: has joined #ruby
[07:08:17] keanny479: has joined #ruby
[07:08:20] keanny479: hello everyone
[07:08:44] keanny479: does someone can help me to refactor the following ?
[07:08:46] keanny479: ln = ln.center(SPACES).green.bold if winner && ln.include?(winner[0].to_s) && ln.include?(winner[1].to_s)
[07:09:31] dminuoso: keanny479: dont use modifier_if
[07:09:46] dminuoso: keanny479: and then you can use #|
[07:10:01] dminuoso: keanny479: how many elements does winner have? just these two?
[07:10:23] keanny479: dminuoso, just 2 elements
[07:10:27] dminuoso: and I mean #& of course
[07:10:43] dminuoso: (ln & winner.map(&:to_s)).empty?
[07:12:03] dminuoso: keanny479: https://gist.github.com/dminuoso/21bc84f586f4cd0b5dcc4d614b1f30ad
[07:12:36] dminuoso: depending on how the surrounding code looks, I might do an early return too
[07:12:51] Cohedrin: has joined #ruby
[07:13:16] muelleme: has joined #ruby
[07:13:25] dminuoso: such as the gist is now if you reload
[07:13:43] makufiru: has left #ruby: ()
[07:14:22] keanny479: dminuoso, i get : undefined method `&' for "+-------+----------+-------------+":String (NoMethodError)
[07:14:42] dminuoso: keanny479: Oh I thought it was an array my bad.
[07:15:14] dminuoso: keanny479: what are the possible contents of winner?
[07:16:12] keanny479: dminuoso, float and string
[07:19:06] edliss: has joined #ruby
[07:21:36] hutch34: has joined #ruby
[07:23:41] neuraload: has joined #ruby
[07:24:12] nOwz: has joined #ruby
[07:24:42] keanny479: dminuoso: an example of winner content : [20.121918907, "Guest"]
[07:25:23] itarato: has joined #ruby
[07:26:54] keanny479: dminuoso: a line of ln (this is a string) : "| Guest | 5 | 20.121918907 |"
[07:27:28] itarato: Hi there. I've seen this call pattern: `arr[idx]&.clone` - what does the `&` sign doing? I couldn't find any difference, neither any online reference.
[07:27:55] herwin: https://stackoverflow.com/questions/34583168/safe-navigation-operator-for-nil
[07:28:03] hotpancakes: has joined #ruby
[07:28:20] itarato: @herwin - Sweet, much appreciated :)
[07:28:34] herwin: http://mitrev.net/ruby/2015/11/13/the-operator-in-ruby/ is a better explanation
[07:29:26] itarato: herwin: I see, very useful. Thank you.
[07:29:53] Pumukel: has joined #ruby
[07:30:43] burgestrand: has joined #ruby
[07:32:08] djbkd: has joined #ruby
[07:34:44] pawnbox: has joined #ruby
[07:35:02] dionysus69: has joined #ruby
[07:38:01] __Yiota: has joined #ruby
[07:39:00] keanny479: anyone can help me to refactor this : ln = ln.center(SPACES).green.bold if winner && ln.include?(winner[0].to_s) && ln.include?(winner[1].to_s)
[07:39:04] last_staff: has joined #ruby
[07:43:30] linocisco: has joined #ruby
[07:43:44] conta: has joined #ruby
[07:44:10] linocisco: hi everybody, who is using ubuntu to develop ruby? what IDE is best for ruby ?
[07:44:59] enterprisey: has joined #ruby
[07:45:07] kassav_: has joined #ruby
[07:45:57] tomphp: has joined #ruby
[07:46:06] itarato: linocisco: Hi. If you have a large codebase and do it profesionally I believe Jetbrains Rubymine is the best without a doubt. However for small projects I like VisualCode - because of the nice plugin nd low footprint.
[07:50:14] keanny479: has joined #ruby
[07:51:52] Mortomes|Work: has joined #ruby
[07:55:28] tildes: linocisco: I use sublime, vim seems popular
[07:56:15] charliesome: has joined #ruby
[07:58:30] Rodya_: has joined #ruby
[08:00:41] tAn: has joined #ruby
[08:00:45] linocisco: itarato, thanks
[08:01:21] aganov: has joined #ruby
[08:01:38] linocisco: tildes, thanks . can sublime show result of ruby output inside editor?
[08:02:05] linocisco: tildes, I dont want to run ruby samplecode.rb in terminal
[08:02:32] aufi: has joined #ruby
[08:02:50] tildes: linocisco: I don't know about sublime, but I'm pretty sure you can do it with vim
[08:03:21] itarato: linocisco: Sublime has a build system, afaik in menu Tools/Build.
[08:03:23] tildes: linocisco: ... I run stuff in the terminal :-$
[08:03:58] itarato: linocisco: I think you can either find a sublime plugin that adds a ruby build option - or you can create yours - it's very simple
[08:04:33] itarato: linocisco: http://sublimetext.info/docs/en/reference/build_systems.html
[08:05:30] itarato: You only need the first line, something like: "cmd": ["/usr/bin/ruby", "$file"]
[08:05:57] pawnbox: has joined #ruby
[08:06:27] __Yiota: has joined #ruby
[08:06:47] tildes: itarato: cool stuff, thanks :D
[08:07:21] itarato: tildes: You're welcome
[08:07:47] linocisco: itarato, that is more advanced beyond my knowledge.
[08:08:10] linocisco: itarato, i once used atom for rails app
[08:09:52] itarato: linocisco: If you're not familiar with it, I recommend - get Submilime - from menu select "install plugin manager" (which allows you to install plugins) - then in plugin manager -> install plugin -> ruby - and check if the Tools/Build System has a ruby item - select it and with CTRL-B (or such) you test the build
[08:09:59] patarr: has joined #ruby
[08:10:09] pfedpy: has joined #ruby
[08:10:33] linocisco: itarato, thanks. you did explain to me in very comprehensive way. thanks alot
[08:10:33] TomyWork: has joined #ruby
[08:11:11] tildes: I need to create a http multipart request, haven't done that before. I can find two seemingly unmaintained gems, multipart-post and httmultiparty, some even older blog posts with code that probably would work...
[08:11:19] juggler: any ruby developers here on a Fedora platform?
[08:11:23] tildes: What would you recommend as of 2017? :)
[08:11:24] itarato: linocisco: No problem. I think in Atom you can simply define a JSON - so that might be more intuitive
[08:12:35] tildes: Another question is about terminology, what would you call the "header"-like rows for each multipart form field (if that is correct terminology either), i.e. rows 3-6 and row 10 in https://gist.github.com/anonymous/c5031fe6c3953e9296ff7baa458db327
[08:14:51] Clarity: has joined #ruby
[08:16:30] mark_66: has joined #ruby
[08:16:49] DARPA: has joined #ruby
[08:18:42] pawnbox: has joined #ruby
[08:18:44] hotpancakes: has joined #ruby
[08:19:27] linocisco: itarato, sublinetext is found not free for continued use.
[08:19:33] antgel: has joined #ruby
[08:20:26] tomphp: has joined #ruby
[08:20:48] itarato: linocisco: I'm not skilled at licences, but it's free if you don't mind its hourly popup, that's all.
[08:21:21] linocisco: itarato, thanks for comment
[08:24:52] sleetdrop: has joined #ruby
[08:25:29] andikr: has joined #ruby
[08:29:50] flying: has joined #ruby
[08:31:59] uncertainty: has joined #ruby
[08:32:23] xall: has joined #ruby
[08:33:40] xen0fon: has joined #ruby
[08:34:44] Clarity: if I'm stubbing a specific method on any instance of a class, in Rspec, is there way to also spy on that method? Like I want any instance of a class to return certain value but I also would like to know which arguments that methods was called with
[08:35:12] jancsi: has joined #ruby
[08:36:24] jancsi: hi all! I'm new to ruby. I've got an instance of a class. How can I enumerate through all the properties of this instance and print those ones that are not nil ?
[08:37:32] tildes: jancsi: my_object.methods gives you an Array of all methods the object can respond to
[08:38:24] tildes: jancsi: then you can use https://ruby-doc.org/core-2.4.0/Enumerable.html methods on the array, for instance each, and pass a block to it
[08:38:56] jancsi: tildes, I tried that, but that returns a lot of things. To be specific this is the Class I'm using: https://github.com/weppos/whois-parser/blob/547d5fbf352f56466ee4d631d4f86b3361fee8f8/lib/whois/parser/contact.rb
[08:39:03] tildes: jancsi: in the block you could use the object's send method, to get results for each method ...
[08:39:09] nofxxx: juggler, used fedora on my early linux days... 04~08 then I found out archlinux...heh ever since
[08:39:34] jancsi: tildes, if you take a look on that class, it does have some properties. I need to access them in a loop somehow.
[08:39:35] nofxxx: Clarity, just add some puts... no biggie if you remove'em later heh
[08:40:03] jancsi: tildes, without explicitly describing the property names
[08:40:08] nofxxx: jancsi, create a def attributes
[08:40:24] nofxxx: and pass all keys there... or maybe a CONSTANT
[08:40:27] esObe_: has joined #ruby
[08:40:27] tildes: jancsi: my_object.instance_variables gives you instance variables defined for that class
[08:40:45] tildes: jancsi: does that list look like what you want?
[08:40:58] nofxxx: there's just no point in the way you're trying to do it... are you a JS dev?
[08:41:09] A124: has joined #ruby
[08:41:25] jancsi: tildes, instance_variables returns an empty arrays
[08:42:25] jancsi: nofxxx, Yes it is easy to do in JS. But it is also easy to do in C# for example.
[08:42:47] tildes: jancsi: are you sure you call instance_variables on the instance of the class, and not on the class itself?
[08:42:50] uncertainty: has joined #ruby
[08:43:13] nofxxx: jancsi, that's a fault, not a feature
[08:43:40] nofxxx: check out how #to_json methods works... that's how you proper "inspect" , or squeeze an object
[08:45:30] nofxxx: or #to_hash
[08:47:38] tildes: jancsi: anyway to respond your question 10:36:23 you could do something like this: my_obj.instance_variables.each{|var| puts my_obj.instance_variable_get(var) unless my_obj.instance_variable_get(var).nil? }
[08:47:49] Clarity: lol nofxxx I need test coverage %% :D
[08:48:54] nofxxx: tildes, dunno which is uglier... his question or yr answer
[08:48:57] jancsi: tildes, ahh, you were right, I just realized I've got an array in which I have the instances of that class... let me fix that
[08:49:01] maattdd: has joined #ruby
[08:49:07] nofxxx: Clarity, userbase?
[08:49:35] Clarity: I'm just writing unit tests for a controller
[08:50:13] tildes: nofxxx: what I see is someone who is new to the language itself, asking a question, and I try to give some context and explain the methods, to help someone to learn :)
[08:50:26] tomphp: has joined #ruby
[08:50:48] uncertainty: has joined #ruby
[08:50:56] tildes: nofxxx: what the answer will be used for is whole another question
[08:51:13] nofxxx: tildes, another reason to explain the correct way
[08:51:17] tildes: nofxxx: however, whatever suggestions you have for improvement, please don't hesitate to share
[08:51:23] nofxxx: already did
[08:51:34] fivmo: has joined #ruby
[08:51:44] burgestrand: has joined #ruby
[08:52:08] olspookishmagus: has joined #ruby
[08:53:17] jancsi: tildes, hm interesting... this is what inspect gaves me: #<struct Whois::Parser::Contact id=nil, type=2, name=nil, organization=nil, address=nil, city=nil, zip=nil, state=nil, country=nil, country_code=nil, phone=nil, fax=nil, email=nil, url=nil, created_on=nil, updated_on=nil>
[08:53:27] jancsi: tildes, but instance_variables still an empty array
[08:53:28] lele: has joined #ruby
[08:53:51] tildes: nofxxx: you are talking about to_json and to_hash, but how do you know this is what jancsi is trying to achieve?
[08:54:14] tildes: it could be my Thursday eyes, but I can't guess the ultimate goal based on what I actually see
[08:54:45] tildes: jancsi: what is your ultimate goal btw, what are you trying to achieve? :)
[08:55:08] linocisco: has joined #ruby
[08:55:22] jancsi: tildes, I want to make a hash which stores only those properties of that object which is not nil
[08:55:47] aupadhye: has joined #ruby
[08:56:02] tildes: jancsi: why?
[08:56:03] jancsi: tildes, so in the example above the hash would only consist "type => 2"
[08:56:34] tildes: this could be first time I see a ruby class inheriting something called SuperStruct
[08:56:36] jancsi: tildes, I need to filter them. The hash itself will eventually be a JSON object that will be sent to a document store (CouchDB)
[08:57:46] tildes: jancsi: what does to_json say?
[08:58:02] ddffg: has joined #ruby
[08:58:05] nofxxx: tildes, I beg you pardon, and accuse my eyes also... I've read he created a class, so my answer fits... but it's not a third party class also (so your answer fits) hehe..it's a Struct!
[08:58:45] tomphp: has joined #ruby
[08:58:50] jancsi: tildes, it gives me the same as inspect but as a string, no json format at all
[08:58:59] nofxxx: jancsi, have fun -> https://ruby-doc.org/core-2.2.0/Struct.html#method-i-members
[08:59:22] Rodya_: has joined #ruby
[08:59:59] jancsi: nofxxx, oh yes! :)
[09:00:34] jancsi: " class Contact < SuperStruct.new " -> this confused me. I thought its a class...
[09:01:01] tildes: jancsi: you are using structs in quite a special way
[09:01:34] dhollin3: has joined #ruby
[09:01:40] nofxxx: jancsi, yup, it's in that gem de definition: https://github.com/weppos/whois-parser/blob/547d5fbf352f56466ee4d631d4f86b3361fee8f8/lib/whois/parser/super_struct.rb
[09:01:55] jancsi: tildes, I want to make this code future proof. So if the author of whois-parser adds new members to this struct, my code would still work.
[09:04:20] rhyselsmore: has joined #ruby
[09:04:21] biberu: has joined #ruby
[09:04:49] jsrn_: has joined #ruby
[09:05:46] lenwood: has joined #ruby
[09:06:49] dmnd: has joined #ruby
[09:07:23] jancsi: nofxxx, tildes, thank you a lot for the help! it works now :)
[09:07:50] patarr: has joined #ruby
[09:08:12] tildes: jancsi: using / overwriting (if necessary) to_json method would be nice for future readers
[09:09:00] hotpancakes: has joined #ruby
[09:10:49] jgnagy: has joined #ruby
[09:12:35] uncertainty: has joined #ruby
[09:14:40] milardovich: has joined #ruby
[09:14:58] tvw: has joined #ruby
[09:16:45] habitullence: has joined #ruby
[09:17:55] charliesome: has joined #ruby
[09:18:37] dionysus69: has joined #ruby
[09:19:45] cibs: has joined #ruby
[09:23:09] Silthias: has joined #ruby
[09:23:11] hutch34: has joined #ruby
[09:27:00] xall: has joined #ruby
[09:27:22] astrobunny: has joined #ruby
[09:29:21] tvw: has joined #ruby
[09:32:25] tildes: jancsi: instance_values gives you a hash to begin with, which you could parse like so my_obj.instance_values.reject{|key, val| val.nil? }
[09:33:33] jancsi: tildes, instance_values gave me an empty array
[09:33:51] tildes: jancsi: again you need to check if you call it on class, or class instance
[09:34:33] tildes: I can't really follow the super struct structures you are using given time constraints, but as a general principle
[09:34:50] jenrzzz: has joined #ruby
[09:34:50] jenrzzz: has joined #ruby
[09:35:45] jancsi: tildes, I don't think structs has that method
[09:35:53] jancsi: or implemented
[09:36:49] tildes: Object.respond_to? :instance_values # => true
[09:36:58] tildes: Struct.ancestors.include? Object # => true
[09:37:50] tildes: jancsi: anyway, if you have something working, maybe that is enough at this point. just found myself thinking about your options
[09:38:19] tomphp: has joined #ruby
[09:39:01] jancsi: tildes, I appreciate it! :)
[09:39:24] pawnbox: has joined #ruby
[09:40:31] leitz: has joined #ruby
[09:41:30] sagarkinare007: has joined #ruby
[09:42:10] zacts: havenwood: I have a paper I don't understand that you might like
[09:42:31] zacts: havenwood: http://projects.csail.mit.edu/wiki/pub/JoeNear/FernMonad/frons.pdf
[09:43:00] zacts: havenwood: I discovered it from this lecture by Guy Steele Jr. https://www.youtube.com/watch?v=IHP7P_HlcBk
[09:43:15] whiteline: has joined #ruby
[09:43:26] jancsi: tildes, "each_pair" seems to be working too, instead of "members"
[09:45:14] ferr1: has joined #ruby
[09:46:06] zacts: havenwood: the part in the YouTube clip where he mentions the paper is at 17min exactly
[09:46:21] zacts: his description of the paper is what makes you realize how cool it sounds
[09:46:42] zacts: (I just thought you might like this because of your exlir.rb gem)
[09:47:08] zacts: it might be cool to implement a gem for something similar to the fern datatype in that paper
[09:47:32] zacts: but I don't fully understand the paper really
[09:47:36] zacts: ACTION idles
[09:47:56] blackmes1: has joined #ruby
[09:50:04] cschneid_: has joined #ruby
[09:50:38] maattdd_: has joined #ruby
[09:52:31] leitz: if gem install brings in dependencies, is there a way to gem uninstall and remove the dependecies with the original gem installed?
[09:52:41] ianfleeton: has joined #ruby
[09:53:30] Paraxial: has joined #ruby
[09:55:34] juggler: nofxxx ahhhh :)
[09:58:25] neuraload: has joined #ruby
[09:59:09] lxsameer: has joined #ruby
[09:59:45] kassav_: has joined #ruby
[10:00:02] Rodya_: has joined #ruby
[10:02:03] Qchmqs: has joined #ruby
[10:02:40] toretore: has joined #ruby
[10:02:43] nettoweb: has joined #ruby
[10:03:00] harfangk: has joined #ruby
[10:05:57] aupadhye: has joined #ruby
[10:08:03] Doow: has joined #ruby
[10:10:38] qchmqs_: has joined #ruby
[10:11:27] Doow: Hi, I'm having a problem writing files from ruby where the line endings get written as \r\n while I want only \n. I'm on windows.
[10:11:32] Doow: example: https://gist.github.com/anonymous/0b8e8ceac1c3f30dacaf5dc3eeb54a75
[10:12:26] workmad3: has joined #ruby
[10:12:54] manveru: Doow: your strings array contains entries like ["foo\r\n", "bar\r\n"]
[10:13:54] Doow: manveru, I don't think so, and even if it did, shouldn't I the encode strip them?
[10:14:28] manveru: i've never seen universal_newline :)
[10:14:30] manveru: lemme check
[10:14:37] Doow: I think it's something happening inside strings_file.write()
[10:14:47] Doow: but this is new territory for me =)
[10:15:13] Doow: the documentation I looked at: http://ruby-doc.org/core-2.4.0/String.html#method-i-encode
[10:15:44] manveru: you can try opening the file in wb mode instead
[10:15:51] Qchmqs: has joined #ruby
[10:15:52] manveru: but write shouldn't insert any newlines
[10:16:07] manveru: so it's strange either way
[10:17:19] Doow: "wb" solved the problem, so it's almost certainly something going on in there
[10:17:31] manveru: b stands for binary mode
[10:17:48] manveru: it's possible your system encoding is a bit strange
[10:18:06] manveru: what's your Encoding.default_external ?
[10:18:10] chagel: has joined #ruby
[10:18:19] uncertainty: has joined #ruby
[10:18:28] kristofferR: has joined #ruby
[10:18:52] manveru: well, that's also something i haven't seen before :)
[10:19:54] manveru: it's probably best if you write the file with UTF-8 instead
[10:20:05] Doow: Me neither, I haven't built ruby myself and I'm pretty sure I downloaded from https://www.ruby-lang.org/en/downloads/ so shouldn't be anything odd
[10:20:18] manveru: no, that's from your windows environment variables
[10:20:23] Doow: How can I change it?
[10:20:38] pandaant: has joined #ruby
[10:24:32] hutch34: has joined #ruby
[10:25:13] manveru: File.open(path, 'w+:UTF-8'){|file| strings.each{|line| file.print(line.encode('UTF-8', universal_newline: true)) } }
[10:25:36] Doow: thanks =D
[10:26:07] teclator: has joined #ruby
[10:26:22] manveru: those args are documented at https://ruby-doc.org/core-2.1.4/IO.html#method-c-new
[10:26:40] manveru: using the block with File.open makes sure the file is closed again, otherwise you might leak file descriptors
[10:27:47] dionysus69: has joined #ruby
[10:33:12] dunpeal: has joined #ruby
[10:33:49] dunpeal: Hi. So I'm writing a new small library. I created the following tree structure: mylib/ mylib/lib mylib/spec
[10:34:09] dminuoso: Sounds good.
[10:34:13] ruby[bot]: dminuoso: I don't know anything about next
[10:34:29] dunpeal: Haha. Question is: in mylib/spec RSpec, how do I make sure I can require mylib?
[10:35:19] dunpeal: I.E. how do I ensure the tests in mylib/spec can require code from mylib/lib?
[10:35:40] manveru: dunpeal: you can use require_relative
[10:35:48] neuraload: has joined #ruby
[10:35:56] dunpeal: OK, is that the most elegant way?
[10:35:56] dminuoso: manveru: No.
[10:35:58] dminuoso: dunpeal: No.
[10:36:00] dminuoso: dunpeal: https://relishapp.com/rspec/rspec-core/docs/command-line
[10:36:03] dminuoso: dunpeal: You dont have to do anything.
[10:36:12] dminuoso: rspec will do all of this for you.
[10:36:25] manveru: make a mylib/spec/helper.rb with `require_relative "../lib/mylib"` and require that in your files :)
[10:36:32] dminuoso: This is getting worse.
[10:36:45] dminuoso: manveru: rspec will fucking add lib/ to the LOAD_PATH for you already.
[10:36:48] uncertainty: has joined #ruby
[10:37:36] manveru: ignore me then :)
[10:37:41] dminuoso: just "require mylib"
[10:37:57] burgestrand: Downside is if you have dependencies, since rspec won't respect gem version restrictions specified in your gemspec.
[10:38:21] dminuoso: Burgestrand: You can use bundler to take care of that
[10:38:35] burgestrand: dminuoso Exactly!
[10:38:44] manveru: i don't use rspec usually, that's just how i do it in bacon which doesn't mess with my LOAD_PATH
[10:39:29] burgestrand: i.e. use bundler for development, don't check in your Gemfile.lock, and in your spec_helper.rb be content with `require 'bundler/setup'` and then do `require 'mylib'`!
[10:39:30] manveru: and require_relative is still faster since it doesn't have to search the file...
[10:39:37] pwnd_nsfw`: has joined #ruby
[10:39:58] dminuoso: Burgestrand: or just use "bundle exec rspec" :-)
[10:40:21] AlHafoudh: has joined #ruby
[10:40:46] dminuoso: ACTION has a `be' bash alias
[10:40:48] burgestrand: dminuoso I prefer a setup that doesn't allow me to make mistakes
[10:41:03] dminuoso: Burgestrand: Fair enough. It's become such a habit to execute everything with "be" in front of it.
[10:41:10] dminuoso: For me anyway.
[10:41:13] burgestrand: dminuoso Haha, I agree, I do it all the time, even in other languages.
[10:41:51] marr: has joined #ruby
[10:42:01] dminuoso: Burgestrand: I almost feel like the rspec binstub should check whether there's a Gemfile, and then load the bundle.
[10:42:06] dminuoso: That would be awesome.
[10:42:12] dminuoso: rails does this
[10:42:30] dminuoso: ACTION thinks
[10:44:36] ledestin: has joined #ruby
[10:44:45] gizmore: has joined #ruby
[10:45:10] xenops: has joined #ruby
[10:51:31] TvL2386: has joined #ruby
[10:52:14] jancsi: is it possible to create a hash where both keys and values are symbols?
[10:52:55] tobiasvl: jancsi: yes
[10:53:40] jancsi: tobiasvl, it is the form of: hash => { :symbol_one => :symbol_two } ?
[10:53:51] Gazeth_Sonica: has joined #ruby
[10:53:57] allisio: Or `{one: :two}`, but that's ugly.
[10:54:13] lightheaded: has joined #ruby
[10:55:59] tobiasvl: jancsi: yes. should be pretty easy for you to test
[10:56:01] chenzfroff: has joined #ruby
[10:56:08] chenzfroff: has left #ruby: ()
[10:56:10] tobiasvl: >> { :symbol_one => :symbol_two }
[10:56:11] ruby[bot]: tobiasvl: # => {:symbol_one=>:symbol_two} (https://eval.in/755662)
[10:56:20] chenzfroff: has joined #ruby
[10:57:07] pwnd_nsfw: has joined #ruby
[10:59:36] CloCkWeRX: has joined #ruby
[11:00:48] Rodya_: has joined #ruby
[11:00:51] fivmo: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[11:03:59] chenzfroff: has joined #ruby
[11:09:35] gregf_: has joined #ruby
[11:10:56] dunpeal: dminuoso: looks like I have to do rspec -I. spec/*.spec
[11:11:07] dunpeal: otherwise rspec can't see lib/
[11:13:47] maattdd: has joined #ruby
[11:17:14] edliss_: has joined #ruby
[11:19:33] lightheaded: has joined #ruby
[11:20:27] hotpancakes: has joined #ruby
[11:23:03] dunpeal: Are there custom string processors in Ruby?
[11:23:29] dunpeal: I'd like to do something like %{foo} #=> evaluates to the result of bar("foo")
[11:23:33] dunpeal: Is that possible?
[11:23:33] kristofferR: has joined #ruby
[11:24:35] allisio: dunpeal: String#~ isn't defined by default; maybe just use that instead?
[11:24:43] jaruga________: has joined #ruby
[11:25:07] hutch34: has joined #ruby
[11:27:31] dunpeal: allisio: not a bad idea! any other, similar methods?
[11:27:52] lkb: has joined #ruby
[11:28:02] allisio: dunpeal: There are also #+@ and #-@, but those were taken in 2.4 for freezing.
[11:28:19] lkb: has joined #ruby
[11:29:21] allisio: >> class String; alias +@ upcase end; +'foo'
[11:29:22] ruby[bot]: allisio: # => "FOO" (https://eval.in/755678)
[11:29:28] linocisco: has joined #ruby
[11:29:35] rizonz: nofxxx: lolz, that is what woman always say... there is no-one more lovely then me... and code can be a biatch :P
[11:29:55] lkb: has joined #ruby
[11:30:19] lightheaded: has joined #ruby
[11:30:38] dunpeal: allisio: thanks!
[11:30:45] allisio: dunpeal: Sure thing.
[11:30:56] luknerw: has joined #ruby
[11:31:10] allisio: There *is* a way to respond to the creation of string literals pre-2.3 or so, but that way lies madness.
[11:32:10] dunpeal: allisio: how? and was it removed?
[11:32:26] luknerw: has joined #ruby
[11:32:41] allisio: dunpeal: FrozenCore. It wasn't removed, but I'm pretty sure it's impossible to redefine its methods these days.
[11:33:19] lkb: has joined #ruby
[11:34:11] allisio: But never mind; it was Hash literals you could respond to.
[11:34:44] zipper: has joined #ruby
[11:35:01] zipper: Why does rvm advise that I import someone gpg keys?
[11:35:07] zipper: *someone's
[11:35:30] dunpeal: OK. Simpler question: when I run `rspec`, it finds tests under spec/foo_spec.rb, but inside that test, I'm trying to `require "lib/foo"`. It doesn't work, because lib is a sibling of spec. Is there a good, elegant fix?
[11:35:54] allisio: Why is lib/ in spec/?
[11:36:18] dunpeal: allisio: it's not, it's a sibling, i.e. at the same level.
[11:36:31] dunpeal: i.e. I have mylib/lib and mylib/spec
[11:36:46] inersha: has joined #ruby
[11:37:12] allisio: Right, that was a bad derp.
[11:37:35] allisio: You really should just `require 'foo'` and arrange to have RSpec load your library.
[11:37:37] burgestrand: dunpeal typically you don't include `lib` in your requirement, you assume that the $LOAD_PATH is set up.
[11:37:58] burgestrand: dunpeal so when you `require "foo"` Ruby already knows to check in `lib/` first.
[11:38:07] inersha: I want to create a string like this: ""{n:1}, {n:2}, {n:3} ... {n:100}". Is there a more rubyesque way of doing it than this:
[11:38:08] luknerw: has joined #ruby
[11:38:09] burgestrand: dminuoso mentioned that RSpec does this for you already.
[11:38:12] inersha: list = Array.new
[11:38:17] inersha: for i in 1..200 do
[11:38:21] allisio: If you're really keen, `require_relative '../lib/foo'` will get you there.
[11:38:21] inersha: list << "{n:#{i}}"
[11:38:31] inersha: list = list.join(', ')
[11:38:40] mnemon: zipper: because the installation files are signed with gpg
[11:38:41] allisio: &ri #map inersha
[11:38:41] `derpy: inersha: http://ruby-doc.org/core-2.4.0/Array.html#method-i-map
[11:38:47] burgestrand: >> Array.new(100) { |i| "{n:#{i}}" }
[11:38:52] ruby[bot]: Burgestrand: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[11:38:53] dunpeal: Burgestrand: thanks. how does RSpec know to include lib?
[11:39:05] allisio: They built that smart right in.
[11:39:08] inersha: Burgestrand: Thanks!
[11:39:12] Qchmqs: has joined #ruby
[11:39:20] zipper: mnemon: I see
[11:39:24] burgestrand: dunpeal No idea! I typically use bundler when I develop gems, and in my `spec_helper.rb` I do `require "bundler/setup"`.
[11:39:42] burgestrand: dunpeal (bundler does this for you, assuming your Gemfile has `gemspec` in it)
[11:40:21] burgestrand: dunpeal you can look at e.g. https://github.com/Burgestrand/spotify to see how I set things up.
[11:40:48] dunpeal: One more question: what's the Ruby equivalent of a specification for commenting format?
[11:40:58] burgestrand: dunpeal rdoc or YARDoc
[11:41:04] dunpeal: i.e. like javadoc in Java, or pydoc in Python
[11:41:13] dunpeal: Burgestrand: this rdoc: http://rdoc.sourceforge.net/doc/
[11:41:37] burgestrand: dunpeal I believe so, typically I use YARDoc since I both prefer the output and the specification :)
[11:41:48] burgestrand: dunpeal http://yardoc.org
[11:41:59] dunpeal: Doesn't seem to have a standard way to document method parameters, which is pretty important
[11:42:05] lenwood: has joined #ruby
[11:42:13] loechel: has joined #ruby
[11:42:35] JeanCarloMachado: has joined #ruby
[11:42:44] burgestrand: dunpeal YARDoc has @param
[11:43:13] tdy: has joined #ruby
[11:43:16] burgestrand: dunpeal oh, btw, the setup for my spotify gem is too outdated, if you were to look at the setup I'd look at https://github.com/elabs/serial instead
[11:43:38] burgestrand: (I thought it was new enough, turns out it's in need of a touch-up :))
[11:44:51] burgestrand: dunpeal serial also happen to be documented using YARDoc and also has a rake task for generating the documentation
[11:45:03] lightheaded: has joined #ruby
[11:46:06] alibby: has joined #ruby
[11:46:08] zipper: mnemon: You familiar with "gpg: keyserver receive failed: No route to host"? Am I having something like DNS issues
[11:46:24] burgestrand: dunpeal rubydoc.info hosts documentation for public projects too, so sample output could look like this: http://www.rubydoc.info/github/elabs/serial/master
[11:47:52] dunpeal: Burgestrand: thanks
[11:50:18] conta: has joined #ruby
[11:51:14] Pumukel: has joined #ruby
[11:56:21] senayar: has joined #ruby
[11:57:01] mula: has joined #ruby
[11:59:23] inersha: has left #ruby: ("thanks for the help :)")
[12:00:10] linocisco: has joined #ruby
[12:01:04] kristofferR: has joined #ruby
[12:01:38] Rodya_: has joined #ruby
[12:01:53] mula: has joined #ruby
[12:03:46] kristofferR: has joined #ruby
[12:04:23] uncertainty: has joined #ruby
[12:05:08] pawnbox: has joined #ruby
[12:06:44] ldnunes: has joined #ruby
[12:07:03] dminuoso: 12:37 < allisio> You really should just `require 'foo'` and arrange to have RSpec load your library.
[12:07:08] dminuoso: The beauty is you dont have to do that. :-)
[12:07:40] allisio: dminuoso: *accept the arrangement
[12:07:43] allisio: Or some such.
[12:08:47] allisio: Programmatically-accessible documentation is a Good Thing, and Ruby should've had it years ago. :/
[12:08:50] allisio: Anyway: https://eval.in/755701
[12:09:33] allisio: dunpeal: Out of curiosity, what use case did you have in mind for String#~?
[12:11:27] __Yiota: has joined #ruby
[12:13:23] augcesar: has joined #ruby
[12:14:30] czeq: has joined #ruby
[12:15:32] HoierM: has joined #ruby
[12:16:16] mula: has joined #ruby
[12:19:00] dangerousdave: has joined #ruby
[12:20:16] nadir: has joined #ruby
[12:23:36] teddysmoker: has joined #ruby
[12:35:48] inbx: has joined #ruby
[12:36:05] edliss: has joined #ruby
[12:39:17] rfoust: has joined #ruby
[12:40:31] mnemon: zipper: Seems like a routing issue(no route to the resolved ip).
[12:41:30] edliss: has joined #ruby
[12:41:48] Pumukel: has joined #ruby
[12:43:56] lxsameer: has joined #ruby
[12:50:30] milardovich: has joined #ruby
[12:50:50] Gazeth_Sonica: Guys beginner question, if i want to recall a variable, wouldn that be:
[12:51:02] Gazeth_Sonica: puts ¨#{something}¨?
[12:51:18] burgestrand: >> a = 5; puts "#{a}"
[12:51:19] ruby[bot]: Burgestrand: # => 5 ...check link for more (https://eval.in/755719)
[12:52:07] Gazeth_Sonica: thanks! I must be doing something else wrong then, iĺl figure it out o/
[12:52:47] burgestrand: Gazeth_Sonica mind your quotes, btw :)
[12:52:50] allisio: Are you using Word as your editor?
[12:53:23] burgestrand: Gazeth_Sonica ^
[12:53:24] Gazeth_Sonica: no im using codecadamy
[12:53:48] Gazeth_Sonica: but it just displays {a} in the output
[12:54:00] burgestrand: Gazeth_Sonica are you using single-quotes perhaps?
[12:54:28] Gazeth_Sonica: nope, ill the code in pastebin (only 4 lines)
[12:54:38] allisio: You're probably forgetting the '#'.
[12:54:46] elomatreb: If you just want to output the variable, you don't need the string interpolation btw
[12:54:48] elomatreb: >> a = 5; puts a
[12:54:50] ruby[bot]: elomatreb: # => 5 ...check link for more (https://eval.in/755721)
[12:54:57] Pumukel: has joined #ruby
[12:55:08] ebbflowgo: has joined #ruby
[12:55:11] Pumukel: has joined #ruby
[12:55:13] burgestrand: Gazeth_Sonica you can use eval.in, it'll run the code too
[12:55:25] Derperperd: has joined #ruby
[12:56:08] dminuoso: ¨#{something}¨
[12:56:17] dminuoso: ACTION punches Gazeth_Sonica 
[12:56:21] dminuoso: Gazeth_Sonica: something.to_s
[12:56:31] Gazeth_Sonica: oh thanks for the link
[12:56:50] Gazeth_Sonica: sorry other ppl distracting me atm ><, im checking out the link
[12:57:17] olivier__: has joined #ruby
[12:57:34] burgestrand: I'm still curious what the problem was with your first try :d
[12:58:14] Gazeth_Sonica: still not sure, i thought i had the # but i removed all text and just left the variable
[12:58:33] Gazeth_Sonica: now i added the text back and the variable isnt broken
[12:58:46] allisio: You were missing the '#'.
[12:58:48] Gazeth_Sonica: so the mistake must have been between my desk and my chair
[12:59:06] allisio: >> ['#{a}', "{a}"]
[12:59:11] ruby[bot]: allisio: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[12:59:14] pawnbox: has joined #ruby
[13:00:17] hotpancakes: has joined #ruby
[13:00:25] allisio: Anyway, the first results in "\#{a}"; that's not what you were seeing, so it must've been the latter.
[13:01:00] mzo: has joined #ruby
[13:01:25] pawnbox: has joined #ruby
[13:01:56] ramortegui: has joined #ruby
[13:02:20] Rodya_: has joined #ruby
[13:02:45] ldnunes: has joined #ruby
[13:02:58] xall: has joined #ruby
[13:04:15] Raboo: has joined #ruby
[13:05:56] Kero: has left #ruby: ()
[13:11:44] __Yiota: has joined #ruby
[13:12:30] jgnagy: has joined #ruby
[13:13:44] uncertainty: has joined #ruby
[13:15:04] lenwood: has joined #ruby
[13:15:18] bmurt: has joined #ruby
[13:19:39] ramortegui: has joined #ruby
[13:20:40] milardovich: has joined #ruby
[13:21:58] tAn: has joined #ruby
[13:22:07] millerti: has joined #ruby
[13:25:51] baked__beans: has joined #ruby
[13:29:24] agent_white: has joined #ruby
[13:29:31] DLSteve_: has joined #ruby
[13:31:16] dionysus69: has joined #ruby
[13:31:25] esObe_: has joined #ruby
[13:34:55] olivier__: has joined #ruby
[13:40:28] xen0fon: has joined #ruby
[13:41:27] invalidusrname: has joined #ruby
[13:44:47] xall: has joined #ruby
[13:47:42] agent_white: Mornin' folks
[13:48:07] swills: has joined #ruby
[13:51:28] jaruga________: has joined #ruby
[13:51:53] shinnya: has joined #ruby
[13:54:04] hutch34: has joined #ruby
[13:55:08] Fernando-Basso: has joined #ruby
[14:00:10] swills: has joined #ruby
[14:01:26] hotpancakes: has joined #ruby
[14:02:38] xen0fon: has joined #ruby
[14:02:51] Fin1te: has joined #ruby
[14:03:06] Rodya_: has joined #ruby
[14:03:17] dangerousdave: has joined #ruby
[14:04:09] psychicist__: has joined #ruby
[14:06:30] Silthias: has left #ruby: ()
[14:07:49] jackjackdripper: has joined #ruby
[14:08:43] millerti: has joined #ruby
[14:10:26] mula: has joined #ruby
[14:15:21] kobain: has joined #ruby
[14:18:52] chouhoulis: has joined #ruby
[14:22:01] hotpancakes: has joined #ruby
[14:24:01] hutch34: has joined #ruby
[14:24:38] dunpeal: allisio: it converts a certain notation to a complex object.
[14:24:59] aupadhye: has joined #ruby
[14:25:15] cdg: has joined #ruby
[14:26:11] adam12: allisio: This was that gem I was looking for last night. https://github.com/inf0rmer/blanket
[14:26:23] cpruitt: has joined #ruby
[14:27:31] pawnbox: has joined #ruby
[14:27:42] nofxxx: has joined #ruby
[14:29:04] millerti: has joined #ruby
[14:30:24] Silthias: has joined #ruby
[14:35:58] allisio: adam12: Nifty.
[14:36:22] adam12: allisio: I'm sticking with HTTP.rb but at least I don't feel like I'm going crazy anymore ;)
[14:43:47] bougyman: has joined #ruby
[14:45:53] rizonz: has joined #ruby
[14:56:36] quirkycoder: has joined #ruby
[14:57:18] quirkycoder: So I have the following code but it's telling that the next in my rescue is invalid. All the example I see online have it the same way. https://gist.github.com/jpstokes/7727eeaf42e24e477c3cb077b3145840
[14:57:23] quirkycoder: Any suggestions?
[14:57:44] edliss: has joined #ruby
[14:57:56] blackmes1: has joined #ruby
[14:57:59] matthewd: quirkycoders: next what?
[14:58:06] workmad3: has joined #ruby
[14:58:43] quirkycoders: Just following what I see here: http://stackoverflow.com/questions/2624835/ruby-continue-a-loop-after-catching-an-exception
[14:59:13] hxegon: quirkycoders, matthewd: also shouldn't the "Sending Program Alerts..." message be sent before begin?
[14:59:39] matthewd: quirkycoders: You're rescuing outside the loop
[15:00:08] lightheaded: has joined #ruby
[15:00:34] bryanthompson: has joined #ruby
[15:02:32] last_staff: has joined #ruby
[15:02:38] quirkycoders: OK...will try that thanks
[15:03:44] allisio: adam12: I went one or two steps too far: https://eval.in/755770
[15:03:48] Rodya_: has joined #ruby
[15:04:15] adam12: allisio: you monster
[15:04:56] cschneid_: has joined #ruby
[15:08:17] patarr: has joined #ruby
[15:08:44] pulkit4tech: has joined #ruby
[15:10:32] cdg: has joined #ruby
[15:11:54] raul782: has joined #ruby
[15:12:02] dhollin3: has joined #ruby
[15:13:36] lightheaded: has joined #ruby
[15:15:07] Guest92871: has joined #ruby
[15:18:28] ElDoggo: has joined #ruby
[15:21:07] millerti: has joined #ruby
[15:21:19] yeticry_: has joined #ruby
[15:22:20] milardovich: has joined #ruby
[15:25:24] ozcanesen: has joined #ruby
[15:25:30] olivier__: has joined #ruby
[15:27:46] brent__: has joined #ruby
[15:30:11] edliss: has joined #ruby
[15:31:25] cfec0b8d: has joined #ruby
[15:31:27] hotpancakes: has joined #ruby
[15:38:17] olivier__: has joined #ruby
[15:39:31] cagomez: has joined #ruby
[15:42:36] nobitanobi: has joined #ruby
[15:42:47] lenwood: has joined #ruby
[15:43:06] cagomez: first time using RoR on an existing codebase. when I enter `rails db` I get dropped into a psql console. what are the commands I can use to interact in this console? Is it this: https://www.postgresql.org/docs/9.0/static/app-psql.html
[15:43:44] nobitanobi: hey alls. How do you call this pattern where you define a method like this: "self.[]" and then you basically call the MyClass[arg1,arg2]? I have seen it usually for classes that you command to do something, but I forgot the name of the pattern if any
[15:46:21] matthewd: cagomez: Yes
[15:47:09] Papierkorb: cagomez: You can also type `\help` (with a backspace) for in-shell help there
[15:47:10] elomatreb: nobitanobi: Hash.[] and Array.[] create new instances from their arguments, but I don't know a name for that pattern either
[15:47:15] matthewd: (sorry, should've answered in #rubyonrails instead)
[15:47:23] cagomez: oh nice, thanks Papierkorb
[15:47:41] Papierkorb: s/backspace/backslash/
[15:47:42] nobitanobi: elomatreb: I've seen it people definining in its own classes, so instead of doing MyClass.new.execute(a,b,c), they do MyClass[a,b,c]
[15:48:21] TomyLobo2: has joined #ruby
[15:49:24] hutch34: has joined #ruby
[15:49:49] baweaver: Normally because it's cleaner than injecting it into the Kernel so you can MyClass(a,b,c)
[15:50:09] baweaver: instead it's just: class MyClass; def self.[](args) ... end; end
[15:51:11] V1s1ble: has joined #ruby
[15:51:17] sagax: has joined #ruby
[15:53:19] hotpancakes: has joined #ruby
[15:54:15] amclain: has joined #ruby
[15:55:26] Derperperd: has joined #ruby
[15:56:26] kinduff: has joined #ruby
[15:57:10] username1: has joined #ruby
[16:01:27] olspookishmagus: has joined #ruby
[16:01:43] lightheaded: has joined #ruby
[16:02:13] gusrub: has joined #ruby
[16:02:56] [Butch]: has joined #ruby
[16:03:17] unique: has joined #ruby
[16:03:24] millerti: has joined #ruby
[16:03:27] bkxd: has joined #ruby
[16:03:27] cagomez: has joined #ruby
[16:03:45] unique: Why is Ruby "very complex from inside, just like our human bodies."?
[16:04:14] baweaver: that's a rather unique question
[16:04:21] baweaver: also doesn't make much sense
[16:05:14] ledestin: has joined #ruby
[16:05:53] mula: has joined #ruby
[16:05:53] Papierkorb: unique: Is your question from a quote you read somewhere? If yes, where? (I haven't heard of this either before)
[16:07:57] anekant: why is ruby so needlessly controlling, forcing me to edit hundreds of files to change a require to require_relative?
[16:08:13] DoubleMalt: has joined #ruby
[16:08:46] allisio: Why is Ruby so loving, permitting me to do whatever the hell I want whencever I wish?
[16:09:07] anekant: can i add . into $LOAD_PATH
[16:09:19] anekant: like globally forever
[16:09:24] kinduff: has joined #ruby
[16:10:29] anekant: whoever took it out is an insensitive clod.
[16:10:38] baweaver: anekant: be nice.
[16:12:34] baweaver: You could, though I don't believe it was ever there to begin with
[16:13:36] kinduff: has joined #ruby
[16:13:57] V1s1ble: has joined #ruby
[16:13:57] V1s1ble: has joined #ruby
[16:14:25] blackwind_123: has joined #ruby
[16:15:51] bmurt: has joined #ruby
[16:17:49] allisio: 18>> $:[-1]
[16:17:50] ruby[bot]: allisio: # => "." (https://eval.in/755816)
[16:18:03] allisio: Better than it being at the very front, anyway.
[16:18:13] hotpanca_: has joined #ruby
[16:18:24] dionysus69: has joined #ruby
[16:18:30] allisio: Kinda where you'd want it to be, though, if you did in fact want it in there.
[16:18:47] unique: I meant, why ruby should be very complex from inside?
[16:20:59] linux13337: has joined #ruby
[16:21:05] havenwood: anekant: It's long been considered unsafe to have "." in your load path. Switch to require_relative.
[16:22:15] hxegon: unique: Well, there are 2 types of complexity, accidental and essential. What the ration is inside Ruby, I'm not sure, but I am sure that there is a lot of essential complexity in Ruby, and in our body. Essential complexity is basically complexity that is inherint in the problem domain, vs accidental complexity which arises from poor quality of work, external constraints etc.
[16:22:29] dionysus69: has joined #ruby
[16:22:45] hxegon: s/inherint/inherent
[16:23:01] hxegon: also s/ration/ratio
[16:23:23] Sylario: has joined #ruby
[16:23:25] yxhuvud: has joined #ruby
[16:23:34] havenwood: anekant: It's better to require relative to the file from which it was called rather than the working directory. Progress!
[16:23:43] raul782: has joined #ruby
[16:25:34] skalfyfan: has joined #ruby
[16:26:09] hxegon: unique: also, sometimes things trade off an increase of internal complexity for some kind of external benefit, like a manual vs automatic transmission in a car. The manual may be much more simple/reliable mechanically, and yet most cars are automatic
[16:27:18] kitikonti: has joined #ruby
[16:27:51] BackEndCoder: has joined #ruby
[16:28:26] raul782: has joined #ruby
[16:28:43] psychicist__: has joined #ruby
[16:31:50] hotpancakes: has joined #ruby
[16:32:01] allisio: America is the only country.
[16:32:56] yxhuvud: has joined #ruby
[16:33:00] gusrub: has joined #ruby
[16:35:28] polishdub: has joined #ruby
[16:38:51] pwnd_nsfw`: has joined #ruby
[16:39:38] d0nn1e: has joined #ruby
[16:39:59] bmurt: has joined #ruby
[16:40:42] jackjackdripper: has joined #ruby
[16:40:46] anekant: one man's progress is another man's sadism
[16:41:44] dar123: has joined #ruby
[16:43:24] anekant: how can i monkey-patch to include . in the $LOAD_PATH each time ruby starts?
[16:44:37] allisio: You're barking up the wrong tree.
[16:46:13] rahul_bajaj: has joined #ruby
[16:47:18] xzhao: has joined #ruby
[16:47:30] hotpancakes: has joined #ruby
[16:47:46] anekant: i could fork it huh
[16:47:53] anekant: you guys are all wrong on security
[16:48:40] MrJoshua: has joined #ruby
[16:49:01] MrJoshua: has joined #ruby
[16:50:25] nobitanobi: has joined #ruby
[16:50:30] hxegon: ?coffee anekant
[16:50:30] ruby[bot]: anekant: here's a coffee, you seem to need it: ☕
[16:50:37] nobitanobi: has joined #ruby
[16:50:57] xall: has joined #ruby
[16:51:15] anekant: i had my morning weed so I'm questioning authority, sorry for being uppity
[16:52:43] hxegon: S'all good anekant
[16:53:27] dionysus69: has joined #ruby
[16:58:10] marxarelli: has joined #ruby
[16:58:23] cagomez: has joined #ruby
[17:03:40] hahuang61: has joined #ruby
[17:05:17] Rodya_: has joined #ruby
[17:06:52] jonjoe: has joined #ruby
[17:07:49] lightheaded: has joined #ruby
[17:09:57] chihhsin: has joined #ruby
[17:12:26] duderonomy: has joined #ruby
[17:14:13] jgnagy: has joined #ruby
[17:15:58] dopamean_: has joined #ruby
[17:16:43] ptvttg: has joined #ruby
[17:20:37] JoshS: has joined #ruby
[17:22:04] xen0fon: has joined #ruby
[17:22:24] oncall-pokemon: has joined #ruby
[17:23:12] JoshS: has joined #ruby
[17:23:38] djbkd: has joined #ruby
[17:24:23] mula: has joined #ruby
[17:24:27] apeiros: anekant: "." in $LOAD_PATH isn't just about security. it's also brittle. it relies on the working dir. unless all your ruby apps ensure the working dir (and I doubt that), then . will break your stuff the moment you (try to) start it from elsewhere.
[17:24:55] uncertainty: has joined #ruby
[17:25:46] Cohedrin: has joined #ruby
[17:26:23] anekant: yes well i was setting the working directory for loading and saving files inside the agents, which i have a lot of now
[17:26:56] apeiros: anekant: then just set $LOAD_PATH to the actual directory instead of .
[17:27:02] apeiros: s/set/add/
[17:29:14] JoshS: has joined #ruby
[17:31:50] hotpancakes: has joined #ruby
[17:36:27] sczizzo: has joined #ruby
[17:36:29] allisio: has joined #ruby
[17:39:57] hotpancakes: has joined #ruby
[17:41:00] Cohedrin: has joined #ruby
[17:42:08] rippa: has joined #ruby
[17:44:57] swills: has joined #ruby
[17:45:03] mula: has joined #ruby
[17:45:56] grant: has joined #ruby
[17:46:47] nobitanobi: has joined #ruby
[17:47:59] green_hat: has joined #ruby
[17:48:47] uncertainty: has joined #ruby
[17:51:58] xall: has joined #ruby
[17:54:11] hooper: has joined #ruby
[18:01:05] kinduff: has joined #ruby
[18:01:22] tomphp: has joined #ruby
[18:02:17] grant: has joined #ruby
[18:02:43] dn`: has joined #ruby
[18:06:00] Rodya_: has joined #ruby
[18:06:20] bkxd: has joined #ruby
[18:06:48] ahrs: has joined #ruby
[18:07:08] JeanCarloMachado: has joined #ruby
[18:09:52] muelleme: has joined #ruby
[18:14:11] olivier__: has joined #ruby
[18:14:13] ducks: has joined #ruby
[18:17:28] xall: has joined #ruby
[18:18:36] edliss: has joined #ruby
[18:18:36] pawnbox: has joined #ruby
[18:19:27] Fin1te: has joined #ruby
[18:20:17] banisterfiend: has joined #ruby
[18:20:58] xzhao: has joined #ruby
[18:24:06] hotpanca_: has joined #ruby
[18:25:16] davidt: has joined #ruby
[18:26:18] cibs: has joined #ruby
[18:27:29] ramfjord: has joined #ruby
[18:27:55] gizmore: has joined #ruby
[18:29:06] SeepingN: has joined #ruby
[18:30:02] cek: has left #ruby: ()
[18:30:24] Rodya_: has joined #ruby
[18:30:41] olivier__: has joined #ruby
[18:32:10] raul782: has joined #ruby
[18:33:22] raul782: has joined #ruby
[18:33:36] hotpancakes: has joined #ruby
[18:35:08] T4nk5bb0t: has joined #ruby
[18:35:27] dionysus69: has joined #ruby
[18:35:31] T4nk5bb0t: has left #ruby: ()
[18:35:39] aspiers: has joined #ruby
[18:36:56] nobitanobi: has joined #ruby
[18:41:05] umdstu: has joined #ruby
[18:41:12] umdstu: is there a best practice for communicating with a java jar daemon from inside ruby?
[18:41:58] mzo: has joined #ruby
[18:44:03] maikowblue: has joined #ruby
[18:48:49] xall: has joined #ruby
[18:49:44] mula: has joined #ruby
[18:50:27] sepp2k: has joined #ruby
[18:54:17] renchan: has joined #ruby
[18:55:07] gusrub: has joined #ruby
[18:58:21] hxegon: maybe this, umdstu? https://github.com/reidmorrison/jruby-jms
[18:58:31] viuo: has joined #ruby
[19:00:50] [Butch]_: has joined #ruby
[19:02:10] [Butch]_: has joined #ruby
[19:02:55] [Butch]: has joined #ruby
[19:03:32] szulak_: has joined #ruby
[19:04:41] ElDoggo: has joined #ruby
[19:06:14] ozcanesen: has joined #ruby
[19:06:44] AndBobsYourUncle: has joined #ruby
[19:07:22] green_hat: has joined #ruby
[19:08:21] sepp2k1: has joined #ruby
[19:09:39] Rodya_: has joined #ruby
[19:11:45] ElDoggo: has joined #ruby
[19:12:10] olivier__: has joined #ruby
[19:22:40] millerti: has joined #ruby
[19:23:02] bryanthompson: has left #ruby: ()
[19:26:34] jackjackdripper: has joined #ruby
[19:27:56] mula: has joined #ruby
[19:36:31] edliss: has joined #ruby
[19:40:02] banisterfiend: has joined #ruby
[19:42:01] Renich: has joined #ruby
[19:43:00] DARPA: has joined #ruby
[19:46:19] Renich: has joined #ruby
[19:46:33] onkelhotte: has joined #ruby
[19:48:59] millerti: has joined #ruby
[19:49:20] tomphp: has joined #ruby
[19:50:03] cagomez: has joined #ruby
[19:50:24] jottr: has joined #ruby
[19:51:00] ozcanesen: has joined #ruby
[19:54:18] rhyselsmore: has joined #ruby
[19:54:24] umdstu: ty hxegon i will look into that
[19:55:00] cdg: has joined #ruby
[19:55:01] umdstu: hxegon: ahh.. yea i'm not using jruby
[19:55:46] dar123: has joined #ruby
[19:56:53] blackpajamas: has joined #ruby
[19:58:57] kirun: has joined #ruby
[19:59:58] dar123: has joined #ruby
[20:01:37] cagomez: has joined #ruby
[20:01:44] alibby1: has joined #ruby
[20:03:34] username1: has joined #ruby
[20:03:46] nertzy: has joined #ruby
[20:04:06] alibby2: has joined #ruby
[20:04:37] patarr1: has joined #ruby
[20:06:08] armyriad: has joined #ruby
[20:06:13] bkxd: has joined #ruby
[20:08:12] olivier__: has joined #ruby
[20:09:10] pwnd_nsfw: has joined #ruby
[20:11:04] aswen: has joined #ruby
[20:11:52] Renich: has joined #ruby
[20:11:59] dar123: has joined #ruby
[20:12:39] raspado: has joined #ruby
[20:14:48] olivier__: has joined #ruby
[20:15:24] codephreak: has joined #ruby
[20:16:04] Renich_: has joined #ruby
[20:16:31] patarr: has joined #ruby
[20:18:25] enterprisey: has joined #ruby
[20:18:32] codephreak: Hello everybody, I'm completely new to Ruby but I've experience in other programming languages. Where would you advice me to learn the language in a correct manner? :)
[20:18:44] Renich__: has joined #ruby
[20:19:02] j416: _why the lucky stiff's poignant guide to ruby is hilarious and useful
[20:20:43] zeroDi: has joined #ruby
[20:21:19] millerti: has joined #ruby
[20:21:25] lxsameer: has joined #ruby
[20:23:34] codephreak: Alright, I'll check that out J4. Thank you very much :D
[20:23:37] tAn: has joined #ruby
[20:24:11] havenwood: ?books codephreak
[20:24:11] ruby[bot]: codephreak: You can find a list of recommended books at http://ruby-community.com/pages/links
[20:24:24] havenwood: codephreak: https://gist.github.com/baweaver/57a7c8296ca2c03effbd8fac1e7f6b40
[20:24:54] p0p0pr37: has joined #ruby
[20:24:54] p0p0pr37: has joined #ruby
[20:25:07] akkad: has joined #ruby
[20:25:21] edliss: has joined #ruby
[20:29:03] codephreak: Thanks for all the great links guys.
[20:32:08] DoubleMalt: has joined #ruby
[20:34:40] patarr: has joined #ruby
[20:35:27] skalfyfan: has joined #ruby
[20:37:14] die7: has joined #ruby
[20:37:36] rgiscard: has joined #ruby
[20:40:17] szulak_: has joined #ruby
[20:43:18] green_hat: has joined #ruby
[20:46:34] edliss: has joined #ruby
[20:49:17] enterprisey: has joined #ruby
[20:50:50] Parker0: has joined #ruby
[20:51:06] Parker0: has left #ruby: ()
[20:51:13] blackmes1: has joined #ruby
[20:53:44] dagelf: has joined #ruby
[20:56:51] Parker0: has joined #ruby
[20:57:02] despai: has joined #ruby
[20:57:08] lightheaded: has joined #ruby
[20:58:51] milardovich: has joined #ruby
[20:58:51] oleingem_: has joined #ruby
[20:59:30] dar123: has joined #ruby
[21:01:32] matthewd: has joined #ruby
[21:01:37] Parker0: has left #ruby: ()
[21:02:53] skalfyfan: has joined #ruby
[21:04:53] Parker0: has joined #ruby
[21:05:50] jenrzzz: has joined #ruby
[21:05:50] jenrzzz: has joined #ruby
[21:05:59] rfoust: has joined #ruby
[21:06:45] Fin1te: Anyone know why ruby would be executing a sleep statement at the beginning of a script and not when it was declared?
[21:07:15] dgs: is the sleep statement in a method or class or something?
[21:07:48] dgs: or just sitting somewhere in the script outside of a method/code block?
[21:07:56] havenwood: Fin1te: Show some code?
[21:08:50] Fin1te: its in rspec/serverspec if that helps. Let me sanitize a bit and paste.
[21:09:40] waltair: has joined #ruby
[21:10:00] pilne: has joined #ruby
[21:10:18] patarr: has joined #ruby
[21:10:34] szulak_: has joined #ruby
[21:11:14] Paraxial: has joined #ruby
[21:11:24] ozcanesen: has joined #ruby
[21:11:46] Fin1te: dgs havenwood https://gist.github.com/amgrice/20afda2eaedbc97ebe9a0eeabaea05b2
[21:12:12] elomatreb: RSpec reads the example groups, and then executes them separately, not in lexical order
[21:12:13] green_hat: has joined #ruby
[21:14:14] waltair: has joined #ruby
[21:15:33] ozcanesen: has joined #ruby
[21:15:47] jgnagy: has joined #ruby
[21:20:31] havenwood: Fin1te: does that ^ make sense?
[21:21:48] rakm: has joined #ruby
[21:22:29] dgs: what elomatreb said?
[21:23:43] dgs: yeah - you're run all these code blocks when the file loads. Some of them create the methods used for testing, one of them is just a bare sleep statement that will be executed as soon as it sleeps
[21:24:08] dgs: if you want it to sleep between those two tests (why?) you could either move the sleep into one of the tests
[21:24:31] dgs: or put it in as an explicit call from your test script
[21:24:47] skalfyfan: has joined #ruby
[21:25:06] raul782: has joined #ruby
[21:28:52] Fin1te: Yeah, I put the sleep inside the test and still no joy.
[21:29:33] Fin1te: I unfortunately understand what elomatreb said which makes me sad. I should have read more about rspec/serverspec.
[21:29:42] Fin1te: Might be the wrong tool or I'm using it the wrong way.
[21:30:14] elomatreb: I'd be interested too why you want to sleep between tests, seems strange
[21:30:21] enterprisey: has joined #ruby
[21:31:39] raul782: has joined #ruby
[21:31:44] Fin1te: I have a test that spins up a VM and I need to wait for the VM to be spun up before I can then run tests on that VM heh
[21:31:56] ptx0: has joined #ruby
[21:32:03] baweaver: Fin1te: before { create_files }; expect(files to be created); expect(other tasks)
[21:32:13] sdrew: has joined #ruby
[21:32:20] baweaver: sleep 1 until vm_is_up
[21:32:36] dgs: prob better to check if the if the vm is up rather than just sleep, no?
[21:32:56] baweaver: but that'll at least get things running
[21:32:57] Fin1te: True, but how does one do that in serverspec?
[21:34:03] dgs: depends on what the server is . . . if it's a web server you could loop waiting til port 80 (or whatever) was open
[21:35:16] sepp2k: has joined #ruby
[21:37:01] nOwz: has joined #ruby
[21:38:33] habitullence_: has joined #ruby
[21:38:57] waltair: has joined #ruby
[21:48:01] grant: has joined #ruby
[21:52:29] Lord_of_Life: has joined #ruby
[21:58:11] jphase: has joined #ruby
[22:00:42] username1: has joined #ruby
[22:10:40] bkxd: has joined #ruby
[22:11:01] hahuang65: has joined #ruby
[22:11:39] Bish: is there really no tool in standard ruby
[22:11:43] Bish: that can urlencode data?
[22:12:16] hahuang65: has joined #ruby
[22:13:17] baweaver: require 'cgi'; CGI.escape(str)
[22:13:32] Bish: i said encode urlencoded
[22:13:34] Bish: not escape
[22:13:51] havenwood: require 'uri'; URI.encode(str)
[22:14:14] Bish: same thing
[22:14:30] Bish: i want {'a'=>'b'} => a=b
[22:14:46] Bish: i want {'a'=>'b','c'=>'d'} => a=b&c=d
[22:14:47] Bish: and so on
[22:15:59] havenwood: >> URI.encode_www_form({'a'=>'b','c'=>'d'})
[22:16:06] ruby[bot]: havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[22:16:16] havenwood: #=> "a=b&c=d"
[22:16:33] Bish: havenwood: that's it, thanks
[22:16:38] hahuang65: has joined #ruby
[22:16:39] havenwood: Bish: de nada
[22:16:52] dminuoso: #ruby - or "how to avoid googling"
[22:17:05] Bish: #ruby how to assume people didn't google before asking here
[22:17:10] djbkd: has joined #ruby
[22:17:18] Bish: it's not like im here since yesterday
[22:18:13] ahrs: has joined #ruby
[22:18:36] dminuoso: https://www.google.de/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=ruby+hash+to+url+params&*
[22:18:39] dminuoso: first hit for me.
[22:18:59] Bish: congrats you inserted better search words, i searched for "urlencode", because that's what i says in content-type
[22:21:57] Asher: has joined #ruby
[22:22:05] workmad3: has joined #ruby
[22:23:07] dar123: has joined #ruby
[22:23:39] elifoster: has joined #ruby
[22:26:57] baweaver: hrm, not in here then
[22:27:14] gloscombe_: has joined #ruby
[22:29:03] rfoust: has joined #ruby
[22:32:37] GSilva: has joined #ruby
[22:45:56] raul782: has joined #ruby
[22:52:19] cibs: has joined #ruby
[22:55:04] raul782: has joined #ruby
[22:57:30] hahuang65: has joined #ruby
[22:57:43] lightheaded: has joined #ruby
[22:58:10] millerti: has joined #ruby
[22:59:51] raul782: has joined #ruby
[23:03:33] die7: has left #ruby: ()
[23:05:59] HoierM_: has joined #ruby
[23:08:32] CloCkWeRX: has joined #ruby
[23:09:44] agent_white: has joined #ruby
[23:17:06] raul782: has joined #ruby
[23:20:11] jaequery: has joined #ruby
[23:20:23] dfockler: has joined #ruby
[23:21:46] raul782: has joined #ruby
[23:22:17] AndBobsYourUncle: has joined #ruby
[23:22:44] bmurt: has joined #ruby
[23:27:23] davidt_: has joined #ruby
[23:28:25] enterprisey: has joined #ruby
[23:29:45] pawnbox: has joined #ruby
[23:31:16] nullobject: has joined #ruby
[23:32:06] AndBobsYourUncle: has joined #ruby
[23:34:17] quazimodo: has joined #ruby
[23:35:44] sdrew: has joined #ruby
[23:37:10] oetjenj: has joined #ruby
[23:39:44] Derperperd: has joined #ruby
[23:40:30] blackmes1: has joined #ruby
[23:40:43] modin: has joined #ruby
[23:40:44] sdrew: has joined #ruby
[23:41:29] sdrew: has joined #ruby
[23:41:34] pwnd_nsfw`: has joined #ruby
[23:42:19] sdrew: has joined #ruby
[23:43:04] sdrew: has joined #ruby
[23:43:54] sdrew: has joined #ruby
[23:44:25] cschneid_: has joined #ruby
[23:46:33] djbkd: has joined #ruby
[23:46:51] cibs: has joined #ruby
[23:47:27] green_hat: has joined #ruby
[23:50:57] frosty: has joined #ruby
[23:52:53] Apoc_: has joined #ruby
[23:53:41] hahuang65: has joined #ruby
[23:54:28] hahuang65: has joined #ruby
[23:56:01] rgtk: has joined #ruby
[23:56:57] charliesome: has joined #ruby
[23:57:24] Renich__: has joined #ruby
[23:57:37] zapata: has joined #ruby
[23:57:46] olivier__: has joined #ruby
[23:58:51] rgtk: has joined #ruby
[23:59:49] ramfjord_: has joined #ruby