#ruby - 15 May 2018
« Back 1 day Forward 1 day »
[02:36:09] kegan_: which is the apparent outcome of putting it into a puts statement with + concatenation with another strong
[02:54:13] ruby[bot]: havenwood: # => String can't be coerced into Fixnum (TypeError) ...check link for more (https://eval.in/1004076)
[02:56:39] ruby[bot]: havenwood: # => /tmp/execpad-a9c844a20409/source-a9c844a20409:2: warning: class variable access from toplevel ...check link for more (https://eval.in/1004077)
[02:57:50] havenwood: kegan_: If you can show your code we can probably give you some good suggestions.
[09:09:48] dachi: Hello. Could you tell how to set rejectUnauthorized to false, or in other words openssl_verify_mode to OpenSSL::SSL::VERIFY_NONE in Net::SMTP? https://ruby-doc.org/stdlib-2.0.0/libdoc/net/smtp/rdoc/Net/SMTP.html
[09:41:35] Abhijit: i am trying to use this module https://www.rubydoc.info/gems/toml-rb/0.3.0/TOML i did not installed any extra libraries. when i tyr to do TOML.parse(content) in my irb it says NoMethodError: undefined method `parse' for TOML:Module
[09:46:56] dminuoso: toml-rb and toml are different things (which is why 1.0.0 in toml-rb changed the namespace to avoid namespace conflicts)
[09:49:04] Abhijit: elomatreb, dminuoso this code gives me error https://paste.ubuntu.com/p/ZH8Y2vj4Yq/
[09:49:54] dminuoso: Abhijit: Also you should probably upgrade your toml-rb if you also want to use toml
[10:01:07] elomatreb: You also need to change the module constant. It got renamed to `TomlRb`. The docs you linked to are from an outdated version.
[13:00:45] apeiros: I assume that's not even the full statement? given that `= if` is not suffix-if…
[14:38:51] apeiros: if you want to work with binary data, use binary encodings, for both your target string and your regex.
[15:15:16] havenwood: I wrote an article about the new `exception: false` and `exception: true` kwargs for #system, #Integer, etc: https://medium.com/square-corner-blog/rubys-new-exception-keyword-arguments-4d5bbb504d37
[16:13:55] Hashirama: hey beginner programmer here — looking at a private rails repo and I am seeing something like "result = ::Foo::Bar.meth(" just trying to understand what the colons mean. Unfortunately, I am not sure how I can google such a thing without knowing what it is.
[16:16:28] Hashirama: I think the prefixing `::` is throwing me off I bet thats something to do with relative paths
[16:16:56] NL3limin4t0r: Hashirama: The prefixed `::` indicates that you navigate namespaces from root.
[16:17:40] dminuoso: Hashirama: So every constant gets tossed in there. `::Foo` is basically a way to access Object::Foo rather than say some `Foo` from your current nesting
[16:54:22] tbuehlmann: havenwood: that's not fully present 2.6.0-preview1, is that right? getting an error for Integer('not-a-number', exception: false)
[16:54:55] havenwood: tbuehlmann: It didn't make it into the preview1, but it'll be in the preview2. I should have mentioned that.
[16:57:25] havenwood: I have a script to install nightly ruby, but it's macOS-specific: https://gist.github.com/havenwood/823382815cbdcfddadd798d4042023a8
[16:58:10] havenwood: I guess I could switch to a script that builds it with ruby-install easy enough.
[16:58:48] tbuehlmann: I just searched for a way to install a nightly build via ruby-install, but it seems to be an anti feature
[17:00:33] havenwood: tbuehlmann: you can do it easy enough by pointing at the nightly url, but yeah, postmodern wanted to keep it simple by supporting stable releases
[17:01:27] regedit: if i'm using a gem like Unirest and i know i'm gonna be placing hundreds of HTTP requests to a given 3rd party, do i have to do anything to care about persistent connection / keep alive?
[17:06:20] ruby[bot]: +bbb $a:jongley$#ruby-banned jongley!*@*$#ruby-banned *!*@gateway/web/freenode/ip.18.104.22.168$#ruby-banned
[17:06:22] ruby[bot]: ruby[bot] kicked jongley: offense, see http://ruby-community.com/pages/user_rules
[17:07:40] havenwood: regedit: Here's a list of HTTP clients that's in sore need of updating: https://docs.google.com/spreadsheets/d/1vPlk6nMIFa3sI5ISl7zZ5r6lDNpVQX6Jxi3ksXCyVbs/edit?usp=sharing
[17:08:58] havenwood: regedit: RestClient doesn't support keep-alive. Consider switching to something like Typhoeus, where you can do parallel requests.
[17:09:41] havenwood: regedit: If you just want keep-alive, the http gem is nice: https://github.com/httprb/http
[17:10:26] havenwood: regedit: Typhoeus is a libcurl wrapper that makes parallel requests really easy with "hydra": https://github.com/typhoeus/typhoeus
[17:10:41] havenwood: regedit: If you want to do a bunch of requests really fast, it's a good way to go.
[17:10:54] regedit: i'm gonna be interacting with an API, processing hundreds of records, each one its own API call
[17:11:09] baweaver: eam: How much C would one need to understand to grok this?: https://github.com/google/protobuf/pull/3606/files
[17:49:09] deadmund: What is the require line I need so that I can write a script that uses this module? https://github.com/chadrem/market_bot I’m trying to replicate the “App API example” given in the readme for that project but I am getting “uninitialized constant MarketBot (NameError)” Thanks in advance!!
[18:19:05] deadmund: I had to “require” the name of the module. It took some guess and check. In my case it was “market_bot”
[18:33:33] tbuehlmann: cagomez: https://github.com/rails/rails/blob/v5.2.0/activerecord/lib/active_record/timestamp.rb#L84-L108
[18:35:00] cagomez: tbuehlmann: what I'm trying to do is create models with `.new`, but also set their `created_at` and `updated_at` columns
[18:55:29] tuskkk___: need some help with rails, have a form from a custom class, need a dropdown there from one of the fields in a model...
[19:02:52] ruby[bot]: tuskkk___: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[19:03:36] ruby[bot]: tuskkk___: Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
[19:04:04] apeiros: but really, this isn't the right channel for rails questions. please keep them over there.
[19:55:02] BubonicPestilenc: I have a question: in most cases, i do "scan(/...(x).../).flatten.first"
[19:55:28] BubonicPestilenc: but are there any alternative to .flatten.first? One i know is .dig(0, 0)
[19:56:12] elomatreb: If you just want to get at the first matching group, I like using the  method with a regex on string
[19:58:14] ruby[bot]: Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
[20:10:06] ruby[bot]: +bb squishyj!*@*$#ruby-banned *!*@unaffiliated/veonik/bot/squishyj$#ruby-banned
[23:21:58] audy: where does rails' 1.day.ago methods come from? I thought they were in active_support but I was wrong :(
[23:31:45] Radar: audy: https://github.com/rails/rails/blob/5-2-stable/activesupport/lib/active_support/core_ext/numeric/time.rb#L37-L40
[23:57:39] Echo6: New to ruby, I'm trying to install rake so I can compile this, https://github.com/qcam/3llo