havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.1, 2.4.4, 2.3.7, 2.6.0-preview2: https://www.ruby-lang.org | Paste 4+ lines of text to https://gist.github.com | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby
<cthulchu_> how do we exit the annoying output mode
<cthulchu_> the multipage output
<apeiros> ctrl-d
<apeiros> also you can trail any command with ";" to suppress output
FernandoBasso has quit [Quit: Leaving]
<cthulchu_> doesn't work
<cthulchu_> tried ctrl+d
<apeiros> eeeeh, sorry. just "q" :D
<apeiros> ctrl-d is "end of input"
<apeiros> that's how you terminate your binding.pry session.
<cthulchu_> that worked. thanks
ta_ has joined #ruby
<cthulchu_> beautiful. working with arrays seems to be very-very standard
chat_ has joined #ruby
chat has quit [Ping timeout: 264 seconds]
micutzu has quit [Ping timeout: 264 seconds]
cthulchu_ has quit [Ping timeout: 240 seconds]
minimalism has joined #ruby
reber__ has quit [Remote host closed the connection]
jottr has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
jcarl43 has quit [Quit: WeeChat 2.1]
Sembei has quit [Max SendQ exceeded]
beefjoe has joined #ruby
Sembei has joined #ruby
tdy1 has quit [Ping timeout: 268 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ta_ has quit [Ping timeout: 248 seconds]
_whitelogger has joined #ruby
mjolnird has joined #ruby
pabs has quit [Ping timeout: 260 seconds]
chamar has joined #ruby
pabs has joined #ruby
BlopMonster has joined #ruby
scrooloose has joined #ruby
npgm has quit [Quit: Connection closed for inactivity]
BlopMonster has quit [Ping timeout: 276 seconds]
micutzu has joined #ruby
gizmore|2 has joined #ruby
shinnya has joined #ruby
ur5us has joined #ruby
gizmore has quit [Ping timeout: 240 seconds]
[Butch] has quit [Quit: Textual IRC Client: www.textualapp.com]
mjolnird has quit [Remote host closed the connection]
chamar has quit [Quit: Leaving]
c0ncealed1 has quit [Remote host closed the connection]
nicht_ has joined #ruby
c0ncealed1 has joined #ruby
Asher has joined #ruby
apeiros has quit [Ping timeout: 265 seconds]
ur5us has quit [Remote host closed the connection]
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
karapety_ has quit [Remote host closed the connection]
zenspider has quit [Ping timeout: 256 seconds]
zenspider has joined #ruby
bmurt has joined #ruby
eelster has joined #ruby
RougeR has quit [Ping timeout: 260 seconds]
Axy has quit [Read error: Connection reset by peer]
orbyt_ has joined #ruby
Dimik has joined #ruby
eelster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dviola has quit [Quit: WeeChat 2.1]
nicht_ has quit [Ping timeout: 245 seconds]
ogres has quit [Quit: Connection closed for inactivity]
dviola has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has joined #ruby
jottr has quit [Ping timeout: 256 seconds]
beefjoe has quit [Remote host closed the connection]
karapetyan has joined #ruby
ta_ has joined #ruby
xt233 has joined #ruby
karapetyan has quit [Ping timeout: 240 seconds]
pabs has quit [Ping timeout: 240 seconds]
pabs has joined #ruby
BigRonnieRon has quit [Quit: Textual IRC Client: www.textualapp.com]
opekktar has joined #ruby
eelster has joined #ruby
apparition has joined #ruby
cadillac_ has quit [Quit: I quit]
cadillac_ has joined #ruby
xt233 has left #ruby ["Leaving"]
braincrash has quit [Quit: bye bye]
ta_ has quit [Ping timeout: 245 seconds]
braincrash has joined #ruby
sylario has quit [Quit: Connection closed for inactivity]
agent_white has quit [Quit: brb]
AJA4350 has quit [Remote host closed the connection]
agent_white has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
cam27 has joined #ruby
ciscam has quit [Ping timeout: 245 seconds]
pabs has quit [Ping timeout: 240 seconds]
ciscam has joined #ruby
pabs has joined #ruby
pabs has quit [Ping timeout: 260 seconds]
pabs has joined #ruby
SolarAquarion has quit [Quit: PanicBNC - http://PanicBNC.net]
Klumben has quit [Quit: Bye for now]
kapil___ has joined #ruby
schleppel has joined #ruby
Lee_Ash has joined #ruby
micutzu has quit [Ping timeout: 256 seconds]
arekushi has joined #ruby
jottr has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has quit [Ping timeout: 260 seconds]
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
Lee_Ash has quit [Remote host closed the connection]
Lee_Ash has joined #ruby
_whitelogger has joined #ruby
jamesaxl has quit [Quit: WeeChat 2.1]
apparition has quit [Quit: Bye]
SolarAquarion has joined #ruby
Spiker01 has joined #ruby
Spiker01 has quit [Quit: Konversation terminated!]
BlopMonster has joined #ruby
BlopMonster has quit [Ping timeout: 245 seconds]
micutzu has joined #ruby
opekktar has left #ruby [#ruby]
conta has joined #ruby
sauvin has joined #ruby
Lee_Ash has quit [Ping timeout: 240 seconds]
tdy1 has joined #ruby
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Lee_Ash has joined #ruby
ta_ has joined #ruby
snickers has joined #ruby
snickers has quit [Client Quit]
Klumben has joined #ruby
halt has joined #ruby
halt is now known as Guest62369
dviola has quit [Quit: WeeChat 2.1]
_antares_ has joined #ruby
_antares_ has quit [Remote host closed the connection]
_antares__ has joined #ruby
_antares__ is now known as karuna
karuna has quit [Client Quit]
karuna has joined #ruby
RougeR has joined #ruby
_antares_ has joined #ruby
Lee_Ash has quit [Quit: Leaving]
_antares_ is now known as karuna_
karuna_ has quit [Client Quit]
ta_ has quit [Ping timeout: 256 seconds]
Jman has joined #ruby
<Jman> Hello Everyone
<baweaver> Alo alo
mtkd has joined #ruby
dionysus69 has joined #ruby
* dminuoso pokes baweaver
conta has quit [Quit: conta]
conta has joined #ruby
snickers has joined #ruby
<baweaver> mm?
conta has quit [Client Quit]
\void has quit [Quit: So long, and thanks for all the fish.]
jottr has joined #ruby
ramfjord has joined #ruby
jottr has quit [Ping timeout: 264 seconds]
apeiros has joined #ruby
mtkd has quit []
mtkd has joined #ruby
dionysus69 has quit [Ping timeout: 268 seconds]
cam27 has quit [Quit: cam27]
<riceandbeans> http://dpaste.com/1JSNGMD I'm out of ideas, how would you reduce the ABC of that method?
za1b1tsu has joined #ruby
Jman has quit [Ping timeout: 260 seconds]
reber has joined #ruby
dinfuehr has quit [Ping timeout: 264 seconds]
<baweaver> rice
<baweaver> riceandbeans: ABC?
dinfuehr has joined #ruby
<riceandbeans> baweaver: assignment branch conditional
<riceandbeans> there's some math problem that says I'm stupid for making that method too complicated
cadillac_ has quit [Read error: Connection reset by peer]
<riceandbeans> I've reduced it from like 50/15 from the previous iteration to 24.1/15
<riceandbeans> So, I think I'm doing ok
<riceandbeans> Still the goal is <= 15
<baweaver> Ah, those things.
<baweaver> They're more of guidelines, really.
<riceandbeans> It's for a Puppet module
Dimik has quit [Ping timeout: 256 seconds]
<baweaver> that said, look for similarities.
<riceandbeans> Similarities?
<riceandbeans> One sec
<baweaver> Line 4 and 6
<baweaver> What's the difference?
<riceandbeans> That's the starting point
ta_ has joined #ruby
<baweaver> you can abstract methods out
<riceandbeans> shit you're right I have an idea hold on
cadillac_ has joined #ruby
<baweaver> That, and Open3 has a nicer API if you want to capture status codes
<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.
akaiiro has quit [Remote host closed the connection]
<riceandbeans> baweaver: http://dpaste.com/1RD8XJV
<riceandbeans> baweaver: v3
<riceandbeans> baweaver: down to 18/15
<riceandbeans> I change force to this
<riceandbeans> @force = resource.force? ? 'CPAN::force' : ''
<riceandbeans> Because nothing says this module has made me lose sleep and want to smash things like a ternary operator
<baweaver> You don't really need an instance variable there.
weaksauce has quit [Quit: Textual IRC Client: www.textualapp.com]
<baweaver> you could probably also abstract the validation of package existence into another method too
weaksauce has joined #ruby
<riceandbeans> it lowered the score though
<baweaver> def package_exists?(name) system("perl #{ll} -M#{name} -e1 > /dev/null 2>&1").zero? end
<baweaver> Don't obsess over score
<baweaver> It's a suggestion, not a hard rule
<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
<baweaver> As long as a method does one thing and achieves that task clearly, it's fine
<al2o3-cr> baweaver: system(...).zero? ??
<baweaver> I'm guessing
<baweaver> wrongly, I assume, from the reaction
* baweaver probably needs to go to bed.
<al2o3-cr> true on zero false otherwise :)
<baweaver> Yep
<baweaver> sleep it is
TomyLobo has joined #ruby
<al2o3-cr> no worries dude!
<baweaver> I have some fun announcements coming up on Monday :)
<baweaver> All I can say at the moment is keep an eye on Twitter
<baweaver> Anyways, sleepy time, cheers
andi has joined #ruby
<andi> Hello
baweaver is now known as baweaver_away
<andi> I'm trying to generate a puppet manifest out of a json dataset.
<andi> https://paste.sixhop.net/puuojsheg/z4jz6h This is my script at the moment.
<andi> Can you tell me how I can use the value["name"] as key for the hash of arrays?
<andi> Then I think I'm able to pretty print the hash and puppet can easily read it as manifest.
<riceandbeans> baweaver_away: http://dpaste.com/223H262
clemens3_ has joined #ruby
<riceandbeans> andi: don't do that
<riceandbeans> andi: you're going to end up with a monstrous maniest
<riceandbeans> andi: I worked at a place that did that for nagios setups, the puppet runs took 20+ minutes
<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.
<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.
<andi> It would be a great headache if I would try to build the whole puppet configuration like that, you're right.
<riceandbeans> Well, we had like 30,000 entries build into this massive manifest
<andi> Yes, ok this will take its time. :)
<andi> So can you tell me what I'm doing wrong while create my hash?
reber has quit [Remote host closed the connection]
suukim has joined #ruby
sameerynho has joined #ruby
micutzu has quit [Ping timeout: 248 seconds]
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ta_ has quit [Remote host closed the connection]
snickers has joined #ruby
karuna has quit [Quit: Connection closed for inactivity]
micutzu has joined #ruby
jottr has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
sepp2k has joined #ruby
reber has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
biberu has joined #ruby
mtkd has quit [Ping timeout: 260 seconds]
BlopMonster has joined #ruby
mtkd has joined #ruby
BlopMonster has quit [Ping timeout: 264 seconds]
amar_ has joined #ruby
amar_ has quit [Ping timeout: 265 seconds]
za1b1tsu has quit [Quit: WeeChat 2.1]
micutzu has quit [Ping timeout: 248 seconds]
kliq has joined #ruby
amar_ has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
amar__ has joined #ruby
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
amar_ has quit [Ping timeout: 240 seconds]
ramfjord has quit [Ping timeout: 265 seconds]
amar__ has quit [Remote host closed the connection]
amar_ has joined #ruby
plexigras has joined #ruby
amar_ has quit [Ping timeout: 248 seconds]
za1b1tsu has joined #ruby
Mike11 has joined #ruby
FernandoBasso has joined #ruby
za1b1tsu has quit [Quit: WeeChat 2.1]
<FernandoBasso> What people use for unicode string manipulation?
<dminuoso> FernandoBasso: String?
<dminuoso> FernandoBasso: What are you trying to do?
<FernandoBasso> I know of unicode_utils, activesupport (I guess that is rails only?)
<FernandoBasso> Hmm. I remember 'ação'.upcase would not upcase the chars 'ç' and 'ã' in the past.
<al2o3-cr> FernandoBasso: does now ;)
<FernandoBasso> Just noticed. Looking for the release notes where this appeared.
<al2o3-cr> >> 'ação'.upcase
<ruby[bot]> al2o3-cr: # => "AçãO" (https://eval.in/1018119)
<al2o3-cr> FernandoBasso: not sure, maybe 2.4+
micutzu has joined #ruby
omth has quit [Remote host closed the connection]
omth has joined #ruby
qknight has joined #ruby
<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
<qknight> oh, i found this: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=888131 but don't see how it could be helpful
<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.
ellcs has joined #ruby
amar_ has joined #ruby
ellcs has quit [Client Quit]
jottr has joined #ruby
amar_ has quit [Ping timeout: 265 seconds]
BaroMeter has joined #ruby
ciscam has quit [Ping timeout: 264 seconds]
ciscam has joined #ruby
mtkd has quit []
sytherax has joined #ruby
BlopMonster has joined #ruby
desperek has joined #ruby
sytherax has quit [Remote host closed the connection]
catbusters has joined #ruby
BlopMonster has quit [Ping timeout: 240 seconds]
mtkd has joined #ruby
Mike11 has quit [Ping timeout: 264 seconds]
dionysus69 has joined #ruby
shinnya has quit [Ping timeout: 248 seconds]
<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
<qknight> why is that:
<qknight> Installing oj 2.12.14 (was 3.6.2) with native extensions
<qknight> Fetching oj 2.12.14 (was 3.6.2)
<qknight> is that some transitive dependency which i missed somehow?
<qknight> however, it worked for the json update...
konsolebox has joined #ruby
akem_ has joined #ruby
akem has quit [Ping timeout: 264 seconds]
kapil___ has joined #ruby
ramfjord has joined #ruby
desperek has quit [Quit: xoxo]
akem__ has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
akem_ has quit [Ping timeout: 264 seconds]
ciscam has quit [Ping timeout: 240 seconds]
ciscam has joined #ruby
BaroMeter has quit [Ping timeout: 260 seconds]
jottr has quit [Ping timeout: 265 seconds]
akem_ has joined #ruby
mtkd has quit []
akem__ has quit [Ping timeout: 260 seconds]
qknight has quit [Quit: Lost terminal]
shinnya has joined #ruby
akem_ has quit [Quit: Leaving]
eising has joined #ruby
<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?
<apeiros> sinatra and sequel are both thriving
<apeiros> so no reason from the side of those two to switch to something else
<apeiros> @ eising ^
<eising> That's good to hear, thanks :)
<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.
<eising> I imagine most of my work will be on the front-end side, since that has moved quite a bit since then
eelster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
stretchlimo has joined #ruby
AJA4350 has joined #ruby
stretchlimo has quit [Client Quit]
jottr has joined #ruby
minimalism has quit [Quit: minimalism]
jottr has quit [Ping timeout: 248 seconds]
karapetyan has joined #ruby
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
karapety_ has joined #ruby
Silox| has joined #ruby
fmcgeough has joined #ruby
karapetyan has quit [Ping timeout: 265 seconds]
AJA4350 has quit [Remote host closed the connection]
AJA4350 has joined #ruby
whowantstolivefo has quit [Ping timeout: 260 seconds]
dionysus69 has quit [Ping timeout: 260 seconds]
agent_white has quit [Quit: napteim]
whowantstolivefo has joined #ruby
amar_ has joined #ruby
whowantstolivefo has quit [Ping timeout: 248 seconds]
braindead_ has joined #ruby
cyberg has joined #ruby
dionysus69 has joined #ruby
chamar has joined #ruby
whowantstolivefo has joined #ruby
fab has joined #ruby
fab has quit [Client Quit]
fmcgeough has quit [Quit: fmcgeough]
chamar has quit [Quit: Leaving]
shinnya has quit [Ping timeout: 264 seconds]
sepp2k has quit [Read error: Connection reset by peer]
leitz has joined #ruby
DLSteve has joined #ruby
fmcgeough has joined #ruby
t0xik has quit [Quit: Connection closed for inactivity]
<braindead_> hello all
dreamthese has quit [Ping timeout: 248 seconds]
<havenwood> braindead_: hi
ciscam has quit [Ping timeout: 260 seconds]
<braindead_> i am a ruby noob (programming in general) and trying to tweak a script. lobste.rs in question
ciscam has joined #ruby
<braindead_> there is one part where time is shown. like "x minutes ago"
<braindead_> its looking like this: ago = "#{hours} #{'hours'.pluralize(hours)} ago"
catbusters has quit [Quit: Connection closed for inactivity]
<braindead_> and i want to translate it to german so i tried something like this: ago = "vor #{hours} #{'Stunde'.pluralize(hours)}"
dreamthese has joined #ruby
<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
<braindead_> i tried for many hours now to change it somehow with yml files but i failed
<braindead_> is there a way to hardcode it so it shows: "1 Stunde" and "2 Stunden"?
clemens3 has joined #ruby
pabs has quit [Ping timeout: 265 seconds]
<braindead_> or any other "simple" solution to localize it
Diogo has joined #ruby
<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
mtkd has joined #ruby
<havenwood> braindead_: ActiveSupport::Inflector.inflections(:de) { |inflect| inflect.irregular 'stude', 'studen' }; 'Stude'.pluralize'.pluralize
<havenwood> #=> "Studen"
<havenwood> braindead_: Though it's not irregular, so making regex rules like `inflect.plural /\A.../i, '\1...'` might make more sense.
<havenwood> Though that's going to be tough, as it was a major effort for English, and only works some of the time.
<havenwood> braindead_: Maybe use GetText - I think it has i18n pluralization.
<havenwood> braindead_: Unsure: https://github.com/grosser/gettext_i18n_rails
<ruby[bot]> braindead_: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<havenwood> ?rails braindead_
<braindead_> first of all, thanks for taking care havenwood
karapety_ has quit [Remote host closed the connection]
pabs has joined #ruby
<braindead_> how or where would i use your activesupport solution?
<braindead_> like i said. i am totally not into that
<havenwood> braindead_: This would just put an "n" on the end of everything, for example: ActiveSupport::Inflector.inflections { |inflect| inflect.plural /(.+)/, '\1n' }
<havenwood> 'Stude'.pluralize'.pluralize #=> "Studen"
<havenwood> 'Schlagsahne'.pluralize'.pluralize #=> "Schlagsahnen"
<braindead_> but why? because of the #?
<braindead_> for number?
<havenwood> 'Nein'.pluralize'.pluralize #=> "Neinn"
<havenwood> braindead_: Do you understand this part?: inflect.plural /(.+)/, '\1n'
<braindead_> no :(
<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.
karapetyan has joined #ruby
<cdunklau> wow the plural for Nein is really Neins
<cdunklau> alles klar
<havenwood> braindead_: It'd be quite a challenge to add regexp rules to support the German language.
fmcgeough has quit [Quit: fmcgeough]
fmcgeough has joined #ruby
<braindead_> so how exactly would this example look like? "vor #{hours} #{'Stunde'.pluralize(hours)}"
<braindead_> "vor #{hours} #{'Stunde'.inflect.plural /(.+)/, '\1n'}" ?
pabs has quit [Ping timeout: 240 seconds]
<havenwood> braindead_: No, you do the inflector stuff in your `config/initializers/inflections.rb` file.
<havenwood> braindead_: The example would look like your original, but work.
<braindead_> why is life always so complicated
pabs has joined #ruby
<havenwood> braindead_: Life finds a way.
<cdunklau> wouldn't it be better to use a translation file
<braindead_> so one last time please
<braindead_> i copy this string: inflect.plural /(.+)/, '\1n'
<braindead_> into inflections.rb
<havenwood> braindead_: ActiveSupport::Inflector.inflections(:de) { |inflect| inflect.irregular 'stude', 'studen' }
<braindead_> thank you i try it right now
karapetyan has quit [Ping timeout: 260 seconds]
<havenwood> cdunklau: it seems they want pluralization to work, just not English rules
sphenxes has joined #ruby
<havenwood> someone might have bothered to do a best effort for German, like Rails has for English - but I don't know the repo
<havenwood> Even the English one will pluralize to one thing, then return to a different singular than it started with...
<braindead_> it still shows "Stundes" instead of "Stunden"
<braindead_> do i need to change something here: ago = "vor #{hours} #{'Stunde'.pluralize(hours)}"
<havenwood> braindead_: are you in :de i18n?
houhoulis has joined #ruby
<havenwood> braindead_: Drop the `(:de)` from my example, if not
<havenwood> braindead_: ActiveSupport::Inflector.inflections{ |inflect| inflect.irregular 'stude', 'studen' }
<braindead_> yes i added config.i18n.default_locale = :de to application.rb
<havenwood> braindead_: Then restart the app.
<havenwood> braindead_: Should work.
mtkd has quit []
mzo has joined #ruby
<braindead_> restartet rails server still Stundes
<havenwood> braindead_: I just tried in a Rails console and it worked fine. Hrm.
<havenwood> braindead_: The #RubyOnRails channel is probably a better place for this, since it's Rails-specific.
mtkd has joined #ruby
apparition has joined #ruby
<braindead_> to reload the script/app is it enough to restart the rails server?
<havenwood> braindead_: yup
<braindead_> than its not working.
<braindead_> ok, ill give it a try in rails
<braindead_> thank you for the input though
<havenwood> you're welcome
aeontech has quit [Quit: aeontech]
fmcgeough has quit [Quit: fmcgeough]
dionysus69 has quit [Ping timeout: 256 seconds]
mikecmpbll has joined #ruby
BlopMonster has joined #ruby
<havenwood> braindead_: The ActiveSupport::Inflector solution from #ruby definitely works. Gist your: config/initializers/inflections.rb
<havenwood> braindead_: Meant that to be in #RubyOnRails. If you gist the file there I'm sure someone can spot what's up.
<braindead_> except for your line its empty
<braindead_> just some comments
<braindead_> thats what i included: ActiveSupport::Inflector.inflections(:de) { |inflect| inflect.irregular 'Stunde', 'Studen' }
Esa_ has joined #ruby
BlopMonster has quit [Ping timeout: 256 seconds]
pabs has quit [Ping timeout: 264 seconds]
pabs has joined #ruby
<havenwood> braindead_: And that's in your?: config/initializers/inflections.rb
<havenwood> braindead_: Try restarting. Maybe Spring is borking you.
<havenwood> Dunno! Works on my machine.
<braindead_> i mean i could get rid of the :de to test it again
<braindead_> hold on
<braindead_> cant believe it. without de it worked
<braindead_> so this is not correct
<braindead_> config.i18n.default_locale = :de
<braindead_> i added this to application.rb
<eam> why don't we ever run production on developer machines, the code always works there :D
* havenwood ships his laptop to be installed on a rack in prod
<eam> lol
<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?
<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
<havenwood> braindead_: I'm moving to the other channel to give you Rails suggestions.
<braindead_> ok
leitz has quit [Quit: Nappy time]
dionysus69 has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
Silox| has quit [Quit: Connection closed for inactivity]
rippa has joined #ruby
pabs has quit [Ping timeout: 260 seconds]
pabs has joined #ruby
karapetyan has joined #ruby
za1b1tsu has joined #ruby
akaiiro has joined #ruby
emilford has joined #ruby
apparition has quit [Quit: Bye]
pabs has quit [Ping timeout: 248 seconds]
pabs has joined #ruby
TinkerT has quit [Read error: Connection reset by peer]
karapetyan has quit [Remote host closed the connection]
orbyt_ has joined #ruby
TinkerT has joined #ruby
karapetyan has joined #ruby
karapetyan has quit [Remote host closed the connection]
orbyt_ has quit [Ping timeout: 264 seconds]
DLSteve has quit [Ping timeout: 240 seconds]
karapetyan has joined #ruby
sytherax has joined #ruby
sytherax has quit [Remote host closed the connection]
amar_ has quit [Remote host closed the connection]
amar_ has joined #ruby
za1b1tsu has quit [Quit: WeeChat 2.1]
mtkd has quit []
ciscam has quit [Ping timeout: 276 seconds]
ciscam has joined #ruby
amar_ has quit [Ping timeout: 264 seconds]
FernandoBasso has quit [Quit: Leaving]
whowantstolivefo has quit [Ping timeout: 240 seconds]
yokel has joined #ruby
whowantstolivefo has joined #ruby
samosaphile has joined #ruby
mzo has quit [Ping timeout: 260 seconds]
hph^ has joined #ruby
hph^ has quit [Max SendQ exceeded]
konsolebox has quit [Ping timeout: 260 seconds]
za1b1tsu has joined #ruby
houhoulis has quit []
mzo has joined #ruby
akaiiro has quit [Ping timeout: 265 seconds]
mtkd has joined #ruby
whowantstolivef1 has joined #ruby
whowantstolivefo has quit [Ping timeout: 276 seconds]
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 256 seconds]
whowantstolivef1 has quit [Ping timeout: 260 seconds]
mtkd has quit []
karapetyan has quit [Remote host closed the connection]
psychicist__ has joined #ruby
karapetyan has joined #ruby
mtkd has joined #ruby
whowantstolivefo has joined #ruby
DTZUZO has quit [Quit: WeeChat 2.0]
Silox| has joined #ruby
Diogo has quit [Quit: Connection closed for inactivity]
Silox| has quit [Max SendQ exceeded]
DTZUZO has joined #ruby
Silox| has joined #ruby
emilford has quit [Ping timeout: 256 seconds]
shenghi has quit [Ping timeout: 265 seconds]
ramfjord has joined #ruby
Dimik has joined #ruby
Diogo has joined #ruby
shenghi has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
jsrn has quit [Ping timeout: 240 seconds]
jsrn has joined #ruby
karapetyan has quit [Remote host closed the connection]
orbyt_ has joined #ruby
karapetyan has joined #ruby
emilford has joined #ruby
za1b1tsu has quit [Quit: WeeChat 2.1]
pacorro2000 has joined #ruby
Raboo has quit [Remote host closed the connection]
Raboo has joined #ruby
reber has quit [Remote host closed the connection]
konsolebox has joined #ruby
<RougeR> anyone able to help with this error:https://stackoverflow.com/questions/46384345/permission-denied-rb-sysopen-gem-install-pg-on-ubuntu-16-04
<RougeR> trying to get the postgres gem setup
TomyLobo2 has joined #ruby
mzo has quit [Ping timeout: 240 seconds]
Flashynuff_ has joined #ruby
Guest41100 has quit [Ping timeout: 255 seconds]
konsolebox_ has joined #ruby
mtkd has quit []
diego_k has joined #ruby
ged_ has joined #ruby
conr_ has joined #ruby
canton7 has quit [Ping timeout: 255 seconds]
tw1sted_ has joined #ruby
c0ncealed2 has joined #ruby
rmsaksida has joined #ruby
claw_ has joined #ruby
ski4x7 has joined #ruby
sonne_ has joined #ruby
canton7 has joined #ruby
Emmanuel_Chanel_ has joined #ruby
zmo has joined #ruby
fmcgeough has joined #ruby
<zmo> hi!
<zmo> I'm getting an exception such as: `NoMethodError: undefined method `name' for #<Hash:0x000055ca65ee83d0>`
konsolebox has quit [Read error: Connection reset by peer]
c0ncealed1 has quit [Ping timeout: 245 seconds]
bipul has quit [Ping timeout: 245 seconds]
tw1sted has quit [Read error: Connection reset by peer]
ujjain has quit [Ping timeout: 245 seconds]
Flashynuff has quit [Ping timeout: 245 seconds]
sonne has quit [Ping timeout: 245 seconds]
ged has quit [Ping timeout: 245 seconds]
saksida has quit [Ping timeout: 245 seconds]
heyimwill has quit [Ping timeout: 245 seconds]
conr has quit [Ping timeout: 245 seconds]
TomyLobo has quit [Ping timeout: 245 seconds]
Guest49045 has quit [Ping timeout: 245 seconds]
havenwood has quit [Ping timeout: 245 seconds]
diegok has quit [Ping timeout: 245 seconds]
Emmanuel_Chanel has quit [Ping timeout: 245 seconds]
claw has quit [Ping timeout: 245 seconds]
ski7777 has quit [Ping timeout: 245 seconds]
<zmo> and I'm having a hard time finding out what's in the hash being referenced
reber has joined #ruby
rmsaksida is now known as saksida
Flashynuff_ is now known as Flashynuff
ujjain has joined #ruby
ujjain has quit [Changing host]
ujjain has joined #ruby
karapetyan has quit [Remote host closed the connection]
havenwood has joined #ruby
havenwood has joined #ruby
havenwood has quit [Changing host]
<zmo> I was wondering if it was possible to get the hash's content using the object's reference address
ged_ is now known as ged
<zmo> i.e.: `0x000055ca65ee83d0` in my example above
turt2live has quit [Ping timeout: 240 seconds]
giraffe has joined #ruby
EvilJStoker has joined #ruby
Emmanuel_Chanel_ has quit [Client Quit]
haylon_ has quit [Ping timeout: 255 seconds]
bipul has joined #ruby
giraffe is now known as Guest75834
jonjits[m] has quit [Ping timeout: 240 seconds]
Hanma[m] has quit [Ping timeout: 256 seconds]
intheclouddan has quit [Ping timeout: 256 seconds]
iceskins[m] has quit [Ping timeout: 260 seconds]
Emmanuel_Chanel has joined #ruby
KevinMGranger has quit [Ping timeout: 256 seconds]
dinfuehr has quit [Ping timeout: 260 seconds]
sudorobo has quit [Ping timeout: 260 seconds]
velu_aon[m] has quit [Ping timeout: 240 seconds]
zalipuha[m] has quit [Ping timeout: 255 seconds]
Giphy[m] has quit [Ping timeout: 260 seconds]
luna_x[m] has quit [Ping timeout: 256 seconds]
aviraldg has quit [Ping timeout: 256 seconds]
redlegion[m] has quit [Ping timeout: 276 seconds]
bascht has quit [Ping timeout: 276 seconds]
canton7 has quit [Ping timeout: 260 seconds]
clemens3_ has quit [Ping timeout: 264 seconds]
sudorobo has joined #ruby
sudorobo has joined #ruby
mzo has joined #ruby
dinfuehr has joined #ruby
canton7 has joined #ruby
megamos has joined #ruby
heyimwill has joined #ruby
mtkd has joined #ruby
sytherax has joined #ruby
houhoulis has joined #ruby
mtkd has quit []
<RougeR> zmo: doesnt it give you a line number
mtkd has joined #ruby
clemens3_ has joined #ruby
nicht has joined #ruby
dionysus69 has quit [Ping timeout: 264 seconds]
<RougeR> got it
<zmo> well, it's within a lib that transforms the data I'm giving to it
amar has joined #ruby
<zmo> basically, I'm transforming a hash into an object (using the HashIt snippet found through google/SO)
<zmo> and it fails to transform an encapsulated hash, and I need to find why
sytherax has quit [Remote host closed the connection]
za1b1tsu has joined #ruby
<RougeR> hmmm
amar has quit [Remote host closed the connection]
sytherax has joined #ruby
samosaphile has quit [Ping timeout: 260 seconds]
<RougeR> can you stick in binding pry
<RougeR> you should be able to see all objects with it when it breaks
<RougeR> and no you cant reverse look up via memory address afaik
sytherax has quit [Read error: Connection reset by peer]
sytherax has joined #ruby
<RougeR> although
<RougeR> zmo: you can also access local_variables/instance_variables that are in scope
<RougeR> then iterate and match
amar has joined #ruby
<RougeR> local_variables.each {|x| puts x if (eval x.to_s).object_id == bar.object_id}
<RougeR> ^
<zmo> hm it's definitely not local though :-/
jamesaxl has joined #ruby
sytherax has quit [Remote host closed the connection]
<zmo> though I think I found the culprit hash… now I have to find out why it's not transformed
suukim has quit [Quit: Konversation terminated!]
megamos has quit [Ping timeout: 256 seconds]
BlopMonster has joined #ruby
mtkd has quit []
mtkd has joined #ruby
Silox| has quit [Quit: Connection closed for inactivity]
BlopMonster has quit [Ping timeout: 240 seconds]
karapetyan has joined #ruby
cadillac_ has quit [Ping timeout: 240 seconds]
cadillac_ has joined #ruby
karapetyan has quit [Ping timeout: 276 seconds]
megamos has joined #ruby
RougeR has quit [Ping timeout: 264 seconds]
desperek has joined #ruby
sphenxes has quit [Read error: Connection reset by peer]
conta has joined #ruby
rabajaj_ has joined #ruby
tdy1 has quit [Ping timeout: 265 seconds]
<rabajaj_> hey, i am trying to do something like https://paste.fedoraproject.org/paste/3RU8terBrwd0JwsTFDPy9Q
<rabajaj_> any help would be highly appriciated
<rabajaj_> as/appriciated/appreciated
<rabajaj_> s
fmcgeough has quit [Quit: fmcgeough]
<rabajaj_> basically i am not being able to interpolate a key from the hash
minimalism has joined #ruby
nowhere_man has quit [Ping timeout: 256 seconds]
Diogo has quit [Quit: Connection closed for inactivity]
pabs has quit [Ping timeout: 265 seconds]
pabs has joined #ruby
Puffball has quit [Quit: Puffball]
RougeR has joined #ruby
Mike11 has joined #ruby
pabs has quit [Ping timeout: 255 seconds]
pabs has joined #ruby
tdy1 has joined #ruby
t0xik has joined #ruby
ellcs has joined #ruby
ellcs has quit [Client Quit]
mzo has quit [Ping timeout: 248 seconds]
za1b1tsu has quit [Quit: WeeChat 2.1]
RougeR has quit [Ping timeout: 256 seconds]
za1b1tsu has joined #ruby
kmurphy4 has joined #ruby
ur5us has joined #ruby
psprint_ has joined #ruby
<psprint_> Hello. Do someone use ruby at command line, with the -e switch, like perl one-liners?
mzo has joined #ruby
\void has joined #ruby
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
psprint_ is now known as psprint
Giphy[m] has joined #ruby
za1b1tsu has quit [Quit: WeeChat 2.1]
conta has quit [Quit: conta]
jottr has joined #ruby
cjohnson has quit [Remote host closed the connection]
RougeR has quit [Ping timeout: 260 seconds]
<apeiros> psprint: sometimes for small pieces of code, why?
<psprint> apeiros: I'm writing in-prompt colorized keywords, braces, already have such function for awk & perl
jottr has quit [Ping timeout: 245 seconds]
<psprint> something like this, requires ruby to have "compile, syntax check only" perl example: https://asciinema.org/a/186098
<apeiros> looks interesting
<psprint> I can code this for Ruby, two issues a) do people use Ruby inline? b) does ruby have "syntax error checker"
<apeiros> ruby -c
<apeiros> for syntax check
<lupine> "use ruby inline" ?
<apeiros> but I think `ruby -e` is used rather rarely
<psprint> lupine: like perl highlighters, the 1 liners
<apeiros> irb/pry is much more often used
<Zarthus> i would prefer irb/pry over a CLI highlighting with `ruby -e` too
<psprint> I just make my own version
kmurphy4 has quit [Quit: kmurphy4]
<Zarthus> the moment my expression becomes too lengthy I'm fucked.
isene has joined #ruby
akaiiro has joined #ruby
<isene> Is there a way to compile a ruby program into a stand-alone executable on Linux?
pabs has quit [Ping timeout: 240 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chussenot has joined #ruby
mtkd has quit [Ping timeout: 276 seconds]
bascht has joined #ruby
iceskins[m] has joined #ruby
luna_x[m] has joined #ruby
jonjits[m] has joined #ruby
intheclouddan has joined #ruby
haylon_ has joined #ruby
Hanma[m] has joined #ruby
redlegion[m] has joined #ruby
velu_aon[m] has joined #ruby
turt2live has joined #ruby
aviraldg has joined #ruby
KevinMGranger has joined #ruby
zalipuha[m] has joined #ruby
karapetyan has joined #ruby
mtkd has joined #ruby
karapetyan has quit [Remote host closed the connection]
mikeiniowa has joined #ruby
pabs has joined #ruby
karapetyan has joined #ruby
ta_ has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
megamos has quit [Ping timeout: 245 seconds]
kmurphy4 has joined #ruby
houhoulis has quit [Remote host closed the connection]
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
<RougeR> zmo: you can also use instance and global the same way fyi. glad you found it though
akaiiro has quit [Ping timeout: 260 seconds]
megamos has joined #ruby
amar has quit [Remote host closed the connection]
Some-body_ has joined #ruby
DarthGandalf has quit [Ping timeout: 256 seconds]
Some-body_ is now known as DarthGandalf
gr33n7007h has joined #ruby
al2o3-cr has quit [Ping timeout: 240 seconds]
chussenot has quit [Quit: chussenot]
megamos has quit [Quit: Leaving]
biberu has quit []
akaiiro has joined #ruby
mzo has quit [Ping timeout: 256 seconds]
eyedrop has joined #ruby
amar has joined #ruby
Mike11 has quit [Quit: Leaving.]
pabs has quit [Ping timeout: 245 seconds]
pabs has joined #ruby
megamos has joined #ruby
<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.
<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
ta_ has quit [Remote host closed the connection]
amar has quit [Ping timeout: 265 seconds]
<akaiiro> eyedrop do you see any error message?
<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
<eyedrop> akaiiro: Is it because of the order of variables? Just trying to understand how it works.
yaiyaichu has joined #ruby
clemens3_ has quit [Ping timeout: 276 seconds]
<akaiiro> eyedrop yes, the order of the instructions matter
clemens3 has quit [Ping timeout: 256 seconds]
<eyedrop> akaiiro: Thanks.
BlopMonster has joined #ruby
nicht has quit [Remote host closed the connection]
nicht has joined #ruby
orbyt_ has joined #ruby
<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
<yaiyaichu> my user. Also, I use rbenv.
reber has quit [Remote host closed the connection]
<yaiyaichu> Please let me know if you need any additional info, and I'll gladly provide it.
psychicist__ has quit [Ping timeout: 260 seconds]
mtkd has quit []
schleppel has quit [Quit: Konversation terminated!]
<apeiros> yaiyaichu: the usual suspect there is a different env
<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
<apeiros> but I don't know enough about rbenv to give a sensible tip
<apeiros> s/tip/hint/
eyedrop has quit [Quit: Page closed]
<braindead_> when i run my production enviroment i get IP - - [09/Jun/2018:22:06:08 UTC] "GET / HTTP/1.0" 301 0
<braindead_> anybody an idea what that could be?
<braindead_> i mean it sounds like nginx redirect problem but its working in dev
BlopMonster has quit [Ping timeout: 264 seconds]
megamos has quit [Ping timeout: 265 seconds]
ur5us has quit [Remote host closed the connection]
ramfjord has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
dviola has joined #ruby
paraxial has quit [Read error: Connection reset by peer]
paraxial has joined #ruby
<akaiiro> braindead_ are you using the same commands and settings to start you application in both environments?
<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?
<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 }`
<braindead_> akaiiro: take a look at the very bottom of the page: https://github.com/lobsters/lobsters
<braindead_> it looks somehow similar to what you write
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<akaiiro> braindead_ seems that your project uses unicorn instead of puma
<akaiiro> what is your .conf for nginx?
yaiyaichu has quit [Read error: Connection reset by peer]
yaiyaichu has joined #ruby
<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; }
pabs has quit [Ping timeout: 240 seconds]
<akaiiro> seems pretty sparse for an nginx .conf file (but I have only seen the one for the app I manage, hehe)
mikecmpbll has quit [Quit: inabit. zz.]
planigan has quit [Ping timeout: 256 seconds]
<braindead_> do you start your server with just: bundle ...
BlopMonster has joined #ruby
<braindead_> no rails before it?
<akaiiro> braindead_ yes, it uses bundle but I have to start puma manually cause it is an old rails version
<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
plexigras has quit [Ping timeout: 264 seconds]
pabs has joined #ruby
yaiyaichu has quit [Read error: Connection reset by peer]
yaiyaichu has joined #ruby
planigan has joined #ruby
TomyLobo2 has quit [Ping timeout: 256 seconds]
<braindead_> found the error
<braindead_> config.force_ssl = true was the problem
<braindead_> changed it to false and boom
<braindead_> because i do ssl externaly
emilford has quit [Ping timeout: 260 seconds]
braindead_ has quit [Quit: Page closed]
konsolebox_ has quit [Ping timeout: 260 seconds]
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akaiiro has quit [Ping timeout: 265 seconds]
orbyt_ has joined #ruby
emilford has joined #ruby
spencer has joined #ruby
nicht_ has joined #ruby
nicht has quit [Ping timeout: 245 seconds]
emilford has quit [Ping timeout: 276 seconds]
apeiros has quit [Ping timeout: 264 seconds]
nicht has joined #ruby
nicht_ has quit [Ping timeout: 245 seconds]
t0xik has quit [Quit: Connection closed for inactivity]
emilford has joined #ruby