« Back to channel list

#ruby - 06 November 2018

« Back 1 day Forward 1 day »
[00:07:16] TheBloke: has joined #ruby
[00:12:24] patr0clus: has joined #ruby
[00:27:15] za1b1tsu: has joined #ruby
[00:32:38] elphe: has joined #ruby
[00:54:15] eckhardt: has joined #ruby
[00:55:55] mangold: has joined #ruby
[01:03:15] Cork: has joined #ruby
[01:18:20] mangold: has joined #ruby
[01:21:47] Fusl: has joined #ruby
[01:28:32] bmurt: has joined #ruby
[01:33:47] weaksauce: has joined #ruby
[01:37:56] tdy: has joined #ruby
[01:41:01] gigetoo: has joined #ruby
[01:41:02] mangold: has joined #ruby
[01:48:20] orbyt_: has joined #ruby
[02:07:04] creat: has joined #ruby
[02:07:24] tpendragon: has joined #ruby
[02:07:29] KramerC: has joined #ruby
[02:08:56] Fusl: has joined #ruby
[02:15:16] za1b1tsu: has joined #ruby
[02:16:14] arescorpio: has joined #ruby
[02:16:53] kapil____: has joined #ruby
[02:17:26] mangold: has joined #ruby
[02:22:15] jyaworski: has joined #ruby
[02:26:31] DTZUZO: has joined #ruby
[02:30:17] esrse: has joined #ruby
[02:32:17] d10n-work: has joined #ruby
[02:32:22] bga57: has joined #ruby
[02:35:52] ivanskie: has joined #ruby
[02:44:37] elphe: has joined #ruby
[02:44:49] Demos[m]: has joined #ruby
[02:46:11] bastilian: has joined #ruby
[02:50:49] jonjitsu: has joined #ruby
[02:53:13] turt2live: has joined #ruby
[03:06:09] elphe: has joined #ruby
[03:21:10] za1b1tsu: has joined #ruby
[03:34:59] mangold: has joined #ruby
[03:35:52] Cork: has joined #ruby
[04:02:19] SeepingN: has joined #ruby
[04:09:48] braincrash: has joined #ruby
[04:10:16] darkhanb: has joined #ruby
[04:24:12] _whitelogger: has joined #ruby
[04:28:56] jonjitsu: has joined #ruby
[04:29:24] Demos[m]: has joined #ruby
[04:30:03] bastilian: has joined #ruby
[04:31:48] turt2live: has joined #ruby
[04:33:34] mangold: has joined #ruby
[04:48:30] sauvin: has joined #ruby
[04:54:41] sanscoeur: has joined #ruby
[05:03:22] _whitelogger: has joined #ruby
[05:08:36] ged: has joined #ruby
[05:09:22] mahlon: has joined #ruby
[05:18:58] elphe: has joined #ruby
[05:32:01] sanscoeur: has joined #ruby
[05:33:24] ivanskie: has joined #ruby
[05:39:36] alicef: has joined #ruby
[05:48:38] Dbugger: has joined #ruby
[05:51:30] ivanskie: has joined #ruby
[05:56:59] ansraliant: has joined #ruby
[06:02:32] reber: has joined #ruby
[06:15:15] Nicmavr: has joined #ruby
[06:19:09] phaul: has joined #ruby
[06:21:11] OrangeManBad: has joined #ruby
[06:29:45] elphe: has joined #ruby
[06:35:58] conta: has joined #ruby
[06:36:29] eckhardt: has joined #ruby
[06:45:52] Jonno_FTW: has joined #ruby
[06:46:01] Jonno_FTW: how do I insert a literal {{ and }}
[06:48:33] Jonno_FTW: has left #ruby: ()
[06:56:36] xall: has joined #ruby
[07:25:15] aufi: has joined #ruby
[07:31:49] drale2k_: has joined #ruby
[07:43:21] patr0clus: has joined #ruby
[07:57:38] sameerynho: has joined #ruby
[07:58:18] sina: has joined #ruby
[08:09:01] kapil____: has joined #ruby
[08:11:11] clemens3: has joined #ruby
[08:19:42] leitz: has joined #ruby
[08:21:15] Hobbyboy: has joined #ruby
[08:30:51] vondruch: has joined #ruby
[08:35:51] kent\n: has joined #ruby
[08:37:19] ntt: has joined #ruby
[08:37:36] ntt: Hi, I'm trying to use Devise and I'd like to know if it is possible to use current_user in before_action? basically I added an attribute (.admin) to the model User, and I'd like to use something similar to "before_action current_user.admin?". Please, someone can give me some advice? Thank you
[08:40:56] tbuehlmann: ntt: yes, you can use current_user in a before_action
[08:43:09] gix: has joined #ruby
[08:43:15] ntt: tbuehlmann: actually I have an error: "undefined local variable or method `current_user' for ContractCategoriesController:Class". My syntax is: "before_action current_user.admin?, except: [:show, :index]"
[08:44:13] tbuehlmann: you're using before_action wrong
[08:44:30] ntt: how can I solve?
[08:44:59] tbuehlmann: see https://guides.rubyonrails.org/action_controller_overview.html#filters
[08:45:30] ntt: ok, so I have to define a method in the application controller
[08:47:09] marmotini_: has joined #ruby
[08:52:47] ntt: tbuehlmann: I'm trying but it seems that if my private method in the application controller returns false, before_action doesn't consider this
[08:53:05] tbuehlmann: consider what?
[08:55:16] ntt: if the private method returns false, I'd like that CRUD actions will not be permitted
[08:57:22] tbuehlmann: returning false doesn't do anything. you need to render or redirect in order to avoid running the action
[08:57:39] tbuehlmann: it's in the example on https://guides.rubyonrails.org/action_controller_overview.html#filters
[08:58:05] ntt: ok... I'm sorry
[09:08:36] sameerynho: has joined #ruby
[09:18:29] lxsameer: has joined #ruby
[09:23:36] marmotini_: has joined #ruby
[09:30:13] _whitelogger: has joined #ruby
[09:38:33] mangold: has joined #ruby
[09:40:48] drale2k_: has joined #ruby
[09:41:04] norfumpit: has joined #ruby
[09:52:17] venmx: has joined #ruby
[09:59:01] teclator: has joined #ruby
[10:01:58] AntoineLp: has joined #ruby
[10:05:14] xfbs: has joined #ruby
[10:06:35] AntoineLp: has joined #ruby
[10:14:03] hightower4: has joined #ruby
[10:19:54] cd: has joined #ruby
[10:37:03] deadnull: has joined #ruby
[10:43:45] queip: has joined #ruby
[10:44:18] Bish: has joined #ruby
[10:44:49] Bish: i have a thingie in my code which looks like this
[10:44:57] Bish: use_cache! if File.basename($PROGRAM_NAME) == 'client_api_server'
[10:45:10] Bish: i switched to unicorn as a webserver, and this says "unicorn" now
[10:46:25] Bish: is there a clever way to find out what i started?
[10:55:50] AntoineLp: has joined #ruby
[11:00:22] TheBloke: has joined #ruby
[11:11:26] conta: has joined #ruby
[11:25:48] G: has joined #ruby
[11:45:45] themsay: has joined #ruby
[11:46:33] mangold: has joined #ruby
[11:53:53] moei: has joined #ruby
[11:58:07] deadnull: has joined #ruby
[11:59:34] im0nde: has joined #ruby
[12:22:22] deadnull: has joined #ruby
[12:22:49] dbugger_: has joined #ruby
[12:46:28] dinfuehr: has joined #ruby
[12:46:34] deadnull: has joined #ruby
[12:48:47] AJA4350: has joined #ruby
[13:01:40] apparition: has joined #ruby
[13:07:44] dinfuehr: has joined #ruby
[13:12:48] JamieD: has joined #ruby
[13:17:25] cow[moo]: has joined #ruby
[13:18:16] hightower4: Bish you can compare with value of $0
[13:21:41] wildermind: has joined #ruby
[13:28:22] Dbugger: has joined #ruby
[13:28:57] houhoulis: has joined #ruby
[13:30:23] dbugger_: has joined #ruby
[13:35:32] elphe: has joined #ruby
[13:36:31] dbugger__: has joined #ruby
[13:43:26] Dbugger: has joined #ruby
[13:47:52] bmurt: has joined #ruby
[13:48:57] dbugger_: has joined #ruby
[13:54:35] queip: has joined #ruby
[13:55:54] Bish: hightower4: which is equivalent to $PROGRAM_NAME
[14:03:29] aufi: has joined #ruby
[14:15:07] dachi: has joined #ruby
[14:17:37] mangold: has joined #ruby
[14:25:38] Guest70792: has joined #ruby
[14:34:22] havenwood: Bish: You could run unicorn with `rackup`, but then it'll just be the path to rackup executable. If you put `PROGRAM_NAME = $0.dup` in http_server.rb, you could get at that, but again it'd be path to the unicorn executable.
[14:34:38] conta: has joined #ruby
[14:40:12] havenwood: Bish: How's it run when you don't want to? use_cache!
[14:46:32] havenwood: Bish: Maybe something like: %w[client_api_server rackup unicorn].include? File.basename $PROGRAM_NAME[/\A\S+/]
[14:51:04] vondruch: has joined #ruby
[14:51:36] vondruch: has joined #ruby
[14:52:07] GodFather: has joined #ruby
[14:56:29] queip: has joined #ruby
[15:05:33] Inline: has joined #ruby
[15:06:41] donofrio: has joined #ruby
[15:09:16] lxsameer: has joined #ruby
[15:16:50] cxl: has joined #ruby
[15:18:04] d10n-work: has joined #ruby
[15:20:28] rippa: has joined #ruby
[15:22:06] mangold: has joined #ruby
[15:37:30] Rapture: has joined #ruby
[15:42:29] roshanavand: has joined #ruby
[15:46:49] eddof13: has joined #ruby
[15:47:53] eddof13: has joined #ruby
[15:50:07] conta: has joined #ruby
[15:57:46] OrangeManBad: has joined #ruby
[15:58:06] lxsameer: has joined #ruby
[15:59:30] endemic: has joined #ruby
[16:01:13] Fusl: has joined #ruby
[16:01:16] eddof13: has joined #ruby
[16:01:44] emerson: has joined #ruby
[16:07:10] ivanskie: has joined #ruby
[16:08:54] kapil____: has joined #ruby
[16:13:27] ChanServ: +o havenwood
[16:21:54] Azure: has joined #ruby
[16:22:15] alicef: has joined #ruby
[16:34:03] chouhoulis: has joined #ruby
[16:35:47] yxhuvud: has joined #ruby
[16:38:35] Lytol: has joined #ruby
[16:46:01] Rapture_: has joined #ruby
[16:46:19] abrausch: has joined #ruby
[16:46:57] mostlybadfly: has joined #ruby
[16:47:18] dinfuehr_: has joined #ruby
[16:55:30] Nicmavr: has joined #ruby
[16:56:46] alicef: has joined #ruby
[16:57:39] MyMind: has joined #ruby
[17:07:42] johnny56: has joined #ruby
[17:10:59] havenwood: https://www.ruby-lang.org/en/news/2018/11/06/ruby-2-6-0-preview3-released/
[17:14:21] Inside: I'm still running 2.4 and rails 4.2 here
[17:18:42] blackmesa: has joined #ruby
[17:20:03] darkhanb: has joined #ruby
[17:26:02] alicef: has joined #ruby
[17:27:31] craftytech: has joined #ruby
[17:29:37] craftytech: hello folks: does anyone know how to start puma server in debug mode? Is it something configured in puma.rb??
[17:29:57] impermanence: has joined #ruby
[17:32:15] havenwood: craftytech: puma --debug
[17:32:39] havenwood: ruby-install --latest ruby-2.6.0-preview3
[17:32:50] ChanServ: -o havenwood
[17:34:07] craftytech: oh great... thanks @havenwood, I'll give that a try
[17:36:52] orbyt_: has joined #ruby
[17:55:08] sanscoeur: has joined #ruby
[17:56:20] eckhardt: has joined #ruby
[18:08:31] johnny56: has joined #ruby
[18:09:43] alicef: has joined #ruby
[18:13:05] lxsameer: has joined #ruby
[18:16:12] k0mpa: has joined #ruby
[18:17:46] za1b1tsu: Hello, do I have to run rubygems-bundler for each ruby version I have installed?
[18:19:31] za1b1tsu: oh is it compatible cu rbenv??
[18:20:05] havenwood: za1b1tsu: Don't want to type `bundle exec`?
[18:23:57] moei: has joined #ruby
[18:27:16] za1b1tsu: for almsot a year I didn't know I had to
[18:27:29] za1b1tsu: I am switching from rvm to rbenv
[18:27:49] za1b1tsu: automatic my setup in ansible and I encounter issues I never know I had
[18:29:55] havenwood: za1b1tsu: You can use rubygems-bundler outside of RVM, but I don't. I guess I just like explicit more than I dislike typing `bundle exec`.
[18:30:56] havenwood: za1b1tsu: https://i.imgur.com/2Hlpoov.png
[18:32:40] dmitch: has joined #ruby
[18:38:22] Guest70792: has joined #ruby
[18:58:47] patr0clus: has joined #ruby
[18:59:36] OrangeManBad: has joined #ruby
[19:04:22] despai: has joined #ruby
[19:07:38] mroutis: has joined #ruby
[19:14:40] xfbs: has joined #ruby
[19:23:04] rwb: has joined #ruby
[19:23:43] wildermind: has joined #ruby
[19:29:45] xfbs: has joined #ruby
[19:39:34] macaronus: has joined #ruby
[19:54:10] fiftysix: has joined #ruby
[19:54:53] voelzmo: has joined #ruby
[19:55:10] fiftysix: i just noticed writing "private def foo; end" compiles, so it's not illegal. but does it mean "make method foo private"? or does it still make all following methods private?
[19:56:07] ur5us: has joined #ruby
[19:56:53] vondruch: has joined #ruby
[19:57:07] mochiyoda: just that one. def returns a symbol, so you're just making that method private ala: "private :foo"
[19:57:12] voelzmo: Hey, not sure where to ask this, so maybe someone knows where to better address this: We have been programmatically trying to figure out if a new version of ruby has been released by looking at http://cache.ruby-lang.org/pub/ruby/index.txt but it seems it hasn't been updated for e.g. 2.4.5. Any reason or any better way to check for new ruby versions and get their link+sha?
[19:57:59] vondruch: has joined #ruby
[19:59:31] fiftysix: mochiyoda, thanks :) ... that's actually useful then!
[19:59:49] mochiyoda: fiftysix: 👍
[20:00:01] xfbs: has joined #ruby
[20:02:21] ptx0: has joined #ruby
[20:04:49] za1b1tsu: has joined #ruby
[20:06:32] niceperl: has joined #ruby
[20:13:38] synaps3: has joined #ruby
[20:15:18] havenwood: voelzmo: One option would be to use the ruby-versions repo, which ruby-install consumes for Ruby metadata: https://github.com/postmodern/ruby-versions
[20:16:30] voelzmo: @havenwood ah, I didn't know that repo before, thanks!
[20:16:34] havenwood: voelzmo: A while ago I needed something similar, and used the FTP mirror to get at it: https://gist.github.com/havenwood/4395461
[20:16:38] voelzmo: I'll have a look real quick
[20:16:44] kaleido: what's the current favorite web micro framework? and sorry if this is off topic.
[20:16:51] havenwood: kaleido: <3 Roda
[20:17:21] havenwood: voelzmo: ruby-versions has the md5, sha1, sha256 and sha512 - and the dl url can be composed from the version
[20:17:48] kaleido: havenwood thanks, i'll take a look.
[20:17:57] havenwood: kaleido: It's really, really nice. :)
[20:18:26] havenwood: kaleido: If you want something more Rails-inspired, Hanami is another nice option: https://hanamirb.org/
[20:18:45] voelzmo: @havenwood this looks pretty much like what I was looking for, thanks!
[20:18:46] havenwood: kaleido: I love Roda's simplicity, being just a routing tree with optional plugins: http://roda.jeremyevans.net/
[20:18:52] havenwood: voelzmo: You're welcome!
[20:19:29] voelzmo: @havenwood as a bonus question: do you have any idea what happened to updating http://cache.ruby-lang.org/pub/ruby/index.txt
[20:19:38] voelzmo: last update was on july 10th this year
[20:19:46] voelzmo: until then this worked nicely for us
[20:20:22] havenwood: voelzmo: I don't know why it doesn't always get updated. I think this has happened before. I'm not sure what's the matter.
[20:21:54] voelzmo: okay, thanks. We'll just switch to https://github.com/postmodern/ruby-versions and update our CI
[20:28:54] mochiyoda: has joined #ruby
[20:30:16] SeepingN: has joined #ruby
[20:32:45] roshanavand: has joined #ruby
[20:39:55] roshanavand: has joined #ruby
[20:47:20] alicef: has joined #ruby
[20:50:14] xfbs_: has joined #ruby
[20:54:22] dviola: has joined #ruby
[20:56:04] eddof13: has joined #ruby
[20:58:17] xfbs: has joined #ruby
[20:58:33] elphe: has joined #ruby
[21:01:10] GodFather: has joined #ruby
[21:01:24] despai: has joined #ruby
[21:04:06] dtzuzu: has joined #ruby
[21:06:28] mochiyoda: has joined #ruby
[21:07:51] nicesignal: has joined #ruby
[21:09:45] nicolasb: has joined #ruby
[21:13:26] za1b1tsu: has joined #ruby
[21:18:06] blackmesa: has joined #ruby
[21:21:26] patr0clus: has joined #ruby
[21:24:04] Xeago_: has joined #ruby
[21:27:31] mroutis: has joined #ruby
[21:27:40] nchambers: has joined #ruby
[21:31:32] dmgk: has joined #ruby
[21:36:00] segy: has joined #ruby
[21:45:19] elphe: has joined #ruby
[21:45:48] rwb: has joined #ruby
[21:49:29] biberao: has joined #ruby
[21:54:03] Guest70792: has joined #ruby
[21:59:28] eckhardt: has joined #ruby
[22:00:15] stooj: has joined #ruby
[22:03:49] bauruine: has joined #ruby
[22:07:23] biberao: hi, any good reading for starting with Ruby?
[22:09:54] havenwood: biberao: here are a few books: https://gist.github.com/baweaver/57a7c8296ca2c03effbd8fac1e7f6b40#learning-ruby
[22:10:11] havenwood: biberao: and more links: https://ruby-community.com/pages/links
[22:10:28] havenwood: biberao: and a few more: https://www.ruby-lang.org/en/documentation/
[22:10:44] havenwood: biberao: Feel free to ask questions here!
[22:11:16] havenwood: biberao: If you're familiar with REPLs, Ruby has great ones. I'd suggest getting started with irb or pry early.
[22:11:19] ruby[bot]: irb is "interactive ruby", it is part of ruby. You can run ruby code and see results immediately. it's useful for testing code. Also see ?pry, a gem which is a popular alternative to irb.
[22:11:21] ruby[bot]: Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
[22:13:42] niceperl: has joined #ruby
[22:14:39] biberao: havenwood: im learning im a novice
[22:14:54] havenwood: biberao: Welcome to Ruby!
[22:16:21] SeepingN: has joined #ruby
[22:18:17] havenwood: biberao: Do you have Ruby installed yet?
[22:18:44] havenwood: biberao: Awesome, you're ahead of the game!
[22:19:41] clemens3: has joined #ruby
[22:19:53] biberao: it would be cool if it even ran
[22:20:56] lupine: downsides of pry: not in stdlib
[22:22:00] reber: has joined #ruby
[22:22:45] kapil____: has joined #ruby
[22:22:54] biberao: its working :DDD
[22:23:05] reber__: has joined #ruby
[22:25:46] RougeR: has joined #ruby
[22:30:26] yokel: has joined #ruby
[22:31:43] lypsis: has joined #ruby
[22:33:36] fluxAeon: has joined #ruby
[22:36:50] biberao: havenwood: which book would you advise?
[22:49:51] Inside: can you program?
[22:50:00] Inside: ie: do you have previous experience in any other language?
[22:53:35] biberao: Inside: a bit ya
[22:53:52] mroutis: has joined #ruby
[22:55:50] Inside: what language?
[22:56:11] biberao: some stuff
[22:58:40] Inside: I guess the question is... at what level are you trying to learn it?
[22:58:44] Inside: Just the basic syntax?
[22:58:49] Inside: or design patterns?
[22:59:41] biberao: but developing a base first
[23:03:09] postmodern: has joined #ruby
[23:04:10] eckhardt: has joined #ruby
[23:07:54] SeepingN: has joined #ruby
[23:09:02] SeepingN_: has joined #ruby
[23:14:15] asphyxia: has joined #ruby
[23:15:35] cow[moo]: has joined #ruby
[23:17:38] elphe: has joined #ruby
[23:19:12] alicef: has joined #ruby
[23:20:05] wolfshappen: has joined #ruby
[23:23:15] RiPuk: has joined #ruby
[23:40:27] SeepingN: has joined #ruby
[23:45:49] sanscoeur: has joined #ruby
[23:50:58] chouhoulis: has joined #ruby
[23:57:10] wolfshappen: has joined #ruby
[23:57:42] cow[moo]: has joined #ruby