ericx2x has quit [Remote host closed the connection]
cdg has joined #ruby
elsevero has quit [Quit: elsevero]
br0d1n has quit [Quit: Leaving]
hahuang65 has joined #ruby
justbleed has joined #ruby
uZiel_ has quit [Quit: Reconnecting]
uZiel has joined #ruby
harfangk has joined #ruby
hahuang65 has quit [Ping timeout: 276 seconds]
Rodya_ has quit [Remote host closed the connection]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jackjackdripper has quit [Quit: Leaving.]
gf3 has quit [Ping timeout: 260 seconds]
bogdanteleaga has quit [Ping timeout: 255 seconds]
duracrisis has quit [Ping timeout: 246 seconds]
millerti has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest85780 has quit [Ping timeout: 260 seconds]
bazzy has quit [Ping timeout: 255 seconds]
z64 has quit [Ping timeout: 240 seconds]
D9 has quit [Ping timeout: 240 seconds]
tsul has quit [Ping timeout: 240 seconds]
biox has quit [Ping timeout: 260 seconds]
chrisarcand has quit [Ping timeout: 240 seconds]
bogdanteleaga has joined #ruby
pawandubey has joined #ruby
D9 has joined #ruby
biox has joined #ruby
gf3 has joined #ruby
dyyylan has quit [Quit: ZNC 1.6.3+deb1 - http://znc.in]
gsingh93 has joined #ruby
dyyylan has joined #ruby
duracrisis has joined #ruby
tsul has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
patr0clus has joined #ruby
chrisarcand has joined #ruby
z64 has joined #ruby
mim1k has joined #ruby
bazzy has joined #ruby
railswebdev has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
Silthias has joined #ruby
patr0clus is now known as s3nd1v0g1us
asdfasdf has joined #ruby
pawandubey has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<asdfasdf>
Hello, I am having trouble with the Ruby net/https library. For some reason I get a SocketError from my code, seen here: https://pastebin.com/zccLMppV .
<ruby[bot]>
asdfasdf: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
im314ous has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
<elomatreb>
asdfasdf: The net/http constructor wants a pure domain (no protocol) I think, try leaving the http:// part off
<havenwood>
asdfasdf: If you just want the response it's less code to use OpenURI from the stdlib: require 'open-uri'; response = open 'http://www.wikipedia.org', &:read
FastJack has quit [Ping timeout: 258 seconds]
bed7 has joined #ruby
<asdfasdf>
elmatreb, havenwood: I still get the same result
<havenwood>
asdfasdf: You should get a redirect after elomatreb's fix or the response body with OpenURI.
<havenwood>
asdfasdf: Double check you're running the suggested code?
<havenwood>
There's an Ubuntu walkthrough for Ruby 2.4 ^ on Ubuntu with ruby-install/chruby.
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<havenwood>
asdfasdf: You can handle the redirect yourself with net/http or open-uri but I think you're right to just bump to 2.4.1 if that's an option!
<havenwood>
asdfasdf: There are also many high quality HTTP gems. Some wrap net/http, some wrap libcurl and some are pure Ruby.
Patadas has quit [Remote host closed the connection]
romank is now known as romankapitonov
Patadas has joined #ruby
<_moep_>
hello! I have a problem: I try to install unicorn via bundle exec gem install unicorn, but I get this error: https://paste.debian.net/hidden/4485ab46/ which tells me the correct gem in ~/.rbenv
hopland has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #ruby
marr has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
al2o3-cr has quit [Ping timeout: 276 seconds]
jameser has joined #ruby
r3vDev has quit [Quit: Leaving.]
mim1k has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
cam27 has quit [Quit: cam27]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
agent_white has quit [Quit: bai]
im0nde has joined #ruby
dhollinger has quit [Ping timeout: 268 seconds]
postmodern has quit [Quit: Leaving]
pandaant has joined #ruby
axsuul has quit [Ping timeout: 260 seconds]
Coldblackice_ has joined #ruby
axsuul has joined #ruby
djbjd has joined #ruby
KeyJoo has quit [Ping timeout: 260 seconds]
Coldblackice has quit [Ping timeout: 268 seconds]
Coldblackice has joined #ruby
contradictioned has joined #ruby
_Coldblackice has joined #ruby
_Coldblackice has joined #ruby
_Coldblackice has quit [Remote host closed the connection]
alex`` has quit [Quit: WeeChat 1.8]
_Coldblackice has joined #ruby
_Coldblackice has quit [Remote host closed the connection]
Coldblackice_ has quit [Ping timeout: 268 seconds]
_Coldblackice has joined #ruby
_Coldblackice has quit [Read error: Connection reset by peer]
Coldblackice has quit [K-Lined]
Fraeon has quit [Ping timeout: 240 seconds]
_Coldblackice has joined #ruby
_Coldblackice has quit [Read error: Connection reset by peer]
_Coldblackice has joined #ruby
_Coldblackice has quit [Read error: Connection reset by peer]
<dminuoso>
_moep_: Im wondering if this is a psych related bug that was fixed in a newer version.
Coldblackice has joined #ruby
<dminuoso>
_moep_: Can you try upgrading to 2.3.4?
graingert is now known as pqnst
pqnst is now known as graingert
nofxxxx has quit [Remote host closed the connection]
flips has quit [Quit: bbl ...]
flips has joined #ruby
Coldblackice_ has joined #ruby
Coldblackice_ has quit [K-Lined]
Coldblackice has quit [K-Lined]
Coldblackice_ has joined #ruby
Coldblackice_ has quit [K-Lined]
Coldblackice_ has joined #ruby
runescape07rsps has joined #ruby
govg has joined #ruby
patarr has joined #ruby
Fernando-Basso has joined #ruby
Coldblackice has joined #ruby
_Coldblackice has joined #ruby
dhollinger has joined #ruby
Coldblackice has quit [K-Lined]
_Coldblackice has quit [K-Lined]
Coldblackice_ has quit [K-Lined]
_Coldblackice has joined #ruby
hahuang65 has joined #ruby
_Coldblackice has quit [K-Lined]
patarr has quit [Ping timeout: 240 seconds]
pale3x has left #ruby ["WeeChat 1.8"]
Esf has joined #ruby
Esf has quit [Client Quit]
hahuang65 has quit [Ping timeout: 240 seconds]
hutch34 has joined #ruby
astrobunny has quit [Remote host closed the connection]
astrobunny has joined #ruby
astrobunny has quit [Remote host closed the connection]
psychicist__ has joined #ruby
hutch34 has quit [Ping timeout: 276 seconds]
ltem has joined #ruby
judofyr has quit [Read error: Connection reset by peer]
judofyr_ has joined #ruby
Coldblackice has joined #ruby
Coldblackice is now known as Guest14371
minimalism has quit [Quit: minimalism]
Guest14371 has quit [Ping timeout: 260 seconds]
Serpent7776 has joined #ruby
psychicist__ has quit [Quit: leaving]
psychicist__ has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
im0nde has quit [Ping timeout: 276 seconds]
djbjd has quit [Quit: djbjd]
r3vDev has joined #ruby
Fysicus has joined #ruby
Fraeon has joined #ruby
djbjd has joined #ruby
sami has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
GodFather has joined #ruby
pandaant has quit [Remote host closed the connection]
sami has joined #ruby
r3vDev has quit [Quit: Leaving.]
anisha has quit [Ping timeout: 240 seconds]
alex`` has joined #ruby
r3vDev has joined #ruby
tvw has joined #ruby
nowhere_man has quit [Ping timeout: 276 seconds]
anisha has joined #ruby
<_moep_>
dminuoso: ok, I'll try
DoubleMalt has quit [Ping timeout: 276 seconds]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
runescape07rsps has quit [Ping timeout: 260 seconds]
psychicist__ has quit [Quit: leaving]
psychicist__ has joined #ruby
ledestin has joined #ruby
ur5us has joined #ruby
ledestin has quit [Ping timeout: 276 seconds]
roamingdog has joined #ruby
bkxd has joined #ruby
bkxd_ has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
roamingdog has quit [Ping timeout: 276 seconds]
bkxd_ has quit [Ping timeout: 255 seconds]
bkxd has quit [Ping timeout: 255 seconds]
bkxd has joined #ruby
nowhere_man has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
bkxd has quit [Ping timeout: 255 seconds]
stamina has joined #ruby
ur5us has quit [Ping timeout: 276 seconds]
DoubleMalt has joined #ruby
zacts has quit [Ping timeout: 276 seconds]
Mia has quit [Ping timeout: 240 seconds]
zacts has joined #ruby
mydog2 has quit [Ping timeout: 255 seconds]
TomyWork has quit [Ping timeout: 240 seconds]
mydog2 has joined #ruby
patarr has joined #ruby
<kspencer>
How can I add my ~/.gem/... path to the ruby load path? As I'm looking and only seeing how to add 'lib' directories, not user gem directories
bkxd has joined #ruby
cschneid has quit [Ping timeout: 258 seconds]
hahuang65 has joined #ruby
bkxd_ has joined #ruby
patarr has quit [Ping timeout: 276 seconds]
hahuang65 has quit [Ping timeout: 260 seconds]
hutch34 has joined #ruby
blackwind_123 has quit [Ping timeout: 276 seconds]
hutch34 has quit [Ping timeout: 255 seconds]
uZiel has quit [Ping timeout: 248 seconds]
IRC-Manager has joined #ruby
<IRC-Manager>
hi
ldnunes has joined #ruby
WhereIsMySpoon has joined #ruby
<WhereIsMySpoon>
Hey, I’m trying to install json 1.7.7 and I’m getting a crapton of compile errors when trying to install
<WhereIsMySpoon>
when its trying to run make
jameser has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
tonini__ has quit [Quit: Connection closed for inactivity]
djbjd has quit [Quit: djbjd]
roshanavand has quit [Quit: roshanavand]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sepp2k has joined #ruby
im0nde has joined #ruby
blackwind_123 has joined #ruby
chimkan has joined #ruby
Mortomes|Work has quit [Ping timeout: 260 seconds]
<chimkan>
I’m using whenever gem to cron my ruby scripts
<chimkan>
but when it runs, it runs in a the cron bin directory instead of the app’s folder
<chimkan>
then the app just doesn’t run because I cannot set the directory path
<chimkan>
currently, I’m setting by using a constant and I name the directory’s path
minimalism has quit [Client Quit]
<chimkan>
isn’t there any other way to do it dynamically?
<dminuoso>
_moep_: It does.
minimalism has joined #ruby
<dminuoso>
_moep_: It's an entirely different error.
ldnunes has quit [Ping timeout: 258 seconds]
<_moep_>
dminuoso: hmmm my problem is, that I cant access to the unicorn
<dminuoso>
_moep_: Im not convinced that "bundle exec gem install" is such a wise idea.
<dminuoso>
What are you trying to do?
<_moep_>
try to run a rails app
<dminuoso>
_moep_: The rails app should specify all its dependencies in the Gemfile.
WhereIsMySpoon has quit [Quit: WhereIsMySpoon]
<dminuoso>
_moep_: Which means a plain "bundle install" will install all necessary external dependencies.
djbjd has joined #ruby
<_moep_>
yes I know and i did it
<_moep_>
I unicorn is running, but I cant see it
r3vDev has quit [Quit: Leaving.]
millerti has joined #ruby
dropsh0t has joined #ruby
ldnunes has joined #ruby
FastJack has quit [Read error: Connection reset by peer]
mim1k has joined #ruby
graft has joined #ruby
graft has joined #ruby
graft has quit [Changing host]
GinoMan has joined #ruby
FastJack has joined #ruby
JustTheDoctor has quit [Quit: Connection closed for inactivity]
cdg has joined #ruby
Mortomes|Work has joined #ruby
jameser has joined #ruby
IRC-Manager has quit [Quit: Page closed]
minimalism has quit [Quit: minimalism]
r3vDev has joined #ruby
mim1k has quit [Read error: Connection reset by peer]
jphase has joined #ruby
synthroi_ has joined #ruby
Rodya_ has joined #ruby
synthroid has quit [Ping timeout: 260 seconds]
Patadas has quit [Ping timeout: 260 seconds]
patarr has joined #ruby
mim1k has joined #ruby
andikr has quit [Remote host closed the connection]
minimalism has joined #ruby
rohitpaulk has quit [Ping timeout: 240 seconds]
DoubleMalt has quit [Quit: Leaving]
bed7 has joined #ruby
rohitpaulk has joined #ruby
patarr has quit [Ping timeout: 276 seconds]
WhereIsMySpoon has joined #ruby
WhereIsMySpoon has joined #ruby
WhereIsMySpoon has quit [Changing host]
TheBloke has joined #ruby
r3vDev has quit [Quit: Leaving.]
nowhere_man has quit [Ping timeout: 240 seconds]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
simmaniac has joined #ruby
jameser has joined #ruby
sysvalve has quit [Ping timeout: 260 seconds]
runescape07rsps has joined #ruby
synthroi_ has quit [Remote host closed the connection]
minimalism has quit [Quit: minimalism]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chimkan has quit [Quit: chimkan]
WhereIsMySpoon has quit [Quit: WhereIsMySpoon]
jameser has joined #ruby
millerti has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
synthroid has joined #ruby
phikes has joined #ruby
nowhere_man has joined #ruby
Burgestrand has quit [Quit: Closing time!]
Burgestrand has joined #ruby
WhereIsMySpoon has joined #ruby
gnufied has joined #ruby
rohitpaulk has quit [Ping timeout: 276 seconds]
DLSteve has joined #ruby
hahuang65 has joined #ruby
centrx has joined #ruby
gregf_ has joined #ruby
Mortomes|Work has quit [Ping timeout: 260 seconds]
hahuang65 has quit [Ping timeout: 258 seconds]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Burgestrand has quit [Quit: Closing time!]
r3vDev has joined #ruby
hutch34 has joined #ruby
fuzzyhorns1 has joined #ruby
ta_ has quit [Remote host closed the connection]
jameser has joined #ruby
fuzzyhorns1 has quit [Client Quit]
psychicist__ has quit [Quit: leaving]
roamingdog has joined #ruby
psychicist__ has joined #ruby
hutch34 has quit [Ping timeout: 255 seconds]
oleo has joined #ruby
gheegh has joined #ruby
pier has joined #ruby
WhereIsMySpoon has quit [Quit: WhereIsMySpoon]
rohitpaulk has joined #ruby
__Yiota has joined #ruby
Burgestrand has joined #ruby
roamingdog has quit [Ping timeout: 258 seconds]
<ljarvis>
that's because they're not real
jordanm has quit [Ping timeout: 260 seconds]
jordanm has joined #ruby
chouhoulis has joined #ruby
itsautomatisch has joined #ruby
runescape07rsps has quit [Ping timeout: 260 seconds]
millerti has joined #ruby
railswebdev has joined #ruby
WhereIsMySpoon has joined #ruby
<cttttt>
Just wondering. Is it possible to perform an early return from a block in Ruby? I'm noticing that if I use `return` from a block is jumps out of the containing method instead of the block. I guess if returns aren't possible, the alternative would be to just fully describe the logic in blocks and make sure the result is evaluated last on all codepaths...right?
<ljarvis>
but yeah, you shouldn't really be doing too much complex stuff in blocks
<ytti_>
break?
<ljarvis>
whoops i meant to use break not next
<ljarvis>
next works in this case.. for reasons, but break is more correct
chimkan has quit [Client Quit]
<cttttt>
ljarvis: True. Are early `return` 's just seldom used in Ruby because of the last-statement-is-the-return-value behavior?
charliesome has joined #ruby
<ljarvis>
pretty much yeah. They're used, but not too often
umaaji has quit [Quit: Leaving...]
chimkan has joined #ruby
<cttttt>
ljarvis: Cool. I think Javascript scrambled my brain. It's actually easier to reason with when branches fully describe control flow. But in Javascript, early return is life.
dangerousdave has joined #ruby
mathys has quit [Quit: Leaving]
ferr has quit [Quit: WeeChat 1.8]
dropsh0t has quit [Quit: Leaving]
<elomatreb>
cttttt: They're used in Ruby like guard frequently too, like guard statements. Catching the simple case/errors in the beginning of methods, usually in the form `return a if/unless b` or `raise A if/unless b`
dropsh0t has joined #ruby
<elomatreb>
eh, garbled sentence
bkxd has quit [Read error: Connection reset by peer]
bkxd_ has quit [Read error: Connection reset by peer]
tau has joined #ruby
<cttttt>
elomatreb: Yeah...this is a thing in JS as well. But it's more because in earlier iterations of the language, folks couldn't decide how to handle background tasks, so some slow operations take a callback which is called with an optional error argument. So, first thing u do is inspect the error, and return immediately if something's wrong...then process the result of the slow operation.
<cttttt>
elomatreb: Since this happens *a lot* folks just do an early return, and avoid the indenting.
bkxd has joined #ruby
bkxd_ has joined #ruby
<cttttt>
elomatreb: And, not garbled enough to be unreadable :) thx for the insights.
chimkan has quit [Quit: chimkan]
<cttttt>
So, `next` in blocks (but avoid early return) and `return` in actual functions. I guess blocks !== functions in Ruby, eh?
<elomatreb>
You'll find that Ruby code often doesn't use the explicit return keyword anywhere except in these statements
<ljarvis>
cttttt: ruby doesn't really have functions
<ljarvis>
cttttt: also, break not next
<elomatreb>
Prefer break over next, and yes, blocks are not functions/methods
<elomatreb>
They're just a bit of code associated with a method call
<cttttt>
ljarvis: Completely academic example...was literally expecting the events to be turned to `nil` here.
<cttttt>
events --> evens
<elomatreb>
cttttt: ljarvis solution is idiomatic, alternatively you could utilize that a non-branching if returns nil already, so `d if d.even?` has the same effect
<ljarvis>
cttttt: sure, you just very hardly have to do that. If you do, maybe the code is bad. Using your example, you would indeed just write if d.even?; return; else; d; end
<cttttt>
ljarvis: Just popped into a blank file to figure out why return was weird. Makes sense though...these aren't really first class functions being passed around.
<ljarvis>
yeah, elomatreb's example would be how it's done in the wild. Implicit nil value from the conditional
Ropeney has joined #ruby
<cttttt>
ljarvis: Yup. Makes senses. I'll try to reprogram myself to embrace the branch in Ruby :)
chimkan has joined #ruby
<ljarvis>
>> (1..5).select { |d| d unless d.even? }
<cttttt>
elomatreb: Just reading ur responses. So, yield is like calling a subroutine in some languages. Yikes. So, blocks are in no way functions at all. Interesting.
elsevero has quit [Ping timeout: 240 seconds]
<ljarvis>
nothing is a function in Ruby, btw
<cttttt>
ljarvis: Interesting. So, not even lamdas?
<ljarvis>
They're lambdas :)
<cttttt>
ljarvis: touche
<elomatreb>
You can mutate state in lambdas, so they're not functions either
graft has quit [Ping timeout: 276 seconds]
<cttttt>
Okay. I guess under the strict definition, yeah...ur right...
<ljarvis>
it'll all start making sense pretty quickly
<elomatreb>
In Ruby they're called methods for that reason
Rodya_ has quit [Remote host closed the connection]
Yzguy has joined #ruby
<cttttt>
elomatreb: Makes sense. Because they can mutate data outside of converting args to a result.
oblique has quit [Quit: WeeChat 1.7.1]
Burgestrand has quit [Quit: Closing time!]
<elomatreb>
Wrt blocks from earlier: You can get a Proc object (basically a wrapper for a block) to pass them around like you would in Javascript
<ljarvis>
you can also unbind and rebind ruby methods
<ljarvis>
because why not
kruppm has quit [Ping timeout: 276 seconds]
haylon has joined #ruby
vondruch has quit [Ping timeout: 255 seconds]
<Ropeney>
elomatreb, can you reference something that a function must not change the state of anything?
<cttttt>
ropeney: It's a thing in pure functional programming circles. Technically, they're right that the term is misused in a lot of cases.
<elomatreb>
I'm thinking of functions from math, where calling a function with the same arguments must always produce the same result
kruppm has joined #ruby
<Ropeney>
I don't see how changing the state on something is any different to that?
<cttttt>
ropeney: From a computer science/math standpoint, ...a function produces the same result from the same inputs. So, mutating those inputs or anything else could break that contract.
<elomatreb>
It's a fairly dumb technicality, you're right
<Ropeney>
I don't think it is a technicality
<Ropeney>
So a function in a "functional" language, couldn't write to a database during a function call?
<elomatreb>
Look at how you have to jump through hoops in e.g. Haskell with the IO monad to achieve that
<elomatreb>
You're right in essence, yes
<cttttt>
ropeney: Whatever calls out to the db wouldn't be a function.
mim1k has quit [Read error: Connection reset by peer]
<elomatreb>
In functional languages there is often one special "function" that's allowed to break this rule
<cttttt>
ropeney: If you talk to a hardcore functional programmer, you'll notice anger if you say that a routine the mutates data is a function.
<Ropeney>
It'd be "changing state" of something, indirectly or not.
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kug3lis_off is now known as Kug3lis
<elomatreb>
As I said, look at how e.g. IO works in Haskell, it demonstrates all this
<Ropeney>
I can't find anything backing this up, do you mind sharing any article?
<Ropeney>
"In computer programming, a function may be considered a pure function if both of the following statements about the function hold:", so I'
<Ropeney>
m still confused if "function" is incorrect here.
conta has quit [Ping timeout: 240 seconds]
<dminuoso>
ropeney: it is incorrect.
<dminuoso>
ropeney: They ought to say "routine"
<dminuoso>
ropeney: "pure function" is the desperate attempt for "function" to regain its original meaning
<dminuoso>
"function" is suddenly used synonmously with routine, so the old meaning of function suddenly becomes pure function.
<dminuoso>
ljarvis | you can also unbind and rebind ruby methods
<elomatreb>
How this came to be has to do with the evolution of programming languages from the basic form of a list of instructions
<dminuoso>
ropeney: Essentially a pure function is a function that behaves in a mathematical sense.
itsech0 has joined #ruby
<ljarvis>
pure like dminuoso
conta has joined #ruby
roamingdog has joined #ruby
<ljarvis>
many routine, such mathmatics
<Ropeney>
I think in maths, the purity comes natural though? This doesn't defy the standard definition of function in CS though.
t-recx has joined #ruby
<dropsh0t>
take it over to #haskell
* elomatreb
mumbles something about monads and burritos
<ljarvis>
#ruby-offtopic is fine
<Ropeney>
np :)
<ljarvis>
nobody needs to be sent to haskell
<dminuoso>
elomatreb: Maybe.
judofyr_ has quit []
<dminuoso>
ljarvis: None needs to be send to Haskell even.
<ljarvis>
har
<ljarvis>
that was average at best for you
<dminuoso>
ljarvis: Im Just trying to be like baweaver
<dminuoso>
There's Nothing wrong with that.
<ljarvis>
Maybe you should stop
<ljarvis>
^ see, subtle
<ljarvis>
oh you did Maybe already
<ljarvis>
DAMMIT
<ljarvis>
ok everyone go to #ruby-offtopic
<dminuoso>
ljarvis: You should Read what I say.
workmad3 has joined #ruby
troys is now known as troys_
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
ALVAN has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
Ropeney has quit [Remote host closed the connection]
mim1k has joined #ruby
roamingdog has quit [Remote host closed the connection]
<ALVAN>
hello, in bash i can specify multiple hosts using box0[1-9].dev.foo, can i use same aproach to define an attribute like hosts='box0[1-9].dev.foo' as a list ?
roamingdog has joined #ruby
<ALVAN>
so i wont need to enter all the 9 hosts
roamingdog has quit [Remote host closed the connection]
<elomatreb>
>> (1..9).map {|i| "host#{i}.dev" }
<ruby[bot]>
elomatreb: # => ["host1.dev", "host2.dev", "host3.dev", "host4.dev", "host5.dev", "host6.dev", "host7.dev", "host8.d ...check link for more (https://eval.in/823769)
graft has joined #ruby
graft has joined #ruby
graft has quit [Changing host]
<dminuoso>
There must be a shorter way to do that.
phikes has quit [Remote host closed the connection]
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
dionysus70 is now known as dionysus69
bkxd__ has joined #ruby
bkxd___ has joined #ruby
runescape07rsps has joined #ruby
<ALVAN>
thanks elomatreb i will try it
workmad3 has quit [Ping timeout: 276 seconds]
<elomatreb>
I agree with dminuoso though, this does not feel like a satisfyingly Ruby-obscure solution
bkxd_ has quit [Ping timeout: 276 seconds]
bkxd has quit [Ping timeout: 276 seconds]
enterprisey has joined #ruby
runescape07rsps has quit [Client Quit]
cam27 has joined #ruby
runescape07rsps has joined #ruby
nchambers is now known as god
<dminuoso>
asm>> (1..9).map {|i| "host#{i}.dev" }
<ruby[bot]>
dminuoso: I have disassembled your code, the result is at https://eval.in/823771
workmad3 has joined #ruby
<dminuoso>
elomatreb: I do not think it is doable any shorter than that. But perhaps we can find a solution that uses less vm opcodes.
god is now known as nchambers
uZiel has joined #ruby
<dminuoso>
Wow!
<dminuoso>
1..9 is a primitive?
Yzguy has quit [Quit: Zzz...]
<dminuoso>
What the!
<dminuoso>
That seals the deal. That _is_ the shortest way.
patarr has joined #ruby
im0nde has quit [Ping timeout: 276 seconds]
t-recx has quit [Quit: t-recx]
im0nde has joined #ruby
d10n-work has joined #ruby
Rodya_ has joined #ruby
hutch34 has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
andrzejku has joined #ruby
cdg has quit [Remote host closed the connection]
andrzejku has quit [Client Quit]
<balo>
szerintem erdemes
<balo>
wrong window sry
tvw has quit []
workmad3 has quit [Ping timeout: 260 seconds]
rickumali has joined #ruby
r3vDev has quit [Quit: Leaving.]
nowhere_man has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 260 seconds]
dionysus69 has quit [Ping timeout: 260 seconds]
tau has quit [Remote host closed the connection]
tau has joined #ruby
tau has quit [Remote host closed the connection]
davidmichaelkarr has joined #ruby
hahuang65 has joined #ruby
tau has joined #ruby
tau has quit [Remote host closed the connection]
brent__ has joined #ruby
tau has joined #ruby
nb_bez___ has joined #ruby
pier has quit [Quit: pier]
workmad3 has joined #ruby
justbleed has joined #ruby
hahuang65 has quit [Ping timeout: 260 seconds]
rohitpaulk has quit [Ping timeout: 255 seconds]
__Yiota has joined #ruby
pawandubey has joined #ruby
conta has quit [Ping timeout: 260 seconds]
tau has quit [Remote host closed the connection]
skweek has joined #ruby
tau has joined #ruby
hutch34 has quit [Quit: WeeChat 1.5]
xzhao has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawelbx has joined #ruby
<pawelbx>
is there a way to check if a range is unbounded?
Rodya_ has quit [Remote host closed the connection]
tatey has joined #ruby
rohitpaulk has joined #ruby
rubylegend2092 has joined #ruby
<rubylegend2092>
Hi guys
<rubylegend2092>
Can you please help with a problem that I'm having.
DaniG2k has joined #ruby
skweek has quit [Ping timeout: 276 seconds]
amclain has joined #ruby
wlanboy has quit [Ping timeout: 268 seconds]
<rubylegend2092>
I'm trying to build an activerecord relationship between 3 models. I have a user model and a business user model. I would like to give the user the ability to leave a review on the ReviewModel linked to the business user. What kind of relationship would you establish for that?
<ljarvis>
?rails rubylegend2092
<ruby[bot]>
rubylegend2092: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
Serpent7776 has quit [Quit: Leaving]
workmad3 has quit [Ping timeout: 260 seconds]
Wsewolod has quit [Ping timeout: 260 seconds]
<rubylegend2092>
#RubyOnRails
rubylegend2092 has quit [Remote host closed the connection]
gusrub has quit [Remote host closed the connection]
gusrub has joined #ruby
bkxd__ has quit [Read error: Connection reset by peer]
bkxd___ has quit [Read error: Connection reset by peer]
bkxd has joined #ruby
djbjd has quit [Quit: djbjd]
montanonic has quit [Ping timeout: 260 seconds]
Kug3lis is now known as Kug3lis_off
bkxd_ has joined #ruby
ddddddd has quit [Ping timeout: 260 seconds]
hutch34 has joined #ruby
djbjd has joined #ruby
<rubylegend2092>
Alright, I managed to get registered to the IRC.
<Zarthus>
excellent job
conta has joined #ruby
<mikecmpbll>
that is a fine choice of alias, sir.
karlding_ is now known as karlding
muelleme_ has joined #ruby
<rubylegend2092>
What I'm having an issue with, is how I should set a relationship up between 3 models. I have a BusinessUser model, a User model and a BusinessReview model. How can I allow the user to create/update/delete/read business reviews on the BusinessReview model. But still have a reference to the BusinessUser Model (for tracking purposes) ActiveRecord
cdg has joined #ruby
<rubylegend2092>
If you have a better approach. Please let me know.
cam27 has quit [Quit: cam27]
jaruga_________ has joined #ruby
cdg has quit [Read error: Connection reset by peer]
r3vDev has quit [Quit: Leaving.]
cdg has joined #ruby
JustTheDoctor has joined #ruby
jaruga________ has quit [Ping timeout: 240 seconds]
valentin has joined #ruby
vali has quit [Read error: Connection reset by peer]
cdg has quit [Read error: Connection reset by peer]
cdg has joined #ruby
DaniG2k has quit [Quit: leaving]
mim1k has joined #ruby
ddddddd has joined #ruby
mikecmpbll has quit [Ping timeout: 240 seconds]
jaruga_________ has quit [Client Quit]
muelleme_ has quit [Ping timeout: 255 seconds]
Wsewolod has joined #ruby
kies has quit [Ping timeout: 240 seconds]
im0nde has quit [Ping timeout: 268 seconds]
cadillac__ has joined #ruby
lxsameer has quit [Quit: WeeChat 1.7]
meshsmith has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
cadillac_ has quit [Ping timeout: 260 seconds]
cadillac__ is now known as cadillac_
ltem has quit [Quit: Leaving]
tgragnato has joined #ruby
balazs has joined #ruby
pawandubey has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jinie has quit [Remote host closed the connection]
jinie has joined #ruby
meshsmith has quit [Remote host closed the connection]
ResidentBiscuit has quit [Quit: Critical Miss]
PaulCapestany has joined #ruby
Cohedrin_ has quit [Read error: Connection reset by peer]
jottr has quit [Ping timeout: 240 seconds]
Cohedrin_ has joined #ruby
<amperry>
hi folks, I'm trying to connect to a postgresql db using the PG gem, but I need to be able to create a schema (in the postgresql sense of the word) and set my search_path to it.
<amperry>
I'm reading a file of psql commands into an array, the first of which are 'create schema if not exists #{legacydb};' and 'set search_path to #{legacydb};' I've already created one schema manually, so the 'if not exists' should guard against creating it.
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
<amperry>
As for the second command, my script seems to execute it, but when I go to execute other commands (e.g. 'insert into "TABLE NAME" ...'), I get the error 'relation "TABLE NAME" does not exist', even though it does, in the #{legacydb} schema.
<amperry>
I'm guessing, therefore, that I'm not really altering my search_path, or at least, the change doesn't persist between commands.
<amperry>
sooo... I guess the question is, is there something that needs to be done to persist the search_path in the same connection, but between commands?
jackjackdripper has joined #ruby
justbleed has quit [Ping timeout: 246 seconds]
__Yiota has joined #ruby
rgr_ has quit [Ping timeout: 276 seconds]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
jak has quit [Remote host closed the connection]
tau has quit [Remote host closed the connection]
jak has joined #ruby
tau has joined #ruby
jak has quit [Client Quit]
jak has joined #ruby
dh64 has quit [Quit: Konversation terminated!]
roamingdog has joined #ruby
bkxd has quit [Read error: Connection reset by peer]
bkxd_ has quit [Read error: Connection reset by peer]
im0nde has joined #ruby
justbleed has joined #ruby
chouhoulis has quit [Remote host closed the connection]
workmad3 has joined #ruby
troys is now known as troys_
troys_ is now known as troys
cam27 has joined #ruby
bkxd has joined #ruby
dionysus69 has quit [Ping timeout: 268 seconds]
knight33 has joined #ruby
workmad3 has quit [Quit: Lost terminal]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bkxd_ has joined #ruby
Dimik has quit [Ping timeout: 260 seconds]
BSaboia has quit [Read error: Connection reset by peer]
meshsmith has joined #ruby
TessierAshpool has quit [Quit: leaving]
nb_bez____ has joined #ruby
hutch34 has quit [Quit: WeeChat 1.5]
Fernando-Basso has quit [Quit: WeeChat 1.9]
ahrs has quit [Remote host closed the connection]
ahrs has joined #ruby
wilbert has quit [Ping timeout: 260 seconds]
agent_white has quit [Quit: brbsec]
agent_white has joined #ruby
amperry has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
patarr has quit [Ping timeout: 276 seconds]
hahuang65 has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
<clemens3>
first time i learn about search_path, seems to be a feature better living without
<clemens3>
never needed it, and if you need it, i don-t know, maybe ur not clear about what you really need / but that-s me..
psychicist__ has quit [Ping timeout: 260 seconds]
ur5us has quit [Ping timeout: 240 seconds]
roamingdog has quit [Remote host closed the connection]
fusta has quit [Quit: Leaving]
hkdsun has quit [Read error: Connection reset by peer]
<amperry>
hi folks, I'm trying to use the 'pg' gem to read and execute a bunch of sql (postrgresql) commands from one or more files. I've determined that when I make the connection I am the right user with the right password, and I've also confirmed that I'm in the right schema. But, no matter what table I try to insert data into, I get the error 'relation "TABLE" not found'. Even though I can confirm its existence in the psql client. Any ideas
<amperry>
why this might happen?
<amperry>
correction, the error is 'relation "TABLE" does not exist'
<pabs>
i'm guessing you've got the table name quoted in your query, a double-quoted identifier in postgres is case-sensitive
<pabs>
so if your table is literally named table (lower case), and you're trying to query "TABLE", it won't find it
<amperry>
they're uppercase, which is why I have the double quotes
<amperry>
it happens regardless of the actual table name, too (although I haven't tried it on a lowercase table... let me check that).
<pabs>
remove the double quotes from the name, that's what i'm trying to tell you
<pabs>
or fix the case
<pabs>
look:
<pabs>
> create table asdf as select generate_series as a from generate_series(1, 5); select count(*) from "ASDF"; select count(*) from asdf;
<pabs>
SELECT 5
<pabs>
ERROR: relation "ASDF" does not exist
<pabs>
LINE 1: select count(*) from "ASDF";
<pabs>
^
<pabs>
count
jak has quit [Remote host closed the connection]
<pabs>
-------
<pabs>
5
<pabs>
(1 row)
jak has joined #ruby
<pabs>
notice how the first query (the one with the double quoted relation name) fails with the exact same error you're seeing?
<amperry>
the table names are given, and I've tried with and without quotes
Pepu has joined #ruby
rgs_ is now known as rgs
chimkan has joined #ruby
thatsnotjack has quit [Quit: WeeChat 1.7]
<pabs>
amperry: the only things i can think of are your search path might be different, and/or the account your code is connecting as doesn't have the proper permissions to see the table
<pabs>
amperry: but i suspect it's the double quotes
<amperry>
is there no way to make the pg gem work with a table name that's all uppercase?
Patadas has quit [Ping timeout: 240 seconds]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<amperry>
yeah, I've verified the user has permissions and I'm in the correct schema; I can query the tables from within a psql terminal client.
<pabs>
amperry: it's the double quotes around the table name in the query itself, not the pg gem
Azure|dc has joined #ruby
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<amperry>
how do you get postgresql to recognize an all-capital table name without quoting it? The tables pre-exist so I can't rename them.
<pabs>
identifiers are case-insensitive in postgres unless they are double-quoted in the query string, so you need to remove the double quotes in the query string itself
Azure has quit [Ping timeout: 246 seconds]
<pabs>
if you've got 'select count(*) from "TABLE"', it should be changed to 'select count(*) from table'
<amperry>
same error, only now in lowercase; the table in question is OCCUPANTS, so (without the double quotes), I get 'ERROR: relation "occupants" does not exist'.
railswebdev has joined #ruby
<amperry>
with them, I get 'ERROR: relation "OCCUPANTS" does not exist'
<pabs>
if that's the case then it could be a search path issue
<amperry>
possible, but by everything I can check, it's the right search_path, the right user credentials, and the right permissions.
<pabs>
it would help if you could paste the actual query and/or the code that you're using (as a gist or whatever)