<havenwood>
Anubix: I mean it looks like you're setting the headers properly. I'm not sure why they're not being picked up by Rails. Maybe make a simplified reproduction script with Rails and see if you can nerd snipe someone in the #RubyOnRails channel?
<Anubix>
I am doing it in rails
<havenwood>
Anubix: Right, I just mean a minimal reproduction app that folk can run themselves.
<Anubix>
Is there some possibility to check this variables host in browser? Because when its request, its never in network
<marz_d`ghostman>
I'm working with numbers like 3.9855141693e+07, does ruby support it?
x0f has joined #ruby
<marz_d`ghostman>
I mean what type should I use to properly handle it
clemens3_ has joined #ruby
n13z has quit [Remote host closed the connection]
ur5us has quit [Read error: Connection reset by peer]
drale2k_ has joined #ruby
<Ove_>
With the Ruby GC, I know what amount of heap_live_slots and heap_free_slots I max out with. Adding them totals 2.3 million. Does it make sense to set RUBY_GC_HEAP_INIT_SLOTS to that value and then don't allow more growing on the heap?
skyikot has joined #ruby
<kke>
with frozen string literals, i don't get why `key = "foo"; "#{key}".frozen?` ==> true
skyikot has quit [Client Quit]
skyikot has joined #ruby
<kke>
even "#{key.reverse}".frozen? == true
skyikot has quit [Client Quit]
nowhere_man has quit [Ping timeout: 258 seconds]
alem0lars has joined #ruby
n13z has joined #ruby
cd has quit [Quit: cd]
DTZUZO has quit [Ping timeout: 246 seconds]
skyikot has joined #ruby
mikecmpbll has joined #ruby
ramfjord has joined #ruby
bruce_lee has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kapil____ has joined #ruby
<phaul>
kke, "#{..}" is a string literal
ramfjord has quit [Ping timeout: 240 seconds]
<phaul>
&ri BigDecimal, marz_d`ghostman
<rubydoc>
marz_d`ghostman: I found 2 entries matching class BigDecimal.
<tbuehlmann>
right, we rather handle objects as "truthy" and "falsy" most of the time
gregf_ has joined #ruby
blackmesa1 has quit [Ping timeout: 258 seconds]
<phaul>
drop the class from that, given that there are two objects in total, you can do [true, false].include?(object) or object == true || object == false if you really need to match on those two.
conta has quit [Ping timeout: 246 seconds]
<RougeR>
yeah ive seen there is a few ways of doing it phaul i quite liked this for it being the explicit functionality i wanted
<RougeR>
but yeah i feel standard ruby should have a is_bool? method built in
<phaul>
what tbuehlmann said is also true. the fact you need this is a bit of a smell
<RougeR>
i can tell you what its for
<RougeR>
i want to pass true or false for a json api request
<RougeR>
and i want to validate that a param is either true or false
<phaul>
yeah. that's a smell :) don't validate that things match classes. If it behaves like a true or false it's good enough. Doesn'tneed to be it. You might need to convert. Instead of checking the type, do (object ? true : false) or some like !! object, but I don't
<phaul>
and use the converted object in JSON
prestorium has quit [Quit: prestorium]
<RougeR>
i disagree
<RougeR>
otherwise sticking in any old string will work as true
<RougeR>
im not sure why validating a bool is bad
aufi has joined #ruby
<RougeR>
i have thought about using just a string as the decider
<RougeR>
but i think having bools should be fine
<tbuehlmann>
yeah, I'd check for == true or == false directly then
<RougeR>
but thats not really any different too .is_a?(TrueClas)
BH23 has quit [Read error: No route to host]
prestorium has joined #ruby
tdy1 has quit [Ping timeout: 246 seconds]
BH23 has joined #ruby
conta has joined #ruby
gregf_ has quit [Ping timeout: 256 seconds]
<phaul>
RougeR: sure. there are always exceptions. it's not that validating bools is bad, but in general validating on classes is bad. It makes the code harder to extend by tying methods down to classes. for instance the reek tool flat out tells you off for using any type checks. Not everybody agrees with that though.
<haxx0r>
i need to load that stupid javascript and then get some values out there
<haxx0r>
no json api. so i have to extract it out of the html page
<haxx0r>
i wonder why <script>.*<\/script> won't match
<haxx0r>
<script>.{100} or even that
<phaul>
try putting a ? on your *
<phaul>
* is greedy
<phaul>
it will consume </script>
<haxx0r>
na. figured out i need "m" modifier because of new line stuff
<haxx0r>
mh
<haxx0r>
initialState: JSON\.parse(.*)\),
<haxx0r>
that could work
<haxx0r>
but how do i get only (.*) with String.scan?
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
drale2k_ has joined #ruby
AJA4350 has quit [Ping timeout: 268 seconds]
AJA4350 has joined #ruby
sleetdrop has quit [Quit: Computer has gone to sleep.]
<phaul>
I was wrong. It seems greediness only applies if it doesn't fail overall match.
stryek has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr>
if both arguments to a method must be string which is preferred? raise [ArgumentError|TypeError], "arguments must be string" unless [x,y].all? String
<z64>
our windows users seem to be having an issue installing unf_ext, a native extension in our dependency tree, specifically on ruby 2.6. the error they get when installing is "unf_ext requires Ruby version >= 2.0, < 2.6", but there is in fact no such restriction in their gemspec (or the wrapper gem, unf). this is not an issue on linux. what could be enforcing this?
<rubydoc>
Man is driven to create; I know I really love to create things. And while I'm not good at painting, drawing, or music, I can write software.
<al2o3-cr>
good quote!
<phaul>
especially that now it doesnt truncate quotes halfway as it used to ;)
<al2o3-cr>
hehe, yeah, like the last one ;)
<phaul>
also fixed the ri BigDecimal thing. now the logic is that if classname.downcase == require_name || require_name == core => default to that, instead of complaining for multiple hits
<phaul>
I'm not sure how derpy used to deal with these things..
fluxAeon has quit [Ping timeout: 246 seconds]
AJA4350 has quit [Ping timeout: 245 seconds]
<al2o3-cr>
phaul: i'm not sure now, as they've taken their code off of github.
aufi has quit [Ping timeout: 255 seconds]
renich has joined #ruby
plainprogrammer has joined #ruby
sagax has quit [Ping timeout: 250 seconds]
AJA4350 has joined #ruby
BH23 has quit [Ping timeout: 250 seconds]
skryking_ has joined #ruby
nowhere_man has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
moei has joined #ruby
clemens3_ has quit [Ping timeout: 255 seconds]
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mangold has quit [Quit: This computer has gone to sleep]
\void has joined #ruby
blackmesa has joined #ruby
spacesuitdiver has joined #ruby
<marz_d`ghostman>
How do I convert a number with exponential notation from BigDecimal to its original form? e.g. BigDecimal.new('1.6703200934e+08')
AJA4351 has joined #ruby
blackmesa1 has quit [Ping timeout: 268 seconds]
AJA4350 has quit [Ping timeout: 250 seconds]
AJA4351 is now known as AJA4350
<al2o3-cr>
marz_d`ghostman: call to_f on it.
<marz_d`ghostman>
al2o3-cr: It doesn't seem to convert it back to its original: 1.6703200934e+08
<al2o3-cr>
oh haha
<al2o3-cr>
marz_d`ghostman: "%e" % bd
<marz_d`ghostman>
al2o3-cr: can you tell me what these numbers are and this conversion process