baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.5.1, 2.4.4, 2.3.7, 2.6.0-preview1: https://www.ruby-lang.org || Paste 4+ lines of text to https://gist.github.com || Rails questions? Ask in #RubyOnRails || Books: https://goo.gl/wpGhoQ || Logs: https://irclog.whitequark.org/ruby
shtirlic_ has quit [Quit: ZNC - http://znc.in]
xuanrui has joined #ruby
shtirlic_ has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
cadillac_ has quit [Ping timeout: 264 seconds]
karapetyan has quit [Ping timeout: 240 seconds]
cadillac_ has joined #ruby
IRCtoo has quit []
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
erlend has quit [Ping timeout: 264 seconds]
ryzokuken has quit [Remote host closed the connection]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
erlend has joined #ruby
marr has quit [Ping timeout: 240 seconds]
Yxhuvud has joined #ruby
cthulchu has quit [Ping timeout: 246 seconds]
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
jinie has quit [Ping timeout: 268 seconds]
jinie has joined #ruby
shtirlic_ has quit [Quit: ZNC - http://znc.in]
cagomez has quit [Ping timeout: 264 seconds]
jcarl43 has quit [Quit: WeeChat 2.1]
shtirlic_ has joined #ruby
tdy has quit [Ping timeout: 240 seconds]
leitz has quit [Quit: Nappy time]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jready has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
eckhardt has joined #ruby
Yxhuvud has joined #ruby
Xiti has quit [Quit: Xiti]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Dimik has joined #ruby
Yxhuvud has joined #ruby
bmurt has joined #ruby
Psybur has joined #ruby
Xiti has joined #ruby
Psybur_ has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
karapetyan has joined #ruby
ramfjord has quit [Ping timeout: 265 seconds]
shtirlic_ has quit [Quit: ZNC - http://znc.in]
xuanrui has quit [Quit: Leaving]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
gizmore has joined #ruby
shtirlic_ has joined #ruby
Yxhuvud has joined #ruby
karapetyan has quit [Ping timeout: 260 seconds]
gizmore|2 has quit [Ping timeout: 240 seconds]
kapil___ has joined #ruby
Yxhuvud has quit [Client Quit]
cyberg has quit [Remote host closed the connection]
Yxhuvud has joined #ruby
xuanrui has joined #ruby
shtirlic_ has quit [Quit: ZNC - http://znc.in]
shtirlic_ has joined #ruby
dcunit3d has joined #ruby
n0m4d1c has joined #ruby
heyimwill has quit [Ping timeout: 256 seconds]
heyimwill has joined #ruby
jordanm has quit [Quit: Konversation terminated!]
workmad3 has joined #ruby
dinfuehr_ has joined #ruby
konsolebox has quit [Ping timeout: 256 seconds]
dinfuehr has quit [Ping timeout: 240 seconds]
konsolebox has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
mikhael_k33hl has joined #ruby
<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.
nicesignal has joined #ruby
<havenwood> mikhael_k33hl: Are you still asking about sending a CSV via email?
xuanrui has quit [Ping timeout: 240 seconds]
<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?
<havenwood> mikhael_k33hl: Have you made a CSV file before? Do you know what that would look like?
<mr-robert> or use HTML.
<havenwood> You keep talking about sending "a report" or "columns and rows" but that could be so many things...
AJA4350 has quit [Remote host closed the connection]
RougeR has quit [Ping timeout: 268 seconds]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
<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?
<havenwood> ?xy
<havenwood> ?xy
<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
<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
Yxhuvud has joined #ruby
<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.
<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.
<havenwood> mr-robert: Yeah, HTML has columns and rows! ¯\_(ツ)_/¯
<havenwood> It satisfies the requirements as stated.
<mikhael_k33hl> havenwood: I was thinking of having it like: https://gist.github.com/marzdgzmn/aba35001e7a3260efd10f3f70fbabf6a
<havenwood> What is that data? Why are you sending it? Who are you sending it to? What are they doing with it?
<havenwood> mikhael_k33hl: Your pseudo data there could be represented well by CSV.
<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.
<havenwood> mikhael_k33hl: And what are you doing with it once you receive the email?
weaksauce has joined #ruby
<havenwood> mikhael_k33hl: Loading it into a spreadsheet? Storing it for posterity? Parsing it into another program?
<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 :)
<havenwood> So you just want a human-readable representation.
<havenwood> mikhael_k33hl: Do you care what program you're reading it with, or just that it can be easily read?
alfiemax has joined #ruby
<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?
<havenwood> mikhael_k33hl: Is it a lot of data, would it be advantageous to open it with a spreadsheet processor?
<mikhael_k33hl> havenwood: Just so that it can be easily read
<havenwood> mikhael_k33hl: YAML or pretty generated JSON are options.
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
<mikhael_k33hl> havenwood: Nah, it'll be like 20 line tops, I'd rather have it in an email body
<havenwood> CSV wouldn't look nice in an email.
<havenwood> mr-robert's suggestion is back on the table ;-)
<mr-robert> yeah. sending reports as HTML is pretty common.
Yxhuvud has joined #ruby
<mikhael_k33hl> oh I see, i'll try using html tags then
xuanrui has joined #ruby
<havenwood> >> require 'json'; puts JSON.pretty_generate({mikhael_k33hl: [1, 2, 3]})
<ruby[bot]> havenwood: # => { ...check link for more (https://eval.in/989951)
<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.
<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.
alfiemax has quit [Ping timeout: 264 seconds]
ramfjord has joined #ruby
<havenwood> mikhael_k33hl: ERB or Nokogiri::HTML::Builder would be two of many options for HTML.
<havenwood> mikhael_k33hl: JSON and YAML are in the stdlib, and are worth learning how to use in any case.
DTZUZO has quit [Ping timeout: 240 seconds]
<mr-robert> erb is stdlib and def worth it too
<havenwood> Yeah, ERB is totally worth learning for a variety of reasons.
<havenwood> If Nokogiri didn't have deps it'd be in the stdlib too.
pastorinni has joined #ruby
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
pastorinni has quit [Client Quit]
<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.
Yxhuvud has joined #ruby
<havenwood> mikhael_k33hl: JSON.pretty_generate your_data_here
xuanrui has quit [Quit: Leaving]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> mikhael_k33hl: Psych.dump your_data_here
<mikhael_k33hl> havenwood: thanks, I"ll give JSON a try
<havenwood> JSON.pretty_generate({response: "you're welcome"})
n0m4d1c has quit [Ping timeout: 240 seconds]
<havenwood> Don't forget to: require 'json'
ramfjord has quit [Ping timeout: 268 seconds]
chrisseaton has joined #ruby
Psybur has quit [Ping timeout: 240 seconds]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
pilne has quit [Quit: Leaving]
Yxhuvud has joined #ruby
Tharbakim has quit [Ping timeout: 264 seconds]
dr3w_ has joined #ruby
dr3w__ has quit [Ping timeout: 260 seconds]
kurko_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kurko_ has joined #ruby
kurko_ has quit [Client Quit]
kurko_ has joined #ruby
kurko_ has quit [Client Quit]
kurko_ has joined #ruby
kurko_ has quit [Client Quit]
kurko_ has joined #ruby
kurko_ has quit [Client Quit]
kurko_ has joined #ruby
kurko_ has quit [Client Quit]
kurko_ has joined #ruby
kurko_ has quit [Client Quit]
kurko_ has joined #ruby
kurko_ has quit [Client Quit]
kurko_ has joined #ruby
kurko_ has quit [Client Quit]
kurko_ has joined #ruby
erlend has quit [Ping timeout: 268 seconds]
kurko_ has quit [Client Quit]
erlend has joined #ruby
kurko_ has joined #ruby
kurko_ has quit [Client Quit]
mroutis has joined #ruby
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
kurko_ has joined #ruby
kurko_ has quit [Client Quit]
lupine is now known as ren___
kurko_ has joined #ruby
ren___ is now known as lupine
kurko_ has quit [Client Quit]
kurko_ has joined #ruby
kurko_ has quit [Client Quit]
kurko_ has joined #ruby
kurko_ has quit [Client Quit]
Yxhuvud has joined #ruby
dcunit3d has quit [Ping timeout: 240 seconds]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #ruby
alfiemax has joined #ruby
jready has quit []
cadillac_ has quit [Quit: I quit]
linuxdaemon has quit [Ping timeout: 260 seconds]
cadillac_ has joined #ruby
noobineer has joined #ruby
alfiemax has quit [Ping timeout: 256 seconds]
dcunit3d has joined #ruby
mroutis has quit [Ping timeout: 256 seconds]
giuseppe_ has joined #ruby
rf has joined #ruby
xuanrui has joined #ruby
<giuseppe_> guys, how do i delete those characters with code 160? https://pastebin.com/SQuPQL2d
<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
airstream66 has joined #ruby
<giuseppe_> guys, how do i delete those characters with code 160? https://gist.github.com/agfp/098d3fcbd5592cca0fb6fbcbf8aecff0
airstream66 has quit [Client Quit]
linuxdaemon has joined #ruby
airstream66 has joined #ruby
cadillac_ has quit [Read error: Connection reset by peer]
DTZUZO has joined #ruby
airstream66 has quit [Client Quit]
dcunit3d has quit [Ping timeout: 256 seconds]
cadillac_ has joined #ruby
orbyt_ has joined #ruby
dcunit3d has joined #ruby
rf has quit []
gix- has joined #ruby
gix has quit [Disconnected by services]
govg has quit [Ping timeout: 268 seconds]
xuanrui has quit [Remote host closed the connection]
cschneid_ has joined #ruby
cschneid_ has quit [Remote host closed the connection]
mroutis has joined #ruby
envex has joined #ruby
xuanrui has joined #ruby
karapetyan has joined #ruby
xuanrui has quit [Remote host closed the connection]
xuanrui has joined #ruby
xuanrui has quit [Remote host closed the connection]
alfiemax has joined #ruby
dcunit3d has quit [Ping timeout: 276 seconds]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
xuanrui has joined #ruby
Yxhuvud has joined #ruby
karapetyan has quit [Ping timeout: 276 seconds]
cschneid_ has joined #ruby
giuseppe_ has quit [Quit: Page closed]
Dimik has quit [Ping timeout: 240 seconds]
alfiemax has quit [Ping timeout: 264 seconds]
kapil___ has quit [Quit: Connection closed for inactivity]
xuanrui has quit [Quit: Leaving]
cagmz has joined #ruby
<havenwood> gius, aww, they left
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<havenwood> >> 160.chr('UTF-8')
<ruby[bot]> havenwood: # => " " (https://eval.in/989958)
<cagmz> what is the best way generate a hash from a hash of k,v pairs? ie least chance of collision
<havenwood> cagmz: hash from a hash?
<havenwood> cagmz: give an example in pseudo code?
<cagmz> cagmz, hash/checksum generated from a Hash. like an MD5 hash
<cagmz> haha wow, long day. @ havenwood
<havenwood> cagmz: Ah, err. I'm still confused! Yeah, long day...
<havenwood> cagmz: You have a Hash like {} and you want a checksum of it?
<havenwood> Or?
<cagmz> yup!
<havenwood> cagmz: But not one to use internally in Ruby, or yeah?
<havenwood> >> {}.hash
<ruby[bot]> havenwood: # => 415101549 (https://eval.in/989959)
<havenwood> >> {}.hash
<ruby[bot]> havenwood: # => 183856668 (https://eval.in/989960)
<cagmz> well, my intent is to pass it to Rails.cache.write to ensure a unique cache key
<havenwood> cagmz: And you'll have multiple Ruby processes?
<cagmz> not sure if generating a checksum from a {} is overkill. yes, multiple ruby processes accessing a distributed cache (multiple memcached servers)
<havenwood> cagmz: mmm
<havenwood> cagmz: I'm curious what aspect of the Hash identifies that it should correspond to that cache?
<havenwood> cagmz: The key/value content being identical?
Janky has quit []
xenops has quit [Ping timeout: 246 seconds]
<cagmz> the hash will contain k, v values such as { user_id: 1, item_id: 2 }
<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?
workmad3 has joined #ruby
<cagmz> yes. that hash would be a key to item 2's data. and { user_id: 1, item_id: 3 } for item 3
<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?
arescorpio has joined #ruby
postmodern has joined #ruby
alfiemax has joined #ruby
<havenwood> err, i mean still lookup the same cache key?
<cagmz> havenwood, yeah, the hash content is the actual cache key. not the object id
<havenwood> cagmz: Maybe just #inspect and SHA512?
<havenwood> >> require 'digest/sha2'; Digest::SHA512.hexdigest({cagmz: true}.inspect)
<ruby[bot]> havenwood: # => "3573a14feed0198699363aa6a6cc1305aabe6d508cad825c47ff3dc24e76a1f9daa8d050af78bb53ccad79d85414e6daf0b ...check link for more (https://eval.in/989968)
<havenwood> >> require 'digest/sha2'; Digest::SHA512.hexdigest({cagmz: true}.inspect)
<ruby[bot]> havenwood: # => "3573a14feed0198699363aa6a6cc1305aabe6d508cad825c47ff3dc24e76a1f9daa8d050af78bb53ccad79d85414e6daf0b ...check link for more (https://eval.in/989969)
workmad3 has quit [Ping timeout: 256 seconds]
<cagmz> >> require 'digest'; key = { user_id: 1, item_id: 2 }; Digest::SHA256.digest key.to_s
<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)
<cagmz> thanks!
<havenwood> cagmz: Yeah, you can get away with SHA256. I'd probably hexdigest.
alfiemax has quit [Ping timeout: 240 seconds]
<havenwood> >> key = {user_id: 1, item_id: 2}; require 'digest/sha2'; Digest::SHA256.hexdigest key.inspect
<ruby[bot]> havenwood: # => "aa5f679065a6d2e8be8d76403c54cebebb16f1e57b2b35c0673fca0d64c58aa2" (https://eval.in/989971)
<cagmz> why is Hexdigest better?
<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. ¯\_(ツ)_/¯
<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))."
dcunit3d has joined #ruby
noobineer has quit [Ping timeout: 256 seconds]
minimalism has quit [Quit: minimalism]
<havenwood> cagmz: If you don't mind weird bytes, maybe just Marshal it.
<cagmz> what do you mean?
<havenwood> >> key = {user_id: 1, item_id: 2}; Marshal.dump key
<ruby[bot]> havenwood: # => "\x04\b{\a:\fuser_idi\x06:\fitem_idi\a" (https://eval.in/989972)
<havenwood> >> Marshal.load "\x04\b{\a:\fuser_idi\x06:\fitem_idi\a"
<ruby[bot]> havenwood: # => {:user_id=>1, :item_id=>2} (https://eval.in/989973)
<cagmz> I don't mind, but since the {} will be a cache key, I think Hexdigest is more semantic
<havenwood> yeah, hexdigest is prettier
<havenwood> and uniformly sized
<cagmz> Marshal.dump is neat, though
<havenwood> yeah, it's a nice inter-Ruby way to serialize and deserialize
<havenwood> it supports all sorts of objects out of the box, and you can easily implement your own for classes or singleton classes
govg has joined #ruby
<havenwood> The Singleton docs have a decent example: https://ruby-doc.org/stdlib/libdoc/singleton/rdoc/Singleton.html#module-Singleton-label-Singleton+and+Marshal
<cagmz> this is giving me ideas haha. what do you think about using Marshal.dump work with an in-memory store?
<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
<havenwood> cagmz: I've thought the same!
<havenwood> cagmz: The stdlib has PStore, which stores Marshalled Ruby to disk transactionally.
<havenwood> cagmz: I have a little wrapper around PStore that gives a nicer interface: https://github.com/havenwood/persist#readme
<havenwood> I should "refresh" these gems. They're old.
<cagmz> what's the diff between storing on disk vs memory? besides the obvious
<havenwood> cagmz: But PStore is worth a look. And Marshal can be handy, and is used by stuff like DRb.
<cagmz> I mean, what are the trade offs?
<havenwood> So for example, Ruby stdlib has YAML::Store and YAML::DBM.
<havenwood> YAML::Store is like PStore for YAML.
<havenwood> YAML::DBM uses Berkley DB with YAML values.
<havenwood> They both store YAML to disk. They're both transactional. The latter is a DB.
govg has quit [Ping timeout: 260 seconds]
<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.
mroutis has quit [Ping timeout: 240 seconds]
govg has joined #ruby
<havenwood> cagmz: They're ^ both quite usable. I'd recommend giving each a quick try.
ryzokuken has joined #ruby
<cagmz> hmm so with the YAML::Store, a process' memory usage may grow until...?
<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?
<havenwood> cagmz: Just like anything else, it takes the memory until it's dereferenced and GCed or the process is killed.
<cagmz> so say it falls out of scope and no methods are using it, is that when it's dereferenced?
<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.
<cagmz> wow, til!
<havenwood> With JSONB you can query the binary and retrieve just the value for one key.
<cagmz> ^_^ amazing
<havenwood> cagmz: It's the same thing for JSON versus Protocol Buffers. It really makes a huge difference when the data gets larger.
<havenwood> cagmz: For in-memory stuff, you can just not serialize it at all - unless you need to send it over the wire.
<cagmz> ah ok
<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.
xuanrui has joined #ruby
<ur5us> is there a way to define your own `MyClass(…)` method (operator?) like with `BigDecimal(…)`?
<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.
<havenwood> ur5us: yes
<cagmz> got it, thanks again! goodnight
<havenwood> cagmz: you're welcome, g'night!
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
cagmz has quit [Quit: Leaving]
<ur5us> havenwood: I tried `def self.call(…); …; end` but that’s not the same. So what’s the correct way?
<havenwood> >> module Kernel; def Ur5us(s); s.chars.shuffle.join end end; Ur5us('ur5us')
<ruby[bot]> havenwood: # => "rsuu5" (https://eval.in/989978)
Yxhuvud has joined #ruby
<havenwood> ur5us: It's actually just a method that starts with a capital letter on Kernel.
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> >> method(:Integer).owner
<ruby[bot]> havenwood: # => Kernel (https://eval.in/989979)
<havenwood> >> defined? Integer()
<ruby[bot]> havenwood: # => "method" (https://eval.in/989980)
<ur5us> havenwood: ah, thanks. That makes sense
<havenwood> ur5us: np
Tharbakim has joined #ruby
Tharbakim has quit [Changing host]
Tharbakim has joined #ruby
chrisseaton has quit [Quit: Connection closed for inactivity]
jordanm has joined #ruby
cliluw has quit [Ping timeout: 240 seconds]
cliluw has joined #ruby
armyriad has quit [Quit: Leaving]
armyriad has joined #ruby
<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?
xuanrui has quit [Remote host closed the connection]
<havenwood> ericmathison: If you had a newer version of rails installed it'd be the wrong bin/rails that it then called.
<havenwood> ericmathison: Say if you had a project using 5.0, but had Rails 5.1 also installed.
<ericmathison> Oh, yikes. Even though it's using bundler?
<havenwood> ericmathison: If you `bundle exec rails` you'll get the version from your Gemfile.lock.
erlend has quit [Ping timeout: 264 seconds]
<havenwood> ericmathison: You can specify the version directly as well, say if you're starting a new rails project: rails _5.1.0_ new ...
<ericmathison> Hmm. I thought using the rails command actually was eqivalent to running `bundle exec rails`
<havenwood> ericmathison: If you're using RVM and haven't uninstalled rubygems-bundler, then it is.
<havenwood> ericmathison: By default, it isn't.
erlend has joined #ruby
<ericmathison> ok. good to know. thanks. miss seeing you around the meetup by the way. take care!
<havenwood> ericmathison: o/
oleo has quit [Quit: Leaving]
Azure has quit [Ping timeout: 255 seconds]
nadir has quit [Quit: Connection closed for inactivity]
arescorpio has quit [Excess Flood]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
reber has joined #ruby
cschneid_ has quit [Remote host closed the connection]
char_var[buffer] has joined #ruby
obzidian has quit [Ping timeout: 260 seconds]
jamesaxl has joined #ruby
sauvin has joined #ruby
n008f4g_ has joined #ruby
iMadper has joined #ruby
claudiuinberlin has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
<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
n008f4g_ has quit [Ping timeout: 256 seconds]
<ericmathison> not using rvm either
ur5us has quit [Remote host closed the connection]
hkais has joined #ruby
anisha has joined #ruby
venmx has joined #ruby
jud^ has quit [Ping timeout: 264 seconds]
icarus has joined #ruby
arescorpio has joined #ruby
workmad3 has joined #ruby
alfiemax has joined #ruby
eckhardt has joined #ruby
alfiemax has quit [Read error: Connection reset by peer]
alfiemax has joined #ruby
jud has joined #ruby
jud has quit [Changing host]
jud has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
jud has quit [Ping timeout: 240 seconds]
jud has joined #ruby
jud has quit [Changing host]
jud has joined #ruby
icarus has quit [Ping timeout: 256 seconds]
icarus has joined #ruby
apeiros has quit [Remote host closed the connection]
suukim has joined #ruby
tdy has joined #ruby
alex`` has joined #ruby
icarus has quit [Ping timeout: 260 seconds]
troys has quit [Quit: Bye]
mtkd has joined #ruby
sidx64 has joined #ruby
aufi has joined #ruby
arescorpio has quit [Quit: Leaving.]
karapetyan has joined #ruby
karapetyan has quit [Ping timeout: 240 seconds]
alex`` has quit [Ping timeout: 246 seconds]
schneider has joined #ruby
sidx64_ has joined #ruby
ryzokuken has quit [Remote host closed the connection]
sidx64 has quit [Read error: Connection reset by peer]
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
ltt has joined #ruby
sidx64 has joined #ruby
sidx64_ has quit [Ping timeout: 256 seconds]
<weaksauce> ericmathison what are you using for versioning? nothing?
<weaksauce> in any event you should be using bundler and a gem file
amar has joined #ruby
ltt has quit [Ping timeout: 276 seconds]
schneider has quit [Ping timeout: 240 seconds]
ozaki_ has joined #ruby
ozaki_ has quit [Remote host closed the connection]
phaul has joined #ruby
schneider has joined #ruby
dionysus69 has joined #ruby
erlend has quit [Ping timeout: 256 seconds]
_phaul has joined #ruby
erlend has joined #ruby
phaul has quit [Ping timeout: 256 seconds]
_phaul is now known as phaul
ltt has joined #ruby
dionysus69 has quit [Quit: dionysus69]
dionysus69 has joined #ruby
clemens3_ has joined #ruby
inerthia has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
schneider has quit [Ping timeout: 256 seconds]
andikr has joined #ruby
inerthia has joined #ruby
TomyWork has joined #ruby
mikhael_k33hl has quit [Quit: Page closed]
tvw has joined #ruby
chouhoulis has joined #ruby
claudiuinberlin has joined #ruby
Burgestrand has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
schneider has joined #ruby
Matthew1 has joined #ruby
schneider has quit [Ping timeout: 268 seconds]
ltt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
reber has quit [Ping timeout: 240 seconds]
reber has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
chouhoul_ has joined #ruby
shiroeni has joined #ruby
ltt has joined #ruby
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
amar has quit [Remote host closed the connection]
chouhoulis has quit [Ping timeout: 276 seconds]
cabotto has joined #ruby
yokel has quit [Remote host closed the connection]
sidx64 has joined #ruby
schneider has joined #ruby
yokel has joined #ruby
mikecmpbll has joined #ruby
hkais has quit [Ping timeout: 264 seconds]
chouhoul_ has quit [Remote host closed the connection]
chouhoulis has joined #ruby
sidx64 has quit [Ping timeout: 256 seconds]
marr has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fyrril2 has joined #ruby
sidx64 has joined #ruby
fyrril has quit [Ping timeout: 245 seconds]
postmodern has quit [Quit: Leaving]
cabotto has quit [Remote host closed the connection]
sidx64 has quit [Ping timeout: 240 seconds]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
RougeR has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
Kilobyte22 has quit [Ping timeout: 240 seconds]
cabotto has joined #ruby
Puffball has joined #ruby
guille-moe has joined #ruby
vondruch has joined #ruby
ltt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
iMadper has quit [Ping timeout: 240 seconds]
iMadper has joined #ruby
ltt has joined #ruby
jnollette has quit [Ping timeout: 268 seconds]
mtkd has quit []
izaac has quit [Ping timeout: 260 seconds]
jnollette has joined #ruby
karapetyan has joined #ruby
ltt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
headius has quit [Ping timeout: 264 seconds]
yohji has joined #ruby
weaksauce has quit [Ping timeout: 264 seconds]
headius has joined #ruby
clemens3_ has quit [Ping timeout: 240 seconds]
reber has quit [Remote host closed the connection]
izaac has joined #ruby
ltt has joined #ruby
mtkd has joined #ruby
amar has joined #ruby
gigetoo has quit [Ping timeout: 260 seconds]
gigetoo has joined #ruby
amar_ has joined #ruby
Beams has joined #ruby
amar has quit [Read error: No route to host]
amar has joined #ruby
kedare has joined #ruby
tomphp has joined #ruby
roshanavand has quit [Ping timeout: 256 seconds]
chouhoulis has quit [Remote host closed the connection]
amar_ has quit [Ping timeout: 256 seconds]
reber has joined #ruby
clemens3_ has joined #ruby
kedare has quit [Client Quit]
amar_ has joined #ruby
ciscam has quit [Ping timeout: 276 seconds]
ciscam has joined #ruby
amar has quit [Ping timeout: 256 seconds]
minimalism has joined #ruby
shiroeni has quit [Quit: Leaving]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
schneider has quit [Ping timeout: 276 seconds]
erlend has quit [Ping timeout: 276 seconds]
tomphp has joined #ruby
erlend has joined #ruby
ltt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
RougeR has quit [Ping timeout: 268 seconds]
yokel has quit [Ping timeout: 260 seconds]
ltt has joined #ruby
ur5us has joined #ruby
yokel has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roshanavand has joined #ruby
ltt has quit [Ping timeout: 276 seconds]
workmad3 has joined #ruby
marr has quit [Ping timeout: 264 seconds]
roshanavand has quit [Client Quit]
roshanavand has joined #ruby
iNs_ has quit [Ping timeout: 276 seconds]
sidx64 has joined #ruby
sidx64 has quit [Client Quit]
iNs has joined #ruby
schneider has joined #ruby
Burgestrand has quit [Quit: Good bye and have a nice day!]
amar_ has quit [Remote host closed the connection]
amar has joined #ruby
mikecmpb_ has joined #ruby
zautomata2 has joined #ruby
amar_ has joined #ruby
amar_ has quit [Remote host closed the connection]
amar_ has joined #ruby
zautomata1 has quit [Ping timeout: 256 seconds]
sidx64 has joined #ruby
amar has quit [Ping timeout: 256 seconds]
mikecmpbll has quit [Ping timeout: 264 seconds]
ltt has joined #ruby
hkais has joined #ruby
zautomata3 has joined #ruby
zautomata2 has quit [Ping timeout: 240 seconds]
tomphp has joined #ruby
tomphp has quit [Client Quit]
ReusedSalt has joined #ruby
Mike11 has joined #ruby
hammer has quit [Ping timeout: 265 seconds]
zautomata3 has quit [Ping timeout: 276 seconds]
zautomata has joined #ruby
hammer has joined #ruby
nowhereman_ has quit [Ping timeout: 256 seconds]
eckhardt has joined #ruby
cabotto has quit [Remote host closed the connection]
cabotto has joined #ruby
schneider has quit [Ping timeout: 240 seconds]
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
schneider has joined #ruby
zautomata1 has joined #ruby
cabotto has quit [Ping timeout: 256 seconds]
zautomata has quit [Ping timeout: 265 seconds]
schneider has quit [Ping timeout: 268 seconds]
clemens3_ has quit [Ping timeout: 256 seconds]
schneider has joined #ruby
zautomata1 has quit [Quit: WeeChat 1.9.1]
ltt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zautomata has joined #ruby
ltt has joined #ruby
leitz has joined #ruby
<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.
<phaul> very little or not at all
<phaul> you would be able to look up stuff in MRI implementation, or write C extensions. that's about it
iMadper has quit [Ping timeout: 240 seconds]
<phaul> none of those things are striclty speaking ruby knowledge
iMadper has joined #ruby
<Radar> >> (1..20).each { |x| puts x if (x == 5) .. (x == 10) }
<ruby[bot]> Radar: # => 5 ...check link for more (https://eval.in/990275)
<Radar> TIL "flip-flop operator"
<leitz> That seems useful. phaul, just an aside, I'm not too hot in OOP, still mentally prodcedural.
<leitz> Like dealing with the 31 errors in today's comile. :)
<leitz> compile
<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..
kapil___ has joined #ruby
<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.
<leitz> Of course, whenever I get frustrated with Ruby I look at C and Go anyway. ;)
<phaul> Radar: it's horrendous isn't it? Hopefully they remove it from 3.0
<Radar> phaul: absolutely
amar_ has quit [Remote host closed the connection]
amar has joined #ruby
mtkd has quit [Remote host closed the connection]
amar has quit [Read error: No route to host]
icarus has joined #ruby
amar has joined #ruby
<mr-robert> leitz: learning C is worthwhile.
cabotto has joined #ruby
Psybur has joined #ruby
<leitz> mr-robert, please expand.
<mr-robert> learning C will make you a better programmer generally speaking.
cabotto has quit [Remote host closed the connection]
* leitz is going to sit with his manager today and lay out the plan the manager should follow. :)
cabotto has joined #ruby
<mr-robert> C is harder to learn than Ruby, though
<mr-robert> Ruby is easy to learn
ltt has quit [Quit: Textual IRC Client: www.textualapp.com]
<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.
<leitz> Ruby is the first language that inspires me to come home and code more. Others I need to work myself up to.
<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.
<leitz> ;)
<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
<leitz> I can get stuff done in Ruby. What I can do in C is learn C.
<leitz> phaul, use a very loose defintion of "good understanding". :)
alex`` has joined #ruby
<leitz> I'm a linux guy by trade.
tomphp has joined #ruby
tomphp has quit [Client Quit]
amar has quit [Read error: Connection reset by peer]
amar has joined #ruby
guille-moe has quit [Ping timeout: 256 seconds]
Matthew1 has quit [Remote host closed the connection]
<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 :)
guille-moe has joined #ruby
<leitz> phaul; plggbbttt.....
<leitz> Most of the good "How commputers work" books use C as the reference.
tomphp has joined #ruby
<leitz> Well, most of the ones I've seen.
<mr-robert> C is the foundation of so many things in computers.
<konsolebox> knowing C = system control
cadillac_ has quit [Ping timeout: 240 seconds]
mikecmpb_ has quit [Quit: inabit.]
ur5us has quit [Remote host closed the connection]
<mr-robert> without C, there wouldn't be a Ruby :)
<phaul> nah, C is just a language. And not a particularly good one. But most things around the unix world are written in it
<mr-robert> not just the unix world.
<mr-robert> Windows too
mikecmpbll has joined #ruby
cadillac_ has joined #ruby
<konsolebox> phaul: C is really good if written properly. it hides nothing
<konsolebox> or almost nothing
<konsolebox> vs. C++, etc.
<phaul> well, there are shortcomings in C due to how old it is. I think everybody agrees that preprocessing is baaaadd
<konsolebox> phaul: hmm, why though? if it's about optimization, there's LTO
<mr-robert> and yet no one has written a decent replacement. people have tried, with Go, and Rust, but C still reigns supreme.
<leitz> I like preprocessing. At least as I understand it. Filtering, and all that.
<leitz> Go is pretty nice, but still not C fast or as portable.
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kurko_ has joined #ruby
tomphp has joined #ruby
tomphp has quit [Client Quit]
dipnlik has joined #ruby
<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.
<konsolebox> i never described akin to a holy grail
Azure has joined #ruby
<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.
tomphp has joined #ruby
tomphp has quit [Client Quit]
<konsolebox> but it's good the way it is good, not "not a particularly good one"
tomphp has joined #ruby
tomphp has quit [Client Quit]
<mr-robert> it's unforgiving
iMadper` has joined #ruby
tomphp has joined #ruby
iMadper has quit [Ping timeout: 240 seconds]
<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.
amar has quit [Ping timeout: 264 seconds]
apparition has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
<leitz> C does seem to have it's place, as does Ruby.
<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.
mikecmpbll has joined #ruby
<phaul> I already said the preprocessor. the enum type is also not the greatest
<phaul> representing chars is weird
<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.
<dminuoso> Learning C will not make you a better programming.
<dminuoso> I'd argue that these days there's little value in picking C for a fresh project.
<dminuoso> leitz: Name one area where C excels at.
<leitz> Operating systems
<leitz> Performance
<leitz> Portability
<leitz> Simplicity
<leitz> Widespread usage
<leitz> Tooling
<dminuoso> leitz: OS -> Rust or C++ are just as great.
<dminuoso> leitz: Performance -> Rust or C++ are better.
erlend has quit [Ping timeout: 256 seconds]
<leitz> Nope.
<mr-robert> that's just not true
erlend has joined #ruby
<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.
<leitz> Wikipedia says OSX is writting in C++, which might explain some of the issues...
<leitz> Pretty sure Linux, NetBSD, OpenBSD, and Ruby are in C. Where they aren't assembler.
AJA4350 has joined #ruby
<konsolebox> my favorite editor is written in C
<mr-robert> vim?
<konsolebox> Geany
<tobiasvl> writing an OS in rust? :o
<mr-robert> Geany is a good editor :)
<konsolebox> tbh i find it much easier to hack a software written in C than one written in C++
cabotto has quit [Remote host closed the connection]
cabotto has joined #ruby
alex`` has quit [Ping timeout: 240 seconds]
alfiemax has quit [Remote host closed the connection]
ldnunes has joined #ruby
alfiemax has joined #ruby
Cavallari has joined #ruby
noobineer has joined #ruby
apeiros has joined #ruby
nadir has joined #ruby
cabotto has quit [Remote host closed the connection]
shaman42 has quit [Ping timeout: 256 seconds]
shaman42 has joined #ruby
noobineer has quit [Ping timeout: 256 seconds]
jeffreylevesque has quit [Ping timeout: 256 seconds]
minimalism has quit [Quit: minimalism]
<dminuoso> mr-robert: So your argument is because nobody has written a commercial OS in Rust, it's not feasible?
Azure has quit [Read error: Connection reset by peer]
<apeiros> I seem to have missed some pop-corn worthy discussion?
<mr-robert> doesn't have to be commercial.
<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.
<dminuoso> Which makes C about one of the most horrid languages.
<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.
Azure has joined #ruby
<dminuoso> So it's just availability of implementatinos.
<leitz> And still everything else I mentioned.
<dminuoso> leitz: C does not excel at operating systems for any good reason.
<dminuoso> What features of C makes C better for operating systems than say C++?
<leitz> apeiros, I asked about the value of relearning C. Mostly to support my Ruby.
<leitz> dminuoso, everything I listed above. C++ loses them all.
<dminuoso> leitz: No I mean specific for operating systems.
<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.
<dminuoso> It inhibts writing clean code.
<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.
<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.
<dminuoso> See how that doesnt make sense?
jerematic has joined #ruby
chmurifree is now known as chmuri
<leitz> See how Javascript is about the most used client side web dev language? Why is that?
<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.
<dminuoso> leitz: Certainly not because it's good.
cabotto has joined #ruby
<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.
<dminuoso> leitz: So does untyped lambda calculus.
<dminuoso> Whats your point
<apeiros> mr-robert: uh, rust makes a big part of firefox. I wouldn't call that a "toy concept"
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mr-robert> apeiros: i wouldn't call it an operating system either.
<leitz> That I should spend more time in my code and less in chat.
<apeiros> no, but that's not what you said.
<dminuoso> mr-robert: browsers are amongst the most complex pieces of software you will find in userland.
<apeiros> you claimed it didn't go beyond toy-concept. and that's definitively wrong.
<mr-robert> apeiros: we're talking about operating systems. seems you missed the conversation.
<dminuoso> mr-robert: And I dont know why you call PoC "toys"
drbrain has quit [Ping timeout: 276 seconds]
<mr-robert> apeiros: in the context of operating systems. you've missed the conversation and interjecting wrongly.
<apeiros> classy reaction
jerematic has quit [Remote host closed the connection]
<leitz> Didn't brfower's start off as a class project?
jerematic has joined #ruby
<leitz> browseres....new keyboard. Clumsy fingers.
<leitz> bleagh....
<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.
<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.
<dminuoso> Contrary to popular belief kernel code actually uses abstractions.
<tbuehlmann> I learned the other day that I'm using Fisher-price infrastructure ¯\_(ツ)_/¯
guille-moe has quit [Ping timeout: 264 seconds]
<mr-robert> apeiros: we're talking about C, and how it is the foundation of many things in computers today.
<mr-robert> dminuoso: i never mentioned firefox.
<mr-robert> i'm talking about operating systems. Rust hasn't proven itself in that regard.
<dminuoso> mr-robert: What the heck does that mean?
<dminuoso> mr-robert: Rust only needs to prove in code generation.
<dminuoso> Either Rust generates correct code, or it doesn't.
<dminuoso> If it generates correct code, then it doesnt matter whether your software is a kernel or a browser.
<mr-robert> it means there isn't one serious OS written in Rust.
<dminuoso> mr-robert: There is redox.
synthroid has joined #ruby
<dminuoso> mr-robert: You do know that kernel code is just machine code right? Just like userland apps.
<dminuoso> a kernel is just a piece of software.
<mr-robert> that's not my point.
<mr-robert> but redox looks impressive
RougeR has joined #ruby
RougeR has quit [Changing host]
RougeR has joined #ruby
<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.
<apeiros> the language at that point is irrelevant
<dminuoso> the foundation that other programs are built upon is machine code. So the only question is: "How do we obtain machine code?"
<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"
clemens3_ has joined #ruby
<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"
<dminuoso> And it turns out C is absolutely awful on the last.
<dminuoso> The only abstraction mechanism C has, is pointers.
<mr-robert> apeiros: should just be "other languages", not "other programs"
<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?
<mr-robert> yup
alex`` has joined #ruby
<apeiros> I'd go the same route as dminuoso there. it's a question of ubiquity, not quality
<mr-robert> Rust is one of the many attempts to replace C. i don't think it has proven itself yet.
<mr-robert> i don't think any language has.
<apeiros> yeah, and your goal-post seems to be "proven = an OS implemented in it"
<mr-robert> not just that. C is the bedrock of so many things.
<apeiros> and I disagree. a complex project like a webbrowser is sufficient to prove being beyond a toy.
<mr-robert> i'm not calling Rust a toy
<dminuoso> mr-robert: C is just so ubiquitous because 30 years ago there were not many other good options.
<mr-robert> Rust is a good language, but will it be capable of replacing C? that is yet to be proven
<dminuoso> mr-robert: C is rarely picked to kick off large and complex projects simply because you have 0 abstractions.
<apeiros> again, I think it has proven to be capable of just that.
<apeiros> that doesn't mean C will go away
<dminuoso> mr-robert: Without abstractions your code becomes hard to maintain, hard to reason about.
<apeiros> the same as not even COBOL has yet gone away.
<dminuoso> 14:21 mr-robert | Rust is a good language, but will it be capable of replacing C? that is yet to be proven
<dminuoso> mr-robert: Again. You just need to prove that the implementations are correct.
<dminuoso> mr-robert: The machine code produced for Firefox is equal to your kernel.
<mr-robert> no, it depends on adoption of the language by the masses.
<dminuoso> mr-robert: Let me ask you differently.
<dminuoso> mr-robert: How many segfaults did you have in C projects?
<dminuoso> How many segfaults did you have in Rust projects?
<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.
<apeiros> mr-robert: "adoption of the masses" has little to do with "capable of replacing C", that is "has actually replaced C"
<dminuoso> So a language that has absolutely no guarantees whatsoever is kind of silly to use for a KERNEL.
macduck has quit [Remote host closed the connection]
<dminuoso> mr-robert: and by "segfault" I mean an incorrect memory access.
<dminuoso> C simply has no compile time mechanisms to guarantee this wont happen.
<apeiros> and I think nobody argues that rust has replaced C.
<dminuoso> Rust is just the better option. :P
<mr-robert> i can agree there, but since so much is already written in C it's not always feasible to use Rust
<dminuoso> mr-robert: Why?
<dminuoso> mr-robert: Rust has FFI.
<dminuoso> So you can use external C libraries just fine.
SynSynack has quit [Quit: Не разучиться мечтать... любить...]
byte512 has quit [Ping timeout: 264 seconds]
<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.
<mr-robert> that's my point. you still rely on C and will for a long time.
drbrain has joined #ruby
drbrain has joined #ruby
drbrain has quit [Changing host]
<dminuoso> mr-robert: My point is you can simply start writing a Rust project without any real downsides.
<apeiros> that point I won't argue. that's quite likely the case, given how slow things move.
<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.
<mr-robert> i agree
bmurt has joined #ruby
<mr-robert> but it is still very valuable to know C.
tomphp has joined #ruby
guille-moe has joined #ruby
tomphp has quit [Client Quit]
<mr-robert> nice chatting, back in a while
byte512 has joined #ruby
megamosaren has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dr3w_ has joined #ruby
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tomphp has joined #ruby
<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
<konsolebox> direct to the point. the point that Rust and C++ haven't replaced C yet stands.
chouhoulis has joined #ruby
byte512 has quit [Ping timeout: 256 seconds]
jeffreylevesque has joined #ruby
byte512 has joined #ruby
sidx64 has joined #ruby
drbrain has joined #ruby
drbrain has joined #ruby
drbrain has quit [Changing host]
eblip has joined #ruby
def_jam has joined #ruby
eb0t_ has quit [Ping timeout: 240 seconds]
eb0t has quit [Ping timeout: 276 seconds]
beefjoe has joined #ruby
<beefjoe> can I output the result of irb commands to a file ?
<apeiros> beefjoe: yes
<beefjoe> how
chouhoulis has quit [Remote host closed the connection]
<beefjoe> I'm trying to copy the output
<apeiros> depends on what exactly you want. most primitive way: copy & paste.
chouhoulis has joined #ruby
<apeiros> hm, built-in history is commands only. but you could replace $stdout with an IO splitting class.
<beefjoe> what did you mean by copy and paste
<beefjoe> like manually ?
<apeiros> yes. as said, depends on what you want.
<apeiros> on *nix platforms there's also the "script" tool
<apeiros> e.g. `script your/logfile.log irb`
chouhoulis has quit [Ping timeout: 240 seconds]
duderonomy has joined #ruby
hammer has quit [Remote host closed the connection]
hammer has joined #ruby
drbrain has quit [Ping timeout: 256 seconds]
drbrain has joined #ruby
drbrain has quit [Changing host]
drbrain has joined #ruby
fiachetti has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
k0mpa has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
raynold has quit [Quit: Connection closed for inactivity]
alfiemax has quit [Ping timeout: 256 seconds]
erlend has quit [Ping timeout: 256 seconds]
pork13_ has joined #ruby
erlend has joined #ruby
dcunit3d has quit [Ping timeout: 256 seconds]
def_jam is now known as eb0t_
eblip is now known as eb0t
Dimik has joined #ruby
n0m4d1c has joined #ruby
Antiarc has quit [Ping timeout: 268 seconds]
Antiarc has joined #ruby
megamosaren has quit [Quit: Leaving]
shinnya has joined #ruby
karapetyan has quit [Remote host closed the connection]
dinfuehr_ is now known as dinfuehr
megamosaren has joined #ruby
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
konsolebox has quit [Ping timeout: 256 seconds]
konsolebox has joined #ruby
sidx64 has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has quit [Ping timeout: 256 seconds]
nadir has quit [Quit: Connection closed for inactivity]
karapetyan has joined #ruby
yohji has quit [Ping timeout: 256 seconds]
<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`?
<apeiros> marahin: no need to refactor, you can already do that.
<marahin> OK, so just plain `yield`? :) Does it matter if `&block` stays as defined argument, or not?
<apeiros> marahin: but if you don't use block.call, you should remove the &block from the method definition.
<marahin> I assume it would stay, if I want to pass it later on to another method?
<apeiros> it doesn't matter. but it's better to remove it.
<marahin> actually, let me gist the code, it will be easier
<marahin> sorry for not doing that in the first place
<apeiros> ruby has to actually do work to convert a block to a Proc instance, and &block forces that work.
<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?
<marahin> (if the first, then I assume i can remove &block from arguments list)
<apeiros> yield can't be used to pass on the block
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<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.
<apeiros> but honestly, IMO that's ugly. just stick with &block
duderonomy has joined #ruby
<marahin> OK :)
<marahin> thank you!
axsuul has quit [Ping timeout: 240 seconds]
pastorinni has joined #ruby
<apeiros> yw
amar has joined #ruby
ryzokuken has joined #ruby
axsuul has joined #ruby
govg has quit [Ping timeout: 268 seconds]
duderonomy has quit [Ping timeout: 256 seconds]
yohji has joined #ruby
mn3m has joined #ruby
grilix has joined #ruby
Rapture has joined #ruby
megamosaren has quit [Ping timeout: 264 seconds]
konsolebox has quit [Max SendQ exceeded]
konsolebox has joined #ruby
ReusedSalt has quit [Ping timeout: 265 seconds]
konsolebox has quit [Max SendQ exceeded]
oleo has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
konsolebox has joined #ruby
konsolebox has quit [Max SendQ exceeded]
mikecmpbll has quit [Quit: inabit. zz.]
konsolebox has joined #ruby
mikecmpbll has joined #ruby
konsolebox has quit [Max SendQ exceeded]
konsolebox has joined #ruby
konsolebox has quit [Client Quit]
banisterfiend has joined #ruby
mroutis has joined #ruby
konsolebox has joined #ruby
zautomata1 has joined #ruby
zautomata has quit [Ping timeout: 264 seconds]
apeiros__ has joined #ruby
aufi has quit [Quit: Leaving]
apeiros__ has quit [Remote host closed the connection]
zautomata2 has joined #ruby
n0m4d1c has quit [Remote host closed the connection]
zautomata1 has quit [Ping timeout: 256 seconds]
n0m4d1c has joined #ruby
apeiros has quit [Ping timeout: 264 seconds]
Dimik has quit [Ping timeout: 265 seconds]
n0m4d1c has quit [Ping timeout: 240 seconds]
leitz has quit [Quit: Nappy time]
jud has quit [Quit: Leaving]
chouhoulis has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
nowhereman_ has joined #ruby
physicist__ has joined #ruby
mroutis has quit [Ping timeout: 256 seconds]
Zaab1t has joined #ruby
RougeR has quit [Ping timeout: 240 seconds]
cadillac_ has quit [Quit: I quit]
apparition has quit [Quit: Bye]
workmad3 has quit [Ping timeout: 240 seconds]
cadillac_ has joined #ruby
cyberg has joined #ruby
workmad3 has joined #ruby
leitz has joined #ruby
apeiros has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
mikecmpbll has joined #ruby
tomphp has joined #ruby
<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 }
<leitz> What is "rollback:"?
Cavallari1 has joined #ruby
<apeiros> keyword argument
<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"
nowhere_man has joined #ruby
nowhereman_ has quit [Read error: Connection reset by peer]
andikr has quit [Remote host closed the connection]
Cavallari has quit [Ping timeout: 240 seconds]
Cavallari1 is now known as Cavallari
<mr-robert> it could also be a Hash, where "rollback" is a Symbol.
<leitz> Cool. thanks!
* leitz has a lot to learn...
Cavallari has quit [Quit: Cavallari]
lele has quit [Ping timeout: 256 seconds]
<konsolebox> leitz: also check the splat operator
lele has joined #ruby
cabotto has quit []
hammer has quit [Remote host closed the connection]
hammer has joined #ruby
cadillac_ has quit [Ping timeout: 268 seconds]
cadillac_ has joined #ruby
cschneid_ has joined #ruby
hammer has quit [Client Quit]
synthroid has quit [Remote host closed the connection]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
schneider has quit [Ping timeout: 240 seconds]
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
synthroid has joined #ruby
tomphp has joined #ruby
dcunit3d has joined #ruby
erlend has quit [Ping timeout: 246 seconds]
noobineer has joined #ruby
gigetoo has quit [Ping timeout: 256 seconds]
netherwolfe has joined #ruby
TomyWork has quit [Remote host closed the connection]
gigetoo has joined #ruby
erlend has joined #ruby
beefjoe has quit [Remote host closed the connection]
WhereIsMySpoon has quit [Disconnected by services]
WhereIsMySpoon_ has joined #ruby
n008f4g_ has joined #ruby
karapetyan has quit [Remote host closed the connection]
cthulchu has joined #ruby
cadillac_ has quit [Ping timeout: 240 seconds]
cadillac_ has joined #ruby
stormpack has joined #ruby
jcarl43 has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
osvimer has joined #ruby
[Butch] has joined #ruby
cadillac_ has quit [Ping timeout: 240 seconds]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
mn3m has quit [Ping timeout: 256 seconds]
cadillac_ has joined #ruby
mikecmpbll has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
dcunit3d has quit [Ping timeout: 256 seconds]
noobineer has quit [Ping timeout: 265 seconds]
cadillac_ has quit [Ping timeout: 264 seconds]
cadillac_ has joined #ruby
Mike11 has quit [Quit: Leaving.]
yohji has quit [Remote host closed the connection]
aintno_sunshine has joined #ruby
osvimer has quit [Remote host closed the connection]
n0m4d1c has joined #ruby
envex has quit []
n0m4d1c has quit [Remote host closed the connection]
n0m4d1c has joined #ruby
stormpack has quit [Quit: Leaving]
shinnya has quit [Ping timeout: 264 seconds]
dr3w_ has joined #ruby
inerthia has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
amar has quit [Remote host closed the connection]
amar_ has joined #ruby
amar_ has quit [Read error: No route to host]
amar_ has joined #ruby
amar_ has quit [Ping timeout: 256 seconds]
pilne has joined #ruby
megamosaren has joined #ruby
tvw has quit [Remote host closed the connection]
orbyt_ has joined #ruby
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
biberu has joined #ruby
marxarelli has joined #ruby
mikecmpbll has quit [Ping timeout: 276 seconds]
Beams has quit [Quit: .]
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
marxarelli has quit [Quit: Textual IRC Client: www.textualapp.com]
\void has joined #ruby
zautomata2 has quit [Ping timeout: 276 seconds]
clemens3_ has quit [Ping timeout: 240 seconds]
guille-moe has quit [Ping timeout: 256 seconds]
chouhoul_ has joined #ruby
megamosaren has quit [Quit: Leaving]
chouhoulis has quit [Ping timeout: 240 seconds]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
baweaver is now known as baweaver_away
amar_ has joined #ruby
baweaver_away is now known as baweaver
schneider has joined #ruby
Sembei has quit [Read error: Connection reset by peer]
bmurt has joined #ruby
Sembei has joined #ruby
amar_ has quit [Ping timeout: 256 seconds]
schneider has quit [Ping timeout: 256 seconds]
SeepingN has joined #ruby
sanscoeur has joined #ruby
amar has joined #ruby
karapetyan has joined #ruby
Yogui has quit [Ping timeout: 240 seconds]
John_Ivan has joined #ruby
karapetyan has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
jottr has joined #ruby
suukim has quit [Quit: Konversation terminated!]
Mike11 has joined #ruby
eckhardt has joined #ruby
dionysus69 has joined #ruby
<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
<Mike11> it says:
<Mike11> diff_tree_to_tree repo, tree, other_tree.tree, options
<SeepingN> that's diff_tree_to_tree(repo, tree, other_tree.tree, options)
<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
<SeepingN> so diff_tree_to_tree is a method somewhere
<Mike11> SeepingN: thanks I thought that too, but I couldn't find it
<phaul> if it's dynamically defined, it will be hard to find.
<Mike11> btw, is there any difference between using f(x) and f x ?
<phaul> none
Rapture has joined #ruby
Naeblis has joined #ruby
<Mike11> googling ruby dynamically defined methods...
workmad3 has quit [Ping timeout: 240 seconds]
<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?
<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
<phaul> then you won't find the name by grepping for it
<Mike11> phaul: is that needed when calling into a C interface?
<Mike11> (since this is a ruby bindings library, I am guessing)
marxarelli has joined #ruby
workmad3 has joined #ruby
<SeepingN> pub struct Diff<'repo> { /* fields omitted */ }
<SeepingN> The diff object that contains all individual file deltas.
<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).
chouhoul_ has quit [Remote host closed the connection]
<Mike11> SeepingN: sorry, where is that?
chouhoulis has joined #ruby
<havenwood> >> RubyVM::InstructionSequence.compile('f(x)').to_a.last == RubyVM::InstructionSequence.compile('f x').to_a.last # Mike11
<ruby[bot]> havenwood: # => true (https://eval.in/990623)
<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 :)
erlend has quit [Ping timeout: 265 seconds]
schneider has joined #ruby
<Mike11> I just want to make sure that this holds in ruby rugged too :)
<SeepingN> ;)
erlend has joined #ruby
<Mike11> havenwood: thank you, good to learn about RubyVM::InstructionSequence.compile() :D
<Eiam> Naeblis: not sure I follow the question exactly. You want to know the date/time for the latest day in a set?
<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)
ramfjord has joined #ruby
nadir has joined #ruby
synthroid has quit [Remote host closed the connection]
<Eiam> I think he was looking for a non rails answer
<SeepingN> oh is DateTime rails?
<Eiam> no, i just saw rails in the SO.
<Eiam> I've opend it tho and its not a rails specific answer
<SeepingN> however, Date.today.beginning_of_week(:sunday) is
workmad3 has quit [Ping timeout: 256 seconds]
<Eiam> yeah, but DateTime.now - wday isn't
<SeepingN> Then do that for two saturdays and if you want subtract 1 second for the latter
synthroid has joined #ruby
anisha has joined #ruby
karapetyan has joined #ruby
<konsolebox> Naeblis: they can but you have to do the math
<Naeblis> yeah, I'm trying out various tricks based on above answers
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
alfiemax_ has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
jeremati_ has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
eckhardt has quit [Ping timeout: 265 seconds]
eckhardt has joined #ruby
cadillac_ has quit [Ping timeout: 264 seconds]
alfiemax_ has quit [Remote host closed the connection]
alfiemax has joined #ruby
jerematic has quit [Ping timeout: 246 seconds]
cadillac_ has joined #ruby
dionysus69 has quit [Remote host closed the connection]
alfiemax has quit [Ping timeout: 256 seconds]
sauvin has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 260 seconds]
raynold has joined #ruby
marxarelli is now known as marxarelli|afk
marxarelli|afk is now known as marxarelli
dr3w_ has joined #ruby
alfiemax has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
claudiuinberlin has joined #ruby
schneider has quit [Ping timeout: 260 seconds]
dionysus69 has joined #ruby
jeremati_ has quit [Remote host closed the connection]
jerematic has joined #ruby
Kilo`byte has joined #ruby
pastorinni has quit [Ping timeout: 268 seconds]
Mike11 has quit [Read error: Connection reset by peer]
marxarelli is now known as marxarelli|afk
schneider has joined #ruby
kurko_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dcunit3d has joined #ruby
alfiemax has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 256 seconds]
ramfjord has joined #ruby
meinside has quit [Quit: Connection closed for inactivity]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 240 seconds]
plexigras has quit [Quit: WeeChat 2.1]
marxarelli|afk is now known as marxarelli
phate408 has quit [Ping timeout: 260 seconds]
ramfjord has joined #ruby
aintno_sunshine has quit [Ping timeout: 256 seconds]
cschneid_ has quit [Remote host closed the connection]
cschneid_ has joined #ruby
phate408 has joined #ruby
karapetyan has quit [Remote host closed the connection]
kies^ has quit [Ping timeout: 264 seconds]
scwizard has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 240 seconds]
mikecmpbll has joined #ruby
orbyt_ has joined #ruby
clemens3_ has joined #ruby
cschneid_ has quit [Ping timeout: 264 seconds]
phate408 has quit [Remote host closed the connection]
ramfjord has joined #ruby
sameerynho has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<cagomez> how do I create an object that responds to a method I define? Like a test double, but in plain ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 268 seconds]
chongtxtx has quit [K-Lined]
<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?
chongtxtx has joined #ruby
<cagomez> havenwood: I want to create an object that responds to `call!`
<cagomez> I'd create a proc but it only responds to `call`
kies^ has joined #ruby
<havenwood> cagomez: Do you want to instantiate it and call an instance method or use a class/module method/function?
RougeR has quit [Ping timeout: 264 seconds]
<cagomez> the former
<havenwood> >> Cagomez = Struct.new :call!; Cagomez.new.call!
<ruby[bot]> havenwood: # => nil (https://eval.in/990633)
plexigras has joined #ruby
<havenwood> >> module Cagomez; module_function; def call!; end end; Cagomez.call!
<ruby[bot]> havenwood: # => nil (https://eval.in/990634)
<cagomez> that's perfect, thanks! I was using the wrong syntax (albeit with OpenStruct)
<havenwood> >> class Cagomez; def call!; end end; Cagomez.new.call!
<ruby[bot]> havenwood: # => nil (https://eval.in/990635)
bmurt has joined #ruby
schneider has quit [Ping timeout: 260 seconds]
<cagomez> I forgot that structs need to be defined and assigned to a variable, and then instantiated
hkais has quit [Ping timeout: 260 seconds]
<cagomez> ( lunch time :) )
oncall-pokemon has joined #ruby
alfiemax has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
dc1 has joined #ruby
banisterfiend has joined #ruby
dcunit3d has quit [Ping timeout: 276 seconds]
dc1 has quit [Client Quit]
dcunit3d has joined #ruby
clemens3_ has quit [Ping timeout: 268 seconds]
n0m4d1c_ has joined #ruby
cschneid_ has joined #ruby
n0m4d1c has quit [Ping timeout: 256 seconds]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
marr has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
RougeR has joined #ruby
cschneid_ has quit [Ping timeout: 265 seconds]
cschneid_ has joined #ruby
synthroid has quit [Remote host closed the connection]
schneider has joined #ruby
synthroid has joined #ruby
clemens3_ has joined #ruby
byte512 has quit [Ping timeout: 264 seconds]
byte512 has joined #ruby
cschneid_ has quit [Remote host closed the connection]
workmad3 has joined #ruby
orbyt_ has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
erlend has quit [Ping timeout: 256 seconds]
biberu has quit []
banisterfiend has joined #ruby
erlend has joined #ruby
weaksauce has joined #ruby
ramfjord has joined #ruby
n0m4d1c_ has quit [Remote host closed the connection]
cschneid_ has joined #ruby
schneider has quit [Ping timeout: 256 seconds]
n0m4d1c has joined #ruby
ramfjord has quit [Ping timeout: 268 seconds]
ramfjord has joined #ruby
dinfuehr has quit [Ping timeout: 265 seconds]
karapetyan has joined #ruby
Mike11 has joined #ruby
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
netherwolfe has quit [Ping timeout: 265 seconds]
dinfuehr has joined #ruby
grilix_ has joined #ruby
roobie has joined #ruby
inerthia has joined #ruby
grilix has quit [Ping timeout: 276 seconds]
netherwolfe has joined #ruby
n0m4d1c has quit [Remote host closed the connection]
leitz has quit [Quit: Nappy time]
Zaab1t has quit [Quit: Zaab1t]
roobie has quit [Quit: Leaving]
dionysus69 has quit [Ping timeout: 255 seconds]
karapetyan has quit [Remote host closed the connection]
Puffball has quit [Remote host closed the connection]
dcunit3d has quit [Ping timeout: 265 seconds]
FrostCandy has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
venmx has quit [Ping timeout: 240 seconds]
aintno_sunshine has joined #ruby
alfiemax has quit [Ping timeout: 256 seconds]
eckhardt has joined #ruby
pastorinni has joined #ruby
ur5us has joined #ruby
ta_ has joined #ruby
marxarelli has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
[Butch] has quit [Quit: Textual IRC Client: www.textualapp.com]
netherwolfe has quit [Ping timeout: 240 seconds]
hkais has joined #ruby
netherwolfe has joined #ruby
ta_ has quit [Quit: Leaving...]
dcunit3d has joined #ruby
sidx64 has joined #ruby
ur5us has quit [Read error: No route to host]
ur5us has joined #ruby
sidx64_ has joined #ruby
synthroid has quit []
papua has joined #ruby
sidx64 has quit [Ping timeout: 240 seconds]
jeffreylevesque has quit [Ping timeout: 276 seconds]
minimalism has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
dr3w_ has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
dr3w_ has quit [Client Quit]
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
dr3w_ has joined #ruby
ski7777 has quit [Ping timeout: 246 seconds]
dr3w_ has quit [Client Quit]
ta_ has joined #ruby
pork13_ has quit [Quit: Connection closed for inactivity]
Exagone313 has quit [Ping timeout: 276 seconds]
grilix_ has quit [Ping timeout: 240 seconds]
VladGh_ has quit [Ping timeout: 260 seconds]
phaul has quit [Ping timeout: 256 seconds]
ged has quit [Read error: Connection reset by peer]
ged has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
ta_ has quit [Ping timeout: 265 seconds]
ldnunes has quit [Quit: Leaving]
karapetyan has joined #ruby
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
jeremati_ has joined #ruby
cyberg has quit [Ping timeout: 240 seconds]
karapetyan has quit [Ping timeout: 256 seconds]
hackeron has joined #ruby
alfiemax has joined #ruby
alex`` has quit [Ping timeout: 256 seconds]
jerematic has quit [Ping timeout: 264 seconds]
<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
cyberg has joined #ruby
<hackeron> popping/adding items without needing to rewrite the entire thing? (it's an SD card so need to minimize data writes)
jeremati_ has quit [Ping timeout: 276 seconds]
<havenwood> hackeron: How about YAML::DBM?
<havenwood> &ri YAML::DBM
<hackeron> havenwood: can that add and remove lines in place and handle a sudden power failure without corrupting the file?
<havenwood> hackeron: it handles the "popping/adding items without needing to rewrite the entire thing" part
<hackeron> but if you happen to yank the power cable during the write, file gone? :(
alfiemax has quit [Ping timeout: 256 seconds]
<havenwood> hackeron: that's a question of how DBM handles it
<havenwood> i don't know DBM well enough to day
<havenwood> say*
<havenwood> hackeron: It *looks like* transactions that are occurring during a power loss will be rolled back
<hackeron> it seems to also be key value pair - so I don't think I can just push and pop items from it?
<havenwood> hackeron: there's probably always a possibility of corruption, dunno ¯\_(ツ)_/¯
<havenwood> hackeron: oh, I see - you just want to push/pop?
<hackeron> yes, so something like Queue.new - but persisted to disk in a reliable/efficient way
\void has quit [Quit: So long, and thanks for all the fish.]
Exagone313 has joined #ruby
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
jottr has quit [Ping timeout: 265 seconds]
aintno_sunshine has quit [Ping timeout: 264 seconds]
<hackeron> hmm, maybe redis, I can trigger save to persist to disk
<havenwood> hackeron: redis or rabbitmq seem reasonable
<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
<havenwood> hackeron: Nerves ftw.
<hackeron> what's that?
<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).
ski7777 has joined #ruby
<havenwood> hackeron: The result is booting a modern rPi in 5 sec, instead of 55 sec.
<havenwood> hackeron: That's super nice if you need to restart a demo, etc.
<hackeron> oh is it? - very interesting, thank you :)
<havenwood> hackeron: It has other great features. Totally worth a look.
<hackeron> does it run on x86_64 as well?
<hackeron> ah, it does, very interesting, thank you, I'll definitely be checking it out!
<hackeron> comes with ruby 2.5.1? :)
workmad3 has joined #ruby
<havenwood> hackeron: Erlang or Elixir ;-P
<havenwood> or any other language on the BEAM
<hackeron> hmm
ur5us has quit [Read error: No route to host]
<hackeron> havenwood: what do you mean by on the BEAM?
ur5us has joined #ruby
<havenwood> hackeron: on the Erlang VM
<havenwood> hackeron: Bogumil’s/Björn’s Abstract Machine (BEAM)
<hackeron> oh, so I can't just run normal MRI?
<havenwood> nope - sorry if I gave that impression
<hackeron> oh :( - sad times
workmad3 has quit [Ping timeout: 256 seconds]
ur5us_ has joined #ruby
k0mpa has quit [Remote host closed the connection]
karapetyan has joined #ruby
char_var[buffer] has quit [Quit: sys.exit(0)]
ur5us__ has joined #ruby
ur5us_ has quit [Read error: No route to host]
noobineer has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
tvw has joined #ruby
ellcs has joined #ruby
sidx64_ has quit [Read error: Connection reset by peer]
ramfjord has quit [Ping timeout: 240 seconds]
dcunit3d has quit [Ping timeout: 256 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roshanavand has quit [Remote host closed the connection]
karapetyan has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
<scwizard> I'm trying to delete all functions from an array of functions, of a certain type
FrostCandy has quit []
<scwizard> if I put them through to_s I get #<fucntionname:0x0000000003bb76e8> for the function in the array
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
<scwizard> and: functionname
<scwizard> for the function itself
erlend has quit [Ping timeout: 264 seconds]
erlend has joined #ruby
cthulchu_ has joined #ruby
netherwolfe has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
gix has joined #ruby
gix- has quit [Ping timeout: 264 seconds]
ellcs has quit [Ping timeout: 256 seconds]
cthulchu has quit [Ping timeout: 256 seconds]
dcunit3d has joined #ruby
orbyt_ has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
inerthia_ has joined #ruby
jottr has joined #ruby
zapata has quit [Quit: WeeChat 2.1]
reber has quit [Remote host closed the connection]
inerthia has quit [Ping timeout: 265 seconds]
zapata has joined #ruby
aintno_sunshine has joined #ruby
aintno_sunshine has quit [Remote host closed the connection]
mattp__ has quit [Read error: Connection reset by peer]
mattp__ has joined #ruby
dcunit3d has quit [Ping timeout: 256 seconds]
dcunit3d has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
Psybur_ has joined #ruby
cliluw has quit [Ping timeout: 256 seconds]
Psybur has quit [Ping timeout: 268 seconds]
cliluw has joined #ruby
VladGh has joined #ruby
asdfasdf_ has joined #ruby
Mike11 has quit [Quit: Leaving.]
mroutis has joined #ruby
<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 ?
scwizard has quit [Ping timeout: 260 seconds]
tolerablyjake has joined #ruby
asdfasdf_ has quit [Quit: Page closed]
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
amar has quit [Remote host closed the connection]
venmx has joined #ruby
amar has joined #ruby
hkais has quit [Ping timeout: 268 seconds]
chouhoulis has quit [Ping timeout: 240 seconds]
justinfaler has joined #ruby
<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?`
<chaos95> each method tests between 2-6 of these before embarking on its actual functionality
jottr has joined #ruby
<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
VladGh has quit [Ping timeout: 260 seconds]
tvw has quit [Ping timeout: 256 seconds]
VladGh has joined #ruby
whathappens has joined #ruby
amar has quit [Ping timeout: 256 seconds]
icarus has quit [Ping timeout: 265 seconds]
jottr has quit [Ping timeout: 256 seconds]
clemens3_ has quit [Ping timeout: 240 seconds]
dcunit3d has quit [Quit: WeeChat 1.4]
noobineer has quit [Remote host closed the connection]
bmurt has joined #ruby
n008f4g_ has quit [Ping timeout: 265 seconds]
karapetyan has joined #ruby
darkhanb has joined #ruby
karapetyan has quit [Ping timeout: 260 seconds]
venmx has quit [Ping timeout: 265 seconds]
shinnya has joined #ruby
mahlon_ has joined #ruby
ErhardtMundt has quit [Quit: No Ping reply in 180 seconds.]
byte512 has quit [Ping timeout: 246 seconds]
mahlon has quit [Ping timeout: 246 seconds]
cpallares has quit [Ping timeout: 246 seconds]
volix has quit [Ping timeout: 246 seconds]
volix has joined #ruby
ErhardtMundt has joined #ruby
byte512 has joined #ruby
cpallares has joined #ruby
John_Ivan has quit [Read error: Connection reset by peer]
physicist__ has quit [Quit: leaving]
alfiemax has joined #ruby
cadillac_ has quit [Ping timeout: 256 seconds]
darkhanb has quit [Quit: Textual IRC Client: www.textualapp.com]
jeffreylevesque has joined #ruby
cadillac_ has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
Dimik has joined #ruby
dr3w_ has joined #ruby
workmad3 has joined #ruby
Psybur has joined #ruby
jordanm has quit [Quit: Konversation terminated!]
ryzokuken has quit [Remote host closed the connection]
jottr has joined #ruby
oncall-pokemon has quit [Quit: Connection closed for inactivity]
Psybur_ has quit [Ping timeout: 264 seconds]
workmad3 has quit [Ping timeout: 265 seconds]
<mroutis> what are you using for testing, chaos95 ?
jottr has quit [Ping timeout: 246 seconds]
n0m4d1c has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
cliluw has quit [Ping timeout: 260 seconds]
cliluw has joined #ruby
<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
Yxhuvud has joined #ruby
<chaos95> mroutis: it's been written in what I would describe as a highly.. defensive style.
cthu| has joined #ruby
<mroutis> why won't you encapsulate that logic into a function and just call it?
darkhanb has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]