« Back to channel list

#ruby - 18 April 2018

« Back 1 day Forward 1 day »
[00:07:22] xuanrui: has joined #ruby
[00:08:58] shtirlic_: has joined #ruby
[00:15:04] karapetyan: has joined #ruby
[00:20:17] cadillac_: has joined #ruby
[00:36:03] erlend: has joined #ruby
[00:37:24] yxhuvud: has joined #ruby
[00:39:06] cagomez: has joined #ruby
[00:40:04] jinie: has joined #ruby
[00:45:05] shtirlic_: has joined #ruby
[00:55:27] jready: has joined #ruby
[00:58:56] eckhardt: has joined #ruby
[00:59:11] yxhuvud: has joined #ruby
[01:04:39] Dimik: has joined #ruby
[01:05:44] yxhuvud: has joined #ruby
[01:08:23] bmurt: has joined #ruby
[01:08:44] Psybur: has joined #ruby
[01:09:57] Xiti: has joined #ruby
[01:15:11] karapetyan: has joined #ruby
[01:19:31] gizmore: has joined #ruby
[01:20:00] shtirlic_: has joined #ruby
[01:20:51] yxhuvud: has joined #ruby
[01:23:08] kapil___: has joined #ruby
[01:25:59] yxhuvud: has joined #ruby
[01:27:10] xuanrui: has joined #ruby
[01:28:12] shtirlic_: has joined #ruby
[01:29:36] dcunit3d: has joined #ruby
[01:32:56] n0m4d1c: has joined #ruby
[01:42:03] heyimwill: has joined #ruby
[01:46:08] workmad3: has joined #ruby
[01:47:31] dinfuehr_: has joined #ruby
[01:50:57] konsolebox: has joined #ruby
[01:54:07] mikhael_k33hl: has joined #ruby
[01:54:30] mikhael_k33hl: How do you format a string like I want to create a table with columns and populate its rows as a report before sending it as an email.
[01:56:31] nicesignal: has joined #ruby
[01:57:18] havenwood: mikhael_k33hl: Are you still asking about sending a CSV via email?
[01:58:06] havenwood: mikhael_k33hl: "columns and rows" is too vague to answer, but I've gathered from your past answers that a comma separated values spreadsheet suffices for what you're doing?
[01:58:23] havenwood: mikhael_k33hl: Have you made a CSV file before? Do you know what that would look like?
[01:58:37] mr-robert: or use HTML.
[01:58:40] havenwood: You keep talking about sending "a report" or "columns and rows" but that could be so many things...
[01:59:52] havenwood: mikhael_k33hl: When you take your data and format it into a string for sending it somewhere, it's called "serialization,." You then "deserialize" on the other side. I take it from what you've said on previous days that you want this data to be a spreadsheet. Is that true?
[02:00:01] ruby[bot]: it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[02:00:03] ruby[bot]: it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[02:01:15] yxhuvud: has joined #ruby
[02:01:35] havenwood: mikhael_k33hl: If you tell us instead what data you're sending, to who, and why, we can answer the question much better and more definitively.
[02:02:33] havenwood: mikhael_k33hl: The answer folk here have given in the past is send CSV with Pony. If that's not a good solution for you, say more about what you're trying to do.
[02:03:19] havenwood: mr-robert: Yeah, HTML has columns and rows! ¯\_(ツ)_/¯
[02:03:20] havenwood: It satisfies the requirements as stated.
[02:03:23] mikhael_k33hl: havenwood: I was thinking of having it like: https://gist.github.com/marzdgzmn/aba35001e7a3260efd10f3f70fbabf6a
[02:03:44] havenwood: What is that data? Why are you sending it? Who are you sending it to? What are they doing with it?
[02:04:21] havenwood: mikhael_k33hl: Your pseudo data there could be represented well by CSV.
[02:04:32] mikhael_k33hl: havenwood: That is data I will be retrieved from a database(sqlite3). I'm trying to implement a function to send it to me in my email.
[02:05:19] havenwood: mikhael_k33hl: And what are you doing with it once you receive the email?
[02:05:32] weaksauce: has joined #ruby
[02:05:50] havenwood: mikhael_k33hl: Loading it into a spreadsheet? Storing it for posterity? Parsing it into another program?
[02:06:09] mikhael_k33hl: havenwood: Uhhhm, it serves as a report so I just need to know the dates and status. If I need to do anything, it will be done manually by me logging in to the server where the script it :)
[02:06:20] havenwood: So you just want a human-readable representation.
[02:06:35] havenwood: mikhael_k33hl: Do you care what program you're reading it with, or just that it can be easily read?
[02:06:48] alfiemax: has joined #ruby
[02:06:54] mikhael_k33hl: If I format the string in ruby using formatting flags(e.g. "%20{ruby}".% ruby: "Idiosyncratic"), will it be formatted that way once I send it as an email?
[02:06:54] havenwood: mikhael_k33hl: Is it a lot of data, would it be advantageous to open it with a spreadsheet processor?
[02:07:06] mikhael_k33hl: havenwood: Just so that it can be easily read
[02:07:23] havenwood: mikhael_k33hl: YAML or pretty generated JSON are options.
[02:07:25] mikhael_k33hl: havenwood: Nah, it'll be like 20 line tops, I'd rather have it in an email body
[02:07:46] havenwood: CSV wouldn't look nice in an email.
[02:07:58] havenwood: mr-robert's suggestion is back on the table ;-)
[02:08:23] mr-robert: yeah. sending reports as HTML is pretty common.
[02:08:32] yxhuvud: has joined #ruby
[02:08:43] mikhael_k33hl: oh I see, i'll try using html tags then
[02:09:14] xuanrui: has joined #ruby
[02:09:18] havenwood: >> require 'json'; puts JSON.pretty_generate({mikhael_k33hl: [1, 2, 3]})
[02:09:19] ruby[bot]: havenwood: # => { ...check link for more (https://eval.in/989951)
[02:09:57] havenwood: mikhael_k33hl: If you try that ^ in irb or look at the result you can see how pretty JSON would look. HTML gives you a lot more styling options.
[02:10:47] havenwood: mikhael_k33hl: It's dead simple to do pretty JSON or YAML, which are both human readable. If you want more control over how it looks, you could bother with proper HTML.
[02:12:52] ramfjord: has joined #ruby
[02:13:18] havenwood: mikhael_k33hl: ERB or Nokogiri::HTML::Builder would be two of many options for HTML.
[02:13:28] havenwood: mikhael_k33hl: JSON and YAML are in the stdlib, and are worth learning how to use in any case.
[02:14:03] mr-robert: erb is stdlib and def worth it too
[02:14:23] havenwood: Yeah, ERB is totally worth learning for a variety of reasons.
[02:15:18] havenwood: If Nokogiri didn't have deps it'd be in the stdlib too.
[02:15:28] pastorinni: has joined #ruby
[02:16:35] havenwood: mikhael_k33hl: You can probably get it working very quickly with JSON or YAML. If you'd like us to show you how to use ERB I'm sure someone here would be happy to.
[02:16:45] yxhuvud: has joined #ruby
[02:17:25] havenwood: mikhael_k33hl: JSON.pretty_generate your_data_here
[02:18:13] havenwood: mikhael_k33hl: Psych.dump your_data_here
[02:18:34] mikhael_k33hl: havenwood: thanks, I"ll give JSON a try
[02:19:01] havenwood: JSON.pretty_generate({response: "you're welcome"})
[02:19:33] havenwood: Don't forget to: require 'json'
[02:20:44] chrisseaton: has joined #ruby
[02:27:00] yxhuvud: has joined #ruby
[02:32:33] dr3wo: has joined #ruby
[02:37:34] kurko_: has joined #ruby
[02:38:31] kurko_: has joined #ruby
[02:39:17] kurko_: has joined #ruby
[02:40:09] kurko_: has joined #ruby
[02:40:55] kurko_: has joined #ruby
[02:41:48] kurko_: has joined #ruby
[02:42:26] kurko_: has joined #ruby
[02:43:22] kurko_: has joined #ruby
[02:44:08] kurko_: has joined #ruby
[02:44:43] erlend: has joined #ruby
[02:44:47] kurko_: has joined #ruby
[02:45:13] mroutis: has joined #ruby
[02:45:33] kurko_: has joined #ruby
[02:46:18] kurko_: has joined #ruby
[02:47:16] kurko_: has joined #ruby
[02:48:07] kurko_: has joined #ruby
[02:48:50] yxhuvud: has joined #ruby
[02:57:45] yxhuvud: has joined #ruby
[02:58:07] alfiemax: has joined #ruby
[03:00:10] cadillac_: has joined #ruby
[03:01:07] noobineer: has joined #ruby
[03:03:39] dcunit3d: has joined #ruby
[03:06:26] GiuseppeP: has joined #ruby
[03:06:39] rf: has joined #ruby
[03:06:49] xuanrui: has joined #ruby
[03:07:20] GiuseppeP: guys, how do i delete those characters with code 160? https://pastebin.com/SQuPQL2d
[03:07:20] ruby[bot]: giuseppe_: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[03:07:43] airstream66: has joined #ruby
[03:08:21] GiuseppeP: guys, how do i delete those characters with code 160? https://gist.github.com/agfp/098d3fcbd5592cca0fb6fbcbf8aecff0
[03:09:11] linuxdaemon: has joined #ruby
[03:09:21] airstream66: has joined #ruby
[03:09:57] DTZUZO: has joined #ruby
[03:13:14] cadillac_: has joined #ruby
[03:13:31] orbyt_: has joined #ruby
[03:15:05] dcunit3d: has joined #ruby
[03:17:34] gix-: has joined #ruby
[03:19:11] cschneid_: has joined #ruby
[03:22:11] mroutis: has joined #ruby
[03:24:04] envex: has joined #ruby
[03:24:13] xuanrui: has joined #ruby
[03:24:26] karapetyan: has joined #ruby
[03:25:37] xuanrui: has joined #ruby
[03:26:23] alfiemax: has joined #ruby
[03:28:00] xuanrui: has joined #ruby
[03:28:25] yxhuvud: has joined #ruby
[03:29:13] cschneid_: has joined #ruby
[03:34:17] cagmz: has joined #ruby
[03:35:28] havenwood: gius, aww, they left
[03:36:09] jenrzzz: has joined #ruby
[03:36:09] jenrzzz: has joined #ruby
[03:37:10] havenwood: >> 160.chr('UTF-8')
[03:37:11] ruby[bot]: havenwood: # => " " (https://eval.in/989958)
[03:37:21] cagmz: what is the best way generate a hash from a hash of k,v pairs? ie least chance of collision
[03:37:37] havenwood: cagmz: hash from a hash?
[03:37:58] havenwood: cagmz: give an example in pseudo code?
[03:38:27] cagmz: cagmz, hash/checksum generated from a Hash. like an MD5 hash
[03:38:48] cagmz: haha wow, long day. @ havenwood
[03:39:06] havenwood: cagmz: Ah, err. I'm still confused! Yeah, long day...
[03:39:20] havenwood: cagmz: You have a Hash like {} and you want a checksum of it?
[03:39:39] havenwood: cagmz: But not one to use internally in Ruby, or yeah?
[03:39:44] ruby[bot]: havenwood: # => 415101549 (https://eval.in/989959)
[03:39:51] ruby[bot]: havenwood: # => 183856668 (https://eval.in/989960)
[03:40:09] cagmz: well, my intent is to pass it to Rails.cache.write to ensure a unique cache key
[03:40:23] havenwood: cagmz: And you'll have multiple Ruby processes?
[03:40:44] cagmz: not sure if generating a checksum from a {} is overkill. yes, multiple ruby processes accessing a distributed cache (multiple memcached servers)
[03:43:54] havenwood: cagmz: I'm curious what aspect of the Hash identifies that it should correspond to that cache?
[03:44:13] havenwood: cagmz: The key/value content being identical?
[03:44:41] cagmz: the hash will contain k, v values such as { user_id: 1, item_id: 2 }
[03:45:05] havenwood: cagmz: And are all of those relevant to the cache lookup? They all have to be the same, or just certain ones of them?
[03:45:23] workmad3: has joined #ruby
[03:46:08] cagmz: yes. that hash would be a key to item 2's data. and { user_id: 1, item_id: 3 } for item 3
[03:47:11] havenwood: cagmz: If the hash was serialized and deserialized would you want it to still lookup the same hash? So like you care about the hash content, not object ids?
[03:47:22] arescorpio: has joined #ruby
[03:47:47] postmodern: has joined #ruby
[03:47:48] alfiemax: has joined #ruby
[03:48:04] havenwood: err, i mean still lookup the same cache key?
[03:48:15] cagmz: havenwood, yeah, the hash content is the actual cache key. not the object id
[03:49:26] havenwood: cagmz: Maybe just #inspect and SHA512?
[03:49:55] havenwood: >> require 'digest/sha2'; Digest::SHA512.hexdigest({cagmz: true}.inspect)
[03:49:56] ruby[bot]: havenwood: # => "3573a14feed0198699363aa6a6cc1305aabe6d508cad825c47ff3dc24e76a1f9daa8d050af78bb53ccad79d85414e6daf0b ...check link for more (https://eval.in/989968)
[03:49:57] havenwood: >> require 'digest/sha2'; Digest::SHA512.hexdigest({cagmz: true}.inspect)
[03:49:58] ruby[bot]: havenwood: # => "3573a14feed0198699363aa6a6cc1305aabe6d508cad825c47ff3dc24e76a1f9daa8d050af78bb53ccad79d85414e6daf0b ...check link for more (https://eval.in/989969)
[03:51:18] cagmz: >> require 'digest'; key = { user_id: 1, item_id: 2 }; Digest::SHA256.digest key.to_s
[03:51:19] ruby[bot]: cagmz: # => "\xAA_g\x90e\xA6\xD2\xE8\xBE\x8Dv@<T\xCE\xBE\xBB\x16\xF1\xE5{+5\xC0g?\xCA\rd\xC5\x8A\xA2" (https://eval.in/989970)
[03:51:59] havenwood: cagmz: Yeah, you can get away with SHA256. I'd probably hexdigest.
[03:52:43] havenwood: >> key = {user_id: 1, item_id: 2}; require 'digest/sha2'; Digest::SHA256.hexdigest key.inspect
[03:52:44] ruby[bot]: havenwood: # => "aa5f679065a6d2e8be8d76403c54cebebb16f1e57b2b35c0673fca0d64c58aa2" (https://eval.in/989971)
[03:53:15] cagmz: why is Hexdigest better?
[03:55:20] havenwood: cagmz: You're less likely to run into encoding issues between systems, print more uniformly, look at when debugging, but either should be fine. ¯\_(ツ)_/¯
[03:56:20] cagmz: ah ok. just saw this: "Returns the hex-encoded hash value of a given string. This is almost equivalent to Digest.hexencode(Digest::Class.new(*parameters).digest(string))."
[03:56:45] dcunit3d: has joined #ruby
[04:00:11] havenwood: cagmz: If you don't mind weird bytes, maybe just Marshal it.
[04:00:38] cagmz: what do you mean?
[04:00:44] havenwood: >> key = {user_id: 1, item_id: 2}; Marshal.dump key
[04:00:45] ruby[bot]: havenwood: # => "\x04\b{\a:\fuser_idi\x06:\fitem_idi\a" (https://eval.in/989972)
[04:01:19] havenwood: >> Marshal.load "\x04\b{\a:\fuser_idi\x06:\fitem_idi\a"
[04:01:19] ruby[bot]: havenwood: # => {:user_id=>1, :item_id=>2} (https://eval.in/989973)
[04:01:42] cagmz: I don't mind, but since the {} will be a cache key, I think Hexdigest is more semantic
[04:01:54] havenwood: yeah, hexdigest is prettier
[04:02:18] havenwood: and uniformly sized
[04:02:29] cagmz: Marshal.dump is neat, though
[04:02:49] havenwood: yeah, it's a nice inter-Ruby way to serialize and deserialize
[04:03:13] havenwood: it supports all sorts of objects out of the box, and you can easily implement your own for classes or singleton classes
[04:04:03] govg: has joined #ruby
[04:04:14] havenwood: The Singleton docs have a decent example: https://ruby-doc.org/stdlib/libdoc/singleton/rdoc/Singleton.html#module-Singleton-label-Singleton+and+Marshal
[04:04:52] cagmz: this is giving me ideas haha. what do you think about using Marshal.dump work with an in-memory store?
[04:05:25] cagmz: *meant to ask what you thought about using Marshal.dump with an in-memory store, and if it would work in the first place
[04:05:52] havenwood: cagmz: I've thought the same!
[04:05:55] havenwood: cagmz: https://github.com/havenwood/bindi#bindi
[04:06:26] havenwood: cagmz: The stdlib has PStore, which stores Marshalled Ruby to disk transactionally.
[04:06:52] havenwood: cagmz: I have a little wrapper around PStore that gives a nicer interface: https://github.com/havenwood/persist#readme
[04:07:02] havenwood: I should "refresh" these gems. They're old.
[04:07:32] cagmz: what's the diff between storing on disk vs memory? besides the obvious
[04:07:33] havenwood: cagmz: But PStore is worth a look. And Marshal can be handy, and is used by stuff like DRb.
[04:07:49] cagmz: I mean, what are the trade offs?
[04:07:53] havenwood: So for example, Ruby stdlib has YAML::Store and YAML::DBM.
[04:08:03] havenwood: YAML::Store is like PStore for YAML.
[04:08:17] havenwood: YAML::DBM uses Berkley DB with YAML values.
[04:08:44] havenwood: They both store YAML to disk. They're both transactional. The latter is a DB.
[04:09:13] havenwood: cagmz: When you load the YAML::Store, you load the whole thing into memory. You can retrieve the value for just one key from the DB.
[04:09:33] govg: has joined #ruby
[04:09:49] havenwood: https://ruby-doc.org/stdlib/libdoc/yaml/rdoc/YAML/Store.html
[04:09:50] havenwood: https://ruby-doc.org/stdlib/libdoc/yaml/rdoc/YAML/DBM.html
[04:10:15] havenwood: cagmz: They're ^ both quite usable. I'd recommend giving each a quick try.
[04:10:21] Ryzokuken: has joined #ruby
[04:10:30] cagmz: hmm so with the YAML::Store, a process' memory usage may grow until...?
[04:11:08] cagmz: or will it just load the entire thing into memory and reach the memory cap right away? when/how can this memory be released?
[04:11:42] havenwood: cagmz: Just like anything else, it takes the memory until it's dereferenced and GCed or the process is killed.
[04:12:18] cagmz: so say it falls out of scope and no methods are using it, is that when it's dereferenced?
[04:12:22] havenwood: cagmz: JSON versus JSONB is a similar thing, where to get one key from JSON you must deserialize the whole JSON string into memory.
[04:12:36] cagmz: wow, til!
[04:12:44] havenwood: With JSONB you can query the binary and retrieve just the value for one key.
[04:12:55] cagmz: ^_^ amazing
[04:13:24] havenwood: cagmz: It's the same thing for JSON versus Protocol Buffers. It really makes a huge difference when the data gets larger.
[04:14:20] havenwood: cagmz: For in-memory stuff, you can just not serialize it at all - unless you need to send it over the wire.
[04:15:01] havenwood: In which case, just YAML or Marshal is fine. Both of those allow unsafe things to be deserialized, so make sure to never allow user input into those.
[04:15:38] xuanrui: has joined #ruby
[04:15:58] ur5us: is there a way to define your own `MyClass(…)` method (operator?) like with `BigDecimal(…)`?
[04:16:11] havenwood: JSON is a "safe" subset of YAML. You can actually load pretty crazy things with JSON.load in Ruby, but JSON.parse is sane.
[04:16:45] cagmz: got it, thanks again! goodnight
[04:16:54] havenwood: cagmz: you're welcome, g'night!
[04:17:40] ur5us: havenwood: I tried `def self.call(…); …; end` but that’s not the same. So what’s the correct way?
[04:17:42] havenwood: >> module Kernel; def Ur5us(s); s.chars.shuffle.join end end; Ur5us('ur5us')
[04:17:43] ruby[bot]: havenwood: # => "rsuu5" (https://eval.in/989978)
[04:18:05] yxhuvud: has joined #ruby
[04:18:11] havenwood: ur5us: It's actually just a method that starts with a capital letter on Kernel.
[04:18:25] havenwood: >> method(:Integer).owner
[04:18:26] ruby[bot]: havenwood: # => Kernel (https://eval.in/989979)
[04:18:44] havenwood: >> defined? Integer()
[04:18:45] ruby[bot]: havenwood: # => "method" (https://eval.in/989980)
[04:18:47] ur5us: havenwood: ah, thanks. That makes sense
[04:21:31] Tharbakim: has joined #ruby
[04:21:52] Tharbakim: has joined #ruby
[04:31:23] jordanm: has joined #ruby
[04:42:08] cliluw: has joined #ruby
[04:44:12] armyriad: has joined #ruby
[04:46:06] ericmathison: Is there any special reason that the rails guides demonstrate using the rails command with `bin/rails` when just using `rails` is actually executing the `bin/rails` binstub anyway?
[04:50:09] havenwood: ericmathison: If you had a newer version of rails installed it'd be the wrong bin/rails that it then called.
[04:50:55] havenwood: ericmathison: Say if you had a project using 5.0, but had Rails 5.1 also installed.
[04:51:11] ericmathison: Oh, yikes. Even though it's using bundler?
[04:51:49] havenwood: ericmathison: If you `bundle exec rails` you'll get the version from your Gemfile.lock.
[04:52:26] havenwood: ericmathison: You can specify the version directly as well, say if you're starting a new rails project: rails _5.1.0_ new ...
[04:52:40] ericmathison: Hmm. I thought using the rails command actually was eqivalent to running `bundle exec rails`
[04:53:08] havenwood: ericmathison: If you're using RVM and haven't uninstalled rubygems-bundler, then it is.
[04:53:17] havenwood: ericmathison: By default, it isn't.
[04:53:33] erlend: has joined #ruby
[04:54:01] ericmathison: ok. good to know. thanks. miss seeing you around the meetup by the way. take care!
[04:54:11] havenwood: ericmathison: o/
[05:09:26] reber: has joined #ruby
[05:11:53] char_var[buffer]: has joined #ruby
[05:15:51] jamesaxl: has joined #ruby
[05:16:22] sauvin: has joined #ruby
[05:19:44] n008f4g_: has joined #ruby
[05:22:24] iMadper: has joined #ruby
[05:23:33] claudiuinberlin: has joined #ruby
[05:24:54] ericmathison: havenwood: I checked out an old version of my app that uses rails 5.1.5, ran rails -v and it says 5.1.5 even though I have rails 5.2.0 installed. For example https://gist.github.com/ericmathison/eaf781bcf467f929c7503a2901373577
[05:25:01] ericmathison: not using rvm either
[05:31:42] hkais: has joined #ruby
[05:37:33] anisha: has joined #ruby
[05:37:55] venmx: has joined #ruby
[05:40:24] icarus: has joined #ruby
[05:42:33] arescorpio: has joined #ruby
[05:44:32] workmad3: has joined #ruby
[05:45:44] alfiemax: has joined #ruby
[05:46:41] eckhardt: has joined #ruby
[05:47:10] alfiemax: has joined #ruby
[05:47:33] jud: has joined #ruby
[05:47:33] jud: has joined #ruby
[05:53:17] jud: has joined #ruby
[05:53:18] jud: has joined #ruby
[06:00:38] icarus: has joined #ruby
[06:03:13] suukim: has joined #ruby
[06:07:00] tdy: has joined #ruby
[06:08:32] alex``: has joined #ruby
[06:10:58] mtkd: has joined #ruby
[06:11:06] sidx64: has joined #ruby
[06:12:00] aufi: has joined #ruby
[06:33:40] karapetyan: has joined #ruby
[06:38:43] schneider: has joined #ruby
[06:38:59] sidx64_: has joined #ruby
[06:42:17] ltt: has joined #ruby
[06:42:35] sidx64: has joined #ruby
[06:45:38] weaksauce: ericmathison what are you using for versioning? nothing?
[06:45:55] weaksauce: in any event you should be using bundler and a gem file
[06:47:25] amar: has joined #ruby
[06:53:30] ozaki_: has joined #ruby
[06:55:25] phaul: has joined #ruby
[06:59:24] schneider: has joined #ruby
[07:00:01] dionysus69: has joined #ruby
[07:01:01] _phaul: has joined #ruby
[07:01:42] erlend: has joined #ruby
[07:04:25] ltt: has joined #ruby
[07:07:03] dionysus69: has joined #ruby
[07:08:44] clemens3_: has joined #ruby
[07:15:24] andikr: has joined #ruby
[07:15:32] inerthia: has joined #ruby
[07:16:24] TomyWork: has joined #ruby
[07:21:49] tvw: has joined #ruby
[07:23:09] chouhoulis: has joined #ruby
[07:23:41] claudiuinberlin: has joined #ruby
[07:28:12] burgestrand: has joined #ruby
[07:33:43] schneider: has joined #ruby
[07:34:07] Matthew1: has joined #ruby
[07:49:20] reber: has joined #ruby
[07:50:21] chouhoulis: has joined #ruby
[07:50:59] chouhoul_: has joined #ruby
[07:51:01] shiroeni: has joined #ruby
[07:52:15] ltt: has joined #ruby
[07:57:32] cabotto: has joined #ruby
[08:00:03] sidx64: has joined #ruby
[08:00:24] schneider: has joined #ruby
[08:00:29] yokel: has joined #ruby
[08:02:27] mikecmpbll: has joined #ruby
[08:04:57] chouhoulis: has joined #ruby
[08:05:21] marr: has joined #ruby
[08:08:33] fyrril2: has joined #ruby
[08:08:54] sidx64: has joined #ruby
[08:16:36] alfiemax: has joined #ruby
[08:20:27] RougeR: has joined #ruby
[08:20:27] RougeR: has joined #ruby
[08:21:52] alfiemax: has joined #ruby
[08:22:50] cabotto: has joined #ruby
[08:23:45] Puffball: has joined #ruby
[08:24:23] guille-moe: has joined #ruby
[08:27:27] vondruch: has joined #ruby
[08:29:45] iMadper: has joined #ruby
[08:31:12] ltt: has joined #ruby
[08:37:13] jnollette: has joined #ruby
[08:38:48] karapetyan: has joined #ruby
[08:40:03] yohji: has joined #ruby
[08:41:33] headius: has joined #ruby
[08:44:23] izaac: has joined #ruby
[08:46:44] ltt: has joined #ruby
[08:47:32] mtkd: has joined #ruby
[08:51:12] amar: has joined #ruby
[08:52:28] gigetoo: has joined #ruby
[08:53:07] amar_: has joined #ruby
[08:54:04] Beams: has joined #ruby
[08:56:23] amar: has joined #ruby
[08:57:07] Kedare: has joined #ruby
[08:57:15] tomphp: has joined #ruby
[09:00:43] reber: has joined #ruby
[09:01:01] clemens3_: has joined #ruby
[09:01:49] amar_: has joined #ruby
[09:02:34] ciscam: has joined #ruby
[09:05:23] minimalism: has joined #ruby
[09:09:56] tomphp: has joined #ruby
[09:10:31] erlend: has joined #ruby
[09:14:32] ltt: has joined #ruby
[09:15:22] ur5us: has joined #ruby
[09:15:34] yokel: has joined #ruby
[09:19:27] roshanavand: has joined #ruby
[09:19:46] workmad3: has joined #ruby
[09:20:30] roshanavand: has joined #ruby
[09:29:52] sidx64: has joined #ruby
[09:30:54] iNs: has joined #ruby
[09:31:26] schneider: has joined #ruby
[09:32:30] amar: has joined #ruby
[09:33:45] mikecmpb_: has joined #ruby
[09:34:18] zautomata2: has joined #ruby
[09:34:40] amar_: has joined #ruby
[09:35:05] amar_: has joined #ruby
[09:35:25] sidx64: has joined #ruby
[09:37:09] ltt: has joined #ruby
[09:38:19] hkais: has joined #ruby
[09:38:35] zautomata3: has joined #ruby
[09:40:29] tomphp: has joined #ruby
[09:44:06] reusedSalt: has joined #ruby
[09:47:00] Mike11: has joined #ruby
[09:50:29] zautomata: has joined #ruby
[09:52:29] hammer: has joined #ruby
[09:54:15] eckhardt: has joined #ruby
[09:56:16] cabotto: has joined #ruby
[09:59:36] schneider: has joined #ruby
[09:59:56] zautomata1: has joined #ruby
[10:06:43] schneider: has joined #ruby
[10:10:01] zautomata: has joined #ruby
[10:11:36] ltt: has joined #ruby
[10:12:42] leitz: has joined #ruby
[10:13:59] leitz: Understanding that Ruby and C are different, would (re-)learning C help with my Ruby? I know Ruby is written in C (C99?). Trying to plan my learning time well.
[10:14:54] phaul: very little or not at all
[10:15:42] phaul: you would be able to look up stuff in MRI implementation, or write C extensions. that's about it
[10:17:00] phaul: none of those things are striclty speaking ruby knowledge
[10:17:00] iMadper: has joined #ruby
[10:17:19] Radar: >> (1..20).each { |x| puts x if (x == 5) .. (x == 10) }
[10:17:20] ruby[bot]: Radar: # => 5 ...check link for more (https://eval.in/990275)
[10:17:25] Radar: TIL "flip-flop operator"
[10:17:49] leitz: That seems useful. phaul, just an aside, I'm not too hot in OOP, still mentally prodcedural.
[10:20:53] leitz: Like dealing with the 31 errors in today's comile. :)
[10:21:34] phaul: well, you said, you wanted to use your learning time well. I assume you would like to deepen your Ruby knowledge. Learning C for that seems weird. I would spend my time reading and understanding gem sources instead. But then again..
[10:21:54] kapil___: has joined #ruby
[10:23:09] leitz: Ah, sorry, there's a piece missing. My work does not use Ruby at all. It can use me being better at C. I can get signoff to spend some work time on C, but not Ruby.
[10:23:32] leitz: Of course, whenever I get frustrated with Ruby I look at C and Go anyway. ;)
[10:25:59] phaul: Radar: it's horrendous isn't it? Hopefully they remove it from 3.0
[10:26:06] Radar: phaul: absolutely
[10:26:42] amar: has joined #ruby
[10:27:33] icarus: has joined #ruby
[10:27:34] amar: has joined #ruby
[10:30:59] mr-robert: leitz: learning C is worthwhile.
[10:31:06] cabotto: has joined #ruby
[10:31:08] Psybur: has joined #ruby
[10:31:27] leitz: mr-robert, please expand.
[10:32:07] mr-robert: learning C will make you a better programmer generally speaking.
[10:32:22] leitz: ACTION is going to sit with his manager today and lay out the plan the manager should follow. :)
[10:32:24] cabotto: has joined #ruby
[10:32:52] mr-robert: C is harder to learn than Ruby, though
[10:32:56] mr-robert: Ruby is easy to learn
[10:33:26] leitz: mr-robert, that's part of my thinking. Like phaul says, it's not Ruby. I've done C before but have forgotten most of it.
[10:33:49] leitz: Ruby is the first language that inspires me to come home and code more. Others I need to work myself up to.
[10:34:53] mr-robert: well, i'm not sure if learning C will make you a better Ruby programmer. it might make you appreciate Ruby even more, though.
[10:38:09] phaul: Well, it sounds like you have done C before. From that I guess you have a good undesrtanding of memory allocations, execution stacks, registers. Basically how a computer works. The rest is easy. C syntax and the language is pretty simple
[10:38:22] leitz: I can get stuff done in Ruby. What I can do in C is learn C.
[10:38:42] leitz: phaul, use a very loose defintion of "good understanding". :)
[10:38:54] alex``: has joined #ruby
[10:38:59] leitz: I'm a linux guy by trade.
[10:39:00] tomphp: has joined #ruby
[10:40:18] amar: has joined #ruby
[10:42:11] phaul: yeah, I would want to learn about those things. The C language itself would be less of a priority. Maybe try doing some elementary programs like prime test in assembly :)
[10:43:53] guille-moe: has joined #ruby
[10:43:54] leitz: phaul; plggbbttt.....
[10:44:49] leitz: Most of the good "How commputers work" books use C as the reference.
[10:45:00] tomphp: has joined #ruby
[10:45:05] leitz: Well, most of the ones I've seen.
[10:46:32] mr-robert: C is the foundation of so many things in computers.
[10:46:53] konsolebox: knowing C = system control
[10:48:18] mr-robert: without C, there wouldn't be a Ruby :)
[10:48:34] phaul: nah, C is just a language. And not a particularly good one. But most things around the unix world are written in it
[10:48:59] mr-robert: not just the unix world.
[10:49:02] mr-robert: Windows too
[10:49:03] cadillac_: has joined #ruby
[10:49:04] mikecmpbll: has joined #ruby
[10:49:29] konsolebox: phaul: C is really good if written properly. it hides nothing
[10:49:39] konsolebox: or almost nothing
[10:49:44] konsolebox: vs. C++, etc.
[10:51:22] phaul: well, there are shortcomings in C due to how old it is. I think everybody agrees that preprocessing is baaaadd
[10:52:11] konsolebox: phaul: hmm, why though? if it's about optimization, there's LTO
[10:52:15] mr-robert: and yet no one has written a decent replacement. people have tried, with Go, and Rust, but C still reigns supreme.
[10:52:33] leitz: I like preprocessing. At least as I understand it. Filtering, and all that.
[10:52:54] leitz: Go is pretty nice, but still not C fast or as portable.
[10:53:20] kurko_: has joined #ruby
[10:53:41] tomphp: has joined #ruby
[10:54:38] dipnlik: has joined #ruby
[10:54:39] phaul: just to clarify Im not arguing that you should't learn C to learn about computers. Im just saying it's pretty far from that holy grail that mr-robert, konsolebox painted here.
[10:55:03] konsolebox: i never described akin to a holy grail
[10:55:18] Azure: has joined #ruby
[10:55:22] mr-robert: i disagree. C is the holy grail. it's the foundation that other programs and languages are built upon, right up until this day.
[10:55:22] tomphp: has joined #ruby
[10:56:17] konsolebox: but it's good the way it is good, not "not a particularly good one"
[10:56:54] tomphp: has joined #ruby
[10:57:28] mr-robert: it's unforgiving
[10:59:12] iMadper`: has joined #ruby
[10:59:31] tomphp: has joined #ruby
[11:00:38] mr-robert: and it's not for everything. i wouldn't build web applications with it. i'd use Ruby, but without C there wouldn't be a Ruby.
[11:07:58] apparition: has joined #ruby
[11:12:13] leitz: C does seem to have it's place, as does Ruby.
[11:12:58] phaul: there are two disticnt things here. The quality of the ecosystem and the compiler, ie rich library coverage, fast protable code etc. These properties have nothing to do with the language design. The language design are things like type system, syntax etc. I said the age shows on those things in C.
[11:13:58] mikecmpbll: has joined #ruby
[11:14:10] phaul: I already said the preprocessor. the enum type is also not the greatest
[11:14:37] phaul: representing chars is weird
[11:15:00] leitz: phaul, you're right, C is older and there are lots of useful things in newer languages. Yet as mr-robert said, nothing has come up to replace it in many areas.
[11:15:42] dminuoso: Learning C will not make you a better programming.
[11:16:21] dminuoso: I'd argue that these days there's little value in picking C for a fresh project.
[11:16:34] dminuoso: leitz: Name one area where C excels at.
[11:16:41] leitz: Operating systems
[11:16:44] leitz: Performance
[11:16:47] leitz: Portability
[11:16:52] leitz: Simplicity
[11:16:58] leitz: Widespread usage
[11:17:01] dminuoso: leitz: OS -> Rust or C++ are just as great.
[11:17:07] dminuoso: leitz: Performance -> Rust or C++ are better.
[11:17:20] mr-robert: that's just not true
[11:19:13] erlend: has joined #ruby
[11:19:48] mr-robert: no one has written an OS in Rust that isn't a toy or PoC. theo de raadt made this point in a video, too, where he argues that no new language has come close to replacing C for OS development, and all the userland tools are still written in C.
[11:22:41] leitz: Wikipedia says OSX is writting in C++, which might explain some of the issues...
[11:23:15] leitz: Pretty sure Linux, NetBSD, OpenBSD, and Ruby are in C. Where they aren't assembler.
[11:23:28] AJA4350: has joined #ruby
[11:27:25] konsolebox: my favorite editor is written in C
[11:27:52] tobiasvl: writing an OS in rust? :o
[11:27:52] mr-robert: Geany is a good editor :)
[11:28:21] konsolebox: tbh i find it much easier to hack a software written in C than one written in C++
[11:31:53] cabotto: has joined #ruby
[11:37:47] ldnunes: has joined #ruby
[11:39:08] alfiemax: has joined #ruby
[11:39:51] Cavallari: has joined #ruby
[11:40:59] noobineer: has joined #ruby
[11:43:52] apeiros: has joined #ruby
[11:44:12] nadir: has joined #ruby
[11:51:51] shaman42: has joined #ruby
[11:58:35] dminuoso: mr-robert: So your argument is because nobody has written a commercial OS in Rust, it's not feasible?
[11:59:06] apeiros: I seem to have missed some pop-corn worthy discussion?
[11:59:10] mr-robert: doesn't have to be commercial.
[11:59:33] dminuoso: mr-robert: C itself simply has nothing over C++ or Rust that makes it more suited. Quite the opposite, you have just enough abstraction to not have a proper high level assembler, but the complete lack of a useful type system or mechanisms for abstraction.
[11:59:42] dminuoso: Which makes C about one of the most horrid languages.
[11:59:55] dminuoso: The only thing C has going for itself, is the fact that you already have C compilers for all kinds of weird and exotic architectures.
[11:59:55] Azure: has joined #ruby
[11:59:58] dminuoso: So it's just availability of implementatinos.
[12:00:46] leitz: And still everything else I mentioned.
[12:01:04] dminuoso: leitz: C does not excel at operating systems for any good reason.
[12:01:14] dminuoso: What features of C makes C better for operating systems than say C++?
[12:01:15] leitz: apeiros, I asked about the value of relearning C. Mostly to support my Ruby.
[12:01:34] leitz: dminuoso, everything I listed above. C++ loses them all.
[12:01:44] dminuoso: leitz: No I mean specific for operating systems.
[12:02:26] dminuoso: leitz: And the "simplicity" argument is a bit silly. It's the usual go-lang style of anti intellectualism that a language should not have any abstractions that a kid with 2 weeks of training couldn't understand.
[12:02:33] dminuoso: It inhibts writing clean code.
[12:02:54] leitz: dminuoso, it's BDD: If C++ was better for the OS, people would use it for the OS. Mac OSX is slow and bloated. May or may not be the language.
[12:03:33] dminuoso: leitz: That argument is deeply flawed. By the same logic JavaScript is the best langauge for client-side web development, otherwise people would use a different language.
[12:03:43] dminuoso: See how that doesnt make sense?
[12:05:48] jerematic: has joined #ruby
[12:06:50] leitz: See how Javascript is about the most used client side web dev language? Why is that?
[12:06:51] mr-robert: I don't argue against C++ being suitable for OS development. C++ has been used by NASA to control robots it sends to space. But I don't think Rust has proven itself beyond toy concepts people put on github. C is still king in the land of OS development.
[12:07:00] dminuoso: leitz: Certainly not because it's good.
[12:07:07] cabotto: has joined #ruby
[12:07:42] leitz: dminuoso, I view "getting things done" as "good". Won't say any of it is perfect, or even technically the best. But it gets stuff done.
[12:07:52] dminuoso: leitz: So does untyped lambda calculus.
[12:07:55] dminuoso: Whats your point
[12:08:07] apeiros: mr-robert: uh, rust makes a big part of firefox. I wouldn't call that a "toy concept"
[12:08:22] mr-robert: apeiros: i wouldn't call it an operating system either.
[12:08:26] leitz: That I should spend more time in my code and less in chat.
[12:08:32] apeiros: no, but that's not what you said.
[12:08:35] dminuoso: mr-robert: browsers are amongst the most complex pieces of software you will find in userland.
[12:08:48] apeiros: you claimed it didn't go beyond toy-concept. and that's definitively wrong.
[12:08:49] mr-robert: apeiros: we're talking about operating systems. seems you missed the conversation.
[12:09:05] dminuoso: mr-robert: And I dont know why you call PoC "toys"
[12:09:18] mr-robert: apeiros: in the context of operating systems. you've missed the conversation and interjecting wrongly.
[12:09:34] apeiros: classy reaction
[12:09:56] leitz: Didn't brfower's start off as a class project?
[12:10:04] jerematic: has joined #ruby
[12:10:07] leitz: browseres....new keyboard. Clumsy fingers.
[12:10:12] leitz: bleagh....
[12:10:36] mr-robert: apeiros: well. you lack context, then you interject with some stuff about firefox when it is not the basis of the conversation at all.
[12:10:42] dminuoso: leitz: I've written kernels in C++, I have just as much control over code generation as C. The difference is I have a fine type system in which I can enforce certain semantics. I have a large bunch of tools to write abstractions with.
[12:10:50] dminuoso: Contrary to popular belief kernel code actually uses abstractions.
[12:10:53] tbuehlmann: I learned the other day that I'm using Fisher-price infrastructure ¯\_(ツ)_/¯
[12:11:18] mr-robert: apeiros: we're talking about C, and how it is the foundation of many things in computers today.
[12:11:34] mr-robert: dminuoso: i never mentioned firefox.
[12:11:49] mr-robert: i'm talking about operating systems. Rust hasn't proven itself in that regard.
[12:11:58] dminuoso: mr-robert: What the heck does that mean?
[12:12:05] dminuoso: mr-robert: Rust only needs to prove in code generation.
[12:12:11] dminuoso: Either Rust generates correct code, or it doesn't.
[12:12:20] dminuoso: If it generates correct code, then it doesnt matter whether your software is a kernel or a browser.
[12:12:29] mr-robert: it means there isn't one serious OS written in Rust.
[12:12:56] dminuoso: mr-robert: There is redox.
[12:13:28] synthroid: has joined #ruby
[12:13:53] dminuoso: mr-robert: You do know that kernel code is just machine code right? Just like userland apps.
[12:14:07] dminuoso: a kernel is just a piece of software.
[12:14:21] mr-robert: that's not my point.
[12:14:38] mr-robert: but redox looks impressive
[12:14:45] RougeR: has joined #ruby
[12:14:53] apeiros: "it's the foundation that other programs and languages are built upon" is a false assertion. just because the OS is built in C doesn't mean that applications running on it are built upon C. they're built upon the product of that C code.
[12:15:03] apeiros: the language at that point is irrelevant
[12:15:24] dminuoso: the foundation that other programs are built upon is machine code. So the only question is: "How do we obtain machine code?"
[12:16:33] dminuoso: A rust compiler can give you machine code. A C compiler can give you machine code. A C++ compiler can give you machine code. So the only question is: which one do you pick? Useful things are: "How much control over memory allocations do you get? 100% for all 3 languages". "How good is code generation in state-of-the-art compilers? Good for C, better for C++ - no experience for Rust"
[12:16:34] clemens3_: has joined #ruby
[12:16:55] dminuoso: And "how useful is this language to write abstractions so I dont have to generate tons of boiler plate code/focus on the problem Im solving"
[12:17:02] dminuoso: And it turns out C is absolutely awful on the last.
[12:17:18] dminuoso: The only abstraction mechanism C has, is pointers.
[12:17:19] mr-robert: apeiros: should just be "other languages", not "other programs"
[12:17:55] apeiros: do you mean by that, that those other languages are implemented in C? like cruby being the main interpreter for ruby code is itself written in C?
[12:18:41] alex``: has joined #ruby
[12:18:51] apeiros: I'd go the same route as dminuoso there. it's a question of ubiquity, not quality
[12:20:11] mr-robert: Rust is one of the many attempts to replace C. i don't think it has proven itself yet.
[12:20:24] mr-robert: i don't think any language has.
[12:20:37] apeiros: yeah, and your goal-post seems to be "proven = an OS implemented in it"
[12:20:59] mr-robert: not just that. C is the bedrock of so many things.
[12:21:01] apeiros: and I disagree. a complex project like a webbrowser is sufficient to prove being beyond a toy.
[12:21:13] mr-robert: i'm not calling Rust a toy
[12:21:49] dminuoso: mr-robert: C is just so ubiquitous because 30 years ago there were not many other good options.
[12:21:56] mr-robert: Rust is a good language, but will it be capable of replacing C? that is yet to be proven
[12:22:15] dminuoso: mr-robert: C is rarely picked to kick off large and complex projects simply because you have 0 abstractions.
[12:22:17] apeiros: again, I think it has proven to be capable of just that.
[12:22:23] apeiros: that doesn't mean C will go away
[12:22:25] dminuoso: mr-robert: Without abstractions your code becomes hard to maintain, hard to reason about.
[12:22:33] apeiros: the same as not even COBOL has yet gone away.
[12:22:38] dminuoso: 14:21 mr-robert | Rust is a good language, but will it be capable of replacing C? that is yet to be proven
[12:22:48] dminuoso: mr-robert: Again. You just need to prove that the implementations are correct.
[12:23:07] dminuoso: mr-robert: The machine code produced for Firefox is equal to your kernel.
[12:23:18] mr-robert: no, it depends on adoption of the language by the masses.
[12:23:27] dminuoso: mr-robert: Let me ask you differently.
[12:23:32] dminuoso: mr-robert: How many segfaults did you have in C projects?
[12:23:37] dminuoso: How many segfaults did you have in Rust projects?
[12:23:59] dminuoso: mr-robert: Turns out that when writing a kernel, a segfault will usually kernel panic or have some pretty bad guarantees. Frequently in the wrong places.
[12:24:13] apeiros: mr-robert: "adoption of the masses" has little to do with "capable of replacing C", that is "has actually replaced C"
[12:24:14] dminuoso: So a language that has absolutely no guarantees whatsoever is kind of silly to use for a KERNEL.
[12:24:27] dminuoso: mr-robert: and by "segfault" I mean an incorrect memory access.
[12:24:34] dminuoso: C simply has no compile time mechanisms to guarantee this wont happen.
[12:24:39] apeiros: and I think nobody argues that rust has replaced C.
[12:24:52] dminuoso: Rust is just the better option. :P
[12:25:33] mr-robert: i can agree there, but since so much is already written in C it's not always feasible to use Rust
[12:25:39] dminuoso: mr-robert: Why?
[12:25:49] dminuoso: mr-robert: Rust has FFI.
[12:25:56] dminuoso: So you can use external C libraries just fine.
[12:26:24] apeiros: C is IMO as little the holy grail for low level code as JS is for client-side code or PHP for webserver-side code. they are languages which happened to be good enough combined with circumstances to become ubiquitous.
[12:26:29] mr-robert: that's my point. you still rely on C and will for a long time.
[12:26:43] drbrain: has joined #ruby
[12:26:43] drbrain: has joined #ruby
[12:26:49] dminuoso: mr-robert: My point is you can simply start writing a Rust project without any real downsides.
[12:27:02] apeiros: that point I won't argue. that's quite likely the case, given how slow things move.
[12:27:31] dminuoso: mr-robert: But just because C will still be around in 30 years, doesn't make it the better technology to pick for a new project.
[12:27:45] bmurt: has joined #ruby
[12:27:58] mr-robert: but it is still very valuable to know C.
[12:28:11] tomphp: has joined #ruby
[12:29:10] guille-moe: has joined #ruby
[12:29:38] mr-robert: nice chatting, back in a while
[12:33:28] byte512: has joined #ruby
[12:33:51] Megamosaren: has joined #ruby
[12:40:54] dr3wo: has joined #ruby
[12:48:13] tomphp: has joined #ruby
[12:48:31] konsolebox: seems like the general idea here is that C++ and Rust are better or are capable of replacing C simply because they are capable of abstraction or perhaps have better features is rather trivial. the added features in Rust and C++ in some ways can not necessarily be seen as strengths but also as weaknesses. one obvious thing is that it adds dependencies, and also adds complexity. C on the other hand excels in simplicity syntax-wise, and in many ways
[12:48:31] konsolebox: direct to the point. the point that Rust and C++ haven't replaced C yet stands.
[12:49:36] chouhoulis: has joined #ruby
[12:50:11] jeffreylevesque: has joined #ruby
[12:52:00] byte512: has joined #ruby
[12:54:04] sidx64: has joined #ruby
[12:54:36] drbrain: has joined #ruby
[12:54:36] drbrain: has joined #ruby
[12:55:35] eblip: has joined #ruby
[12:55:44] def_jam: has joined #ruby
[12:59:36] beefjoe: has joined #ruby
[12:59:57] beefjoe: can I output the result of irb commands to a file ?
[13:00:17] apeiros: beefjoe: yes
[13:00:35] beefjoe: I'm trying to copy the output
[13:00:39] apeiros: depends on what exactly you want. most primitive way: copy & paste.
[13:01:03] chouhoulis: has joined #ruby
[13:01:15] apeiros: hm, built-in history is commands only. but you could replace $stdout with an IO splitting class.
[13:01:57] beefjoe: what did you mean by copy and paste
[13:02:01] beefjoe: like manually ?
[13:02:55] apeiros: yes. as said, depends on what you want.
[13:03:06] apeiros: on *nix platforms there's also the "script" tool
[13:04:10] apeiros: e.g. `script your/logfile.log irb`
[13:06:56] duderonomy: has joined #ruby
[13:07:40] hammer: has joined #ruby
[13:11:19] drbrain: has joined #ruby
[13:11:19] drbrain: has joined #ruby
[13:15:39] k0mpa: has joined #ruby
[13:17:10] alfiemax: has joined #ruby
[13:26:39] pork13_: has joined #ruby
[13:27:57] erlend: has joined #ruby
[13:33:38] Dimik: has joined #ruby
[13:35:21] n0m4d1c: has joined #ruby
[13:35:42] Antiarc: has joined #ruby
[13:37:20] shinnya: has joined #ruby
[13:42:49] Megamosaren: has joined #ruby
[13:51:04] konsolebox: has joined #ruby
[13:51:35] sidx64: has joined #ruby
[13:55:43] karapetyan: has joined #ruby
[13:56:48] marahin: Hello! I have a `.with_retries` method that accepts two arguments: retry_amount and &block. Is it possible to refactor it, so I can call `yield` instead of `block.call`?
[13:58:00] apeiros: marahin: no need to refactor, you can already do that.
[13:58:19] marahin: OK, so just plain `yield`? :) Does it matter if `&block` stays as defined argument, or not?
[13:58:20] apeiros: marahin: but if you don't use block.call, you should remove the &block from the method definition.
[13:58:27] marahin: I assume it would stay, if I want to pass it later on to another method?
[13:58:30] apeiros: it doesn't matter. but it's better to remove it.
[13:58:42] marahin: actually, let me gist the code, it will be easier
[13:58:46] marahin: sorry for not doing that in the first place
[13:58:47] apeiros: ruby has to actually do work to convert a block to a Proc instance, and &block forces that work.
[13:59:04] marahin: https://gist.github.com/Marahin/be9eac2364cbf0262e7c31c16de47463
[13:59:29] marahin: https://gist.github.com/Marahin/be9eac2364cbf0262e7c31c16de47463#file-with_retries-rb-L6 - so here, would it be OK to use 'yield' to pass the received block, or should it be &block then?
[13:59:39] marahin: (if the first, then I assume i can remove &block from arguments list)
[14:00:06] apeiros: yield can't be used to pass on the block
[14:00:41] apeiros: you can do `with_retries(retry_amount - 1, &Proc.new)`, since Proc.new without a block will reuse the block passed to the current method.
[14:00:49] apeiros: but honestly, IMO that's ugly. just stick with &block
[14:00:55] duderonomy: has joined #ruby
[14:01:13] marahin: thank you!
[14:01:35] pastorinni: has joined #ruby
[14:02:04] amar: has joined #ruby
[14:04:05] Ryzokuken: has joined #ruby
[14:04:11] Axsuul: has joined #ruby
[14:07:39] yohji: has joined #ruby
[14:09:13] mn3m: has joined #ruby
[14:09:53] grilix: has joined #ruby
[14:10:23] Rapture: has joined #ruby
[14:13:05] konsolebox: has joined #ruby
[14:14:20] oleo: has joined #ruby
[14:14:41] konsolebox: has joined #ruby
[14:16:16] konsolebox: has joined #ruby
[14:17:24] mikecmpbll: has joined #ruby
[14:17:59] konsolebox: has joined #ruby
[14:18:07] banisterfiend: has joined #ruby
[14:18:56] mroutis: has joined #ruby
[14:20:57] konsolebox: has joined #ruby
[14:21:45] zautomata1: has joined #ruby
[14:25:10] apeiros__: has joined #ruby
[14:26:01] zautomata2: has joined #ruby
[14:27:59] n0m4d1c: has joined #ruby
[14:35:54] chouhoulis: has joined #ruby
[14:36:34] chouhoulis: has joined #ruby
[14:36:46] nowhereman_: has joined #ruby
[14:37:12] physicist__: has joined #ruby
[14:38:06] Zaab1t: has joined #ruby
[14:49:16] cadillac_: has joined #ruby
[14:51:58] cyberg: has joined #ruby
[14:55:03] workmad3: has joined #ruby
[14:55:26] leitz: has joined #ruby
[14:58:52] apeiros: has joined #ruby
[15:00:07] mikecmpbll: has joined #ruby
[15:00:43] tomphp: has joined #ruby
[15:01:44] leitz: Okay, newbie question. A colon before a variable name denotes a symbol. What about after? This snippet is from "Effective Testing with RSpec3": DB.transaction(rollback: :always) { example.run }
[15:01:56] leitz: What is "rollback:"?
[15:02:47] Cavallari1: has joined #ruby
[15:03:51] apeiros: keyword argument
[15:04:10] apeiros: also, it's not "a colon before a variable name", just the same as a string is not "a quote before and after a variable name"
[15:04:29] nowhere_man: has joined #ruby
[15:06:08] mr-robert: it could also be a Hash, where "rollback" is a Symbol.
[15:07:06] leitz: Cool. thanks!
[15:07:15] leitz: ACTION has a lot to learn...
[15:09:22] konsolebox: leitz: also check the splat operator
[15:10:29] lele: has joined #ruby
[15:12:46] hammer: has joined #ruby
[15:15:20] cadillac_: has joined #ruby
[15:15:52] cschneid_: has joined #ruby
[15:23:09] RougeR: has joined #ruby
[15:23:09] RougeR: has joined #ruby
[15:27:30] synthroid: has joined #ruby
[15:28:49] tomphp: has joined #ruby
[15:32:11] dcunit3d: has joined #ruby
[15:34:21] noobineer: has joined #ruby
[15:35:57] netherwolfe: has joined #ruby
[15:36:15] gigetoo: has joined #ruby
[15:36:43] erlend: has joined #ruby
[15:40:18] WhereIsMySpoon_: has joined #ruby
[15:43:47] n008f4g_: has joined #ruby
[15:45:44] cthulchu: has joined #ruby
[15:50:59] cadillac_: has joined #ruby
[15:51:28] stormpack: has joined #ruby
[15:51:37] jcarl43: has joined #ruby
[15:54:12] osvimer: has joined #ruby
[15:57:09] [Butch]: has joined #ruby
[15:58:07] cagomez: has joined #ruby
[15:58:29] cagomez: has joined #ruby
[15:59:28] cadillac_: has joined #ruby
[16:01:39] mikecmpbll: has joined #ruby
[16:06:52] cadillac_: has joined #ruby
[16:14:43] aintno_sunshine: has joined #ruby
[16:18:08] n0m4d1c: has joined #ruby
[16:21:44] n0m4d1c: has joined #ruby
[16:23:19] dr3wo: has joined #ruby
[16:25:08] amar_: has joined #ruby
[16:26:48] amar_: has joined #ruby
[16:34:04] pilne: has joined #ruby
[16:34:09] Megamosaren: has joined #ruby
[16:37:05] orbyt_: has joined #ruby
[16:37:40] biberu: has joined #ruby
[16:38:09] marxarelli: has joined #ruby
[16:47:52] \void: has joined #ruby
[16:50:24] chouhoul_: has joined #ruby
[16:59:48] amar_: has joined #ruby
[17:00:12] schneider: has joined #ruby
[17:01:40] bmurt: has joined #ruby
[17:01:51] Sembei: has joined #ruby
[17:06:41] SeepingN: has joined #ruby
[17:09:22] sanscoeur: has joined #ruby
[17:10:31] amar: has joined #ruby
[17:11:29] karapetyan: has joined #ruby
[17:13:47] John_Ivan: has joined #ruby
[17:18:20] alfiemax: has joined #ruby
[17:27:16] Azure: has joined #ruby
[17:30:46] jottr: has joined #ruby
[17:32:05] Mike11: has joined #ruby
[17:32:46] eckhardt: has joined #ruby
[17:33:13] dionysus69: has joined #ruby
[17:33:37] Mike11: hello all, I am new to ruby, I am browsing through the code base of rugged (ruby libgit2 bindings) and I couldn't understand what would this line be doing (a strange syntax to my eyes): https://github.com/libgit2/rugged/blob/master/lib/rugged/tree.rb#L147
[17:33:50] Mike11: diff_tree_to_tree repo, tree, other_tree.tree, options
[17:34:38] SeepingN: that's diff_tree_to_tree(repo, tree, other_tree.tree, options)
[17:34:48] Mike11: I can guess that it should be a function call, but what perplexes me more is that I can not see this function defined anywhere
[17:34:51] SeepingN: so diff_tree_to_tree is a method somewhere
[17:35:16] Mike11: SeepingN: thanks I thought that too, but I couldn't find it
[17:35:26] phaul: if it's dynamically defined, it will be hard to find.
[17:35:37] Mike11: btw, is there any difference between using f(x) and f x ?
[17:36:27] Rapture: has joined #ruby
[17:36:56] Naeblis: has joined #ruby
[17:36:57] Mike11: googling ruby dynamically defined methods...
[17:38:23] Naeblis: Hi, sorry if this sounds like a noob question, but all answers I found rely on assumption of working in Rails. Is there a way for me to say "Give me the timestamp of beginning/end of last <Mon/Tue/Fri>" in Ruby? Can DateTime/Time libraries do this?
[17:38:33] phaul: Mike11: well, what that means is that at the location of the definition the name is constructed by code, or there is a possibility for something even worse, it's caught by method_missing, somewhere, and dispatched there
[17:38:59] phaul: then you won't find the name by grepping for it
[17:38:59] Mike11: phaul: is that needed when calling into a C interface?
[17:39:21] Mike11: (since this is a ruby bindings library, I am guessing)
[17:40:15] marxarelli: has joined #ruby
[17:40:18] workmad3: has joined #ruby
[17:40:28] SeepingN: pub struct Diff<'repo> { /* fields omitted */ }
[17:40:28] SeepingN: The diff object that contains all individual file deltas.
[17:40:28] SeepingN: This is an opaque structure which will be allocated by one of the diff generator functions on the Repository structure (e.g. diff_tree_to_tree or other diff_* functions).
[17:41:18] Mike11: SeepingN: sorry, where is that?
[17:41:23] chouhoulis: has joined #ruby
[17:42:06] SeepingN: https://docs.rs/git2/0.6.11/git2/struct.Diff.html but sounded generic
[17:43:25] havenwood: >> RubyVM::InstructionSequence.compile('f(x)').to_a.last == RubyVM::InstructionSequence.compile('f x').to_a.last # Mike11
[17:43:26] ruby[bot]: havenwood: # => true (https://eval.in/990623)
[17:44:42] Mike11: SeepingN: Actually, I was just trying to know if a "patch" is supposed to contain all hunks related to a specific file, and this paragraph answers my question right away. That was really helpful thanks :)
[17:44:57] schneider: has joined #ruby
[17:45:06] Mike11: I just want to make sure that this holds in ruby rugged too :)
[17:45:27] erlend: has joined #ruby
[17:46:12] Mike11: havenwood: thank you, good to learn about RubyVM::InstructionSequence.compile() :D
[17:46:40] Eiam: Naeblis: not sure I follow the question exactly. You want to know the date/time for the latest day in a set?
[17:47:59] Naeblis: Not exactly. Given a day, I want to actually just know the timestamp of beginning of the previous Saturday (12am) and end of upcoming Friday (11:59pm)
[17:48:12] ramfjord: has joined #ruby
[17:48:16] nadir: has joined #ruby
[17:48:51] SeepingN: https://stackoverflow.com/questions/8089485/rails-previous-sunday-in-relation-to-any-datetime
[17:49:26] Eiam: I think he was looking for a non rails answer
[17:49:42] SeepingN: oh is DateTime rails?
[17:50:05] Eiam: no, i just saw rails in the SO.
[17:50:12] Eiam: I've opend it tho and its not a rails specific answer
[17:50:34] SeepingN: however, Date.today.beginning_of_week(:sunday) is
[17:51:19] SeepingN: A little more work for nonsundays. https://stackoverflow.com/questions/43149326/ruby-rails-get-the-previous-friday-friday-of-last-week
[17:51:55] Eiam: yeah, but DateTime.now - wday isn't
[17:52:03] SeepingN: Then do that for two saturdays and if you want subtract 1 second for the latter
[17:55:04] synthroid: has joined #ruby
[17:55:18] anisha: has joined #ruby
[17:58:42] karapetyan: has joined #ruby
[18:00:03] konsolebox: Naeblis: they can but you have to do the math
[18:00:23] Naeblis: yeah, I'm trying out various tricks based on above answers
[18:04:12] alfiemax: has joined #ruby
[18:07:13] alfiemax_: has joined #ruby
[18:10:42] jerematic: has joined #ruby
[18:11:17] jenrzzz: has joined #ruby
[18:11:17] jenrzzz: has joined #ruby
[18:11:41] eckhardt: has joined #ruby
[18:13:01] alfiemax: has joined #ruby
[18:14:00] cadillac_: has joined #ruby
[18:23:03] raynold: has joined #ruby
[18:27:31] dr3wo: has joined #ruby
[18:28:01] alfiemax: has joined #ruby
[18:28:36] alfiemax: has joined #ruby
[18:32:05] claudiuinberlin: has joined #ruby
[18:32:57] dionysus69: has joined #ruby
[18:35:12] jerematic: has joined #ruby
[18:35:52] Kilo`byte: has joined #ruby
[18:37:04] schneider: has joined #ruby
[18:39:13] dcunit3d: has joined #ruby
[18:41:52] ramfjord: has joined #ruby
[18:49:57] ramfjord: has joined #ruby
[18:51:51] cschneid_: has joined #ruby
[18:52:56] phate408: has joined #ruby
[18:53:13] scwizard: has joined #ruby
[18:55:23] mikecmpbll: has joined #ruby
[18:55:37] orbyt_: has joined #ruby
[18:56:18] clemens3_: has joined #ruby
[18:57:11] ramfjord: has joined #ruby
[18:57:49] sameerynho: has joined #ruby
[19:01:16] cagomez: how do I create an object that responds to a method I define? Like a test double, but in plain ruby
[19:03:16] havenwood: cagomez: Say more? That sounds like just creating a straightforward module, singleton class or class. Do you want to mock something that already exists and confirm the method gets called? Or something else?
[19:03:42] chongtxtx: has joined #ruby
[19:04:28] cagomez: havenwood: I want to create an object that responds to `call!`
[19:04:44] cagomez: I'd create a proc but it only responds to `call`
[19:04:48] kies^: has joined #ruby
[19:05:51] havenwood: cagomez: Do you want to instantiate it and call an instance method or use a class/module method/function?
[19:06:22] cagomez: the former
[19:06:39] havenwood: >> Cagomez = Struct.new :call!; Cagomez.new.call!
[19:06:40] ruby[bot]: havenwood: # => nil (https://eval.in/990633)
[19:07:11] plexigras: has joined #ruby
[19:07:47] havenwood: >> module Cagomez; module_function; def call!; end end; Cagomez.call!
[19:07:51] ruby[bot]: havenwood: # => nil (https://eval.in/990634)
[19:08:18] cagomez: that's perfect, thanks! I was using the wrong syntax (albeit with OpenStruct)
[19:08:24] havenwood: >> class Cagomez; def call!; end end; Cagomez.new.call!
[19:08:25] ruby[bot]: havenwood: # => nil (https://eval.in/990635)
[19:08:29] bmurt: has joined #ruby
[19:08:50] cagomez: I forgot that structs need to be defined and assigned to a variable, and then instantiated
[19:09:13] cagomez: ( lunch time :) )
[19:09:56] oncall-pokemon: has joined #ruby
[19:10:36] alfiemax: has joined #ruby
[19:14:28] jenrzzz: has joined #ruby
[19:14:29] jenrzzz: has joined #ruby
[19:15:00] dc1: has joined #ruby
[19:15:00] banisterfiend: has joined #ruby
[19:18:57] dcunit3d: has joined #ruby
[19:20:55] n0m4d1c_: has joined #ruby
[19:21:18] cschneid_: has joined #ruby
[19:25:00] marr: has joined #ruby
[19:26:15] RougeR: has joined #ruby
[19:26:15] RougeR: has joined #ruby
[19:32:47] cschneid_: has joined #ruby
[19:38:40] schneider: has joined #ruby
[19:38:51] synthroid: has joined #ruby
[19:39:10] clemens3_: has joined #ruby
[19:41:55] byte512: has joined #ruby
[19:46:18] workmad3: has joined #ruby
[19:50:05] orbyt_: has joined #ruby
[19:53:39] banisterfiend: has joined #ruby
[19:54:12] erlend: has joined #ruby
[19:54:51] weaksauce: has joined #ruby
[19:56:26] ramfjord: has joined #ruby
[20:00:40] cschneid_: has joined #ruby
[20:01:05] n0m4d1c: has joined #ruby
[20:03:14] ramfjord: has joined #ruby
[20:03:43] karapetyan: has joined #ruby
[20:03:47] Mike11: has joined #ruby
[20:04:04] karapetyan: has joined #ruby
[20:04:29] dinfuehr: has joined #ruby
[20:04:48] grilix_: has joined #ruby
[20:06:49] roobie: has joined #ruby
[20:08:02] inerthia: has joined #ruby
[20:08:27] netherwolfe: has joined #ruby
[20:19:47] FrostCandy: has joined #ruby
[20:21:41] alfiemax: has joined #ruby
[20:25:55] aintno_sunshine: has joined #ruby
[20:28:40] eckhardt: has joined #ruby
[20:31:49] pastorinni: has joined #ruby
[20:33:43] ur5us: has joined #ruby
[20:37:03] tAn: has joined #ruby
[20:42:16] hkais: has joined #ruby
[20:42:45] netherwolfe: has joined #ruby
[20:45:03] dcunit3d: has joined #ruby
[20:46:59] sidx64: has joined #ruby
[20:47:51] ur5us: has joined #ruby
[20:49:28] sidx64_: has joined #ruby
[20:49:48] papua: has joined #ruby
[20:53:25] minimalism: has joined #ruby
[20:54:35] ur5us: has joined #ruby
[20:55:16] dr3wo: has joined #ruby
[20:56:19] ur5us: has joined #ruby
[20:58:09] Azure: has joined #ruby
[20:59:04] dr3wo: has joined #ruby
[21:01:41] tAn: has joined #ruby
[21:10:45] ged: has joined #ruby
[21:15:48] karapetyan: has joined #ruby
[21:15:59] duderonomy: has joined #ruby
[21:18:29] jerematic: has joined #ruby
[21:20:19] hackeron: has joined #ruby
[21:21:23] alfiemax: has joined #ruby
[21:23:05] hackeron: hi there, quick question, I'm working on an IoT device with MQTT, but it's important that all messages are delivered to the MQTT broker. When the IoT device goes offline for any reason, it needs to queue the messages on local storage to be sent when it reconnects. Can you recommend some low overhead local store? - I was thinking maybe PStore but does that handle sudden power failures well and
[21:23:06] cyberg: has joined #ruby
[21:23:11] hackeron: popping/adding items without needing to rewrite the entire thing? (it's an SD card so need to minimize data writes)
[21:23:49] havenwood: hackeron: How about YAML::DBM?
[21:24:09] havenwood: &ri YAML::DBM
[21:24:09] `derpy: http://ruby-doc.org/stdlib-2.4.1/libdoc/yaml/rdoc/YAML/DBM.html
[21:24:51] hackeron: havenwood: can that add and remove lines in place and handle a sudden power failure without corrupting the file?
[21:25:20] havenwood: hackeron: it handles the "popping/adding items without needing to rewrite the entire thing" part
[21:25:44] hackeron: but if you happen to yank the power cable during the write, file gone? :(
[21:26:03] havenwood: hackeron: that's a question of how DBM handles it
[21:26:29] havenwood: i don't know DBM well enough to day
[21:27:37] havenwood: hackeron: It *looks like* transactions that are occurring during a power loss will be rolled back
[21:27:58] hackeron: it seems to also be key value pair - so I don't think I can just push and pop items from it?
[21:28:12] havenwood: hackeron: there's probably always a possibility of corruption, dunno ¯\_(ツ)_/¯
[21:28:33] havenwood: hackeron: oh, I see - you just want to push/pop?
[21:29:08] hackeron: yes, so something like Queue.new - but persisted to disk in a reliable/efficient way
[21:31:01] Exagone313: has joined #ruby
[21:37:50] hackeron: hmm, maybe redis, I can trigger save to persist to disk
[21:38:38] havenwood: hackeron: redis or rabbitmq seem reasonable
[21:40:25] hackeron: havenwood: I'm using rabbitmq now, but I'm having some major issues: https://groups.google.com/forum/?nomobile=true#!topic/rabbitmq-users/ernykxb1mZY -- also, it's very heavy to run erlang/etc on an IoT device. I think Redis could be the way to go
[21:41:53] havenwood: hackeron: Nerves ftw.
[21:42:10] hackeron: what's that?
[21:42:41] havenwood: hackeron: It's a slimmed down Linux for IoT that runs just what it needs to for the BEAM (at least that's my take).
[21:42:42] ski7777: has joined #ruby
[21:42:53] havenwood: hackeron: The result is booting a modern rPi in 5 sec, instead of 55 sec.
[21:43:03] havenwood: hackeron: That's super nice if you need to restart a demo, etc.
[21:43:03] hackeron: oh is it? - very interesting, thank you :)
[21:43:08] havenwood: hackeron: https://github.com/nerves-project/nerves#nerves
[21:43:19] havenwood: hackeron: It has other great features. Totally worth a look.
[21:43:25] hackeron: does it run on x86_64 as well?
[21:44:38] hackeron: ah, it does, very interesting, thank you, I'll definitely be checking it out!
[21:44:53] hackeron: comes with ruby 2.5.1? :)
[21:45:29] workmad3: has joined #ruby
[21:45:38] havenwood: hackeron: Erlang or Elixir ;-P
[21:45:41] havenwood: or any other language on the BEAM
[21:48:54] hackeron: havenwood: what do you mean by on the BEAM?
[21:49:16] ur5us: has joined #ruby
[21:49:37] havenwood: hackeron: on the Erlang VM
[21:50:07] havenwood: hackeron: Bogumil’s/Björn’s Abstract Machine (BEAM)
[21:50:08] hackeron: oh, so I can't just run normal MRI?
[21:50:21] havenwood: nope - sorry if I gave that impression
[21:50:30] hackeron: oh :( - sad times
[21:50:54] ur5us_: has joined #ruby
[21:51:56] karapetyan: has joined #ruby
[21:52:20] ur5us__: has joined #ruby
[21:52:28] noobineer: has joined #ruby
[21:52:41] tvw: has joined #ruby
[21:52:41] ellcs: has joined #ruby
[21:58:08] bmurt: has joined #ruby
[21:59:12] scwizard: I'm trying to delete all functions from an array of functions, of a certain type
[22:00:42] scwizard: if I put them through to_s I get #<fucntionname:0x0000000003bb76e8> for the function in the array
[22:00:53] scwizard: and: functionname
[22:00:57] scwizard: for the function itself
[22:02:28] erlend: has joined #ruby
[22:03:35] cthulchu_: has joined #ruby
[22:04:16] ramfjord: has joined #ruby
[22:05:02] gix: has joined #ruby
[22:08:30] dcunit3d: has joined #ruby
[22:09:49] orbyt_: has joined #ruby
[22:15:25] inerthia_: has joined #ruby
[22:16:00] jottr: has joined #ruby
[22:17:12] zapata: has joined #ruby
[22:17:27] aintno_sunshine: has joined #ruby
[22:21:53] mattp__: has joined #ruby
[22:22:12] dcunit3d: has joined #ruby
[22:25:29] Psybur_: has joined #ruby
[22:30:12] cliluw: has joined #ruby
[22:30:36] VladGh: has joined #ruby
[22:33:40] asdfasdf_: has joined #ruby
[22:34:39] mroutis: has joined #ruby
[22:34:59] asdfasdf_: let's say i have class A, and i include Modules::B. class A overrides a method 'foo' in Modules::B. in the foo method, is there a difference between calling super or calling Modules::B.foo ?
[22:43:51] tolerablyjake: has joined #ruby
[22:53:05] chouhoulis: has joined #ruby
[22:54:02] chouhoulis: has joined #ruby
[22:57:21] venmx: has joined #ruby
[22:57:33] amar: has joined #ruby
[22:58:56] justinfaler: has joined #ruby
[22:59:02] chaos95: I have a class with a few public methods that check various (different) preconditions along the lines of `raise SomethingError.new("Wrong!") if something.wrong?`
[22:59:30] chaos95: each method tests between 2-6 of these before embarking on its actual functionality
[22:59:56] jottr: has joined #ruby
[22:59:59] chaos95: is there a best practice or standard way of abstracting these sorts of checks? They end up blowing out method bodies to way more lines than I feel they should be
[23:01:25] VladGh: has joined #ruby
[23:01:40] whathappens: has joined #ruby
[23:06:13] bmurt: has joined #ruby
[23:07:48] karapetyan: has joined #ruby
[23:08:42] darkhanb: has joined #ruby
[23:18:42] shinnya: has joined #ruby
[23:19:52] mahlon_: has joined #ruby
[23:20:45] volix: has joined #ruby
[23:21:02] ErhardtMundt: has joined #ruby
[23:21:23] byte512: has joined #ruby
[23:21:41] cpallares: has joined #ruby
[23:23:45] alfiemax: has joined #ruby
[23:27:15] jeffreylevesque: has joined #ruby
[23:27:17] cadillac_: has joined #ruby
[23:41:05] Dimik: has joined #ruby
[23:43:02] dr3wo: has joined #ruby
[23:44:36] workmad3: has joined #ruby
[23:45:22] Psybur: has joined #ruby
[23:48:34] jottr: has joined #ruby
[23:51:34] mroutis: what are you using for testing, chaos95 ?
[23:54:13] n0m4d1c: has joined #ruby
[23:56:56] Azure: has joined #ruby
[23:57:40] cliluw: has joined #ruby
[23:57:54] chaos95: mroutis: sorry I should have been clearer - this is not in tests, this is in operational code, validating inputs to a function before performing the actual function's operations
[23:58:02] yxhuvud: has joined #ruby
[23:58:25] chaos95: mroutis: it's been written in what I would describe as a highly.. defensive style.
[23:58:40] cthu|: has joined #ruby
[23:59:17] mroutis: why won't you encapsulate that logic into a function and just call it?
[23:59:47] darkhanb: has joined #ruby