<havenwood>
skwurl: Yes. I tried to show an example with initializing state, but didn't implement #name and #skills like your example.
<havenwood>
skwurl: If you added those methods, which printed the same output as your example (#to_s as well) - you'd have something working that preserved state between method calls.
MoritaShinobu has joined #ruby
<havenwood>
skwurl: The instance variables are what stick around between method calls.
<havenwood>
skwurl: @name and @skills
<havenwood>
skwurl: Adding to the bottom of your codeshare...
aupadhye has joined #ruby
Puffball has quit [Remote host closed the connection]
Puffball has joined #ruby
<havenwood>
skwurl: Let me know if any of my comments in the codeshare don't make sense or if you'd like me to expound.
<skwurl>
makes sense. theres a couple things ive seen before but havent learned about yet. Your approach really minimizes redundancies
ramfjord has joined #ruby
<skwurl>
im finding there are alot of options to do things.
ramfjord has quit [Ping timeout: 252 seconds]
skwurl has quit [Quit: WeeChat 2.2]
lunarkitty7 has quit [Ping timeout: 252 seconds]
marz_d`ghostman has joined #ruby
<marz_d`ghostman>
Is it possible to stub a gem I am using in my script?
<marz_d`ghostman>
for rspec testing?
<baweaver>
Yes, but why?
yokel has quit [Remote host closed the connection]
yokel has joined #ruby
venmx has quit [Ping timeout: 245 seconds]
<marz_d`ghostman>
baweaver: How? I'm currently using double, doesn't seem to be working though. I'm trying to test that my conditionals are working if the gem succeeds/fails.
<marz_d`ghostman>
hmmm, tried allow(Marz::Rsync).to receive(:run).with(any_args).and_yield(result), but output doesn't seem to be stubbed
<marz_d`ghostman>
oh my bad, it is
wildermind has joined #ruby
lxsameer has joined #ruby
alem0lars has joined #ruby
alem0lars has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
jp has quit [Ping timeout: 260 seconds]
<marz_d`ghostman>
Does Rspec.describe run any methods prior to the test? I have a puts method inside my class and it seems to be invoked before the tests
jp has joined #ruby
<tbuehlmann>
marz_d`ghostman: it's plain inside the class? then it's executed when the class is loaded
<tbuehlmann>
uh, no, that method shouldn't be called by rspec before your examples
<marz_d`ghostman>
cause puts result.output is invoked apparently
ramfjord has joined #ruby
nowhere_man has joined #ruby
ramfjord has quit [Ping timeout: 244 seconds]
jetchisel has joined #ruby
ReporterMan has joined #ruby
<zxq2>
rspec is like broken english
<zxq2>
don't know why it attempts to mimic a natural language
<zxq2>
readability isn't gained
phaul has joined #ruby
<zxq2>
the little readability that's gained is bought with an awkward syntax, which makes writing a pain
<tbuehlmann>
cool
Spitfire has joined #ruby
<phaul>
rspec isn't for everyone. some love it. some don't. I do.
<phaul>
but I agree that not fully understanding whats a method call there, what expect gives back, why matchers are chainable, or what runs when, makes it really a false promise
<phaul>
dangerous too. You can easily write something that runs and passes but dooesn't test what you wanted
<phaul>
but.., if you know how to use it, it becomes productive. at least for me
arekushi has quit [Quit: Gateway shutdown]
nowhere_man has quit [Ping timeout: 272 seconds]
ReporterMan has quit [Read error: Connection reset by peer]
Reporter_ has joined #ruby
johnny56 has joined #ruby
ikbenhet has joined #ruby
lxsameer has quit [Ping timeout: 260 seconds]
SanguineAnomaly has quit [Ping timeout: 260 seconds]
SanguineAnomaly has joined #ruby
za1b1tsu has quit [Ping timeout: 252 seconds]
Reporter_ has quit [Quit: ragequit]
bijan_ has joined #ruby
arekushi has joined #ruby
lunarkitty7 has quit [Ping timeout: 252 seconds]
bijan_ has quit []
za1b1tsu has joined #ruby
za1b1tsu has quit [Ping timeout: 244 seconds]
xfbs has joined #ruby
mister_solo has joined #ruby
mister_solo has quit [Client Quit]
mister_solo has joined #ruby
mister_solo has quit [Client Quit]
lxsameer has joined #ruby
vonfry has joined #ruby
za1b1tsu has joined #ruby
lxsameer has quit [Ping timeout: 272 seconds]
ikbenhet has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
za1b1tsu has quit [Ping timeout: 246 seconds]
apeiros_ has joined #ruby
aufi has quit [Remote host closed the connection]
aufi has joined #ruby
lxsameer has joined #ruby
ramfjord has joined #ruby
apeiros_ has quit [Ping timeout: 276 seconds]
kent\n has quit [Ping timeout: 244 seconds]
apeiros_ has joined #ruby
ramfjord has quit [Ping timeout: 268 seconds]
apparition has joined #ruby
lxsameer has quit [Ping timeout: 246 seconds]
kurko_ has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
apeiros has joined #ruby
apeiros_ has quit [Ping timeout: 250 seconds]
nowhere_man has joined #ruby
esrse has quit [Ping timeout: 252 seconds]
lxsameer has joined #ruby
koensw has joined #ruby
DTZUZO_ has joined #ruby
mister_solo has joined #ruby
ikbenhet has joined #ruby
lxsameer has quit [Ping timeout: 244 seconds]
vonfry has quit [Quit: WeeChat 2.2]
rivalomega has quit [Remote host closed the connection]
<ruby[bot]>
bhaak: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
Pupeno_ has joined #ruby
<bhaak>
na, broken
<bhaak>
but the explanation is in the documentation of iso8601
crankharder has joined #ruby
<bhaak>
"alias for xmlschema" and under xmlschema: "Parses date as a dateTime defined by the XML Schema and converts it to a Time object. The format is a restricted version of the format defined by ISO 8601."
<bhaak>
_restricted_
<apeiros>
bhaak: Date.iso8601 if you don't have a time part
<apeiros>
and the above error with the bot is sadly http://eval.in being broken
<apeiros>
personally I'd consider it correct if Time.iso8601("2007-01-01") would be treated as 2007-01-01T00:00:00 in local time. apparently ruby sees that differently.
mister_solo has quit [Quit: My ansible has gone to sleep. ZZZzzz…]
<Bish>
apeiros: but i don't know beforehand if i have a date part
<bhaak>
puts then you would get a Time object and not a Date object.
kapil____ has joined #ruby
<bhaak>
s/puts/but
<bhaak>
too much ruby
<Bish>
ruby - where method named after a standard, don't get you the standard
<Bish>
and i remember this being differently
mister_solo has joined #ruby
<Bish>
different*
<bhaak>
you might remember the parse method and not iso8601?
<apeiros>
Bish: uh, yeah, don't tell me it's difficult for you to test that :-p
nertzy has quit [Quit: This computer has gone to sleep]
Fusl has quit [Excess Flood]
<Bish>
bhaak: no, that code is super old
<Bish>
apeiros: well, there will always be testcases that slip through
<Bish>
like.. not testing a method that is named after an iso
Fusl has joined #ruby
<Bish>
maybe i should test if nil.nil?
nowhereman has joined #ruby
nowhereman is now known as Guest6910
nowhere_man has quit [Ping timeout: 268 seconds]
<bhaak>
I just tested it for 1.8.7, doesn't work either
<bhaak>
looking at the source code, the relevant method has been last changed in 2014. the regexp matches the input string even only in 2008
<apeiros>
Bish: you certainly should. also test 1 < 2 and "string".is_a?(String) for good measure
* apeiros
afk
apeiros has quit []
crankharder has quit [Ping timeout: 252 seconds]
lxsameer has quit [Ping timeout: 244 seconds]
lxsameer has joined #ruby
GodFather has quit [Ping timeout: 245 seconds]
ramfjord has joined #ruby
xfbs has quit [Quit: afk]
ramfjord has quit [Ping timeout: 252 seconds]
GodFather has joined #ruby
nertzy has joined #ruby
apeiros_ has joined #ruby
throwntall has quit [Remote host closed the connection]
throwntall has joined #ruby
meinside has quit [Quit: Connection closed for inactivity]
bsrd has joined #ruby
whysthatso has left #ruby [#ruby]
venmx has quit [Ping timeout: 250 seconds]
ikbenhet has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
whysthatso has joined #ruby
whysthatso has quit [Remote host closed the connection]
knight33 has joined #ruby
<bsrd>
Hey I've a puma server running a grape API. We've just had a down and unresponsive period because our logger died. I'm thinking about just offloading to a new thread whenever we log something and continue without calling join or value, so reponses are made regardless of whether the log is alive or not. Has anyone experience with that?
crankharder has joined #ruby
aupadhye has quit [Ping timeout: 252 seconds]
whysthatso has joined #ruby
nertzy has quit [Quit: This computer has gone to sleep]
aupadhye has joined #ruby
deathwishdave has joined #ruby
ikbenhet has joined #ruby
apeiros_ has quit [Remote host closed the connection]
uplime has quit [Ping timeout: 244 seconds]
rivalomega has joined #ruby
rivalomega has quit [Remote host closed the connection]
apeiros_ has joined #ruby
justicefries has joined #ruby
apeiros_ has quit [Remote host closed the connection]
<darix>
bsrd: log to something like a message bus and feed your real log destination from there
lxsameer has quit [Ping timeout: 252 seconds]
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
marz_d`ghostman has quit [Quit: Page closed]
lxsameer has joined #ruby
mixfix41 has quit [Ping timeout: 252 seconds]
crankhar1er has joined #ruby
mister_solo has quit [Quit: So long, and thanks for all the fish!]
Xiti has quit [Ping timeout: 252 seconds]
Xiti has joined #ruby
mixfix41 has joined #ruby
Xiti has quit [Ping timeout: 252 seconds]
Xiti has joined #ruby
jetchisel has quit [Ping timeout: 272 seconds]
<bsrd>
darix: Thanks! sucker_punch gem seems to be the solution I want.
jetchisel has joined #ruby
vondruch has quit [Ping timeout: 268 seconds]
vondruch has joined #ruby
<darix>
just feeding into sidekiq would be one way yes
Guest6910 has quit [Ping timeout: 260 seconds]
ramfjord has joined #ruby
discopatrick has joined #ruby
phaul has joined #ruby
ramfjord has quit [Ping timeout: 250 seconds]
rivalomega has joined #ruby
marmotini has quit [Ping timeout: 250 seconds]
venmx has joined #ruby
MoritaShinobu has quit [Ping timeout: 260 seconds]
nowhere_man has joined #ruby
Rapture has joined #ruby
apparition has quit [Quit: Bye]
knight33 has joined #ruby
Dbugger has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
Tuor has quit [Ping timeout: 245 seconds]
whysthatso has quit [Quit: whysthatso]
MoritaShinobu has joined #ruby
dbugger_ has joined #ruby
aupadhye has quit [Quit: Leaving]
marmotini_ has joined #ruby
crankharder has quit [Quit: leaving]
kurko__ has joined #ruby
crankharder has joined #ruby
kurko_ has quit [Ping timeout: 244 seconds]
Inline has quit [Disconnected by services]
Fusl has quit [Ping timeout: 256 seconds]
koensw has quit [Remote host closed the connection]
knight33 has quit [Ping timeout: 272 seconds]
planigan_ has joined #ruby
za1b1tsu has quit [Ping timeout: 252 seconds]
elomatreb_ has joined #ruby
ablackack_ has joined #ruby
kurko_ has joined #ruby
kurko__ has quit [Ping timeout: 250 seconds]
Dbugger has quit [*.net *.split]
Rapture has quit [*.net *.split]
crankhar1er has quit [*.net *.split]
wildermind has quit [*.net *.split]
fluxAeon has quit [*.net *.split]
elomatreb has quit [*.net *.split]
KazeFX has quit [*.net *.split]
Dark_Arc has quit [*.net *.split]
jmcgnh has quit [*.net *.split]
planigan has quit [*.net *.split]
baweaver has quit [*.net *.split]
cgfbee has quit [*.net *.split]
devyn has quit [*.net *.split]
Cork has quit [*.net *.split]
maxmanders has quit [*.net *.split]
mniip has quit [*.net *.split]
jtdowney has quit [*.net *.split]
hurricanehrndz has quit [*.net *.split]
S007 has quit [*.net *.split]
ablackack has quit [*.net *.split]
helpa has quit [Ping timeout: 252 seconds]
WebDawg has quit [Ping timeout: 252 seconds]
michael_mbp has quit [Ping timeout: 252 seconds]
marmotini_ has quit [Ping timeout: 252 seconds]
cgfbee has joined #ruby
WebDawg has joined #ruby
jtdowney has joined #ruby
xfbs has joined #ruby
roshanavand has quit [Ping timeout: 272 seconds]
chouhoulis has joined #ruby
wildermind has joined #ruby
michael_mbp has joined #ruby
maxmanders_ has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
marmotini_ has joined #ruby
za1b1tsu has joined #ruby
millerti has joined #ruby
Bish has quit [Ping timeout: 246 seconds]
venmx has quit [Ping timeout: 252 seconds]
leafyleong has quit [Ping timeout: 252 seconds]
aufi has quit [Ping timeout: 245 seconds]
mikecmpbll has joined #ruby
leafyleong has joined #ruby
justicefries has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros>
they don't write a NEWS file for the changes? :(
reber has quit [Remote host closed the connection]
marmotini_ has joined #ruby
rivalomega has joined #ruby
ellcs has joined #ruby
marmotini_ has quit [Ping timeout: 246 seconds]
rivalomega has quit [Remote host closed the connection]
rivalomega has joined #ruby
rivalomega has quit [Read error: Connection reset by peer]
rivalomega has joined #ruby
Mos has joined #ruby
ellcs has quit [Ping timeout: 272 seconds]
roshanavand has quit [Ping timeout: 272 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
dinfuehr has quit [Ping timeout: 268 seconds]
venmx has joined #ruby
dinfuehr has joined #ruby
lytol_ has joined #ruby
RedNifre has joined #ruby
<RedNifre>
hey there. What's a good gem for functional programming? (currying, partial application etc.)
<phaul>
haskell
* phaul
ducks :)
<RedNifre>
...
<RedNifre>
hey there. What's a good way to do regex matching and yaml config stuff in Haskell without having to declare records for all the yaml stuff?
<phaul>
well, you can't have eeverything
<RedNifre>
All I want is a lightweight way to do FP. haskell is too heavy for simple stuff.
<RedNifre>
Ruby is really nice except that I would like an easier way to do mappings. I don't want to use blocks when partially applied functions would also work.
<phaul>
have you looked at elixir?
<phaul>
that seems to be the hot stuff these days...
<RedNifre>
That's erlang with ruby syntax, right? Hm....
<phaul>
yeah
<RedNifre>
Well, I'm looking for a programmer friendly scripting language with a large and useful standard library. That's ruby.
<phaul>
RedNifre: I was just kidding at the beginning, but give elixir a go. They even have phoenix, which is supposed to be "their rails". Or if you are a purist there is haskell Strong static types, referential transparency.. Or if you dont care about trends and buzzwords - in my opinion - you can just use ruby :) And forget about the whole nonsense
<phaul>
but Ruby from the begining concepts wasn't built for being functional. You either OO or you either functional
dbugger_ has quit [Remote host closed the connection]
tdy has joined #ruby
<djellemah>
>> ->a,b{a+b}.curry[1][2] # RedNifre
<ruby[bot]>
djellemah: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<djellemah>
@_@
<djellemah>
=> 3
im0nde has joined #ruby
kapil____ has joined #ruby
drusepth has quit [Ping timeout: 252 seconds]
ramfjord has joined #ruby
orbyt_ has joined #ruby
r00twrh has joined #ruby
ellcs has joined #ruby
millerti has quit [Ping timeout: 252 seconds]
ur5us has joined #ruby
<RedNifre>
okay
<RedNifre>
Another thing, I'd like to put a regex in a yaml file. Is there a trick or do I just put it in there as a string and turn the string into a regex when I read the file?
ur5us has quit [Read error: Connection reset by peer]
nadir has quit [Quit: Connection closed for inactivity]
justicefries has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RedNifre>
The right side looks like a regex in a string, but what is !ruby/regexp ?
<baweaver>
Magic :D
<baweaver>
Read that stack exchange link right above it
<RedNifre>
wtf
<RedNifre>
okay, I'll have to look into that. Excellent! That's exactly what I need.
<baweaver>
So as far as functional programming, let us know what ya want to do
ramfjord has joined #ruby
<baweaver>
and we'll supply the bad ideas.
<RedNifre>
Basically everything that's possible in Haskell. I might be looking for a dynamically typed light weight Haskell like scripting language.
<RedNifre>
It looks like that doesn't exist and ruby is mostly great so it would be nice to make ruby more haskelly with a library or something.
eckhardt has joined #ruby
tdy has quit [Ping timeout: 252 seconds]
Mike11 has quit [Quit: Leaving.]
<phaul>
RedNifre: haskell is prretty far from ruby, and that's not saying that it's preferable in either direction. But having what haskell can in Ruby is just simply no-no
<phaul>
or the other way. what ruby can in haskell will never happen.
r00twrh has quit [Read error: Connection reset by peer]
ellcs has quit [Ping timeout: 272 seconds]
Mos has quit [Ping timeout: 244 seconds]
_kupo has quit [Quit: WeeChat 2.2]
orbyt_ has quit [Ping timeout: 244 seconds]
<phaul>
what I mean is that for instance to have "referential transparency" haskell had to give up variables and variable assignement. Any stateful language can't do that. In return they gained strong guaranties on behaviour..... but of course you can use baweeavers libs,.and when a haskellish syntax makes more sense in the domain, do so. I myself just started using Qo :) but Im afraid that doesnt make it what haskell
<phaul>
gives you
<RedNifre>
That's not a problem in practice though, if you don't use state in your code you can write haskelly code without the guarantees (you just have to make sure you obey the rules).
<RedNifre>
The thing is, Ruby seems to be the perfect light weight programmer friendly OOP language. Haskell seems to be the perfect (ignoring Idris) heavy weight serious professional awesome FP language. It looks like there is no perfect light weight programmer friendly FP language out there though. So how to write light weight fp code then?
wojnar has joined #ruby
marmotini_ has joined #ruby
whysthatso_ has quit [Quit: whysthatso_]
<SeepingN>
heavily
marmotini_ has quit [Ping timeout: 246 seconds]
marmotini_ has joined #ruby
pharma_joe has joined #ruby
orbyt_ has joined #ruby
nadir has joined #ruby
<baweaver>
The problem is that once people start using Haskell they're convinced that any other language is morally reprehensible to use.
<baweaver>
Whether that be pure FP concerns or type concerns, I've seen both
<baweaver>
Pragmatism trumps dogma. Use what works, and learn along the way what works best. There's no such thing as perfect code.
<baweaver>
Mind, I like Haskell, but some practitioners have almost a religious level of zealotry attached to it.
xfbs has quit [Quit: afk]
ramfjord has quit [Ping timeout: 252 seconds]
marmotini has joined #ruby
knight33 has joined #ruby
marmotini_ has quit [Ping timeout: 246 seconds]
sameerynho has quit [Ping timeout: 246 seconds]
Bacteria has joined #ruby
<Bacteria>
do you guys put user stuff into controller or model?
<phaul>
?rails
<ruby[bot]>
Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<phaul>
yay, it worked :)
<Bacteria>
yay
<phaul>
Bacteria: what's user stufff?
<phaul>
but I would say model....
<Bacteria>
i dont tryst u
<Bacteria>
is there any experts here
<phaul>
I'm totally agreeing I wouldnt trust myself either
07IAAJ8B3 is now known as emerson
<Bacteria>
damit
<Bacteria>
how can u betray me like this
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Dimik has joined #ruby
chouhoulis has quit [Ping timeout: 246 seconds]
venmx has quit [Ping timeout: 245 seconds]
ramfjord has joined #ruby
ellcs has joined #ruby
apeiros has quit [Remote host closed the connection]
justicefries has joined #ruby
Xiti has quit [Read error: Connection reset by peer]
Xiti has joined #ruby
snickers has joined #ruby
lxsameer has joined #ruby
fiachetti has joined #ruby
marmotini has quit [Read error: Connection reset by peer]
lxsameer has quit [Ping timeout: 268 seconds]
ellcs has quit [Ping timeout: 250 seconds]
marmotini_ has joined #ruby
<havenwood>
ruby-install --latest ruby
<havenwood>
rvm get head && rvm install ruby
<havenwood>
Ruby 2.5.2! ^
marmotini has joined #ruby
<phaul>
yay -Syu
<phaul>
pacman -Syu for some...
<havenwood>
phaul: i love Ruby arch packages are actually kept up-to-date
<miah>
everything is kept up to date =)
<lupine>
I love Ruby debian packages are actually kept stable + security fixes