havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.0, 2.6.5, 2.5.7: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
jmcgnh has quit [Read error: Connection reset by peer]
jmcgnh has joined #ruby
pupsikov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pupsikov has joined #ruby
pupsikov has quit [Client Quit]
chalkmonster has joined #ruby
xco has joined #ruby
xco has quit [Client Quit]
kaivai_ has quit [Quit: ZNC 1.6.5 - http://znc.in]
jmcgnh has quit [Read error: Connection reset by peer]
jmcgnh has joined #ruby
leitz has quit [Quit: Leaving]
markoong has quit [Ping timeout: 265 seconds]
meinside has joined #ruby
ooheitooh1 has joined #ruby
ooheitooh has quit [Ping timeout: 265 seconds]
bvdw has joined #ruby
postmodern has joined #ruby
pupsikov has joined #ruby
zlogan has joined #ruby
Dirak has quit [Ping timeout: 240 seconds]
Dirak has joined #ruby
xco has joined #ruby
xco has quit [Client Quit]
gix has quit [Ping timeout: 260 seconds]
TotalFail has joined #ruby
pupsikov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Esa_ has joined #ruby
Buggys has joined #ruby
xco has joined #ruby
xco has quit [Client Quit]
jmcgnh has quit [Ping timeout: 240 seconds]
RougeR has joined #ruby
<RougeR> did a quick exponential program for covid19
darkf has quit [Quit: so long, and thanks for all the fish]
<RougeR> "fun"
jmcgnh_ has joined #ruby
jmcgnh_ is now known as jmcgnh
_whitelogger has joined #ruby
dinfuehr has quit [Ping timeout: 265 seconds]
dinfuehr has joined #ruby
braincrash has quit [Quit: bye bye]
ur5us has quit [Ping timeout: 240 seconds]
braincrash has joined #ruby
xco has joined #ruby
gavlee has quit [Excess Flood]
xco has quit [Client Quit]
gavlee has joined #ruby
teej has quit [Quit: Connection closed for inactivity]
donofrio has quit [Remote host closed the connection]
cd has quit [Quit: cd]
<taserface> RougeR: how long before we all die?
mkroman- has joined #ruby
Dirak has quit [Ping timeout: 256 seconds]
ur5us has joined #ruby
Dirak has joined #ruby
mkroman has quit [Quit: pa bangu noroi banzu]
mkroman- has quit [Quit: pa bangu ba noroi banzu]
mkroman has joined #ruby
pinpox has quit [Ping timeout: 255 seconds]
ur5us has quit [Ping timeout: 256 seconds]
taserface has quit [Ping timeout: 256 seconds]
chalkmonster has quit [Quit: WeeChat 2.7.1]
mkroman has quit [Quit: pa bangu ba noroi banzu]
mkroman has joined #ruby
Tempesta has quit [Quit: AdiIRC is updating to v3.8 Beta Build (2020/03/05 UTC) 64 Bit]
Tempesta has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
duderonomy has quit [Ping timeout: 260 seconds]
Tempesta has quit [Quit: See ya!]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Tempesta has joined #ruby
markopasha has joined #ruby
zapata has quit [Ping timeout: 260 seconds]
roadie has joined #ruby
roadie has left #ruby ["ERC (IRC client for Emacs 25.3.50.1)"]
roadie has joined #ruby
<roadie> how do I revert from rspec to minitest when creating a new gem? It asked me the first time and I entered rspec ...
<roadie> nvmd solved
Modulo5k has joined #ruby
<Modulo5k> Hello, what are my options for binding C++ to Ruby?
<Modulo5k> I've looked at SWIG, but the last time I checked it wasn't mature enough for all of C++
RougeR has quit [Read error: Connection reset by peer]
RougeR has joined #ruby
xco has joined #ruby
fercell has joined #ruby
<Modulo5k> I'm also looking at Rice
<Modulo5k> but there is no auto generation of the binding
p3ps1 has quit [Ping timeout: 258 seconds]
Modulo5k has quit [Read error: Connection reset by peer]
p3ps1 has joined #ruby
Ai9zO5AP has quit [Ping timeout: 258 seconds]
Ai9zO5AP has joined #ruby
alexherbo2 has joined #ruby
sdu has joined #ruby
dionysus69 has joined #ruby
vondruch has joined #ruby
fanta1 has joined #ruby
dinfuehr has quit [Ping timeout: 268 seconds]
dinfuehr has joined #ruby
ellcs has joined #ruby
sergioro has quit [Quit: leaving]
paraxial has quit [Quit: The Lounge - https://thelounge.chat]
TzilTzal has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
paraxial has joined #ruby
donofrio has joined #ruby
<TzilTzal> Hi
<TzilTzal> How can I replace an element in a Set?
chalkmonster has joined #ruby
paraxial has quit [Client Quit]
paraxial has joined #ruby
paraxial has quit [Client Quit]
jetchisel has joined #ruby
paraxial has joined #ruby
rapha has joined #ruby
<rapha> morning
<rapha> *yawn*
cnsvc has joined #ruby
jmcgnh has quit [Read error: Connection reset by peer]
cnsvc has quit [Ping timeout: 240 seconds]
jmcgnh has joined #ruby
Dirak has quit [Ping timeout: 268 seconds]
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
Dirak has joined #ruby
cnsvc has joined #ruby
Dirak has quit [Ping timeout: 256 seconds]
cnsvc has quit [Ping timeout: 240 seconds]
chalkmonster has quit [Quit: WeeChat 2.7.1]
royal_screwup21 has joined #ruby
royal_screwup21 has quit [Remote host closed the connection]
rippa has joined #ruby
<TzilTzal> How do I retrieve an element by its hash from a Set?
<ytti> i'm not sure i understand
<ytti> Set being internally hash is impleemntation detail you shouldn't rely even if you can
<ytti> what is hash in this context?
<ytti> do you mean object id?
<TzilTzal> I'd just like to retrieve an element from a set.
<ytti> what do you know about the potential element?
<TzilTzal> It's hash. Which is how Set compares elements (hash & eql?)
<ytti> can you show code
<ytti> usually in set you'd just test if element exist in set
<TzilTzal> s = Set.new
<TzilTzal> s << 'hello'
<TzilTzal> # how do I find if a string is in s?
<ytti> fetching elements from set makes little sense to me now, but i may be missing a use-case
<ytti> s.include? 'hello'
<TzilTzal> and if it exists, I'd like to have that object.
<ytti> item if s.include? item
<ytti> :/
<TzilTzal> ?
<ytti> that will return item if item is in set
<TzilTzal> And what if item is a more complex object and the set stores by the name (which is a stirng)
<TzilTzal> (string)
<TzilTzal> I'd like to just check by the name and have the object.
<ytti> can you show actual code
<ytti> what you're asking makes very little sense to me
<ytti> and i feel like it's communication issue
<TzilTzal> class Person
<TzilTzal> def eql?(other)
<TzilTzal> attr_accessor :name
<TzilTzal> @name == other.name
<TzilTzal> end
<TzilTzal> end
<TzilTzal> s = Set.new()
<TzilTzal> s << Person.new('John') << Person.new('Jack')
markoong has joined #ruby
<TzilTzal> I'd like the full Person when search for 'John' and 'Jack'
<ytti> s.find { |item| item.name == name }
<TzilTzal> That probably defies the whole purpose of using a Set...
<ytti> your design does
<TzilTzal> Not really...
<ytti> you're putting object of Person there
<ytti> but you're trying to find with unrelated value
<TzilTzal> Very reasonable to want to store something by a certain field or attribute
<ytti> then how would you expect anything else but s.find { |item| item.name == name } to work?
paraxial has quit [Quit: The Lounge - https://thelounge.chat]
<ytti> either find
<ytti> or test for the actual object you put there
<ytti> s.include? Person.new(name)
<TzilTzal> I don't want to use a hash since that duplicates the name
<ytti> either you use find or you test for the actual object you put there
<ytti> dunno what else to tell you
<ytti> let me try this otherway around
<ytti> if ruby would do magically what ever you wish it would do, what code would work?
<ytti> because my imagination fails to see any other opportunities
lovelove has quit [Quit: Connection closed for inactivity]
cnsvc has joined #ruby
roadie has quit [Remote host closed the connection]
cnsvc has quit [Ping timeout: 240 seconds]
d3bug has quit [Quit: Connection closed for inactivity]
<pyrmont> TzilTzal: This is Ruby. You can simply patch Set to do what you want. Monkey patching like that has issues but if you understand what they are you can make it do what you want.
<pyrmont> TZilTzal: Alternatively, you can create a new object that inherits from Set and overriding the #include? method and simply use your new Set-like collection object instead of Set.
<pyrmont> *overrides
paraxial has joined #ruby
paraxial has quit [Client Quit]
paraxial has joined #ruby
royal_screwup21 has joined #ruby
chalkmonster has joined #ruby
p3ps1 has quit [Ping timeout: 258 seconds]
TzilTzal has quit [Quit: Leaving.]
burningserenity has joined #ruby
drincruz_ has joined #ruby
royal_screwup21 has quit [Remote host closed the connection]
p3ps1 has joined #ruby
cnsvc has joined #ruby
<ytti> pyrmont, that implies there is something that can be added
<ytti> pyrmont, to me it's not obvious how Set could perform better
<ytti> which is why i'd like to see the dream code, what it would do in his ideal world
<ytti> my imagination fails me
cnsvc has quit [Ping timeout: 240 seconds]
drincruz_ has quit [Ping timeout: 256 seconds]
<pyrmont> Perhaps I'm missing it but can't you just have #include? check the #name getter of each of the objects inside it?
<pyrmont> Seems pretty straightforward.
<pyrmont> TzilTzal said they wanted to be able to send the name of the Person and use that to fetch the item from the Set. What's there to imagine?
vondruch_ has joined #ruby
burningserenity has quit [Ping timeout: 258 seconds]
vondruch has quit [Ping timeout: 255 seconds]
vondruch_ is now known as vondruch
<ytti> pyrmont, but that is what the find did
<ytti> pyrmont, and he didn't want the find because reasons
markong has joined #ruby
* pyrmont shrugs.
<ytti> 12:51 < ytti> s.find { |item| item.name == name }
<ytti> 12:51 < TzilTzal> That probably defies the whole purpose of using a Set...
<ytti> so he doesn't want to compare the iterms getter method
<ytti> and he doesn't waqnt to give thet set Person.new(name)
<pyrmont> It seems a strength to me of Ruby that you can solve problems in multiple ways. Whatever fits the way they think.
<ytti> so what is there to do?
<ytti> yes but my issue is, i can't see any other way
<ytti> but to löook at the getter or create the object
<ytti> and OP wants something else, and my imagination doesn't stretch to understand what something else could be
<pyrmont> Your solution exposes the implementation to the user of the collection.
<ytti> that wasn't his complaint
<pyrmont> If you override #include? you arguably have a more semantically clear method that might be more ergonomic. Behind the scenes, it can use #find but you don't need to make that clear to the user of the API.
<ytti> his complain was that the defies the purpose of using set
<ytti> implying he should just check for existence
RougeR has quit [Remote host closed the connection]
<ytti> not iterate the list
<ytti> and your proposal also iterates
<ytti> so if you don't want to iterate and you don't want to check for the actual object
<ytti> what other venues are there?
RougeR has joined #ruby
<pyrmont> Well, no, I said you could override #include? I didn't say what the implementation should be. You could implement it with a Set of names that sits inside the Set. You could
markoong has quit [Ping timeout: 260 seconds]
<pyrmont> …implement it with an internal Hash.
<ytti> 14:03 < pyrmont> Perhaps I'm missing it but can't you just have #include? check the #name getter of each of the objects inside it?
<ytti> that is iteration
<pyrmont> But since he or she is gone it's probably not worth worrying about at this point.
<ytti> which is what OP didn't want
<pyrmont> Sorry, you're right. I did eventually suggest that. Initially I said: <pyrmont> TzilTzal: This is Ruby. You can simply patch Set to do what you want. Monkey patching like that has issues but if you understand what they are you can make it do what you want.
<ytti> what ever you do, you either iterate or you check for the object itself
<ytti> i proposed both #find to iterate and Person.new(name) for the object itself, neither was acceptable
<ytti> which i believe leaves us with solution space of 0
<pyrmont> 👍
<ytti> and seeing the dream code would possibly add clarity
cnsvc has joined #ruby
stryek has joined #ruby
jcalla has quit [Ping timeout: 265 seconds]
cnsvc has quit [Ping timeout: 240 seconds]
burningserenity has joined #ruby
duderonomy has joined #ruby
leitz has joined #ruby
drincruz_ has joined #ruby
margeas has joined #ruby
markong has quit [Ping timeout: 255 seconds]
drincruz_ has quit [Ping timeout: 240 seconds]
P1RATEZ has joined #ruby
RougeR has quit [Remote host closed the connection]
RougeR has joined #ruby
postmodern has quit [Read error: Connection reset by peer]
postmodern has joined #ruby
stdedos has quit [Remote host closed the connection]
infinityfye has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
ua has quit [Read error: Connection reset by peer]
ua has joined #ruby
jcalla has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
lucasb has joined #ruby
cnsvc has joined #ruby
Bounga has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
alexherbo2 has quit [Remote host closed the connection]
ttoocs has quit [Ping timeout: 240 seconds]
postmodern has quit [Quit: Leaving]
banisterfiend has joined #ruby
pupsikov has joined #ruby
AndroidKitKat has quit [Quit: バイバイ〜!]
zlogan has quit [Remote host closed the connection]
zlogan has joined #ruby
drincruz_ has joined #ruby
Bounga has quit [Remote host closed the connection]
pelegreno___ has quit [Ping timeout: 265 seconds]
cnsvc has joined #ruby
Dirak has joined #ruby
hutch has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
fercell has quit [Quit: WeeChat 2.7.1]
Dirak has quit [Ping timeout: 240 seconds]
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
cnsvc has joined #ruby
<dreamreal> Has anyone here gotten bearer authentication working with Net::HTTP?
<dreamreal> I'm building the request properly, I think - debugger shows the headers and all - and it matches what Postman is showing as working, but I'm not getting a proper response
Dirak has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
Dirak has quit [Ping timeout: 256 seconds]
dionysus69 has quit [Ping timeout: 256 seconds]
tsujp has quit [Quit: Textual IRC Client: www.textualapp.com]
markopasha has quit [Read error: Connection reset by peer]
szqdsegrhrdgdrg has joined #ruby
<szqdsegrhrdgdrg> hi
<szqdsegrhrdgdrg> Could someone help me please
<szqdsegrhrdgdrg> ?
cnsvc has joined #ruby
<clemens3> just shoot your question
<szqdsegrhrdgdrg> Ok, it's about an Rails app. I want to include all the js files presents inside the folder "./app/assets/javascripts"
<szqdsegrhrdgdrg> I don't know what to include in my layout file
<szqdsegrhrdgdrg> I have this : <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
<szqdsegrhrdgdrg> but I just include the "./app/javascript/application.js" file
<szqdsegrhrdgdrg> it just *
cnsvc has quit [Ping timeout: 240 seconds]
alexherbo2 has joined #ruby
lmns has quit [Quit: The Lounge - https://thelounge.chat]
lmns has joined #ruby
royal_screwup21 has joined #ruby
ChmEarl has joined #ruby
<dreamreal> I got httparty to work, net::http still fails, something about the headers I THINK
mre- has joined #ruby
cnsvc has joined #ruby
<al2o3-cr> dreamreal: show how you are doing it with net/http.
P1RATEZ has quit [Remote host closed the connection]
<dreamreal> pretty simple: get the http reference (Net::HTTP.new(endpoint.host, endpoint.port), then getting the request, setting the headers with request["Authorization"]="Bearer #{@api_key}", then http.request(request)
TheBrayn has quit [Quit: poof]
cthu| has joined #ruby
<dreamreal> the response comes back as a 400 - which is weird, because it SHOULD be a 401 - but the authorization header IS being set (but with "authorization" as a key and not "Authorization")
infinityfye has quit [Ping timeout: 258 seconds]
alexherbo2 has quit [Remote host closed the connection]
<al2o3-cr> dreamreal: that code you shown should work. wonder why it's coming back as a bad request.
TheBrayn has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.7.1]
<al2o3-cr> dreamreal: https://gist.github.com/gr33n7007h/7c6810b8924ff741367de2bd1844a97f try this, see what resp code you get.
royal_screwup21 has quit [Remote host closed the connection]
<al2o3-cr> i missed to closing brace but i updated it.
RougeR has quit [Remote host closed the connection]
RougeR has joined #ruby
robenkleene has joined #ruby
<dreamreal> well, it's working with httparty now - I'd rather not revert to test
<dreamreal> but I truly appreciate the advice
<szqdsegrhrdgdrg> dreamreal could You help me ? It's about Rails
<al2o3-cr> dreamreal: i was just curious to why it was failing. dreamreal good luck.
gbt1988 has joined #ruby
<dreamreal> szqdsegrhrdgdrg: I wish I could but I think I royally suck at ruby
<dreamreal> al2o3-cr: honestly, me too but I'm already behind on an integration effort :/
<al2o3-cr> dreamreal: np.
<szqdsegrhrdgdrg> dreamreal No proble
<szqdsegrhrdgdrg> problem
<al2o3-cr> szqdsegrhrdgdrg: have you asked in #rubyonrails maybe they can help you?
<szqdsegrhrdgdrg> al2o3-cr Yes, but it's seem they are not presents
<al2o3-cr> just hold on here until someone knows. there is a few people who know rails here.
sdu has quit [Remote host closed the connection]
<adam12> szqdsegrhrdgdrg: Are you using webpacker? What version of Rails?
<szqdsegrhrdgdrg> Yes
<szqdsegrhrdgdrg> It's : Rails 6.0.2.1
<szqdsegrhrdgdrg> My issue is that I can't call a function from my "test.js"
<szqdsegrhrdgdrg> in my layout file I have : " <%= javascript_pack_tag 'test', 'data-turbolinks-track': 'reload' %>"
<adam12> szqdsegrhrdgdrg: Old versions of Rails used to include a Sprockets statement which required all javascript. You always loaded the one file (application.js) but that would load the rest.
<adam12> szqdsegrhrdgdrg: Inside your application.js, you're probably going to want to `import "test.js"`
<adam12> I don't use Rails or Webpack so probably won't be much help other than that.
yxhuvud has joined #ruby
gbt1988 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
Dirak has joined #ruby
<szqdsegrhrdgdrg> I finally fix the issue
<szqdsegrhrdgdrg> in the js file, instead of using function declaration, you should use function expression
<szqdsegrhrdgdrg> Thanks
Dirak has quit [Ping timeout: 258 seconds]
thecoffemaker has quit [Read error: Connection reset by peer]
mre- has quit [Ping timeout: 240 seconds]
banisterfiend has quit [Quit: Textual IRC Client: www.textualapp.com]
mre- has joined #ruby
Dirak has joined #ruby
zapata has joined #ruby
mre- has quit [Ping timeout: 265 seconds]
Dirak has quit [Ping timeout: 265 seconds]
howdoi has joined #ruby
dionysus69 has quit [Quit: dionysus69]
dionysus69 has joined #ruby
ellcs has quit [Ping timeout: 258 seconds]
pupsikov has quit [Quit: Textual IRC Client: www.textualapp.com]
pupsikov has joined #ruby
cd has joined #ruby
mre- has joined #ruby
zlogan has quit [Read error: Connection reset by peer]
sergioro has joined #ruby
hiroaki has joined #ruby
dinfuehr has quit [Ping timeout: 256 seconds]
dinfuehr has joined #ruby
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
fanta1 has quit [Quit: fanta1]
akem has joined #ruby
banisterfiend has joined #ruby
alfiemax has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
RougeRR has joined #ruby
RougeR has quit [Read error: Connection reset by peer]
Dirak has joined #ruby
Dirak has quit [Read error: Connection reset by peer]
x0f_ has quit [Ping timeout: 255 seconds]
x0f has joined #ruby
cnsvc has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
drincruz_ is now known as drincruz
cnsvc has quit [Ping timeout: 240 seconds]
<dreamreal> This may be (yet another) stupid question... but if I'm trying to create a hash with strings as keys, what's the right way to do this? Like, I literally want a hash of "Id" => id, "Name" => name....
ellcs has joined #ruby
<leftylink> indeed, hashes can have strings as keys. I sense there must be something I'm missing to this question.
ellcs has quit [Ping timeout: 240 seconds]
<dreamreal> well, IDEA is giving me a warning saying 'string key in hash'
<dreamreal> which makes me think "... is that wrong?"
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
banisterfiend has quit [Quit: Textual IRC Client: www.textualapp.com]
<dreamreal> wait a second... the hashes all look like the keys are lower-cased.
<szqdsegrhrdgdrg> In Rails in the the ./config/routes.rb, Is it safe to do : `get '' => 'pages#home'` instead of : `root 'pages#home'` ?
akem has quit [Quit: Leaving]
<dreamreal> gah, okay, the integration endpoint is doing this
alfiemax has quit [Ping timeout: 268 seconds]
troulouliou_div2 has joined #ruby
sergioro has quit [Quit: leaving]
kristian_on_linu has joined #ruby
entel has joined #ruby
szqdsegrhrdgdrg has quit [Remote host closed the connection]
cnsvc has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
cnsvc has quit [Ping timeout: 240 seconds]
bvdw has joined #ruby
markopasha has joined #ruby
szqdsegrhrdgdrg has joined #ruby
<szqdsegrhrdgdrg> hi
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
hutch has quit [Ping timeout: 265 seconds]
markopasha has quit [Remote host closed the connection]
markopasha has joined #ruby
cnsvc has joined #ruby
hutch has joined #ruby
szqdsegrhrdgdrg has quit [Remote host closed the connection]
cnsvc has quit [Ping timeout: 240 seconds]
Esa_ has quit []
cnsvc has joined #ruby
szqdsegrhrdgdrg has joined #ruby
<szqdsegrhrdgdrg> hi
<szqdsegrhrdgdrg> Is it safe to do : `get '' => 'pages#home'` instead of : `root 'pages#home'` ?
hutch has quit [Ping timeout: 260 seconds]
roadie has joined #ruby
wildtrees has joined #ruby
jordanm has joined #ruby
ur5us has joined #ruby
<dreamreal> okay, I have ... yet another question, maybe about ruby philosophy. I have a gem that's basically an API to call a REST API. It accepts hashes as a data model; it's designed to be used by ANOTHER module that has a generic data model itself. The idea is that the intermediary will convert the ORIGINAL model into an appropriate model for the API, right? ... but what I'm wondering is how much I should
<dreamreal> worry, from a Rubyist's perspective, about validating that the model has the right data; should I scan for ONLY the right data, or just assume, or...
<szqdsegrhrdgdrg> dreamreal I still have the same question
<szqdsegrhrdgdrg> Is it safe to do : `get '' => 'pages#home'` instead of : `root 'pages#home'` ?
<dreamreal> *nod* I'm coming from languages that are strongly typed so I worry.
<dreamreal> szqdsegrhrdgdrg: As to your question, I have no idea
davor has quit [Ping timeout: 256 seconds]
kristian_on_linu has quit [Remote host closed the connection]
davor has joined #ruby
<szqdsegrhrdgdrg> davor hi
gix has joined #ruby
<phaul> szqdsegrhrdgdrg: root would map the controller action to the root url of the app, whereas get just maps it to pages/home path. so they achieve different things. Therefore Im not sure in this context what safe means
<phaul> dreamreal: It's specific to the codebase, but I would expect an api distributed as a gem to validate its inputs
<phaul> dreamreal: and the emphasis is on distributed as a gem. If it's an internal api then it depends
<dreamreal> well, it's not really a GENERAL-PURPOSE gem (it's for a vertical industry) but... yeah, I'm kinda leaning to wards trying to validate the types fairly strictly ("must have these keys, may have these keys, other keys are rejected")
weird_error has joined #ruby
<phaul> szqdsegrhrdgdrg: I didn't process your ` quotes properly... ignore my previous answer
hiroaki has quit [Ping timeout: 256 seconds]
mre- has quit [Ping timeout: 256 seconds]
<dreamreal> ... any suggestions on how to implement that with Ruby? :)
<szqdsegrhrdgdrg> phaul Hi. Thanks for your answer
<szqdsegrhrdgdrg> but since, '/' is also the root, it will achieve the same behavior
<szqdsegrhrdgdrg> correct me, if I'm wrong
<phaul> yeah, I prly agree with you
<szqdsegrhrdgdrg> I also quickly try it, and they work same
<szqdsegrhrdgdrg> But i'm sure there is a slighly difference
<szqdsegrhrdgdrg> Which could lead to exploit
ellcs has joined #ruby
Swyper has joined #ruby
hiroaki has joined #ruby
<adam12> szqdsegrhrdgdrg: `root` just does `get /` in the backend, but gives it a name as `root`. No reason you couldn't do the same. https://github.com/rails/rails/blob/4fbb393b25222bb16c60fef9e2a4e60f34dfec71/actionpack/lib/action_dispatch/routing/mapper.rb#L1999-L2002
<szqdsegrhrdgdrg> adam12 Thanks
burningserenity has quit [Quit: Leaving.]
xp has joined #ruby
xp has left #ruby [#ruby]
wimpog has joined #ruby
<wimpog> uby
<wimpog> hello, I'm selecting DISTINCT records with just one column that I need to then create an array of. However, I need my key to be the same as value.
hutch has joined #ruby
SeepingN has joined #ruby
sergioro has joined #ruby
evdubs has quit [Ping timeout: 256 seconds]
RougeR has joined #ruby
RougeRR has quit [Ping timeout: 240 seconds]
wimpog has quit [Quit: wimpog]
davispuh has joined #ruby
Swyper has quit [Remote host closed the connection]
mre- has joined #ruby
AndroidKitKat has joined #ruby
roadie has quit [Remote host closed the connection]
roadie has joined #ruby
wildtrees has quit [Remote host closed the connection]
royal_screwup21 has joined #ruby
wildtrees has joined #ruby
evdubs has joined #ruby
roadie has quit [Ping timeout: 265 seconds]
pupsikov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ellcs has quit [Ping timeout: 258 seconds]
davispuh has quit [Ping timeout: 255 seconds]
taserface has joined #ruby
davispuh has joined #ruby
davispuh has quit [Client Quit]
Milos has quit [Read error: Connection reset by peer]
davispuh has joined #ruby
Milos has joined #ruby
markopasha has quit [Remote host closed the connection]
wildtrees has quit [Remote host closed the connection]
ianbrown78 has joined #ruby
AndroidKitKat has quit [Remote host closed the connection]
wildtrees has joined #ruby
roadie has joined #ruby
drincruz has quit [Ping timeout: 260 seconds]
ianbrown78 has quit [Ping timeout: 255 seconds]
AndroidKitKat has joined #ruby
ianbrown78 has joined #ruby
AndroidKitKat has quit [Quit: バイバイ〜!]
roadie has quit [Ping timeout: 256 seconds]
AndroidKitKat has joined #ruby
d3bug has joined #ruby
royal_screwup21 has quit [Remote host closed the connection]
leitz has quit [Quit: Leaving]
<apotheon> havenwood: What are exciting new tools you use with Ruby dev these days?
royal_screwup21 has joined #ruby
entel has quit [Quit: Connection closed for inactivity]
ianbrown78 has quit [Ping timeout: 258 seconds]
ianbrown78 has joined #ruby
mre- has quit [Ping timeout: 256 seconds]
weird_error has quit [Quit: weird_error]
szqdsegrhrdgdrg has quit [Ping timeout: 240 seconds]
mre- has joined #ruby
roadie has joined #ruby
ttoocs has joined #ruby
roadie has quit [Ping timeout: 265 seconds]
mre- has quit [Ping timeout: 240 seconds]
hiroaki has quit [Ping timeout: 268 seconds]
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
nofxx has quit [Ping timeout: 256 seconds]
mre- has joined #ruby