Activity Graph

Page 1 of 1


[07:39:17] flips: has joined #ruby
[07:39:32] flips: has left #ruby: ("BBL")


[09:59:43] flips: Heh, dashboard prompted me to install versionupgrade ... But FreePBX 15 is still alpha ... I guess I'll just wait a bit longer ... ;)
[10:12:35] flips: has left #ruby: ("bbl")


[10:58:21] flips: Quit: bbl ...
[10:58:41] flips: has joined #ruby
[16:49:56] flips: *.net *.split


[16:49:12] flips: Quit: bbl ...
[16:49:42] flips: has joined #ruby


[22:01:17] flips: Ping timeout: 255 seconds


[10:18:29] flips: *.net *.split
[10:18:51] flips: has joined #ruby


[14:58:16] flips: Quit: bbl ...
[14:58:50] flips: has joined #ruby
[19:22:10] flips: Read error: Connection reset by peer


[04:51:41] flips: Read error: Connection reset by peer


[07:57:32] flips: Quit: bbl ...
[08:19:56] flips: has joined #ruby


[18:48:53] flips: *.net *.split


[17:56:31] flips: *.net *.split
[18:02:40] flips: has joined #ruby


[13:07:42] flips: Quit: bbl ...
[13:08:04] flips: has joined #ruby


[14:26:34] flips: Ping timeout: 240 seconds


[00:07:00] flips: *.net *.split
[00:15:33] flips: has joined #ruby


[10:20:02] flips: has joined #ruby


[17:56:52] flips: Quit: bbl ...


[15:54:32] flips: Quit: bbl ...
[17:06:26] flips: has joined #ruby


[15:10:42] flips: has joined #ruby


[11:45:47] flips: Quit: bbl ...


[14:30:24] flips: I'm afraid being awake is not enough, I have no idea about capybara/docker stuff ...


[02:07:05] flips: Ping timeout: 256 seconds
[02:41:50] flips: *.net *.split
[02:42:10] flips: has joined #ruby
[02:47:01] flips: *.net *.split
[02:47:54] flips: has joined #ruby


[10:01:16] flips: *.net *.split


[17:56:56] flips: Ping timeout: 268 seconds
[17:59:42] flips: has joined #ruby


[15:51:19] flips: has joined #ruby


[06:56:18] flips: Quit: bbl ...


[12:26:03] flips: *.net *.split
[12:27:28] flips: has joined #ruby
[15:01:34] flips: *.net *.split
[15:03:12] flips: has joined #ruby


[14:47:45] flips: Quit: bbl ...
[14:48:54] flips: has joined #ruby


[11:27:21] flips: *.net *.split


[20:35:03] flips: *.net *.split


[10:14:44] flips: Quit: bbl ...
[10:28:41] flips: has joined #ruby
[13:50:55] flips: Ping timeout: 248 seconds
[13:53:53] flips: has joined #ruby


[20:43:38] flips: *.net *.split
[20:44:16] flips: has joined #ruby


[14:48:12] flips: *.net *.split
[14:54:17] flips: has joined #ruby


[02:29:00] flips: has joined #ruby


[09:09:07] flips: Quit: bbl ...
[11:17:16] flips: has joined #ruby


[01:25:02] flips: Ping timeout: 240 seconds
[01:25:15] flips: has joined #ruby


[08:06:05] flips: Ping timeout: 240 seconds
[08:10:44] flips: has joined #ruby


[08:58:25] flips: Quit: bbl ...
[09:24:06] flips: has joined #ruby


[11:09:08] flips: Ping timeout: 246 seconds
[11:10:55] flips: has joined #ruby


[09:25:11] flips: Quit: bbl ...
[09:25:23] flips: has joined #ruby


[09:24:33] flips: Quit: bbl ...
[14:41:15] flips: has joined #ruby
[14:41:15] flips: Changing host
[14:41:15] flips: has joined #ruby


