mochiyoda has quit [Remote host closed the connection]
akosednar has quit [Ping timeout: 245 seconds]
zenspider has quit [Ping timeout: 245 seconds]
zenspider has joined #ruby
mochiyoda has joined #ruby
tarptaeya has joined #ruby
Spitfire has quit [Ping timeout: 255 seconds]
\tau has quit [Ping timeout: 246 seconds]
Tharbakim has quit [Ping timeout: 255 seconds]
doodlebug has quit [Ping timeout: 246 seconds]
akosednar has joined #ruby
akosednar has quit [Changing host]
akosednar has joined #ruby
Milos has joined #ruby
Spitfire has joined #ruby
Spitfire has quit [Changing host]
Spitfire has joined #ruby
Tharbakim has joined #ruby
Tharbakim has quit [Changing host]
Tharbakim has joined #ruby
doodlebug has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
Fernando-Basso has quit [Remote host closed the connection]
xall has joined #ruby
<IGnorAND>
how does one go about testing a APIAdapter?
<IGnorAND>
Do you just test the api command, and then all possible values for all possible params?
pupsikov has joined #ruby
<scientes>
IGnorAND, "all possible", thats impossible
<scientes>
thats n!
<IGnorAND>
scientes: all possible 'classes' of input
<scientes>
yes
<scientes>
that sounds about right
<IGnorAND>
but also the combination of?
<scientes>
test anything you want to work
<scientes>
its quite simple
GodFather has joined #ruby
x0f has quit [Ping timeout: 252 seconds]
x0f has joined #ruby
barg has quit [Ping timeout: 246 seconds]
GodFather has quit [Ping timeout: 255 seconds]
DTZUZO has quit [Ping timeout: 246 seconds]
<IGnorAND>
I have a param PageSize. Minimum value is 10, and maximum value is 100. Default Value: 20. So I test for <10, x>=10 && x<=100, >100 and non integers?
llua has quit [Quit: <Rudolph> shell code is what greycat reads to kids when he tucks them in]
llua has joined #ruby
<IGnorAND>
I wonder if ruby programmers also adhere to the 'fail fast' principle. Maybe I should thrown an exception at the initializer
fluxAeon has joined #ruby
GodFather has joined #ruby
nwradio878887987 has quit [Ping timeout: 268 seconds]
mr_rich102 has quit [Read error: Connection reset by peer]
mr_rich101 has joined #ruby
UnknownSoldier has joined #ruby
jottr has joined #ruby
ljarvis has quit [Ping timeout: 246 seconds]
GodFather has quit [Remote host closed the connection]
<xall>
I'm trying to sum a hash with another hash but I'm not getting it quite right: https://pastebin.com/2YyEdHNZ. Is it possible to do it like this?
jameser has joined #ruby
<adam12>
xall: What are you trying to achieve, exactly? ie. what are you expecting as output
ljarvis has joined #ruby
<adam12>
xall: I think this is what you're looking for? {"win"=>1, "draw"=>0, "loss"=>0}.merge({"win"=>3, "draw"=>1, "loss"=>0}) { |key, oldval, newval| newval + oldval }
Arahael has quit [Remote host closed the connection]
Autolycus has quit []
yield has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has joined #ruby
yield has quit [Client Quit]
<xco>
i want to make some steps to create my first ruby gem. but need some thougts. is it a good idea for a gem to make an api call to some other service? are there gems like that already
<xco>
the gem i want to make will require an API secret key which if you’er using rails you’d put the key in your initializers folder but i’m not sure if this is a good idea
maxdoubt has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
Swyper has quit [Remote host closed the connection]
<havenwood>
xco: it's a fine idea for a gem to make an API call. there are lots of gems that wrap APIs or make API calls for various reasons.
Wolland has joined #ruby
DmitryBochkarev has joined #ruby
<xco>
havenwood: thanks for the response. reason i asked was i thought if i created a gem like that it’d be “odd” since i haven’t personally used a gem that makes an API call
ramfjord has quit [Ping timeout: 255 seconds]
<havenwood>
xco: gems involving secret keys often are initialized with the key. another pattern is to assign an environment variable.
xall has joined #ruby
<xco>
yeah and ENV variable would work too, good idea i’ll keep that option in my thoughts
code_zombie has quit [Read error: Connection reset by peer]
<havenwood>
xco: the company I work for, for example, has a square_connect gem that is an SDK for Square APIs
<havenwood>
xco: it's pretty common for a company to have a gem that wraps their APIs
<xco>
yeah prolly a private gem right? i’m yet to see a public OS gem that makes use of keys like that
<havenwood>
yes, you don't have to publish a gem
<havenwood>
you can have it be private
<havenwood>
xco: lots of gems do use API keys
bambanx has quit [Quit: Leaving]
xall has quit [Read error: Connection reset by peer]
<xall>
havenwood: Thanks. Surely I've seen that before but evidently not enough
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DmitryBochkarev has joined #ruby
Dbugger has joined #ruby
Inline has quit [Quit: Leaving]
hays has quit [Ping timeout: 246 seconds]
hays has joined #ruby
ferr has quit [Read error: Connection reset by peer]
sidx64 has joined #ruby
duderonomy has joined #ruby
jottr has joined #ruby
ferr has joined #ruby
jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has joined #ruby
beilabs_ has quit [Ping timeout: 245 seconds]
sleetdrop has joined #ruby
beilabs_ has joined #ruby
jottr has quit [Ping timeout: 246 seconds]
iNs has quit [Remote host closed the connection]
iNs has joined #ruby
sauvin has joined #ruby
teclator_ has joined #ruby
teclator_ is now known as teclator_gc
Tuor has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ferr has quit [Read error: Connection reset by peer]
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ferr has joined #ruby
sidx64 has joined #ruby
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
ferr has quit [Ping timeout: 246 seconds]
teclator_gc has quit [Read error: Connection reset by peer]
duderonomy has joined #ruby
schleppel has joined #ruby
duderonomy has quit [Client Quit]
Nicmavr has quit [Read error: Connection reset by peer]
duderonomy has joined #ruby
aupadhye has joined #ruby
andikr has joined #ruby
Nicmavr has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
Swyper has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
HendrikPeter has joined #ruby
jenrzzz has joined #ruby
jottr has joined #ruby
amfdsrt^ has quit [Read error: Connection reset by peer]
clemens3_ has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
HendrikPeter has quit [Ping timeout: 244 seconds]
prestorium has joined #ruby
daniel__ has quit [Quit: Leaving]
daniel____ has joined #ruby
mhlei has quit [Remote host closed the connection]
mhlei has joined #ruby
szulak has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has quit [Ping timeout: 246 seconds]
waheedi has joined #ruby
nowhereman has joined #ruby
powerbit has joined #ruby
ferr has joined #ruby
TomyWork has joined #ruby
ferr has quit [Client Quit]
xall_ has joined #ruby
xall_ has quit [Client Quit]
mangold has joined #ruby
xall has quit [Ping timeout: 255 seconds]
HendrikPeter has joined #ruby
HendrikPeter has quit [Client Quit]
Swyper has quit [Remote host closed the connection]
lxsameer has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
DmitryBochkarev_ has joined #ruby
DmitryBochkarev has quit [Ping timeout: 245 seconds]
tvl has joined #ruby
tvl is now known as tobiasvl
<Tuor>
havenwood: thx for all your explanation. I went trew it again. I think I understand the idea, but I still don't understand what symbols exactly are and how they work.
marz_d`ghostman has joined #ruby
<marz_d`ghostman>
In rails, it doesn't seem that running rails credentials:edit and saving it doesn't seem to be included when dockerizing it.
<marz_d`ghostman>
How do I find the file so I can save it along in docker?
ur5us_ has quit [Remote host closed the connection]
nowhereman has quit [Ping timeout: 246 seconds]
ur5us has joined #ruby
schleppel has quit [Ping timeout: 245 seconds]
sylario has joined #ruby
marmotini_ has joined #ruby
ur5us has quit [Ping timeout: 246 seconds]
ur5us has joined #ruby
marmotini has joined #ruby
schleppel has joined #ruby
marmotini_ has quit [Ping timeout: 246 seconds]
cisco has joined #ruby
cisco is now known as Guest95744
t0xik has quit [Quit: Connection closed for inactivity]
alem0lars has joined #ruby
Ai9zO5AP has joined #ruby
ferr has joined #ruby
jenrzzz has joined #ruby
amfabaiste has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
troulouliou_dev has quit [Quit: Leaving]
jottr has joined #ruby
ur5us has quit []
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sidx64 has joined #ruby
Tuor has quit [Ping timeout: 245 seconds]
am0123 has joined #ruby
kyrylo has joined #ruby
Tuor has joined #ruby
Tuor has quit [Changing host]
Tuor has joined #ruby
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sidx64 has joined #ruby
dviola has joined #ruby
kyrylo has joined #ruby
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sidx64 has joined #ruby
kyrylo has quit [Ping timeout: 246 seconds]
hightower2 has quit [Ping timeout: 245 seconds]
kyrylo has joined #ruby
kyrylo has quit [Ping timeout: 245 seconds]
conta has quit [Ping timeout: 246 seconds]
ldnunes has joined #ruby
ljarvis has quit [Ping timeout: 246 seconds]
conta has joined #ruby
kyrylo has joined #ruby
mondz has joined #ruby
kyrylo has quit [Ping timeout: 244 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 255 seconds]
AJA4351 is now known as AJA4350
kyrylo has joined #ruby
ljarvis has joined #ruby
hightower2 has joined #ruby
kyrylo has quit [Ping timeout: 250 seconds]
jonjitsu has quit [Ping timeout: 250 seconds]
neovalis[m] has quit [Ping timeout: 250 seconds]
supergeek[m] has quit [Ping timeout: 250 seconds]
Turnikov[m] has quit [Ping timeout: 252 seconds]
sepp2k has quit [Ping timeout: 264 seconds]
turt2live has quit [Ping timeout: 268 seconds]
bastilian has quit [Ping timeout: 264 seconds]
AJA4350 has quit [Remote host closed the connection]
AJA4350 has joined #ruby
irdr_ has quit [Remote host closed the connection]
dinfuehr has quit [Ping timeout: 255 seconds]
dinfuehr has joined #ruby
irdr has joined #ruby
marmotini_ has joined #ruby
marmotini has quit [Ping timeout: 250 seconds]
alem0lars_ has joined #ruby
marmotini has joined #ruby
alem0lars has quit [Ping timeout: 268 seconds]
mangold has quit [Quit: This computer has gone to sleep]
alem0lars has joined #ruby
alem0lars_ has quit [Read error: Connection reset by peer]
marmotini_ has quit [Ping timeout: 268 seconds]
kyrylo has joined #ruby
marmotini_ has joined #ruby
marmotini has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
mondz has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
mangold has joined #ruby
AJA4350 has quit [Ping timeout: 245 seconds]
<Tuor>
A symbol is an object which can be converted to a string or integer and is immutable. Is this all to know or are there other special things about symbols?
vondruch has quit [Ping timeout: 255 seconds]
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fredolinhares has joined #ruby
<phaul>
:xxx is not allocated as an object but when first encountered put in the symbol table of the interpreter. It's never freed, invisible to garbage collection. It's a unique thing in the program, and object_id would match up even across programs
<phaul>
therefore don't create symbolsdynamically, otherwise you leak memory
<phaul>
that also means that while 'xxx'; 'xxx' allocated and grabage collects 2 times, :xxx ; :xxx would not do any of that
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
<Tuor>
Ah ok. So when to use them? What it the purpose or why not just using strings?
<phaul>
use them for unique values, that represent a thing in your program. :monday, :tuesday, :to_s, to_h, :+ etc.
<phaul>
use string for text
<phaul>
there is no :mondaytuesday, but there would be 'monday' + 'tuesday'
<Tuor>
OK. makes sense.
pupsikov has joined #ruby
lucasb has joined #ruby
aupadhye has quit [Ping timeout: 250 seconds]
nowhereman has joined #ruby
mondz has joined #ruby
AJA4350 has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jhass>
to me it looks like the spec code you shared is not the same as the one that produced the output you shared
<jhass>
if it were it would say "expected: 7" and "got: 0", not vice versa
<jhass>
so make sure you saved your file?
Tuor has quit [Quit: Konversation terminated!]
<jhass>
then regardless of that, note that code outside of it, describe, context, before and after blocks is run first and once
<jhass>
the spec code is not run sequentially as it's written into the file
<jhass>
so api_response will be the same value for both of your it blocks
Tuor has joined #ruby
<jhass>
oh wait, I got confused, you made the same typo in both of your it blocks
<jhass>
so nvm regarding the wrong output
<jhass>
it's just the second thing I mentioned
<jhass>
you want to move your local variables inside your it blocks, or introduce more context blocks if you expect multiple specs with the same output and then use before blocks or let declarations inside
Rapture has joined #ruby
polishdub has joined #ruby
<IGnorAND>
jhass: aah, I made different contexts for the cases
Iarfen has joined #ruby
<IGnorAND>
parsing xml is harder than I thought, even with nokogiri
segy has quit [Read error: Connection reset by peer]
conta has joined #ruby
xco has quit [Quit: xco]
DmitryBochkarev_ has quit [Ping timeout: 255 seconds]
<IGnorAND>
phaul: much appreciated, I changed the spec to reflect it with the issue fixed :)
<phaul>
np
daed has quit [Remote host closed the connection]
Dbugger has quit [Remote host closed the connection]
Drowze has quit [Quit: Page closed]
jobewan has joined #ruby
jobewan has quit [Read error: Connection reset by peer]
ellcs has quit [Ping timeout: 255 seconds]
dviola has quit [Quit: WeeChat 2.4]
jobewan has joined #ruby
<IGnorAND>
phaul: I'd like to be more like the guy in this talk: He seems to make a distinction between subject, result and then do asserts on the result. I think I'm still miles away from that now though :)
<ryouba>
this is aaaaaaaaaaaaaawesome!!! the thing actually reads Matlab .mat files!
mondz has quit [Ping timeout: 240 seconds]
Swyper has quit [Remote host closed the connection]
<IGnorAND>
ryouba: have fun :)
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 250 seconds]
AJA4351 is now known as AJA4350
Swyper has joined #ruby
alem0lars has quit [Remote host closed the connection]
i1nfusion has quit [Remote host closed the connection]
i1nfusion has joined #ruby
xco has joined #ruby
mondz has joined #ruby
lxsameer has quit [Ping timeout: 246 seconds]
ellcs1 has joined #ruby
<ryouba>
IGnorAND: having fun compiling fortran libraries needed for that #pinv ...
<IGnorAND>
ryouba: hey, at least you have a roadmap of what to do now :)
gix has joined #ruby
<IGnorAND>
I'm still struggling on figiring out if I write my code correctly by decoupling stuff or if I am overly complicating stuff :)
<ryouba>
i'm so psyched because now i can implement the algorithm from my gf's prof's paper in Ruby instead of having to use Matlab, IGnorAND
<IGnorAND>
ryouba: but shouldn't she have already done it in matlab?
<ryouba>
if your code has more than 200 lines i would say go and learn what you need to know to be able to decouple it. your future you will thank you.
<ryouba>
IGnorAND: yes, she has. but it's giving bogus results. and i'm trying to help but my head keeps threating to explode because matlab is so godforsakenly stupid.
<ryouba>
threatening*
wallace_mu has joined #ruby
<IGnorAND>
ryouba: I'm trying to follow sandi metz with her 100 lines per class, 5 lines per method, 4 params per method, 1 instance variables per view, 2 class names per controller action
<ryouba>
oh i've never heard of her ... *googles*
tdy has joined #ruby
<ryouba>
they sound like nice approximate numbers
<ryouba>
what's your problem with that method?
<ryouba>
are you following it too religiously?
krawchyk has joined #ruby
nowhereman has joined #ruby
<IGnorAND>
ryouba: no method issues. more like am I doing this right in terms of classes :)
<IGnorAND>
now I need a response class with a subclass for every type of response
<IGnorAND>
@ryouba I havent touched calculus or algebra in > 10 years
<ryouba>
IGnorAND: by method i meant sandi metz's method(ology)
<ryouba>
well you never know
<IGnorAND>
@ryouba how old are you if I may ask?
<ryouba>
i'm trying to do this and i just *barely* got my A-levels in math back then
<ryouba>
36
<IGnorAND>
same age :)
<ryouba>
oh :)
Swyper has quit [Remote host closed the connection]
* havenwood
tugs on his grey beard with tired eyes
hightower2 has quit [Ping timeout: 255 seconds]
Swyper has joined #ruby
<IGnorAND>
anyway, since I have a cmd and a response for every method in the api, I think I should name the classes cmd_method_name and rsp_method_name or method_name_rsp and method_name_cmd
<ryouba>
anyways, one thing i've learned about myself when it comes to designing larger scripts (i.e. large enough to require classes): coming up with a class structure beforehand never works. i have to make the bare minimum functionality work and introduce classes as needed, then take a step back and see if what i did makes sense, then re-design from an eagle's eye perspective on paper, then remodel/refactor as needed.
<IGnorAND>
havenwood: well, you ussually have good answers for my questions, so you must be like gandalf :)
<ryouba>
havenwood: but unlike us, you have gained wisdom
<IGnorAND>
ryouba: I'd like to rubber duck program with you sometime. I think I keep trying to design first, and then crash
prestorium has quit [Ping timeout: 245 seconds]
<IGnorAND>
ryouba: sandi metz also explains you cannot design beforehand, just get it to work, make your tests green, and as you continue look up code smells and refactor
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
Emmanuel_Chanel has joined #ruby
jinie has joined #ruby
stan has joined #ruby
pupsikov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
\tau has quit [Remote host closed the connection]
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
Emmanuel_Chanel has joined #ruby
hightower2 has joined #ruby
pupsikov has joined #ruby
ellcs1 has quit [Ping timeout: 264 seconds]
wallace_mu has left #ruby [#ruby]
gigetoo has quit [Ping timeout: 268 seconds]
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
gigetoo has joined #ruby
Emmanuel_Chanel has joined #ruby
barg has joined #ruby
<barg>
how would a program like vnc send data to and fro, the mouse coordinates from client to server, and the screen from server to client? would it use a refresh every like half a second so the client does a POST with coordinates and gets the screen sent back. Or would it use websockets?
<barg>
thanks. I want to write a simple program not like VNC, but you'd have two users, each user is presented with two textboxes. One textbox , the user types into. The other textbox, will display what the other user has typed. How would one go about doing that?
<barg>
like, in terms of sending data, what protocol would you suggest?
tarptaeya has left #ruby ["Leaving..."]
dsmythe has quit [Remote host closed the connection]
<jhass>
in a browser websocket makes sense
dsmythe has joined #ruby
SCHAPiE has joined #ruby
<barg>
ok, what about if not in a browser?
<IGnorAND>
barg: there is something called sockets. I think rails does this with cable or something
<barg>
yeah rails actioncable uses websockets. But what about if not in a browser?
<IGnorAND>
don't think it matters
<IGnorAND>
a socket is a socket
<jhass>
a socket is a socket but not a websocket
<jhass>
websocket is protocol on top of http
<IGnorAND>
require 'socket'
<jhass>
a plain socket is either TCP or UDP
Iarfen has quit [Remote host closed the connection]
<barg>
hmm, I hadn't thought about connecting to a railis server without using a web browser
<jhass>
you really don't need rails here
<jhass>
the next question you need to answer here is whether you want to work peer to peer or peer to server to peer
<IGnorAND>
I have a person has_many :organizations, through: :employments and organization has_many :employees, through: :employments. This results in Organization.first.employees.first being a person. It seems to make more sense to call Organization.first.employments.first and add functions such as wages etc there. My naming is screwed I think
<havenwood>
barg: it might be "fun" to use DRb (distributed Ruby) from the stdlib
jenrzzz has quit [Ping timeout: 252 seconds]
dar123 has joined #ruby
orbyt_ has joined #ruby
Swyper has quit [Remote host closed the connection]
dar123 has quit [Ping timeout: 252 seconds]
Swyper has joined #ruby
orbyt_ has quit [Ping timeout: 252 seconds]
<barg>
jhass: yeah i've been considering both possibilities, maybe one version they connect directly, and another versoin there is a server in between
krawchyk has quit [Quit: krawchyk]
<barg>
havenwood: yeah would be ruby on both ends
<jhass>
for client to client you need to pick one of them to be the server and the other connect to it