#ruby - 23 July 2018
« Back 1 day Forward 1 day »
[08:32:02] fsmauri21: What is the point of having a constant in Ruby when you can change it's value anyways?
[08:34:21] fsmauri21: I'm testing it out in IRB, and I get that I can make test as var, I can make Test as a constant, but it won't let me make TEST as a new constant. Any reason why it does so?
[08:46:41] ColeW_Picaro: Anyone here use the twitter ruby gem? I made a twitter bot and I need it to collect all of my tweets, but when I grab the text of some tweets (the full_text attribute), some get cut off short with a "..." instead of the whole tweet.
[08:49:04] havenwood: FsMauri21: You should be able to reassign TEST, but it'll give you a warning and it's best to avoid.
[08:49:37] havenwood: FsMauri21: Ruby lets you do all sorts of things, but we choose to no reassign constants by convention.
[16:07:38] mensvaga: rubygem-deep_merge.noarch for EL, and ruby-deep-merge for deb is apparently what I need to investigate for that.
[16:09:00] mensvaga: Also, https://ruby-doc.org/core-2.1.2/Hash.html - A Hash is a dictionary-like collection of unique keys and their values. Also called associative arrays... ;)
[17:14:29] JJonah: we use gems to share domain code across different projects. sometimes i need to make an update to a project, which also requires a gem update. when doing this, i need to change both the gem and, say, a rails project simultaneously. so i'll clone the gem into the `lib` dir, specify that local path temporarily in the rails project Gemfile, and make changes until my tests pass. Then I'll publish my gem changes, change the rails
[17:14:29] JJonah: Gemfile to point back to the actual gem (rather than the local copy), test again, and finally publish the changes to the rails project. this feels inefficient and because of that discourages the team from using gems even they are appropriate. is there a better solution for developing projects with gem deps?
[17:30:41] apeiros_: JJonah: https://rossta.net/blog/how-to-specify-local-ruby-gems-in-your-gemfile.html - I prefer the `bundle config local` way: https://rossta.net/blog/how-to-specify-local-ruby-gems-in-your-gemfile.html#-quot-bundle-config-local-quot-to-the-rescue
[17:55:03] JJonah: apeiros_: thanks. your preferred solution seems like an improvement. In the article they set the Gemfile to point to the github repo: `gem "tacokit", github: "rossta/tacokit", branch: "master"`. Would you typically change this back to just `gem 'tacokit'` after republishing the gem? Or is a valid approach to just leave the gem hosted on gh and not bother?
[18:09:07] apeiros_: JJonah: if it's a gem I publish I'd never set it to github. I'd use the local override.
[18:09:22] ruby[bot]: +bbbb chouhoulis!*@*$#ruby-fix-your-connection chouhoul_!*@*$#ruby-fix-your-connection chouhou__!*@*$#ruby-fix-your-connection chouho___!*@*$#ruby-fix-your-connection
[18:09:22] ruby[bot]: +bb chouh____!*@*$#ruby-fix-your-connection *!*@50-207-64-46-static.hfc.comcastbusiness.net$#ruby-fix-your-connection
[18:10:38] apeiros_: JJonah: I/we only use repo paths in our gemfile for gems we never publish. and even there we're actually switching towards just gem and having our own gem server (geminabox iirc).
[18:13:01] apeiros_: we don't use github for that, no. you can use any repo path in your gemfile. you can even make abbreviations in the same way `github:` kwarg works there.
[19:39:42] scrptktty: How do I delete one specific gem and reinstall it? I am guessing deleting my `Gemfile.lock` is over-kill :X
[19:41:45] elomatreb: `gem uninstall gemname` uninstalls a gem, bundle install will then install it again
[19:45:46] elomatreb: If it's a bundle gem you may need to prefix with `bundle exec ` to get it to load your environment correctly
[19:46:58] scrptktty: I switched the order of the require paths and ran `bundle exec` and that worked!
[19:48:35] scrptktty: Is there a good blog post explaining how bundle works? I would like to know *why* `bundle exec` solves the problem.
[19:49:18] elomatreb: You may have a look through the bundler docs (https://bundler.io/docs.html), but I don't know if there is a comprehensive article like that, sorry
[19:49:50] elomatreb: In short it basically forces the command after the exec to actually and only use the gems defined in the gemfile, as opposed to mixing and matching with other gems that just happen to also be installed on the machine
[19:51:12] havenwood: scrptktty: If you just run the app directly, it'll use the newest version of each gem. If you prefix `bundle exec`, it'll instead use the exact versions for each gem that are specified in the Gemfile.lock.
[20:21:15] baweaver: especially after that region figured out they could use those domains to rake money out of the valley
[20:22:41] elomatreb: Except it's not actually the region that is getting the money, it's some shell corporation
[21:40:49] chrisseaton: Would anyone be interested in reviewing a RubyConf talk proposal for me? Could do with some completely external opinions on it.
[22:00:00] havenwood: That reminds me I need to work on a proposal or two myself. CFPs due July 31! https://cfp.rubycentral.org/events/rubyconf2018