[00:17:29] flips: *.net *.split


[10:36:47] flips: Quit: bbl ...
[10:37:02] flips: has joined #ruby
[10:37:02] flips: Changing host
[10:37:02] flips: has joined #ruby


[18:06:07] flips: Maybe one of you could point in a direction to help me figure out what kinda basic principle/mechanism I'm not getting when working with classes/objects/OO stuff(?): https://gist.github.com/flips/8782b613be168ad3500bc917e222ac58 :-)
[18:34:56] flips: havenwood: Thank you! Had just started reading that ruby-doc page ... :)


[10:46:27] flips: Huh, in irb 'require "crack/xml" returns true, in pry I get "LoadError: cannot load such file"
[11:09:40] flips: jhass: running pry from a dir with .ruby-version and .ruby-gemset defined
[13:01:23] flips: importing values from an XML file, the booleans ends up as string "true" and "false" ... Is there an easy way to "boolify" the strings? :) (Assuming it might not, as true and false are object, that might have to write a conditional test)
[13:15:52] flips: Hm, I do want the field to be only true or false, boolean style. I'm saving to the xml file myself using xmlsimple (or crack, is the plan)
[13:26:17] flips: elomatreb: That was compact syntax :) So ... value should point/be assigned to value's object if value == "true" (and then point to false if value is something else)?
[13:26:39] flips: (Yep, the syntax worked very well) :)
[13:27:58] flips: and no parenthesis :)
[13:28:59] flips: I tried asking yesterday if I should consider json, xml or haml in addition to yaml ... Now you gave me a good reason for json
[13:29:40] flips: I'm just experimenting for learning anyways :)
[13:30:39] flips: I know crack has json, but should I consider some other module/gem?
[13:32:28] flips: ok, it showed up when I searched for xml parsing tools :)
[13:36:45] flips: I tried nokogiri, but ended up a very complex hash ... Russ Olsen mentions xmlsimple in his book :)
[14:04:38] flips: json seems simpler for such data I'm storing :)
[15:03:02] flips: When I do a @myhash = JSON.parse(myfile, opts...) in a class method, then @file="/path/to/myfile.json" ends up in my hash after the data I wanted (hash created by myhash = MyClass.new and myhash.load_item_from_file)
[15:03:25] flips: I assume my logic is wrong ;)
[15:12:21] flips: I'm guessing that, too, I'm trying to move working code into class/subclass... ;) https://eval.in/776594 (It's a mix of other copied&pasted code, but list = List.new, and list.load_items seems to work, but list contains a layer too much or something
[15:23:07] flips: I haven't looked into the saving yet (it's copied and pasted/confused with code from a working array example), I thought I would learn more about hashes by rewriting it and also test json/xml etc .. So the input file looks valid and works in a plain example (no classes, just load from file and puts)
[15:31:05] flips: This code worked for parsing/reading the json file: https://eval.in/776600
[15:32:00] flips: *noted* :)
[15:35:39] flips: I thought that opts were known/expected by JSON.parse, it does symbolize the names :)
[15:37:01] flips: I see, just an anonymous hash instead
[19:55:52] flips: This gist explains my issue (scoping or what the problem is) of importing a json data structure/hash correctly: https://gist.github.com/flips/95f0eea0afd8347c514256d654655697 <-- all feedback welcome
[20:01:35] flips: Hm, I have trouble accessing the array/hash inside (and list.load_items also seemingly overwrote/removed the method list.add_item, when I had it defined)
[20:04:47] flips: I was trying to isolate one issue at the time ... so first try to fetch data from that list
[20:09:43] flips: jhass: in my first working program, I can fetch list[:item][2] and so on, in my attempt to structure it into classes and use methods I just get "undefined method `[]'" ... So I'm trying to understand the data structure ...
[20:15:34] flips: Not sure what you mean I'm not showing, but as in the gist, it runs 'list = List.new' and the 'list.load_items', I'm doing that in pry and poking around. Yes, it's reported as List class (see last 2 lines), so somehow it's now an instance of the class, hm. So I need a way to expose the hash, then
[20:40:20] flips: Added some pry output to the gist, maybe that shows what happens at 'list.load_items'/why it's becoming a pointer to the Class instead of containing the hash. Thankful for any hint as to how I could/should expose/fetch the hash ... (I'm trying to learn this stuff) :)
[21:29:18] flips: Adding a "return @list" to load_items didn't help/change anything, also maybe load_items should be a private method ... I need some sleep
[21:41:41] flips: if I do 'list2 = list.load_item' list2 gets the hash I want, so I'm not that far off, I guess ... :)
[21:57:21] flips: matthewd: yes, I feel there's some basic flaw in my logic/understanding. I wrote this program for an array based structure first, and that works nicely ... I missed something trying to convert to using a hash structure instead.


