<tdump>
Hello. I'm having an issue with my code and I'm not sure why. I actually had it working earlier but it had some nested if/else and I thought it looked bad so I redid it, and now it's failing. Here's a gist https://git.io/v1zbK
jhack has joined #ruby
tectonic has joined #ruby
rakm has joined #ruby
nankyokusei has quit [Ping timeout: 248 seconds]
bougyman has quit [Ping timeout: 248 seconds]
bturker has quit [Ping timeout: 256 seconds]
<tdump>
oh i got it
<tdump>
it was line 15
<tdump>
thanks!
tdump has quit [Quit: Leaving...]
charliesome has joined #ruby
h1fuelcell has quit [Remote host closed the connection]
tectonic has quit []
hutch34 has quit [Ping timeout: 246 seconds]
chrisja has quit [Quit: leaving]
s1kx has joined #ruby
benlieb has quit [Quit: benlieb]
Yacker_ has joined #ruby
Yacker has quit [Ping timeout: 260 seconds]
NeverTired has joined #ruby
OTORelic has joined #ruby
smlocal has joined #ruby
Snickers has quit [Quit: Snickers]
h1fuelcell has joined #ruby
allcentury has joined #ruby
DarthGandalf has quit [Ping timeout: 245 seconds]
borei has quit [Ping timeout: 260 seconds]
kareelee has quit [Ping timeout: 265 seconds]
zeroDi has joined #ruby
skalfyfan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
skalfyfan has joined #ruby
jackjackdripper1 has joined #ruby
skalfyfan has quit [Read error: Connection reset by peer]
AndBobsYourUncle has joined #ruby
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jackjackdripper has quit [Ping timeout: 250 seconds]
cpruitt has quit [Quit: cpruitt]
kareelee has joined #ruby
Fernando-Basso has quit [Quit: WeeChat 1.6]
AndBobsYourUncle has quit [Ping timeout: 258 seconds]
JeanCarloMachado has quit [Ping timeout: 245 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
bronson has quit [Read error: Connection reset by peer]
sdothum has joined #ruby
bronson has joined #ruby
alexar has joined #ruby
jtd has quit [Quit: No Ping reply in 180 seconds.]
jtd has joined #ruby
sdothum has quit [Client Quit]
alexar has quit [Ping timeout: 245 seconds]
jackjackdripper has quit [Quit: Leaving.]
dbruns has left #ruby [#ruby]
dnicole has joined #ruby
h1fuelcell has joined #ruby
alexar has joined #ruby
xall has joined #ruby
antoniobeyah has quit [Quit: antoniobeyah]
tau has quit [Remote host closed the connection]
etehtsea has quit [Ping timeout: 268 seconds]
dnicole has quit [Ping timeout: 245 seconds]
antoniobeyah has joined #ruby
alexar has quit [Ping timeout: 258 seconds]
nankyokusei has joined #ruby
bturker has joined #ruby
etehtsea has joined #ruby
xberg_ has joined #ruby
grh has joined #ruby
r3vDev has quit [Quit: Leaving.]
nankyokusei has quit [Ping timeout: 256 seconds]
r3vDev has joined #ruby
FastJack has joined #ruby
bturker has quit [Ping timeout: 256 seconds]
alexar has joined #ruby
bronson has quit [Read error: Connection reset by peer]
bronson has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 256 seconds]
alexar has quit [Ping timeout: 260 seconds]
Emmanuel_Chanel has joined #ruby
djbkd has quit [Quit: My people need me...]
alexar has joined #ruby
bronson has quit [Read error: Connection reset by peer]
bronson has joined #ruby
Jameser has quit [Ping timeout: 248 seconds]
alexar has quit [Ping timeout: 245 seconds]
enterprisey has quit [Ping timeout: 258 seconds]
Jameser has joined #ruby
djbkd has joined #ruby
Ademan has quit [Quit: leaving]
bocaneri has joined #ruby
eggshke has quit []
aryaching has quit [Ping timeout: 246 seconds]
eggshke has joined #ruby
Devalo has joined #ruby
Macaveli has joined #ruby
enterprisey has joined #ruby
alexar has joined #ruby
P_R_Deltoid has joined #ruby
xall has quit [Ping timeout: 245 seconds]
grh has quit [Ping timeout: 256 seconds]
Dimik has quit [Ping timeout: 260 seconds]
sarbs has quit [Ping timeout: 260 seconds]
alexar has quit [Ping timeout: 265 seconds]
antoniobeyah has quit [Quit: antoniobeyah]
<P_R_Deltoid>
Is String interpolation allowed in Exception messages?
<P_R_Deltoid>
Like "raise "#{variable}""
<P_R_Deltoid>
Because I am trying to use rspec to test for an exception error message and it seems to be returning the literal string without interpolation
alexar has joined #ruby
sarbs has joined #ruby
howdoi has joined #ruby
djbkd has quit [Quit: My people need me...]
cibs has quit [Ping timeout: 268 seconds]
alexar has quit [Ping timeout: 256 seconds]
kareelee_ has quit [Ping timeout: 256 seconds]
cibs has joined #ruby
<tjbiddle>
P_R_Deltoid: You’re using double quotes, as well as ensuring that the variable is intantiated and spelled correctly?
tomlynn[m] has left #ruby ["User left"]
<tjbiddle>
I’m unsure if variable scope is lost, so check that as well - or if it was instantiated before the exception was raised
<P_R_Deltoid>
yeah, I think I don't really understand how raising exceptions works
<P_R_Deltoid>
at least with rspec
<P_R_Deltoid>
I can raise an exception without using the begin and rescue keywords, right?
Devalo has quit [Remote host closed the connection]
h1fuelcell has quit [Remote host closed the connection]
Devalo has joined #ruby
<al2o3-cr>
P_R_Deltoid: yep
radic has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
alexar has joined #ruby
xrlk has quit [Ping timeout: 250 seconds]
djbkd has joined #ruby
Devalo has quit [Ping timeout: 256 seconds]
<P_R_Deltoid>
Aww, I think this is just an rspec issue
antoniobeyah has joined #ruby
boombox_ has joined #ruby
alexar has quit [Ping timeout: 244 seconds]
astrobunny has quit [Remote host closed the connection]
<dminuoso>
P_R_Deltoid: Raising has nothing to do with begin/rescue. All that the keyword rescue (it does not always require a "begin") does is set up a catch handler.
last_staff has joined #ruby
<P_R_Deltoid>
Yeah, I was grasping at straws trying to figure it out
<dminuoso>
P_R_Deltoid: For rspec that means that you have to use the block form of expect, i.e. expect { code_that_throws }.to raise_error - rspec will wrap the execution of the blocks inside a begin/rescue for you.
emptyflask has quit [Remote host closed the connection]
gusrub has joined #ruby
<P_R_Deltoid>
oh!
h1fuelcell has joined #ruby
<P_R_Deltoid>
That worked perfectly!
<dminuoso>
P_R_Deltoid: :)
alexar has joined #ruby
danst has joined #ruby
<P_R_Deltoid>
So am I correct in assuming that, because it was throwing an error in the code, and I wasn't using that form, it literally was just exiting the code with that error before Rspec could inspect it?
alfy has joined #ruby
<P_R_Deltoid>
or, catch it
<dminuoso>
P_R_Deltoid: Correct. :)
c355e3b has quit [Quit: Connection closed for inactivity]
<P_R_Deltoid>
perfect, thank you so much
aryaching has joined #ruby
<alfy>
wassup
boombox_ has quit [Remote host closed the connection]
<dminuoso>
P_R_Deltoid: Note that expect { code_that_raises }.not_to raise_error is sometimes considered an antipattern, because whether rspec will catch it inside the expect block, or whether the test just fails with an exception is the same.
astrobunny has joined #ruby
<dminuoso>
One just looks slighty better, but you expect any code you write inside an example block to not raise an error implicitly anyway.
alexar has quit [Ping timeout: 248 seconds]
h1fuelcell has quit [Remote host closed the connection]
JoshS has quit [Quit: Leaving]
<P_R_Deltoid>
So you are saying don't use that pattern? Just test for certain errors if I need to, but otherwise assume that if a test succeeds, that it didn't throw an error?
<P_R_Deltoid>
In other words, testing for the lack of an error is a fruitless exercise?
h1fuelcell has joined #ruby
antoniobeyah has quit [Quit: antoniobeyah]
JoshS has joined #ruby
<dminuoso>
P_R_Deltoid: Indeed.
<dminuoso>
P_R_Deltoid: If some code raises an exception it will fail the rspec anyway, and rspec will still catch it - it will just present the error slightly differently.
alexar has joined #ruby
function has quit [Quit: /dev/null is full]
function has joined #ruby
function has quit [Client Quit]
troulouliou_div2 has joined #ruby
jgnagy has quit [Remote host closed the connection]
function has joined #ruby
function has quit [Client Quit]
jgnagy has joined #ruby
ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
constant has joined #ruby
constant has quit [Client Quit]
alexar has quit [Ping timeout: 268 seconds]
alexar has joined #ruby
emilkarl has joined #ruby
jgnagy has quit [Ping timeout: 268 seconds]
kareelee has joined #ruby
xall has joined #ruby
alexar_ has joined #ruby
alexar has quit [Read error: Connection reset by peer]
antoniobeyah has joined #ruby
gusrub has quit [Remote host closed the connection]
conta has joined #ruby
Salih has joined #ruby
Salih has quit [Changing host]
Salih has joined #ruby
djbkd has quit []
alexar_ has quit [Ping timeout: 260 seconds]
grh has joined #ruby
benlieb has quit [Quit: benlieb]
alexar has joined #ruby
benlieb has joined #ruby
xberg has joined #ruby
benlieb has quit [Client Quit]
benlieb has joined #ruby
benlieb has quit [Client Quit]
djbkd has joined #ruby
xberg_ has quit [Ping timeout: 258 seconds]
gusrub has joined #ruby
ekduhmanah is now known as ekem
alexar has quit [Ping timeout: 250 seconds]
djbkd has quit [Client Quit]
foooobear has joined #ruby
gusrub has quit [Ping timeout: 245 seconds]
pawnbox_ has joined #ruby
pawnbox has quit [Ping timeout: 246 seconds]
h1fuelcell has quit [Remote host closed the connection]
alexar has joined #ruby
andikr has joined #ruby
aganov has joined #ruby
emilkarl has quit [Read error: Connection reset by peer]
<jokke>
i need a container which is solely used for checking if elements are in it or not
ramortegui has joined #ruby
<jokke>
i don't need to iterate over it or nothing
<jokke>
should i use Set for this?
alexar has joined #ruby
<jokke>
would it be faster than Array?
<herwin>
depends on the number of elements
<jokke>
i see
<jokke>
number of elements is something between 10 and 50 probably
<jokke>
i assume include? on array uses binary search
<herwin>
no, it doesn't
<herwin>
there is a bsearch-method
<herwin>
because binary search only works if the array is sorted
<jokke>
oh you're right of course
<herwin>
set uses a hash-based lookup
SesMan has joined #ruby
<jokke>
yeah
GodFather has quit [Ping timeout: 246 seconds]
<herwin>
inserting can be a bit more expensive, searching is faster
jaguarmagenta has quit [Remote host closed the connection]
hutch34 has joined #ruby
<jokke>
i don't insert. i initialize it once with values
SteenJobs has quit [Quit: SteenJobs]
<jokke>
or do a .to_set on an array
<herwin>
s/insert/initializing/
<jokke>
mmh
<jokke>
that's okay
alexar has quit [Ping timeout: 260 seconds]
<jokke>
i reuse it alot
<herwin>
if you really want to know it: benchmark it
Definity2 has joined #ruby
byte512 has joined #ruby
jhack has joined #ruby
<jokke>
yeah
brendan- has joined #ruby
rodfersou is now known as rodfersou|lunch
montanonic has quit [Ping timeout: 250 seconds]
jrafanie has joined #ruby
hutch34 has quit [Ping timeout: 258 seconds]
nowz has joined #ruby
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
<herwin>
most likely this isn't the critical factor in performance and we're just bike-shedding here
<nowz>
Hellow im looking for the function with nokogiri that can help me to get the first <a> after the first <p> after the first <div class="content">
<nowz>
Could someone help me?!
jhack has quit [Client Quit]
juco_ has quit [Quit: leaving]
dcluna has joined #ruby
jaguarmagenta has joined #ruby
jhack has joined #ruby
jaguarmagenta has quit [Remote host closed the connection]
dcluna has quit [Read error: No route to host]
alexar has joined #ruby
dcluna has joined #ruby
handicraftsman has left #ruby ["Leaving"]
adavia has joined #ruby
millerti has joined #ruby
fenre has quit [Remote host closed the connection]
blackbombay has joined #ruby
antoniobeyah has joined #ruby
alexar has quit [Ping timeout: 256 seconds]
saslam has joined #ruby
<Papierkorb>
nowz: #at_css
dionysus69 has joined #ruby
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<Papierkorb>
nowz: Or traverse the tree yourself, however, a CSS or XPath selector will be easier to understand I guess later on
SesMan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DLSteve has joined #ruby
jgnagy has joined #ruby
blackbombay has quit [Ping timeout: 260 seconds]
alexar has joined #ruby
ruby-lang342 has joined #ruby
<antoniobeyah>
nowz: use xpath. something like (//div[@class=“content”]/p/a)[1]
<antoniobeyah>
dont trust the xpath u will have to google for it thats my rough guess
<antoniobeyah>
i havent done xpath in a couple years
<Papierkorb>
The CSS selector should be `div.content > p > a`
<Papierkorb>
Which is imho much easier to read than any xpath
dcluna_ has joined #ruby
<Papierkorb>
Or maybe without the `>`, whatever you really need
<nowz>
thank you, im going to look after it
_chazu has quit [Quit: ZNC 1.6.1+deb1~ubuntu14.04.0 - http://znc.in]
sepp2k has joined #ruby
alexar has quit [Ping timeout: 260 seconds]
chazu has joined #ruby
SpiffTR has joined #ruby
dcluna has quit [Read error: Connection reset by peer]
zeroDi has joined #ruby
SpiffTR has quit [Client Quit]
ruby-lang342 has quit [Ping timeout: 260 seconds]
nickjj_ is now known as nickjj
modin has quit [Ping timeout: 246 seconds]
emilkarl has quit [Quit: emilkarl]
sphex has quit [Read error: Connection reset by peer]
modin has joined #ruby
alexar has joined #ruby
xrlk has joined #ruby
submitnine has quit [Remote host closed the connection]
s2013 has joined #ruby
Minko has joined #ruby
<Minko>
hello, why did IronRuby die and isn't revived?
<Minko>
JRuby looks fine
sphex has joined #ruby
gregor3005 has joined #ruby
alexar has quit [Ping timeout: 258 seconds]
jaguarmagenta has joined #ruby
Illusioneer has joined #ruby
<gregor3005>
hi, can anybody point to to a gem which can read, edit and write xls files (version 97-2003)? there are lot of gem's out there but, some have bugs, others can't write and so on. it's frustrating finding one which work
terens has quit [Remote host closed the connection]
centrx has joined #ruby
psychicist__ has quit [Ping timeout: 250 seconds]
<Minko>
gregor3005: you could try converting in and out of xls
alexar has joined #ruby
polishdub has joined #ruby
hutch34 has joined #ruby
roshanavand has joined #ruby
<gregor3005>
Minko: by parsing the binary xls?
Derderderd has joined #ruby
<Minko>
you could just use something to convert it to another format, whichever you want, that's better supported
roshanavand has quit [Client Quit]
<Minko>
I didn't work with excel much, perhaps even something like csv would do the job
roshanavand has joined #ruby
blackwind_123 has joined #ruby
alexar has quit [Ping timeout: 260 seconds]
<mikecmpbll>
gregor3005 : i use the 'spreadsheet' gem but i don't do anything complicated.
<gregor3005>
Minko: ok, suppose there is a gem which converts from xls to csv and one which converts from csv to xls. which would you suggest?
minimalism has quit [Ping timeout: 245 seconds]
jhack has quit [Quit: jhack]
<gregor3005>
mikecmpbll: i only have to add values without any formatting style
<Minko>
gregor3005: I don't know any, it's just a suggestion. you could even use an outside converter for that
Derderderd has quit [Ping timeout: 244 seconds]
<gregor3005>
mikecmpbll: the main goal is to write a tool which reads contacts from an carddav server and produce a xls for a crappy telephone system
<gregor3005>
darix: (16:03:22) gregor3005: mikecmpbll: the main goal is to write a tool which reads contacts from an carddav server and produce a xls for a crappy telephone system
x77686d has quit [Quit: x77686d]
<darix>
gregor3005: i know
<mikecmpbll>
gregor3005 : i mean https://rubygems.org/gems/spreadsheet ; whether or not that's the github repo for that gem i'll leave you to work out
<mikecmpbll>
but yeah, that'll do the job for you.
Burgestrand has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
d0nn1e has joined #ruby
<gregor3005>
mikecmpbll: please calm down, it was only a question. leave this channel if you like to diss people
brendan- has joined #ruby
x77686d has joined #ruby
<mikecmpbll>
gregor3005 : pardon? i'm perfectly calm, i'm not sure how you got the impression otherwise.
<gregor3005>
ok
blackbombay has joined #ruby
jhack has joined #ruby
alexar has quit [Ping timeout: 250 seconds]
Humdai has quit [Quit: Leaving]
<antoniobeyah>
Papierkorb: agreed, the css is seems easier. didn’t know you could do that
antoniobeyah has quit [Quit: antoniobeyah]
ResidentBiscuit has joined #ruby
shinnya has quit [Ping timeout: 250 seconds]
blackbombay has quit [Ping timeout: 248 seconds]
Humdai has joined #ruby
alexar has joined #ruby
SesMan has joined #ruby
kareelee has quit [Remote host closed the connection]
xberg has quit [Remote host closed the connection]
foooobear has joined #ruby
jhack has quit [Ping timeout: 258 seconds]
Rodya_ has joined #ruby
grh has quit [Ping timeout: 260 seconds]
alexar has quit [Ping timeout: 246 seconds]
c355e3b has joined #ruby
Rodya_ has quit [Remote host closed the connection]
Dimik has joined #ruby
nettoweb has joined #ruby
Guest88798 is now known as c-c
Humdai has quit [Quit: Leaving]
alexar has joined #ruby
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
mr_rich102 has quit [Ping timeout: 252 seconds]
jhack has joined #ruby
Definity2 has quit [Ping timeout: 260 seconds]
Humdai has joined #ruby
kobain has joined #ruby
Rodya_ has joined #ruby
alexar has quit [Ping timeout: 244 seconds]
jhack has quit [Ping timeout: 260 seconds]
Rodya_ has quit [Remote host closed the connection]
zeroDi has quit [Quit: WeeChat 1.6]
teclator has quit [Ping timeout: 260 seconds]
teclator has joined #ruby
Toledo_ is now known as croberts
tomphp_ has joined #ruby
tomphp has quit [Ping timeout: 244 seconds]
Fernando-Basso has quit [Quit: WeeChat 1.6]
alexar has joined #ruby
Rodya_ has joined #ruby
jhack has joined #ruby
blackbombay has joined #ruby
allcentury has joined #ruby
saneax is now known as saneax-_-|AFK
Minko has quit [Quit: Page closed]
alexar has quit [Ping timeout: 268 seconds]
rkoller has joined #ruby
antoniobeyah has joined #ruby
manjaro-kde5_ has joined #ruby
chouhoulis has quit [Remote host closed the connection]
lenwood has quit [Remote host closed the connection]
mr_rich101 has joined #ruby
alexar has joined #ruby
SesMan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Definity2 has joined #ruby
blackbombay has quit [Ping timeout: 248 seconds]
ferr1 has quit [Quit: WeeChat 1.6]
Derderderd has joined #ruby
SteenJobs has joined #ruby
alexar has quit [Ping timeout: 250 seconds]
SteenJobs has quit [Client Quit]
tau has joined #ruby
Rodya_ has quit [Remote host closed the connection]
blackbombay has joined #ruby
Hyuk has joined #ruby
Derderderd has quit [Ping timeout: 265 seconds]
vuoto has joined #ruby
alexar has joined #ruby
x77686d has quit [Quit: x77686d]
Rodya_ has joined #ruby
Rodya_ has quit [Remote host closed the connection]
aganov has quit [Remote host closed the connection]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
DLSteve has joined #ruby
hutch34 has quit [Quit: WeeChat 1.5]
synbit has quit [Quit: Ex-Chat]
rakm has joined #ruby
DLSteve has quit [Client Quit]
Gasher has joined #ruby
rakm has quit [Client Quit]
<Gasher>
hello, I have a problem. when I made a shortcut/link to my Ruby program, the __dir__ variable broke, pointing to the shortcut, and not the original file. how can I fix it?
xberg has joined #ruby
GooseYArd has joined #ruby
DLSteve has joined #ruby
jtdoncas_ has joined #ruby
tomphp_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros>
either don't rely on __dir__ or resolve it to the real path
Devalo has joined #ruby
smlocal has quit [Remote host closed the connection]
smlocal has joined #ruby
<Gasher>
what else can I rely on?
rakm has joined #ruby
<apeiros>
I don't know what problem you solve with __dir__.
<Gasher>
just getting the program's folder's path
gregf_ has quit [Quit: Page closed]
<apeiros>
that's not the problem you solve.
smlocal has quit [Remote host closed the connection]
<Gasher>
hm?
<apeiros>
what do you need the program's folder?
<apeiros>
*why
<Gasher>
because it consists of many other files
<Gasher>
that are needed for the program
Devalo has quit [Ping timeout: 246 seconds]
<apeiros>
ruby code?
<apeiros>
data?
<apeiros>
other?
<Gasher>
data - config files, different kind of storage
<apeiros>
is your program a gem?
<Gasher>
nope
<apeiros>
why not?
<Gasher>
and some "other"
Rodya_ has joined #ruby
<Gasher>
it's not designed to be one
<Gasher>
and I've never made a gem
roshanavand has quit [Ping timeout: 260 seconds]
Silthias has quit [Quit: Leaving.]
<apeiros>
proper way IMO:
<apeiros>
make it a gem
<apeiros>
use gem's datadir
<apeiros>
have an initial config there, copy it per user
<apeiros>
have and keep your immutable datafiles there
<Gasher>
won't work here
<apeiros>
mutable datafiles again, copy per user
<apeiros>
well, too bad then.
<Gasher>
so no nice solution to that?
<apeiros>
to "doesn't work". no.
<apeiros>
I have no solutions for that kind of problem.
UserJosh is now known as JoshS
jhack has joined #ruby
<Gasher>
what do you mean?
<apeiros>
precisely what I said. I have no solution to "doesn't work".
<Gasher>
I didn't say "doesn't work", I said "points to the shortcut instead of the original file"
x77686d has quit [Quit: x77686d]
<apeiros>
no. you said "won't work here".
<Gasher>
it's not that kind of software that would be a gem
<mustmodify>
apeiros: I do! I do! Smash it with a hammer!
<apeiros>
Gasher: I have no idea why you think that and I currently lack the desire to ask or even argue about it.
Derderderd has quit [Ping timeout: 248 seconds]
fmcgeough has quit [Quit: fmcgeough]
rodfersou is now known as rodfersou|afk
x77686d has joined #ruby
_ZerGabriel_ has joined #ruby
maattdd has quit [Ping timeout: 245 seconds]
jaxxstorm has quit [Ping timeout: 256 seconds]
[Butch] has quit [Quit: I'm out . . .]
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
xberg has quit [Remote host closed the connection]
Humdai has quit [Quit: Leaving]
[Butch] has joined #ruby
djbkd has joined #ruby
splud has joined #ruby
aryaching has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mustmodify has left #ruby [#ruby]
Beams has quit [Quit: .]
omphe has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has quit []
Derderderd has joined #ruby
TomyWork has quit [Remote host closed the connection]
nankyokusei has joined #ruby
Eiam has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
kies has quit [Ping timeout: 256 seconds]
<SebastianThorn>
if you have a script that generates code that your lib usese, any special way i might wanna commit that code to git, or does it just not matter? 64k lines
tercenya has quit [Remote host closed the connection]
<baweaver>
Gasher: Consider a gem just to be a project structure / packaging system.
nankyokusei has quit [Ping timeout: 248 seconds]
tercenya has joined #ruby
<baweaver>
There's no real reason you can't use it for even projects you never intend to "publish" to the world
<havenwood>
Gasher: If it's not an app it's a gem.
<baweaver>
havenwood: Apps can be gems too.
frozengeek has quit [Quit: frozengeek]
Derderderd has quit [Ping timeout: 268 seconds]
<baweaver>
in fact it makes it way easier to deploy / publish later, especially if you have an internal gemserver to use.
<havenwood>
baweaver: My logical syllogism didn't exclude that. :-P
<baweaver>
fine fine
x77686d has quit [Quit: x77686d]
<apeiros>
logical syllogism - it gets to greeky in here. I'll go ^^
deadnull has quit [Quit: Bye]
borei has joined #ruby
x77686d has joined #ruby
<baweaver>
SebastianThorn is it necessary for the application to run?
<baweaver>
or is it just generated at whim for whatever usecase?
<baweaver>
In the first, yes, commit
<baweaver>
In the second, .gitignore
<SebastianThorn>
baweaver: yes, it is needed for the application, thanks
sp4rrow has joined #ruby
beilabs_ has joined #ruby
rodfersou|afk is now known as rodfersou
DenSchub has joined #ruby
beilabs has quit [Ping timeout: 246 seconds]
DenSchub has quit [Client Quit]
DenSchub has joined #ruby
gusrub has joined #ruby
GodFather has quit [Ping timeout: 246 seconds]
heftig has joined #ruby
bougyman has joined #ruby
x77686d has quit [Quit: x77686d]
bougyman is now known as Guest52468
gusrub has quit []
heftig has quit [Read error: Connection reset by peer]
x77686d has joined #ruby
heftig has joined #ruby
x77686d has quit [Client Quit]
sneakers has joined #ruby
kies has joined #ruby
omphe has joined #ruby
gusrub has joined #ruby
Eiam has joined #ruby
zeroDi has joined #ruby
jaruga___ has quit [Quit: jaruga___]
banisterfiend has joined #ruby
sniffer has joined #ruby
chouhoul_ has joined #ruby
Guest52468 has quit [Changing host]
Guest52468 has joined #ruby
chouhou__ has joined #ruby
chouhoulis has quit [Ping timeout: 258 seconds]
fmcgeough has joined #ruby
chouhoul_ has quit [Ping timeout: 245 seconds]
centrx has quit [Remote host closed the connection]
chouhoulis has joined #ruby
townes11 has joined #ruby
Eiam has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chouhou__ has quit [Ping timeout: 265 seconds]
omphe has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
adavia has quit [Ping timeout: 250 seconds]
enterprisey has joined #ruby
chouhoul_ has joined #ruby
<townes11>
I'm a bit new to the OOP way of doing things. I'm working through a tutorial...we change a user file so that it displays a first and last name, not just one 'name'. https://gist.github.com/anonymous/eeabfd5b2d7161e15b066944f96f46c1 <---- this code fails, and I see that the 'full_name' method isn't being seen inside other methods, I guess.
<townes11>
I'm a bit new to the OOP way of doing things. I'm working through a tutorial...we change a user file so that it displays a first and last name, not just one 'name'. https://gist.github.com/anonymous/eeabfd5b2d7161e15b066944f96f46c1 <---- this code fails, and I see that the 'full_name' method isn't being seen inside other methods, I guess.
<townes11>
Honestly, I'm not entirely sure. This is new to me and I'm unsure of a right way to accomplish this, and I have an idea of why it's failing but I don't totally understand it
xberg has joined #ruby
<toretore>
townes11: how does it fail?
chouhoulis has quit [Ping timeout: 256 seconds]
_ZerGabriel_ has quit [Ping timeout: 250 seconds]
pilne has joined #ruby
Rodya_ has quit [Quit: Leaving...]
claudiuinberlin has joined #ruby
Illusioneer1 has joined #ruby
<townes11>
toretore: it's actually through rails console. Okay, so I require this file ("./example_user") I'm able to add a user with these attributes
<townes11>
But a final part of this section is to see if full_name.split and alphabetical_name.split(',').reverse give the same output
<townes11>
Sorry a little slow on the keyboard today heh
xberg has quit [Remote host closed the connection]
jhack has quit [Ping timeout: 245 seconds]
davidt has joined #ruby
johnmilton has quit [Ping timeout: 250 seconds]
<toretore>
townes11: go back to the part where you implement full_name and alphabetical_name: if the test you gave is supposed to pass then you have implemented them wrong
Derderderd has joined #ruby
<miah>
ya, that code works fine so test must be broken
<townes11>
Hmmm
<toretore>
it won't pass because there's no comma in full_name
<toretore>
when facing something like this, work backwards: inspect the output manually to see if it is actually the same
<townes11>
Oh wow. I've been so focused on just verifying it (I get nameerror undefined local var etc) That I didn't even look to see if it would actually verify if it worked
<toretore>
oh wait
smlocal has joined #ruby
<toretore>
full_name.split without arg; well it still won't be the same because the other one is ',' and not ', '
Eiam has joined #ruby
AgentVenom has joined #ruby
iooner has joined #ruby
<townes11>
Okay thanks everyone. I'll work backwards and focus on this part after. I dunno, I really felt like I messed up the class somehow
<toretore>
townes11: are you confused about `user.full_name` vs just `full_name` or `full_name(user)` ?
alexar has joined #ruby
<townes11>
Haha actually I tried all, honestly, because I wasn't sure the way to call it (I assumed: user.full_name)
<toretore>
yes
<toretore>
you have defined a class, with instance methods
Gasher has quit [Quit: Page closed]
centrx has joined #ruby
centrx has quit [Changing host]
centrx has joined #ruby
<toretore>
to run any of those methods, you must first create an instance of the class
Illusioneer1 has quit [Read error: Connection reset by peer]
<townes11>
Yeah. user = User.new(....)
<toretore>
every method call in ruby has an explicit or implicit receiver, which is `self` inside its own scope
bturker_ has quit [Ping timeout: 256 seconds]
<toretore>
between `def something` and `end` you are in instance scope
Illusioneer has joined #ruby
<toretore>
outside that, it's something else
smlocal has quit [Remote host closed the connection]
hutch34 has joined #ruby
Illusioneer has quit [Max SendQ exceeded]
<toretore>
anyway, all of this is something you should learn following a basic ruby tutorial
alexar_ has quit [Ping timeout: 245 seconds]
Illusioneer has joined #ruby
Illusioneer has quit [Max SendQ exceeded]
<townes11>
It's my fault, I'm like half comprehending when you start talking about explicit/implicit receiver
alexar has quit [Ping timeout: 244 seconds]
<townes11>
The concepts are a little foggy to me. I need to work on that
<toretore>
that's something you are going to have to learn at some point
<toretore>
otherwise you won't get very far
jenrzzz has joined #ruby
alexar has joined #ruby
jhack has joined #ruby
<townes11>
Yeah. It's been a real problem so far. Alright look thanks for your help, I'm gonna run and try to work through this
smlocal has joined #ruby
Illusioneer has joined #ruby
<toretore>
np you'll get it eventually
Illusioneer has quit [Max SendQ exceeded]
<miah>
http://poodr.com/ really straightened out my oop/ruby knowledge
<townes11>
I hope so. Thanks. Take care toretore
Xiti has joined #ruby
Illusioneer has joined #ruby
<townes11>
miah: bookmarked, I'll check it out tonight. This is a serious problem I've been having and I'll try anything lol
Illusioneer has quit [Max SendQ exceeded]
<townes11>
Later :)
townes11 has quit []
Macaveli has joined #ruby
Illusioneer has joined #ruby
Illusioneer has quit [Client Quit]
konsolebox has quit [Ping timeout: 260 seconds]
alexar has quit [Ping timeout: 246 seconds]
smlocal has quit [Remote host closed the connection]
SteenJobs has joined #ruby
andrzeju_ has joined #ruby
SteenJobs has quit [Client Quit]
sparch has quit [Quit: Leaving]
andrzejku has quit [Ping timeout: 260 seconds]
alexar has joined #ruby
alexar has quit [Remote host closed the connection]
alexar has joined #ruby
nofxx has joined #ruby
aryaching_ has joined #ruby
aswen has joined #ruby
aryaching has quit [Ping timeout: 260 seconds]
tercenya has quit [Remote host closed the connection]
tercenya has joined #ruby
bocaneri has quit [Read error: Connection reset by peer]
marxarelli is now known as marxarelli|afk
emilkarl has joined #ruby
jtdoncas_ has quit [Ping timeout: 246 seconds]
Amoeba has quit [Quit: Ex-Chat]
SpiffTR has joined #ruby
emilkarl has quit [Read error: Connection reset by peer]
emilkarl has joined #ruby
nankyokusei has joined #ruby
paralitix has quit []
Rutix has joined #ruby
Rutix has joined #ruby
Rutix has quit [Changing host]
adavia has joined #ruby
harai has joined #ruby
h1fuelcell has joined #ruby
smlocal has joined #ruby
bayed has quit [Quit: Connection closed for inactivity]
smlocal has quit [Client Quit]
tvw has joined #ruby
jtdoncas has joined #ruby
ixti has joined #ruby
h1fuelcell has quit [Ping timeout: 250 seconds]
nankyokusei has quit [Remote host closed the connection]
ahuman has quit [Ping timeout: 245 seconds]
Definity2 has joined #ruby
foooobear has quit [Quit: (null)]
Illusioneer has joined #ruby
emilkarl has quit [Read error: Connection reset by peer]
Illusioneer has quit [Max SendQ exceeded]
Illusioneer has joined #ruby
Illusioneer has quit [Max SendQ exceeded]
ahuman has joined #ruby
emilkarl has joined #ruby
borei has quit [Quit: Leaving.]
brent__ has joined #ruby
Illusioneer has joined #ruby
Illusioneer has quit [Max SendQ exceeded]
marxarelli|afk is now known as marxarelli
enterprisey has quit [Remote host closed the connection]
Illusioneer has joined #ruby
Illusioneer has quit [Max SendQ exceeded]
ramfjord has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
centrx has quit [Remote host closed the connection]
emilkarl has quit [Client Quit]
boombox_ has joined #ruby
gregor3005 has quit [Quit: Leaving.]
zacts has quit [Quit: WeeChat 1.6]
zacts has joined #ruby
SteenJobs has joined #ruby
Madplatypus has joined #ruby
kuSuSE has quit [Quit: Konversation terminated!]
SteenJobs has quit [Client Quit]
synthroid has joined #ruby
bigtawm has joined #ruby
f4 has quit [Remote host closed the connection]
jtdoncas has quit [Ping timeout: 246 seconds]
<bigtawm>
Hey is ruby good for learning data structures and algorithms? Im taking a datastructures class next semester, and we can use any language we want. I'm on the fence between Java and Ruby. Ive been using Java in school, but using Ruby outside of it.
boombox_ has quit [Remote host closed the connection]
<miah>
i've learned quite a bit from that
s2013 has joined #ruby
laudiacay has joined #ruby
<bigtawm>
I have seen that site I was going to work through it over break. I think Ill go ruby, but I'm not sure if it will give me a crutch when doing the projects
<atmosx>
bigtawm: doesn't the class enforce a language?
<atmosx>
I've seen courses using java, c++, python and C but never ruby
konsolebox has joined #ruby
symm-_ has quit [Ping timeout: 246 seconds]
Rich_Morin has joined #ruby
<jidar>
c++/java is typically what I see
alan_w has quit [Ping timeout: 265 seconds]
* jidar
cries over all the null pointer errors he saw in C++
jenrzzz has quit [Ping timeout: 256 seconds]
ramfjord has quit [Ping timeout: 265 seconds]
bigtawm has quit [Ping timeout: 260 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
f4 has joined #ruby
Xiti has quit [Quit: Xiti]
symm- has joined #ruby
bigtawm has joined #ruby
c0mrad3 has joined #ruby
Eiam has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
<bigtawm>
No he doesnt enforce a language, but he said most people continue to use Java. Would java give me a better understanding of data structures or is it all the same?
rodfersou has quit [Quit: leaving]
JeanCarloMachado has quit [Ping timeout: 250 seconds]
<jidar>
imho, it's entirely what you make of it. the datastructures can be represented in any language. I'd personally pick the one you're most familiar with rather than something new
<Rich_Morin>
I'm trying to set up log filtering on Sinatra, but it isn't working as expected. Help? - see http://pastie.org/10979589 for details.
<jidar>
that way you won't be fighting the language and the class
<havenwood>
bigtawm: <3 Ruby
<bigtawm>
I probably have the same amount of familiarity with java as I do ruby
<havenwood>
bigtawm: Give JRuby a look as well.
omphe has joined #ruby
<havenwood>
It's a great Ruby implementation on the JVM.
<bigtawm>
Ive heard of that is that were you can compile ruby using a jvm?
harai has quit [Ping timeout: 250 seconds]
<havenwood>
bigtawm: There's a #jruby channel for JRuby specifically.
<bigtawm>
Oh thats cool Ill look into that I heard of it, but have never tried it out
<bigtawm>
So I wont be cheating myself if I choose ruby thats all that I care about since I want to get the most out of the class
<jidar>
not any more than you would with java imho
lxsameer has joined #ruby
TTilus has quit [Ping timeout: 260 seconds]
<bigtawm>
Okay sweet Im working up to doing web dev with rails, so I figure data structures in Ruby would be the best choice Ill do that then
<havenwood>
bigtawm: I think Ruby is a great language to learn. It's multi-paradigm with some fun functional stuff and has an interesting object model.
x77686d has joined #ruby
lxsameer has quit [Client Quit]
TTilus has joined #ruby
<jidar>
there's likely already a implementation of any data structure in any language you'd use rather than writing your own anyhow
harai has joined #ruby
<havenwood>
"If you want a language for easy object-oriented programming, or you don't like the Perl ugliness, or you do like the concept of LISP, but don't like too many parentheses, Ruby might be your language of choice."
<jidar>
so make sure you just understand the concepts in that class
<havenwood>
~ Ruby manpage
<bigtawm>
Yeah I started learning Ruby while taking this OO design class and its much nicer to work with than java to learn haha
<bigtawm>
Yeah its just to understand how the data structures work under the hood correct?
<jidar>
yes. You should know when to use a linked list vs an array and all that
alan_w has joined #ruby
<havenwood>
bigtawm: Ruby Under a Microscope is a good book to read.
Cyrus has joined #ruby
x77686d has quit [Client Quit]
<bigtawm>
Im reading beginning ruby from novice to professional right now any opinions?
chouhoul_ has quit [Remote host closed the connection]
bmurt has joined #ruby
<bigtawm>
Does it show how ruby preforms all its abstractions? Looks like a good read
frozengeek has joined #ruby
<bigtawm>
I have to check out those books for my next read thanks
<bigtawm>
I'll
<jidar>
not sure what you mean, like how it works with it's native types and all that? Might be better to follow up on what havenwood mentioned if that's your interest
connor_goodwolf has joined #ruby
foxxx0 has joined #ruby
<bigtawm>
I just looked at well grounded rubyist on amazon would that be a good follow up to beginning ruby? haha sorry for all the questions
dionysus69 has quit [Ping timeout: 248 seconds]
<jidar>
I think so
<havenwood>
bigtawm: Just get the Second Edition of Well-Grounded Rubyist since it covers modern Ruby. It's a good book for covering the basics.
<jidar>
it's broad
<bigtawm>
When should I start thinking about learning rails?
<bigtawm>
Im up in northern california going to school and trying to get my foot in the door for an internship so I feel like some rails work would help
<havenwood>
bigtawm: I'd say after you have a working knowledge of Ruby and have made your own basic Rack app and tried a few of the simpler-than-Rails Rack adapters like Sinatra and Roda.
<bigtawm>
Okay sounds good Ill look into that next then
<Rich_Morin>
I'll try to create a minimal example.
tdy1 has joined #ruby
<toretore>
you are probably getting output from various libraries; i've used some that just have straight puts at various points in their code and you can't get rid of it
eb0t has quit [Quit: WeeChat 1.4]
<Rich_Morin>
Well, this looks like a pretty vanilla HTTP request log message; I'd expect a random library to generate something else...
kareelee has joined #ruby
kareelee has quit [Remote host closed the connection]
kareelee has joined #ruby
frozengeek has quit [Remote host closed the connection]