« Back to channel list

#ruby - 20 April 2015

« Back 1 day Forward 1 day »
[00:05:45] Radar: gem install bundler ?
[00:06:00] Radar: well, gem install bundler -v '~> 1.6'
[01:07:40] zubov: quiet tonight
[01:07:48] zubov: or this morning
[01:07:49] NoDG3: is it usually busy?
[01:08:01] zubov: has spurts of activity
[01:08:43] Radar: Sunday night in the US + EU == quiet
[01:09:02] dorei: is it night @ us?
[01:09:13] NoDG3: is there a difference between connecting to chat.freenode.net versus irc.freenode.net?
[01:09:26] NoDG3: its 6pm on west coast
[01:09:41] Radar: NoDG3: Nope.
[01:09:46] Radar: No difference.
[01:10:49] zubov: more than likely everyone is watching Game of Thrones
[01:10:55] sevenseacat: oh i wish it was still sunday night
[01:11:03] pontiki: 20:10 here in central US
[01:11:05] sevenseacat: no spoilers, my cable box is recording it as we speak!
[01:11:25] pontiki: the person you like best is killed
[01:11:28] zubov: I have only seen season one
[01:11:38] sevenseacat: pontiki: thats not a spoiler, that goes without saying
[01:15:59] zubov: got my environment setup on Elementary OS. Decided to give visual ruby some time with this install
[01:18:00] a5i: does Ruby have strict comparisons?
[01:21:09] shevy: a5i it is super strict!
[01:21:30] shevy: >> "a" == ?a
[01:21:32] ruboto: shevy # => true (https://eval.in/315648)
[01:21:51] ruboto: dorei # => "a" (https://eval.in/315649)
[01:22:02] shevy: zubov well in europe, people are sleeping at this time normally
[01:22:20] dorei: only vampires are still awake :p
[01:22:55] a5i: like Java has .eqauls() for strict comparisons
[01:22:58] a5i: and JS has ===
[01:23:48] dorei: >> 5 == "5"
[01:23:49] ruboto: dorei # => false (https://eval.in/315650)
[01:24:43] shevy: java is a weird language a5i
[01:24:56] shevy: I assume most people would type .equals but now they have to relearn
[01:25:06] dorei: javascript is even weirder
[01:25:08] shevy: ruby also has === btw
[01:25:20] shevy: >> 1 === 1
[01:25:21] ruboto: shevy # => true (https://eval.in/315651)
[01:25:31] dorei: >> 1 === "1"
[01:25:32] ruboto: dorei # => false (https://eval.in/315652)
[01:25:33] a5i: god I love Ruby's flexxibility
[01:25:40] shevy: === is used in case/when menus
[01:25:54] shevy: so you can do stuff like /abc/ or case x; when Array
[01:26:26] shevy: do you know what is weird about ruby?
[01:26:28] dorei: a5i: i think, "by default" all ruby comparisons are strict, of course you can override this behaviour
[01:26:29] shevy: the feature request
[01:26:35] shevy: you can request new features here: https://bugs.ruby-lang.org/projects/ruby-trunk
[01:26:40] shevy: but the URL indicates that it is for bugs :-)
[01:26:55] shevy: Feature: 678 open / 1901
[01:27:54] shevy: if only I would know C, then I could process my own feature requests with patches
[01:28:03] karstensrage: hi is there a way to use a previously defined variable in a config.yml?
[01:28:52] karstensrage: so if you define url: "http://www.example.com" how do you later use that in description: "Visit us at $url"
[01:29:02] shevy: this will become a hash
[01:29:12] shevy: so you have it available in the yaml dataset where you did YAML.load_file()
[01:29:29] karstensrage: its the _config.yml in jekyll
[01:29:34] karstensrage: i didnt do anything
[01:29:58] shevy: can you access to that yaml file from jekyll somehow?
[01:30:19] karstensrage: well the description is IN the yaml file
[01:30:34] shevy: as said, if you load a yaml file, like the above, you have the dataset
[01:33:03] NoDG3: I see what you meant about the bursts of activity
[01:34:15] karstensrage: well im not loading any yaml file
[01:34:21] karstensrage: its just using it
[01:40:39] shevy: karstensrage so you have no access to it
[01:40:44] shevy: that is not good
[01:41:05] shevy: if you were to use a yaml file on your own, you can use YAML.load_file to turn it into a ruby datastructure, usually a Hash
[01:41:23] shevy: once you have a hash, you can query the given key, in this case, 'url' I assume, to extract the value of said key
[01:42:25] shevy: require 'yaml'; DATASET = YAML.load_file('_config.yml'); def url?; DATASET['url']; end; puts "Visit us at #{url?}"
[02:08:20] pontiki: it's a jekyll question, not a general ruby question
[02:09:15] pontiki: i think we've sorted it, at any rate
[02:37:28] Technodrome: how can i import a certain class like
[02:37:29] Technodrome: Mechanize::Page::Link
[02:37:37] Technodrome: i dont want to have to type that every time
[02:37:51] Technodrome: but i can???t include right because that is for modules only?
[02:56:41] a5i: How do I initialize a variable without setting a value?
[02:57:16] sevenseacat: how can you have a variable without a value?
[02:57:31] sevenseacat: moreso, why would you want one?
[02:57:41] a5i: I;m just wondering
[02:57:50] a5i: liek in C you can do int x;
[02:57:54] havenwood: >> a = a; a
[02:57:56] ruboto: havenwood # => nil (https://eval.in/315686)
[02:58:10] havenwood: a5i: just assign it to `nil`
[02:59:38] shevy: a5i nil is the default placeholder, even all $ variables "default" to it
[02:59:41] ruboto: shevy # => nil (https://eval.in/315687)
[03:00:03] ruboto: a5i # => undefined local variable or method `a' for main:Object (NameError) ...check link for more (https://eval.in/315688)
[03:23:01] spsp: i get a an array of hashes returned and want to filter them and just select the matching record out of it
[03:23:08] spsp: so I'm using this
[03:23:09] spsp: theme = themes.select {|x| x.name == theme_name }[0]
[03:23:14] spsp: is that a clean way to do it?
[03:23:32] spsp: select always returns an array right?
[03:23:39] Coraline: detect might be better, it will return on the first match
[03:25:09] spsp: Coraline: Thanks, that's the one I was looking for.
[04:00:13] shevy: the evil agent is about
[04:00:39] agent_white: No, agent_black hasn't been around in awhile. If you see him you must let me know.
[04:00:44] agent_white: I must bring balance.
[04:03:13] selite: Hi, how can I aceess elements of yaml file that I read in ruby. Like x[name] for json file from js?
[04:04:42] selite: pipework: I did google it but I found nothing useful, except reading it like a regular file.
[04:04:58] weaksauce: selite what are you actually trying to accomplish?
[04:05:44] pipework: selite: https://duckduckgo.com/?q=ruby+yaml+read+file&t=ffab&ia=qa
[04:06:28] weaksauce: pipework I read it as they have read it in already and want to know how to access the contents of a ruby hash from js
[04:06:50] selite: pipework: But I ready the file, but how can i access it like file_content[web_pages] to get the web pages from the yaml file
[04:06:59] pipework: weaksauce: I read that it was a file they've read in and need to use with yaml.
[04:07:10] weaksauce: pipework we are probably both off
[04:07:17] pipework: Which is pretty cool because you can always just read the documentation for hte main class that you'll read about.
[04:07:55] weaksauce: actually re reading it I am off
[05:18:41] shevy: pipework only if it is documented!!!
[05:25:19] weaksauce: shevy the tests are the documents!
[05:46:36] agent_white: THE DOCUMENTS ARE IN THE COMPUTER
[05:46:56] flughafen: ooooh, they're in the computer?
[05:47:03] sevenseacat: ACTION throws computer out window
[05:47:15] sevenseacat: ...where are all the files!?
[05:47:32] flughafen: i would've helped but was too busy breakdance fighting
[05:47:54] agent_white: sevenseacat: They... must be in the cloud!!!
[05:48:01] sevenseacat: ACTION looks up in awe
[05:48:08] agent_white: ACTION does a rain dance
[05:48:12] flughafen: hey sevenseacat
[05:48:26] sevenseacat: good afternoon
[05:48:34] flughafen: how was your weekend?
[05:49:30] sevenseacat: it finished D:
[05:50:01] flughafen: did you do anything fun>
[05:50:11] sevenseacat: nup. i'm a pretty boring person.
[05:50:20] sevenseacat: unless playing elder scrolls online counts.
[05:59:37] flughafen: sevenseacat: that is exciting as wrestling tigers
[06:09:25] Kurisu: Can someone help me? I'm wondering why this isn't working?
[06:09:25] Kurisu: if File.extname(file)==".scss"||".scss "
[06:09:34] Radar: Kurisu: !explain
[06:09:34] helpa: Kurisu: Please explain your problem better as we are having trouble understanding what you mean. A Gist (http://gist.github.com) is always helpful!
[06:09:47] Radar: sigh helpa is banned and I keep forgetting.
[06:10:05] Radar: Kurisu: It's because you're doing File.extname(file)==".scss" and then comparing that to ".scss"
[06:10:28] Kurisu: Oh so maybe my syntax is wrong
[06:10:30] Radar: Why would the extname include a space?
[06:10:37] Kurisu: I want the file extension to be ".scss" and ".scss "
[06:10:45] Radar: That is not a valid extension.
[06:10:50] Kurisu: In OS X, when you drag a file into the Terminal, it automatically adds a space to the end
[06:11:12] Kurisu: So, rather than having people remove it, can I cater to it?
[06:11:17] Kurisu: Or is that not do-able?
[06:11:37] sevenseacat: having a space in the command doesnt translate to a space in the extension
[06:12:06] sevenseacat: it would be handy if helpa wasnt banned, yes.
[06:13:00] Kurisu: I'll just put an error message if there's a space afterward then.
[06:13:03] wasamasa: why not teach ruboto the new things
[06:13:06] Kurisu: Thanks for your help ~
[06:14:15] sevenseacat: cuz ruboto is owned by committee, and we spent a long time building up useful commands in helpa
[06:18:50] wasamasa: I haven't seen much use of these to be honest
[06:19:01] wasamasa: can only recall the pastebin and crossposting one
[06:19:13] wasamasa: also, is that the sunk cost fallacy?
[06:19:41] sevenseacat: nope, we still like and use helpa in #rubyonrails.
[06:22:23] Radar: apeiros suddenly felt the urge to build ruboto because it has integration with a site that nobody uses.
[06:22:37] Radar: namely http://ruby-community.com
[06:22:47] sevenseacat: Radar: it's only a new site. give it time.
[06:23:00] Radar: There is no reason that helpa could not have been customised to interact with that site oto.
[06:23:14] Radar: to have two channel bots that do the same thing is ridiculous.
[06:25:30] sevenseacat: there's other bots here anyway :D see: DeBot
[06:26:24] Radar: DeBot: !gems
[06:26:33] Radar: DeBot: !hangman gems
[06:26:33] DeBot: ?????????????????? [] 0/12
[06:26:42] Radar: At least DeBot DEviates from the mean
[06:26:46] DeBot: ????????????a??? [] 0/12
[06:26:48] DeBot: ????????????a??? [s] 1/12
[06:26:49] DeBot: ????????????a??? [sm] 2/12
[06:26:52] DeBot: ????????????a??? [smn] 3/12
[06:26:55] DeBot: ????????????a??? [smnk] 4/12
[06:26:56] DeBot: ????????????a??? [smnkr] 5/12
[06:26:59] DeBot: ????????????al [smnkr] 5/12
[06:27:00] DeBot: ????????????al [smnkrc] 6/12
[06:27:03] DeBot: ????????????al [smnkrci] 7/12
[06:27:03] DeBot: ????????????al [smnkrcib] 8/12
[06:27:13] DeBot: t?????????al [smnkrcib] 8/12
[06:27:15] DeBot: t?????????al [smnkrcibd] 9/12
[06:27:24] DeBot: t?????????al [smnkrcibde] 10/12
[06:27:24] DeBot: t?????????al [smnkrcibde] 10/12
[06:27:30] DeBot: to??????al [smnkrcibde] 10/12
[06:27:30] DeBot: to??????al [smnkrcibde] 10/12
[06:27:37] DeBot: to??????al [smnkrcibdeu] 11/12
[06:27:44] Radar: We'll we're screwed.
[06:27:46] DeBot: to_???al [smnkrcibdeu] 11/12
[06:27:52] DeBot: to_gal [smnkrcibdeuv] 12/12 You lost!
[06:28:43] jokester: gal?? sounds yummy
[06:29:18] dodobrain: that was sooo weird
[06:30:32] jokester: https://github.com/onigra/to_gal
[06:31:51] dodobrain: jokester, what does it do?
[06:32:18] dodobrain: the singular example provided there, seems to change the very last character only
[06:32:44] dodobrain: even then, i don;t know what a smaller size character means there (it really is the same character)
[06:33:00] jokester: it's japanese character
[06:33:04] wasamasa: lol: https://github.com/onigra/to_gal/blob/master/data/dictionary.yml
[06:33:31] dodobrain: wasamasa, lol? what is it doing?
[06:33:45] dodobrain: maybe someone who knows japanese knows the real answer here
[06:33:47] wasamasa: dodobrain: it's a hash
[06:33:58] jokester: and the sentence itself is literally "transform to gal-ish text"
[06:34:12] jokester: I can read a little japanese, but "gal-ish" thing is beyond me
[06:34:24] dodobrain: 'transform to gal-ish text'... what is gal-ish text ?
[06:34:33] sevenseacat: i can understand characters, but thats a long way from understanding japanese.
[06:34:56] dodobrain: some kind of weird lingo?
[06:35:16] sevenseacat: whats weird is that 'gal' is written in katakana
[06:35:39] sevenseacat: meaning its a loanword
[06:36:43] jokester: http://en.wikipedia.org/wiki/Gyaru
[06:36:46] jokester: ACTION yields
[06:37:51] dodobrain: jokester, o.0 what wiki did i just read? lol
[07:29:47] apiercey: Hello, is this channel quite active?
[07:30:12] apeiros: apiercey: stay and judge for yourself?
[07:30:31] sevenseacat: ACTION plays hangman
[07:30:50] apiercey: Maybe not for long tonight, though haha. Late were I am
[07:31:58] Kurisu: apiercey ??? I think everyone's asleep right now, but it's usually quite/very active. You can tell by the channel's user count :)
[07:33:15] apiercey: Ah thanks! I'm new to IRC as a whole but someone online mentioned that this freenode/# ruby is a decent ruby community.
[07:46:21] Hanmac1: shevy: look at this! https://github.com/ruby/ruby/commit/d06a439be226b13569f86697bb6f29878cd09f2b ;P
[07:46:58] Hanmac1: apeiros: "Enumerable#count_by" incoming! XD
[07:47:21] sevenseacat: ive wanted that for ages
[07:49:02] apeiros: hanmac1: ah, good thing
[07:49:06] apeiros: yeah, common use case
[07:49:39] apeiros: even with fixnum/bignum optimization :D
[07:55:17] apeiros: hi adaedra
[08:09:08] apeiros: current status: compiling :<
[08:11:31] Hanmac1: apeiros: hm maybe i can get nobu to implement an each_uniq(_by) methods into C too
[08:16:04] wasamasa: TIL that one infects objects in ruby
[08:16:47] apeiros: wasamasa: you generally don't. that's lowlevel stuff ;-)
[08:29:45] apeiros: ok, so in ruby 2.2.2, send(:bar) is faster than bar.call and that is faster than instance_exec(&bar)
[08:30:05] apeiros: where in the first example, bar is an instance method, and in the two other examples a lambda with the same body.
[08:30:07] ytti: by what margin
[08:30:45] apeiros: send 4.419M (?? 4.6%) i/s - 22.126M
[08:30:45] apeiros: lambda 3.647M (?? 3.0%) i/s - 18.269M
[08:30:45] apeiros: instance_exec 2.481M (?? 3.5%) i/s - 12.415M
[08:30:52] apeiros: numbers by benchmark-ips
[08:30:55] Nuck: Anyone know a way to get a stack trace out of Bundler/Rubygems? I've supposedly got an error in my Gemspec but it's giving me one entirely irrelevant line from the stack trace :/
[08:31:40] apeiros: Nuck: I suggest you gist your gemspec and the full exception, even if you deem it irrelevant
[08:32:29] ytti: apeiros, that is way more than i expected
[08:33:47] Nuck: https://gist.github.com/NuckChorris/8b312aa16cc571a36333
[08:35:49] Nuck: I'm slowly losing my sanity to this thing
[08:36:14] jhass: Nuck: it's spec.add_dependency too
[08:36:17] jhass: and so forth
[08:36:44] Nuck: :| Wow what the hell
[08:36:54] ruboto: jhass # => wrong number of arguments (0 for 1+) (ArgumentError) ...check link for more (https://eval.in/315771)
[08:37:01] Nuck: I tweaked that straight from Bundler's code
[08:37:33] jhass: doubt that https://github.com/bundler/bundler/blob/master/lib/bundler/templates/newgem/newgem.gemspec.tt#L35
[08:38:24] Nuck: I didn't even touch the rake and bundler lines, so color me confused as to how things got this way
[08:39:02] Nuck: Oh well. No need questioning things when I could be fixing it
[08:39:11] Nuck: thanks lol
[08:39:32] Nuck: If only Vim highlighted the word "gem" like Gist does, wow
[09:15:47] Hanmac1: shevy: i updated https://gist.github.com/Hanmac/cb9e13ff220e4f31e13a gemtree against newest rubocop ... i may not like it but it says its "better" now ...
[09:17:29] Igorshp: Morning, i'm trying to see if a block of xml is part of a larger xml. sort of like .includes? for strings. could anyone point me in the right direction?
[09:18:26] Hanmac1: Igorshp: Nokogiri is your friend
[09:18:47] Igorshp: yeah, playing around wiht it already
[09:18:55] Igorshp: but it's little fidly to use
[09:19:24] jhass: hanmac1: luckily you can tell it what's better: https://gist.github.com/jhass/a5ae80d87f18e53e7b56
[09:21:41] Hanmac1: jhass: my main problem i got was "Assignment Branch Condition" and "Cyclomatic complexity" ... like for the first one i mostly think its to dump to understand what "/\A#{k}(?<n>\d+)\Z/ =~ name && n.to_i.between?(3, v)" does and whines about that the Condition is to complex or something
[09:22:25] jhass: those are metrics for too many statements in a method, it wants you to make smaller ones, afaik
[09:22:58] canton7: cyclomatic complexity is the number of routes through a method iirc: i.e. how much branching/looping/jumping about is done
[09:24:22] Hanmac1: canton7: have you tryed to write a case/when in ruby? it causes rubocop to go overload with cyclomatic complexity ;p
[09:26:41] Nuck: rubocop complains a lot, but it means well
[09:29:27] Nuck: Kind of like an overbearing parent
[09:29:41] Nuck: You know it wants the best for your codebase, but sometimes it's just too much
[09:29:47] canton7: hanmac1, I haven't - sounds fun
[09:30:49] jhass: yeah, tbh I'm thinking about turning those two off
[09:31:47] Nuck: All the complexity complainers in rubocop I set to absurd (but sadly realistic) levels
[09:31:59] Nuck: And use CodeClimate for anything lower
[09:32:18] Hanmac1: good that my rwx code cant be checked by rubocop otherwise it might crash because the error count is to high ;P
[09:32:21] Nuck: So rubocop is just an alarm for when things slip by and get *really* bad
[10:13:28] Hanmac1: banister: hm i think pry might need to update its slop dependency ... they are already a few versions behind it (4.1.0 vs ~> 3.4)
[10:13:51] ytti: i don't think that is the correct solution
[10:14:22] ytti: better solution is to separate CLI and lib
[10:14:42] ytti: in which case pry does not have to use same slop version as you do
[10:15:14] Hanmac1: ytti: hm what would you do? i mean he should check if pry (or other parts of pry) does work with he newer version too
[10:15:33] Hanmac1: an separation might be useful but does not solve all the problems
[10:15:39] ytti: hanmac1, it definitelty won't work with slop4 without rewrite
[10:15:56] ytti: but why would I, as pry user, care which slop version is pry using?
[10:16:16] Hanmac1: hm ok i guessed so, but imo it be updated sooner or later
[10:16:57] ytti: probably, but what is the problem that needs to be solved
[10:52:35] adaedra: Opal seems nice
[11:38:15] jokke: anyone using chruby and got it setting the correct ruby version for vim?
[11:39:20] jokke: i set the rubyversion to 2.2.0 and started vim, yet `:ruby print RUBY_VERSION` shows 2.2.2
[12:01:25] jokester: vim may link to its own ruby
[12:41:54] kq_away: What's the difference between 'or' and '||'?
[12:42:20] rom1504: http://stackoverflow.com/questions/2083112/difference-between-or-and-in-ruby
[12:42:48] apeiros: kq_away: in short: precedence
[12:46:23] banister: apeiros oh hey there stefan
[12:46:28] banister: apeiros ltns
[12:46:36] banister: apeiros going anywhere for summer hols?
[12:49:18] kq_away: I shall learn to google before asking
[12:49:20] kq_away: thanks, though
[12:56:13] kq_away: I still don't understand what made Foo = ARGV[1] or 'bar' not work
[12:56:29] kq_away: did it go (Foo = ARGV[1]) or 'bar'?
[12:57:31] apeiros: Foo = ARGV[1] or abort("Must provide an argument!")
[12:58:16] kq_away: that was really unexpected though
[12:58:30] kq_away: I operated under impression that or and || are aliases
[12:59:02] apeiros: and now you learned that they aren't ;-)
[12:59:17] kq_away: that I did
[12:59:48] ddv: kq_away: also read the ruby style guide
[13:01:03] jhass: kq_away: you also learned why many rubyists avoid or/and altogether ;)
[13:06:10] yh: Anyone here done any structured logging?
[13:52:35] Naypalm: so say I have something someone developed 2+ years ago and stopped, what should I be doing when `bundle install` invariably explodes
[13:52:45] Naypalm: fix each issue as they come up?
[13:52:51] Naypalm: downgrade my ruby version?
[13:54:36] adaedra: it shouldn't blow up
[13:54:42] adaedra: what are the errors ?
[14:05:12] Naypalm: well yesterday I had to change like two billion things
[14:05:43] Naypalm: like a readline module that wouldn't work, turns out there was one for ruby 1.9 but then there was a -devel something else one that replaced them both
[14:06:06] Naypalm: and nokogiri likes to explode
[14:06:18] Naypalm: it was just little consistency things here and there
[14:07:10] Naypalm: I mean yeah I know wanting 2+ years gems to work with bleedin' edge ruby is asking too much
[14:07:19] Naypalm: I'm just going to vent about it anyway though
[14:10:58] Naypalm: and now I finally get everything bundle installed and it starts erroring when I try to do anything :(
[14:10:59] gregf_: er, 2 billion things... you surely wrote a brand new app in 1 day then ;)
[14:11:09] Naypalm: I wrote billions of them gregf_!
[14:11:18] gregf_: unless you broke the build a million times
[14:11:49] Naypalm: I did dirty things
[14:12:03] Naypalm: I went into Gemfile.lock and changed version numbers and changed readline things
[14:12:10] Naypalm: that's probably not a healthy activity
[14:14:18] Naypalm: this is probably why nothing now works!
[14:14:27] Naypalm: https://bpaste.net/show/4677630c5f39
[14:36:12] havenwood: Naypalm: Rails 2.3.5? Eek.
[14:37:25] Naypalm: there is a lot of eek here
[14:37:40] Naypalm: I don't know ruby but I know when I'm in hell!
[14:37:55] jhass: 2 years? more like 6...
[14:38:21] apeiros: jhass: they might have used 2.3 when rails 3 was out
[14:38:23] Hanmac1: apeiros: hm with the newest feature .count_by(&:itself) might be very funny ;p
[14:38:54] jhass: apeiros: I just invented the concept of anti-religion I think. There are thinks I do not want to believe
[14:39:01] jhass: *things, even
[14:49:13] apeiros: jhass: I'm pretty sure you're not the first ;-D
[14:49:27] apeiros: jhass: but that's a bit an odd topic for #ruby?
[14:49:52] jhass: business as usual you mean?
[14:51:33] Toska: Does anyone here know of a gem that lets you invite people to events, accept and decline them, etc?
[14:53:21] apeiros: Toska: I don't. but your question is very weak on context.
[14:54:05] apeiros: anyway, ruby-toolbox.com might still help you
[14:57:13] serard: Is there ?? way to pass env vars to a ruby program whin launching it via #!/bin/sh .sh script ???(Hope I'm clear enough ^^)
[14:58:16] jhass: serard: what general way do you know to pass env vars to a ruby script?
[14:58:35] jhass: or any program
[14:58:37] adaedra: just modify the env in your shell script
[14:58:37] serard: MYENV=myval ruby myscript.rb
[14:58:53] havenwood: serard: Tried that ^ yet?
[14:58:53] adaedra: and does it works, serard ?
[14:58:53] jhass: did you try that in your shellscript?
[14:59:01] apeiros: I'm not quite sure how you launch a ruby script with #!/bin/sh??? do you mean you have a bash script which in turn runs ruby?
[14:59:11] apeiros: s/bash/sh/
[14:59:13] adaedra: (I'd guess so)
[14:59:31] serard: apeiros, exactly !
[15:00:48] serard: oh, my bad, didn't set the env in my container call, sorry....
[15:08:24] catphish: i'm having trouble with ruby 1.9.3 with OpenSSL 0.9.8k, when connecting to an FTPS server with explicit FTPS, the ssl client handshake appears to be sent, but the server ignores it, as if not enough data was sent to complete the handshake, does anyone have any idea why that might be?
[15:08:28] catphish: connecting to the same serve with ruby 2.1.5 and OpenSSL 1.0.1f works fine
[15:08:41] catcher: How common is it for ruby / ror projects to use a template engine?
[15:09:23] catcher: c-c, would you say most use haml or slim?
[15:10:45] c-c: no idea what most use
[15:11:02] ytti: haml is definitely more common than slim
[15:11:24] ytti: had some slim issues, google-fu failed
[15:11:30] ytti: for haml, it never fails
[15:11:38] apeiros: I'd say historically it's erb > haml > slim. new projects it's probably reversed: slim > haml > erb
[15:11:43] catphish: yaml is very common, iirs rails still prefers eruby/irb which means its still popular despite being (IMO) sucky
[15:12:16] catphish: i haven't see much slim, but i believe that it's growing in popularity
[15:12:19] dorei: isn't haml only for html?
[15:13:02] apeiros: dorei: yes, same for slim
[15:13:06] apeiros: well, might also do xml
[15:13:20] catphish: i think it does any xml, but basically html
[15:13:21] dorei: so, only erb is general purpose?
[15:13:42] catphish: yes, erb isn't really a language, its just "run this ruby code and put the result here"
[15:13:42] apeiros: from those 3? yes
[15:13:56] catphish: hence can be used for any type of output
[15:14:44] catphish: whereas haml is a way of writing html, that integrated nicely with ruby code, i assume slim is the same though i haven't used it
[15:15:51] catphish: ultimately it comes down to preference, but most people prefer not to write html by hand now from what i've seen, i'd avoid erb for HTML though it can be useful if you have a pre-made html page and just want to put in a little bit of dynamic data
[15:17:27] catcher: Thanks for the feedback.
[15:25:27] A124: Umm. I have a class with method "def self.clear" ... would like to alias it to "self.clean". How can I acheive so?
[15:28:46] dorei: A124: the way I do that is something like: class X ; class << self ; alias :clean :clear; end ; end
[15:31:07] A124: dorei Thank you! .. I would probably note.. or at least think.. that alias_method is more flexible.
[15:37:58] havenwood: A124: Depends what you mean. You can redefine #alias_method but it can't take barewords like: alias clean clear
[15:38:56] A124: Hmm, true.
[15:42:51] hobodave: any contributors to fakeredis hang out in here?
[16:01:11] EminenceHC: Say this block returns 100 records: Review.all.each do |review| How can I do something to 40 of them, and something else to 60 of them?
[16:01:31] jhass: ?rails EminenceHC
[16:01:32] ruboto: EminenceHC, Please join #RubyOnRails for Rails questions. You need to be authenticated with NickServ, see /msg NickServ help
[16:01:49] EminenceHC: jhass: Sorry didnt realize it was rails specific.
[16:02:10] jhass: the better solution is rails specific
[16:02:49] jhass: depends on the something I guess
[16:03:46] EminenceHC: jhass: Updating an attribute.
[16:07:18] shevy: hanmac why do you use gemtree?
[16:07:23] shevy: or perhaps why did you write it
[16:08:12] shevy: damn it... I went to bed way too early, woke up at 2:00 am and now I am getting tired again ... but if I sleep now, I get basically nothing done; I came home about an hour ago...
[16:26:26] shevy: hey jhass did you get any death threads when you suggested to deprecated #ruby-lang?
[16:26:31] shevy: death *threats
[16:26:45] shevy: and *deprecate, not deprecated. I need sleep apparently :(
[16:26:58] GaryOak_: It seems like there aren't many people talking in there
[16:27:12] shevy: GaryOak_ tell them that to their faces!
[16:27:37] shevy: but I have reconciled with my old enemies there ever since they no longer mandated registering to chat
[16:27:39] GaryOak_: there's a lot of random shit in here though, but we usually stay on topic if someone asks a question
[16:27:55] shevy: free donuts, free love, free chat
[16:28:04] eam: death threads would be like the Timeout module
[16:28:04] shevy: hey it's ruby relevant
[16:28:12] shevy: I am just coming home TO WRITE MORE RUBY code
[16:31:22] shevy: 60% of the vim config out on the www
[16:31:29] shevy: is simply copy/pasting of other people's vim config
[16:31:33] shevy: including their typos :D
[16:32:00] jhass: it's evolution, copy paste and make random edits
[16:32:05] shevy: it's now the third time I am reading: 'set cf " Enable error files & error jumping' (no typo there though)
[16:32:16] shevy: copy paste for more power
[16:33:15] GaryOak_: who's the ghengis khan of vim configs?
[16:33:53] shevy: btw why aren't you a vimster jhass?
[16:33:58] shevy: GaryOak_ DHH?
[16:37:20] GaryOak_: Are there any language compilers written in ruby?
[16:38:22] shevy: I think there are a few... let me think
[16:39:17] shevy: ragel-6.8/test/langtrans_ruby.txl
[16:39:17] ytti: if you'd have hash[42] = "moi"
[16:39:23] shevy: I guess ragel is written in C not ruby...
[16:39:30] ytti: it would be {}??of Integer => String
[16:39:33] ytti: (or fixnum or whatever)
[16:39:37] shevy: >> 42.class
[16:39:39] ruboto: shevy # => Fixnum (https://eval.in/316027)
[16:39:51] ytti: ohh, i'm on wrong channel
[16:39:53] shevy: >> hash = Hash.new; hash[42] = 'moi'; hash[42]
[16:39:55] ruboto: shevy # => "moi" (https://eval.in/316028)
[16:40:01] shevy: this is the right channel!
[16:40:04] shevy: for everything!
[16:40:22] shevy: I've recently read some of the blog comments about IRC being on the decline
[16:40:35] havenwood: GaryOak_: Crystal's compiler was written in Ruby before it was bootstrapped to Crystal.
[16:40:36] shevy: one argument was interesting; it said that because warez are no longer as important these days
[16:40:38] ytti: i was responding for question in another channel on this channel, because i'm bliind
[16:40:58] shevy: and I even remember having downloaded .mp3 files... in the pre-napster days back then, I think, via directl DCC chats through mIRC \o/
[16:41:16] shevy: ytti tell the guys to join here and learn ruby
[16:41:18] Daneel: i am absolutly beginer in ruby
[16:41:21] shevy: ytti what language is it anyway?
[16:41:24] havenwood: Daneel: Welcome!
[16:41:25] Daneel: i create this facter : https://gist.github.com/anonymous/bb3443dfceccd684e201
[16:41:26] ytti: shevy, crystal :)
[16:41:34] shevy: that's way too close
[16:41:43] shevy: go use some alien language
[16:41:46] shevy: like python
[16:41:52] Daneel: it return a list of words separated by a space
[16:42:00] ytti: elixir and rust are my top picks right now :)
[16:42:05] ytti: for something new
[16:42:15] Daneel: i would like to change the space by a comma
[16:42:27] Daneel: or better return an array in ruby point of view
[16:42:48] Daneel: i don't know how to do this
[16:43:06] havenwood: Daneel: Have you ever used String#split before?
[16:43:08] Daneel: some one can give me some method ?
[16:43:15] ytti: freenode is only irc network that i know of which is growing
[16:43:17] Daneel: havenwood: no
[16:43:26] GaryOak_: ytti: I've been trying out rust for a while
[16:43:32] havenwood: >> "some one can give me some method ?".split
[16:43:34] ruboto: havenwood # => ["some", "one", "can", "give", "me", "some", "method", "?"] (https://eval.in/316030)
[16:44:04] havenwood: >> "some one can give me some method ?".split.join ", "
[16:44:06] ruboto: havenwood # => "some, one, can, give, me, some, method, ?" (https://eval.in/316032)
[16:44:22] Daneel: havenwood: it looks good
[16:44:32] havenwood: Daneel: http://ruby-doc.org/core/String.html#method-i-split
[16:44:34] eam: havenwood just wrote a shatner-ifier
[16:45:42] Daneel: havenwood: so in my path i have to use Facter::Core::Execution.execute("blable").split ?
[16:47:31] havenwood: Daneel: If `Facter::Core::Execution.execute("blable")` returns the String you want to split, yup.
[16:48:38] Daneel: havenwood: thank you
[16:48:45] havenwood: Daneel: you're welcome
[16:50:04] shevy: havenwood is training the new generation
[16:50:09] shevy: and then his kids
[16:52:40] Technodrome: the mechanize library is kinda weird
[16:53:15] Technodrome: some methods it returns instances of mechanize, and sometimes it just straight out returns nokogiri instances
[16:54:37] shevy: things changed when they moved from hpricot to nokogiri
[16:54:45] shevy: I so fondly remember the good old hpricot days... and _why :(
[16:56:54] dudedudeman: i missed you guys over the weekend :(
[16:57:00] shevy: did you get drunk
[16:57:12] dudedudeman: me? no, that was thursday at lunchy time
[16:57:24] shevy: ok so YOU missed the weekend!
[16:57:39] dudedudeman: meh, i was working lol
[16:57:46] shevy: damn, on weekends???
[16:58:02] dudedudeman: i work 2, or really, 3 jobs
[16:58:07] kaspergrubbe: That is not recommended
[16:58:10] shevy: brave man
[16:58:25] dudedudeman: wont be the case all the time, definitely just a season
[16:58:39] dudedudeman: once i get a full-time job in development i'll phase one of them out
[16:58:49] dudedudeman: then use the second job to finish paying off some debt, and then be home free
[16:59:02] dudedudeman: i'm 27. i got a few more years of youth left in me i think
[17:02:46] shevy: lucky you
[17:02:51] shevy: once you are past 30
[17:02:55] shevy: it's going towards 40
[17:02:59] dudedudeman: diapers and fiber
[17:03:33] Technodrome: shevy: if i do search and you use an xpath string to a link or a set of links , you get an array of instances of Mechanize::Page::Link
[17:04:00] Technodrome: if you do a page.at and you give it the CSS class of the link , you get the link returned as a nokogiri instance
[17:04:13] Technodrome: then you have to use the Link.new to make your own
[17:08:23] shevy: I get a headache from such APIs
[17:09:57] wasamasa: TIL that rbenv contains a single C file
[17:09:59] wasamasa: "Speed up `realpath()` with dynamically loaded C extension"
[17:10:00] jhass: shevy: my main editor is sublime, I use vim for quick edits
[17:11:08] dudedudeman: no, it's ARGV
[17:18:05] cpt_yossarian: i see what you did there
[17:20:36] billy_ran_away: Can anyone help me think of a good exercise for consuming or generating an array of hashes?
[17:22:08] eam: billy_ran_away: can you give a bit more detail about your objective?
[17:22:53] billy_ran_away: eam: to demonstrate knowledge and comprehension of how to manipulate an array of hashes
[17:27:44] shevy: jhass ah, so vim for quickies, I see
[17:28:05] shevy: billy_ran_away why not create a hash rather than an array?
[17:28:31] eam: billy_ran_away: give someone a few pages of text from a book, ask for a per-paragraph and per-sentence word frequency count, printed in sorted order
[17:28:33] billy_ran_away: shevy: yea either way, just trying to create a homework exercies...
[17:28:39] billy_ran_away: anyone know of a good api endpoint I could hit that has an array of hashes? preferably something that could be averaged or manipulated in some way?
[17:29:05] billy_ran_away: thought about a bitcoin exchange or something but there wasn't anything that looked super great...
[17:29:09] eam: billy_ran_away: just upload a static json file?
[17:29:54] billy_ran_away: today's class is loops, arrays, and hashes, just need some homework where they loop though an array of hashes, but i can't think of any pre-text for why
[17:30:59] apeiros: billy_ran_away: parse a csv file
[17:31:32] apeiros: returning an array with {header => value, ???} hashes
[17:31:49] billy_ran_away: apeiros: got any interesting data to use for it?
[17:31:50] eam: call it a ledger for a business with product: sale
[17:31:55] eam: just make up some data
[17:32:00] apeiros: billy_ran_away: I'm sure there's plenty of gov data
[17:33:19] billy_ran_away: yea the only problem is i have to make a rule that you can't use a csv reader, or it can basically be done for them...
[17:33:24] shevy: he is stealing patient data!
[17:33:32] shevy: John Doe:
[17:33:53] shevy: also add jack the ripper there, in the case your teacher is a psycho geek
[17:33:54] apeiros: billy_ran_away: sure. use trivial csv, ie unquoted fields
[17:33:58] apeiros: where you can just split on ,
[17:34:27] eam: or just free-form text from a book
[17:34:30] eam: and use word counts
[17:34:39] ReK2GnULinuX: FYI: if anyone here is into/interested in infose+ruby https://www.reddit.com/r/ruby_infosec
[17:36:51] dudedudeman: i love that subreddit! i don't understand half the stuff in it, but i enjoy reading and learning
[17:37:42] shevy: hmm guys, if I have a dataset such as this here: http://pastie.org/pastes/10103660/text
[17:38:12] shevy: I guess this is a hash, in ruby terms?
[17:38:24] shevy: the values are missing right now, I have to fill them up first
[17:38:49] momomomomo: shevy: what is the question?
[17:39:24] shevy: I need to have it available in ruby
[17:39:32] momomomomo: have what available in ruby?
[17:39:33] shevy: I dunno how to best store it though
[17:39:38] shevy: that table dataset
[17:39:47] momomomomo: looks like an empty matrix to me
[17:40:03] shevy: I need to use the values and make calculations; this is a substitution matrix for estimating protein-to-protein comparisons
[17:40:20] shevy: do you know how tedious and boring it is to fill it!
[17:44:26] momomomomo: >> matrix = [[1, 2, 3 ,4], [5, 6, 7, 8]]; puts matrix[0][2]
[17:44:28] ruboto: momomomomo # => 3 ...check link for more (https://eval.in/316039)
[17:46:46] aawe: >> (1..8).each_slice(4).to_a
[17:46:47] ruboto: aawe # => [[1, 2, 3, 4], [5, 6, 7, 8]] (https://eval.in/316044)
[17:49:47] Scriptonaut: does anyone know how you can run a method and supress the output?
[17:50:21] Scriptonaut: like def hi; puts "HELLO"; end; hi <- does nothing
[17:50:24] momomomomo: Scriptonaut: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[17:50:50] Scriptonaut: what was wrong with that question?
[17:50:53] apeiros: Scriptonaut: reassign $stderr/$stdout
[17:50:55] momomomomo: Scriptonaut: it???d be better to know the context around what you???re doing
[17:51:00] momomomomo: rather than give an answer like that above
[17:51:11] momomomomo: chances are you may not actually want to do that
[17:51:39] Scriptonaut: I am making an api call that produces an insane amount of output
[17:51:46] momomomomo: Scriptonaut: take a second, read that article
[17:51:48] Scriptonaut: like many thousand lines worth
[17:51:49] momomomomo: come back and ask
[17:52:09] ninjs: is there a way to check for a character in a string? ' ' space for example
[17:52:10] apeiros: Scriptonaut: why would an api call produce output?
[17:52:10] aawe: what momomomomo is trying to say is: ask about what you want to achieve, not about your current strategy for achieving it
[17:52:20] apeiros: Scriptonaut: are you sure you're not talking about return values?
[17:52:21] momomomomo: hence, read that article Scriptonaut
[17:53:04] Scriptonaut: apeiros: ya not return values
[17:53:29] apeiros: Scriptonaut: then again: why'd an api call produce output?
[17:53:53] Scriptonaut: databasedotcom materalize method if you're curious
[17:53:59] apeiros: I suggest you find out
[17:54:05] apeiros: I'm not. you should be.
[17:55:24] aawe: Scriptonaut: do you mean that the gem you use to talk to the API logs a lot of output?
[17:55:57] Scriptonaut: it logs all the request/responses
[17:56:00] aawe: Scriptonaut: there might be a way to configure the gem to be less verbose
[17:56:07] Scriptonaut: ah, I'll check into that
[18:00:29] Rakko: I'm trying to find *official* documentation of ERB's template syntax, but I can't seem to find it in rdoc/ri. Is it just not there?
[18:01:31] momomomomo: Rakko: http://ruby-doc.org/stdlib-2.2.2/libdoc/erb/rdoc/ERB.html
[18:02:16] aawe: momomomomo: that does not document the syntax
[18:02:50] momomomomo: http://ruby-doc.org/stdlib-2.2.2/libdoc/erb/rdoc/ERB.html#method-c-new-label-Example
[18:03:14] aawe: momomomomo: again, that does not document the syntax
[18:03:14] momomomomo: no syntax definitions though
[18:03:26] aawe: erb has <% %> and <%= %> and <%== %> and <%# %> etc
[18:03:35] Rakko: ok. thanks
[18:04:15] momomomomo: aawe: Rakko http://stackoverflow.com/a/20910438/1162491
[18:04:36] Rakko: oh! so ERB isn't the same as eruby
[18:06:45] dudedudeman: no, ERB is a templating language that allows you to embed ruby code in to HTML
[18:07:26] dudedudeman: so instead of index.html, you use index.erb and the browser will render that as html with ruby passed in to it
[18:08:04] aawe: browsers know nothing about erb
[18:08:43] dudedudeman: i didn't say they did
[18:09:02] dudedudeman: just that the browser will render the page as html with ruby passed in to it
[18:09:50] Rakko: yes, I know that
[18:10:20] dudedudeman: i'm looking at this now....
[18:10:35] dudedudeman: and, i was confused
[18:11:07] dudedudeman: but according to the wiki gods, erb is an "implementation of eRuby written purely in the Ruby programming language and included in the Ruby standard library"
[18:13:49] dorei: >> require 'erb' ; @name = joe ; ERB.new("hello, my name is <%= @name %>").result(binding)
[18:13:51] ruboto: dorei # => undefined local variable or method `joe' for main:Object (NameError) ...check link for more (https://eval.in/316058)
[18:13:59] dorei: >> require 'erb' ; @name = 'joe' ; ERB.new("hello, my name is <%= @name %>").result(binding)
[18:14:00] ruboto: dorei # => "hello, my name is joe" (https://eval.in/316059)
[18:14:44] audy: ooh a robot
[18:20:36] shevy: nah audy dudedudeman is not a robot
[18:20:54] dudedudeman: i foten feel like one
[18:22:48] audy: >> class Robot; end; class DudeDudeMan < Robot; end; DudeDudeMan.new.is_a? Robot
[18:22:49] ruboto: audy # => true (https://eval.in/316060)
[18:23:08] dudedudeman: ACTION bee boop?
[18:23:26] havenwood: ACTION beep bop boop
[18:24:01] Technodrome: shevy: i get a headache too, i just don???t get why they are not consistent sometimes wen it make so much sense, unless there is some very good reasons
[18:32:27] weaksauce: shevy is that translation data symmetric?
[18:32:53] shevy: weaksauce hmmm not sure; I finished typing in the stuff, this is what I ended up with now:
[18:33:10] shevy: http://pastie.org/pastes/10103726/text
[18:33:50] weaksauce: looks like it yeah
[18:34:31] weaksauce: but that's a hash of hashes sure.
[18:34:46] shevy: would you store this as a table, and parse it; or store it directly in a hash?
[18:35:08] weaksauce: table in the database?
[18:35:23] weaksauce: probably not unless you needed to do some joins with it
[18:56:40] shevy: nono just for ruby
[18:56:53] shevy: adding a database is overkill
[19:09:24] wasamasa: you mean, a rdbms
[19:09:38] wasamasa: since strictly speaking, a fucking json dump is a database
[19:11:51] shevy: I don't use json
[19:13:15] eam: shevy: why not
[19:14:28] rom1504: because he likes yaml ofc
[19:14:45] shevy: eam dunno, I always used yaml sort of and kind of got used to it
[19:15:10] shevy: I remember a long time ago, fowl/fowlmouth having used .ini format files
[19:15:17] GaryOak_: Too many tabs in Yaml
[19:15:19] shevy: [another_header]
[19:15:27] ytti: i use json for m2m
[19:15:28] shevy: he ended up with #nim as former ruby hacker :)
[19:15:33] ytti: yaml for humans
[19:15:57] ytti: TOML is ini-style, rust uses it for their package manager
[19:16:13] rom1504: when you have a simple standard like json, what do you do ? invent a new language with the same purpose but with a far more complicated syntax of course
[19:18:58] ytti: there are plenty of serialization formats predating json
[19:19:11] ytti: i think fragmentation encourages innovation and progress
[19:19:24] eam: yaml is a mess, toml is ugly
[19:19:45] eam: json is unfortuante too but at least it's not quite so large
[19:20:04] havenwood: Shell not Ruby... but you can install Ruby with it so here's a script to automate pkgsrc package manager installation on OS X: https://gist.github.com/havenwood/d25276ec38fc6ac03685
[19:20:08] eam: thinking about serialization formats just makes me grumpy
[19:20:13] ytti: yet there is IJSON variant, as JSON is too ambiguous :)
[19:20:37] GaryOak_: there's stuff like MessagePack
[19:20:38] eam: json's biggest problem is no binary strings
[19:20:38] ytti: rfc749, very recent
[19:21:25] eam: looks like ijson has the same problem
[19:21:35] ytti: yes, it's not more than json
[19:21:37] ytti: it's less than json
[19:21:42] rom1504: you can store stuff in a binary format if you like
[19:21:43] ytti: it's simplified and ambiguities removed
[19:22:09] ytti: all ijson is also json
[19:22:14] ytti: but not all json are ijson
[19:22:46] rom1504: that means ijson is more complicated to check/parse
[19:23:37] ytti: it means you can make more assumptions about it
[19:23:45] ytti: and need less complexity
[19:23:51] rom1504: why json works : it's implemented in most languages, and if not, you can make a parser in a few lines
[19:24:17] ytti: i think you are thoroughly misunderstanding ijson
[19:24:25] rom1504: I don't know ijson ;)
[19:24:36] GaryOak_: and it mimics the style of the webs dynamic languages syntax for hashes and arrays
[19:24:39] ytti: check http://www.rfc-editor.org/rfc/rfc7493.txt
[19:24:42] rom1504: "but not all json are ijson" => ijson is more complicated to check
[19:24:53] havenwood: Ruby object notation is nice.
[19:25:09] eam: rom1504: that's correct, it forces an early failure rather than produce ambiguity
[19:25:17] eam: usually that's a good thing
[19:25:55] ytti: i would personally find it much easier to parse IJSON than JSON
[19:26:15] ytti: because it's more strict, which means i can make more assumptions and write less code
[19:27:19] eam: I don't see any changes which would make parsing simplified, the constraints seem to relate to data and datastructure limits
[19:27:49] ytti: i can rely it's utf8
[19:27:55] eam: ytti: json already is utf8
[19:28:07] ytti: it's not mandatory
[19:28:15] eam: pretty sure it is? checking
[19:28:34] dorei: u can always uuencode :p
[19:28:45] eam: oh, json is either utf8, 16 or 32
[19:28:48] ytti: i don't have to be prepared to handle arbitrarily large numbers
[19:29:06] ytti: i can just put number in fixed size integer
[19:29:07] ytti: and not worry about it
[19:29:08] havenwood: Not lispy enough. Let's use EDN.
[19:37:21] mwlang: I want to break up a large monolithic ruby file into several files organized by class names of the objects in the file. I am wondering what the best way to do the requires. I???ll likely organize the model classes similar to Rails??? models into two or three sub-folders, but I wasn???t sure if I could somehow do an auto-load approach without having to name everything explicitly with a require.
[19:38:36] mwlang: anyway, what are some suggested gems out there that I can steal the playbook from that do project file organization and autoload extremely well?
[19:38:48] dorei: mwlang: something like this: Dir[File.join(File.dirname(__FILE__), '..', 'models', '*.rb')].each { |f| puts f;require f } might help
[19:38:55] pipework: mwlang: I make files require their dependencies.
[19:39:38] havenwood: mwlang: Have the file structure mirror the namespace.
[19:39:43] mwlang: dorei: I???ve done that before. Just seems a little hacky.
[19:40:16] mwlang: havenwood: that???s what I???m after???mirroring the namespace with sub-folders..but I wasn???t sure the best way to load all the parts up.
[19:40:59] mwlang: one of my concerns is I do have a Base class that a bunch of models inherit from, so that base.rb definitely has to get loaded before the first model that uses it.
[19:41:36] havenwood: mwlang: Like pipework said, have the files require their deps.
[19:43:54] Ellis: how do i return the value of an instance variable after creating an instance of a class?
[19:44:11] havenwood: Ellis: As the instance of the class by way of a method it exposes.
[19:44:20] havenwood: Ellis: s/As/Ask
[19:45:08] havenwood: Ellis: So like an attr_reader is the simplest.
[19:47:02] Ellis: woo! thanks havenwood, i appreciate it
[19:48:35] catcher: What's used more commonly, procs or lambdas?
[19:49:20] GaryOak_: I've seen more proc examples
[19:49:22] catcher: I see what their differences are, but when those don't matter, what's used more?
[19:49:32] pipework: catcher: People like the dashrocket.
[19:49:43] pipework: I prefer proc to dashrocket myself.
[19:50:22] catcher: I haven't seen dashrockets for blocks yet, I'm sure I will soon
[20:05:53] ninjs: I really want to like python more (it runs on more things, it has a bunch more libraries for standard computing stuff) but I just can't. I always keep deferring to Ruby. Ruby is too good
[20:06:17] GaryOak_: ninjs: I feel the same way
[20:06:41] ninjs: GaryOak_: It's just so much more natural to me. Writing ruby I don't even have to think about it. Python on the other hand...
[20:07:52] bootstrappm: it makes me sad that the python DevOps tools are considered better than the Ruby ones
[20:08:00] bootstrappm: I wanna be able to use Ruby in my whole stack
[20:09:07] ninjs: I think python scripts seem to work with less errors on a PC, not sure why. The python way is just more PC friendly. but in a linux/unix environment, Ruby has been king for all of my devops stuff
[20:10:40] hdkwkd: I think the differences between python and ruby are not very deep
[20:11:45] ytti: if pc means windows, ruby definitely isn't too strong there
[20:11:54] Hijiri: are you including PC linux/unix with PC?
[20:12:03] Hijiri: nevermind, ytti beat me
[20:12:40] ninjs: yeah that's what I meant by PC. Windows
[20:12:41] ytti: i've had my first windows desktop for 6months or so now
[20:12:46] ytti: it makes me misarable
[20:12:56] ytti: i don't say windows is worse, it's just not what i'm used to
[20:13:16] ninjs: for instance, my python script that renames folders works flawlessly on mac and windows. My ruby script works great on mac, not on windows. Working on the same directory
[20:13:22] ytti: but i've let myself understand windows is big deal for game devels
[20:13:29] Hijiri: if you adopt stallmanism you will have no trouble saying that windows is worse
[20:13:55] ninjs: ytti: it is, unless you consider the fact that 'gaming' branches to a huge mobile gaming market now, which is almost solely done in xcode on macs
[20:14:29] ninjs: except for android stuff I guess... but the real money is in iOS anyways
[20:14:40] Hijiri: year of the linux desktop!
[20:15:02] ninjs: That's what I've done at home. Built a super beefy desktop that runs windows for games and linux for everything else
[20:20:08] GaryOak_: you can almost 'almost' use linux for your gaming machine now
[20:21:27] Hijiri: I don't play much that requires windows
[20:22:00] GaryOak_: I don't understand the whole Microsoft stack of products
[20:22:11] Hijiri: there are some japanese lewdgames that try to play video though, and that always crashes wine
[20:26:05] diegoviola: Hijiri: file a bug report?
[20:26:09] diegoviola: or try wine-staging
[20:26:48] Hijiri: maybe I will
[20:26:56] Hijiri: not right now though, I'm in a public place
[20:27:10] diegoviola: http://www.wine-staging.com/
[20:27:46] Hijiri: bleeding edge
[20:28:08] Hijiri: pulseaudio driver means wine won't steal my audio if I use PA for stuff?
[20:28:30] diegoviola: pulseaudio driver means wine will use be able to use pulseaudio
[20:29:08] diegoviola: so you don't have to redirect alsa to pulse
[20:29:18] Hijiri: thanks diegoviola
[20:29:29] diegoviola: it's beyond me why wine devs don't add pulse support to wine yet
[20:29:43] diegoviola: I refuse to use wine without pulse support
[20:30:24] jhass: it's been ages since I needed wine
[20:31:19] diegoviola: I don't game anymore so I don't need wine
[20:33:10] bricker: ACTION reads history
[20:35:02] GaryOak_: games that have in-app purchases are better off providing as many platforms as possible, which also encourages new tech to be built for those platforms
[20:37:01] catcher: Is linux generally the preferred OS for ruby dev?
[20:37:44] GaryOak_: I think unix in general
[20:37:58] GaryOak_: there aren't that many differences between linux and mac
[20:38:17] havenwood: catcher: A BSD or GNU/Linux of some flavor, generally.
[20:38:58] catcher: havenwood, nice. More common than mac you think?
[20:39:11] havenwood: catcher: Lots of OS X and some FreeBSD, OpenBSD and NetBSD too. I was counting OS X as a BSD since it is.
[20:39:21] catcher: fair enough
[20:44:59] havenwood: catcher: https://wiki.freebsd.org/Myths#FreeBSD_is_Just_OS_X_Without_the_Good_Bits
[20:54:45] Naypalm: so right I have this 45 year old filthy rails app that won't run and 1/50000 of the gems in its Gemfile have been updated in the past century
[20:54:56] Naypalm: what's the best course of action of redeploying this
[20:55:10] Naypalm: from Heroku and their magical woo-wee cloud solution?
[20:55:32] Naypalm: haven't been updated*
[20:56:56] Naypalm: at the moment I'm thinking a nuclear bomb would do the trick
[20:57:53] Powf: Hi, is there a way to force print or puts in an erb file please ? <%= is not working well for me because I am doing <%= Object.print %> which is using puts
[20:58:18] jhass: Naypalm: we may be able to help with concrete issues (and #RubyOnRails even more so), but you won't get anything useful in the vague
[20:58:44] avleen: hey folks, i've got a real weird one here: https://gist.github.com/avleen/51d15d8d327787d0e7ab array.each -> if -> if I'm updating a variable (@mac_address), if i do it inside an if, which is inside another if, which is inside an Array.each, the variable is never updated in the global scope.
[20:58:54] jhass: Powf: <%= foo %> or <%= foo.inspect %>, depending on what you want
[20:58:57] avleen: if i update it one level up inside the first if, then it is updated
[20:58:59] Naypalm: yeah I know, it's just *sigh*
[20:59:00] avleen: anyone seen that before?
[20:59:01] Naypalm: let me see
[21:00:06] jhass: Naypalm: you get the output of the puts though?
[21:00:12] jhass: er avleen ^, sorry
[21:00:20] avleen: jhass: totally
[21:00:31] Naypalm: the "puts"?
[21:00:34] avleen: jhass: the puts works fine, and can correctly print the value
[21:01:04] Naypalm: I think this is more RoR based so I might migrate my questions to there
[21:01:29] jhass: avleen: is that intended to be a find last algorithm, not find any or find first?
[21:01:45] Powf: jhass: No, I already have a specific function that prints what I want (MyObject.print does exactly my need). I need to call it in the erb file but the erb file overwrite my behavior
[21:02:22] avleen: jhass: it'll only ever find one or none, but yeah find last. i've tested it a few other ways to make sure @mac_address isn't getting set back to nil later or something, and that's definitely not happening
[21:02:37] jhass: Powf: you can't redirect stdout to an erb file in a sane manner, rewrite your method to return the string
[21:03:01] jhass: avleen: try using .find then
[21:03:16] jhass: @mac_address eths.find {|iface| ...
[21:03:26] avleen: jhass: lemme give that a shot
[21:03:27] jhass: er, @mac_address = eths.find {|iface|
[21:03:36] avleen: good call
[21:04:07] Shidash_: Hi- I'm getting a weird warning I've never seen before when I try to build a gem- "WARNING: lib/extract_set_terms.rb is not world-readable"
[21:04:23] Shidash_: What does world-readable here mean? I can't seem to find any explanation of this anywhere
[21:04:33] Shidash_: and the permissions look the same as on the files for any other gems I've made
[21:04:38] jhass: Shidash_: o+r
[21:05:37] platzhirsch: How's everyone
[21:05:45] avleen: jhass: looks like .find isn't in 2.0, so that'll break when i upgrade ruby. any idea for a method that is more future proof? :)
[21:06:05] jhass: what? what kind of object is eths?
[21:06:13] jhass: it's there since ever afaik
[21:06:31] avleen: oh, the 2.0 docs for Array didn't show it
[21:06:35] gr33n7007h: 20>> [].methods.grep /find/
[21:06:36] ruboto: gr33n7007h # => [:find_index, :find, :find_all] (https://eval.in/316121)
[21:06:46] avleen: OH, it's in the Enumerable docs i bet
[21:07:01] avleen: ACTION mad
[21:07:33] Shidash_: jhass: hm, I'm still getting that same warning after running chmod o+r on all the files and directories involved
[21:07:55] jhass: Shidash_: you're on newest RubyGems?
[21:08:02] Shidash_: jhass: yeah
[21:08:45] Shidash_: oh hm maybe not. Now it's telling me a different latest version is the latest version. Will try updating again
[21:09:07] jhass: Shidash_: https://github.com/rubygems/rubygems/blob/aad1014e124d65ed28dcd6580cbf6cf8441c1690/lib/rubygems/specification.rb#L2814
[21:09:10] jhass: so a+r actually
[21:11:45] Shidash_: jhass: yup, it's a+r
[21:12:24] jhass: let's see what ruby thinks it is then, ruby -e "p File.stat('lib/extract_set_terms.rb').mode"
[21:13:25] usandfriends: Does ThreadGroup automatically remove Thread's that have been killed/ended?
[21:14:19] Shidash_: jhass: 33188
[21:15:40] jhass: weird, it should run into that condition then
[21:15:49] jhass: can you check that file in your local install?
[21:16:02] jhass: (the one I linked)
[21:16:50] Shidash_: jhass: sure, will check. Also I can't actually use the gem- I get this error when I try to use it (but any other gem works) https://gist.github.com/Shidash/97a36f465c77b4f2b958
[21:17:29] jhass: Shidash_: not enough information
[21:17:36] jhass: share the .gem or something
[21:18:12] Shidash_: jhass: https://github.com/TransparencyToolkit/EntityExtractor
[21:18:38] jhass: your file is named term_extractor.rb, not termextractor.rb
[21:19:13] jhass: Shidash_: see http://guides.rubygems.org/name-your-gem/
[21:19:24] Shidash_: ah, that explains it. I just renamed some of the files
[21:20:09] havenwood: usandfriends: do you know how to check in irb/pry?
[21:27:45] usandfriends: havenwood: Yes. Just tested, looks like ThreadGroup automatically removes threads when they end/die.
[21:28:00] havenwood: usandfriends: yup! and automatically adds threads they spawn too.
[21:29:51] dudedudeman: can i cross post something here from a question i have over in #sinatra?
[21:29:54] havenwood: >> group = ThreadGroup.new; group.add a = Thread.new { Thread.new { Thread.stop } && Thread.stop }; sleep 0.1; group.list
[21:29:55] ruboto: havenwood # => (https://eval.in/316125)
[21:30:54] havenwood: dudedudeman: yeah, just say so in both channels if you crosspost, which you already did here
[21:32:42] dudedudeman: https://gist.github.com/anonymous/9b6a95e08c9c6b62d2b0
[21:32:54] dudedudeman: i have 4 get requests that i'm trying to pass
[21:33:01] jhass: ?gist-usage dudedudeman
[21:33:02] ruboto: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[21:33:40] dudedudeman: the first 13 lines pass correctly
[21:34:05] dudedudeman: what i'm trying to do, is pass my params back in on line 20 so i can make a thing/new page here
[21:35:01] dudedudeman: i currently can get /monitors/:tag/calibrations to work
[21:35:14] dudedudeman: what i want, is a /monitors/:tag/calibrations/new page
[21:39:51] dudedudeman: i know i can add a ?tag=abcdef to the end of a calibrations/new route, but that doesn't help solve the issue of how to call which ever tag is stored in params[:tag]?
[21:40:40] dudedudeman: my console output gives me this: "GET /monitors//calibrations/new HTTP/1.1" 404 400 0.0026
[21:40:52] dudedudeman: so it's routing, just skipping over the :tag param that i want to pass in to it
[21:43:11] jhass: does params["tag"] work?
[21:43:24] dudedudeman: it does in my first route
[21:43:32] dudedudeman: oh, you mean not :
[21:44:24] havenwood: Well, it's 4/20, so Happy Spring Equinox to all!
[21:44:32] dudedudeman: where would you recommend placing that, jhass
[21:45:04] jhass: well, what options do you see?
[21:45:21] adaedra: havenwood: it???s 20/4 ??_??
[21:45:33] havenwood: Or if you prefer, Happy Setting Orange, this fine 37th day of Discord.
[21:45:43] jhass: isn't it hitlers birthday or something?
[21:46:11] dudedudeman: as i look at it(in reference to my gist), i could place it in my redirect on line 16, or i could place it after my call to calibrations/new on line 15?
[21:47:02] Scriptonaut: 4/20 here involves a bunch of the ganja stores giving out free samples
[21:47:07] jhass: dudedudeman: huh? I'd like how you place in line 15 :P
[21:47:11] jhass: *like to see
[21:47:13] Scriptonaut: no hitler stuff
[21:47:25] dudedudeman: ah, you're right. i wouldn't that wouldn't be string interpolation. sorry.. lol
[21:47:38] bricker: #NoHitlerStuff
[21:47:41] dudedudeman: what i mean, is in my .erb template, where i call a href on that calibrations/new
[21:48:11] avleen: jhass: thanks for the tip earlier. .find worked like a charm.
[21:48:19] jhass: avleen: yw
[21:48:43] jhass: dudedudeman: now that's a quite different question
[21:49:24] jhass: dudedudeman: why would you ever call that route if all it does is redirect??
[21:49:46] jhass: I thought you're providing stuff to legacy clients there
[21:50:34] dudedudeman: i do that because you can't do string interpolation on an a href? as far as i understood
[21:50:46] jhass: sure you can
[21:50:52] GaryOak_: Does ruby's case, have the ability to fall through to the next case?
[21:51:11] jhass: dudedudeman: erb doesn't call _at all_ where you insert a <%=
[21:51:24] bricker: GaryOak_: sadly, no, ruby's implicit return also means implicit break
[21:51:27] jhass: er, doesn't care
[21:51:27] dudedudeman: oh my god.... is that what i've been sitting here missing
[21:51:43] bricker: GaryOak_: HOWEVER, ruby does let you specify multiple conditions for a single case block: `case String, Array `
[21:51:49] GaryOak_: bricker: so the best I can do is a bunch of if statements?
[21:52:08] jhass: dudedudeman: erb is just fancy way to build a string, it doesn't even know you're building HTML
[21:52:11] bricker: GaryOak_: Closest you'll get is to use the multi-condition case as I said above
[21:52:42] GaryOak_: I'm building a custom sql query builder that can check if a value is set and add it to a query
[21:55:18] dudedudeman: jhass: if i'm using this to call my route: <a href="/calibrations/new">Add Calibration</a>, where would <%= %> fit in that/
[21:55:39] dudedudeman: i tried putting it inbtween calibration and new, but that didn't work
[21:56:55] jhass: dudedudeman: <a href="/monitors/<%= tag %>/calibrations/new">Add Calibration</a>
[21:57:26] jhass: replace tag with whatever you get the tag from
[22:02:05] dudedudeman: jhass, i can replace it with where i'm getting the tag from, but it's still doing the same thing
[22:02:13] adaedra: why do I feel like the same discussion is taking place in two different channels
[22:02:24] dudedudeman: two different people are helping me?
[22:02:31] jhass: sigh, he doesn't transfer help?
[22:02:31] dudedudeman: sorry if that's frowned upon. :/
[22:02:43] jhass: it's not, but you need to inform both channels of the state
[22:02:48] jhass: so we don't duplicate effort
[22:04:04] dudedudeman: my apologies, then
[22:04:32] dudedudeman: i did let both channels know i cross posted, didn't know i needed to invite individual members to only one
[22:05:02] jhass: I don't think that's what I said
[22:05:18] adaedra: well, it???s nice to let people know someone else is on the issue and helped you, so we don???t try to re-do the same thing
[22:05:50] jhass: not only that it's happening, you should inform both channels of provided suggestions and their outcome
[22:06:25] adaedra: because some of messages Rennex and pangur looks like jhass after a quick read
[22:06:44] dudedudeman: you are correct
[22:06:58] bricker: I think the cross-over between #RoR and #ruby of people who can actually help is about 90%, cross-posting for help is usually pointless
[22:07:15] bricker: RoR has more traffic just because there are more questions
[22:07:22] adaedra: bricker: in RoR case, we usually redirect them to #RubyOnRails here.
[22:07:29] adaedra: so the problem doesn???t exist.
[22:07:38] bricker: adaedra: that too
[22:07:42] adaedra: #sinatra, on the other hand...
[22:07:46] dudedudeman: well, now i'm just frustrated that i messed up here so i'm useless at this point trying to figure out my problem
[22:08:02] adaedra: no, continue
[22:08:20] adaedra: just, if something progresses thanks to one channel, says so in the other one
[22:08:27] adaedra: like you just did
[22:08:50] dudedudeman: roger. i'll def remember that
[22:09:17] dudedudeman: and thank you
[22:10:24] dudedudeman: so from what i gather, this is incorrect
[22:10:26] dudedudeman: redirect "/monitors/#{params[:tag]}/calibrations/new"
[22:10:48] dudedudeman: but, passing params["tag"] would be a better option
[22:10:58] adaedra: (I???ll need a moment to backlog all that)
[22:12:50] jhass: dudedudeman: no, I think you just incorrectly described your issue, we're past that aren't we? You don't need the additional routes at all
[22:13:28] dudedudeman: i'd agree, i'm not wanting to add additional routes, but it seems that one of my routes is wrong?
[22:13:47] jhass: you do know that we don't see your screen?
[22:14:06] dudedudeman: yes i do know that.
[22:14:12] dudedudeman: what else can i gist for you
[22:15:16] jhass: start by properly describing your issues, if you use "X is wrong" and "X doesn't work", you're doing it wrong
[22:15:49] jhass: 1) assumption 2) steps you took to verify your assumption 3) actual behavior
[22:16:29] adaedra: standard format: This is my code, I want it to do this, It does this. (Replace this by concrete, reproductible samples)
[22:16:40] mwlang: I???m working on setting up specs for my project. This project is processing about 500mb of data each time the scripts run for it, so I want to be sure the PORO???s are being released/garbage collected at the end of each section. How can I be sure the objects are getting GC???d (other than just watching memory consumption via top, etc. in the OS?
[22:17:48] mwlang: for those curious, its using the Ox gem and the SaxParser to process large XML files.
[22:17:51] adaedra: mwlang: I don???t think GC is predictable
[22:18:06] adaedra: supposed to be*
[22:18:24] mwlang: adaedra: aren???t there techniques for peeking into the GC and or doing a manual flush and then checking things?
[22:18:39] adaedra: you can look into the GC object
[22:18:43] ruboto: adaedra # => GC (https://eval.in/316130)
[22:18:43] jhass: you can influence it but you can't completely control it
[22:19:17] adaedra: dudedudeman: you???re trying to generate a href from a url param?
[22:19:30] jhass: influence point 1) environment variables starting with GC_ 2) GC object to disable/enable it and trigger a manual run
[22:19:44] jhass: a manual run is just that, it won't free as much as possible
[22:20:36] mwlang: jhass: as long as I can confirm that memory isn???t being held indefinitely, that???s all I need to check.
[22:20:57] jhass: well, you can also check GC.stats
[22:21:01] jhass: >> GC.statss
[22:21:03] ruboto: jhass # => undefined method `statss' for GC:Module (NoMethodError) ...check link for more (https://eval.in/316131)
[22:21:06] jhass: >> GC.stats
[22:21:07] ruboto: jhass # => undefined method `stats' for GC:Module (NoMethodError) ...check link for more (https://eval.in/316132)
[22:21:13] jhass: or whatever it was
[22:21:15] mwlang: basically, if I load 1,000 Products and I trigger a clean up and see that < 1,000 items are there, I???m golden.
[22:21:31] dudedudeman: adaedra: possible? at this point i don't care if it's a button or a link or whatever, i just need to get to my '/new' page
[22:21:37] jhass: >> GC.stat
[22:21:39] ruboto: jhass # => {:count=>5, :heap_allocated_pages=>35, :heap_sorted_length=>36, :heap_allocatable_pages=>0, :heap_av ...check link for more (https://eval.in/316133)
[22:21:52] mwlang: jhass: bingo
[22:22:12] adaedra: dudedudeman: so what???s your problem with "/monitors/#{params[:tag]}/calibrations/new" ?
[22:22:21] adaedra: just put some erb code that outputs that
[22:22:34] jhass: dudedudeman: <a href="/monitors/<%= tag %>/calibrations/new">Add Calibration</a> # what's wrong with that?
[22:22:53] adaedra: (it???s late, my backlogging capacity is down actually, sorry)
[22:23:09] mwlang: ah, this is quite helpful: http://thorstenball.com/blog/2014/03/12/watching-understanding-ruby-2.1-garbage-collector/
[22:23:36] dudedudeman: adaedra: no worries. when i first posted my issue here, my output console is showing /monitors//calibrations/new. it's skpping over where i want to put the params entirely
[22:23:56] dudedudeman: jhass: what's wrong with that, is me. i'm sure i'm not using that correctly
[22:24:11] adaedra: what do you mean, not using that correctly
[22:24:16] adaedra: it doesn???t work?
[22:24:20] adaedra: what does it displays?
[22:24:50] jhass: dudedudeman: since I don't want to guess how you get the tag, you need to replace it
[22:25:33] dudedudeman: i'm getting it like so: @tag = DreamColorMonitor.find_by_tag(params[:tag])
[22:25:35] havenwood: mwlang: Nice GC changes in 2.2 as well: https://engineering.heroku.com/blogs/2015-02-04-incremental-gc
[22:25:57] jhass: if you did that, back to our base 3: what did you replace it with (your assumption), how did you verify your assumption (looking at the generated source, just clikcing on it?), what's the actual behavior
[22:28:41] mwlang: havenwood: thanks for that link. Good coverage of GC in general.
[22:29:59] dudedudeman: my apologies for not seeming to grasp this, guys
[22:31:22] jhass: don't apologize, provide more info
[22:34:09] dudedudeman: here is a gist of my routes, https://gist.github.com/anonymous/900d0df4dbb1f4481eb3
[22:34:48] dudedudeman: and i'm attempting to call from my erb template based on what you mentioned, jhass: <a href="/monitors/<%= @tag %>/calibrations/new">Add Calibration</a>
[22:35:12] havenwood: dudedudeman: name the gist filename with a .rb extension
[22:35:27] jhass: 3: actual output
[22:35:43] jhass: it's not that hard
[22:36:09] dudedudeman: here's a .rb gist.. https://gist.github.com/anonymous/5b96f02cfdb98aa6307b
[22:36:57] adaedra: and I suppose you???re trying to get this displayed from the calibrations.erb file ?
[22:37:37] jhass: you provided your assumption, you still refuse to provide actual behavior
[22:37:55] dudedudeman: on that gist, lines 1-12 show up correctly in my browser as i want them to
[22:38:01] jhass: all we know so far is that "it doesn't work"
[22:38:23] adaedra: ok, time to go to sleep for me, see ya all
[22:38:28] dudedudeman: i guess what's frustrating here, jhass, is that i feel my code is my actual behavior. i'm trying to write out in code what i want to do
[22:38:47] jhass: I think I bail out of this, somebody else can try to get any kind of useful information out of this guy
[22:40:05] Rennex: heh, you guys
[22:41:54] Rennex: looks a bit like you get yourselves frustrated a bit too... you're hung up some 1-2-3 process but not saying what exactly you want to know (even if it'd be nice to not have to ask) :P
[22:42:42] dudedudeman: i'd agree to that. lol. i do realize there are rules to a chat like this, but i joined like, a week ago? i'm still working on navigating all of them.
[22:43:02] dudedudeman: but it's not just rules for this chat, there are rules to properly asking a question so that one is not wasting someone's time who is willing to help out
[22:43:13] dudedudeman: which i believe is what jhass is frustrated about
[22:45:39] jhass: your code is your assumption, it should do something, you observe it and it doesn't do what you assumed, which leads you to saying "it doesn't work". What you observe there is the actual behavior. You share your conclusion of the actual behavior ("it doesn't work"), but not the actual behavior (the output of your program in most cases)
[22:46:33] dudedudeman: i did share my output, jhass, a couple times. i says this: "GET /monitors//calibrations/new HTTP/1.1" 404 400 0.0022
[22:46:47] dudedudeman: unless i'm royally f*cking up what i'm thinking my output is
[22:47:03] dudedudeman: but when i run my code, click my links, that's what shows up. that exact 'error'
[22:47:09] dudedudeman: in my console
[22:47:19] jhass: that's actually input, in this case affected by previous output
[22:47:51] jhass: your output would be the generated HTML in this case
[22:47:53] Rennex: dudedudeman: so, add a p(params) before that redirect "/monitors/#{params[:tag]}/calibrations/new", and see what it prints to console?
[22:48:50] Rennex: jhass: semantics which are at best tangential to the problem
[22:48:54] jhass: Rennex: he only does that redirect because he can't believe that you can use erb tags inside an a's href
[22:49:13] dudedudeman: please don't make assumptions about me like that, jhass
[22:50:26] jhass: 23:50 <dudedudeman> i do that because you can't do string interpolation on an a href? as far as i understood
[22:50:57] dudedudeman: and then you told me differently, and then i realized my mistake, and moved on
[22:51:39] jhass: then why do we still bother with the redirect?
[22:51:50] Rennex: i like to think that the first objective is to make things work, and only second to make it good if the author has the time and enough knowledge of ruby.. :)
[22:52:35] dudedudeman: because i'm not quick enough to rewrite what i'm attempting to do. i know the redirect works in the first place. i have one of them working. the other is not working, that is the one i'm coming to you guys with issues about. why try to fix something that isn't broken?(yet..)
[22:53:30] jhass: share your current code (including the view), you mentioned you set @tag, none of the code you shared does so
[22:53:32] dudedudeman: i have your notes about what you said about erb tags inside of a href, and when i get my issue worked out, i was actually planning on going back and refactoring all of this
[22:53:48] dudedudeman: do you want my entire github to the project?
[22:55:23] dudedudeman: ok, i'll push my latest and share
[22:55:45] dudedudeman: also, Rennex, when i do p(params) i get a {} after that redirect
[22:57:50] dudedudeman: jhass: https://github.com/JohnHeywardOBrien/DC
[22:58:43] GaryOak_: What's a dreamcolor?
[22:59:01] Rennex: dudedudeman: even when you get that route with a query string, like "/calibrations/new?tag=abc123" ?
[22:59:38] dudedudeman: GaryOak_: it's a type of monitor made by HP used for color accurate display
[23:00:39] dudedudeman: i'm in charge of calibrating them at work(i do not have a full-time dev job) and i'm working on building an app that will let me keep track of them online
[23:02:12] dudedudeman: Rennex: i did that earlier, and while it does pass in the tag to the position i want, it still gives me an error and wont display my erb file
[23:02:33] dudedudeman: an html error, not an input from my console, as i learned from jhass
[23:03:09] dudedudeman: now, when i look at my console, it does have a has of {"tag"=>"abc123"} from the p(params)
[23:03:44] Rennex: ok. so what's the html error? like sinatra's own debugging page?
[23:03:56] jhass: let's shortcut this: http://paste.mrzyx.de/pqxxjokak
[23:05:22] dudedudeman: good lord, 12 people have looked at that
[23:05:53] jhass: welcome to IRC, where only 10% of the active people ever speak ;)
[23:06:30] Rennex: looks good to me
[23:06:33] dudedudeman: thank you for tackling this with me, jhass. this paste, i'm assuming the red is something you want me to get rid of?
[23:06:48] jhass: yes, it's a diff
[23:07:08] dudedudeman: please pardon my ignorance, but what is a diff
[23:07:22] jhass: http://en.wikipedia.org/wiki/Diff_utility
[23:07:44] jhass: in your repo, run git show for example
[23:08:02] TheNet: I accidentally deleted my global gemset, how can I get it back? (RVM)
[23:10:19] ramfjord: yeah dudedudeman, the reason that I looked at it without commenting is that I realized there were 10 pages of backstory after looking
[23:10:41] ramfjord: TheNet: you're not using bundler?
[23:10:47] dudedudeman: oh, here on the channel? yeah... sorry. :( :(
[23:11:21] TheNet: ramfjord: I don't even have bundler installed anymore
[23:11:49] ramfjord: if you were using it before, than at least the versions are saved in your Gemfile.lock
[23:12:17] ramfjord: did you delete it with rm -r, or with gem uninstall?
[23:12:26] ramfjord: and what is in your $GEM_HOME?
[23:12:39] TheNet: ramfjord: I did rvm gemset empty default
[23:13:04] TheNet: ramfjord: I didn't realize that would delete global gems too
[23:14:14] ramfjord: TheNet: try #rvm - they are extremely helpful. I would definitely tell them the exact command you used (rvm gemset empty default)
[23:14:17] dudedudeman: jhass: thsi is great. this makes so much more sense
[23:14:27] TheNet: ramfjord: alright thanks
[23:14:47] dudedudeman: when i click on the add calibration link, it still throws an error on me though
[23:15:21] dudedudeman: it does show me that it's passing in whatever tag number i've clicked on though
[23:16:48] Rennex: and what is the error
[23:17:19] dudedudeman: Request Verb GET
[23:17:20] dudedudeman: Request Path /monitors/123456/calibrations/new
[23:17:34] dudedudeman: sorry, didn't realize that would break it up in to three lines
[23:18:00] dudedudeman: it throws a 404 and 407 http error?
[23:18:41] Rennex: you have a `get 'monitors/:tag/calibrations/new' do`
[23:18:50] Rennex: that's missing a slash from before monitors :P
[23:19:04] dudedudeman: ... can i swear in here?
[23:19:28] Rennex: i dunno, i don't mind ;)
[23:19:38] dudedudeman: ACTION is fucked
[23:20:17] dudedudeman: well, fixing that brings about another error
[23:20:22] dudedudeman: this time i get an actual error page
[23:21:00] dudedudeman: undefined method 'get'
[23:21:02] dudedudeman: i'm googling that now
[23:22:47] Rennex: dudedudeman: you get that if you try to put a route definition inside another
[23:23:07] dudedudeman: a route definition inside another
[23:23:21] Rennex: like get "/foo" { get "/bar" ... }
[23:24:24] dudedudeman: inside that get request, i had @tag = DreamColorMonitor.get(params[:tag])
[23:25:13] dudedudeman: i didn't think about that possibly messing with my http get request
[23:25:36] Rennex: it wouldn't, if that class actually defined a get() method
[23:26:34] dudedudeman: making the appropriate instance variables for erb as directed by jhass, adding in a freaking / where i didn't realize i was missing one, and then the get thing you just described... well, that made it work!
[23:27:05] Rennex: finally :)
[23:27:26] dudedudeman: jhass: thank you.
[23:27:36] dudedudeman: you too, Rennex
[23:28:05] dudedudeman: i'm going to go re-think a few things and write down what i've learned