« Back to channel list

#ruby - 09 June 2018

« Back 1 day Forward 1 day »
[00:00:12] cthulchu_: how do we exit the annoying output mode
[00:00:18] cthulchu_: the multipage output
[00:00:36] apeiros: also you can trail any command with ";" to suppress output
[00:01:12] cthulchu_: https://i.imgur.com/FOSMRw2.png
[00:01:15] cthulchu_: doesn't work
[00:01:19] cthulchu_: tried ctrl+d
[00:02:23] apeiros: eeeeh, sorry. just "q" :D
[00:02:30] apeiros: ctrl-d is "end of input"
[00:02:43] apeiros: that's how you terminate your binding.pry session.
[00:04:36] cthulchu_: that worked. thanks
[00:06:00] tAn: has joined #ruby
[00:06:08] cthulchu_: beautiful. working with arrays seems to be very-very standard
[00:06:12] chat_: has joined #ruby
[00:15:51] minimalism: has joined #ruby
[00:21:14] jottr: has joined #ruby
[00:30:24] beefjoe: has joined #ruby
[00:31:32] Sembei: has joined #ruby
[00:42:04] mjolnird: has joined #ruby
[00:42:11] _whitelogger: has joined #ruby
[00:42:29] mjolnird: has joined #ruby
[00:50:23] chamar: has joined #ruby
[00:52:45] pabs: has joined #ruby
[00:53:59] BlopMonster: has joined #ruby
[00:58:34] scrooloose: has joined #ruby
[01:02:42] micutzu: has joined #ruby
[01:03:36] gizmore|2: has joined #ruby
[01:06:05] shinnya: has joined #ruby
[01:06:31] ur5us: has joined #ruby
[01:23:55] nicht_: has joined #ruby
[01:24:12] c0ncealed1: has joined #ruby
[01:24:58] Asher: has joined #ruby
[01:38:49] zenspider: has joined #ruby
[01:43:45] bmurt: has joined #ruby
[01:48:51] eelster: has joined #ruby
[02:01:43] orbyt_: has joined #ruby
[02:01:53] Dimik: has joined #ruby
[02:15:05] dviola: has joined #ruby
[02:22:11] jottr: has joined #ruby
[02:37:47] karapetyan: has joined #ruby
[02:40:09] tAn: has joined #ruby
[02:41:32] xt233: has joined #ruby
[02:44:12] pabs: has joined #ruby
[02:54:53] opekktar: has joined #ruby
[02:55:16] eelster: has joined #ruby
[02:57:02] apparition: has joined #ruby
[03:00:11] cadillac_: has joined #ruby
[03:03:17] xt233: has left #ruby: ("Leaving")
[03:11:25] braincrash: has joined #ruby
[03:25:20] agent_white: has joined #ruby
[03:35:46] gix-: has joined #ruby
[03:46:20] cam27: has joined #ruby
[03:47:42] ciscam: has joined #ruby
[03:47:44] pabs: has joined #ruby
[03:53:39] pabs: has joined #ruby
[04:01:25] kapil___: has joined #ruby
[04:11:07] schleppel: has joined #ruby
[04:15:12] Lee_Ash: has joined #ruby
[04:20:39] arekushi: has joined #ruby
[04:23:01] jottr: has joined #ruby
[04:35:06] Lee_Ash: has joined #ruby
[04:39:12] _whitelogger: has joined #ruby
[04:47:38] SolarAquarion: has joined #ruby
[04:47:43] Spiker01: has joined #ruby
[04:55:29] BlopMonster: has joined #ruby
[05:05:49] micutzu: has joined #ruby
[05:06:35] opekktar: has left #ruby: ()
[05:09:46] conta: has joined #ruby
[05:09:52] sauvin: has joined #ruby
[05:11:46] tdy1: has joined #ruby
[05:13:48] Lee_Ash: has joined #ruby
[05:14:43] tAn: has joined #ruby
[05:16:29] snickers: has joined #ruby
[05:22:50] Klumben: has joined #ruby
[05:24:13] halt: has joined #ruby
[05:32:55] _antares_: has joined #ruby
[05:33:13] _antares__: has joined #ruby
[05:38:14] Karuna: has joined #ruby
[05:38:25] RougeR: has joined #ruby
[05:38:44] _antares_: has joined #ruby
[05:41:14] Jman: has joined #ruby
[05:42:38] Jman: Hello Everyone
[05:51:29] mtkd: has joined #ruby
[05:58:00] dionysus69: has joined #ruby
[06:03:33] dminuoso: ACTION pokes baweaver
[06:12:56] conta: has joined #ruby
[06:13:09] snickers: has joined #ruby
[06:23:56] jottr: has joined #ruby
[06:28:24] ramfjord: has joined #ruby
[06:38:25] apeiros: has joined #ruby
[06:39:55] mtkd: has joined #ruby
[07:01:20] riceandbeans: http://dpaste.com/1JSNGMD I'm out of ideas, how would you reduce the ABC of that method?
[07:01:29] za1b1tsu: has joined #ruby
[07:01:49] reber: has joined #ruby
[07:03:32] baweaver: riceandbeans: ABC?
[07:03:52] dinfuehr: has joined #ruby
[07:04:33] riceandbeans: baweaver: assignment branch conditional
[07:04:49] riceandbeans: there's some math problem that says I'm stupid for making that method too complicated
[07:05:16] riceandbeans: I've reduced it from like 50/15 from the previous iteration to 24.1/15
[07:05:20] riceandbeans: So, I think I'm doing ok
[07:05:26] riceandbeans: Still the goal is <= 15
[07:05:28] baweaver: Ah, those things.
[07:05:38] baweaver: They're more of guidelines, really.
[07:05:44] riceandbeans: It's for a Puppet module
[07:05:57] baweaver: that said, look for similarities.
[07:06:04] riceandbeans: Similarities?
[07:06:40] baweaver: Line 4 and 6
[07:06:44] riceandbeans: https://github.com/meltwater/puppet-cpan/blob/554d408927febf080eafeeb616337776a48e6c14/lib/puppet/provider/cpan/default.rb#L28
[07:06:45] baweaver: What's the difference?
[07:06:49] riceandbeans: That's the starting point
[07:07:04] tAn: has joined #ruby
[07:07:49] baweaver: you can abstract methods out
[07:08:14] riceandbeans: shit you're right I have an idea hold on
[07:08:22] cadillac_: has joined #ruby
[07:09:32] baweaver: That, and Open3 has a nicer API if you want to capture status codes
[07:10:34] baweaver: when trying to refactor, group similar things and find out what they have in common, then look for ways to compose the differences with smaller functions.
[07:17:29] riceandbeans: baweaver: http://dpaste.com/1RD8XJV
[07:17:40] riceandbeans: baweaver: down to 18/15
[07:17:58] riceandbeans: I change force to this
[07:18:11] riceandbeans: @force = resource.force? ? 'CPAN::force' : ''
[07:18:34] riceandbeans: Because nothing says this module has made me lose sleep and want to smash things like a ternary operator
[07:23:17] baweaver: You don't really need an instance variable there.
[07:24:02] baweaver: you could probably also abstract the validation of package existence into another method too
[07:24:49] weaksauce: has joined #ruby
[07:24:56] riceandbeans: it lowered the score though
[07:25:15] baweaver: def package_exists?(name) system("perl #{ll} -M#{name} -e1 > /dev/null 2>&1").zero? end
[07:25:16] baweaver: Don't obsess over score
[07:25:24] baweaver: It's a suggestion, not a hard rule
[07:25:52] baweaver: Pointlessly and carelessly abstracting things before they make sense to please an algorithm is a good way to get hard to reason about code
[07:26:42] baweaver: As long as a method does one thing and achieves that task clearly, it's fine
[07:27:05] al2o3-cr: baweaver: system(...).zero? ??
[07:27:15] baweaver: I'm guessing
[07:27:29] baweaver: wrongly, I assume, from the reaction
[07:27:45] baweaver: ACTION probably needs to go to bed.
[07:27:57] al2o3-cr: true on zero false otherwise :)
[07:28:14] baweaver: sleep it is
[07:28:28] TomyLobo: has joined #ruby
[07:28:41] al2o3-cr: no worries dude!
[07:30:22] baweaver: I have some fun announcements coming up on Monday :)
[07:33:15] baweaver: All I can say at the moment is keep an eye on Twitter
[07:34:53] baweaver: Anyways, sleepy time, cheers
[07:35:09] andi: has joined #ruby
[07:35:35] andi: I'm trying to generate a puppet manifest out of a json dataset.
[07:36:28] andi: https://paste.sixhop.net/puuojsheg/z4jz6h This is my script at the moment.
[07:36:51] andi: Can you tell me how I can use the value["name"] as key for the hash of arrays?
[07:37:19] andi: Then I think I'm able to pretty print the hash and puppet can easily read it as manifest.
[07:44:02] riceandbeans: baweaver_away: http://dpaste.com/223H262
[07:44:40] clemens3_: has joined #ruby
[07:47:44] riceandbeans: andi: don't do that
[07:47:57] riceandbeans: andi: you're going to end up with a monstrous maniest
[07:48:31] riceandbeans: andi: I worked at a place that did that for nagios setups, the puppet runs took 20+ minutes
[07:50:06] andi: So it's only for a particular element in my manifest. It's only an array which keeps the list of domains that is managed by puppet. The puppet configuration is written in a way that this manifest really only keeps the array of zones, nothing more.
[07:51:14] andi: What I like to achieve is to automatically generate this list to configure our nameservers out of a json file which I can get from an api. This enables us to manage our domains in a mysql database which will make the process to add new domains much easier.
[07:51:53] andi: It would be a great headache if I would try to build the whole puppet configuration like that, you're right.
[07:52:23] riceandbeans: Well, we had like 30,000 entries build into this massive manifest
[07:54:05] andi: Yes, ok this will take its time. :)
[07:54:24] andi: So can you tell me what I'm doing wrong while create my hash?
[08:03:08] suukim: has joined #ruby
[08:03:24] sameerynho: has joined #ruby
[08:09:18] snickers: has joined #ruby
[08:14:42] micutzu: has joined #ruby
[08:24:46] jottr: has joined #ruby
[08:39:07] sepp2k: has joined #ruby
[08:47:20] reber: has joined #ruby
[08:50:22] Mia: has joined #ruby
[08:50:22] Mia: has joined #ruby
[08:50:54] biberu: has joined #ruby
[08:56:58] BlopMonster: has joined #ruby
[08:57:29] mtkd: has joined #ruby
[09:04:09] amar_: has joined #ruby
[09:27:20] kliq: has joined #ruby
[09:27:28] amar_: has joined #ruby
[09:38:58] amarks: has joined #ruby
[09:39:30] Azure: has joined #ruby
[09:43:21] amar_: has joined #ruby
[09:45:59] plexigras: has joined #ruby
[09:49:04] za1b1tsu: has joined #ruby
[09:54:06] Mike11: has joined #ruby
[09:54:31] FernandoBasso: has joined #ruby
[09:56:56] FernandoBasso: What people use for unicode string manipulation?
[09:57:19] dminuoso: FernandoBasso: String?
[09:57:22] dminuoso: FernandoBasso: What are you trying to do?
[09:57:24] FernandoBasso: I know of unicode_utils, activesupport (I guess that is rails only?)
[09:58:06] FernandoBasso: Hmm. I remember 'ação'.upcase would not upcase the chars 'ç' and 'ã' in the past.
[09:59:40] al2o3-cr: FernandoBasso: does now ;)
[10:00:02] FernandoBasso: Just noticed. Looking for the release notes where this appeared.
[10:02:04] al2o3-cr: >> 'ação'.upcase
[10:02:05] ruby[bot]: al2o3-cr: # => "AçãO" (https://eval.in/1018119)
[10:02:28] al2o3-cr: FernandoBasso: not sure, maybe 2.4+
[10:07:57] micutzu: has joined #ruby
[10:10:15] omth: has joined #ruby
[10:26:57] qknight: has joined #ruby
[10:30:21] qknight: hey. how can i compile https://github.com/stevegraham/slanger/ from source? i'm on ubuntu 18.04 LTS and slanger won't install using 'gem install slanger', see https://gist.github.com/qknight/d19930c11f96da1d7a4af9c4bc792d8f
[10:30:48] qknight: oh, i found this: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=888131 but don't see how it could be helpful
[10:31:40] FernandoBasso: According to this http://blog.honeybadger.io/ruby-s-unicode-support/ and https://www.ruby-lang.org/en/news/2016/12/25/ruby-2-4-0-released/ looks like a few methods handle unicode, not all string methods.
[10:40:21] ellcs: has joined #ruby
[10:40:22] amar_: has joined #ruby
[10:41:29] jottr: has joined #ruby
[10:46:03] BaroMeter: has joined #ruby
[10:51:57] ciscam: has joined #ruby
[10:54:32] sytherax: has joined #ruby
[10:58:09] BlopMonster: has joined #ruby
[11:00:47] desperek: has joined #ruby
[11:02:15] catbusters: has joined #ruby
[11:06:49] mtkd: has joined #ruby
[11:11:10] dionysus69: has joined #ruby
[11:17:26] qknight: i've updated the slanger (Gemfile.lock)'s oj to a more recent version but it won't use it and still fail with the older one
[11:17:29] qknight: https://gist.github.com/qknight/deeeb5de495e8811d06a7d16884cd875
[11:17:40] qknight: why is that:
[11:17:40] qknight: Fetching oj 2.12.14 (was 3.6.2)
[11:17:41] qknight: Installing oj 2.12.14 (was 3.6.2) with native extensions
[11:17:54] qknight: is that some transitive dependency which i missed somehow?
[11:18:14] qknight: however, it worked for the json update...
[11:18:33] konsolebox: has joined #ruby
[11:27:44] akem2: has joined #ruby
[11:32:53] kapil___: has joined #ruby
[11:38:34] ramfjord: has joined #ruby
[11:40:59] akemot: has joined #ruby
[11:50:28] ciscam: has joined #ruby
[11:54:24] akem2: has joined #ruby
[11:59:47] shinnya: has joined #ruby
[12:07:24] Eising: has joined #ruby
[12:10:04] Eising: Hey, I'm reviving an old project of mine that I finished about four years ago. That time it was written in Ruby 1.9 and used the Sinatra microframework together with Sequel ORM. Since I'm effectively salvaging bits of the project in to a new project, I was wondering anyone had any opinions whether I should remain in these frameworks or if in this four years time, they have been obsoleted?
[12:12:42] apeiros: sinatra and sequel are both thriving
[12:13:01] apeiros: so no reason from the side of those two to switch to something else
[12:13:04] apeiros: @ eising ^
[12:13:12] Eising: That's good to hear, thanks :)
[12:13:52] Eising: It's a bit of a task this. Understanding what I was thinking 4+ years ago, even though I actually documented things pretty well.
[12:14:20] Eising: I imagine most of my work will be on the front-end side, since that has moved quite a bit since then
[12:18:16] stretchlimo: has joined #ruby
[12:19:16] AJA4350: has joined #ruby
[12:22:46] jottr: has joined #ruby
[12:38:52] karapetyan: has joined #ruby
[12:40:58] karapetyan: has joined #ruby
[12:44:02] karapety_: has joined #ruby
[12:44:07] Silox|: has joined #ruby
[12:46:48] fmcgeough: has joined #ruby
[12:49:28] AJA4350: has joined #ruby
[13:00:39] whowantstolivefo: has joined #ruby
[13:06:52] amar_: has joined #ruby
[13:10:35] braindead_: has joined #ruby
[13:11:28] cyberg: has joined #ruby
[13:18:45] dionysus69: has joined #ruby
[13:19:42] chamar: has joined #ruby
[13:28:06] whowantstolivefo: has joined #ruby
[13:29:44] Fab: has joined #ruby
[13:52:45] leitz: has joined #ruby
[13:57:55] DLSteve: has joined #ruby
[13:58:30] fmcgeough: has joined #ruby
[14:10:13] havenwood: braindead_: hi
[14:10:51] braindead_: i am a ruby noob (programming in general) and trying to tweak a script. lobste.rs in question
[14:11:05] ciscam: has joined #ruby
[14:11:17] braindead_: there is one part where time is shown. like "x minutes ago"
[14:11:35] braindead_: its looking like this: ago = "#{hours} #{'hours'.pluralize(hours)} ago"
[14:11:55] braindead_: and i want to translate it to german so i tried something like this: ago = "vor #{hours} #{'Stunde'.pluralize(hours)}"
[14:12:09] dreamthese: has joined #ruby
[14:13:02] braindead_: that is working. but there is a problem with the pluralize(hours). the result of this will be "vor 1 Stunde" which is correct. but also "vor 2 Stundes" the s at the end is because of the english pluaralize(hours) function
[14:13:43] braindead_: i tried for many hours now to change it somehow with yml files but i failed
[14:14:18] braindead_: is there a way to hardcode it so it shows: "1 Stunde" and "2 Stunden"?
[14:14:39] clemens3: has joined #ruby
[14:15:26] braindead_: or any other "simple" solution to localize it
[14:18:29] Diogo: has joined #ruby
[14:19:53] braindead_: i am thinking of something like if #{hours} <=1 'Stunde' else 'Stunden' .. of course this is not the syntax but maybe something like this would do the trick
[14:20:18] mtkd: has joined #ruby
[14:23:45] havenwood: braindead_: ActiveSupport::Inflector.inflections(:de) { |inflect| inflect.irregular 'stude', 'studen' }; 'Stude'.pluralize'.pluralize
[14:23:50] havenwood: #=> "Studen"
[14:24:25] havenwood: braindead_: Though it's not irregular, so making regex rules like `inflect.plural /\A.../i, '\1...'` might make more sense.
[14:24:44] havenwood: Though that's going to be tough, as it was a major effort for English, and only works some of the time.
[14:24:57] havenwood: braindead_: Maybe use GetText - I think it has i18n pluralization.
[14:25:11] havenwood: braindead_: Unsure: https://github.com/grosser/gettext_i18n_rails
[14:25:15] havenwood: ?rails braindead_
[14:25:16] ruby[bot]: braindead_: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[14:25:55] braindead_: first of all, thanks for taking care havenwood
[14:26:41] pabs: has joined #ruby
[14:26:51] braindead_: how or where would i use your activesupport solution?
[14:27:10] braindead_: like i said. i am totally not into that
[14:27:14] havenwood: braindead_: http://api.rubyonrails.org/classes/ActiveSupport/Inflector/Inflections.html#method-i-plural
[14:29:06] havenwood: braindead_: This would just put an "n" on the end of everything, for example: ActiveSupport::Inflector.inflections { |inflect| inflect.plural /(.+)/, '\1n' }
[14:29:14] havenwood: 'Stude'.pluralize'.pluralize #=> "Studen"
[14:29:51] havenwood: 'Schlagsahne'.pluralize'.pluralize #=> "Schlagsahnen"
[14:30:21] braindead_: but why? because of the #?
[14:30:28] havenwood: 'Nein'.pluralize'.pluralize #=> "Neinn"
[14:31:06] havenwood: braindead_: Do you understand this part?: inflect.plural /(.+)/, '\1n'
[14:32:08] havenwood: braindead_: The `//` is a Regexp literal. The parens are a match. The `.+` means at least one non-newline character. The `\1` means the first match. The `n` is the character "n" added to each word.
[14:32:16] karapetyan: has joined #ruby
[14:32:31] cdunklau: wow the plural for Nein is really Neins
[14:32:37] havenwood: braindead_: It'd be quite a challenge to add regexp rules to support the German language.
[14:33:17] fmcgeough: has joined #ruby
[14:33:28] braindead_: so how exactly would this example look like? "vor #{hours} #{'Stunde'.pluralize(hours)}"
[14:33:43] braindead_: "vor #{hours} #{'Stunde'.inflect.plural /(.+)/, '\1n'}" ?
[14:34:06] havenwood: braindead_: No, you do the inflector stuff in your `config/initializers/inflections.rb` file.
[14:34:17] havenwood: braindead_: The example would look like your original, but work.
[14:34:27] braindead_: why is life always so complicated
[14:34:27] pabs: has joined #ruby
[14:34:41] havenwood: braindead_: Life finds a way.
[14:35:20] havenwood: https://www.youtube.com/watch?v=dMjQ3hA9mEA
[14:35:22] cdunklau: wouldn't it be better to use a translation file
[14:35:31] braindead_: so one last time please
[14:35:36] braindead_: i copy this string: inflect.plural /(.+)/, '\1n'
[14:35:43] braindead_: into inflections.rb
[14:36:01] havenwood: braindead_: ActiveSupport::Inflector.inflections(:de) { |inflect| inflect.irregular 'stude', 'studen' }
[14:36:18] braindead_: thank you i try it right now
[14:37:02] havenwood: cdunklau: it seems they want pluralization to work, just not English rules
[14:37:21] sphenxes: has joined #ruby
[14:38:00] havenwood: someone might have bothered to do a best effort for German, like Rails has for English - but I don't know the repo
[14:38:24] havenwood: Even the English one will pluralize to one thing, then return to a different singular than it started with...
[14:38:51] braindead_: it still shows "Stundes" instead of "Stunden"
[14:39:08] braindead_: do i need to change something here: ago = "vor #{hours} #{'Stunde'.pluralize(hours)}"
[14:39:09] havenwood: braindead_: are you in :de i18n?
[14:39:27] houhoulis: has joined #ruby
[14:39:37] havenwood: braindead_: Drop the `(:de)` from my example, if not
[14:39:38] havenwood: braindead_: ActiveSupport::Inflector.inflections{ |inflect| inflect.irregular 'stude', 'studen' }
[14:39:41] braindead_: yes i added config.i18n.default_locale = :de to application.rb
[14:39:46] havenwood: braindead_: Then restart the app.
[14:39:49] havenwood: braindead_: Should work.
[14:40:10] havenwood: braindead_: Here, found an article: https://vaidehijoshi.github.io/blog/2015/09/01/inflections-everywhere-using-activesupport-inflector/
[14:40:43] havenwood: braindead_: https://ilanasufrin.github.io/blog/2014/07/30/a-rails-grammar-lesson/
[14:40:48] mzo: has joined #ruby
[14:41:06] braindead_: restartet rails server still Stundes
[14:41:50] havenwood: braindead_: I just tried in a Rails console and it worked fine. Hrm.
[14:41:54] havenwood: braindead_: The #RubyOnRails channel is probably a better place for this, since it's Rails-specific.
[14:43:34] mtkd: has joined #ruby
[14:43:39] havenwood: https://freenode.net/kb/answer/registration
[14:45:08] apparition: has joined #ruby
[14:49:28] braindead_: to reload the script/app is it enough to restart the rails server?
[14:49:57] havenwood: braindead_: yup
[14:50:29] braindead_: than its not working.
[14:50:37] braindead_: ok, ill give it a try in rails
[14:50:43] braindead_: thank you for the input though
[14:50:49] havenwood: you're welcome
[14:57:42] mikecmpbll: has joined #ruby
[14:59:13] BlopMonster: has joined #ruby
[15:00:20] havenwood: braindead_: The ActiveSupport::Inflector solution from #ruby definitely works. Gist your: config/initializers/inflections.rb
[15:01:07] havenwood: braindead_: Meant that to be in #RubyOnRails. If you gist the file there I'm sure someone can spot what's up.
[15:02:32] braindead_: except for your line its empty
[15:02:39] braindead_: just some comments
[15:03:49] braindead_: thats what i included: ActiveSupport::Inflector.inflections(:de) { |inflect| inflect.irregular 'Stunde', 'Studen' }
[15:03:51] Esa_: has joined #ruby
[15:04:46] pabs: has joined #ruby
[15:06:13] havenwood: braindead_: And that's in your?: config/initializers/inflections.rb
[15:06:36] havenwood: braindead_: Try restarting. Maybe Spring is borking you.
[15:06:49] havenwood: Dunno! Works on my machine.
[15:07:31] braindead_: i mean i could get rid of the :de to test it again
[15:08:55] braindead_: cant believe it. without de it worked
[15:09:02] braindead_: so this is not correct
[15:09:05] braindead_: config.i18n.default_locale = :de
[15:09:11] braindead_: i added this to application.rb
[15:09:19] eam: why don't we ever run production on developer machines, the code always works there :D
[15:09:51] havenwood: ACTION ships his laptop to be installed on a rack in prod
[15:11:30] braindead_: to add the same thing for "Minute" and "Minuten" do i need to copy the whole thing or can i squeeze it in there?
[15:11:55] havenwood: braindead_: Seems you just haven't setup your i18n, in your application_controller.rb for example. The Rails channel is still the best place for this. ;-P
[15:12:14] havenwood: braindead_: See the docs: http://guides.rubyonrails.org/i18n.html#managing-the-locale-across-requests
[15:13:02] havenwood: braindead_: I'm moving to the other channel to give you Rails suggestions.
[15:19:40] dionysus69: has joined #ruby
[15:23:38] rippa: has joined #ruby
[15:24:53] pabs: has joined #ruby
[15:25:43] karapetyan: has joined #ruby
[15:32:04] za1b1tsu: has joined #ruby
[15:34:03] akaiiro: has joined #ruby
[15:34:12] emilford: has joined #ruby
[15:41:06] pabs: has joined #ruby
[15:46:01] orbyt_: has joined #ruby
[15:46:52] TinkerT: has joined #ruby
[15:47:22] karapetyan: has joined #ruby
[15:52:01] karapetyan: has joined #ruby
[15:52:18] sytherax: has joined #ruby
[15:58:04] amar_: has joined #ruby
[16:00:38] ciscam: has joined #ruby
[16:18:11] yokel: has joined #ruby
[16:19:50] whowantstolivefo: has joined #ruby
[16:22:28] samosaphile: has joined #ruby
[16:26:58] hph^: has joined #ruby
[16:30:02] za1b1tsu: has joined #ruby
[16:30:44] mzo: has joined #ruby
[16:32:53] mtkd: has joined #ruby
[16:36:47] whowantstolivef1: has joined #ruby
[16:38:58] ramfjord: has joined #ruby
[16:47:50] psychicist__: has joined #ruby
[16:50:04] karapetyan: has joined #ruby
[16:50:26] mtkd: has joined #ruby
[16:51:39] whowantstolivefo: has joined #ruby
[16:57:21] Silox|: has joined #ruby
[17:00:31] DTZUZO: has joined #ruby
[17:00:51] Silox|: has joined #ruby
[17:06:11] ramfjord: has joined #ruby
[17:06:31] Dimik: has joined #ruby
[17:09:09] Diogo: has joined #ruby
[17:10:24] shenghi: has joined #ruby
[17:18:35] jsrn: has joined #ruby
[17:20:26] orbyt_: has joined #ruby
[17:20:51] karapetyan: has joined #ruby
[17:22:24] emilford: has joined #ruby
[17:36:04] pacorro2000: has joined #ruby
[17:41:26] Raboo: has joined #ruby
[17:50:42] konsolebox: has joined #ruby
[17:54:14] RougeR: anyone able to help with this error:https://stackoverflow.com/questions/46384345/permission-denied-rb-sysopen-gem-install-pg-on-ubuntu-16-04
[17:54:22] RougeR: trying to get the postgres gem setup
[17:59:20] TomyLobo2: has joined #ruby
[18:00:57] Flashynuff_: has joined #ruby
[18:01:42] konsolebox_: has joined #ruby
[18:01:55] diego_k: has joined #ruby
[18:02:00] ged_: has joined #ruby
[18:02:05] conr_: has joined #ruby
[18:02:37] tw1sted_: has joined #ruby
[18:02:39] c0ncealed2: has joined #ruby
[18:02:42] rmsaksida: has joined #ruby
[18:02:50] claws: has joined #ruby
[18:03:10] ski4x7: has joined #ruby
[18:03:14] sonne_: has joined #ruby
[18:03:19] canton7: has joined #ruby
[18:03:20] Emmanuel_Chanel_: has joined #ruby
[18:03:28] zmo: has joined #ruby
[18:03:37] fmcgeough: has joined #ruby
[18:03:51] zmo: I'm getting an exception such as: `NoMethodError: undefined method `name' for #<Hash:0x000055ca65ee83d0>`
[18:04:15] zmo: and I'm having a hard time finding out what's in the hash being referenced
[18:04:16] reber: has joined #ruby
[18:04:20] ujjain: has joined #ruby
[18:04:20] ujjain: has joined #ruby
[18:04:27] havenwood: has joined #ruby
[18:04:27] havenwood: has joined #ruby
[18:04:43] zmo: I was wondering if it was possible to get the hash's content using the object's reference address
[18:05:06] zmo: i.e.: `0x000055ca65ee83d0` in my example above
[18:06:14] giraffe: has joined #ruby
[18:06:20] EvilJStoker: has joined #ruby
[18:06:30] bipul: has joined #ruby
[18:06:51] Emmanuel_Chanel: has joined #ruby
[18:08:57] sudorobo: has joined #ruby
[18:08:57] sudorobo: has joined #ruby
[18:09:01] mzo: has joined #ruby
[18:09:15] dinfuehr: has joined #ruby
[18:09:20] canton7: has joined #ruby
[18:11:33] Megamos: has joined #ruby
[18:12:02] heyimwill: has joined #ruby
[18:14:15] mtkd: has joined #ruby
[18:18:42] sytherax: has joined #ruby
[18:25:08] houhoulis: has joined #ruby
[18:30:17] RougeR: zmo: doesnt it give you a line number
[18:33:35] mtkd: has joined #ruby
[18:34:01] clemens3_: has joined #ruby
[18:34:09] nicht: has joined #ruby
[18:36:07] zmo: well, it's within a lib that transforms the data I'm giving to it
[18:36:26] amar: has joined #ruby
[18:37:08] zmo: basically, I'm transforming a hash into an object (using the HashIt snippet found through google/SO)
[18:37:36] zmo: and it fails to transform an encapsulated hash, and I need to find why
[18:38:56] za1b1tsu: has joined #ruby
[18:39:28] sytherax: has joined #ruby
[18:40:15] RougeR: can you stick in binding pry
[18:40:36] RougeR: you should be able to see all objects with it when it breaks
[18:40:52] RougeR: and no you cant reverse look up via memory address afaik
[18:41:24] sytherax: has joined #ruby
[18:43:33] RougeR: zmo: for the memory address way; https://medium.com/@astantona/fiddling-with-rubys-fiddle-39f991dd0565
[18:46:37] RougeR: zmo: you can also access local_variables/instance_variables that are in scope
[18:46:43] RougeR: then iterate and match
[18:47:00] amar: has joined #ruby
[18:48:41] RougeR: local_variables.each {|x| puts x if (eval x.to_s).object_id == bar.object_id}
[18:50:27] zmo: hm it's definitely not local though :-/
[18:52:09] jamesaxl: has joined #ruby
[18:53:18] zmo: though I think I found the culprit hash… now I have to find out why it's not transformed
[19:00:41] BlopMonster: has joined #ruby
[19:04:31] mtkd: has joined #ruby
[19:04:53] karapetyan: has joined #ruby
[19:10:33] cadillac_: has joined #ruby
[19:11:49] Megamos: has joined #ruby
[19:16:40] desperek: has joined #ruby
[19:21:42] conta: has joined #ruby
[19:21:47] rabajaj_: has joined #ruby
[19:26:16] rabajaj_: hey, i am trying to do something like https://paste.fedoraproject.org/paste/3RU8terBrwd0JwsTFDPy9Q
[19:26:29] rabajaj_: any help would be highly appriciated
[19:26:53] rabajaj_: as/appriciated/appreciated
[19:27:38] rabajaj_: basically i am not being able to interpolate a key from the hash
[19:32:44] minimalism: has joined #ruby
[19:43:45] pabs: has joined #ruby
[19:48:51] RougeR: has joined #ruby
[19:50:25] Mike11: has joined #ruby
[19:51:07] pabs: has joined #ruby
[19:53:31] tdy1: has joined #ruby
[19:53:50] t0xik: has joined #ruby
[20:02:01] ellcs: has joined #ruby
[20:08:04] za1b1tsu: has joined #ruby
[20:10:19] kmurphy4: has joined #ruby
[20:15:11] ur5us: has joined #ruby
[20:18:49] psprint_: has joined #ruby
[20:19:46] psprint_: Hello. Do someone use ruby at command line, with the -e switch, like perl one-liners?
[20:20:19] mzo: has joined #ruby
[20:23:43] \void: has joined #ruby
[20:30:05] RougeR: has joined #ruby
[20:30:05] RougeR: has joined #ruby
[20:33:45] Giphy[m]: has joined #ruby
[20:43:13] jottr: has joined #ruby
[20:49:33] apeiros: psprint: sometimes for small pieces of code, why?
[20:53:48] psprint: apeiros: I'm writing in-prompt colorized keywords, braces, already have such function for awk & perl
[20:54:30] psprint: something like this, requires ruby to have "compile, syntax check only" perl example: https://asciinema.org/a/186098
[20:55:39] apeiros: looks interesting
[20:56:36] psprint: I can code this for Ruby, two issues a) do people use Ruby inline? b) does ruby have "syntax error checker"
[20:57:12] apeiros: for syntax check
[20:57:14] lupine: "use ruby inline" ?
[20:57:26] apeiros: but I think `ruby -e` is used rather rarely
[20:57:31] psprint: lupine: like perl highlighters, the 1 liners
[20:57:36] apeiros: irb/pry is much more often used
[20:58:58] Zarthus: i would prefer irb/pry over a CLI highlighting with `ruby -e` too
[20:58:59] psprint: I just make my own version
[20:59:12] Zarthus: the moment my expression becomes too lengthy I'm fucked.
[21:01:50] isene: has joined #ruby
[21:01:59] akaiiro: has joined #ruby
[21:03:04] isene: Is there a way to compile a ruby program into a stand-alone executable on Linux?
[21:06:00] chussenot: has joined #ruby
[21:07:32] bascht: has joined #ruby
[21:07:32] intheclouddan: has joined #ruby
[21:07:32] jonjits[m]: has joined #ruby
[21:07:32] luna_x[m]: has joined #ruby
[21:07:32] iceskins[m]: has joined #ruby
[21:07:32] redlegion[m]: has joined #ruby
[21:07:32] Hanma[m]: has joined #ruby
[21:07:32] turt2live: has joined #ruby
[21:07:33] haylon_: has joined #ruby
[21:07:33] velu_aon[m]: has joined #ruby
[21:07:33] KevinMGranger: has joined #ruby
[21:07:33] aviraldg: has joined #ruby
[21:07:40] zalipuha[m]: has joined #ruby
[21:08:16] karapetyan: has joined #ruby
[21:09:12] mtkd: has joined #ruby
[21:09:23] mikeiniowa: has joined #ruby
[21:09:33] pabs: has joined #ruby
[21:09:39] karapetyan: has joined #ruby
[21:09:40] tAn: has joined #ruby
[21:17:16] kmurphy4: has joined #ruby
[21:22:45] RougeR: has joined #ruby
[21:22:45] RougeR: has joined #ruby
[21:23:19] RougeR: zmo: you can also use instance and global the same way fyi. glad you found it though
[21:28:25] Megamos: has joined #ruby
[21:30:58] Some-body_: has joined #ruby
[21:36:30] gr33n7007h: has joined #ruby
[21:39:43] akaiiro: has joined #ruby
[21:44:34] eyedrop: has joined #ruby
[21:46:20] amar: has joined #ruby
[21:47:36] pabs: has joined #ruby
[21:49:06] Megamos: has joined #ruby
[21:49:53] eyedrop: Hello everyone. I've a very newbie problem and can't understand why it doesn't work. https://pastebin.com/raw/1V0nu5Xa Any explanation would be really appreciated.
[21:50:02] ruby[bot]: eyedrop: 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
[21:53:46] akaiiro: eyedrop do you see any error message?
[21:54:49] eyedrop: akaiiro: No, it just can't read the value of variable. On other hand, something like this would work: https://gist.githubusercontent.com/Seenox/58438c12c449e4b3d35f3c833cbe40af/raw/1087901df7089bd301224029579900ec994da33e/gistfile1.txt
[21:55:29] eyedrop: akaiiro: Is it because of the order of variables? Just trying to understand how it works.
[21:56:39] yaiyaichu: has joined #ruby
[21:56:56] akaiiro: eyedrop yes, the order of the instructions matter
[21:57:14] eyedrop: akaiiro: Thanks.
[21:59:31] BlopMonster: has joined #ruby
[22:00:49] nicht: has joined #ruby
[22:00:51] orbyt_: has joined #ruby
[22:01:27] yaiyaichu: Hi all. I hope you guys don't mind if I bother you with a question :) . I'm trying to run my ruby program (a web scraper) as a cronjob with the whenever gem. My cron job command cds into the directory with the Gemfile and runs the script with bundle exec. When the scheduled job runs, bundler says it cannot find the gem ffi in any of the sources. Any thoughts on why that happens? - The cronjob is run with
[22:01:33] yaiyaichu: my user. Also, I use rbenv.
[22:02:16] yaiyaichu: Please let me know if you need any additional info, and I'll gladly provide it.
[22:07:23] apeiros: yaiyaichu: the usual suspect there is a different env
[22:07:38] apeiros: can even be the case if it's run with the same user, since that doesn't necessarily mean it's a login shell
[22:07:55] apeiros: but I don't know enough about rbenv to give a sensible tip
[22:08:01] apeiros: s/tip/hint/
[22:12:41] braindead_: when i run my production enviroment i get IP - - [09/Jun/2018:22:06:08 UTC] "GET / HTTP/1.0" 301 0
[22:12:44] braindead_: anybody an idea what that could be?
[22:13:22] braindead_: i mean it sounds like nginx redirect problem but its working in dev
[22:26:00] ramfjord: has joined #ruby
[22:29:00] dviola: has joined #ruby
[22:30:17] Paraxial: has joined #ruby
[22:33:39] akaiiro: braindead_ are you using the same commands and settings to start you application in both environments?
[22:35:20] braindead_: akaiiro: i dont know if you mean this but to start dev i just use "rails server -b 0.0.0.0" and for prodution "rails server -e production" .. do you mean this?
[22:39:09] akaiiro: braindead_ yes, for example, I use this in production `bundle exec puma -C ./config/puma.rb` and then in nginx `upstream puma { server my_server_name:3000 }`
[22:42:39] braindead_: akaiiro: take a look at the very bottom of the page: https://github.com/lobsters/lobsters
[22:42:51] braindead_: it looks somehow similar to what you write
[22:45:33] akaiiro: braindead_ seems that your project uses unicorn instead of puma
[22:46:31] akaiiro: what is your .conf for nginx?
[22:46:48] yaiyaichu: has joined #ruby
[22:47:05] braindead_: location ~ / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; ##Use the domain.tld here. proxy_pass http://g33kz.de:3000; }
[22:48:15] akaiiro: seems pretty sparse for an nginx .conf file (but I have only seen the one for the app I manage, hehe)
[22:48:50] braindead_: do you start your server with just: bundle ...
[22:49:02] BlopMonster: has joined #ruby
[22:49:03] braindead_: no rails before it?
[22:50:22] akaiiro: braindead_ yes, it uses bundle but I have to start puma manually cause it is an old rails version
[22:51:06] akaiiro: here, in this article are a sample .conf settings for nginx with puma https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-unicorn-and-nginx-on-ubuntu-14-04
[22:52:41] pabs: has joined #ruby
[22:53:11] yaiyaichu: has joined #ruby
[22:55:02] planigan: has joined #ruby
[23:03:08] braindead_: found the error
[23:03:15] braindead_: config.force_ssl = true was the problem
[23:03:28] braindead_: changed it to false and boom
[23:04:07] braindead_: because i do ssl externaly
[23:39:01] orbyt_: has joined #ruby
[23:39:18] emilford: has joined #ruby
[23:42:36] spencer: has joined #ruby
[23:44:14] nicht_: has joined #ruby
[23:56:32] nicht: has joined #ruby
[23:58:48] emilford: has joined #ruby