ccooke has quit [Remote host closed the connection]
Capela has joined #ruby
interpolate has quit [Quit: interpolate]
arnonhongklay has joined #ruby
davidt has quit []
Capela_ has quit [Ping timeout: 244 seconds]
hutch34 has joined #ruby
ARCADIVS has joined #ruby
renderful has joined #ruby
hutch34 has quit [Ping timeout: 250 seconds]
cdg has joined #ruby
aeontech has joined #ruby
ccooke has joined #ruby
renderful has quit [Ping timeout: 252 seconds]
ziarkaen has joined #ruby
cdg has quit [Read error: Connection reset by peer]
Capela has quit [Read error: Connection reset by peer]
jcao219 has quit [Ping timeout: 268 seconds]
cdg has joined #ruby
Capela has joined #ruby
webguynow has quit [Ping timeout: 260 seconds]
railssmith has joined #ruby
cdg has quit [Remote host closed the connection]
webguynow has joined #ruby
ziarkaen has quit [Ping timeout: 260 seconds]
MrBusiness2 has joined #ruby
railssmith has quit [Client Quit]
alexherbo2 has quit [Ping timeout: 250 seconds]
MrBusiness3 has quit [Ping timeout: 250 seconds]
solocshaw has joined #ruby
Capela_ has joined #ruby
infernix has joined #ruby
ur5us has quit [Remote host closed the connection]
tdy has quit [Ping timeout: 260 seconds]
Capela has quit [Ping timeout: 244 seconds]
solocshaw has quit [Ping timeout: 260 seconds]
webguynow has quit [Ping timeout: 260 seconds]
webguynow has joined #ruby
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
audiodude has joined #ruby
charliesome has joined #ruby
<audiodude>
Does anyone use Unirest inside a Rails controller? Do I have to explicitly require it somewhere? uninitialized constant UserController::Unirest
<audiodude>
....and I realized that I made the classic mistake of asking a #rubyonrails question in #ruby
nankyokusei has joined #ruby
nbrogan has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gizmore has quit [Remote host closed the connection]
gizmore has joined #ruby
xall_ has quit [Ping timeout: 260 seconds]
tdy3 has quit [Read error: Connection reset by peer]
tdy3 has joined #ruby
evidex has joined #ruby
antgel has joined #ruby
evidex has quit [Ping timeout: 260 seconds]
nankyokusei has joined #ruby
zacts has joined #ruby
nankyokusei has quit [Ping timeout: 244 seconds]
mluts has quit [Quit: leaving]
codfection has quit [Remote host closed the connection]
timmow has quit [Ping timeout: 268 seconds]
ltd_ has quit [Ping timeout: 245 seconds]
Capela has joined #ruby
Jameser has joined #ruby
timmow has joined #ruby
ziarkaen has joined #ruby
blackbombay__ has joined #ruby
armyriad has quit [Ping timeout: 260 seconds]
_vy_ has left #ruby [#ruby]
Capela has quit [Ping timeout: 260 seconds]
ziarkaen has quit [Ping timeout: 250 seconds]
rrichardsr3 has joined #ruby
blackbombay__ has quit [Ping timeout: 244 seconds]
gizless has joined #ruby
gizmore has quit [Ping timeout: 260 seconds]
xall_ has joined #ruby
harai has joined #ruby
buglessdr2 has quit [Ping timeout: 244 seconds]
lxsameer has joined #ruby
tubuliferous has joined #ruby
rrichard_ has joined #ruby
benhoi has quit [Ping timeout: 260 seconds]
Dimik has quit [Ping timeout: 250 seconds]
toretore has joined #ruby
ltd has joined #ruby
rrichardsr3 has quit [Ping timeout: 268 seconds]
igniting has quit [Ping timeout: 252 seconds]
glebm has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hero has joined #ruby
anisha has joined #ruby
dnicole has joined #ruby
benhoi has joined #ruby
igniting has joined #ruby
buglessdr2 has joined #ruby
dnicole has quit [Ping timeout: 252 seconds]
Alina-malina_ has joined #ruby
wingwalker has quit [Quit: Leaving]
pawnbox has joined #ruby
LoneHerm_ has quit [Remote host closed the connection]
Alina-malina_ has quit [Changing host]
Alina-malina_ has joined #ruby
buglessdr2 has quit [Ping timeout: 268 seconds]
Alina-malina has quit [Ping timeout: 260 seconds]
vikaton has quit [Quit: Connection closed for inactivity]
chouhoulis has joined #ruby
the_drow has joined #ruby
chouhoulis has quit [Ping timeout: 260 seconds]
harfangk has joined #ruby
agent_white has quit [Quit: bai]
tdy4 has joined #ruby
tdy3 has quit [Ping timeout: 250 seconds]
ur5us has joined #ruby
Capela has joined #ruby
_whitelogger has joined #ruby
conta has joined #ruby
Capela has quit [Ping timeout: 260 seconds]
saneax-_-|AFK is now known as saneax
Ishido has joined #ruby
ziarkaen has joined #ruby
tdy has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
bocaneri has quit [Quit: Leaving]
Renich has joined #ruby
tdy4 has quit [Ping timeout: 256 seconds]
nankyokusei has joined #ruby
xall_ has quit [Ping timeout: 260 seconds]
ziarkaen has quit [Ping timeout: 260 seconds]
hero has quit [Ping timeout: 250 seconds]
User458764 has joined #ruby
nankyokusei has quit [Ping timeout: 252 seconds]
benhoi has quit [Ping timeout: 265 seconds]
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
saneax is now known as saneax-_-|AFK
benhoi has joined #ruby
A124 has joined #ruby
anisha_ has joined #ruby
marr has joined #ruby
Renich has quit [Quit: leaving]
firstdayonthejob has joined #ruby
anisha has quit [Ping timeout: 260 seconds]
Immune has quit [Ping timeout: 260 seconds]
Jackneill has joined #ruby
rajdesai has joined #ruby
pawnbox has quit [Remote host closed the connection]
bocaneri has joined #ruby
tubuliferous has quit [Ping timeout: 268 seconds]
rrichard_ has quit [Ping timeout: 252 seconds]
claudiuinberlin has joined #ruby
pawnbox has joined #ruby
lxsameer has quit [Ping timeout: 260 seconds]
jackjackdripper has quit [Quit: Leaving.]
rrichardsr3 has joined #ruby
ur5us has quit [Remote host closed the connection]
nikivi has joined #ruby
evidex has joined #ruby
evidex has quit [Ping timeout: 252 seconds]
hammeds has quit [Excess Flood]
hammed has joined #ruby
tdy has quit [Ping timeout: 265 seconds]
Jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
renderful has joined #ruby
lxsameer has joined #ruby
Pupeno has joined #ruby
Capela has joined #ruby
renderful has quit [Ping timeout: 244 seconds]
Capela has quit [Ping timeout: 260 seconds]
rrichardsr3 has quit [Read error: Connection reset by peer]
aeontech has quit [Quit: aeontech]
ziarkaen has joined #ruby
charliesome has joined #ruby
quazimodo has joined #ruby
ziarkaen has quit [Ping timeout: 260 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
Ax has joined #ruby
lenwood has joined #ruby
nankyokusei has joined #ruby
camilasan has quit [Remote host closed the connection]
camilasan has joined #ruby
nankyokusei has quit [Ping timeout: 260 seconds]
dnicole has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
ramfjord has joined #ruby
dnicole has quit [Ping timeout: 260 seconds]
Alina-malina_ is now known as Alina-malina
pandaant has joined #ruby
Jameser has joined #ruby
Pumukel has joined #ruby
xall_ has joined #ruby
blackbombay__ has joined #ruby
Madplatypus has quit [Quit: Connection closed for inactivity]
nikivi has quit [Quit: irc]
duper has joined #ruby
quazimodo has quit [Ping timeout: 260 seconds]
tvw has joined #ruby
bob434 has joined #ruby
sameerynho has joined #ruby
spectrum has joined #ruby
whiteline has joined #ruby
lxsameer has quit [Ping timeout: 260 seconds]
xall_ has quit [Ping timeout: 252 seconds]
JeanCarloMachado has joined #ruby
loechel has joined #ruby
Capela has joined #ruby
Pumukel has quit [Ping timeout: 260 seconds]
slackr has joined #ruby
Capela has quit [Ping timeout: 260 seconds]
xall_ has joined #ruby
ziarkaen has joined #ruby
loechel has quit [Remote host closed the connection]
muelleme has quit [Ping timeout: 250 seconds]
quazimodo has joined #ruby
anisha_ has quit [Quit: This computer has gone to sleep]
ziarkaen has quit [Ping timeout: 260 seconds]
Ishido has quit [Remote host closed the connection]
Jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
antgel has quit [Ping timeout: 260 seconds]
c355e3b has joined #ruby
despai has joined #ruby
lenwood has quit [Ping timeout: 256 seconds]
Jameser has joined #ruby
lenwood has joined #ruby
ravinray has joined #ruby
aidalgol has quit [Quit: zZzZZzZzzzz]
<ravinray>
hi guys. i just installed ruby 2.2.5 on my windows machine. i cannot install via gem, because it states, certificate verify failed. my first google search results point to an error that is old. can anyone help me out?
<marahin>
ravinray old error doesn't mean it's an outdated error!
codfection has quit [Remote host closed the connection]
<apeiros>
ravinray: not on windows. but on that issue, drbrain (core contrib for rubygems) says they'll add it to guides.rubygems.org, and there I found http://guides.rubygems.org/ssl-certificate-update/
<apeiros>
maybe that helps?
<apeiros>
as in, maybe that's kept up to date
<ravinray>
thank you, i will have a look at it!
symm- has joined #ruby
alexherbo2 has joined #ruby
<ravinray>
nice, that worked! thank you very much :)
despai has quit [Ping timeout: 260 seconds]
blackbombay__ has quit [Ping timeout: 260 seconds]
JoshS has quit [Ping timeout: 260 seconds]
nankyokusei has joined #ruby
bruce_lee has joined #ruby
blackbombay__ has joined #ruby
nankyokusei has quit [Ping timeout: 260 seconds]
muelleme has joined #ruby
<apeiros>
yw
muelleme has quit [Ping timeout: 265 seconds]
mikecmpbll has joined #ruby
hammed has quit [Remote host closed the connection]
hammed has joined #ruby
cibs has quit [Ping timeout: 268 seconds]
cibs has joined #ruby
Ax has quit [Quit: Ax]
alexherbo2 has quit [Ping timeout: 252 seconds]
Capela has joined #ruby
Capela has quit [Ping timeout: 260 seconds]
Jameser has joined #ruby
ziarkaen has joined #ruby
marr has quit [Ping timeout: 250 seconds]
SCHAAP137 has joined #ruby
ziarkaen has quit [Ping timeout: 252 seconds]
tk__ has joined #ruby
Capela has joined #ruby
rajdesai has quit [Remote host closed the connection]
rajdesai has joined #ruby
JoshS has joined #ruby
rajdesai has quit [Ping timeout: 260 seconds]
cdg has joined #ruby
JeanCarloMachado has quit [Ping timeout: 250 seconds]
Lord_of_Life has quit [Excess Flood]
CloCkWeRX has joined #ruby
dnicole has joined #ruby
tvw has quit [Remote host closed the connection]
Lord_of_Life has joined #ruby
dnicole has quit [Ping timeout: 244 seconds]
kimegede has joined #ruby
Capela has quit [Remote host closed the connection]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cdg has quit [Ping timeout: 260 seconds]
hightower2 has quit [Read error: Connection reset by peer]
solocshaw has quit [Ping timeout: 256 seconds]
jcao219 has quit [Ping timeout: 250 seconds]
hightower2 has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
PaulCapestany has quit [Read error: Connection reset by peer]
XV8 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SCHAAP137 has quit [Quit: Leaving]
SCHAAP137 has joined #ruby
<apeiros>
hi sanmi_
solocshaw has joined #ruby
PaulCapestany has joined #ruby
s2013 has joined #ruby
Pupeno has quit [Remote host closed the connection]
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aryaching has quit [Read error: Connection reset by peer]
Rickmasta has joined #ruby
<sanmi_>
Hey, apeiros. I am good, you?
CSWookie has quit [Ping timeout: 260 seconds]
sonOfRa has quit [Quit: Bye!]
djbkd has quit [Remote host closed the connection]
r3vDev has quit [Ping timeout: 252 seconds]
<sanmi_>
I am new here, just installed ruby yesterday.
sonOfRa has joined #ruby
<vktec>
sanmi_: Welcome to the land of Ruby!
<sanmi_>
Thanks vtec, what's up?
<vktec>
sanmi_: Just so you know, you can type vk<Tab> and it should autocomplete my name :)
conta has joined #ruby
<sanmi_>
vktec, good to know. :D
<vktec>
:)
doublemalt__ has quit [Ping timeout: 256 seconds]
<sanmi_>
vktec, I'm so sorry to bother. I eventually want to learn ruby on rails, i would like to know how to achieve this goal.
<apeiros>
sanmi_: I'm fine, thanks
<Yxhuvud>
sanmi_: How much experience with web programming do you have?
bmurt has joined #ruby
ramfjord has joined #ruby
<vktec>
sanmi_: I'd start by learning Ruby before you go on to learn Rails
conta has quit [Ping timeout: 252 seconds]
atmosx has joined #ruby
ziarkaen has joined #ruby
<vktec>
Rails has a lot of stuff built in, so if you go straight into Rails development, you'll miss out on the basics of Ruby and that will probably mean you hit into issues later on
atmosx has quit [Client Quit]
atmosx has joined #ruby
Jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<sanmi_>
vktec, Good to know thank you very much.
<sanmi_>
Yxhuvud, i have dabble around with html and css.
ziarkaen has quit [Ping timeout: 250 seconds]
Capela has quit [Remote host closed the connection]
JeanCarloMachado has quit [Ping timeout: 268 seconds]
<vktec>
sanmi_: If you're new to web dev, I'm not sure that Rails is the best way to go. Rails is a very big project, and, as such, can be quite difficult to work with at times
doublemalt__ has joined #ruby
<vktec>
Personally, I'd recommend something like Padrino. Sinatra is also good, but make sure to structure your project properly, otherwise you'll get into a big mess (I speak from experience here :P)
<c-c>
goeast: my guess is your class selector is incorrect
<c-c>
goeast: you should start from the simplest selector that works incrementally towards the selector that produces the desired results
<goeast>
I think so... but I don't understand what it is incorrect. I tried to used another selector ".impair td" this wors but only for impair elements...
ramfjord has joined #ruby
<goeast>
Thank you c-c. Unfortunately I am trying to do this since 2 hours.. with no result
<c-c>
goeast: -also "tablesorter" is probably a jquery plugin that adds things in document tree dynamically - so those things do not exist in the semantic html doc that nokogiri scrapes
<c-c>
goeast: yeah, maybe fail faster? Cycles of 25 minutes to 45 minutes work well with the brain
nikivi has quit [Quit: zzz]
<goeast>
Ah ok (i dont know jquery). Thank you C-c
<c-c>
(unless you need to do deep debugging)
conta has joined #ruby
<c-c>
goeast: gl!
kimegede has quit [Ping timeout: 265 seconds]
Capela has joined #ruby
roamingdog has quit [Remote host closed the connection]
gnufied has joined #ruby
roamingdog has joined #ruby
tomphp has joined #ruby
nikivi has joined #ruby
solocshaw has joined #ruby
miqlas-H has quit [Ping timeout: 244 seconds]
miqlas-H has joined #ruby
djbkd has joined #ruby
<Darmani>
Hey guys, I'm trying to solve this problem of mapping certain values within an array with other values that I specify.
solocshaw has quit [Ping timeout: 244 seconds]
<Darmani>
It works fine until I give it a partially incorrect value. It should return an empty string and it doesn't.
<Darmani>
How should I approach this problem?
<elomatreb>
Darmani: We're probably going to need more than that. Maybe share some code?
<Darmani>
elomatreb: oh lol I thought I posted it my bad.
gizmore has quit [Remote host closed the connection]
gizmore has joined #ruby
JeanCarloMachado has joined #ruby
<elomatreb>
Darmani: Without being familiar with the domain, what is the use of the the `nucleos` array in line 10? You're defining, but not using it
<Darmani>
elomatreb: Ah I forgot to remove that. I was trying to figure out a solution so I thought I could use that variable somehow but it didn't work.
<elomatreb>
So the method should return an empty string if there are invalid characters in the input (e.g. "X")?
<Darmani>
elomatreb: Yeah that's the goal!
ur5us has joined #ruby
<elomatreb>
Firstly, I'm not sure an empty string is the best return value, since it does not indicate any sort of error. Are you sure you don't want to return nil or maybe even throw an exception?
<Darmani>
elomatreb: Well this is actually an problem from Exercism.io so...
<elomatreb>
Ah, ok. Then ignore that
<elomatreb>
So, to solve your problem, you have to check if your input string contains invalid characters before passing it to the map in line 11
<Darmani>
right..
troys has joined #ruby
<Darmani>
That's where I thought my Nucleos variable would work. I could compare the input to the variable and if none of the variables matched I would return an empty string.
palms has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roamingdog has quit [Remote host closed the connection]
<elomatreb>
Darmani: To avoid duplicating yourself you can use `DNA_TO_RNA.keys`
<Darmani>
oh good point.
<elomatreb>
Uh, I hope I didn't just override your example, but take a look here: https://repl.it/EQOS/1
goeast has quit [Ping timeout: 260 seconds]
<Darmani>
elomatreb: Dude that's awesome.
<Darmani>
Thank you!
<elomatreb>
You understand how it works?
gnufied has quit [Ping timeout: 260 seconds]
ziarkaen has joined #ruby
<Darmani>
I think so.
palms has quit [Ping timeout: 260 seconds]
leea has joined #ruby
<Darmani>
I'm gonna need to study it a bit haha but it looks good.
<elomatreb>
Feel free to ask, if you have any questions
<Darmani>
elomatreb: I appreciate that, thanks again!
tdy has quit [Ping timeout: 250 seconds]
webguynow has quit [Ping timeout: 250 seconds]
ziarkaen has quit [Ping timeout: 244 seconds]
bluOxigen has quit [Ping timeout: 252 seconds]
webguynow has joined #ruby
creat has quit [Ping timeout: 250 seconds]
claudiuinberlin has quit [Remote host closed the connection]
claudiuinberlin has joined #ruby
roamingdog has joined #ruby
symm- has joined #ruby
vuoto has quit [Quit: Lost terminal]
<al2o3-cr>
ruby 3 concurreny model guilds seems interesting
fullofcaffeine has joined #ruby
solocshaw has joined #ruby
roamingdog has quit [Remote host closed the connection]
<blackbombay__>
feels like a perl approach to cuncurrency to me :p
vuoto has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
Pupeno has joined #ruby
vuoto has quit [Client Quit]
roamingdog has joined #ruby
vuoto has joined #ruby
blackmesa has joined #ruby
gnufied has joined #ruby
gnufied has quit [Remote host closed the connection]
<apeiros>
oh, it *did* work. even better than expected. it didn't reban. it just updated its db :D
miqlas-H has quit [Ping timeout: 244 seconds]
Azure has quit [Read error: Connection reset by peer]
roamingdog has quit [Ping timeout: 265 seconds]
pawnbox has quit [Remote host closed the connection]
ziarkaen has joined #ruby
roamingdog has joined #ruby
lenwood has quit [Ping timeout: 256 seconds]
conta has joined #ruby
doublemalt__ has joined #ruby
ziarkaen has quit [Ping timeout: 260 seconds]
roamingdog has quit [Remote host closed the connection]
Azure has joined #ruby
Azure has quit [Client Quit]
symm- has quit [Ping timeout: 252 seconds]
<johnkpaul>
I am trying to intercept and modify class method calls, so that I can add some extra metadata, but pass along the original parameters to the original implementation
<johnkpaul>
I don’t know if I’m using the correct ruby jargon for this
<johnkpaul>
basically, I”m trying to extend a module, not a class
<johnkpaul>
so that when calls to state are made inside the class definition, that gets to my implementation, which I then call super (or whatever it’s called with modules?) so that the original implementation also gets called
doublemalt__ has quit [Ping timeout: 256 seconds]
agit0 has joined #ruby
tubuliferous has joined #ruby
workmad3 has joined #ruby
Lord_of_Life has quit [Excess Flood]
agit0 has quit [Client Quit]
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dnicole has joined #ruby
Lord_of_Life has joined #ruby
troys is now known as troys_
codfection has quit [Quit: Leaving]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
codfection has joined #ruby
symm- has joined #ruby
lenwood has joined #ruby
Immune has joined #ruby
agit0 has joined #ruby
dnicole has quit [Ping timeout: 256 seconds]
agit0 has quit [Client Quit]
nankyokusei has joined #ruby
toogley has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
<chrisseaton>
johnkpaul: are you stuck with something doing that?
LoneHerm_ has quit [Remote host closed the connection]
<toogley>
what header files are missing here? https://paste.fedoraproject.org/473658/63850147/ the error message is so difficult to understand.. but a former error message (which had linked to this log file) said a library or sth like that would be missing.
<johnkpaul>
chrisseaton: yes, I am unable to get my intended-wrapper implementation to be caleld
<toogley>
"Could not create Makefile due to some reason, probably lack of necessary
<toogley>
libraries and/or headers."
Azure has joined #ruby
<chrisseaton>
toogley: the only header file is ruby.h - I guess it must be that surely?
<johnkpaul>
I am considering just reopening the third party module to override the existing method, but I don’t want to do something like that
<chrisseaton>
johnkpaul: do you know what singleton (or eigen, or meta) classes are?
<toogley>
chrisseaton: hm.. i have installed ruby and ruby-devel on fedora
<toogley>
chrisseaton: and libffi libffi-devel and rubygems
<johnkpaul>
chrisseaton: yes, roughly. They are the somewhat behind the scenes _real_ class for every instance, right?
<johnkpaul>
including instances of Class
<chrisseaton>
toogley: maybe write that test program into test.c and compile it manually? You may get more direct error information in case something is being hidden by the configure script.
nankyokusei has quit [Ping timeout: 252 seconds]
<chrisseaton>
johnkpaul: methods on a module are really instance methods on its singleton class
Cohedrin has joined #ruby
fullofcaffeine has quit [Quit: Leaving...]
<chrisseaton>
johnkpaul: unless you can show your code, try experimenting with printing .methods and .singleton_class.methods on your modules to see where you methods are ending up
<chrisseaton>
johnkpaul: maybe they're on the wrong class and so aren't being called
<chrisseaton>
johnkpaul: or, show your code and we can help more directly
elifoster has joined #ruby
<johnkpaul>
chrisseaton: I can show my code. let me get a gist
<johnkpaul>
the class that want to extend starts at line 16
<johnkpaul>
my goal is to override the “state” call
<johnkpaul>
my current attempt at how to do that is on lines 1-13
toretore has quit [Ping timeout: 260 seconds]
<chrisseaton>
johnkpaul: yes, there is a complex interaction of classes, modules, singleton classes, and module-include classes, here!
conta has quit [Ping timeout: 250 seconds]
<chrisseaton>
johnkpaul: so line 8 isn't being run and you want it to?
<johnkpaul>
:) glad that it isn’t an easy one! chrisseaton
<johnkpaul>
yes
<johnkpaul>
that’s my goal
<chrisseaton>
johnkpaul: I get an error on line 4 anyway before that could run
<johnkpaul>
at line 8, I will be plucking some extra arguments out of args, and logging them
roamingdog has joined #ruby
<johnkpaul>
ah chrisseaton, sorry, that’s copied and pasted from a project that has the Statesman gem installed
<johnkpaul>
hmm, I can try to get a runnable example with the same behavior
solocshaw has joined #ruby
<chrisseaton>
johnkpaul: can you give me a quick shim of that module?
<johnkpaul>
yeah, let me see if I can figure out how that works
pokalyis has joined #ruby
Lord_of_Life has quit [Excess Flood]
<toogley>
chrisseaton: writing and testing the c program works.. (return code 0)
<chrisseaton>
toogley: sorry, I've got no more ideas then.
<toogley>
chrisseaton: hm, thanks anyways.
Lord_of_Life has joined #ruby
solocshaw has quit [Ping timeout: 260 seconds]
<johnkpaul>
chrisseaton: :/ sadly I don’t know how to do what Statesman is doing. I am guess it’s something with the included hook
gambl0re has joined #ruby
<johnkpaul>
how can I add methods that can be used in the class definitions of other classes
<gambl0re>
can i delete .rvm folder?
<johnkpaul>
like attr_accessor
<chrisseaton>
johnkpaul: attire_accessor is define on Module
edwinvdgraaf has joined #ruby
Xentil has joined #ruby
<johnkpaul>
chrisseaton: and if I want to create my own method like that, that can be called during the creation of other classes, how can I include that into my own module?
rfoust has joined #ruby
<chrisseaton>
johnkpaul: line 18 doesn't make sense to me - is that idiomatic use of Statesman?
<chrisseaton>
johnkpaul: you've included a module, so you won't get methods that you can use within the class definition like that - state will be a method on the instances of ItemStateMachine I believe
<johnkpaul>
chrisseaton: chrisseaton yes
<johnkpaul>
that is how statesman works, it adds the method “state” for you to use
<chrisseaton>
johnkpaul: I think you need to figure out exactly where Statesman is defining these methods, and that will help you solve your problem.
frankiee1 has quit [Ping timeout: 252 seconds]
frankiee_ has joined #ruby
c0mrad3 has quit [Quit: Connection closed for inactivity]
<johnkpaul>
chrisseaton: “state” is a class method of ItemStateMachine
edwinvdgraaf has quit [Ping timeout: 252 seconds]
<chrisseaton>
johnkpaul: including modules is tricky - it actually adds a weird kind of new superclass into your class that you can't see in normal Ruby
<johnkpaul>
somehow the act of including Statesman::Machine, adds that
<johnkpaul>
yeah, I think that’s where the magic is happening
<ben__bb>
I am using unless ... unless x.at('td:nth-child(5) a').nil? but it doesn't cover all the possible error.
<chrisseaton>
ben__bb: you're using unless to catch errors?
<ben__bb>
Actually I had undefined method `text' for nil:NilClass (NoMethodError) this error because one td was empty => nil so I put a unless to check if it was empty.
symm- has joined #ruby
frankiee_ has quit [Ping timeout: 250 seconds]
<chrisseaton>
ben__bb: which line does the exception come from?
<ben__bb>
But It doesn't cover all the possible nil (because I have many td). So i mean to rescue the no method error
frankiee_ has joined #ruby
roamingdog has quit [Remote host closed the connection]
<chrisseaton>
ben__bb: you can use rescue to catch exceptions, but I would strongly recommend that you avoid the error being thrown in the first place for good style
<ben__bb>
Chrisseaton, thank you very much for your help
ta__ has quit [Remote host closed the connection]
<ben__bb>
How can I avoid the no method error if my text is empty then ?
Ishido has quit [Remote host closed the connection]
gingray has quit [Ping timeout: 260 seconds]
<chrisseaton>
If a value could be nil, check that before hand unless if or unless as you have been
optiz0r has joined #ruby
<chrisseaton>
But I think you weren't doing it on the relevant line
<chrisseaton>
Was the exception coming from line 6 for example?
<ben__bb>
Yes !
<ben__bb>
line 6
<ben__bb>
I put unless x.at('td:nth-child(5) a').nil? but i could also be from 4 or 3 or 2..
<ben__bb>
*it
<chrisseaton>
The exception backtrace should tell you clearly which line it is from.
renderfu_ has joined #ruby
futilegames has quit [Quit: futilegames]
<ben__bb>
extracting data equi2.rb:117:in `block (3 levels) in array_to_name': undefined method `text' for nil:NilClass (NoMethodError)
<ben__bb>
this is line 6 in my code
<ben__bb>
in the code I gave you
<chrisseaton>
So there's your problem.
pokalyis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ben__bb>
I am struggling with it since...
xall_ has joined #ruby
renderfu_ has quit [Ping timeout: 244 seconds]
pokalyis has joined #ruby
joallard has joined #ruby
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
<ben__bb>
@Chrisseaton I think my connexion had a problem I am not sure i get your answer (if you actually answered sorry) :)
<chrisseaton>
ben__bb: line 6 call y.text, but y is nil, so if you don't want the exception, you need to only run this line if y is not nil
<chrisseaton>
ben__bb: you can do that, as you did on the line, with an unless y.nil? - and you can put that at the end of the line if you wanted
<ben__bb>
ah Yes ! great
<ben__bb>
I get it Thanks i am gonna tryit
<joallard>
y is boolean?
<ben__bb>
nop it's a text in an html page
<ben__bb>
stored in a td so a string
djbkd has joined #ruby
roamingdog has joined #ruby
xall_ has quit [Ping timeout: 265 seconds]
roamingdog has quit [Remote host closed the connection]
hightower3 has joined #ruby
<hightower3>
Hey what's the recommended way to write a Ruby bindings for a C lib? The ruby-ffi thing or?
<j416>
sounds reasonable.
ziarkaen has joined #ruby
miqlas-H has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
bob434 has quit [Quit: This computer has gone to sleep]
harai has quit [Ping timeout: 250 seconds]
kith has quit [Ping timeout: 250 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<chrisseaton>
hightower3: yes the FFI is the most portable way and easiest in most cases
alexherbo2 has quit [Ping timeout: 260 seconds]
bob434 has joined #ruby
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
Xentil has quit [Quit: No Ping reply in 180 seconds.]
Xentil has joined #ruby
ta_ has joined #ruby
djbkd has quit [Ping timeout: 250 seconds]
kith_ is now known as kith
djbkd has joined #ruby
kith has quit [Quit: kith]
djbkd has quit [Remote host closed the connection]
Xentil has quit [Read error: Connection reset by peer]
Xentil has joined #ruby
ela_ has joined #ruby
<ela_>
hi! i don't exactly know how this works... do i just ask my question here?
<apeiros>
yes
<apeiros>
the better you describe your problem, the higher the chance somebody answers.
alexherbo2 has joined #ruby
nankyokusei has joined #ruby
<apeiros>
usually code + input + expected output + actual output is a sensible start.
muelleme has quit [Ping timeout: 265 seconds]
Silthias1 has joined #ruby
Silthias has quit [Ping timeout: 260 seconds]
dviola has joined #ruby
twe4ked has joined #ruby
<apeiros>
that is - in case of an error/problem. in case of not knowing how to get there: code of your current approach (at least showing you tried it yourself), input, desired output, description of how/why the input should be converted to that output.
<ela_>
Alright, well hi, I am 16 and using Ruby for the first time to build a mock-election website for my school. I'm using HTML, Ruby, and CSS. The problem is that I can't figure out how to count the votes. I have the vote go in through a form, and then stored it in a variable with my application controller. Then I made a class and initialized variables like trump, clinton, etc. and wrote methods to increase them by 1 when someone votes, but
LoneHerm_ has joined #ruby
<ela_>
I'm not that interested in correcting what I did (although that would be helpful if it sounds like I am on the right track), I am interested in just finding a way to count the votes that go in through the site. How should I do this? So everytime someone goes on the site to vote and it refreshes it doesn't lose the number of previous votes?
gizmore has joined #ruby
gizmore has quit [Remote host closed the connection]
nankyokusei has quit [Ping timeout: 260 seconds]
gizmore has joined #ruby
<ela_>
If someone could help it would be really really great... my computer science teacher doesn't even know how to code and if I don't get this website finished by Tuesday I'll be screwed!
nikivi has joined #ruby
troys_ is now known as troys
<apeiros>
ela_: you'd usually use a database to store them. for something simple to get started, I'd recommend sqlite.
LoneHerm_ has quit [Ping timeout: 260 seconds]
tdy has joined #ruby
Xentil has quit [Ping timeout: 244 seconds]
<apeiros>
btw., if you're using ruby on rails (the framework written in ruby, as opposed to ruby, the language itself), then there's a more suitable channel: #rubyonrails
Xentil has joined #ruby
aryaching has quit [Ping timeout: 265 seconds]
workmad3 has quit [Ping timeout: 265 seconds]
aryaching has joined #ruby
ta_ has quit [Remote host closed the connection]
nullset68 has quit [Quit: WeeChat 1.4]
moei has joined #ruby
<ela_>
No I'm using Ruby, not ruby on rails. and thank you I'll try a database
<apeiros>
Darmani: shouldn't a ? method return true/false?
<apeiros>
also I think I'd just raise ArgumentError if the argument isn't a String.
<Darmani>
apeiros: yeah it should. And this is a problem from Exercism.io so they want an empty string.
<apeiros>
eeeew :-/
<blackbombay__>
ecer
<Darmani>
I don't make the rules D:
<apeiros>
ok, well. so where are you stuck?
<Darmani>
Besides this is more for my education anyway.
<apeiros>
yeah, sure. it's an acceptable reason for a bad API.
<Darmani>
luls
<Darmani>
So I thought I would split the input into an array of chars and compare it to a list of the alphabet.
<Darmani>
And if all the letters matched then true if it's off then false.
<blackbombay__>
what isa pangram
<apeiros>
blackbombay__: all letters of the (or "an") alphabet
<Darmani>
blackbombay__: uhh it's when you have a sentence when all the letters of the alphabet are used?
lenwood has quit [Ping timeout: 250 seconds]
<Darmani>
Like "The quick brown fox jumped over the lazy dog"
<apeiros>
not sure whether with the requirement of having each character exactly once
<Darmani>
apeiros: I think that's the case actually.
<apeiros>
then the quick brown fox isn't one, repeats "e" :)
<blackbombay__>
i see thanks
<Darmani>
apeiros: Oh this is true!
SCHAAP137 has quit [Quit: Leaving]
<Darmani>
apeiros: So perhaps all the letters have to be used at least once?
<blackbombay__>
Hash.new(0) and then count each occurence, if keys is equal to ('a'..'z').size then true, else false, and if it is not a string, return an empty string i guess.
<apeiros>
well, comparing arrays takes order into consideration
<apeiros>
["a","b"] != ["b","a"]
<Darmani>
blackbombay__: Yes that could work.
<Darmani>
apeiros: We could sort the array and then compare it?
<blackbombay__>
there's probably a better way
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
Darmani: yes, that's an approach for the "exactly once" variant
<apeiros>
what about up-/downcase?
<apeiros>
also what about whitespace/punctation?
<Darmani>
yeah we'd grab the input and downcase it before comparing it to anything.
Jackneill has quit [Remote host closed the connection]
<apeiros>
yes, good. solves the case issue.
<Darmani>
apeiros: umm... gsub to filter out the punctuation?
<apeiros>
yes
<Darmani>
Okay but we still need a way to compare the arrays.
<apeiros>
(or String#delete, if you can work with it)
<apeiros>
well, once sorted, == will work just fune.
<apeiros>
*fine
Immune has joined #ruby
Rickmasta has joined #ruby
roamingdog has quit [Remote host closed the connection]
<Darmani>
apeiros: Well... If we are using the same letter twice then it won't work...
unreal_ has joined #ruby
<Darmani>
Right?
<apeiros>
correct
roamingdog has joined #ruby
<Darmani>
So we need another way.
<apeiros>
well, does ruby offer you something to remove duplicates?
s2013 has quit [Read error: Connection reset by peer]
<Darmani>
apeiros: Ah that's a good point. Uniq should do the trick.
<apeiros>
right
<Darmani>
Okay let me throw something together ^.^
<blackbombay__>
or use a Set?
<apeiros>
once you're done with this solution, you should also read blackbombay__'s suggestion
ziarkaen has joined #ruby
cajone has quit [Remote host closed the connection]
<apeiros>
or suggestions, by now :)
<Darmani>
apeiros: That sounds far too excessive although I suppose it would work.
<apeiros>
my solutions would probably be: (alphabet - input.downcase.chars).empty? ;-)
unreal has quit [Ping timeout: 260 seconds]
<apeiros>
*solution
<blackbombay__>
always a cute one liner with ruby :))
<Darmani>
apeiros: I don't know if I understand what you're doing there.
<apeiros>
and in this case even a performant one :D
<ueueueueuueueu>
how do you know which version number to set your project to?
koooge has joined #ruby
<Darmani>
blackbombay__: If everything that's not in the alphabet is getting filtered out shouldn't it be missing characters??
<Darmani>
It shouldn't pass is what I thought...
ur5us has quit [Ping timeout: 252 seconds]
solocshaw has joined #ruby
dnicole has joined #ruby
tdy2 has joined #ruby
<blackbombay__>
Darmani: which characters would it be missing? non-alphabet characters should just be ignored right? then if it is has all chars of the alphabet, it returns true, otherwise false.
dviola has quit [Quit: WeeChat 1.6]
LoneHerm_ has joined #ruby
diego1 has joined #ruby
tdy1 has quit [Ping timeout: 265 seconds]
<Darmani>
blackbombay__: take this string for example 7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog
LoneHerm_ has quit [Remote host closed the connection]
diego1 has quit [Changing host]
diego1 has joined #ruby
diego1 is now known as dviola
<Darmani>
How does that pass?
<blackbombay__>
it returns false for that one
<blackbombay__>
which is correct,since it is missing alphabet chars.
<blackbombay__>
did you write those tests? because 'refute' is equivalent to assert_equal false, Pangram.isPangram?(str)
dviola has quit [Client Quit]
<Darmani>
blackbombay__: I actually didn't realize that it said refute. my bad.
diego1 has joined #ruby
dnicole has quit [Ping timeout: 260 seconds]
<Darmani>
And no this is a problem from Exercism.io
diego1 has quit [Changing host]
diego1 has joined #ruby
diego1 is now known as dviola
<blackbombay__>
never heard of it. do they provide test cases for you?