duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gheegh has joined #ruby
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DaRock has quit [Read error: Connection reset by peer]
DaRock has joined #ruby
citizentwo has joined #ruby
gheegh has joined #ruby
citizentwo has quit [Ping timeout: 240 seconds]
DaRock has quit [Read error: Connection reset by peer]
DaRock has joined #ruby
impermanence has quit [Remote host closed the connection]
TCZ has joined #ruby
ryzokuken has quit [Ping timeout: 246 seconds]
raggi- has quit [Ping timeout: 246 seconds]
raggi- has joined #ruby
gmcintire has quit [Ping timeout: 246 seconds]
danguita has quit [Ping timeout: 246 seconds]
phaul has quit [Ping timeout: 240 seconds]
cc_ has joined #ruby
davidw has quit [Ping timeout: 240 seconds]
ryzokuken has joined #ruby
gmcintire has joined #ruby
phaul has joined #ruby
danguita has joined #ruby
markopasha has quit [Read error: Connection reset by peer]
cc__ has joined #ruby
cc_ has quit [Ping timeout: 265 seconds]
m_antis has quit [Quit: m_antis]
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gheegh has joined #ruby
m_antis has joined #ruby
m_antis has quit [Client Quit]
gheegh has quit [Client Quit]
_phaul has joined #ruby
TinderFX has joined #ruby
alfiemax has joined #ruby
phaul has quit [Ping timeout: 240 seconds]
alfiemax has quit [Ping timeout: 240 seconds]
orbyt_ has joined #ruby
citizentwo has joined #ruby
splud_wurk has quit [Quit: splud_wurk]
citizentwo has quit [Ping timeout: 240 seconds]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sergioro has joined #ruby
DaRock has quit [Read error: Connection reset by peer]
DaRock has joined #ruby
gheegh has joined #ruby
cd has quit [Quit: cd]
m_antis has joined #ruby
citizentwo has joined #ruby
m_antis is now known as m_antis[away]
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Tempesta has quit [Quit: AdiIRC is updating to v3.8 Beta Build (2020/02/18 UTC) 64 Bit]
Tempesta has joined #ruby
m_antis[away] is now known as m_antis
m_antis is now known as m_antis[away]
simonfromspace has joined #ruby
m_antis[away] is now known as m_antis
m_antis is now known as m_antis[away]
citizentwo has quit [Remote host closed the connection]
postmodern has joined #ruby
Tempesta has quit [Quit: See ya!]
m_antis[away] is now known as m_antis
coderhs has quit [Remote host closed the connection]
m_antis is now known as m_antis[away]
bvdw has quit [Read error: Connection reset by peer]
Tempesta has joined #ruby
bvdw has joined #ruby
teardown has joined #ruby
ttoocs has joined #ruby
lineus has quit [Ping timeout: 240 seconds]
simonfromspace has quit [Quit: Leaving]
r3m has quit [Quit: WeeChat 2.8-dev]
r3m has joined #ruby
jenrzzz_ has quit [Ping timeout: 255 seconds]
lineus has joined #ruby
m_antis[away] has quit [Quit: m_antis[away]]
duderonomy has joined #ruby
TCZ has quit [Quit: Leaving]
cc__ has quit [Remote host closed the connection]
jenrzzz has joined #ruby
Arahael has quit [Ping timeout: 265 seconds]
jenrzzz has quit [Ping timeout: 265 seconds]
Arahael has joined #ruby
drincruz has joined #ruby
braincrash has quit [Quit: bye bye]
alfiemax has joined #ruby
braincrash has joined #ruby
ur5us_ has quit [Ping timeout: 248 seconds]
gix has quit [Ping timeout: 258 seconds]
heth has quit [Read error: Connection reset by peer]
fphilipe_ has joined #ruby
TinderFX has quit [Ping timeout: 240 seconds]
fphilipe has quit [Ping timeout: 240 seconds]
MrCrackPot has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
heth has joined #ruby
postmodern has quit [Quit: Leaving]
gheegh has joined #ruby
sagax has joined #ruby
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
drincruz has quit [Ping timeout: 265 seconds]
phaul has joined #ruby
_phaul has quit [Ping timeout: 255 seconds]
jenrzzz has joined #ruby
Furai has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 265 seconds]
Furai has joined #ruby
Arahael has quit [Ping timeout: 255 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mossplix has joined #ruby
LinuxKnight has joined #ruby
zapata has quit [Quit: WeeChat 2.7]
sauvin has joined #ruby
Arahael has joined #ruby
NODE has quit [Quit: changing servers]
NODE has joined #ruby
NODE has quit [Client Quit]
NODE has joined #ruby
Swyper has quit [Remote host closed the connection]
mnemon has quit [Remote host closed the connection]
Arahael has quit [Ping timeout: 240 seconds]
NODE has quit [Client Quit]
NODE has joined #ruby
xco has joined #ruby
NODE has quit [Client Quit]
NODE has joined #ruby
mossplix has quit [Remote host closed the connection]
Swyper has joined #ruby
buckworst has quit [Quit: WeeChat 2.7]
mossplix has joined #ruby
Arahael has joined #ruby
cthulchu_ has quit [Ping timeout: 268 seconds]
Qablae has joined #ruby
<Qablae>
hi, please kindly stay out of #freenode. the pool is closed. thanks.
<Qablae>
hi, please kindly stay out of #freenode. the pool is closed. thanks.
<Qablae>
hi, please kindly stay out of #freenode. the pool is closed. thanks.
Qablae has left #ruby [#ruby]
Arahael has quit [Ping timeout: 260 seconds]
droklatek has joined #ruby
<droklatek>
hi, please kindly stay out of #freenode. the pool is closed. thanks.
<droklatek>
hi, please kindly stay out of #freenode. the pool is closed. thanks.
<droklatek>
hi, please kindly stay out of #freenode. the pool is closed. thanks.
droklatek has left #ruby ["hi, please kindly stay out of #freenode. the pool is closed. thanks."]
aphoi has joined #ruby
<aphoi>
hi, please kindly stay out of #freenode. the pool is closed. thanks.
<aphoi>
hi, please kindly stay out of #freenode. the pool is closed. thanks.
<aphoi>
hi, please kindly stay out of #freenode. the pool is closed. thanks.
aphoi has left #ruby [#ruby]
aphoi has joined #ruby
<aphoi>
hi, please kindly stay out of #freenode. the pool is closed. thanks.
<aphoi>
hi, please kindly stay out of #freenode. the pool is closed. thanks.
<aphoi>
hi, please kindly stay out of #freenode. the pool is closed. thanks.
aphoi has left #ruby [#ruby]
Oblo has joined #ruby
Oblo has left #ruby ["hi, please kindly stay out of #freenode. the pool is closed. thanks."]
kraacr has joined #ruby
fphilipe_ has quit [Ping timeout: 240 seconds]
kraacr has left #ruby ["hi, please kindly stay out of #freenode. the pool is closed. thanks."]
fphilipe_ has joined #ruby
Swyper has quit [Remote host closed the connection]
aceoleeye has joined #ruby
<aceoleeye>
hi, please kindly stay out of #freenode. the pool is closed. thanks.
<aceoleeye>
hi, please kindly stay out of #freenode. the pool is closed. thanks.
<aceoleeye>
hi, please kindly stay out of #freenode. the pool is closed. thanks.
aceoleeye has left #ruby [#ruby]
<lunarkitty>
what?
hoijui has joined #ruby
clemens3 has quit [Quit: WeeChat 2.7]
fphilipe_ has quit [Ping timeout: 260 seconds]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has joined #ruby
Arahael has joined #ruby
conta has joined #ruby
hoijui has quit [Quit: Leaving]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
fphilipe_ has joined #ruby
Arahael has quit [Ping timeout: 240 seconds]
StoneCypherWork has joined #ruby
<StoneCypherWork>
I'm trying to remove the `SameSite` claim from a cookie that I'm sending in Rack, but I'm not a ruby programmer, and I'm having trouble figuring out how to perform the edit
<StoneCypherWork>
If someone has some time for some rudimentary help, it'd be appreciated
zapata has joined #ruby
_phaul has joined #ruby
phaul has quit [Ping timeout: 255 seconds]
<StoneCypherWork>
i worry a bit that it might be too late at night to get help
<lunarkitty>
I've never used rack directly
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<lunarkitty>
you usually have to wait a while to get an answer
bvdw has quit [Read error: Connection reset by peer]
TomyWork has joined #ruby
bvdw has joined #ruby
clemens3 has joined #ruby
_Joes_ has quit [Remote host closed the connection]
Arahael has joined #ruby
<StoneCypherWork>
i'm about 70% confident i have the right thing here
Arahael has quit [Ping timeout: 258 seconds]
<StoneCypherWork>
lunarkitty: could i get you to take a look just in the name of common sense?
<StoneCypherWork>
it's just the bit headers['Set-Cookie'].sub! '; SameSite=Strict' ''
<StoneCypherWork>
i just want to remove that string fragment from headers['Set-Cookie']
<StoneCypherWork>
repeatedly
<_phaul>
headers['Set-Cookie'] = '' ? Or headers.delete('Set-Cookie')
<StoneCypherWork>
i don't want to remove the whole cookie
<StoneCypherWork>
just the substring (repeatedly)
<_phaul>
ah. sub replaces ones. gsub does repeatedly
<StoneCypherWork>
oh, ok
<StoneCypherWork>
was i correct to put the bang there to get in-place edits?
<_phaul>
also therre is a comma missing between the arguments
<StoneCypherWork>
it's "foo".gsub! "a", "b" ?
<lunarkitty>
Oh sorry, I didn't see anything til jsut now
<StoneCypherWork>
hey no worries, i'm asking for 1a help, pauses are not unreasonable
royal_screwup21 has quit [Remote host closed the connection]
cisco has joined #ruby
StoneCypherWork has quit [Ping timeout: 260 seconds]
drincruz has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.7]
al2o3-cr has joined #ruby
al2o3-cr has quit [Client Quit]
al2o3-cr has joined #ruby
jmcgnh has quit [Ping timeout: 268 seconds]
john2496 has joined #ruby
prestorium has joined #ruby
royal_screwup21 has joined #ruby
jmcgnh has joined #ruby
poontangmessiah has quit [Ping timeout: 240 seconds]
poontangmessiah has joined #ruby
royal_screwup21 has quit [Remote host closed the connection]
TCZ has quit [Ping timeout: 240 seconds]
leitz has joined #ruby
DaRock has quit [Ping timeout: 258 seconds]
jintseng has quit [Ping timeout: 240 seconds]
duderonomy has joined #ruby
poontangmessiah has quit [Ping timeout: 258 seconds]
ellcs has quit [Ping timeout: 248 seconds]
poontangmessiah has joined #ruby
_phaul has joined #ruby
phaul has quit [Ping timeout: 255 seconds]
chalkmonster has joined #ruby
burningserenity has quit [Ping timeout: 255 seconds]
jintseng has joined #ruby
ellcs has joined #ruby
StoneCypherWork has joined #ruby
burningserenity has joined #ruby
stryek has joined #ruby
Ytrezar has quit [Quit: See ya]
Ytrezar has joined #ruby
ttoocs has quit [Ping timeout: 255 seconds]
TorpedoSkyline has joined #ruby
StoneCypherWork has quit [Ping timeout: 240 seconds]
burningserenity has quit [Ping timeout: 248 seconds]
<simonfromspace>
havenwood, good morning! Whenever you get some time, kindly explain why you suggested me to put those modules inside a class. I mean, it works, but I was questioned about it and I didn't know what to say.
StoneCypherWork has joined #ruby
poontangmessiah has quit [Ping timeout: 240 seconds]
<havenwood>
simonfromspace: In Ruby, the top level namespace are the constants on Object. Your library should only be adding one, not many. If everyone adds many, we'll stomp on each other and break code.
<havenwood>
&>> Object.constants
<rubydoc>
# => [:SystemExit, :IO, :SignalException, :Interrupt, :StandardError, :TypeError, :ArgumentError, :IndexError,... check link for more (https://carc.in/#/r/8lt9)
<havenwood>
simonfromspace: Your library shouldn't be polluting the top level namespace with JSON, Formatter—some that already exist and some that others will make.
<havenwood>
simonfromspace: By having them under EZTVScraper, it's *your* JSON, not stlib JSON.
poontangmessiah has joined #ruby
<havenwood>
simonfromspace: Leaking top level constants should't make it past code review.
StoneCypherWork has quit [Ping timeout: 240 seconds]
<havenwood>
simonfromspace: Imagine your JSON has a JSON.generate method. By loading your library, you just broke every other gem and parts of the stdlib.
clemens3 has quit [Quit: WeeChat 2.7]
<havenwood>
simonfromspace: If your EZTVScraper::JSON has a EZTVScraper::JSON.generate, no problem whatsoever.
clemens3 has joined #ruby
<havenwood>
simonfromspace: With the EZTVScraper gem, you're claiming any namespace under EZTVScraper for your gem and plugins for your gem.
<havenwood>
simonfromspace: Does that make sense?
SuperL4g is now known as SuperLag
cd has joined #ruby
TorpedoSkyline has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
royal_screwup21 has joined #ruby
sergioro has quit [Quit: leaving]
TorpedoSkyline has joined #ruby
ellcs has quit [Ping timeout: 240 seconds]
<nahmanreally>
isn't EZTV warez?
<havenwood>
nahmanreally: Is it? I'm not familiar with it.
<nahmanreally>
havenwood: Pretty sure it is :/
fig-le-deunch has joined #ruby
<nahmanreally>
Sounds familiar. Remember I had one of The Pirate Bay owners asking me to redo their website and branding. EZTV were one of the release groups that appared most frequently on that site.
<nahmanreally>
He only asked me because we were from the same city though, not because I was involved in piracy.
alexherbo2 has joined #ruby
clemens3 has quit [Ping timeout: 265 seconds]
cisco has quit [Remote host closed the connection]
TomyWork has quit [Read error: Connection reset by peer]
ellcs has joined #ruby
fig-le-deunch has quit [Quit: Konversation terminated!]
LinuxKnight has quit [Ping timeout: 255 seconds]
poontangmessiah has quit [Ping timeout: 265 seconds]
alexherbo22 has joined #ruby
alexherbo2 has quit [Ping timeout: 255 seconds]
alexherbo22 is now known as alexherbo2
TorpedoSkyline has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cthulchu_ has joined #ruby
nowhereman has joined #ruby
royal_screwup21 has quit [Remote host closed the connection]
sagax has quit [Remote host closed the connection]
prestorium has quit [Ping timeout: 258 seconds]
_whitelogger has quit [Ping timeout: 248 seconds]
_whitelogger has joined #ruby
TorpedoSkyline has joined #ruby
gix has joined #ruby
impermanence has joined #ruby
citizentwo has joined #ruby
rippa has joined #ruby
TorpedoSkyline has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<simonfromspace>
havenwood, I am 90% sure I understand what you've said. What keyword do I search on Google to learn more about this?
<havenwood>
simonfromspace: Which part seems iffy? Want another example of defining a method on a shared class that breaks things?
<simonfromspace>
I assumed modules and classes were to be used separately. What you suggested honestly blew my mind. The code reviewer even basically said "I made an observation in your code. Classes were used to wrap modules.I suggest you read again on the differences between classes and modules. The two are different concepts that have unique purpose."
<al2o3-cr>
that code reviewer sucks.
<simonfromspace>
I mean, I trust the advice here more than anything but it just seems wild from a noobs perspective.
<simonfromspace>
I would like to see those if you can think of any, havenwood , and also code where Modules are bundled inside Classes.
<simonfromspace>
Found some examples on that Rubymonk page from al2o3-cr
codefriar has quit [Ping timeout: 272 seconds]
scipio_africanu4 has quit [Ping timeout: 240 seconds]
<al2o3-cr>
simonfromspace: ruby has single inheritance.
batisi[m] has quit [Ping timeout: 246 seconds]
stan has quit [Ping timeout: 240 seconds]
kp666[m] has quit [Ping timeout: 240 seconds]
mistergibson[m] has quit [Ping timeout: 256 seconds]
NODE has quit [Quit: changing servers]
qbrd[m] has quit [Ping timeout: 246 seconds]
sepp2k has quit [Ping timeout: 246 seconds]
turt2live has quit [Ping timeout: 240 seconds]
execat[m] has quit [Ping timeout: 248 seconds]
linuus[m] has quit [Ping timeout: 252 seconds]
NODE has joined #ruby
<al2o3-cr>
timeout bomb proceeding...
<simonfromspace>
why does that happen? it's hilarious
<al2o3-cr>
matrix screwing things
timmow has quit [Ping timeout: 263 seconds]
timmow has joined #ruby
minall has left #ruby ["ERC (IRC client for Emacs 26.3)"]
howdoi has joined #ruby
qbrd[m] has joined #ruby
batisi[m] has joined #ruby
SeepingN has joined #ruby
royal_screwup21 has joined #ruby
scipio_africanu4 has joined #ruby
<havenwood>
simonfromspace: It doesn't matter if the top level class is a module or a class for a namespace—that's irrelevant.
<havenwood>
simonfromspace: The superclass of a Class is Module and the class of Class is Module. They're both equally appropriate to use for a namespace.
<havenwood>
simonfromspace: It's easy to come up with an example, since all you need to do is define a method on a class or module of the same name at top level. For example:
scipio_africanu4 has quit [Client Quit]
batisi[m] has quit [Quit: killed]
<havenwood>
&>> class String; def to_s; 42 end end
cold_iron has quit [Read error: Connection reset by peer]
<havenwood>
simonfromspace: It changes string for every string in Ruby, not just the code you're working on.
<havenwood>
simonfromspace: Now imagine everyone defining top level constants called, JSON, Formatter, String, and how all the code would immediately break when you stomp on methods meant to do something else.
<havenwood>
simonfromspace: Also, if you have a `module Foo` and someone else as a `class Foo` it'll just break.
<havenwood>
simonfromspace: Pick a top level class of any name. Define a method that's already defined. It breaks. That's why you put all your constants under your gem namespace.
iamayam has quit [Ping timeout: 240 seconds]
iamayam has joined #ruby
Arahael has quit [Ping timeout: 268 seconds]
<al2o3-cr>
simonfromspace: what havenwood explained must of sunk in by now?
fphilipe_ has quit [Ping timeout: 258 seconds]
<simonfromspace>
al2o3-cr, My brain is processing. I'll need a while.
alfiemax has joined #ruby
<havenwood>
simonfromspace: Imagine Ruby defines Foo.bar and tons of things depend on it. You redefine Foo.bar and all those things break. Compare with you defining SimonFromSpace::Foo.bar were nothing breaks.
<havenwood>
simonfromspace: Now imagine that you have a project and several gems define Foo.bar differently. That just won't work. But they can define Baz::Foo.bar, Wombat::Foo.bar, Twiddle::Foo.bar and it's fine. Each gem stayed within its namespace.
<simonfromspace>
I understand that much. I'm wondering if I should always write my ruby code with Modules inside Classes from now on.
<havenwood>
simonfromspace: No!
<simonfromspace>
Okay, so just avoid naming them differently, and keep them the same?
<havenwood>
simonfromspace: You can have a module or a class as your gem namespace. It does not matter. You should pick which it is, based on whether that outermost module or class has internal instances of state.
<havenwood>
simonfromspace: You must have a namespace, a module or a class. Whether you choose a module or a class is a good question. Either is perfectly normal.
<havenwood>
simonfromspace: Do use a module or class as your namespace. Think about why you might pick a module or pick a class for that namespace.
<simonfromspace>
So in my main.rb if I have a class BottleMaker, the other files should also have a BottleMaker class or module, right?
<havenwood>
simonfromspace: main.rb would correspond with a Main class or module.
<havenwood>
simonfromspace: Filenames correspond to class and module names.
<simonfromspace>
oh I see
<havenwood>
simonfromspace: bottle_maker.rb is a BottleMaker class or module.
<simonfromspace>
ok, filenames should always equal the namespace inside
<havenwood>
simonfromspace: Yes.
<havenwood>
simonfromspace: BottleMaker::JSON is a bottle_maker/json.rb
<simonfromspace>
ohhh
<simonfromspace>
I must have mistaken your advice a little yesterday
<havenwood>
simonfromspace: Simone::From::Space is simon/from/space.rb
<simonfromspace>
So what I've done is wrong, or right?
<havenwood>
(in lib/)
<simonfromspace>
Oh! That makes sense.
<havenwood>
simonfromspace: that's right. EZTVScraper::Output is eztv_scraper/output.rb
<havenwood>
simonfromspace: right?
<simonfromspace>
Right
<simonfromspace>
It makes sense now. I can access my modules with ::
execat[m] has joined #ruby
<simonfromspace>
If I didn't have that class in output.rb, it would work the same, but that also leaves it open to other EZTVScraper, if it existed.
<simonfromspace>
Am I right?
<havenwood>
No, that seems wrong. It would leave it in conflict with other Output classes OR modules.
<havenwood>
simonfromspace: You only get EZTVScraper to put your constant in. DO NOT create any constant outside the EZSTVScraper namespace.
<havenwood>
simonfromspace: Just follow the rule. If you've added a constant to Object.constants other than your gem name, you're doing it wrong for now.
<havenwood>
EZTVScraper::A_CONSTANT or EZTVScraper::AModule or EZTVScraper::AClass but no ::TopLevelAnyting.
coderhs has joined #ruby
sagax has joined #ruby
<simonfromspace>
Okay, and the way to maintain that hierarchy would be to contain them inside the namespace on every file? Right?
<simonfromspace>
I think I understand it now.
<simonfromspace>
So earlier output was module Output and my options were to either put it inside a class EZTVScraper, or rename the module to EZTVScraper.
<havenwood>
simonfromspace: You can not have Output at all or put it inside your namespace.
<havenwood>
simonfromspace: My next suggestion would be to use fewer constants. Start without extras and only extract as you see opportunity.
<simonfromspace>
And in case of a Class?
<havenwood>
simonfromspace: If you have no need for a second constant, stick with a single top level one. There's no shame in TicTacToe containing the entire functionality of the program.
Rob__ has joined #ruby
<simonfromspace>
Alright
<simonfromspace>
I'll spend reading on namespaces and getting all this clear
<simonfromspace>
Thank you so much for your time havenwood
<simonfromspace>
I sometimes can't believe anyone would spend significant amount of time explaining all these, but I really really appreciate it!
<havenwood>
simonfromspace: Then put all methods in that top level constant, until you see a reason to refactor them out via extract method or extract class/module refactors.
<havenwood>
simonfromspace: Other folk helped me.
<simonfromspace>
I will return the favor here someday too :)
pwnd_nsfw has quit [Ping timeout: 255 seconds]
pwnd_nsfw` has quit [Ping timeout: 260 seconds]
pwnd_nsfw has joined #ruby
alfiemax has quit [Remote host closed the connection]
tau has joined #ruby
chalkmonster has joined #ruby
jmcgnh has quit [Read error: Connection reset by peer]
royal_screwup21 has joined #ruby
linuus[m] has joined #ruby
scipio_africanu4 has joined #ruby
turt2live has joined #ruby
stan has joined #ruby
qbrd[m] has joined #ruby
batisi[m] has joined #ruby
sepp2k has joined #ruby
kp666[m] has joined #ruby
mistergibson[m] has joined #ruby
jmcgnh has joined #ruby
Bounga has quit [Ping timeout: 272 seconds]
royal_screwup21 has quit [Remote host closed the connection]
coderhs has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
<lmat>
I'm writing a rails integration test. How do I adjust the session? I've tried session.clear, controller.session.clear, and @controller.session.clear. Each time, the session appears clear in the integration test, but as soon as code enters the controller again, those session variables are back!! Black magic!
royal_screwup21 has joined #ruby
alfiemax has quit [Ping timeout: 272 seconds]
<ellcs>
lmat: i remember dark, but i think it was like controller.session.session
coderhs has joined #ruby
<lmat>
wow
<lmat>
Checking...
<lmat>
no controller.session.session ;-)
<lmat>
There are so many sessions...
jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
<lmat>
I think they're all the same.... session, controller.session, @controller.session, @request.session.
<lmat>
oh, and request.session :-S
fphilipe_ has joined #ruby
coderhs has quit [Quit: Leaving]
fphilipe_ has quit [Ping timeout: 248 seconds]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
hiroaki has joined #ruby
tdy has quit [Quit: WeeChat 1.9.1]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
<lmat>
b/win 1
<al2o3-cr>
lmat: using weechat? alt + 1 :)
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
ctOS has quit [Quit: Connection closed for inactivity]
fanta1 has quit [Quit: fanta1]
cliluw has quit [Read error: Connection reset by peer]
<justJohnathon>
that's true. Some of my clients don't want to pay to upgrade their software. :/
<justJohnathon>
but most do
<justJohnathon>
as I suspected, openssl isn't right for this ruby
<justJohnathon>
so now I need to recompile
jintseng has quit [Ping timeout: 260 seconds]
<justJohnathon>
I'm using chruby and ruby-install.
<justJohnathon>
I see a lot of people doing something like this... `PKG_CONFIG_PATH=/opt/local/lib/openssl-1.0/pkgconfig ruby-install ruby-2.3.7 --with-openssl-lib=/opt/local/lib/openssl-1.0`
bsdband6 has joined #ruby
<justJohnathon>
I compiled the older version of openssl so I could compile against that, but it doesn't have a pkgconfig file.
smoochsmooch has joined #ruby
bsdbandit-01 has quit [Ping timeout: 260 seconds]
chalkmonster has joined #ruby
istrasci has joined #ruby
<istrasci>
If I have a constant A::B (`class A; B = 'b'.freeze; end`), how can I "call" this constant if given the symbol `:b` for it?
<justJohnathon>
The convention in Ruby is that constants should be in all capitals.
<istrasci>
Nevermind, I can call `A.const_get(:b)`.
<justJohnathon>
you can.
<justJohnathon>
but why not just call it B ?
<istrasci>
I'm not defining it, I'm accessing it.
pwnd_nsfw has quit [Quit: Leaving]
<justJohnathon>
istrasci: Someone else defined it?
bsdband6 has quit [Quit: -a- Connection Timed Out]
<al2o3-cr>
istrasci: :b is not constant
<istrasci>
You guys aren't understanding the scenario.
<justJohnathon>
I'd like to
<istrasci>
Another method returns `:b` to me (whether from an API or whatever). From that, I need to be the value of `A::B`.
<istrasci>
*I need to get
<istrasci>
Basically, someone saying, "Here's a symbol. Get the constant in class A that matches it".
<justJohnathon>
So if you get a _symbol_ 'b'.to_sym, you should check A::B
<istrasci>
Sorry, the symbol returned would be `:B`, not lowercase `:b`.
<al2o3-cr>
A.const_get(:b.upcase)
<al2o3-cr>
oh
<istrasci>
Yes
<justJohnathon>
yep, that's where I was going.
<istrasci>
The `.const_get` is what I didn't know existed.
<justJohnathon>
well I don't think hyou can get symbols
<justJohnathon>
from an API
<justJohnathon>
but...
<justJohnathon>
yep, const_get
<al2o3-cr>
istrasci: check if it's defined first with const_defined?
<justJohnathon>
ok so here's my question. Am I correct in thinking that you can't compile Ruby 2.3.x against the current version of Open SSL?
<justJohnathon>
havenwood: you might know that.
Mallot1 has joined #ruby
<Mallot1>
Hello
<Mallot1>
Please help me. I wrote 4 functions so I can do basic activerecord database work (Create, Read, Update, and Delete). I'm getting a "car.rb:31: syntax error, unexpected ':', expecting ')' (SyntaxError)" error. Please help me fix this: https://dpaste.org/Bbca . Thanks
TorpedoSkyline has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bsdbandit-01 has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.7]
<al2o3-cr>
Mallot1: look at line 31
<Mallot1>
Nevermind. Now the new error is "NoMethodError at /undefined method `id' for #<Class:0x00000000063e2cf8> Did you mean? ids". I get that when I run "Car.createRecord("Chevvy", "purple") in my controller. Error goes away when I remove line 8.
Rob__ is now known as pwnd_nsfw
<pwnd_nsfw>
Who taught you ruby my guy
<Mallot1>
al2o3-cr: Thanks, I solved that issue :) . Now I have another one. Same code, with the edits: https://dpaste.org/mXj4
<Mallot1>
pwnd_nsfw: I'm new. Just trying to get this to work
<pwnd_nsfw>
Did you port it from another language? lol
<Mallot1>
lol
<Mallot1>
What's wrong with it?
<Mallot1>
Do you see the error? :)
<pwnd_nsfw>
Like, the conventions you've used are so not ruby at all. I'm sure you will get it to work
<pwnd_nsfw>
But it definitely looks like you're coming from another language and diving straight in
<Mallot1>
What conventions?
<pwnd_nsfw>
Basically, you could probably write the code you have in like... 10 lines of code lol
donofrio has quit [Remote host closed the connection]
<Mallot1>
How?
<istrasci>
Yeah, if you're using ActiveRecord, you don't need like any of that stuff.
<pwnd_nsfw>
Look how how to use active record
<Mallot1>
istrasci: Using activerecord.
<pwnd_nsfw>
up*
<pwnd_nsfw>
Right, so you don't need much of the code you have
<pwnd_nsfw>
ActiveRecord is gonna be your middle man between your code and the database
<justJohnathon>
Installing ruby 2.3 is impossible.
<pwnd_nsfw>
lies
<Mallot1>
pswd_nsfw: Thanks. Yeah I know (cool)
<Mallot1>
pwnd_nsfw^^
<Mallot1>
pwnd_nsfw: ^^
<pwnd_nsfw>
:)
<Mallot1>
pwnd_nsfw: Now the new error is "NoMethodError at /undefined method `id' for #<Class:0x00000000063e2cf8> Did you mean? ids". I get that when I run "Car.createRecord("Chevvy", "purple") in my controller. Error goes away when I remove line 8. Can you help me fix this?
<Mallot1>
pwnd_nsfw: ^^ (they are not in a controller. Those are just the lines themselves.)
<pwnd_nsfw>
They exist as part of you inheriting from activerecord
<pwnd_nsfw>
Car.find(...)
<pwnd_nsfw>
Are you using rails?
Synthead has joined #ruby
<Mallot1>
Oh I see. So how is the data returned from the "result = Car.update(@record_id, "#{passed_field}" => new_value)" line?
<Synthead>
If I have a keyword with a default value in a method definition (i.e. def my_method(foo: nil); end) is there a way to tell if I explicitly stated nil or of it's the default value?
<Mallot1>
is it in an array or something? In other words how do I just get the data itself? I'm using Sinatra
gavlee has quit [Ping timeout: 260 seconds]
<Mallot1>
pwnd_nsfw: ^^
<havenwood>
Synthead: The pattern I use for that is: DEFAULT = Object.new.freeze
gavlee has joined #ruby
<pwnd_nsfw>
you should consult the documentation
<Mallot1>
Hey havenwood, nice to see you again
<pwnd_nsfw>
This is pretty basic stuff for active record.
<Mallot1>
havenwood: Could you help me with just 4 lines for activerecord? I'm just trying to see if my 4 activerecord lines are written right that's all.
<pwnd_nsfw>
justJohnathon, 2.3.8 just installed on my pi4 using rvm
gavlee has quit [Ping timeout: 240 seconds]
nowhereman has quit [Ping timeout: 255 seconds]
gavlee has joined #ruby
<justJohnathon>
pwnd_nsfw: with openssl?
evert has joined #ruby
fphilipe_ has joined #ruby
fphilipe_ has quit [Ping timeout: 272 seconds]
hiroaki has quit [Ping timeout: 272 seconds]
justJohnathon has quit [Remote host closed the connection]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has joined #ruby
jmcgnh has joined #ruby
john2496 has quit [Remote host closed the connection]
splud_wurk has joined #ruby
Mallot1 has quit [Remote host closed the connection]
drincruz has quit [Ping timeout: 258 seconds]
mossplix has joined #ruby
alfiemax has joined #ruby
davidw has joined #ruby
ellcs has quit [Ping timeout: 240 seconds]
Synthead has quit [Quit: Leaving]
alfiemax has quit [Ping timeout: 258 seconds]
Mallot1 has joined #ruby
<Mallot1>
Hello. Why do I get "NoMethodError at /createtestcar undefined method `id' for #<Class:0x0000000006edbad8> Did you mean? ids" on line 10? How do I fix it?
lucasb has quit [Quit: Connection closed for inactivity]
<Mallot1>
All I want is the id for the record that was created.
<Mallot1>
Thank you :)
donofrio has joined #ruby
jmcgnh has quit [Ping timeout: 268 seconds]
jmcgnh has joined #ruby
<havenwood>
pwnd_nsfw: I think they're installing 2.1 and 2.3 was just an example.
impermanence has quit [Ping timeout: 240 seconds]
<Mallot1>
How can I get the id of the last inserted row in activerecord? Every time I use "Modelname.id" I get "undefined method `id' for #<Class:0x00000000077aa240> Did you mean? ids"