« Back to channel list

#ruby - 11 May 2018

« Back 1 day Forward 1 day »
[00:01:25] c_my_nick: hm, looks like he is trying to claim active admin is just like it
[00:01:33] c_my_nick: do you think thats accurate?
[00:03:32] audy: never used it
[00:04:47] c_my_nick: because i mean, i am looking at the webpage for it, and it doesnt look like its the same thing at all
[00:05:48] audy: it has this dashboard feature http://demo.activeadmin.info/admin/dashboard
[00:09:41] jenrzzz: has joined #ruby
[00:14:02] dogweather: has joined #ruby
[00:14:47] karapetyan: has joined #ruby
[00:22:28] dogweather: has joined #ruby
[00:25:03] cagomez: has joined #ruby
[00:28:21] LenPayne: has joined #ruby
[00:29:34] LenPayne: has joined #ruby
[00:30:58] alfiemax: has joined #ruby
[00:34:13] herbmillerjr: has joined #ruby
[00:37:27] GodFather: has joined #ruby
[00:41:38] chaos95: has joined #ruby
[00:44:51] amar: has joined #ruby
[00:46:56] variable: has joined #ruby
[00:49:51] tAn: has joined #ruby
[00:50:54] gr33n7007h: has joined #ruby
[00:57:27] houhoulis: has joined #ruby
[01:04:00] roamingdog: has joined #ruby
[01:04:45] roamingdog: has joined #ruby
[01:05:02] eckhardt: has joined #ruby
[01:05:35] roamingdog: has joined #ruby
[01:06:20] roamingdog: has joined #ruby
[01:06:33] houhoulis: has joined #ruby
[01:07:10] roamingdog: has joined #ruby
[01:08:31] mahmutov: has joined #ruby
[01:08:55] mahmutov: has left #ruby: ("Leaving")
[01:10:45] dcunit3d: has joined #ruby
[01:12:38] kurko_: has joined #ruby
[01:13:08] rrichardsr3: has joined #ruby
[01:16:42] veex: has joined #ruby
[01:18:11] jenrzzz: has joined #ruby
[01:18:11] jenrzzz: has joined #ruby
[01:20:42] c0ncealed1: has joined #ruby
[01:21:48] hinbody_: has joined #ruby
[01:24:18] _aeris_: has joined #ruby
[01:25:39] hinbody__: has joined #ruby
[01:26:28] hinbody: has left #ruby: ()
[01:27:40] mroutis: has joined #ruby
[01:28:04] rideh: has joined #ruby
[01:31:53] dogweather: has joined #ruby
[01:38:39] emilford: has joined #ruby
[01:40:13] dinfuehr: has joined #ruby
[01:41:07] ramfjord: has joined #ruby
[01:41:41] ciscam: has joined #ruby
[01:41:52] Axy: has joined #ruby
[01:53:08] nolanv: has joined #ruby
[01:53:26] gizmore: has joined #ruby
[02:02:42] dcunit3d: has joined #ruby
[02:15:12] alfiemax: has joined #ruby
[02:15:30] kapil___: has joined #ruby
[02:15:57] ramfjord: has joined #ruby
[02:24:50] Haradani: has joined #ruby
[02:30:57] jenrzzz: has joined #ruby
[02:31:44] kapil___: How to do string introspection like we do in sql using '?'
[02:33:34] alfiemax: has joined #ruby
[02:36:45] xuanrui: has joined #ruby
[02:37:07] mniip: has joined #ruby
[02:37:37] jordanm: kapil___: can you elaborate on your goal?
[02:39:10] kapil___: jordanm: I want to make a function that replace part of the sring
[02:39:25] n0m4d1c: has joined #ruby
[02:40:17] Pisuke: has joined #ruby
[02:40:17] kapil___: `fun(inputstring, arguments)`
[02:41:33] jordanm: kapil___: inputstring.sub("substring", "replacement")
[02:41:34] kapil___: inputstring will have ? or similar in it. i will fill it with arguments
[02:42:56] jordanm: kapil___: sprintf("foo%s", "bar")
[02:43:53] kapil___: jordanm: can you give more example with multiple argument to sprintf
[02:43:59] graft: has joined #ruby
[02:44:12] jordanm: sprintf("%s%s", "foo", "bar")
[02:45:07] kapil___: thanks that is i required. thanks
[02:45:40] jordanm: no problem
[02:46:02] orbyt_: has joined #ruby
[02:54:58] jenrzzz: has joined #ruby
[03:00:09] cadillac_: has joined #ruby
[03:00:56] roamingdog: has joined #ruby
[03:08:03] tdy: has joined #ruby
[03:11:38] baweaver: kapil___: Don't use that with SQL
[03:11:39] baweaver: Also, you should be using interpolation in Ruby.
[03:12:52] dogweather: has joined #ruby
[03:20:29] tAn: has joined #ruby
[03:24:07] roamingdog: has joined #ruby
[03:25:03] roamingdog: has joined #ruby
[03:25:42] roamingdog: has joined #ruby
[03:26:33] roamingdog: has joined #ruby
[03:27:18] roamingdog: has joined #ruby
[03:32:16] mroutis: has joined #ruby
[03:37:55] GodFather: has joined #ruby
[03:44:25] govg: has joined #ruby
[03:45:39] robertothais: has joined #ruby
[03:46:40] gix-: has joined #ruby
[03:50:16] karapetyan: has joined #ruby
[03:52:21] veex: has joined #ruby
[04:00:06] twe4ked: has joined #ruby
[04:03:19] ciscam: has joined #ruby
[04:04:54] dogweather: has joined #ruby
[04:14:38] alfiemax: has joined #ruby
[04:20:22] russt: has joined #ruby
[04:21:01] dogweather: has joined #ruby
[04:28:40] roamingdog: has joined #ruby
[04:32:01] za1b1tsu_: has joined #ruby
[04:41:31] dogweather: has joined #ruby
[04:46:16] dcunit3d: has joined #ruby
[04:52:02] anisha: has joined #ruby
[04:52:28] amar: has joined #ruby
[05:01:46] veex: has joined #ruby
[05:04:58] anisha: has joined #ruby
[05:05:02] rkazak: has joined #ruby
[05:05:05] roamingdog: has joined #ruby
[05:07:46] dogweather: has joined #ruby
[05:08:59] tomphp: has joined #ruby
[05:10:59] redlegion: has joined #ruby
[05:12:01] aufi: has joined #ruby
[05:17:40] eckhardt: has joined #ruby
[05:18:36] fullstack_: has joined #ruby
[05:19:23] sagax: has joined #ruby
[05:20:17] dogweather: has joined #ruby
[05:23:06] sauvin: has joined #ruby
[05:23:19] roamingdog: has joined #ruby
[05:24:09] roamingdog: has joined #ruby
[05:25:02] roamingdog: has joined #ruby
[05:25:45] roamingdog: has joined #ruby
[05:26:30] roamingdog: has joined #ruby
[05:33:10] dogweather: has joined #ruby
[05:37:38] alex``: has joined #ruby
[05:37:56] n0m4d1c_: has joined #ruby
[05:39:57] Tempesta: has joined #ruby
[05:40:18] conta: has joined #ruby
[05:43:35] dogweather: has joined #ruby
[05:44:14] biberu: has joined #ruby
[05:50:29] dionysus69: has joined #ruby
[05:52:27] tAn: has joined #ruby
[05:52:28] cschneid_: has joined #ruby
[05:56:42] DoubleMalt: has joined #ruby
[06:00:24] andikr: has joined #ruby
[06:00:28] aupadhye: has joined #ruby
[06:04:59] jenrzzz: has joined #ruby
[06:04:59] jenrzzz: has joined #ruby
[06:08:40] dogweather: has joined #ruby
[06:08:44] schleppel: has joined #ruby
[06:13:23] sanscoeur: has joined #ruby
[06:16:01] tAn: has joined #ruby
[06:17:20] shakahl: has joined #ruby
[06:21:24] josealobato: has joined #ruby
[06:30:23] biberu: has joined #ruby
[06:33:56] ciscam: has joined #ruby
[06:34:43] dogweather: has joined #ruby
[06:35:35] jenrzzz: has joined #ruby
[06:35:35] jenrzzz: has joined #ruby
[06:38:56] fyrril2: has joined #ruby
[06:42:12] mohsen_1: has joined #ruby
[06:47:43] dogweather: has joined #ruby
[06:48:52] jenrzzz: has joined #ruby
[06:48:52] jenrzzz: has joined #ruby
[06:53:22] alfiemax: has joined #ruby
[06:53:35] memo1: has joined #ruby
[06:54:28] memo1: hi, working with Threads. Once the thread is dead, is possible to back to life?, something like tr.startagain?
[06:56:31] dminuoso: memo1: What does "dead" mean
[06:56:45] dminuoso: memo1: As in software terminology dead?
[06:56:52] dminuoso: memo1: If so, you're shit out of luck.
[06:57:11] dminuoso: memo1: https://i.stack.imgur.com/sVreJ.jpg
[06:57:41] dminuoso: This is ruthlessly stolen from Java, but things are not so different really
[06:57:55] memo1: dminuoso: when i run the t1=Thread.new {something..} and i inspect t1, it say sleep. Whenn the thrad finish it say dead.
[06:58:20] dminuoso: memo1: Threads are like people.
[06:58:25] dminuoso: If they are asleep you can wake them
[06:58:29] dminuoso: If the are dead you cant undead them.
[06:58:30] memo1: dminuoso: i want to install automatically the command im runing on the thread, if it fails
[06:58:37] dminuoso: But you can make threads just like you can make babies.
[06:59:35] memo1: dminuoso: ok, thank you.
[07:02:35] nima_m: has joined #ruby
[07:02:42] conta: has joined #ruby
[07:03:47] nima_m_: has joined #ruby
[07:04:39] dogweather: has joined #ruby
[07:09:41] vondruch: has joined #ruby
[07:09:46] biberu: has joined #ruby
[07:11:44] amar: has joined #ruby
[07:16:46] nima_m_: has joined #ruby
[07:20:06] donofrio: has joined #ruby
[07:21:50] suukim: has joined #ruby
[07:22:16] nima_m_: has joined #ruby
[07:25:22] blackmesa: has joined #ruby
[07:25:49] clemens3: has joined #ruby
[07:26:20] dogweather: has joined #ruby
[07:26:46] nima_m_: has joined #ruby
[07:27:57] yohji: has joined #ruby
[07:30:57] raynold: has joined #ruby
[07:31:03] dionysus69: has joined #ruby
[07:35:39] alfiemax: has joined #ruby
[07:37:55] reber: has joined #ruby
[07:40:03] sysvalve: has joined #ruby
[07:43:49] dogweather: has joined #ruby
[07:51:51] mikecmpbll: has joined #ruby
[07:57:00] Revan007: has joined #ruby
[07:57:55] tvw: has joined #ruby
[08:03:01] alfiemax: has joined #ruby
[08:03:43] dionysus69: has joined #ruby
[08:06:07] marr: has joined #ruby
[08:10:04] burgestrand: has joined #ruby
[08:10:07] sysvalve: has joined #ruby
[08:13:05] c0ncealed1: has joined #ruby
[08:16:20] nima_m: hi ,which IDE/editor is best to use for ruby?
[08:18:19] dminuoso: nima_m: The one you are most comfortable with.
[08:18:45] dminuoso: nima_m: emacs or vim are great choices. But any editor you like that has syntax highlighting and tags support will work
[08:21:33] mohsen_1: dminuoso: Are there any IDEs too?
[08:22:12] dminuoso: mohsen_1: RubyMine and emacs probably give you the most integrated experience
[08:22:40] Zarthus: i find ruby to work poorly on any IDE, i much prefer text editors
[08:22:58] mohsen_1: dminuoso: Hm, what would you personally recommend(I don't have experience with vim/emacs)
[08:23:04] guille-moe: has joined #ruby
[08:23:19] dminuoso: mohsen_1: Editors are like religions. Try them out and pick one you like.
[08:23:27] dminuoso: But dont talk about it.
[08:23:37] dminuoso: mohsen_1: Lack of experience is something you can change. ;)
[08:23:53] dminuoso: mohsen_1: Personally I use spacemacs with evil mode.
[08:23:58] rmerry: has joined #ruby
[08:24:54] dminuoso: The complexity of the editor is not that much of an issue, because you can be productive with very little knowledge. They don't require much experience, but they just offer much power once you learn it.
[08:25:26] rmerry: hey guys; in Rails 5 is there an easy way to make the json serializer (when serializing a model to json) to not output fields with a nil (null) value?
[08:25:30] ruby[bot]: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[08:25:55] mohsen_1: dminuoso: You're right
[08:26:04] jenrzzz: has joined #ruby
[08:27:51] ellcs: has joined #ruby
[08:30:29] amar: has joined #ruby
[08:31:41] Quentinius: has joined #ruby
[08:33:02] burgestrand: has joined #ruby
[08:35:07] Zarthus: rmerry: fyi APIs that have hidden fields are a pain in the ass to work with :P
[08:35:18] Zarthus: especially if not documented
[08:35:35] jenrzzz: has joined #ruby
[08:35:47] amar: has joined #ruby
[08:35:58] rmerry: I was under the impression that it's standard practice not to return null fields in json
[08:36:52] Zarthus: it only really works if your documentation reflects everything :P
[08:37:22] Zarthus: my day job kind of involves reading poorly documented/written apis and implementing them.
[08:38:02] rmerry: thank you for the advice Zarthus
[08:38:25] _antares_: has joined #ruby
[08:39:45] Zarthus: especially when it's something like "if this value is set, do this instead of that" -- it'd be so much better if they just used a boolean :P
[08:41:56] rmerry: indeed, I can see it being more convenient for front end devs
[08:42:19] rmerry: though I guess the downside is you might be returning more data than necessary over the wire
[08:42:26] rmerry: though in my case that's probably not an issue
[08:43:47] Zarthus: i'm actually a backend dev
[08:43:54] Zarthus: i interface with third party apis
[08:44:16] Zarthus: if it's an internal tool, go wild because they can bug you with questions and you can describe the ticket implementation
[08:52:55] tomphp: has joined #ruby
[08:55:16] saTchymoto: has joined #ruby
[08:55:27] dminuoso: 10:35 rmerry | I was under the impression that it's standard practice not to return null fields in json
[08:55:43] dminuoso: `null` generally has the same conncation as `NaN`
[08:55:52] dminuoso: *connotation even
[08:57:09] dogweather: has joined #ruby
[08:58:21] Beams: has joined #ruby
[09:00:04] tAn: has joined #ruby
[09:03:23] jenrzzz: has joined #ruby
[09:03:23] jenrzzz: has joined #ruby
[09:04:34] jottr: has joined #ruby
[09:10:48] physicist__: has joined #ruby
[09:10:52] simmaniac: has joined #ruby
[09:12:49] roamingdog: has joined #ruby
[09:12:56] yohji: has joined #ruby
[09:16:03] jenrzzz: has joined #ruby
[09:16:03] jenrzzz: has joined #ruby
[09:18:20] tomphp: has joined #ruby
[09:18:43] ur5us: has joined #ruby
[09:22:26] dogweather: has joined #ruby
[09:23:22] tomphp: has joined #ruby
[09:26:55] jottr: has joined #ruby
[09:27:54] tomphp: has joined #ruby
[09:29:41] robertothais: has joined #ruby
[09:32:22] tvw: has joined #ruby
[09:37:42] apeiros: dminuoso: IME sql is the only language treating it as such, though. or are there other languages?
[09:37:57] kapil___: has joined #ruby
[09:38:14] jenrzzz: has joined #ruby
[09:38:14] jenrzzz: has joined #ruby
[09:38:45] apeiros: (and I hate sql for treating null similar to NaN)
[09:38:57] dminuoso: apeiros: Actually yeah you are right.
[09:39:29] burgestrand: has joined #ruby
[09:42:02] ur5us: has joined #ruby
[09:48:24] dogweather: has joined #ruby
[09:49:43] ellcs: has joined #ruby
[09:51:03] camonz: has joined #ruby
[09:51:47] jenrzzz: has joined #ruby
[09:55:00] Mike11: has joined #ruby
[09:56:14] conta: has joined #ruby
[09:57:49] karapetyan: has joined #ruby
[09:59:26] amatas: has joined #ruby
[10:00:18] ur5us: has joined #ruby
[10:01:57] ur5us: has joined #ruby
[10:07:43] suukim: has joined #ruby
[10:09:15] plexigras: has joined #ruby
[10:09:29] ur5us: has joined #ruby
[10:09:56] dogweather: has joined #ruby
[10:11:33] ciscam: has joined #ruby
[10:17:57] ur5us: has joined #ruby
[10:21:25] ur5us: has joined #ruby
[10:22:35] KeyJoo: has joined #ruby
[10:27:41] yohji: has joined #ruby
[10:41:16] roamingdog: has joined #ruby
[10:42:49] worldsayshi: has joined #ruby
[10:46:32] p0p0pr37: has joined #ruby
[10:46:33] p0p0pr37: has joined #ruby
[10:48:24] dogweather: has joined #ruby
[10:52:41] conta: has joined #ruby
[10:52:52] AJA4350: has joined #ruby
[10:53:08] alfiemax: has joined #ruby
[10:58:26] p0p0pr37: has joined #ruby
[11:00:34] tomphp: has joined #ruby
[11:03:42] p0p0pr37: has joined #ruby
[11:03:42] p0p0pr37: has joined #ruby
[11:05:35] dogweather: has joined #ruby
[11:07:10] twe4ked: has joined #ruby
[11:07:11] Beams: has joined #ruby
[11:07:31] RedNifre: has joined #ruby
[11:07:47] tomphp: has joined #ruby
[11:08:08] jenrzzz: has joined #ruby
[11:08:09] jenrzzz: has joined #ruby
[11:15:47] houhoulis: has joined #ruby
[11:21:46] roamingdog: has joined #ruby
[11:22:31] roamingdog: has joined #ruby
[11:23:06] robertothais: has joined #ruby
[11:23:22] roamingdog: has joined #ruby
[11:24:07] roamingdog: has joined #ruby
[11:26:23] dogweather: has joined #ruby
[11:26:42] Azure|dc: has joined #ruby
[11:28:19] conta: has joined #ruby
[11:28:47] p0p0pr37: has joined #ruby
[11:30:04] ldnunes: has joined #ruby
[11:34:57] dogweather: has joined #ruby
[11:36:28] _antares_: has joined #ruby
[11:39:20] RougeR: has joined #ruby
[11:40:06] Cavallari: has joined #ruby
[11:46:45] tomphp: has joined #ruby
[11:48:10] dogweather: has joined #ruby
[11:57:22] tomphp: has joined #ruby
[11:58:43] plexigras: has joined #ruby
[12:00:09] synthroid: has joined #ruby
[12:00:30] VladGh: has joined #ruby
[12:02:35] jcalla: has joined #ruby
[12:02:46] quobo: has joined #ruby
[12:05:24] dogweather: has joined #ruby
[12:05:27] tomphp: has joined #ruby
[12:08:43] jenrzzz: has joined #ruby
[12:08:43] jenrzzz: has joined #ruby
[12:13:01] blackmesa: has joined #ruby
[12:13:34] dr3wo: has joined #ruby
[12:14:40] sepp2k: has joined #ruby
[12:18:11] dogweather: has joined #ruby
[12:18:19] RedNifre: has joined #ruby
[12:21:37] ellcs: has joined #ruby
[12:26:14] amar_: has joined #ruby
[12:27:32] KeyJoo: has joined #ruby
[12:28:06] tomphp: has joined #ruby
[12:29:25] kurko_: has joined #ruby
[12:30:44] Junaos: has joined #ruby
[12:30:59] n0m4d1c: has joined #ruby
[12:35:16] dogweather: has joined #ruby
[12:35:31] drale2k_: has joined #ruby
[12:38:45] jenrzzz: has joined #ruby
[12:38:45] jenrzzz: has joined #ruby
[12:41:23] Beams_: has joined #ruby
[12:45:26] tomphp: has joined #ruby
[12:46:55] oleo: has joined #ruby
[12:48:10] dogweather: has joined #ruby
[12:50:43] TinkerT: has joined #ruby
[12:55:58] jenrzzz: has joined #ruby
[12:56:59] suukim: has joined #ruby
[12:57:35] Mike11: has joined #ruby
[12:58:54] zipace: has joined #ruby
[13:01:49] oleo: has left #ruby: ("Leaving")
[13:02:18] cyberg: has joined #ruby
[13:02:28] nowhere_man: has joined #ruby
[13:08:11] k0mpa: has joined #ruby
[13:10:43] Mike11: Hello all, I am new to ruby, I created my gem using gem bundle xxx. and now that it is functioning mostly the way I want, I tried to setup travis to build, but I am getting an error:
[13:10:43] Mike11: 0.40s$ bundle exec rake
[13:10:43] Mike11: rake aborted!
[13:10:43] Mike11: Don't know how to build task 'spec' (see --tasks)
[13:10:43] Mike11: Tasks: TOP => default(See full trace by running task with --trace)
[13:11:12] Sylario: has joined #ruby
[13:11:27] Mike11: I think that the error is related to my Rakefile: https://github.com/micjabbour/pronto-clang_format/blob/master/Rakefile
[13:12:32] Mike11: but it is the one auto-generated by bundle, and I am not feeling alright to change it, should I? and what should I add exactly?
[13:13:03] Mike11: This is the error I got in travis: https://travis-ci.org/micjabbour/pronto-clang_format/builds/377479711
[13:14:04] Zarthus: Mike11: what happens when you run `bundle exec rake` locally?
[13:14:37] Mike11: Zarthus: bundler: failed to load command: rake (/usr/local/bin/rake)
[13:14:41] veex: has joined #ruby
[13:14:42] Mike11: although I have rake installed!
[13:15:22] Zarthus: so it's not failing on travis; it's failing in general
[13:15:47] Zarthus: did you run `bundle install`( i think the command is ) at any recent point in your project dir?
[13:16:52] Mike11: Zarthus: when I use: gem build mygemspecfile.gemspec, then sudo gem install mygemspecfile-0.1.0.gem . Everything works as expected
[13:18:22] Mike11: bundle install says that it insalled all dependencies (and rake shows among them). and after that bundle exec rake fails with the same error
[13:18:31] Mike11: but note that it is a different error from travis
[13:18:47] Mike11: travis isn't complaining about not finding the rake executable
[13:19:11] Zarthus: yeah, travis is saying the command being ran (`rake exec spec`) doesn't exist.
[13:19:20] Zarthus: which means your rakefile doesn't describe this job
[13:19:36] Zarthus: but if you locally cannot get it to run, you cannot assert it will work when travis is doing things.
[13:19:58] Mike11: Zarthus: well, rake --version runs locally
[13:20:04] Mike11: whereis rake show
[13:20:22] Mike11: whereis rake
[13:20:26] Mike11: rake: /usr/bin/rake /usr/local/bin/rake /usr/share/man/man1/rake.1.gz
[13:20:40] Zarthus: try `bundle whereis rake`
[13:20:50] Zarthus: it runs it in context of bundler
[13:21:02] Mike11: did you mean "bundle exec whereis rake"?
[13:21:12] bmurt: has joined #ruby
[13:21:12] Zarthus: yes, sorry
[13:21:52] Zarthus: getting " bundler: failed to load command: rake (/usr/local/bin/rake)" with bundle exec rake is quite.. interesting.
[13:22:17] Mike11: Zarthus: np, well not for me :p
[13:22:19] alfiemax: has joined #ruby
[13:23:24] rippa: has joined #ruby
[13:25:11] Mike11: Zarthus: sorry, got a phone call. "bundle exec rake --version" shows the same error (failed to load command)
[13:25:21] Zarthus: anyway, i would first work towards getting my local environment to say exactly what travis is saying
[13:25:29] Zarthus: then you can fix the problem locally, push your changes, travis will pas.s
[13:25:31] karunagrewal: has joined #ruby
[13:25:39] Mike11: but "bundle exec whereis rake" shows the same paths as running "whereis rake"
[13:26:08] karapetyan: has joined #ruby
[13:26:08] Zarthus: i'm fairly certain the solution is to define a spec task for rake, but there's no point in not fixing local first.
[13:26:21] Zarthus: are you on windows 10 perchance?
[13:26:44] Mike11: Zarthus: no, I am running ruby in a debian 9 VM
[13:26:52] Azure: has joined #ruby
[13:27:18] Mike11: Zarthus: so I should eventually edit the auto-generate Rakefile, right?
[13:27:32] Zarthus: hard to say, i don't know what you have at the moment :P
[13:28:03] Mike11: I am thinking of re-installing ruby
[13:28:12] Zarthus: that might make sese, or at least the gem
[13:28:21] Mike11: what gem?
[13:29:55] _antares_: has joined #ruby
[13:30:38] Mike11: how can I re-install all gems that I have here?
[13:31:11] Zarthus: uh.. good question
[13:31:12] Mike11: I mean, is there any command that removes gem along with all its installed gems?
[13:31:26] Mike11: (I can install what I need later)
[13:31:29] Zarthus: there probably is, but i don't know it off the topic of my head
[13:31:34] Zarthus: `man gem` can probably help here
[13:31:47] krawchyk: has joined #ruby
[13:33:50] houhoulis: has joined #ruby
[13:34:39] tomphp: has joined #ruby
[13:36:35] dionysus69: has joined #ruby
[13:41:10] _antares__: has joined #ruby
[13:46:47] roamingdog: has joined #ruby
[13:47:20] TomyWork: has joined #ruby
[13:48:31] pb122: has joined #ruby
[13:49:26] twe4ked: has joined #ruby
[13:51:23] RedNifre: has joined #ruby
[13:51:23] ferr: has joined #ruby
[13:56:46] kapil___: https://ruby-doc.org/core-2.5.0/Dir.html Dir provides find function. but its documentation is not available on website
[13:57:27] dminuoso: NoMethodError: undefined method `find' for Dir:Class
[13:57:39] apeiros: kapil___: it's an instance method from Enumerable
[13:57:51] kapil___: apeiros: thanks
[13:57:52] apeiros: always check included modules, or use ri
[13:57:59] apeiros: &ri Dir#find kapil___
[13:58:10] apeiros: oh dang, is derpy still off?
[13:58:35] kapil___: apeiros: i tried to use ri but not successful how to use it? thanks
[13:58:44] apeiros: anyway, `ri Dir#find` in your console will give you the result
[13:59:00] apeiros: what do you get when you run the above command?
[13:59:11] kapil___: `Nothing known about Dir`
[13:59:23] apeiros: you didn't install ruby docs along with ruby. how did you install ruby?
[14:00:05] kapil___: `rvm reinstall 2.5.0 --disable-binary`
[14:00:15] apeiros: run `rvm docs generate`
[14:00:24] kapil___: apeiros: thanks
[14:00:26] dminuoso: I refuse to build docs.
[14:00:32] dminuoso: Stupid thing takes way too long
[14:00:36] Asher: has joined #ruby
[14:00:57] apeiros: y u computa so slo, dminuoso?
[14:01:36] kapil___: apeiros: how to use ri in irb?
[14:01:40] apeiros: hm, my 🍎 is fast. just the keyboard is shit.
[14:01:52] apeiros: kapil___: use pry + pry-doc
[14:01:55] dminuoso: apeiros: I just ordered myself a new ducky keyboard for the office =)
[14:01:59] apeiros: and then as simple as `? Dir#find`
[14:02:07] apeiros: and `$ Dir#find` to see the source code
[14:02:14] apeiros: dminuoso: lÿnk?
[14:02:18] dminuoso: apeiros: http://www.duckychannel.com.tw/page-en/ducky-one/
[14:02:25] dminuoso: apeiros: The best mechanical keyboards on the market right now. :)
[14:02:56] apeiros: I'm actually pretty happy with the titanium apple keyboards. still use that one. I think it came with my imac.
[14:03:11] apeiros: got a decent travel distance and feels solid
[14:03:17] jenrzzz: has joined #ruby
[14:03:17] jenrzzz: has joined #ruby
[14:03:33] Mike11: after re-installing ruby, I can get the same output from travis
[14:03:56] dminuoso: apeiros: I grew up with an IBM Model M, so Im pretty hooked on mechanical keyboards. :)
[14:04:10] dminuoso: The Ducky One is the first keyboard that actually feels like an upgrade from an IBM Model M.
[14:04:15] apeiros: I just wish they had enough power in their built-in hub for those silly mice I have
[14:04:26] dminuoso: Haha! You use a mouse?
[14:04:26] apeiros: all of them complain about too little power when I connect them through the keyboard
[14:04:29] wolfshappen: has joined #ruby
[14:04:43] dminuoso: Serves you right!
[14:04:45] dminuoso: Mouse user!
[14:04:46] apeiros: yeah. I got magic trackpad. I used it for like a week and couldn't get used to it
[14:04:52] Mike11: when I use "bundle exec rake" in my gem, I get:
[14:04:52] Mike11: rake aborted!
[14:04:52] Mike11: Don't know how to build task 'spec' (see --tasks)
[14:05:04] dminuoso: apeiros: Honestly I really wish I could run xmonad on macOS
[14:05:15] dminuoso: If I had a decent tiling window manager I could throw the mouse out of the window
[14:05:19] apeiros: Mike11: so the default task is specified to be 'spec' and your Rakefile doesn't load/define that task
[14:05:20] Mike11: This error is preventing my CI to run successfully: https://travis-ci.org/micjabbour/pronto-clang_format/builds/377479711\
[14:05:54] dminuoso: For me the mouse is mostly for dragging windows around..
[14:05:56] apeiros: dminuoso: nah, I like mousing even for stuff like text editing. it's rare, but there's situations where it's definitively faster than any keyboard combo possibly could be.
[14:06:04] Mike11: apeiros: so should I edit my Rakefile even for a hello-world kind of gem?
[14:06:23] apeiros: Mike11: I have no idea what you *should* do, since that depends entirely on what you want to happen.
[14:06:42] apeiros: (and additionally of course on your context, which I know next to nothing about)
[14:06:47] dminuoso: apeiros: Oh yeah, the mouse is not complete useless. Though the times when I actually touch it are rare on a good day.
[14:07:03] dminuoso: I dont actually recall this, but Im sure there may even have been days that I didn't touch the mouse for hours at a time.
[14:07:08] dminuoso: (While working on the computer of course!)
[14:07:09] jottr: has joined #ruby
[14:07:15] apeiros: dminuoso: yeah, I think I'm ~95% keyboard and 5% mouse.
[14:07:19] apeiros: maybe 90/10
[14:07:54] apeiros: and re tiling manager: yes! that'd lower my mouse usage even further. a lot of it is "arranging windows".
[14:08:26] apeiros: and with 30" screens there's really little point in overlapping windows.
[14:08:31] apeiros: spaces + tiling
[14:08:41] Mike11: apeiros: ok, I get your point. I am writing a gem that should (when installed) be picked up by another gem (which invokes some functions/instantiates objects from classes in my gem)
[14:08:50] Mike11: https://github.com/micjabbour/pronto-clang_format
[14:08:55] dminuoso: apeiros: During coding I'd say it's maybe 99/1 unless Im doing webdev.
[14:08:56] apeiros: Mike11: and you need rake for what?
[14:09:16] Mike11: currently it is working fine for me, when I use sudo gem install xxx
[14:09:24] dminuoso: I mean the mouse mostly is just used during clicking on things in the browser.
[14:09:28] Mike11: but I would like to setup CI for my repo above
[14:09:38] apeiros: dminuoso: yeah, a lot of mousing is for all the distractions, like IRC, twitch, youtube, twitter, imessage, whatsapp
[14:09:42] dminuoso: apeiros: And even the tiling can largely be avoided if you set up your desktops once
[14:09:43] Mike11: and travis seems to display an error about rake
[14:09:58] Mike11: apeiros: sorry for my inaccurate terms, I am just new to ruby :)
[14:10:17] Mike11: https://travis-ci.org/micjabbour/pronto-clang_format/jobs/377479712
[14:10:19] dminuoso: apeiros: I mean I try to avoid terminal madness and just use a single terminal window with fullscreen and tmux inside.
[14:10:26] dminuoso: "terminal space tiling"
[14:10:54] tomphp: has joined #ruby
[14:10:57] dminuoso: So it's one screen tmux (tiled), one screen emacs (tiled), and one screen with a browser window
[14:11:05] apeiros: hm, I have one terminal window per project with multiple tabs. usually tab 1 = rails s, tab 2 = rails c, tab 3 = git stuff, tab 4 = open for whatever.
[14:11:32] apeiros: Mike11: ok, what should your CI do?
[14:12:21] Mike11: apeiros: I am not sure what it should do yet, I am not planning to write tests for this (so maybe just "build" the gem?)
[14:12:45] dogweather: has joined #ruby
[14:13:25] apeiros: then configure your CI task to do that. right now it runs `bundle exec rake` which in turn is set to be `bundle exec rake spec`. and that's not about building your gem.
[14:14:10] apeiros: and I'd say "Could not find .travis.yml, using standard configuration." is related to that.
[14:14:31] tomphp: has joined #ruby
[14:14:32] Mike11: apeiros: using rake seems to be the default way for checking gems on travis
[14:14:52] Mike11: and I thought that I should stick to that since I don't have experience to choose something else
[14:15:00] RougeT430: has joined #ruby
[14:15:06] apeiros: you'll have to make up your mind
[14:15:19] apeiros: you just said you don't plan to write tests. what travis by default runs *are* tests.
[14:15:33] apeiros: so either write tests or configure travis to do what you said before (build the gem)
[14:15:54] Mike11: mm, I get your point, thank you very much and sorry for the noise
[14:16:06] samosaphile: has joined #ruby
[14:16:07] apeiros: wasn't noise, you're welcome.
[14:16:09] kmurphy4: has joined #ruby
[14:16:17] Mike11: apeiros: thanks :)
[14:24:33] spiette: has joined #ruby
[14:24:47] tomphp: has joined #ruby
[14:28:10] jenrzzz: has joined #ruby
[14:28:10] jenrzzz: has joined #ruby
[14:29:19] chouhoulis: has joined #ruby
[14:30:58] rouget430__: has joined #ruby
[14:31:44] RougeR: has joined #ruby
[14:32:58] amarks: has joined #ruby
[14:33:31] coderphive: has joined #ruby
[14:34:18] BTRE: has joined #ruby
[14:34:40] drale2k_: has joined #ruby
[14:35:42] jenrzzz: has joined #ruby
[14:35:42] jenrzzz: has joined #ruby
[14:37:15] RougeT430: has joined #ruby
[14:39:46] sonOfRa: has joined #ruby
[14:40:07] \void: has joined #ruby
[14:42:45] samwheel: has joined #ruby
[14:43:44] dogweather: has joined #ruby
[14:44:13] CrazyEddy: has joined #ruby
[14:44:55] ramfjord: has joined #ruby
[14:45:26] cadillac_: has joined #ruby
[14:46:21] TomyLobo: has joined #ruby
[14:47:55] cschneid_: has joined #ruby
[14:50:14] dcunit3d: has joined #ruby
[14:50:44] RougeR: has joined #ruby
[14:51:12] schneider: has joined #ruby
[14:56:47] chouhoulis: has joined #ruby
[14:59:51] tdy: has joined #ruby
[15:00:41] sriehl: has joined #ruby
[15:00:41] sriehl: has joined #ruby
[15:02:57] apparition: has joined #ruby
[15:08:23] simmaniac: has joined #ruby
[15:08:42] memo1: has joined #ruby
[15:11:45] Ryzokuken: has joined #ruby
[15:12:54] tomphp: has joined #ruby
[15:13:25] bmurt: has joined #ruby
[15:13:46] za1b1tsu_: has joined #ruby
[15:14:01] tomphp: has joined #ruby
[15:14:58] RougeT430: has joined #ruby
[15:16:08] banisterfiend: has joined #ruby
[15:18:04] dcunit3d: has joined #ruby
[15:25:01] nadir: has joined #ruby
[15:25:46] mondongo: has joined #ruby
[15:26:48] Azure: has joined #ruby
[15:27:51] cthulchu: has joined #ruby
[15:30:39] dogweather: has joined #ruby
[15:34:09] dcunit3d: has joined #ruby
[15:36:56] tomphp: has joined #ruby
[15:40:51] bmurt: has joined #ruby
[15:42:20] mensvaga: has joined #ruby
[15:42:52] mensvaga: Anybody have experience with the Syslog module in here?
[15:43:05] jcarl43: has joined #ruby
[15:43:23] mensvaga: For instance, why this: error() - Logs a message at the error (syslog warning) log level
[15:43:41] mensvaga: fatal() - Logs a message at the fatal (syslog err) log level
[15:44:05] caleBOT: has joined #ruby
[15:44:06] caleBOT_: has joined #ruby
[15:44:10] mensvaga: warn() - Logs a message at the warn (syslog notice) log level,
[15:46:22] mensvaga: Is there a 'syslog/logger/actualsyslog' ?
[15:46:47] cgfbee: has joined #ruby
[15:47:14] caleBOT__: has joined #ruby
[15:47:14] caleBOT__: has joined #ruby
[15:47:41] tomphp: has joined #ruby
[15:51:39] cagomez: has joined #ruby
[15:51:58] dogweather: has joined #ruby
[15:52:08] Zarthus: you could always alias the methods
[15:52:48] mensvaga: ... I did. But, that felt kind of yucky.
[15:53:13] mensvaga: I see it has a "add" thing, so I might be able to add "real_syslog_info", etc, and then just wrap those
[15:53:27] mensvaga: But, I was wondering if somebody had already done that.
[15:53:38] Zarthus: it kind of makes sense to me though, there's no way a fatal() should become LOG_EMERG or LOG_CRIT
[15:53:52] Zarthus: it's a ruby program, not a system-dependent critical software
[15:55:07] mensvaga: I suppose that's not the correct approach to have when thinking about software. Somewhere, somebody assumes that Ruby is a quality programming language to be relied upon.
[15:55:12] mensvaga: "Critical", if you will.
[15:55:51] Zarthus: i mean, from a syslog perspective, the man page describes LOG_CRIT as a critical system issue
[15:56:09] Zarthus: and LOG_EMERG literally is an emergency, your system is "no longer usable"
[15:57:09] mensvaga: wow, so, no. You're taking the definition of "system" to be to restrictive in this case.
[15:57:33] Zarthus: maybe, I've only read part of the manpage :)
[15:57:35] mensvaga: It's not necessarily the "computing system" you're on, it's the "environment / system you're interacting with"
[15:58:00] mensvaga: Let's just say you're running a door lock system with Ruby
[15:58:06] mensvaga: and them dinosaurs escape
[15:58:16] mensvaga: and you're all like "emergency! Dinosaurs escaping"
[15:58:31] mensvaga: Ruby programmer comes to you and says, "LOL. Ruby not critial. No way for emergency."
[15:59:34] mroutis: has joined #ruby
[16:00:41] mensvaga: You'd be all like, "But... but the door lock system is unusable! And it's an emergency!"
[16:00:57] mensvaga: "LOL. USe fatal. Logs to err."
[16:01:11] Zarthus: i'll admit it's not very intuitive :)
[16:01:12] dogweather: has joined #ruby
[16:01:23] mensvaga: You misspelled "wrong"...
[16:01:52] Zarthus: https://www.rubydoc.info/gems/syslog-logger/1.6.8/Logger/Syslog (albeit from 2012) seems to be closer to what you want
[16:02:16] Zarthus: there's no emergency in that one either, though
[16:02:29] mensvaga: Closer. But they still unknown => alert
[16:02:46] mensvaga: Perl doesn't have an emergency one either, but it's easy to add.
[16:02:55] tomphp: has joined #ruby
[16:03:16] Zarthus: you could extend and modify LO:GGER_MAP
[16:03:29] _antares_: has joined #ruby
[16:03:35] mensvaga: Yeah. I'd have to remap everything except for debug and info.
[16:03:48] Zarthus: less hacky than aliasing methods
[16:04:33] mensvaga: OK. Got the answer I was expecting, but not what I hoped for. I'll remap everything.
[16:09:48] ellcs: has joined #ruby
[16:09:59] kurko_: has joined #ruby
[16:10:38] drale2k_: has joined #ruby
[16:14:55] dogweather: has joined #ruby
[16:19:45] Asher: has joined #ruby
[16:26:55] dogweather: has joined #ruby
[16:27:43] _antares_: has joined #ruby
[16:28:17] mensvaga: wait, so, somebody took a more accurate syslog module, and then made a less accurate one because "ruby can't be used for system critical stuff" ?
[16:30:58] dcunit3d: has joined #ruby
[16:32:36] RedNifre: has joined #ruby
[16:32:47] GodFather: has joined #ruby
[16:32:50] nolanv: Much of Ruby was developed by raptors. They have a personal stake in this.
[16:33:05] GodFather_: has joined #ruby
[16:34:18] jamesaxl: has joined #ruby
[16:36:51] dogweather: has joined #ruby
[16:37:13] regedit: has joined #ruby
[16:38:39] gheegh: has joined #ruby
[16:40:20] mensvaga: https://imgflip.com/i/2a34vz
[16:44:27] RougeT430: has joined #ruby
[16:46:56] dogweather: has joined #ruby
[16:47:04] al2o3-cr: mensvaga: syslog does have critical and emergency
[16:47:43] dcunit3d: has joined #ruby
[16:48:06] mensvaga: welcome to the party.
[16:48:36] nolanv: gracias, amigo
[16:50:04] sanscoeur: has joined #ruby
[16:50:37] cthulchu_: has joined #ruby
[16:52:26] chouhoulis: has joined #ruby
[16:53:32] chouhoul_: has joined #ruby
[16:53:46] NingaLeaf: has joined #ruby
[16:54:36] chouhoul_: has joined #ruby
[16:55:38] chouhoul_: has joined #ruby
[16:55:48] pilne: has joined #ruby
[16:56:46] chouhoul_: has joined #ruby
[16:57:51] chouhoulis: has joined #ruby
[16:59:02] chouhoul_: has joined #ruby
[17:00:06] chouhoul_: has joined #ruby
[17:01:29] bmurt: has joined #ruby
[17:01:32] chouhoul_: has joined #ruby
[17:02:18] chouhoul_: has joined #ruby
[17:03:24] chouhoulis: has joined #ruby
[17:03:26] amar: has joined #ruby
[17:04:36] chouhoul_: has joined #ruby
[17:05:53] chouhoul_: has joined #ruby
[17:06:46] chouhoul_: has joined #ruby
[17:07:23] mroutis: has joined #ruby
[17:07:56] chouhoul_: has joined #ruby
[17:09:17] chouhoulis: has joined #ruby
[17:10:07] chouhoul_: has joined #ruby
[17:11:21] chouhoul_: has joined #ruby
[17:12:17] chouhoul_: has joined #ruby
[17:13:23] chouhoul_: has joined #ruby
[17:14:30] chouhoulis: has joined #ruby
[17:14:44] mustmodify_: has joined #ruby
[17:15:37] chouhoul_: has joined #ruby
[17:15:38] mustmodify_: What's the fastest (runtime) way to test for an invalid byte sequence? just =~ /[^\x00..\x7F]/ ?
[17:16:14] mustmodify_: sorry... non-ASCII characters
[17:16:14] gheegh: has joined #ruby
[17:16:46] chouhoul_: has joined #ruby
[17:17:51] chouhoul_: has joined #ruby
[17:21:06] n0m4d1c: has joined #ruby
[17:21:06] Beams: has joined #ruby
[17:21:07] chouhoul_: has joined #ruby
[17:21:07] Zarthus: maybe .ord > 255
[17:21:08] chouhoulis: has joined #ruby
[17:21:08] mustmodify_: I'll have to test that.
[17:21:08] Zarthus: a regex might be faster against entire strings, i'm not sure.
[17:21:08] mustmodify_: I'll benchmark. Good idea, thanks.
[17:21:10] chouhoul_: has joined #ruby
[17:21:15] Zarthus: your regex should have a dash rather than two dots anyways (unless ruby does something specific)
[17:21:47] mustmodify_: I typed that separately and wrong. Actual code I'm using is /[^\x00-\x7F]/
[17:21:59] apeiros: !fixcon chouh____
[17:21:59] ruby[bot]: +bbbb chouhoulis!*@*$#ruby-fix-your-connection chouhoul_!*@*$#ruby-fix-your-connection chouhou__!*@*$#ruby-fix-your-connection chouho___!*@*$#ruby-fix-your-connection
[17:22:00] ruby[bot]: +bb chouh____!*@*$#ruby-fix-your-connection *!*@50-207-64-46-static.hfc.comcastbusiness.net$#ruby-fix-your-connection
[17:22:00] ruby[bot]: ruby[bot] kicked chouho___: join/part detected
[17:22:01] ruby[bot]: ruby[bot] kicked chouh____: join/part detected
[17:22:01] ruby[bot]: ruby[bot] kicked chouhoulis: join/part detected
[17:22:02] ruby[bot]: ruby[bot] kicked chouhoul_: join/part detected
[17:22:05] gregf_: has joined #ruby
[17:22:13] Zarthus: i'd wonder if testing against truthiness would be faster than falsiness.
[17:22:26] Zarthus: a-la /^[\x00..\x7F]*$/
[17:22:30] mustmodify_: shoot... if the encoding is set to UTF8, the regex still blows up with "invalid byte sequence"
[17:22:42] ohcibi: has joined #ruby
[17:22:47] Zarthus: does adding the /u flag help?
[17:23:06] apeiros: Zarthus: wrong anchors
[17:23:18] d^sh: has joined #ruby
[17:23:24] Zarthus: apeiros: you want the \A\z ones?
[17:23:25] apeiros: also wrong range "operator". character classes use "-"
[17:23:33] apeiros: Zarthus: it's not me who wants that ;-)
[17:23:41] shaman42: has joined #ruby
[17:23:43] apeiros: but yes, \A\z would be the correct ones
[17:23:48] Zarthus: hah, i fell for mustmodify_'s pitfall.
[17:23:52] Zarthus: what makes them more correct?
[17:23:56] apeiros: and /u is no longer necessary since 1.9
[17:24:48] apeiros: >> if "I cheat\n\xff" =~ /^[\x00-\x7f]$/ then "broken regex" else "huh? it works correctly?" end
[17:24:49] ruby[bot]: apeiros: # => invalid byte sequence in UTF-8 (ArgumentError) ...check link for more (https://eval.in/1002951)
[17:24:58] apeiros: >> if "I cheat\n\xff" =~ /^[\x00-\x7f]$/n then "broken regex" else "huh? it works correctly?" end
[17:24:59] ruby[bot]: apeiros: # => invalid byte sequence in UTF-8 (ArgumentError) ...check link for more (https://eval.in/1002952)
[17:25:13] apeiros: >> if "I cheat\nö" =~ /^[\x00-\x7f]$/n then "broken regex" else "huh? it works correctly?" end
[17:25:14] ruby[bot]: apeiros: # => /tmp/execpad-7411697b833b/source-7411697b833b:2: warning: regexp match /.../n against to UTF-8 strin ...check link for more (https://eval.in/1002953)
[17:25:15] mustmodify_: looks like there's no way around it.
[17:25:23] apeiros: ruby, go away, yer drunk
[17:25:27] apeiros: >> if "I cheat\nö" =~ /^[\x00-\x7f]$/ then "broken regex" else "huh? it works correctly?" end
[17:25:28] ruby[bot]: apeiros: # => "huh? it works correctly?" (https://eval.in/1002954)
[17:25:44] apeiros: eh, yeah, I should copy the regex correctly
[17:25:48] apeiros: LAST TRY! :D
[17:25:53] apeiros: >> if "I cheat\nö" =~ /^[\x00-\x7f]*$/ then "broken regex" else "huh? it works correctly?" end
[17:25:54] ruby[bot]: apeiros: # => "broken regex" (https://eval.in/1002955)
[17:26:05] apeiros: >> if "I cheat\nö" =~ /\A[\x00-\x7f]*\z/ then "broken regex" else "huh? it works correctly?" end
[17:26:06] ruby[bot]: apeiros: # => "huh? it works correctly?" (https://eval.in/1002956)
[17:26:15] Zarthus: huh? it works correctly?!
[17:26:17] apeiros: (I forgot the * before "LAST TRY"
[17:26:25] apeiros: and the huh, works correctly is with \A \z ;-)
[17:26:33] Zarthus: interesting.
[17:26:39] apeiros: ^$ doesn't work because only *any* line in the string must match
[17:26:54] apeiros: since ^$ is start/end of *line*, not *string*. \A\z is start/end of string.
[17:27:13] apeiros: sorry for the spamming until I got it right :D
[17:27:22] Zarthus: less noise than our friend chouhoulis
[17:27:27] Zarthus: you're excused
[17:27:28] apeiros: mustmodify_: as for the warnings, force_encoding('binary') the string and //n
[17:27:41] mustmodify_: if "I cheat\nö".force_encoding('UTF-8') =~ /\A[\x00-\x7f]*\z/ then "broken regex" else "huh? it works correctly?" end
[17:27:47] apeiros: well, the chouhoulisses have been shown the door :D
[17:27:47] mustmodify_: >> if "I cheat\nö".force_encoding('UTF-8') =~ /\A[\x00-\x7f]*\z/ then "broken regex" else "huh? it works correctly?" end
[17:28:03] Zarthus: has left #ruby: ()
[17:28:03] apeiros: mustmodify_: you're not registered?
[17:28:05] mustmodify_: ok I'll try binary
[17:28:09] Zarthus: has joined #ruby
[17:28:10] Zarthus: wrong button
[17:28:34] mustmodify: >> if "I cheat\nö".force_encoding('UTF-8') =~ /\A[\x00-\x7f]*\z/ then "broken regex" else "huh? it works correctly?" end
[17:28:35] ruby[bot]: mustmodify: # => "huh? it works correctly?" (https://eval.in/1002957)
[17:28:56] mustmodify: My chat client sometimes gets mixed up and adds an underscore.
[17:29:02] apeiros: mustmodify: you want true if it contains non-ascii or false?
[17:29:16] apeiros: mustmodify: just group the underscored nick. /ns help group
[17:29:20] mustmodify: so that's weird... I'm using 2.1.6 and I get something different.
[17:29:38] apeiros: you forgot the //n flag.
[17:29:52] Zarthus: 2.1 is no longer supported, though
[17:29:56] apeiros: also you force encoded to utf-8, that's wrong. force encode to binary.
[17:29:58] mustmodify: what is //n?
[17:30:07] apeiros: //n tells ruby that the regex is binary
[17:30:07] Zarthus: a regex flag (/ is the delimiter)
[17:30:23] nitric: has joined #ruby
[17:30:44] apeiros: so you compare a binary string with a binary regex. no issues with invalid byte sequences (binary doesn't have such a thing)
[17:31:04] Zarthus: TIL the ruby catchphrase is "a programmer's best friend"
[17:31:11] apeiros: but again, you want true if it's ascii-only, or you want true if it contains non-ascii?
[17:31:22] quobo: has joined #ruby
[17:31:47] RedNifre: has joined #ruby
[17:32:07] mustmodify: method is called `valid_encoding?` so I want true if it's all ascii
[17:32:14] Puffball: has joined #ruby
[17:32:25] apeiros: that's not what that method does.
[17:32:53] apeiros: or well, you can get it to. but then you have to force_encoding("ASCII")
[17:32:54] al2o3-cr: mustmodify: String#ascii_only?
[17:33:09] apeiros: isn't that after 2.1?
[17:33:19] al2o3-cr: shouldn't be
[17:33:49] apeiros: you're right. that's actually the nicest way then :)
[17:34:01] gheegh: has joined #ruby
[17:34:46] apeiros: but reading the backlog, I think we're actually solving the wrong problem
[17:34:54] caleBOT: has joined #ruby
[17:34:55] caleBOT_: has joined #ruby
[17:35:07] apeiros: you have input which you tell ruby is utf-8, but which isn't
[17:35:42] apeiros: the first question is now whether you have a way to know which encoding your input has - do you?
[17:36:53] mustmodify: Right. We have an interface. Per the RFC, it should be UTF-8. Sometimes people are dumb, and they tell me it's UTF-8, and then send ISO-8944 or whatever. So I'd like the server to test files. If it finds one that isn't encoded right, to then isolate the file and alert me.
[17:37:30] mustmodify: Actually I'm not sure it's an RFC, but there's a media type called HL7, which should be ASCII.
[17:37:48] apeiros: ok. in that case, read the data as binary. input.force_encoding('utf-8').valid_encoding?
[17:38:13] apeiros: utf-8 has non-ascii bytes.
[17:38:30] mustmodify: I'd take UTF-8.
[17:38:57] mustmodify: I mean, it's maybe not preferable, but I just don't want to throw bad encodings into my db.
[17:39:17] gheegh: has joined #ruby
[17:39:22] AgentVenom: has joined #ruby
[17:39:36] apeiros: (you may be able to get away with reading it directly as utf-8, but any operation you perform on the input might break if it's not valid utf-8)
[17:40:14] mustmodify: that's correct.
[17:40:15] banisterfiend: has joined #ruby
[17:40:16] mustmodify: that's what happens.
[17:40:51] apeiros: that's why I'd read it as binary and only tell ruby the encoding is utf-8 in order to test it using valid_encoding?, and that will return false if it's not utf-8.
[17:40:59] apeiros: I mean, if it's not valid utf-8
[17:42:14] mustmodify: ok, let me run this though rspec and see what happens. :)
[17:42:52] jenrzzz: has joined #ruby
[17:43:05] apeiros: if you want to do something with the data after your test told you it's not utf-8, either turn it back to binary via force_encoding('binary'), or do the utf-8+valid_encoding? on a duplicate.
[17:43:27] apeiros: (note: String#dup is cheap if you don't actually modify the string's data - which you don't, you only change the encoding flag)
[17:43:54] amar_: has joined #ruby
[17:44:35] mustmodify: ta da! That works. Thanks all.
[17:44:53] alfiemax: has joined #ruby
[17:44:58] ldepandis: has joined #ruby
[17:45:13] sanscoeur: has joined #ruby
[17:46:55] caleBOT__: has joined #ruby
[17:46:55] caleBOT_: has joined #ruby
[17:52:28] chocoelho: has joined #ruby
[17:52:47] RougeT430: has joined #ruby
[17:52:55] nowhere_man: has joined #ruby
[17:53:07] konsolebox: has joined #ruby
[17:54:03] darkhanb: has joined #ruby
[17:54:38] orbyt_: has joined #ruby
[17:54:57] alfiemax: has joined #ruby
[17:57:58] _antares_: has joined #ruby
[17:59:48] RedNifre: has joined #ruby
[18:02:22] sanscoeur: has joined #ruby
[18:03:42] sanscoeur: has joined #ruby
[18:06:17] schneider: has joined #ruby
[18:15:57] dcunit3d: has joined #ruby
[18:17:16] tfitts: has joined #ruby
[18:18:38] Lytol: has joined #ruby
[18:22:05] banisterfiend: has joined #ruby
[18:25:28] cthu|: has joined #ruby
[18:28:01] veex: has joined #ruby
[18:31:37] chocoelho1: has joined #ruby
[18:38:34] minimalism: has joined #ruby
[18:39:33] kurko_: has joined #ruby
[18:40:24] clemens3_: has joined #ruby
[18:41:04] cthulchu_: has joined #ruby
[18:42:09] clemens3: has joined #ruby
[18:44:16] banisterfiend: has joined #ruby
[18:45:04] agimenez: has joined #ruby
[18:45:08] caleBOT__: has joined #ruby
[18:45:08] caleBOT_: has joined #ruby
[18:46:13] anisha: has joined #ruby
[18:47:50] GodFather_: has joined #ruby
[18:48:01] GodFather: has joined #ruby
[18:53:03] tAn: has joined #ruby
[18:57:17] sameerynho: has joined #ruby
[18:57:23] ipe: has joined #ruby
[19:03:54] dinfuehr: has joined #ruby
[19:04:01] caleBOT_: has joined #ruby
[19:04:01] caleBOT: has joined #ruby
[19:06:27] nowhere_man: has joined #ruby
[19:06:32] n0m4d1c_: has joined #ruby
[19:08:16] ldnunes: has joined #ruby
[19:09:42] eam: has joined #ruby
[19:12:05] dviola: has joined #ruby
[19:16:21] blackmesa: has joined #ruby
[19:20:32] banisterfiend: has joined #ruby
[19:22:25] Sonar1: has joined #ruby
[19:26:22] RougeT430: has joined #ruby
[19:28:11] RougeR: has joined #ruby
[19:29:06] alfiemax: has joined #ruby
[19:30:16] tomphp: has joined #ruby
[19:30:28] jrich523: has joined #ruby
[19:32:36] bmurt: has joined #ruby
[19:32:37] mroutis: has joined #ruby
[19:32:48] jrich523: rubocop gives me a "useless assignment to variable" which is sort of expected, cuz i dont need it, but is there a way to ignore/dump/discard the output?
[19:33:43] schneider: has joined #ruby
[19:36:23] mustmodify: has left #ruby: ()
[19:38:00] roamingdog: has joined #ruby
[19:41:11] caleBOT: has joined #ruby
[19:41:12] caleBOT_: has joined #ruby
[19:42:08] banisterfiend: has joined #ruby
[19:44:15] dcunit3d: has joined #ruby
[19:44:50] nowhere_man: has joined #ruby
[19:44:54] bdnelson: has joined #ruby
[19:45:04] caleBOT__: has joined #ruby
[19:45:04] caleBOT__: has joined #ruby
[19:45:26] caleBOT__: has joined #ruby
[19:45:27] caleBOT__: has joined #ruby
[19:46:06] NingaLeaf: has joined #ruby
[19:47:59] cagomez: has joined #ruby
[19:49:16] postmodern: has joined #ruby
[19:49:48] dogweather: has joined #ruby
[19:50:29] claudiuinberlin: has joined #ruby
[19:56:05] cschneid_: has joined #ruby
[19:56:56] xuanrui: has joined #ruby
[19:57:26] jamiejackson: has joined #ruby
[19:59:11] robertothais: has joined #ruby
[20:02:38] sanscoeur: has joined #ruby
[20:04:23] dogweather: has joined #ruby
[20:13:03] jenrzzz: has joined #ruby
[20:13:03] jenrzzz: has joined #ruby
[20:16:33] cschneid_: has joined #ruby
[20:17:12] dogweather: has joined #ruby
[20:18:15] apeiros: jrich523: yes, there are special comments with instructions to rubocop. but I'd have to read the docs too.
[20:20:24] mikecmpbll: has joined #ruby
[20:28:26] karapetyan: has joined #ruby
[20:29:59] dogweather: has joined #ruby
[20:35:50] xuanrui: has joined #ruby
[20:37:58] cschneid_: has joined #ruby
[20:41:39] tAn: has joined #ruby
[20:42:28] qnaal: has joined #ruby
[20:43:22] agent_white: has joined #ruby
[20:44:52] sanscoeur: has joined #ruby
[20:44:53] jrich523: apeiros you mean use a special comment to ignore the issue?
[20:45:01] jrich523: i was more so curious if something like this worked
[20:45:09] jrich523: nil = myMethod(a)
[20:47:08] dogweather: has joined #ruby
[20:47:10] tomphp: has joined #ruby
[20:47:39] apeiros: jrich523: no
[20:47:54] apeiros: left hand side of an assignment must be a variable or a method ending in =
[20:48:02] apeiros: and nil is not a valid variable name. no keyword is.
[20:48:24] weaksauce: has joined #ruby
[20:48:50] apeiros: and re methods ending in =, only with an explicit receiver it's considered as such
[20:51:05] jrich523: yeah, use to powershell, you'd do either null=whatever, or whatever | null.. but either way, there is a way to dump/ignore the output
[20:51:21] jrich523: i'll find and toss in the comment to hide the warnings
[20:51:37] ipee: has joined #ruby
[20:52:14] apeiros: most tools will ignore unused variables if you prefix them with _
[20:52:45] jrich523: the guy who wrote this used that for globals, kinda feel like that would send mixed msgs in this case
[20:53:03] apeiros: glo… bals…?
[20:53:18] apeiros: that code most likely deserves to be screamed at in that case.
[20:53:35] jrich523: perhaps lol
[20:53:42] jrich523: it was tossed at me to "Fix"
[20:53:51] jrich523: my ruby sucks, figured i'd start with lint...
[20:53:55] apeiros: delete the code. no code has no errors.
[20:54:02] jrich523: that alone has given me a huge list of updates lol
[20:54:25] apeiros: I'm being sassy again. ignore me unhelpful comments.
[20:54:48] apeiros: rubocop is more than just linting, though
[20:55:28] apeiros: it also complains about "style violations", and it's not like rubocop's defaults were undisputed
[20:58:23] jrich523: yeah most of what i've google has been disagreement on the rules lol
[20:58:47] apeiros: a plain lint you can get with just `ruby -c codefile.rb`
[20:59:33] jrich523: im using vscode, the rabbit hole of extensions sent me to rubocop
[20:59:39] apeiros: but if you had issues with invalid syntax, you'd get almost certainly immediately a crash.
[20:59:54] apeiros: oh, I would definitively not use an IDE when starting with ruby.
[20:59:57] dogweather: has joined #ruby
[21:00:00] jrich523: yeah this for the most part works well.. most of the problems with it are more so around error handling
[21:00:26] jrich523: notepad does support nix line endings now... i can use that! lol
[21:01:16] apeiros: ok, I did not say I'd use a *crappy* text editor instead.
[21:01:27] jrich523: sublime is my other goto
[21:01:35] apeiros: yeah, sublime is a good choice
[21:03:09] apeiros: note: it may work just fine to edit a project in an IDE if you started writing it in that IDE. if not, chances are good your IDE will struggle with your setup not being perfectly aligned to the IDEs expectations or some other assumptions it makes.
[21:03:34] alfiemax: has joined #ruby
[21:04:11] dviola: has joined #ruby
[21:04:47] yokel: has joined #ruby
[21:05:33] jrich523: actually that was a MAJOR problem before
[21:05:52] jrich523: and ruby is apparently super cool about it, because it will convert my horrible line endings to happy line endings
[21:06:02] apeiros: ruby don't care.
[21:06:13] apeiros: but be a good person and use linux line endings :-p
[21:06:32] jrich523: windows is getting a lot better about that
[21:06:53] jrich523: part of me would love to go to nix or even dual boot.. but god thats such a pain... and i need to play my pc games lol
[21:07:30] apeiros: ACTION got a dedicated box for that
[21:07:50] apeiros: and god I hate the few seconds to minutes I have to spend in windows between booting and starting a game :D
[21:08:01] jrich523: i have a buddy that does that too.. whole different offices
[21:08:25] jrich523: lol exactly, thats why im on windows... i dont have an extra 2 min in my life to waste!
[21:08:48] jrich523: instead i waste hours at work dealing with compatability issues... lol.... ugh...
[21:09:44] apeiros: computers… the bane of humanity, no matter the OS ;-)
[21:10:24] jrich523: yup... keeps us employeed tho :D
[21:10:49] apeiros: yes. always will, because it only becomes worse, lol
[21:11:13] jrich523: lol completely agree
[21:13:10] n0m4d1c: has joined #ruby
[21:17:04] Eiam: 2.3.3 2.3.6 was not a binary compatibility breaking release was it?
[21:17:13] Eiam: It doesn't look it
[21:17:28] Eiam: err, im missing an arrow. 2.3.3 --> 2.3.6
[21:21:17] dogweather: has joined #ruby
[21:23:35] dcunit3d: has joined #ruby
[21:26:25] yokel: has joined #ruby
[21:26:35] apeiros: Eiam: should not. that should have been bugfixes only.
[21:27:12] ciscam: has joined #ruby
[21:33:37] yokel: has joined #ruby
[21:34:03] Eiam: yeah was just thinking back around 1.9 the bug fix that broke json
[21:34:23] apeiros: well, if stuff relies on buggy behavior
[21:34:24] Eiam: (for me, i don't recall how it manifested across the rest of the world"
[21:34:28] ellcs: has joined #ruby
[21:34:38] apeiros: that said, 1.9.0 -> 1.9.3 were not really minor releases
[21:34:42] Eiam: apeiros: compatibility is a big pile of unexpected behavior being made the foundation of expected behavior
[21:34:56] apeiros: for a long time 1.9 was not supposed to be a production version
[21:35:09] Eiam: thats fair
[21:35:31] apeiros: and I think version numbering started to become more consistent with 2.1 or 2.2
[21:35:53] tomphp: has joined #ruby
[21:36:24] banisterfiend: has joined #ruby
[21:37:01] mroutis: has joined #ruby
[21:37:42] chocoelho1: has joined #ruby
[21:38:20] robertothais: has joined #ruby
[21:42:15] robertot1: has joined #ruby
[21:42:49] dcunit3d: has joined #ruby
[21:43:59] kmurphy4: has joined #ruby
[21:51:48] emilford: has joined #ruby
[21:52:19] caleBOT_: has joined #ruby
[21:52:19] caleBOT: has joined #ruby
[21:52:46] mroutis: has joined #ruby
[21:57:25] samosaphile: has joined #ruby
[21:59:19] Mike11: has joined #ruby
[22:00:58] ruby[bot]: has joined #ruby
[22:00:58] ChanServ: +o ruby[bot]
[22:01:27] n0m4d1c: has joined #ruby
[22:02:40] eckhardt: has joined #ruby
[22:07:56] GodFather: has joined #ruby
[22:08:15] Paraxial: has joined #ruby
[22:11:17] cschneid_: has joined #ruby
[22:11:52] gheegh: has joined #ruby
[22:16:31] amar: has joined #ruby
[22:22:13] alfiemax: has joined #ruby
[22:22:37] tAn: has joined #ruby
[22:23:49] GodFather_: has joined #ruby
[22:24:28] Will|: has joined #ruby
[22:24:44] ciscam: has joined #ruby
[22:27:02] Will|: from a semi interactive ruby program (just using #gets), I want to foreground another interactive program (postgres's psql). I think exec would work for that, but I'd like for when I quit psql it'd go back to the the ruby program. It seems like something should be possible, like when other pograms use less for a pager, but I'm not sure how to do this. Anyone have pointers on what to look for?
[22:28:24] jamesaxl: has joined #ruby
[22:28:38] orbyt_: has joined #ruby
[22:30:45] caleBOT_: has joined #ruby
[22:30:45] caleBOT: has joined #ruby
[22:34:18] dogweather: has joined #ruby
[22:35:38] Will|: has joined #ruby
[22:42:07] banisterfiend: has joined #ruby
[22:46:02] dionysus69: has joined #ruby
[22:46:41] caleBOT__: has joined #ruby
[22:46:41] caleBOT_: has joined #ruby
[22:54:21] alfiemax: has joined #ruby
[22:55:26] dogweather: has joined #ruby
[23:01:46] ciscam: has joined #ruby
[23:06:25] SeepingN: has joined #ruby
[23:08:37] envex: has joined #ruby
[23:09:05] envex: has joined #ruby
[23:17:08] sepp2k1: has joined #ruby
[23:19:48] nowhere_man: has joined #ruby
[23:23:36] G: has joined #ruby
[23:28:29] caleBOT: has joined #ruby
[23:28:30] caleBOT__: has joined #ruby
[23:30:01] Azure: has joined #ruby
[23:30:37] arescorpio: has joined #ruby
[23:34:05] dr3wo: has joined #ruby
[23:35:14] nowhere_man: has joined #ruby
[23:38:56] weaksauce: has joined #ruby
[23:40:55] dogweather: has joined #ruby
[23:42:08] dr3wo: has joined #ruby
[23:42:28] emilford: has joined #ruby
[23:46:32] alfiemax: has joined #ruby