[15:10:52] flips: *.net *.split
[15:11:02] flips: has joined #ruby
[15:11:02] flips: Changing host
[21:29:33] flips: For saving small amounts of data in an plaintext based format, just go with yaml? Or consider other options? (xml, json, haml or something?)
[21:30:33] flips: s/ an / a /


[00:24:55] flips: ACTION just started reading the Eloquent Ruby book. Seems helpful for getting good habits and better understanding



[19:15:06] flips: Is proc sort of like ` ` or $( ) in shell programming? Except they are objects that can be called ... so rather like shell functions? ... :)
[19:16:09] flips: and lambdas are procs with a fixed set of arguments?
[19:17:54] flips: Thanks :)


[03:36:49] flips: *.net *.split
[03:36:52] flips: has joined #ruby
[03:36:52] flips: Changing host


[12:08:41] flips: has left #ruby: ("Textual IRC Client: www.textualapp.com")


[17:03:30] flips: Any major drawback using concat withing <% %> in erb, instead of <%= %> for printing?
[17:03:42] flips: s/withing/within/
[17:04:58] flips: jhass: Ref http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-concat states "If you absolutely must output text within a non-output code block (i.e., <% %>), you can use the concat method."
[17:05:53] flips: erb isn't rails specific, I guess?
[17:06:12] flips: oh ... dang
[17:08:08] flips: jhass: I'm trying to avoid bad smelling code (kinda re-learning Ruby after some years away)
[17:10:14] flips: jhass: Good point :) Thanks


[12:15:25] flips: I understand Rails guidelines to be that I should type myhash = {} instead of Hash.new (?) ... But, how would I then type something like: your_hash = Hash.new { |hash, key| hash[key] = Array.new } ?
[12:16:40] flips: ;) ok ...


[15:29:37] flips: has joined #ruby
[15:35:42] flips: Hm, using rbenv and bundler, it's easy enough to manage dependencies etc. But how do you keep various installations from being bloated? (I'm used to Python's virtualenvs, where all I need is copied to that project dir.) When I develop a large project on my laptop, when I'm done with that, I'd like to clear out what's not needed. I guess I could remove all and do bundle install on the projects I'm working on ...
[15:35:45] flips: (?) Or am I missing an obvious better solution? :)


[12:08:36] flips: has left #ruby: ("Textual IRC Client: www.textualapp.com")


[16:11:42] flips: has joined #ruby
[18:46:32] flips: I haven't been using Ruby for a long time, so things have changed. (I used it mostly before Rails.) I've got a new webdev project, and was thinking I should research/test if Ruby would be nice for the task. Googling a bit, I'm thinking maybe install nginx, Rack and padrino or Sinatra or something. Makes sense? :)
[21:04:50] flips: Hm, should I install gems using apt (on ubuntu), or following something like the rbenv/bundler method outlined on gorails.com?
[21:07:13] flips: I haven't used ruby in a loong time. I seem to need rbenv&bundle to get the equivalent of pythons virtualenvs?