<rubyconfused>
the ruby interpreter gives me this: syntax error, unexpected ')', expecting => (SyntaxError)
<rubyconfused>
for line 14 and 21
zacts has joined #ruby
<rubyconfused>
running it through rubocop gives the following: E: unexpected token tRPAREN (Using Ruby 2.1 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)
<rubyconfused>
any help would be greatly appreciated
<mvensky>
try cutting out blocks first
<mvensky>
then adding back to find error
jak has quit [Remote host closed the connection]
jak has joined #ruby
cschneid_ has quit [Read error: Connection reset by peer]
cschneid_ has joined #ruby
<rubyconfused>
mvensky: I have identified the offending line
<rubyconfused>
it is line 14
<rubyconfused>
removing it fixes things
<rubyconfused>
but it still doesn't explain why
<rubyconfused>
I can't figure out why that particular line is bad
<mkaito>
mvensky: **s3_options
<mkaito>
that doesn't fix the syntax error
<mvensky>
interesting; perhaps the S3.new does not like the **s3_options
<mkaito>
but it's how it should be. you'll want to splat the hash in there.
domgetter has joined #ruby
<rubyconfused>
what does splatting it do?
<mkaito>
it turns the hash into keyword arguments, kinda
w0b has joined #ruby
<mkaito>
I'm not a fan of putting that kind of syntax on an introduction of any kind, but shrine does it.
<mkaito>
after putting the hash before the Shrine.storages call in the else branch and splatting the hash in the other branch, rubocop does no longer scream at me for that gist.
<rubyconfused>
I did that and I am not getting this: W: Useless assignment to variable - `s3_options`.
<rubyconfused>
for the first conditional
<mkaito>
s/not/now/?
<rubyconfused>
yes
<mkaito>
in the true branch?
<rubyconfused>
in line 3
<rubyconfused>
yes
<mkaito>
it's not useless unless you mistyped the variable name
<mkaito>
that said, there's no point in making a separate hash if you only use those options once
<rubyconfused>
a bit of context: I am debugging this because dokku is unable to build my project due to line 21 getting nil hash errors
<mkaito>
that's useful if you want the same options for cache and store
<texasmynsted>
is there not a #rails channel?
<rubyconfused>
this is not ...quite rails
<mkaito>
well that's because you're using the variable before declaring it
<mkaito>
texasmynsted: his problem is clearly ruby... even if he's using it for rails. as in, he doesn't know that he needs to declare a variable before using it :P
<texasmynsted>
what server should I use in order to take fully advantage of multi-threading of JRuby? Can this be the same as the server used for C-Ruby?
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
_whitelogger has joined #ruby
FastJack has quit [Ping timeout: 258 seconds]
nofxxxx has joined #ruby
Dimik has quit [Ping timeout: 248 seconds]
nofxxx has quit [Ping timeout: 240 seconds]
_main_ has joined #ruby
_main_ has quit [Read error: Connection reset by peer]
__main__ has quit [Read error: Connection reset by peer]
_main_ has joined #ruby
yeticry_ has joined #ruby
_main_ has quit [Read error: Connection reset by peer]
__main__ has joined #ruby
FastJack has joined #ruby
yeticry has quit [Ping timeout: 240 seconds]
jottr_ has joined #ruby
conta has joined #ruby
TheBloke has joined #ruby
jottr_ has quit [Ping timeout: 248 seconds]
jak has quit [Remote host closed the connection]
jak has joined #ruby
ddddddd has joined #ruby
zacts has quit [Ping timeout: 255 seconds]
bkxd_ has quit [Ping timeout: 276 seconds]
bkxd has quit [Ping timeout: 276 seconds]
charliesome has joined #ruby
zacts has joined #ruby
PaulCape_ has quit [Read error: Connection reset by peer]
PaulCapestany has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
MarkBilk has joined #ruby
MarkBilk__ has quit [Ping timeout: 258 seconds]
chmurifree has quit [Ping timeout: 240 seconds]
unshadow has quit [Quit: leaving]
domgetter has quit [Ping timeout: 240 seconds]
alex`` has quit [Quit: WeeChat 1.8]
alex`` has joined #ruby
snowcrshd has joined #ruby
snowcrshd has quit [Ping timeout: 246 seconds]
chmurifree has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alex`` has quit [Quit: WeeChat 1.8]
jottr_ has joined #ruby
Fysicus has quit [Quit: The Truth Is Just An Excuse For A Lack Of Imagination]
charliesome has joined #ruby
sleepee has joined #ruby
muelleme_ has joined #ruby
milardovich has joined #ruby
jottr_ has quit [Ping timeout: 260 seconds]
latemus has joined #ruby
alex`` has joined #ruby
Dreamer3 has quit [Quit: Computer has gone to sleep.]
Dreamer3 has joined #ruby
latemus_ has joined #ruby
latemus has quit [Ping timeout: 268 seconds]
marr has joined #ruby
mattpotter has joined #ruby
bkxd has joined #ruby
bkxd_ has joined #ruby
montanonic has quit [Ping timeout: 276 seconds]
bkxd_ has quit [Ping timeout: 246 seconds]
bkxd has quit [Ping timeout: 246 seconds]
bkxd has joined #ruby
bkxd has quit [Ping timeout: 255 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
snowcrshd has joined #ruby
charliesome has joined #ruby
snowcrshd has quit [Ping timeout: 255 seconds]
andrzejku has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
yepobebot has quit [Read error: Connection reset by peer]
ascarter has joined #ruby
ResidentBiscuit has joined #ruby
ascarter has quit [Ping timeout: 260 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ResidentBiscuit has quit [Ping timeout: 246 seconds]
Fernando-Basso has joined #ruby
hnanon_ has joined #ruby
<hnanon_>
I have a string that I want to sequentially append numbers to. Is a regex the simplest way? For example:
<hnanon_>
where I look for a "-" in the atring, if it exists, extract the number, convert it to an integer, add one to it, convert it to a string, then append it?
troulouliou_div2 has joined #ruby
_whitelogger has joined #ruby
mattpotter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
perniciouscaffei has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<muelleme_>
did you try .next on your string?
scott4000_ is now known as scott4000
<muelleme_>
depending on how exactly your string looks like, that might already do the trick
jottr_ has joined #ruby
charliesome has joined #ruby
nOwz has joined #ruby
jak has quit [Remote host closed the connection]
jak has joined #ruby
jottr_ has quit [Ping timeout: 248 seconds]
<hnanon_>
muelleme: The string looks like "234253"
<hnanon_>
All numbers, in other words.
jottr_ has joined #ruby
Fernando-Basso has quit [Quit: WeeChat 1.9]
<hnanon_>
Oh, wow. .next does indeed work.
<hnanon_>
Thank you.
nicolai86_ has quit [Remote host closed the connection]
nicolai86 has joined #ruby
mtkd has quit [Ping timeout: 260 seconds]
PaulCapestany has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
PaulCape_ has joined #ruby
bkxd_ has joined #ruby
quobo has joined #ruby
mtkd has joined #ruby
yepobebot has joined #ruby
mtkd has quit [Ping timeout: 248 seconds]
mtkd has joined #ruby
snowcrshd has joined #ruby
hnanon_ has quit [Quit: Page closed]
snowcrshd has quit [Ping timeout: 255 seconds]
_whitelogger has joined #ruby
andrzejku has joined #ruby
lxsameer has joined #ruby
_whitelogger has joined #ruby
_whitelogger has joined #ruby
conta has quit [Ping timeout: 240 seconds]
alex`` has quit [Quit: WeeChat 1.8]
_whitelogger has joined #ruby
dionysus69 has quit [Ping timeout: 248 seconds]
antgel has quit [Ping timeout: 260 seconds]
uZiel has quit [Ping timeout: 248 seconds]
conta has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
yepobebot has quit [Ping timeout: 260 seconds]
bkxd_ has quit [Ping timeout: 268 seconds]
uZiel has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
snowcrshd has joined #ruby
snowcrshd has quit [Remote host closed the connection]
snowcrshd has joined #ruby
conta has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
jak has quit [Remote host closed the connection]
jak has joined #ruby
agent_white has quit [Quit: bai]
sleepee has quit [Ping timeout: 268 seconds]
vuoto has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
isBEKaml has joined #ruby
yepobebot has joined #ruby
jottr_ has quit [Ping timeout: 248 seconds]
djbkd has joined #ruby
isBEKaml has quit [Ping timeout: 240 seconds]
cadillac_ has joined #ruby
alex`` has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
romankapitonov has joined #ruby
jottr_ has joined #ruby
ResidentBiscuit has joined #ruby
minimalism has quit [Quit: minimalism]
ResidentBiscuit has quit [Ping timeout: 246 seconds]
sleepee has joined #ruby
minimalism has joined #ruby
uZiel has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
yepobebot has quit [Quit: Leaving]
romankapitonov has quit [Read error: Connection reset by peer]
mathys has joined #ruby
antgel has joined #ruby
<lxsameer>
hey folk, is there any one who used webpacker gem before ? I like to know about your experience with it
mattp__ has joined #ruby
Harzilein has joined #ruby
romankapitonov has joined #ruby
my123 has joined #ruby
my123 has joined #ruby
my123_ has quit [Ping timeout: 255 seconds]
snowcrshd has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
griffindy has joined #ruby
jak has quit [Remote host closed the connection]
jak has joined #ruby
mathys has quit [Quit: Leaving]
ledestin has joined #ruby
snowcrshd has joined #ruby
jak_ has joined #ruby
jak has quit [Read error: Connection reset by peer]
shinnya has quit [Ping timeout: 260 seconds]
mattp__ has quit [Ping timeout: 255 seconds]
snowcrshd has quit [Ping timeout: 240 seconds]
tgragnato has joined #ruby
chouhoulis has joined #ruby
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
DoubleMalt has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conta has quit [Ping timeout: 268 seconds]
marr has quit [Ping timeout: 240 seconds]
mathys has quit [Quit: Leaving]
my123 has joined #ruby
my123 has quit [Changing host]
my123 has joined #ruby
V1s1ble has joined #ruby
V1s1ble has joined #ruby
V1s1ble has quit [Changing host]
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
dionysus69 has quit [Quit: dionysus69]
jak_ has quit [Remote host closed the connection]
jak_ has joined #ruby
rohitpaulk has joined #ruby
uZiel has joined #ruby
cam27 has quit [Quit: cam27]
sleepee has joined #ruby
brent__ has joined #ruby
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
eljimmy has joined #ruby
eljimmy has quit [Remote host closed the connection]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
zacts has quit [Ping timeout: 246 seconds]
yosafbridge has quit [Quit: Leaving]
cseder has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gothicsouth has joined #ruby
xrlk has joined #ruby
yosafbridge has joined #ruby
brent__ has quit [Remote host closed the connection]
cseder has joined #ruby
wilbert_ has quit [Ping timeout: 248 seconds]
zacts has joined #ruby
dcunit3d has joined #ruby
ascarter has joined #ruby
PaulCape_ has quit [Quit: .]
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
djbkd has quit [Remote host closed the connection]
ascarter has quit [Ping timeout: 240 seconds]
snowcrshd has joined #ruby
snowcrshd has quit [Ping timeout: 240 seconds]
antgel has quit [Ping timeout: 255 seconds]
montanonic has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
conta has joined #ruby
isBEKaml has quit [Ping timeout: 268 seconds]
tgragnato_ has joined #ruby
tgragnato has quit [Ping timeout: 260 seconds]
jak_ has quit [Remote host closed the connection]
jak_ has joined #ruby
mnem is now known as mnemon
milardovich has quit [Remote host closed the connection]
rohitpaulk has quit [Ping timeout: 240 seconds]
Dimik has joined #ruby
brent__ has joined #ruby
uZiel has quit [Remote host closed the connection]
uZiel_ has joined #ruby
uZiel_ has quit [Ping timeout: 248 seconds]
DeeJayh has joined #ruby
__Yiota has joined #ruby
shinnya has quit [Ping timeout: 240 seconds]
brent__ has quit [Remote host closed the connection]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
griffindy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conta has quit [Ping timeout: 248 seconds]
Renich has joined #ruby
antgel has joined #ruby
perniciouscaffei has joined #ruby
Renich has quit [Ping timeout: 255 seconds]
domgetter has joined #ruby
Renich has joined #ruby
andikr has joined #ruby
sleepee has quit [Ping timeout: 268 seconds]
antgel has quit [Ping timeout: 246 seconds]
snowcrshd has joined #ruby
johnny56_ has quit [Ping timeout: 264 seconds]
cyphase has quit [Ping timeout: 240 seconds]
nadir has quit [Quit: Connection closed for inactivity]
_sfiguser has joined #ruby
johnny56_ has joined #ruby
solocshaw has quit [Quit: solocshaw]
solocshaw has joined #ruby
gothicsouth has joined #ruby
marr has joined #ruby
im0nde has joined #ruby
aruns has joined #ruby
jak_ has quit [Remote host closed the connection]
jak_ has joined #ruby
<aruns>
Hey guys, I'm looking into using Ruby as a templating language for a simple HTML site I'm working on, was wondering if you guys had any recommendations for libraries I could use to embed my Ruby code in HTML templates without using Rails.
<lupine>
it's called erb. or maybe haml
<aruns>
I'm using Ruby 2.4.1 on Ubuntu 16.04, Webrick looks like it might be an option.
<aruns>
I tried Erb but it doesn't seem to work under Apache.
<aruns>
Guessing I need a server that's compatible with Ruby.
tgragnato_ has quit [Quit: Sto andando via]
montanonic has quit [Ping timeout: 240 seconds]
<Papierkorb>
aruns: Webrick is dog slow, you can use thin or puma instead. Also, there are other much smaller web frameworks than Rails, `sinatra` is popular, but I also want to recommend `roda` for that task. As templating language, sure there is erb, but I like `haml` much more.
<apeiros>
aruns: templating is only the part which converts text into other text, interpolating some variables and potentially control structures
<apeiros>
aruns: the thing you seem to be looking for is how to run ruby via a webserver, that goes way beyond templating.
<apeiros>
most common way is to use <any webserver> + rack + <any ruby backend>
<apeiros>
where <any webserver> is often puma, nginx+passenger or apache+passenger.
<apeiros>
and <any ruby backend> is often sinatra or rails. you can build a plain rack app too, though
meshsmith has joined #ruby
<apeiros>
as for the "templating engine" option (which would be part of the <any backend>): slim, haml and erb are common choices
DeeJayh has quit [Read error: Connection reset by peer]
<aruns>
Well I'm setting up a Docker container for it, I'll probably go for NGINX.
PaulCapestany has joined #ruby
andikr has quit [Ping timeout: 248 seconds]
KeyJoo has joined #ruby
<aruns>
Thanks, guys, I think I've got enough now for my setup.
xco has joined #ruby
<Papierkorb>
NGINX is really good, its HTTP Proxy stuff should work just fine
clemens3 has joined #ruby
solocshaw1 has joined #ruby
solocshaw has quit [Ping timeout: 255 seconds]
solocshaw1 is now known as solocshaw
<aruns>
Papierkorb: Yeah I wrote some URL rewrites in NGINX for a client site and found its syntax to be much cleaner than Apache's
milardovich has joined #ruby
<Papierkorb>
aruns: Not only that, it's also much much faster. to me it seems that apache has only limited use-cases left where it's better than other solutions, for other use-cases, go with NGINX
inukshuk_ has joined #ruby
milardovich has quit [Ping timeout: 260 seconds]
stryek_ has joined #ruby
learningRuby has joined #ruby
inukshuk_ has quit [Quit: leaving]
stryek has quit [Ping timeout: 260 seconds]
xco has quit [Quit: xco]
xco has joined #ruby
cyphase has joined #ruby
zacts has quit [Ping timeout: 246 seconds]
<learningRuby>
Question: The book “The Ruby Programming Language” says: ‘Chapter 4 covers primary expressions in Ruby—literals, variable references, method invocations, and assignments”. But how is a method invocation a primary expression? It seems to me that it's composed of several values/components: object, method, arguments. Can anyone explain?
zacts has joined #ruby
solocshaw has quit [Remote host closed the connection]
brent__ has joined #ruby
solocshaw has joined #ruby
Cohedrin_ has joined #ruby
solocshaw has quit [Remote host closed the connection]
ascarter has joined #ruby
brent__ has quit [Remote host closed the connection]
HoierM_ has joined #ruby
jaruga________ has joined #ruby
<ineb>
learningRuby: and why do you think a method invocation is a primary expression?
ascarter has quit [Ping timeout: 248 seconds]
__Yiota has joined #ruby
cpruitt has joined #ruby
solocshaw has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardovich has joined #ruby
cpruitt has quit [Quit: cpruitt]
petruff has joined #ruby
<learningRuby>
ineb: I don't think that, the book “The Ruby Programming Language” (by Matz and David Flanagan) seems to say so in the quote I gave above.
petruff has quit [Client Quit]
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
Cohedrin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
s1kx has joined #ruby
hfp_work has quit [Quit: bye]
milardovich has quit [Ping timeout: 248 seconds]
petruff has joined #ruby
<ineb>
i see
brent__ has joined #ruby
<learningRuby>
ineb: The way the book defines primary expression is like an ultimate expression, that don't have subexpressions. Maybe is there some method invocations that are like that? I don't know, but it doesn't seem so when I think about it. Or maybe that was a little mistake in the writing of the book. That's what I'm trying to figure out.
milardovich has joined #ruby
<learningRuby>
ineb: the book seems to be quite precise and well written.. and it had three authors collaborating on it, so I find unlikely to be a mistake.
wilbert_ has joined #ruby
doublemalt_ has quit [Quit: Leaving]
<ineb>
i see your point. method invocations theoretically could be composed by primary expressions you mentioned, yet there is no operator to do so and i think the book therefore is tagging it as primary expression
brent__ has quit [Remote host closed the connection]
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<learningRuby>
ineb: mmm I see. But the book doesn't seem to differentiate primary expressions from compound expressions based on operators. For example, see this quote from the book: “It is worth noting that many literals, such as numbers, are primary expressions—the simplest possible expressions not composed of simpler expressions. Other literals, such as array
<learningRuby>
and hash literals and double-quoted strings that use interpolation, include subexpressions and are therefore not primary expressions.” -> So, here as you see the book defines expressions as primary or compound based on whether it has sub expressions.
<learningRuby>
But then later it calls method invocations as being primary expressions, and it doesn't elaborate on it. So I'm confused.
quobo has joined #ruby
petruff has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
<ineb>
yes, but maybe my argument holds. for example string interpolations are no primary expression because they can be constructed with operators. 'i mean ' + ' like this.'. this holds true for hashes and arrays aswell. however, when it comes to method invocations, i can think of no way to do it with any operator
rubylegend2092 has joined #ruby
rubylegend2092 has quit [Remote host closed the connection]
rubylegend2092 has joined #ruby
astrobunny has joined #ruby
wilbert_ has quit [Quit: wilbert_]
kthibodeaux has joined #ruby
kthibodeaux has quit [Client Quit]
rubylegend2092 has quit [Remote host closed the connection]
rubylegend2092 has joined #ruby
fredlinhares has joined #ruby
montanonic has joined #ruby
brent__ has joined #ruby
astrobunny has quit [Ping timeout: 246 seconds]
psychicist__ has quit [Ping timeout: 248 seconds]
brent__ has quit [Remote host closed the connection]
rubylegend2092 has quit [Remote host closed the connection]
rubylegend2092 has joined #ruby
<fredlinhares>
Where can I find a tutorial about how to create a lexer in Ruby?
<rubylegend2092>
#rubyonrails
BTRE has quit [Read error: Connection reset by peer]