<mozzarella>
can I ask gem to install binaries elsewhere?
ramfjord has quit [Ping timeout: 260 seconds]
qasaur has quit [Read error: Connection reset by peer]
jaguarmagenta has quit [Remote host closed the connection]
ramfjord has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
maxdoubt has quit [Quit: maxdoubt]
PlasmaStar has quit [Ping timeout: 260 seconds]
jaguarmagenta has joined #ruby
chrisja has quit [Quit: leaving]
PlasmaStar has joined #ruby
akiTendo has joined #ruby
qasaur has joined #ruby
maxdoubt has joined #ruby
rkoller has joined #ruby
rkoller has quit [Client Quit]
halfamind has quit [Quit: Leaving.]
rbennace_ has joined #ruby
rkazak has joined #ruby
rbennacer has quit [Ping timeout: 246 seconds]
joneshf-laptop has quit [Ping timeout: 260 seconds]
cooldavid has joined #ruby
<cooldavid>
I'm trying to rewrite the flatten method, any ideas for where to look?
<cooldavid>
I understand how flatten works, I just don't see how I can reimplement it
cdg has quit [Remote host closed the connection]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dsea has quit [Read error: Connection reset by peer]
diegoviola has joined #ruby
gregf has quit [Quit: WeeChat 1.5]
gregf has joined #ruby
stunder001 has joined #ruby
stardiviner has joined #ruby
leitz has quit [Quit: Nappy time]
stunder has quit [Ping timeout: 252 seconds]
_Tariq has joined #ruby
djbkd has quit [Remote host closed the connection]
nankyokusei has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
jaguarmagenta has quit [Remote host closed the connection]
crystal77 has joined #ruby
nankyokusei has quit [Ping timeout: 246 seconds]
nando293921 has quit [Ping timeout: 260 seconds]
stunder001 has quit [Quit: WeeChat 1.4]
safe has quit [Read error: Connection reset by peer]
d0nn1e has quit [Ping timeout: 240 seconds]
gregf has quit [Quit: WeeChat 1.5]
gregf has joined #ruby
d0nn1e has joined #ruby
swills has joined #ruby
<cooldavid>
any ideas?
flashpoint9 has joined #ruby
nettoweb has joined #ruby
olspookishmagus has quit [Remote host closed the connection]
<baweaver>
To understand recursion, you must first understand recursion
gnufied has quit [Quit: Leaving]
<baweaver>
basically you're diving through a tree, pulling up all the nodes
<cooldavid>
ok thanks
youch has quit [Ping timeout: 244 seconds]
<baweaver>
if item is an array, recurse, else concat value to accumulating array
aries_liuxueyang has quit [Remote host closed the connection]
<cooldavid>
thanks, I'll look at how #flatten is implemented also
maxdoubt has quit [Quit: maxdoubt]
<_Tariq>
Hello, I don't know where I can ask this question, so please forgive me if this sounds very stupid. But I'm building a Ruby server
maxdoubt has joined #ruby
<_Tariq>
Ruby web server
<_Tariq>
I am able to send HTTP headers such as "Set-Cookie: _ga=GA1.1.1476691770.1461799040; count=0"
<_Tariq>
but it seems to ignore that HTTP header
<_Tariq>
and doesn't actually set a cookie
<_Tariq>
and I don't know why
aries_liuxueyang has joined #ruby
Xiti has quit [Quit: Xiti]
maxdoubt has quit [Client Quit]
cooldavid has quit [Quit: leaving]
maxdoubt has joined #ruby
qasaur has quit [Read error: Connection reset by peer]
konsolebox has joined #ruby
maxdoubt has quit [Client Quit]
halfamind has joined #ruby
maxdoubt has joined #ruby
imperator has joined #ruby
maxdoubt has quit [Client Quit]
maxdoubt has joined #ruby
dessm has joined #ruby
aeontech has quit [Quit: aeontech]
wldcordeiro has quit [Ping timeout: 250 seconds]
Xiti has joined #ruby
wldcordeiro has joined #ruby
Musashi007 has joined #ruby
swills has quit [Ping timeout: 252 seconds]
sneakerhax has quit [Ping timeout: 252 seconds]
<dessm>
Hi, I'm not sure if it's okay to ask questions here, so apologies if I'm breaching etiquette. I'm doing the Ruby koans and was wondering why, if I have an array=[1,2,3], array[3,0] == [], but array[4,0] == nil? Since both start indices are beyond the indeces of the array wouldn't one expect them to return the same value? Thank you.
LoneHerm_ has quit [Remote host closed the connection]
BTRE has joined #ruby
moeabdol has joined #ruby
ramfjord has joined #ruby
insanedreamer has joined #ruby
halfamind has quit [Quit: Leaving.]
yfeldblum has joined #ruby
yfeldblum has quit [Remote host closed the connection]
iamvery has quit [Ping timeout: 244 seconds]
yfeldblum has joined #ruby
iamvery has joined #ruby
goodfella has quit [Ping timeout: 250 seconds]
<chopin>
If I want to stub requests to an API with webmock but I need to test for a handful of responses, what's the best way to do that? My first hacky though was that you can set something unique in the headers to key in on but it leads me to write terrible code like this:
<chopin>
There must be a better way. Any thoughts?
<shevy>
Radar how about also adding a - :D "Rails 4 - in Action" ... with the - I would capitalize two words. not sure if it would make much sense without the '-' though to capitalize
d0nn1e has quit [Ping timeout: 250 seconds]
LoneHerm_ has joined #ruby
d0nn1e has joined #ruby
xall has joined #ruby
troys has joined #ruby
xall_ has quit [Ping timeout: 260 seconds]
djbkd has joined #ruby
d0nn1e has quit [Ping timeout: 252 seconds]
emilkarl has joined #ruby
bobbycvi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fmcgeough has quit [Quit: fmcgeough]
troys has quit [Client Quit]
curses has joined #ruby
xall_ has joined #ruby
Dimik has quit []
Dimik has joined #ruby
xall has quit [Ping timeout: 244 seconds]
mog has left #ruby ["Leaving"]
elifoster has quit [Ping timeout: 250 seconds]
bronson has joined #ruby
curses has quit [Ping timeout: 260 seconds]
n1x-nz has joined #ruby
polysics_ has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
A5101 has joined #ruby
janebootydoe has joined #ruby
ur5us has quit [Remote host closed the connection]
polysics has quit [Ping timeout: 240 seconds]
aagdbl has joined #ruby
aeontech has quit [Ping timeout: 252 seconds]
Robtop__ has quit [Ping timeout: 250 seconds]
nerium has quit [Quit: nerium]
sondr3 has joined #ruby
fckyoufreenode has joined #ruby
aeontech has joined #ruby
tmtwd has quit [Ping timeout: 276 seconds]
Dimik has quit [Ping timeout: 244 seconds]
ur5us has joined #ruby
chouhoulis has joined #ruby
aghalarp has quit [Read error: Connection reset by peer]
sondr3 has quit [Ping timeout: 260 seconds]
hahuang65 has joined #ruby
aghalarp has joined #ruby
colegatron has joined #ruby
d0lph1n98 has joined #ruby
n1x-nz has quit [Quit: Leaving]
n1x-nz has joined #ruby
kareeoleez has joined #ruby
n1x-nz has quit [Client Quit]
fckyoufreenode has quit []
n1x-nz has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
Dimik has joined #ruby
n1x-nz has quit [Client Quit]
n1x-nz has joined #ruby
hahuang65 has quit [Ping timeout: 260 seconds]
jancel has joined #ruby
tildes_ has joined #ruby
Devalo has quit [Remote host closed the connection]
Amnez777 has quit [Ping timeout: 260 seconds]
Alina-malina has quit [Max SendQ exceeded]
Alina-malina has joined #ruby
TomyLobo has joined #ruby
Alina-malina has quit [Changing host]
Alina-malina has joined #ruby
Alina-malina has quit [Max SendQ exceeded]
Amnez777 has joined #ruby
Alina-malina has joined #ruby
Alina-malina has joined #ruby
jancel has quit [Ping timeout: 244 seconds]
aeontech has quit [Ping timeout: 252 seconds]
Amnez777 has quit [Ping timeout: 260 seconds]
Alina-malina has quit [Ping timeout: 260 seconds]
gregf has quit [Ping timeout: 260 seconds]
<_kraken>
radar: Thank you!
mistermocha has joined #ruby
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
aeontech has joined #ruby
Oog has joined #ruby
skade has joined #ruby
Kyhz has quit [Ping timeout: 260 seconds]
skakri has quit [Ping timeout: 265 seconds]
firstdayonthejob has joined #ruby
agent_white has joined #ruby
<agent_white>
evenin
mistermocha has quit [Ping timeout: 260 seconds]
Alcon` has joined #ruby
skade has quit [Ping timeout: 250 seconds]
LoneHerm_ has quit [Remote host closed the connection]
Alcon has quit [Ping timeout: 244 seconds]
bluOxigen has quit [Ping timeout: 276 seconds]
bluOxigen has joined #ruby
<_kraken>
So are you not able to change objects using the .each method? But you are able to change them with methods you can use ! with
skakri has joined #ruby
TomyLobo has quit [Ping timeout: 260 seconds]
nankyokusei has joined #ruby
aeontech has quit [Ping timeout: 252 seconds]
firstdayonthejob has quit [Ping timeout: 260 seconds]
tildes has quit [Remote host closed the connection]
kgrz has quit [Ping timeout: 260 seconds]
nankyokusei has quit [Ping timeout: 252 seconds]
tvw has joined #ruby
skakri has quit [Ping timeout: 250 seconds]
aeontech has joined #ruby
anisha has joined #ruby
Amnez777 has joined #ruby
tildes_ has quit [Ping timeout: 260 seconds]
tmtwd has joined #ruby
bluOxigen has quit [Ping timeout: 276 seconds]
bluOxigen has joined #ruby
tildes has joined #ruby
skakri has joined #ruby
nando294121 has quit [Ping timeout: 276 seconds]
neanderslob has quit [Remote host closed the connection]
TvL2386 has quit [Ping timeout: 276 seconds]
aghalarp has quit [Read error: Connection reset by peer]
kgrz has joined #ruby
aghalarp has joined #ruby
ur5us has joined #ruby
k3rn31 has quit [Quit: Leaving...]
edwinvdgraaf has quit [Remote host closed the connection]
cbliard has joined #ruby
Janky has joined #ruby
<cbliard>
Hi, I have an issue with `bundle exec rspec`, it won't load some gems in the :test group and I can't remember what changed in my configuration (it used to work). Can anybody help me finding out what's going on?
<cbliard>
the error is "/home/cbliard/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.4.4/lib/rspec/core/formatters.rb:222:in `require': cannot load such file -- fuubar"
<cbliard>
if I remove the `gem 'fuubar'` from group :test (so it has no group), it loads properly but then it fails with another gem (simplecov)
<janebootydoe>
cbliard, does it load in other groups?
neanderslob has joined #ruby
<cbliard>
Yes
<cbliard>
and I use rvm. I tried to remove all my ruby and gems, and reinstall everything, but I still have the same behavior.
_kraken has quit [Quit: Leaving]
<cbliard>
One weird thing when I moved from group :test to group :development is that the gem 'fuubar' was not installed. I had to run `bundle install` again to install it.
<cbliard>
so the gem is invisible to "bundle exec", but also to "bundle install"
RegulationD has joined #ruby
<janebootydoe>
cbliard, have a repo link?
<cbliard>
not a public one :/
fbandov has joined #ruby
<cbliard>
I'm making a gist
skade has joined #ruby
skade has quit [Client Quit]
tildes has quit [Ping timeout: 260 seconds]
RegulationD has quit [Ping timeout: 252 seconds]
djbkd has quit [Remote host closed the connection]
TomyWork has joined #ruby
lewis1711 has joined #ruby
p1k has joined #ruby
tildes has joined #ruby
<cbliard>
Ok, I found the problem. I once ran "--without test", and as this is a sticky config option, it created a .bundle/config with "BUNDLE_WITHOUT: test". I deleted it and it now works correctly
p1k has quit [Client Quit]
Ishido has joined #ruby
tildes has quit [Ping timeout: 244 seconds]
aganov has joined #ruby
antgel has joined #ruby
<lewis1711>
is there anything like "#take" for arrays that mutates them in place?
<cbliard>
lewis1711: #shift
<lewis1711>
for some inexplicable reason, #pop removes from the end of an array, but pop(n) removes from the front
<lewis1711>
ah, thanks cbliard
codecop has joined #ruby
<cbliard>
#pop should remove from the end
<cbliard>
[9] pry(main)> a = [1, 2, 3, 4, 5]
<cbliard>
=> [1, 2, 3, 4, 5]
<cbliard>
=> [4, 5]
<cbliard>
[10] pry(main)> a.pop(2)
<cbliard>
[11] pry(main)> a
<cbliard>
=> [1, 2, 3]
<apeiros>
lewis1711: um, no, pop(n) removes from the end too
<apeiros>
shift(n) and shift remove from the front
<lewis1711>
I'm having a slow day. it returns what it removes..
p1k has joined #ruby
the_drow has joined #ruby
the_drow has quit [Max SendQ exceeded]
the_drow has joined #ruby
terlar has joined #ruby
jaguarmagenta has quit [Remote host closed the connection]
A5101 has quit [Ping timeout: 252 seconds]
tildes has joined #ruby
fbandov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
aufi has joined #ruby
LoneHerm_ has joined #ruby
Oog has quit []
ur5us has quit [Remote host closed the connection]
n_blownapart has quit [Remote host closed the connection]
Dimik has quit [Ping timeout: 276 seconds]
aeontech has quit [Ping timeout: 252 seconds]
skade has joined #ruby
LoneHerm_ has quit [Ping timeout: 260 seconds]
tmtwd has quit [Ping timeout: 244 seconds]
polysics has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
Janky has quit []
tmtwd has joined #ruby
mic_e has joined #ruby
polysics_ has quit [Ping timeout: 240 seconds]
jaruga___ has joined #ruby
jaruga___ is now known as jaruga____
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
curses has joined #ruby
n_blownapart has joined #ruby
mic_e has quit [Ping timeout: 276 seconds]
CausaMortis has joined #ruby
noobsu has joined #ruby
last_staff has joined #ruby
tatsuo has joined #ruby
noobsu has quit [Remote host closed the connection]
norc has joined #ruby
bronson has joined #ruby
yfeldblum has quit [Ping timeout: 240 seconds]
n_blownapart has quit [Ping timeout: 246 seconds]
curses has quit [Ping timeout: 260 seconds]
<TomyWork>
jhass cheers for pointing me at hash.dig yesterday. i couldnt take a look at it due to net outage, but that looks exactly like what i need
<apeiros>
leitz: ah, error on bottom - nil.gsub can't be called. regardless of where
skakri has quit [Ping timeout: 276 seconds]
<apeiros>
leitz: you do know how to read "./read_pm.rb:11:in `initialize': private method `gsub' called for nil:NilClass (NoMethodError)"?
skakri has joined #ruby
n_blownapart has quit [Ping timeout: 252 seconds]
Trieste has quit [Excess Flood]
Trieste has joined #ruby
d0lph1n98 has joined #ruby
polysics_ has joined #ruby
Trieste has quit [Excess Flood]
Trieste has joined #ruby
CausaMortis has quit [Ping timeout: 250 seconds]
polysics has quit [Ping timeout: 276 seconds]
sameerynho has joined #ruby
JonasOSDever has joined #ruby
MrSamuel has quit [Quit: MrSamuel]
devyn has quit [Ping timeout: 260 seconds]
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Trieste has quit [Ping timeout: 276 seconds]
devyn has joined #ruby
MrSamuel has joined #ruby
atmosx_alt is now known as atmosx
MrSamuel has quit [Client Quit]
gregf has joined #ruby
n_blownapart has joined #ruby
fbandov has joined #ruby
lewis1712 has left #ruby ["Ex-Chat"]
n_blownapart has quit [Ping timeout: 252 seconds]
<gregf_>
fg
<gregf_>
bah :/
nankyokusei has joined #ruby
<leitz>
apeiros, I'm not sure.
<apeiros>
leitz: "./read_pm.rb:11" tells you what?
<leitz>
Is it because gsub is in a different class/namespace?
<apeiros>
ah, what were you referring to with "not sure"? I thought "not sure how to read the error message"
n_blownapart has joined #ruby
<leitz>
yes. I tested the gsub line in irb, but it fails in the initialize.
koooge has quit [Quit: Leaving...]
modin has quit [Ping timeout: 264 seconds]
<apeiros>
and the exception tells you why
<apeiros>
hence my question whether you know how to read the message
nettoweb has joined #ruby
nankyokusei has quit [Ping timeout: 260 seconds]
umdstu has joined #ruby
<leitz>
Not well, and fixing to be late for work. Guess I know what I'm going to be focusing on today!
modin has joined #ruby
n_blownapart has quit [Ping timeout: 252 seconds]
pawnbox_ has quit [Ping timeout: 244 seconds]
sameerynho has quit [Ping timeout: 240 seconds]
pawnbox has joined #ruby
ur5us has joined #ruby
startupality has quit [Quit: startupality]
leitz has quit [Quit: Nappy time]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
mozzarella has quit [Remote host closed the connection]
mozzarella has joined #ruby
pawnbox has quit [Ping timeout: 246 seconds]
n_blownapart has joined #ruby
ReK2GnULinuX has joined #ruby
M-Kodo has quit [Ping timeout: 244 seconds]
hays_ has joined #ruby
M-mistake has quit [Ping timeout: 276 seconds]
mg^ has quit [Ping timeout: 260 seconds]
the_drow has quit [Quit: Leaving]
vondruch_ has joined #ruby
fbandov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
elavee has joined #ruby
mg^ has joined #ruby
jgt has joined #ruby
hays has quit [Ping timeout: 260 seconds]
kus has joined #ruby
kus has quit [Max SendQ exceeded]
Pumukel has quit [Ping timeout: 260 seconds]
ReK2 has quit [Ping timeout: 276 seconds]
vondruch has quit [Ping timeout: 244 seconds]
mdw has quit [Quit: Sleeping Zzzzz]
gnufied has joined #ruby
M-Kodo has joined #ruby
M-mistake has joined #ruby
startupality has joined #ruby
elavee has quit [Ping timeout: 276 seconds]
n_blownapart has quit [Ping timeout: 252 seconds]
johnmilton has joined #ruby
pawnbox has joined #ruby
rodfersou has joined #ruby
Macaveli has joined #ruby
RegulationD has joined #ruby
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #ruby
n_blownapart has joined #ruby
hahuang65 has joined #ruby
emilkarl has joined #ruby
ur5us has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 240 seconds]
RegulationD has quit [Ping timeout: 276 seconds]
n_blownapart has quit [Ping timeout: 252 seconds]
hahuang65 has quit [Ping timeout: 260 seconds]
n_blownapart has joined #ruby
valeri_ufo has quit [Quit: ...]
d0lph1n98 has quit [Ping timeout: 260 seconds]
ponga has joined #ruby
fergal has joined #ruby
valeri_ufo has joined #ruby
Dysp has joined #ruby
<fergal>
hi guys, if i want to poll a server for a build finishing every 2 seconds, but also want to print a message that i am polling the server once every 60 seconds so i dont flood stdout, what is the best approach for doing this? so essentially, i want my script to poll the build server once every 2 seconds, and then once every minute print out something like “polling the build server every 2 seconds”. would it jsut be a case of looping, sleeping every 2 seconds
<fergal>
and then every 30th iteration, print polling?
<apeiros>
assuming your polling does not take time, or assuming that a skew in time is acceptable - yes
<toretore>
vedu: what is the equivalent curl command that works?
modin has joined #ruby
<jhass>
vedu: mitmproxy.org proves as a good tool to compare the generated requests in depth, my first guess would be on setting the Content-Type header correctly or something like that
grs has quit [Ping timeout: 260 seconds]
hk238 has joined #ruby
davedev24 has joined #ruby
UKn0Me has quit [Remote host closed the connection]
UKn0Meh has quit [Quit: Gone shopping.]
Amnez777 has joined #ruby
UKn0Me has joined #ruby
jancel has joined #ruby
jancel has quit [Remote host closed the connection]
Gasher has joined #ruby
giz|work has joined #ruby
k3rn31 has joined #ruby
maucar has joined #ruby
<vedu>
toretore: curl -X POST --data-urlencode 'payload={"text": "This is posted to #non-tech and comes from a bot named webhookbot."}' https://hooks.slack.com/services/...
<jhass>
vedu: well that's obviously quite different, where did the payload parameter go in your code?
<vedu>
jhass: okay I got it working using Net::HTTP.post_form uri, "payload" => '{"text": "This is a line of text in a channel.\nAnd this is another line of text."}'. thanks :)
<rubirc>
Is there something like .map for hashes?
<rubirc>
I just want to create a new hash on the fly from the old one
<toretore>
yes, there is Hash#map
<rubirc>
yeah it gets a key and a value as an argument
<toretore>
if you want to create a Hash and not an Array, use inject or each?with?object
<rubirc>
what do i need to return so it creates a hash again?
flashpoint9 has joined #ruby
vondruch_ has quit [Quit: Ex-Chat]
vondruch has joined #ruby
<toretore>
each_with_object ..
skade has quit [Quit: Computer has gone to sleep.]
<jhass>
or just return two element arrays from Hash#map and call Array#to_h
<jhass>
p1k: if you can make a minimal example reproducing it using just the standard library, sure
<centrx>
jhass: seems like each_with_object is just implemented slowly
KantonKid has quit [Ping timeout: 244 seconds]
<jhass>
centrx: it still wins against doing .to_h afterwards though on my machine
<centrx>
ok that makes sense
edavis has quit [Quit: Leaving]
<despai>
Hello. Anybody knows how to make an rake application that uses ActiveRecord to use the mocked objects from FactoryGirl. I have a suite of tests that test the api from outside, I have an api running in "test" environment. The FactoryGirl mocks are working in the test suite, but when the running "test" api retrieves a record, it uses the original ActiveRecord objects instead of the FactoryGirl mocks, so my tests don't validate. Do you have an idea h
<despai>
ow to connect the mocked FactoryGirl object to be used also in the api?
<p1k>
jhass: ugh
<jhass>
centrx: and is just as fast as reduce/inject
<p1k>
it would be nice if valgrind was better supported
<centrx>
jhass: It could be much better on 2.3 vs 2.0 or whatever it was when it was much slower. I can’t find the article
<centrx>
I withdraw all previous statements
n_blownapart has quit [Ping timeout: 252 seconds]
<jhass>
2.0 didn't have Array#to_h, so ...
<jhass>
let's try 2.1
LoneHermit has joined #ruby
<jhass>
reduce seems slightly faster there but within error margin of each_with_object
binaryplease has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
blackmesa has joined #ruby
n_blownapart has joined #ruby
senayar has quit [Remote host closed the connection]
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
flashpoint9 has joined #ruby
LoneHermit has quit [Ping timeout: 252 seconds]
synthroid has joined #ruby
<jhass>
despai: you're looking into doing integration tests with that setup?
davedev24 has quit [Remote host closed the connection]
<despai>
jhass yes
n_blownapart has quit [Ping timeout: 252 seconds]
noobsu has quit [Remote host closed the connection]
jgt has quit [Ping timeout: 260 seconds]
<despai>
In my tests I reset my database using DatabaseCleaner, however, the other part, the api running in "test" environment is not using my FactoryGirl mocks that I setup in my tests
pawnbox has quit [Read error: Connection reset by peer]
<jhass>
despai: you call .create on the factories and have transactional fixtures turned off?
KantonKid has joined #ruby
<jhass>
btw it's rack, not rake
<despai>
There are 2 things. 1 The api running in "test" environment. 2 The tests running against that api (here I mock FactoryGirl records for every test)
fbandov has joined #ruby
<despai>
yes, rack
<despai>
let me check that
pawnbox has joined #ruby
<jhass>
stop saying "FactoryGirl mock" or "mock FactoryGirl", it's wrong and makes no sense
djcp has joined #ruby
<jhass>
FactoryGirl is for generating test data and returning the real model instances, persisted with .create or not persisted with .build
<jhass>
as you want to write test data into the database for your appserver to fetch again, you have to use .create
<jhass>
and make sure it happens outside a transaction so the other database connection can actually see the data
<despai>
mmm
<despai>
I'm using create
<despai>
the records are created when I print them in my tests afterwards
<despai>
however in the test database the records are always empty
blackmesa has quit [Ping timeout: 260 seconds]
<despai>
config.use_transactional_fixtures in my spec helpers is undefined. I'm not using Rails
<jhass>
sounds like transactional fixtures is still on
<jhass>
set it to false explicitly, just to be sure
<jhass>
also make sure your database_cleaner mode is not using a transaction
rbennacer has quit [Remote host closed the connection]
truenito has joined #ruby
rbennacer has joined #ruby
curses has quit [Ping timeout: 260 seconds]
n_blownapart has joined #ruby
noService has joined #ruby
Couch has quit [Ping timeout: 240 seconds]
mic_e has joined #ruby
rbennacer has quit [Remote host closed the connection]
MrSamuel has joined #ruby
Shashikant86 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rbennacer has joined #ruby
startupality has joined #ruby
jancel has quit [Ping timeout: 252 seconds]
davedev2_ has joined #ruby
cerrar has joined #ruby
idefine has joined #ruby
aganov has quit [Remote host closed the connection]
danielpk has quit [Quit: danielpk]
Ch4rAss has quit [Ping timeout: 244 seconds]
k3rn31 has joined #ruby
mic_e has quit [Ping timeout: 250 seconds]
davedev24 has quit [Ping timeout: 260 seconds]
eljimmy has quit [Quit: This computer has gone to sleep]
centrx has quit [Quit: centrx]
Ch4rAss has joined #ruby
Azure has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
perlgod has joined #ruby
govg has joined #ruby
Shashikant86 has joined #ruby
Shashikant86 has quit [Client Quit]
Azure has joined #ruby
stan has quit [Quit: Leaving]
Nimonas has joined #ruby
marr has joined #ruby
<Nimonas>
hello
duracrisis has quit [Quit: Remember, smarter not harder!]
grs has quit [Ping timeout: 260 seconds]
<jhass>
hi
chouhoulis has quit [Remote host closed the connection]
xcesariox has joined #ruby
chouhoulis has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
stan has joined #ruby
hahuang65 has joined #ruby
yqt has joined #ruby
n_blownapart has quit [Ping timeout: 252 seconds]
skade has joined #ruby
Snowy has joined #ruby
n_blownapart has joined #ruby
MrSamuel has quit [Quit: MrSamuel]
LoneHerm_ has quit [Remote host closed the connection]
LoneHermit has joined #ruby
tacit7 has joined #ruby
deadnull is now known as _deadnull
<shevy>
just got back... I feel like going to sleep right away ... :(
kies has quit [Ping timeout: 260 seconds]
giz|work has quit [Ping timeout: 260 seconds]
hahuang65 has quit [Ping timeout: 260 seconds]
<shevy>
flughafen ah ha ... I still dig that dude though https://www.tagesschau.de/ausland/paes-interview-101.html - "Flughafenbau in Berlin? Wer ist dafür verantwortlich" imagine if there be a rubyconf in berlin, you'd have to travel by train, roads or by foot but not via plane! :P
pwnd_nsfw has quit [Read error: Network is unreachable]
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
pwnd_nsfw has joined #ruby
<hanmac>
shevy did you get the big ruby news from weekend yet? Fixnum and Bignum became one ;P
pawnbox_ has joined #ruby
<jhass>
uh, that's a good idea?
<jhass>
well I guess at least the ugly autopromiting is gone
<shevy>
I find it increasingly hard to keep up with ruby-related changes though, I seem to have less and less time available :(
suchness has joined #ruby
ChiefAlexander has quit [Remote host closed the connection]
deadnull is now known as _deadnull
<|2701>
sure would be nice to have some kind of standard to rely on
<suchness>
Does anyone know what this syntax is actually called? <<-EOF a bunch of text EOF
<|2701>
instead of "MRI is always right"
_deadnull is now known as deadnull
<hanmac>
suchness: HEREDOC ?
<suchness>
Oh cool! Thanks!
<shevy>
hanmac isn't that quite confusing though? If they still remain
skade has quit [Quit: Computer has gone to sleep.]
biberu has joined #ruby
<hanmac>
shevy they only remain for compatibiliy
<shevy>
hehe
<shevy>
wimps!
<aegis3121>
kareeoleez : What IS the output of your code? Because my guess is that @status is true.
duracrisis has joined #ruby
<kareeoleez>
it's false
duracrisis is now known as Guest97056
n_blownapart has quit [Ping timeout: 252 seconds]
<kareeoleez>
If you create a virtual interface more than one time then it fails
<kareeoleez>
and returns false
<kareeoleez>
aegis3121: with ifconfig: SIOCIFCREATE: File exists
mdw has quit [Quit: Sleeping Zzzzz]
TomyWork has joined #ruby
synthroid has quit [Remote host closed the connection]
sameerynho has quit [Ping timeout: 260 seconds]
<aegis3121>
Meaning that's when a duplicate is attempted to be created?
axl_ has joined #ruby
<aegis3121>
er, when you attempted to create a duplicate*
norc has quit [Ping timeout: 250 seconds]
n_blownapart has joined #ruby
Es0teric has joined #ruby
maxdoubt has joined #ruby
kareeoleez has quit [Remote host closed the connection]
aufi has quit [Ping timeout: 276 seconds]
grs has quit [Ping timeout: 260 seconds]
wilsonc91 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
synthroid has joined #ruby
Guest97056 has quit [Quit: Remember, smarter not harder!]
eljimmy has joined #ruby
n_blownapart has quit [Ping timeout: 252 seconds]
noService has quit [Ping timeout: 252 seconds]
k3rn31 has quit [Quit: Computer has gone to sleep.]
wilsonc91 has joined #ruby
nankyokusei has joined #ruby
pwnd_nsfw has quit [Read error: Network is unreachable]
pwnd_nsfw has joined #ruby
polishdub has joined #ruby
cdg has joined #ruby
<aegis3121>
Well, it kind of sounds like that's the value of @stderr.to_s, which is what's being passed to the RuntimeError. You're immediately rescuing, so that's the output of puts "#{e}". It sounds like it IS raising, and is immediately rescued.
monoprotic has joined #ruby
skade has joined #ruby
chipotle_ has joined #ruby
nankyokusei has quit [Ping timeout: 244 seconds]
TomyWork has quit [Remote host closed the connection]
rippa has joined #ruby
chipotle has quit [Read error: Connection reset by peer]
n_blownapart has joined #ruby
noService has joined #ruby
TomyWork has joined #ruby
fergal has quit [Read error: Connection reset by peer]
fergal has joined #ruby
aagdbl has quit [Ping timeout: 276 seconds]
CausaMortis has joined #ruby
truenito has quit [Ping timeout: 244 seconds]
grs has joined #ruby
halfamind has quit [Read error: Connection reset by peer]
halfamind has joined #ruby
halfamind has quit [Read error: Connection reset by peer]
halfamind has joined #ruby
noService has quit [Ping timeout: 260 seconds]
ChiefAlexander has joined #ruby
senayar has joined #ruby
senayar has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
n_blownapart has quit [Ping timeout: 252 seconds]
noService has joined #ruby
skade has joined #ruby
stannard has quit [Remote host closed the connection]
startupality has quit [Quit: startupality]
n_blownapart has joined #ruby
skade has quit [Client Quit]
mistermocha has joined #ruby
idefine has quit []
mjuszczak has joined #ruby
mroth_ is now known as mroth
mroth has quit [Changing host]
mroth has joined #ruby
mroth has joined #ruby
danielpk has joined #ruby
rkazak has joined #ruby
n_blownapart has quit [Ping timeout: 252 seconds]
bronson has joined #ruby
stannard has joined #ruby
jhack has joined #ruby
mistermocha has quit [Remote host closed the connection]
danielpk has quit [Client Quit]
danielpk has joined #ruby
Ch4rAss has quit [Ping timeout: 252 seconds]
Devalo has joined #ruby
Ch4rAss has joined #ruby
mistermocha has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
anisha has quit [Quit: Leaving]
n_blownapart has joined #ruby
blackmesa has quit [Ping timeout: 244 seconds]
aagdbl has joined #ruby
ejnahc has quit [Remote host closed the connection]
mark_66 has quit [Quit: Leaving.]
adambeynon has quit [Ping timeout: 260 seconds]
synthroid has quit [Remote host closed the connection]
ejnahc has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
adambeynon has joined #ruby
mistermocha has quit [Ping timeout: 260 seconds]
n_blownapart has quit [Ping timeout: 252 seconds]
synthroid has joined #ruby
cbliard has quit [Quit: Leaving]
mjuszczak has quit []
nettoweb has joined #ruby
noService has quit [Ping timeout: 260 seconds]
Es0teric has quit [Quit: Computer has gone to sleep.]
chouhoul_ has joined #ruby
hobodave has joined #ruby
zast has joined #ruby
Es0teric has joined #ruby
haylon has joined #ruby
nando294021 has joined #ruby
chouhoulis has quit [Ping timeout: 244 seconds]
solars has quit [Ping timeout: 276 seconds]
flughafen_ has joined #ruby
mdw has joined #ruby
ramortegui has joined #ruby
n_blownapart has joined #ruby
giz|work has quit [Ping timeout: 246 seconds]
kies has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Yiota has joined #ruby
dgynn has quit [Quit: dgynn]
flughafen_ has quit [Ping timeout: 276 seconds]
crissae has joined #ruby
stannard has quit [Read error: Connection reset by peer]
tmtwd has joined #ruby
CJKinni has joined #ruby
halfamind has quit [Read error: Connection reset by peer]
halfamind1 has joined #ruby
noService has joined #ruby
moei has quit [Quit: Leaving...]
giz|work has joined #ruby
nando294021 has quit [Ping timeout: 250 seconds]
ramortegui has quit [Quit: Ex-Chat]
skweek has quit [Ping timeout: 260 seconds]
moei has joined #ruby
skweek has joined #ruby
smathy has joined #ruby
sameerynho has joined #ruby
n_blownapart has quit [Ping timeout: 252 seconds]
mjuszczak has joined #ruby
kareeoleez has joined #ruby
saneax is now known as saneax_AFK
duoi has quit [Ping timeout: 250 seconds]
fergal_ has joined #ruby
fergal has quit [Ping timeout: 276 seconds]
fergal_ is now known as fergal
CJKinni has quit [Remote host closed the connection]
gtsai has joined #ruby
CJKinni has joined #ruby
stannard has joined #ruby
duoi has joined #ruby
bluOxigen has quit []
bluOxigen has joined #ruby
postmodern has joined #ruby
CausaMortis has quit [Ping timeout: 244 seconds]
deadnull is now known as _deadnull
bluOxigen has left #ruby [#ruby]
n_blownapart has joined #ruby
jaguarmagenta has joined #ruby
noService has quit [Ping timeout: 260 seconds]
[Butch] has joined #ruby
chipotle_ has quit [Quit: cheerio]
chipotle has joined #ruby
synthroid has quit [Remote host closed the connection]
CoderPuppy has quit [Ping timeout: 244 seconds]
JesseH has joined #ruby
tmtwd has quit [Ping timeout: 246 seconds]
jaguarmagenta has quit [Ping timeout: 260 seconds]
anna` has quit [Excess Flood]
frem_ has joined #ruby
anna` has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
giz|work has quit [Ping timeout: 246 seconds]
n_blownapart has quit [Ping timeout: 252 seconds]
[Butch] has quit [Ping timeout: 260 seconds]
stardiviner has quit [Quit: Code, Sex, Just fucking world.]
danielpk has quit [Quit: danielpk]
cpup has joined #ruby
araujo has joined #ruby
kareeoleez has quit [Remote host closed the connection]
bluOxigen has joined #ruby
araujo has quit [Max SendQ exceeded]
xcesariox has quit [Read error: Connection reset by peer]
araujo has joined #ruby
norc has joined #ruby
araujo has quit [Read error: Connection reset by peer]
kareeoleez has joined #ruby
[Butch] has joined #ruby
curses has joined #ruby
n_blownapart has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nando294021 has joined #ruby
Guest38 has joined #ruby
nettoweb has joined #ruby
rkazak has quit [Ping timeout: 250 seconds]
kareeoleez has quit [Remote host closed the connection]
curses has quit [Ping timeout: 260 seconds]
blandflakes has joined #ruby
amclain has joined #ruby
n_blownapart has quit [Ping timeout: 252 seconds]
kies has quit [Ping timeout: 252 seconds]
chouhoul_ has quit [Remote host closed the connection]
crystal77 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
minimalism has quit [Quit: minimalism]
chouhoul_ has joined #ruby
Yiota has joined #ruby
stannard has quit [Read error: Connection reset by peer]
kareeoleez has joined #ruby
blackmesa has joined #ruby
aegis3121 has quit [Ping timeout: 260 seconds]
danostrowski has joined #ruby
mistermocha has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
n_blownapart has joined #ruby
nando294021 has quit [Ping timeout: 244 seconds]
kareeoleez has quit [Ping timeout: 276 seconds]
insanedreamer has quit [Ping timeout: 276 seconds]
lacce has joined #ruby
fbandov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
insanedreamer has joined #ruby
antgel has quit [Ping timeout: 260 seconds]
stannard has joined #ruby
blackmesa has quit [Ping timeout: 244 seconds]
mistermocha has quit [Ping timeout: 276 seconds]
kies has joined #ruby
joonty has quit [Ping timeout: 244 seconds]
iamvery has quit [Ping timeout: 252 seconds]
iamvery has joined #ruby
symm- has joined #ruby
cerrar has quit [Remote host closed the connection]
Gasher has quit [Ping timeout: 260 seconds]
gtsai has quit [Remote host closed the connection]
n_blownapart has quit [Ping timeout: 252 seconds]
joaumg has quit [Quit: WeeChat 0.4.2]
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zenguy_pc has quit [Ping timeout: 250 seconds]
edwinvdgraaf has quit [Remote host closed the connection]
aagdbl has quit [Quit: This computer has gone to sleep]
konsolebox has quit [Ping timeout: 246 seconds]
kgrz has joined #ruby
n_blownapart has joined #ruby
centrx has joined #ruby
hahuang65 has joined #ruby
mdw has quit [Quit: Sleeping Zzzzz]
platzhirsch has quit [Quit: WeeChat 1.4]
evidex has quit [Remote host closed the connection]
tomchapin has joined #ruby
pglombardo has joined #ruby
agent_white has quit [Read error: Connection reset by peer]
zenguy_pc has joined #ruby
n_blownapart has quit [Ping timeout: 252 seconds]
kgrz has quit [Read error: Connection reset by peer]
synthroid has joined #ruby
skweek has quit [Ping timeout: 244 seconds]
hahuang65 has quit [Ping timeout: 276 seconds]
pglombardo has quit [Client Quit]
agent_white has joined #ruby
kareeoleez has joined #ruby
rbennacer has quit [Remote host closed the connection]
gtsai_ has joined #ruby
senayar has quit []
lsmola has quit [Ping timeout: 260 seconds]
gtsai_ has quit [Read error: Connection reset by peer]
danostrowski has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kgrz has joined #ruby
kareeoleez has quit [Ping timeout: 260 seconds]
noobsu has quit [Read error: Connection reset by peer]
noobsu has joined #ruby
biberu has quit [Ping timeout: 246 seconds]
RegulationD has joined #ruby
Devalo has quit [Remote host closed the connection]
wilsonc91 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
finisherr has joined #ruby
ferr has quit [Quit: WeeChat 1.5]
kareeoleez has joined #ruby
tacit7 has quit [Quit: ERC (IRC client for Emacs 25.0.50.1)]
isxek has joined #ruby
dml337ira has joined #ruby
noService has joined #ruby
aagdbl has joined #ruby
Juanchito has quit [Quit: Connection closed for inactivity]
biberu has joined #ruby
RegulationD has quit [Remote host closed the connection]
Regulati_ has joined #ruby
stannard has quit [Read error: Connection reset by peer]
kareeoleez has quit [Ping timeout: 244 seconds]
n_blownapart has joined #ruby
danostrowski has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
tlaxkit has quit [Quit: ¡Adiós!]
rbennacer has joined #ruby
emilkarl has joined #ruby
arajakul2 has joined #ruby
n_blownapart has quit [Ping timeout: 252 seconds]
skade has joined #ruby
nankyokusei has joined #ruby
arajakul has quit [Ping timeout: 276 seconds]
n_blownapart has joined #ruby
sameerynho has quit [Ping timeout: 260 seconds]
noobsu_ has joined #ruby
chouhoul_ has quit [Remote host closed the connection]
marr has quit [Ping timeout: 276 seconds]
zast has quit [Quit: Leaving.]
noobsu has quit [Ping timeout: 250 seconds]
konsolebox has joined #ruby
nankyokusei has quit [Ping timeout: 244 seconds]
startupality has joined #ruby
Cohedrin has joined #ruby
nareiber has joined #ruby
curses has joined #ruby
mistermocha has joined #ruby
n_blownapart has quit [Ping timeout: 252 seconds]
n_blownapart has joined #ruby
roelof has joined #ruby
TomyWork has quit [Ping timeout: 244 seconds]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<roelof>
I have some 10 hashes, now I want to store them in one object. What can I use the best a array or some nested hashes ?
elaptics is now known as elaptics`away
mistermocha has quit [Remote host closed the connection]
zast has joined #ruby
elifoster has joined #ruby
n_blownapart has quit [Ping timeout: 252 seconds]
<eam>
roelof: depends on how you want to access them
mistermocha has joined #ruby
<roelof>
eam : I want to iterate later to display the data on a view
<eam>
if you're just going to iterate them in sequence an array is fine
biberu\ has joined #ruby
tvw has quit [Ping timeout: 260 seconds]
<roelof>
oke, and why when I do array << hash It looks like it's one item. ruby does not put a , between it
stannard has joined #ruby
biberu has quit [Ping timeout: 260 seconds]
jhack has quit [Ping timeout: 260 seconds]
<roelof>
so array.first does not work
araujo has joined #ruby
wilsonc91 has joined #ruby
araujo has quit [Max SendQ exceeded]
<eam>
roelof: can you share code? It's not clear what you're describing
<doug23424234>
Now I'm trying to use the Rainbow gem.
<doug23424234>
It doesn't have the exact same problem, but there is no color change.
<postmodern>
regarding thread pools, is it better to roll your own, or use some popular threading gem?
<toretore>
postmodern: best bet right now is probably concurrent-ruby
<toretore>
it doesn't really matter if you roll your own or not, you're going to have issues anyway
<doug23424234>
What is strange to me, is that later in the same code, it says color=red and that works. But if I use the same format earlier in the code where I want it, it doesn't work.
<doug23424234>
Maybe I'm getting the format wrong?
KINGSABRI has quit [Remote host closed the connection]
centrx has joined #ruby
kgrz has quit [Ping timeout: 260 seconds]
<toretore>
doug23424234: where is the output from?
qasaur has quit [Read error: Connection reset by peer]
giz|work has joined #ruby
Vingador has joined #ruby
ferr1 has joined #ruby
jaguarmagenta has joined #ruby
stannard has quit [Read error: Connection reset by peer]
aupadhye has quit [Quit: Leaving]
n_blownapart has joined #ruby
<Ballo>
OK, I have a question about class variables. I have defined a @@tminutes in a superclass and have a few subclasses, ONE of which has changed it to a different value. The odd thing is when using the subclass which does NOT change the value, the value was still changed
phredus has joined #ruby
warreng_ has joined #ruby
warreng_ has quit [Changing host]
warreng_ has joined #ruby
qasaur has joined #ruby
<roelof>
jhasss : I know what map does
<jhass>
Ballo: that's expected behavior and why class variables are generally discouraged in Ruby
<warreng_>
i don't understand this syntax, what's happening here: @rx_queue << (query, deferrable = @tx_queue.shift)
Terens has left #ruby [#ruby]
<Ballo>
ok, weird
<roelof>
but how can I then first read the contents which a url sends to me when I do not know the number so far
<warreng_>
@rx_queue is an array that's getting something pushed... but query isn't defined, and how do the parans work?
<Ballo>
jhass, can I define object variables outside the methods/
<roelof>
and how do I read things then ?
<warreng_>
ohhh.... query,deferable are two new variables getting set to what's coming off of @tx_queue
<Ballo>
or do I HAVE to use the initializer
<jhass>
warreng_: yup it's multi assign, and quite ugly indeed
qasaur has quit [Client Quit]
<Ballo>
'cause it's now looking like I have to use the initializer.
<toretore>
Ballo: what's the use case?
<Ballo>
it's just a constant for every subclass
<Ballo>
it tells me when I need to discard the object based on a relative time
<jhass>
Ballo: so use a constant, you can access the subclass constant from the parent class though self.class::FOO
gtsai has joined #ruby
stannard has joined #ruby
Tesla_ has joined #ruby
jaguarmagenta has quit [Ping timeout: 252 seconds]
mtkd has quit [Ping timeout: 240 seconds]
<Ballo>
jhass, yes, but my question is do I have to set it in the initializer
<Tesla_>
I know STDIN.getch gets a character, but is there a STDIN method that gets ANY key... so I can pause the console and wait for ANY key on the keyboard to be clicked prior to termination???
* Ballo
is getting used to the Ruby quirks
<jhass>
Ballo: the constant? no
Snowy has quit [Remote host closed the connection]
rcc has joined #ruby
phredus has quit [Client Quit]
<eam>
Tesla_: not a STDIN method, but there are ways to do it by interacting with the terminal
Regulati_ has quit [Remote host closed the connection]
<Ballo>
'cause it doesn't appear to work...
<jhass>
?code Ballo
<ruby[bot]>
Ballo: We can't help you without your code, please post it to https://gist.github.com
wilsonc91 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<eam>
the kernel does input buffering to a terminal, so there aren't character by character semantics available without reconfiguring your terminal
<Tesla_>
eam: such as <example/tutorialLink>?
<Ballo>
I have the @tminutes = 60 but not in the initializer and it doesn't exist in the subclass
skylerto has joined #ruby
gomix has quit [Ping timeout: 252 seconds]
<jhass>
roelof: you realize you're truncating to two items with all_numbers = all_paintings.map { |item| item["objectNumber"] }[0..1] ?
<eam>
Tesla_: well actually, by "any key" do you also mean modifier keys?
mtkd has joined #ruby
<eam>
like shift, control, etc?
<jhass>
Ballo: yes, that's a class level instance variable, not a constant as suggested
AnoHito_ has joined #ruby
<eam>
if you've found #getch that's the best you can do inside a terminal
<Tesla_>
eam: I mean... I click any button on my keyboard and console terminates...
<Tesla_>
eam: so yes
AnoHito has quit [Ping timeout: 252 seconds]
edwinvdgraaf has joined #ruby
<eam>
Tesla_: you can't do that through a console
<eam>
you need to write something that sees scan codes
<eam>
and interacts with the keyboard directly without going via a terminal
rcc has quit [Client Quit]
<eam>
games would do that, for example
n_blownapart has quit [Ping timeout: 252 seconds]
<Tesla_>
eam: could I use Tcl/Tk for that?
<roelof>
oke, what I tried to do is getting the first two objectNumbers of the all-paintings
<jhass>
Ballo: yes, again very much expected so
<eam>
Tesla_: not sure
<Tesla_>
eam: Not for console, but say using a custom window
<Ballo>
expected for ruby programmers yes
<toretore>
Ballo: what's the *actual* use case?
<eam>
Tesla_: maybe, possibly
<jhass>
Ballo: the upper @tminutes is a instance variable in Superclass' singleton class
<eam>
Tesla_: for sure, the game frameworks for ruby will let you
wilsonc91 has joined #ruby
<roelof>
that part is right I see then 2 objectNumbers : ["SK-C-1368", "SK-A-1718"]
<Ballo>
so again my question is do I have to put this in the initalalizer
<Tesla_>
eam: ?? for sure what? Custom window, or do I need something other than Tk to get keypresses & keyreleases?
<eam>
in terms of interfaces, it'll need to be talking to the native OS windowing interfaces and not via the tty abstraction that terminals provide (character streams)
zenlot has joined #ruby
<eam>
Tesla_: I'm not familiar with the Tk interface for ruby
<eam>
but if it lets you see key up/down events, then yes
<roelof>
jhass : so after it I try to get some info on both numbers and the image_urls and put them into a hash. Right ?
<jhass>
Ballo: for the specific example you gave, yes. Whether this is at all suitable or recommended for your actual usecase, who knows
<Tesla_>
eam: apparently it
zenlot6 has quit [Ping timeout: 250 seconds]
<Ballo>
toretore: As I explained, it's a constant to know when to get rid of the object
<Tesla_>
eam: it's Java's swing library
<jhass>
roelof: I guess?
<toretore>
Ballo: let's see some real code
<eam>
tcl/tk is different from swing
<Ballo>
toretore: sorry can't
jancel has joined #ruby
<roelof>
so data_painting is first containing the name, title and the download links of the first one
<Tesla_>
eam: in what way?
<toretore>
Ballo: it's very difficult to give advice because you're asking a very specific question when you should be asking a broader one
<roelof>
and then I needs to have the content of the second image
<roelof>
and that it does, I checked that
<eam>
Tesla_: Tcl is a completely different language from Java. Tk is a completely different windowing framework from Swing
<Ballo>
that's the world we live in
maxdoubt has quit [Quit: maxdoubt]
<jhass>
?xy Ballo
<ruby[bot]>
Ballo: it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
<jhass>
that's what toretore is getting at
<roelof>
but I cannot make 1 array containg both paintings :(
renatosilva has joined #ruby
<Ballo>
toretore: I just need a value to check to know whether to discard the object based on relative time
<toretore>
Ballo: that doesn't actually mean anything at all to us
<eam>
Tesla_: no
<toretore>
Ballo: context is missing
<jhass>
roelof: did you try my suggestion of replacing your each with the map I suggested yet (plus fetching data inside it of course)
<eam>
terminals do not see scan codes generated by modifier keys -- they only see character streams
n_blownapart has joined #ruby
<roelof>
I tried but I do not see how I can work .
<roelof>
jhass ^^^^
<Tesla_>
eam: so what is that example?
<Ballo>
toretore: it's just a value associated with the object. Just trying to implement this with a minimum amount of boilerplate
<eam>
that code example will let you respond to any character (like "a") instead of having to read a full line
ramfjord has joined #ruby
ramortegui has joined #ruby
<eam>
but it won't let you respond to the shift key being pressed
<jhass>
roelof: what did you try?
<jhass>
show the latest try
<Tesla_>
eam: but what does it mean by escape, tab and other keys?
<eam>
terminals would see "a" or "A" -- but not "keydown-lshift, keydown "a", keyup "a", keyup "lshift"
<roelof>
with your suggestion ; nothing. I do not see how I can make the fetching and so on work within the map
<eam>
escape and tab send characters
<Tesla_>
eam: oh ok
<eam>
modifers like control, shift and alt do not
<toretore>
Ballo: again, that doesn't mean anything to me. it means something to you because you know the context and you know what the end goal is, but i don't
<jhass>
Ballo: so, why is my initial suggestion of using a constant and fetching it through self.class::FOO not working out for you?
<toretore>
Ballo: most likely there is a much better solution to the actual problem than the one you're trying to implement
<Ballo>
I was just trying to avoid having to type def initialize for every subclass
<Ballo>
uh huh
<jhass>
roelof: you already have it working inside each, right? just do the same inside map
<jhass>
and return the hash literal from the map
<roelof>
jhasss : I think the code will be very messy and unreadable
nofxx has joined #ruby
<jhass>
not anymore than your current code
<Ballo>
toretore: More likely you think this is a lot more complicated than it actually is
centrx has joined #ruby
maxdoubt has joined #ruby
<smathy>
Ballo, not having your actual code isn't a problem, having code that doesn't even compile is.
<toretore>
Ballo: no way to know because i don't know anything about the problem you're trying to solve
<roelof>
jhasss : but how can I get something when I have not a objectcode , Without it I cannot fetch a thing
<nofxx>
having a code that compile is the problem...
<jhass>
roelof: you have everything you have inside your each inside the map too
<nofxx>
gcc problem =D
n_blownapart has quit [Ping timeout: 252 seconds]
<jhass>
Ballo: my suggestion doesn't require a def initialize
jwren has joined #ruby
skylerto has quit [Ping timeout: 260 seconds]
synthroid has quit [Remote host closed the connection]
<Tesla_>
eam: Is there something like Tk that's also cross-platform, not too complex like an entire game engine / framework, that allows somewhat easy-to-learn interaction with input devices?
<Tesla_>
eam: That you'd know?
Cyrus1 is now known as Cyrus
<Ballo>
jhass, looking up the syntax...
Cyrus has quit [Changing host]
Cyrus has joined #ruby
torandu has quit [Ping timeout: 260 seconds]
rcc has joined #ruby
kgrz has quit [Ping timeout: 250 seconds]
<nofxx>
Tesla_, I was hoping for a atom/cromeless browser way for GUIs on Ruby, but, nobody cares about GUIs on ruby. That's the truth.
<nofxx>
you mean USB devices of some sort? Or keyboard/mice?
<Ballo>
jhass, the problem is I don't see how it's overloaded. If you don't define it in the subclass it seems you have to know to look at the superclass constant
jhack has joined #ruby
<Tesla_>
I want to build something standalone, not browser, and keyboard/mice
<nofxx>
Tesla_, it is standalone... kinda the old firefox prism, remember? The 'browser' is bundled in the 10Mb or so download.
<smathy>
Tesla_, also, if your focus is mobile (I wasn't sure when you said "devices") you might like http://www.rubymotion.com/ - although its only target on the desktop is OSX.
<Ballo>
I defined TMINUTES in the subclass and the superclass getter function uses the superclass constant
<Ballo>
so that isn't a solution
<Tesla_>
smathy: no I mean input devices, e.g. keyboard / mouse
<Tesla_>
smathy: get keypresses, keyreleases on both etc
crystal77 has joined #ruby
<Ballo>
jhass: oh sorry, I get what you're saying now
cdg has quit [Remote host closed the connection]
momomomomo has quit [Quit: momomomomo]
sameerynho has quit [Ping timeout: 260 seconds]
<Ballo>
my code works now. Thank you
<roelof>
jhasss : thanks, I will experiment with it
<Tesla_>
How can I install a gem on windows? :O
<Tesla_>
or can I put into a folder and require it or smnthn? :T
Ch4rAss has quit [Quit: Lost terminal]
n_blownapart has quit [Ping timeout: 252 seconds]
<Ballo>
good, that eliminated a lot of boilerplate
GodFather has quit [Remote host closed the connection]
Vingador has quit [Ping timeout: 252 seconds]
stannard has joined #ruby
n_blownapart has joined #ruby
danostrowski has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
haylon has quit [Ping timeout: 260 seconds]
<wrkrcoop>
when i do let(:user) {User.new} i try to print out :user using p :user and it doesnt log anything …
<jhass>
p user, let creates a method named after the symbol you pass it
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
diegoaguilar has quit [Ping timeout: 244 seconds]
<wrkrcoop>
oh it creates a method, not an object?
k3rn31 has quit [Ping timeout: 250 seconds]
<jhass>
it creates a method that returns an object
<jhass>
well that returns whatever the return value of the block you pass it is
stannard has quit [Ping timeout: 244 seconds]
<wrkrcoop>
so i would call user() to get the isntance?
<jhass>
the parens are unnecessary, but yes
<eam>
Does ruby have a mechanism to read or list signal handlers? Or can they only be set?
arlek_ has joined #ruby
k3rn31 has joined #ruby
ChiefAlexander has quit [Read error: Connection reset by peer]
ChiefAlexander has joined #ruby
n_blownapart has quit [Ping timeout: 252 seconds]
bronson has joined #ruby
danielpk has quit [Quit: danielpk]
wrkrcoop has quit [Quit: wrkrcoop]
momomomomo has joined #ruby
insanedreamer has quit [Quit: insanedreamer]
arthurl has joined #ruby
hutch34_ has joined #ruby
zotherstupidguy has joined #ruby
danielpk has joined #ruby
danielpk has quit [Client Quit]
bronson has quit [Ping timeout: 252 seconds]
Vingador has joined #ruby
tristanp has joined #ruby
n_blownapart has joined #ruby
<kgrz>
eam: unix signal handlers?
momomomomo has quit [Ping timeout: 260 seconds]
lacce has quit []
bronson has joined #ruby
hutch34_ has quit [Ping timeout: 250 seconds]
LoneHerm_ has joined #ruby
hutch34_ has joined #ruby
danostrowski has joined #ruby
grs has quit [Ping timeout: 250 seconds]
bronson has quit [Remote host closed the connection]
kareeole_ has joined #ruby
diegoaguilar has joined #ruby
n_blownapart has quit [Ping timeout: 252 seconds]
<toretore>
eam: (Signal.list.keys-%w[ILL FPE KILL BUS SEGV STOP VTALRM]).map{|s| h=Signal.trap(s, nil); Signal.trap(s, h); h } # :P
phredus has joined #ruby
<toretore>
there probably exists reasons why not to do that
phredus_ has joined #ruby
blackmesa has joined #ruby
momomomomo has joined #ruby
phredus_ has quit [Remote host closed the connection]
kareeoleez has quit [Ping timeout: 252 seconds]
stannard has joined #ruby
ponga has quit [Quit: Connection closed for inactivity]
polysics_ has quit []
<eam>
kgrz: yeah. toretore: hah, does that read and unset, then re-set them all?
<toretore>
yep
n_blownapart has joined #ruby
<eam>
Signal ought to have a non-intrusive way to just list 'em =/
stannard has quit [Ping timeout: 244 seconds]
<toretore>
yeah
<eam>
should be easy to add I suppose
<toretore>
i guess ruby maintains an internal list of handlers
<eam>
I'm guessing ruby doesn't actually look to see if any were set via other means
gtsai_ has joined #ruby
babblebre has joined #ruby
k3rn31 has quit [Ping timeout: 240 seconds]
xapak has joined #ruby
<xapak>
Hello.
<xapak>
Hey, I’ve got a general Linux inquiry. It’s about the TERM environment variable (if you have resources to better understand it, the better)
<xapak>
I have it right now as TERM=rxvt-unicode-256color. I have this Ruby code that runs system("#{ENV['EDITOR']} file"), which should pick up vim, which is the value of my EDITOR variable. Problem is, if I leave my TERM as is, it ends up loading vi instead of vim. If I do export TERM to something like xterm-color, then it loads vim correctly. Would you happen to know why?
n_blownapart has quit [Ping timeout: 252 seconds]
grs has joined #ruby
gtsai has quit [Ping timeout: 276 seconds]
momomomomo has quit [Ping timeout: 250 seconds]
brianpWins has joined #ruby
noobsu has joined #ruby
noobsu has quit [Remote host closed the connection]
<eam>
xapak: how are you determining that it loads vi instead of vim? Is vi not just a link to vim on your system?
Vingador has quit [Ping timeout: 244 seconds]
Vingador has joined #ruby
<eam>
xapak: is it possible that it's loading vim in both cases, but you're getting a vim without color in one case?
skolman_ has joined #ruby
<xapak>
Hmm, it might be vim, but not just without colors, it’s like it’s vi-compatible all the way. Let me see how can I check which one is it.
qasaur has joined #ruby
ruby488 has joined #ruby
n_blownapart has joined #ruby
ruby-lang390 has joined #ruby
aeterne has joined #ruby
<xapak>
Now it’s working even when switching back the TERM... :tableflip:
k3rn31 has joined #ruby
<xapak>
Let me reboot. I refuse to believe this to be luck.
cpup has quit [Ping timeout: 244 seconds]
bigwavejake has joined #ruby
bigwavejake has left #ruby [#ruby]
noobsu has joined #ruby
jenrzzz has joined #ruby
LoneHerm_ has quit [Remote host closed the connection]
matp has joined #ruby
stannard has joined #ruby
tomphp has joined #ruby
cpup has joined #ruby
xenthree3 has joined #ruby
kareeole_ is now known as kareeoleez
n_blownapart has quit [Ping timeout: 252 seconds]
ruby-lang390 has quit [Ping timeout: 250 seconds]
fergal has quit [Quit: fergal]
wrkrcoop has joined #ruby
_deadnull is now known as deadnull
Coldblackice has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
ruby488 has quit [Ping timeout: 250 seconds]
nettoweb has joined #ruby
<xapak>
Luck...
<xapak>
Anyways, thanks. :P
ta_ has joined #ruby
polishdub has quit [Quit: Leaving]
xapak has left #ruby [#ruby]
Devalo has quit [Remote host closed the connection]
Vingador has quit [Ping timeout: 240 seconds]
jhack has quit [Quit: jhack]
xenthree3 has quit [Remote host closed the connection]
Kallis has joined #ruby
n_blownapart has joined #ruby
<swein>
proc.new
kirillow has joined #ruby
<Tesla_>
new.proc
<wrkrcoop>
im trying to figure out how to test if a instance method has an arugment, i’m trying user.should_receive(:get_info)with(id)
<wrkrcoop>
but its not working
mtkd has quit [Ping timeout: 260 seconds]
sameerynho has joined #ruby
mtkd has joined #ruby
<jhass>
?didntwork
<ruby[bot]>
What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
n_blownapart has quit [Ping timeout: 252 seconds]
arajakul has quit [Ping timeout: 276 seconds]
<kirillow>
Method `collect_files` is reading files in a directory and turning them into objects of `kind`. Class `kind` stores every initialized `kind` in an array `@kind`. How do I get this array without initializing another `kind`?
<wrkrcoop>
i have this method that calls a method on one of my isntance variables, if i want my spec to not call that method, would i stub out that method?
<ruby[bot]>
havenwood: # => undefined method `shellescape' for "boredom? never!":String (NoMethodError) ...check link for more (https://eval.in/573994)
<ruby[bot]>
havenwood: I'm terribly sorry, I could not evaluate your code because of an error: OpenURI::HTTPError:500 Internal Server Error
<havenwood>
okay, i'lll stop spamming >.>
qasaur has joined #ruby
<havenwood>
but that "works"
troulouliou_dev has quit [Quit: Leaving]
_aeris_ has quit [Ping timeout: 276 seconds]
Xiti has quit [Read error: Connection reset by peer]
mjuszczak has quit []
n_blownapart has quit [Ping timeout: 252 seconds]
<wrkrcoop>
ok thanks
skade has joined #ruby
eL_bamba has quit [Read error: Connection reset by peer]
bronson has joined #ruby
_aeris_ has joined #ruby
k3rn31 has quit [Quit: Computer has gone to sleep.]
kirillow has quit [Quit: WeeChat 1.0.1]
LoneHerm_ has joined #ruby
jhack has joined #ruby
LoneHerm_ has quit [Read error: No route to host]
mdw has quit [Quit: Sleeping Zzzzz]
syndikate has joined #ruby
<syndikate>
Hello guys, I was writing a small application and used sprintf to print formatted output, but it is not printing anything, where as printf does...could anybody help understand why it is?
n_blownapart has joined #ruby
n_blownapart has quit [Remote host closed the connection]
n_blownapart has joined #ruby
<tobiasvl>
syndikate: sprintf returns a string, printf prints
<syndikate>
I should have been more careful reading it
bronson has quit [Ping timeout: 252 seconds]
synthroid has quit []
halfamind has quit [Read error: Connection reset by peer]
halfamind has joined #ruby
halfamind1 has joined #ruby
halfamind has quit [Read error: Connection reset by peer]
<eam>
what's the best way to parse apart a string that looks like FOO BAR1 BAR2 BAR3 into foo => [bar1, bar2, ...] where I might have one or more BAR elements
ivanskie has joined #ruby
zeroDi has joined #ruby
CJKinni has quit [Ping timeout: 252 seconds]
cdg has joined #ruby
arlek_ has quit [Ping timeout: 240 seconds]
eljimmy has quit [Quit: This computer has gone to sleep]
<jhass>
I think I would go with lines.map {|line| key, *values = line.split; [key, values] }.to_h
rrichardsr3 has joined #ruby
<kgrz>
heh, I had a similar usecase yesterday and used CSV.parse for the heck of it :D (My data has comma as the delimiter vs space in this question)
suchness has quit [Remote host closed the connection]
emilkarl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ryoshu has joined #ruby
<ryoshu>
hi
<ryoshu>
how to fix: Your Ruby version is 2.2.5, but your Gemfile specified 2.2.1
johnmilton has joined #ruby
qasaur has quit [Read error: Connection reset by peer]
wrkrcoop has quit [Quit: wrkrcoop]
<ramfjord>
well, you can either downgrade your local ruby version to 2.2.1
<ramfjord>
or tell your gemfile to use 2.2.5
wrkrcoop has joined #ruby
nankyokusei has joined #ruby
<ramfjord>
you should probably be using rvm or rbenv to manage your ruby versions in development, and you can have a copy of 2.2.1 in addition to 2.2.5
noobsu_ has quit [Read error: Connection reset by peer]
noobsu has joined #ruby
weckl has quit [Quit: Leaving]
jaguarmagenta has quit [Ping timeout: 250 seconds]
jhack has quit [Quit: jhack]
Devalo has joined #ruby
rbennacer has quit [Remote host closed the connection]
elementaru has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<elementaru>
hello, can't get a line right
<jhass>
ryoshu: nodejs rather
rbennacer has joined #ruby
<elementaru>
a>b ? puts 'text' : puts 'text2'
<elementaru>
what's missing?
mistermocha has quit [Remote host closed the connection]
<jhass>
ryoshu: execjs is a gem that runs an available javascript runtime, one of which is nodejs
noobsu has quit [Remote host closed the connection]
<ryoshu>
ruby-execjs installs nodejs
stannard has quit [Remote host closed the connection]
<jhass>
makes sense, still bundler installs execjs already so installing just nodejs would be fine
danostrowski has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
elementaru: some parens, puts('text') : puts('text2')
wald0 has joined #ruby
<jhass>
note most people prefer if/else for control flow and use ternary only when they're interested in the value of the expression
<baweaver>
puts a > b ? 'text' : 'text2'
kus has joined #ruby
kus has quit [Max SendQ exceeded]
<jhass>
like baweaver's example demonstrates
minot has joined #ruby
minot has quit [Max SendQ exceeded]
mistermocha has joined #ruby
joelwallis has joined #ruby
stannard has joined #ruby
Devalo has quit [Ping timeout: 276 seconds]
stannard has quit [Remote host closed the connection]
LoneHermit has joined #ruby
mtkd has quit [Ping timeout: 260 seconds]
rbennacer has quit [Ping timeout: 246 seconds]
tatsuo has joined #ruby
<elementaru>
baweaver but how do I get that to print to the screen?
<jhass>
elementaru: notice the puts in front
<elementaru>
ohh
<elementaru>
right
danostrowski has joined #ruby
<elementaru>
thank you
LoneHermit has quit [Remote host closed the connection]
jaruga___ has joined #ruby
jaruga___ is now known as jaruga____
jaruga____ has quit [Remote host closed the connection]
mtkd has joined #ruby
s2013 has joined #ruby
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
Pupeno has quit [Quit: Leaving...]
nickjj has quit [Ping timeout: 244 seconds]
LoneHerm_ has joined #ruby
elementaru has quit [Quit: Leaving]
kareeoleez has quit [Remote host closed the connection]
wrkrcoop has quit [Quit: wrkrcoop]
maxdoubt has quit [Quit: maxdoubt]
eL_bamba has quit [Quit: Leaving]
LoneHermit has joined #ruby
LoneHerm_ has quit [Read error: No route to host]
whathappens has joined #ruby
Evan_ has quit [Quit: Oh shit the geek died!]
wald0 has quit [Quit: Lost terminal]
LoneHermit has quit [Remote host closed the connection]
wrkrcoop has joined #ruby
ledestin has joined #ruby
Xiti has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
arlek_ has quit [Ping timeout: 276 seconds]
A124 has quit [Quit: '']
codecop has quit [Remote host closed the connection]
Yiota has quit [Ping timeout: 246 seconds]
tatsuo has quit [Read error: No route to host]
perlgod has quit [Ping timeout: 260 seconds]
A124 has joined #ruby
swein has quit [Ping timeout: 244 seconds]
biberu has quit []
Dimik has quit [Ping timeout: 252 seconds]
startupality has quit [Quit: startupality]
dml337ira has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ss_much has joined #ruby
Yiota has joined #ruby
Evan_ has joined #ruby
monod has quit [Quit: Sto andando via]
gnufied has quit [Quit: Leaving]
ramfjord_ has joined #ruby
<Ballo>
can err_arr.select{|t| !t.test?} be shortened to something like err_arr.reject{&:test?}
wilsonc91 has quit [Ping timeout: 246 seconds]
norc has quit [Read error: Connection reset by peer]
nickjj has joined #ruby
startupality has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
<havenwood>
Ballo: err_arr.reject &:test?
<Ballo>
oh yea, parentheses...
<Ballo>
is I wanted to keep the select ! instead of reject, would it be err_arr.select &:!test
<havenwood>
Ballo: nope
<tobiasvl>
why would you want that anyway
<Ballo>
or err_arr.select !&:test?
<havenwood>
Ballo: The long form you initially wrote.
ivanskie has quit [Ping timeout: 276 seconds]
<Ballo>
so you're saying I can't modify the result
<tobiasvl>
you can't negate a proc symbol
<tobiasvl>
it doesn't make sense
<jhass>
there's no such thing as "proc symbol"
<jhass>
it's just a symbol
<tobiasvl>
sure
hahuang61 has joined #ruby
* Ballo
is trying to figure out why ruby has these block things instead of function objects
qasaur has quit [Read error: Connection reset by peer]
<jhass>
Ballo: so the :test? in &:test? is just a Symbol, the & operator calls to_proc on it and Symbol#to_proc happens to return a useful proc (one calling the method named by the symbol on its first argument)
qasaur_ has joined #ruby
<tobiasvl>
Ballo: you mean in addition to? (if you mean method instead of function)
<havenwood>
Ballo: You can pass a lambda, proc or method as a block as well by prefixing the &.
hahuang65 has quit [Ping timeout: 244 seconds]
<Ballo>
so far as I can see, ruby doesn't have functions. Period
<jhass>
well, Method object
<tobiasvl>
Ballo: you're right. it has methods
<havenwood>
Ballo: It does.
<Ballo>
javascript has functions as does python
<havenwood>
Ballo: Method, functions, block, procs, lambdas, and bears.
<Ballo>
and you can pass them to other functions
<havenwood>
Ballo: Ruby has functions...
s2013 has quit [Ping timeout: 276 seconds]
<havenwood>
Ballo: As you can with any modern lang.
JesseH has quit [Remote host closed the connection]
<havenwood>
Functions with a module as a receiver for example.
<havenwood>
Ballo: Anyways, just because you have a block sugar syntax or whatever you want to call it doesn't preclude passing methods/functions/procs/lambdas around.
<Ballo>
I don't see what you're calling a "function"
<tobiasvl>
Ballo: what is, in your view, the differences between a function and a method?
<tobiasvl>
a lambda and a proc are not invoked on an object. are they functions in your opinion?
<havenwood>
Ballo: Maybe you're getting confused because Ruby has more options than just one type of function. There are reasons!
curses has quit [Remote host closed the connection]
axl__ has joined #ruby
axl_ has quit [Ping timeout: 260 seconds]
axl__ is now known as axl_
<havenwood>
See the talk above. It's an interesting look at lambdas in Ruby.
centrx has quit [Quit: centrx]
<havenwood>
Or if you're looking for a particular locality of return, or binding or non-binding or whatever, just say what exactly.
<smathy>
RIP Jim, such a sad loss, he was a good guy.
<havenwood>
smathy: Indeed.
aeterne has quit [Read error: Connection reset by peer]
<havenwood>
:(
<havenwood>
<3 <3 <3
<tobiasvl>
weirich? or did someone else pass?
<havenwood>
Ballo: It's Ruby so if it makes you more comfortable: Function = Proc # :P
<smathy>
Yeah, Weirich.
<smathy>
...the video above.
nankyokusei has joined #ruby
<tobiasvl>
oh right
<tobiasvl>
Ballo: basically, procs and lambdas are what you could call functions in ruby. they're not invoked on an object (although they ARE objects, or first class functions) but can have closures
<tobiasvl>
...basically.
Tesla_ has quit [Ping timeout: 250 seconds]
qasaur_ has quit [Read error: Connection reset by peer]
finisherr has quit [Quit: finisherr]
nareiber has quit [Ping timeout: 250 seconds]
qasaur has joined #ruby
<tobiasvl>
a block obviously is also a closure.
solars has quit [Ping timeout: 252 seconds]
<tobiasvl>
if you want something else from a "function" than that then please elaborate
Omen has joined #ruby
Omen is now known as Guest47468
nankyokusei has quit [Ping timeout: 252 seconds]
rbennacer has joined #ruby
zotherstupidguy has quit [Ping timeout: 260 seconds]
brianpWins has quit [Ping timeout: 240 seconds]
stannard has joined #ruby
dopie has joined #ruby
Symbiosisz has quit [Ping timeout: 276 seconds]
firstdayonthejob has quit [Ping timeout: 246 seconds]
qasaur has quit [Read error: Connection reset by peer]
<nerium>
Any recommendations on a tool/lib that can travarse a page where only unique resources are visited? So if /posts/1 is visited, /posts/2 shouldn’t
<havenwood>
nerium: most crawlers would have an option to not duplicate visits
blackmesa has joined #ruby
dopie has quit [Client Quit]
<|2701>
ive never enjoyed ruby's pointy lambdas
<nerium>
That’s not really the case here. I don’t want it to visit duplicate resources, not urls
hightower2 has joined #ruby
<havenwood>
|2701: stabby stab stab!
<havenwood>
(i do)
edwinvdgraaf has quit [Remote host closed the connection]
jwren has quit [Quit: Changing server]
<havenwood>
nerium: Rails-specific or just in general?
<nerium>
General would be good, but rails workls
stannard has quit [Ping timeout: 244 seconds]
tax has quit [Remote host closed the connection]
tax has joined #ruby
<|2701>
surely mechanize has something like that...?
<smathy>
"only unique resources" doesn't match with "if /posts/1 is visited, /posts/2 shouldn’t"
axl_ has joined #ruby
<smathy>
... /posts/1 and /posts/2 are unique resources.
dopie has joined #ruby
<|2701>
he meant unique groups of resources, I think. so /users/*, /pages/*, /stuff/* etc
<nerium>
Okay, I would call /posts a resource, but I get what you mean
toretore has quit [Ping timeout: 276 seconds]
<smathy>
nerium, so what about /posts/1/comments ?
maxdoubt has joined #ruby
<smathy>
...and if /posts is visited, you want to skip any individual /posts/1 ?
jwren has joined #ruby
hightower3 has quit [Ping timeout: 276 seconds]
sameerynho has joined #ruby
<nerium>
That’s correct. The idea is to verify that all views works (200 response)
<smathy>
So ambiguity, much unknown.
<smathy>
nerium, well if that's correct, then you DON
<smathy>
DON'T want to skip /posts/1
<smathy>
Are you going to assume totally restful routes? So /posts/some_category couldn't exist?
<smathy>
If this is testing your own app I'd just make a list of URLs to test/check.
<nerium>
Yes, this is my owen site
<nerium>
*sites
<nerium>
Was hoping to avloid doing this manually
<nerium>
but maybe that’s the way to go
blackgoat has joined #ruby
arthurl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<nerium>
Maybe I can just look at the most visited urls in the log and use them
Symbiosisz has joined #ruby
rbennacer has quit [Read error: Connection reset by peer]
<smathy>
It would only be reliable with very ordinary/restful routes anyway, and if your routes are like that then spitting out `rake routes` and using conventions to map to models and just pulling up `ThatModel.first` or something to grab an id will probably be simpler and more reliable than scraping and trying to work backwards to identify unique controller/action combinations.
rbennacer has joined #ruby
<smathy>
Well that won't ensure any level of your "uniqueness" (I wouldn't expect).
sameerynho has quit [Ping timeout: 260 seconds]
<nerium>
It would with some filtering
<smathy>
...or if you know you never delete records maybe you just always use `1`
<nerium>
Yeah, but then we might have /posts/1/comments/194
<smathy>
Yep. I'd go the other way, taking the URLs and substituting - but the filtering would work ok too.
<nerium>
Yeah, just looking at what my users already uses would work
<smathy>
Not sure which approach that was a "but" to, but in both situation nested routes will just require some additional filtering or substitution.
swein has joined #ruby
<smathy>
Cool.
qasaur has joined #ruby
<nerium>
Tried that a few years ago. (using resources and existing data to generate a list) and it was to much work and error prone
ixti has quit [Quit: WeeChat 1.5]
<nerium>
I mean, using rake routes and appplying data to routes by doing user_path(User.first)
akiTendo has joined #ruby
sdwrage has quit [Quit: This computer has gone to sleep]
insanedreamer has joined #ruby
swein has quit [Ping timeout: 276 seconds]
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
momomomomo has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
LoneHermit has joined #ruby
rbennacer has quit [Remote host closed the connection]
JesseH has joined #ruby
tomchapin has joined #ruby
chouhoulis has joined #ruby
halfamind has quit [Quit: Leaving.]
swills has joined #ruby
chouhoul_ has joined #ruby
spider-mario has quit [Remote host closed the connection]
koooge has joined #ruby
qasaur has quit [Read error: Connection reset by peer]
<wrkrcoop>
anyone see anything wrong with this: expect(client.get_file([],{})).to raise ArgumentError
<wrkrcoop>
code is raise ArgumentError if !xis_a?(String) || !y.is_a?(String)
<tpendragon>
If you're expecting an exception it needs to be in a block.
chouhoulis has quit [Ping timeout: 276 seconds]
flashpoint9 has joined #ruby
<tpendragon>
So expect{client.get_file([], {})}.to raise_error ArgumentError
<tpendragon>
(Also, consider duck typing)
sdwrage has joined #ruby
<wrkrcoop>
tpendragon: can u elaborate on the duck typing part
<wrkrcoop>
thank you for the help that worked
<tpendragon>
It's almost never a good idea to check for a class. Just send it a method and if it responds, great.
mtkd has quit [Ping timeout: 252 seconds]
blaxter has quit [Quit: KTHXBYE]
skolman_ has quit [Remote host closed the connection]
<wrkrcoop>
tpendragon: but if u dont return an error then how will the user know what went wrong?
wald0 has joined #ruby
skolman has joined #ruby
<tpendragon>
Your code will try to send the message and it will explode if they send a bad thing.
<wrkrcoop>
tpendragon: and isnt that bad for your server?
qasaur has joined #ruby
<tpendragon>
No..? ArgumentError's no more useful than NoMethodException, I wouldn't think.
mtkd has joined #ruby
joelwallis has quit [Quit: Leaving]
nando294021 has quit [Read error: No route to host]
nando293921 has joined #ruby
<wrkrcoop>
tpendragon: what if u dont raise and error but send a response, if u dont send a response wont your server crash?
<tpendragon>
So...don't send it bad things?
qasaur has quit [Read error: Connection reset by peer]
swein has joined #ruby
qasaur has joined #ruby
<wrkrcoop>
tpendragon: thanks for the help, much appreciated
<wrkrcoop>
why did i have to use a block instead of parentheses?
<tpendragon>
It's just the only way rspec has to know to capture the exception.
<tpendragon>
h
skolman has quit [Ping timeout: 252 seconds]
qasaur has quit [Read error: Connection reset by peer]
<tpendragon>
(the block's only run when the matcher decides to run it, so it can do something like begin; block.call; rescue Exception => e; record_exception; end;)