<ljarvis>
but yeah, don't chdir without knowing it's a directory..
axsuul has quit [Ping timeout: 272 seconds]
<mg^>
I still like my suggestion of Rake::FileList because you can give it a .exclude
sepp2k has quit [Quit: Leaving.]
<mg^>
but of course there's more than one way to do it
rakm has joined #ruby
<ljarvis>
I think that and glob are find for collecting stuff, but this doesn't seem to do that (yet?)
<jhass>
EllisTAA seems determined to find the most cludgy one for now, let's just let them
<ljarvis>
so it seems pointless to grow something
<jhass>
at least glob takes a block
<ljarvis>
aye
HammyJammy has quit [Quit: Vwums]
frem has quit [Quit: Connection closed for inactivity]
<blubjr>
i think they're just learning..
<EllisTAA>
blubjr: yep
_stu_ has quit [Quit: _stu_]
<EllisTAA>
i need to eventually accecss gzip … is that possible from inside ruby
<ljarvis>
yes
jetpackjoe has joined #ruby
<EllisTAA>
ljarvis: how?
bkxd has quit [Ping timeout: 244 seconds]
<ljarvis>
you said eventually, do you really want to start that now?
<gennaro>
22Avolio-Toly11
jetpackjoe has quit [Max SendQ exceeded]
shortdudey123 has quit [Max SendQ exceeded]
<mg^>
this would be a fun one to golf, since there are so many ways to get it done
juddey has quit [Ping timeout: 260 seconds]
shortdudey123 has joined #ruby
aeontech has joined #ruby
gennaro has quit []
<ljarvis>
i dont really understand what the goal is, it cant be inferred from the code
gatman has joined #ruby
bkxd has joined #ruby
<EllisTAA>
ljarvis: i’m just doing it for fun and to learn how to work with files
<ljarvis>
EllisTAA: yep sure I get that, but I'm saying you should get past the current hurdle before moving on to the mode advanced stuff. I think it would be helpful
<EllisTAA>
ljarvis: for sure
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<EllisTAA>
which seems like that wouldn’t be true since it’s like a tree …
maloik has joined #ruby
mistermocha has quit [Ping timeout: 260 seconds]
dlitvak has joined #ruby
rakm has joined #ruby
nateberkopec has joined #ruby
pdoherty has quit [Ping timeout: 265 seconds]
bruce_lee2 has joined #ruby
benlieb has quit [Quit: benlieb]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
willardg has joined #ruby
chipotle has joined #ruby
maloik has quit [Ping timeout: 265 seconds]
<strgbrew>
quit
hahuang65 has joined #ruby
strgbrew has quit [Quit: [BX] Reserve your copy of BitchX-1.2.1 for the Amiga today!]
nateberkopec has quit [Quit: Leaving...]
asas has quit [Ping timeout: 272 seconds]
bruce_lee has quit [Ping timeout: 272 seconds]
CloCkWeRX has joined #ruby
scripore has joined #ruby
NeverTired has joined #ruby
troulouliou_dev has quit [Quit: Leaving]
aibot has quit [Remote host closed the connection]
maloik has joined #ruby
aibot has joined #ruby
kobain has quit [Read error: Connection timed out]
kobain has joined #ruby
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
htmldrum has joined #ruby
blackmesa has quit [Ping timeout: 244 seconds]
<havenwood>
arcanez: I think `require 'find'; puts Find.find('.').first 20` would be more along the lines of `find -s . | head -n 20`.
maloik has quit [Ping timeout: 250 seconds]
pawnbox has quit [Remote host closed the connection]
CloCkWeRX has quit [Ping timeout: 250 seconds]
arooni has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
NeverDie has quit [Ping timeout: 246 seconds]
<havenwood>
diff -s <(find -s . | head -n 20) <(ruby -rfind -e "puts Find.find('.').first 20") #=> Files /dev/fd/x and /dev/fd/y are identical
baweaver has joined #ruby
ur5us has joined #ruby
B1n4r10 has quit [Ping timeout: 272 seconds]
Melpaws has joined #ruby
NeverDie has joined #ruby
yoongkang has joined #ruby
dmcp_ has joined #ruby
pawnbox has joined #ruby
baweaver has quit [Ping timeout: 260 seconds]
ur5us has quit [Ping timeout: 250 seconds]
NeverDie has quit [Ping timeout: 250 seconds]
<havenwood>
(^ BSD userland flags.)
cirenyc has quit [Quit: Leaving...]
gatman has quit []
yoongkang has quit [Ping timeout: 260 seconds]
bruce_lee2 has quit [Changing host]
bruce_lee2 has joined #ruby
EllisTAA has left #ruby [#ruby]
bruce_lee2 is now known as bruce_lee
pawnbox has quit [Ping timeout: 240 seconds]
Oog has quit []
cirenyc has joined #ruby
cirenyc has quit [Client Quit]
axsuul has joined #ruby
eminencehc has joined #ruby
iateadonut has joined #ruby
iateadonut has quit [Client Quit]
axsuul has quit [Ping timeout: 250 seconds]
jackjackdripper has quit [Quit: Leaving.]
jetpackjoe has joined #ruby
jetpackjoe has quit [Client Quit]
pyon has quit [Quit: fix config]
rgtk has quit [Remote host closed the connection]
eminencehc has quit [Remote host closed the connection]
kp666 has quit [Ping timeout: 250 seconds]
moeabdol has joined #ruby
hahuang65 has quit [Ping timeout: 260 seconds]
hahuang65 has joined #ruby
paradisaeidae has joined #ruby
kp666 has joined #ruby
EllisTAA has joined #ruby
borkdude_ has joined #ruby
tvw has quit [Ping timeout: 252 seconds]
towski_ has quit [Remote host closed the connection]
Sp4rKy_ has joined #ruby
raddazong has joined #ruby
mduca has joined #ruby
Drakevr_ has joined #ruby
saltsa_ has joined #ruby
sgrdrnk has joined #ruby
tethra_ has joined #ruby
bafbomb_ has joined #ruby
badeball_ has joined #ruby
euoia_ has joined #ruby
pygospa has quit [Disconnected by services]
ccooke_ has joined #ruby
connor_g1odwolf has joined #ruby
[ace] has joined #ruby
janno_ has joined #ruby
OmegaA_ has joined #ruby
gregf__ has joined #ruby
L1nuX has quit [Excess Flood]
bubuntu_ has joined #ruby
kiki_lam1 has joined #ruby
moeabdol has quit [Ping timeout: 252 seconds]
uxp_ has joined #ruby
pygospa has joined #ruby
bubuntu has quit [Write error: Broken pipe]
ccooke has quit [Write error: Broken pipe]
sugardrunk has quit [Write error: Broken pipe]
madhatter has quit [Write error: Broken pipe]
mduca_ has quit [Write error: Broken pipe]
OmegaA has quit [Write error: Broken pipe]
janno has quit [Write error: Broken pipe]
dtordable has quit [Write error: Broken pipe]
kiki_lamb has quit [Write error: Broken pipe]
badeball has quit [Write error: Broken pipe]
axisys has quit [Write error: Broken pipe]
Jamo has quit [Write error: Broken pipe]
euoia has quit [Write error: Broken pipe]
borkdude has quit [Write error: Broken pipe]
gregf_ has quit [Write error: Broken pipe]
silverdust has quit [Write error: Broken pipe]
Sp4rKy has quit [Remote host closed the connection]
uxp has quit [Remote host closed the connection]
saltsa has quit [Remote host closed the connection]
connor_goodwolf has quit [Remote host closed the connection]
tethra has quit [Remote host closed the connection]
Drakevr has quit [Remote host closed the connection]
[ace]_ has quit [Remote host closed the connection]
bafbomb has quit [Remote host closed the connection]
dtordabl1 has joined #ruby
axisys_ has joined #ruby
silverdust has joined #ruby
Jamo has joined #ruby
L1nuX has joined #ruby
vagnerlandio has joined #ruby
<vagnerlandio>
hi
eminencehc has joined #ruby
<bougyman>
hey
silverdust is now known as Guest13472
<blubjr>
hi
<vagnerlandio>
my first time in irc chat
<vagnerlandio>
hehe
Bellthoven has quit []
pkmiec has quit [Ping timeout: 246 seconds]
pawnbox has joined #ruby
Azure has joined #ruby
<Ox0dea>
vagnerlandio: The world is quiet here.
vagnerlandio has quit [Client Quit]
Azure has quit [Client Quit]
pawnbox has quit [Ping timeout: 244 seconds]
Azure has joined #ruby
djbkd has quit [Quit: My people need me...]
Azure has quit [Client Quit]
FunkyJunky has quit [Quit: FunkyJunky]
FunkyJunky has joined #ruby
Azure has joined #ruby
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
copious has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
copious has quit [Client Quit]
UniFreak has joined #ruby
IrishGringo has joined #ruby
freerobby has joined #ruby
allcentury has quit [Ping timeout: 240 seconds]
blackmesa has joined #ruby
Melpaws has quit [Quit: Leaving.]
pyon has joined #ruby
yqt has quit [Ping timeout: 250 seconds]
<EllisTAA>
i’m running this program trying to traverse through my file system but it’s taking forever … i decided to add the paths of every searched file to an array and check if that path has been searched, but it’s still taking forever. could someone glance at this file and see if anything is causing it to maybe loop? https://github.com/ellismarte/neatfreak/blob/master/neatfreak.rb#L15
<havenwood>
EllisTAA: Are you doing it for fun or to learn or rather to accomplish the task?
hahuang61 has joined #ruby
<Radar>
EllisTAA: Dir.glob("**/*") will save a lot of that code.
<EllisTAA>
havenwood: fun and to learn
nateberkopec has joined #ruby
<EllisTAA>
Radar: what do u mean will save a lot of that code?
<Radar>
EllisTAA: Try it and find out.
<EllisTAA>
k
<havenwood>
Radar: Earlier I was suggesting: require 'find'; Find.find('/') { |path| puts path }
malconis has joined #ruby
<havenwood>
EllisTAA: Ah, good! :)
hahuang65 has quit [Ping timeout: 272 seconds]
<Radar>
EllisTAA: I hope the difference between Dir.glob("*") and Dir.glob("**/*") are obvious from their output.
<Radar>
havenwood: TIL about Find
blackmesa has quit [Ping timeout: 252 seconds]
maloik has joined #ruby
UtkarshRay has quit [Remote host closed the connection]
WillAmes has quit [Remote host closed the connection]
stannard has joined #ruby
WillAmes has joined #ruby
FunkyJunky has quit [Ping timeout: 272 seconds]
<EllisTAA>
Radar: so running Dir.glob(“**/*”) grabs all files & all files in all of the folder’s sub folders?
nateberkopec has quit [Ping timeout: 276 seconds]
<Radar>
EllisTAA: yup
Ox0dea has quit [Ping timeout: 264 seconds]
dikaio has joined #ruby
<EllisTAA>
oh snap
<Radar>
mhm
maloik has quit [Ping timeout: 272 seconds]
stannard has quit [Ping timeout: 244 seconds]
fedexo has joined #ruby
RainBowww has joined #ruby
DLSteve has joined #ruby
yoongkang has joined #ruby
hahuang61 has quit [Ping timeout: 272 seconds]
EllisTAA has quit [Quit: EllisTAA]
sunya7a has quit [Quit: leaving]
EllisTAA has joined #ruby
EllisTAA has quit [Client Quit]
RainBowww has quit [Quit: Leaving]
benlovell has joined #ruby
nofxx has quit [Remote host closed the connection]
djbkd has joined #ruby
yoongkang has quit [Ping timeout: 272 seconds]
nofxx has joined #ruby
rubie has joined #ruby
jetpackjoe has joined #ruby
jetpackjoe has quit [Max SendQ exceeded]
connor_g1odwolf has quit [Quit: leaving]
connor_goodwolf has joined #ruby
benlovell has quit [Ping timeout: 252 seconds]
djbkd has quit [Ping timeout: 240 seconds]
speakingcode has quit [Ping timeout: 265 seconds]
juddey has joined #ruby
pdoherty has joined #ruby
speakingcode has joined #ruby
rubie has quit [Ping timeout: 265 seconds]
UniFreak has quit [Ping timeout: 276 seconds]
dfinninger has joined #ruby
dlitvak has quit [Remote host closed the connection]
lemondom has joined #ruby
<lemondom>
hi
<lemondom>
config.ru - that is a Rake specific config thing, right?
bb010g has joined #ruby
idefine has joined #ruby
<lemondom>
anyone? :/
howdoicomputer has quit [Ping timeout: 265 seconds]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cmoneylulz has joined #ruby
karapetyan has joined #ruby
<mozzarella>
Russian configuration
<mozzarella>
set your squat levels
freerobby has quit [Quit: Leaving.]
paradisaeidae has quit [Quit: ChatZilla 0.9.92 [Firefox 42.0/20151029151421]]
makenoise has quit [Remote host closed the connection]
Bellthoven has quit []
Bellthoven has joined #ruby
sarkis has joined #ruby
benlieb has quit [Quit: benlieb]
moeabdol has joined #ruby
juddey has joined #ruby
sarkis has quit [Ping timeout: 272 seconds]
yoongkang has joined #ruby
moeabdol has quit [Ping timeout: 272 seconds]
meltdown has quit [Quit: This computer has gone to sleep]
juddey has quit [Ping timeout: 244 seconds]
jetpackjoe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dealpete has quit [Ping timeout: 276 seconds]
benlieb has joined #ruby
brainfire has joined #ruby
arup_r has joined #ruby
yoongkang has quit [Ping timeout: 252 seconds]
diegoaguilar has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rubie has joined #ruby
rippa has joined #ruby
meltdown has joined #ruby
shinenelson has joined #ruby
iateadonut has quit [Quit: Leaving.]
cjbottaro has joined #ruby
axsuul has joined #ruby
rubie has quit [Ping timeout: 265 seconds]
diegoaguilar has quit [Remote host closed the connection]
djbkd has joined #ruby
cjbottaro has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Coldblackice has quit [Ping timeout: 276 seconds]
CloCkWeRX has joined #ruby
pawnbox has joined #ruby
maloik has joined #ruby
<kiki_lam1>
Hey... if I've got an object that has optional features that can be enabled, is there any particular reason why implementing this by having it dynamically prepend modules onto it's eigenclass in response to a method call is a bad idea?
CloCkWeRX has quit [Ping timeout: 244 seconds]
kp666 has quit [Ping timeout: 250 seconds]
maloik has quit [Ping timeout: 250 seconds]
pawnbox has quit [Ping timeout: 260 seconds]
framling has joined #ruby
kp666 has joined #ruby
lxsameer has joined #ruby
fedexo has quit [Read error: Connection reset by peer]
benlieb_ has joined #ruby
benlieb has quit [Read error: Connection reset by peer]
benlieb_ is now known as benlieb
PDI has joined #ruby
antoniobeyah has quit [Quit: antoniobeyah]
benlieb has quit [Client Quit]
amclain has quit [Quit: Leaving]
lxsameer has quit [Remote host closed the connection]
<apeiros>
why on earth do you even use a heredoc there?
<arup_r>
seeing the output as "invalid_emails.join(', ') is not valid." not the one I want
<arup_r>
save local variables .. :)
Coldblackice has quit [Ping timeout: 250 seconds]
<apeiros>
I'm not sure I want to comment that.
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<arup_r>
comment or commit you meant ?
TomPeed has joined #ruby
<apeiros>
I said what I meant
<apeiros>
I also meant what I said
DoubleMalt has joined #ruby
dlitvak has joined #ruby
<apeiros>
also you may want to take a look at Enumerable#partition
<arup_r>
ok. How that partition will help me here ?
<apeiros>
it'll save line 3
<apeiros>
since you like saving.
nso95__ has joined #ruby
nofxx has joined #ruby
<arup_r>
ok. What is wrong with Heredoc .. just asking.?
<arup_r>
I mean why did you not like in this usecase ?
<arup_r>
I fixed it. want to know why is that a code smell ?
karapetyan has joined #ruby
<apeiros>
because it's utterly pointless. there's absolutely no string in your string. only code.
<apeiros>
it's like a = "#{some code here}"
<apeiros>
why have "#{}" at all there?
dlitvak has quit [Ping timeout: 255 seconds]
<arup_r>
ok. convinced
<apeiros>
but your code is full with silly stuff tbh. e.g. invalid_emails.size == 0 -> singular. well, no. zero is plural. only 1 is singular. and an empty list of emails results in " is not valid".
nofxx has quit [Ping timeout: 255 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<apeiros>
or: EOF as token - EOF means End Of File. your heredoc doesn't really mark the end of file
<arup_r>
MSG is a good name
<apeiros>
and I sure hope that the test for @ is only a placeholder for an actually useful email validation
<arup_r>
yes :)
<shevy>
apeiros is having a day :-)
blackmesa has quit [Ping timeout: 260 seconds]
<apeiros>
and email.rindex("@").to_i > 0 as a test for "contains an @" - seriously?
<shevy>
it's creative!
<apeiros>
email =~ /@/, or email.include?("@"). if you want to make sure it's not the first char: email =~ /.@/
<arup_r>
yes. which has first letter as `@` is not valid
<apeiros>
(and of course, still the same comment about "actually meaningful email validation")
<apeiros>
yeah, it's quite arbitrary to allow a billion invalid email addresses, BUT NOT THOSE starting with @.
<arup_r>
rindex will tell me the word has @ but not at first prostion with > 0 test
<apeiros>
nice if you want asc/desc and handling of nils.
karapetyan has joined #ruby
<apeiros>
or have expensive to calculate properties which aren't first thing to sort by.
arup_r has joined #ruby
futilegames has quit [Quit: futilegames]
AndyBotwin has joined #ruby
<brainfire>
does this work with .sort! as well?
voodo|away is now known as voodo
last_staff has joined #ruby
k3asd` has quit [Ping timeout: 250 seconds]
banister has joined #ruby
<apeiros>
"this"? sort/sort! works quite a bit differently from sort_by.
benlovell has joined #ruby
nofxx has joined #ruby
<apeiros>
and why'd you want to use sort! over sort_by! ?
atmosx has joined #ruby
karapetyan has quit [Ping timeout: 250 seconds]
<brainfire>
just because I'm more familiar with it. I just started using ruby a couple of days ago.
aryaching has joined #ruby
<apeiros>
using any of the above described ways with sort/sort! is just you making your own life harder for no reason. learn how sort_by works instead.
BaroMeter has joined #ruby
<brainfire>
I'm looking into it right now ;)
<apeiros>
(and yes, you can make them work with sort)
ht__ has quit [Quit: Konversation terminated!]
benlovell has quit [Ping timeout: 246 seconds]
nofxx has quit [Ping timeout: 255 seconds]
ht__ has joined #ruby
aryaching has quit []
dorei has joined #ruby
<brainfire>
apeiros: I got it :) thanks
Bellthoven has quit []
pyon is now known as nyon
karapetyan has joined #ruby
ht__ has quit [Client Quit]
ht__ has joined #ruby
BaroMeter has quit [Remote host closed the connection]
dlitvak has joined #ruby
ht__ has quit [Client Quit]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tildes has quit [Ping timeout: 250 seconds]
dlitvak has quit [Ping timeout: 252 seconds]
aryaching has joined #ruby
ht__ has joined #ruby
decoponio has joined #ruby
ht__ has quit [Client Quit]
ht__ has joined #ruby
Macaveli has joined #ruby
karapetyan has quit [Ping timeout: 250 seconds]
Pupp3tm4st3r has joined #ruby
tildes has joined #ruby
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tulak has joined #ruby
karapetyan has joined #ruby
voodo is now known as voodo|away
davedev24 has joined #ruby
dstarh has joined #ruby
ruurd has joined #ruby
A124 has joined #ruby
psy_ has joined #ruby
Rollabunna has joined #ruby
agit0 has joined #ruby
IrishGringo has joined #ruby
<lessless>
guys, what's most eloquent way to accept both integer and array as an argument, so the integer would be an array eventually?
Oli has joined #ruby
<lessless>
i.e. x(1) => [1], x([2,3]) => [2,3]
davedev2_ has joined #ruby
Oli is now known as Guest42726
karapetyan has quit [Ping timeout: 250 seconds]
<toretore>
the most elegant way is to not accept both
<toretore>
if there's any chance that you want to accept more than one of something, always demand an array
davedev24 has quit [Read error: Connection reset by peer]
blue_deref has joined #ruby
<jhass>
or use a splat and demand the caller to do so too
<jhass>
x(1), x(*[2, 3]), def x(*values)
<jhass>
x(2, 3)
RobertBirnie has joined #ruby
freerobby has quit [Quit: Leaving.]
<toretore>
and then when you want to add another parameter you're screwed ;)
episage has joined #ruby
j5s7 has joined #ruby
encapuzado has left #ruby [#ruby]
<jhass>
ruby's pretty tolerant about that actually
atomical has quit [Ping timeout: 255 seconds]
<apeiros>
lessless: +1 to toretore's suggestion.
<apeiros>
also sometimes splat is the appropriate answer.
<apeiros>
ah, and that's already been mentioned by jhass
<apeiros>
s/the/an/
<toretore>
but it's like singletons, rarely does is not come back to bite you
<apeiros>
toretore: well, for single/last argument, I prefer splat over taking an array.
j5s7 has quit [Client Quit]
<apeiros>
caller can still easily normalize
<toretore>
i just like being very explicit about everything i guess
<apeiros>
splat is explicit :)
<jhass>
so, switch to Java? :P
<toretore>
java 8 looks inviting actually ;)
j5s7 has joined #ruby
dkphenom has joined #ruby
ht__ has quit [Quit: Konversation terminated!]
ruurd has quit [Read error: Connection reset by peer]
ht__ has joined #ruby
j5s7 has quit [Client Quit]
ruurd has joined #ruby
tildes has quit [Ping timeout: 250 seconds]
rubie has joined #ruby
<apeiros>
java starts to look more attractive indeed.
<apeiros>
if only they could reduce their twenty five gazillion classes to something more sane…
<adaedra>
but that would make it less entreprise-y
<apeiros>
adaedra: all they have to do is call it "oracle java". boom. enterprise-y
<adaedra>
:D
<toretore>
that's also part of the attraction - they have libs for everything, good quality ones too
<apeiros>
toretore: IME a mixed bag too.
<Papierkorb>
Java is outdated from a language standpoint
<toretore>
how so?
<apeiros>
it's only the 10th character in the alphabet.
<apeiros>
s/it's/J is/
<apeiros>
so it must be outdated. Kava would be newer
<Papierkorb>
toretore: The OOP model is just old. no real mixins. Takes more code to do the same, while not being faster at all times
ruurd has quit [Read error: Connection reset by peer]
<Papierkorb>
Not everything is an Object. no operator overloading.
<Papierkorb>
And yes, operator overloading comes to bite you back when you want to write something like an_array + an_array
davedev24 has joined #ruby
<Papierkorb>
Writing tests is annoying. static methods (comparable to rubys "class methods") are a special kind of snowflake, so no simple mocking for them
monod has joined #ruby
davedev2_ has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
<Papierkorb>
You can have an int, or an Integer. int works most of the time, but as they're not an Object, not as an Generic type (e.g.: List<Integer>, not List<int>)
dlitvak has joined #ruby
<Papierkorb>
The list goes on. That language has too many annoyances.
atomical has joined #ruby
skweek has quit [Ping timeout: 246 seconds]
benhuda has joined #ruby
ruurd has joined #ruby
bMalum has quit [Quit: bMalum]
dlitvak has quit [Ping timeout: 272 seconds]
czsr has joined #ruby
monod has quit [Quit: Sto andando via]
rubie has quit [Remote host closed the connection]
<shevy>
it is too verbose
bMalum has joined #ruby
j5s7 has joined #ruby
tildes has joined #ruby
<shevy>
it does have a lot of graphic stuff though - I remember at my old workplace when we looked at electron microscopy dataset, there were two fat java apps that did not have any good replacement (electron microscopy have the weirdest binary format types)
ruurd has quit [Read error: Connection reset by peer]
j5s7 has quit [Client Quit]
<Papierkorb>
shevy: not to confuse with GUI development. Java is horrible at that.
<Papierkorb>
JavaFX. Creating a new button only requires to create three distinct classes! Because only one would not be enterprais for srs bsns
j5s7 has joined #ruby
<Papierkorb>
And then, it still looks completely outlandish. Expect it to look n' feel native to the platform? Don't use Java. (Use e.g. C++/Qt)
j5s7 has quit [Client Quit]
tildes has quit [Remote host closed the connection]
voodo|away has quit [Quit: Leaving...]
dfdfdf has joined #ruby
htmldrum has joined #ruby
stannard has joined #ruby
davedev2_ has joined #ruby
arup_r has quit [Remote host closed the connection]
davedev24 has quit [Read error: Connection reset by peer]
CloCkWeRX has quit [Quit: Leaving.]
ruurd has joined #ruby
arup_r has joined #ruby
kab has joined #ruby
arup_r has quit [Remote host closed the connection]
s2013 has joined #ruby
htmldrum has quit [Ping timeout: 272 seconds]
spiman has quit []
FreelancerBR has joined #ruby
linuxboy_ has quit [Ping timeout: 260 seconds]
chipotle has joined #ruby
ht__ has quit [Quit: Konversation terminated!]
ht__ has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
<flashbck>
What is the recommended way to develop an applicaiton that depends on a custom gem that is hosted in a private gem server?
skade has joined #ruby
<flashbck>
Say I've got a rails applicaiton, my_rails, and a custom gem, my_gem
<adaedra>
Add the custom source to the Gemfile
<flashbck>
I typically host my_gem from a private gem server
jamesfordummies has joined #ruby
<flashbck>
I know that I can use :path in the Gemfile
nofxx has joined #ruby
weemsledeux has joined #ruby
<flashbck>
but I'd have to modify my gemfile for local dev but revert that for deployment?
skade has quit [Client Quit]
<jhass>
flashbck: why do you have to use a local development checkout of the private gem for development?
<jhass>
as adaedra pointed out, just use the source option
jamesfordummies has quit [Client Quit]
<flashbck>
Because I am making modifications to my gem and the rails app
<jhass>
well, that has nothing to do with it being on a private gem server then
VeryBewitching has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sarkis has quit [Ping timeout: 276 seconds]
<VeryBewitching>
G'day folks.
<flashbck>
I'm just wondering if the only way that I can make updates to the gem is to modify my Gemfile to reference the local copy instead of the gem server copy
<flashbck>
I know that npm has the ability to do some sort of link option
<jhass>
flashbck: pretty much, there are some shenigans for using the git option and specifying a local override for that in your local bundler configuration, but it's not really making it any easier
s2013 has joined #ruby
<jhass>
flashbck: switch it back before releasing the gem
ruurd has quit [Read error: Connection reset by peer]
<jhass>
or when rather
troulouliou_dev has joined #ruby
howdoicomputer has quit [Ping timeout: 246 seconds]
jamesfordummies has joined #ruby
<flashbck>
Yeah, I saw the bundle config options for a git based gem
ruurd has joined #ruby
nofxx has quit [Ping timeout: 276 seconds]
xet7 has joined #ruby
skade has joined #ruby
karapetyan has joined #ruby
jamesfordummies has quit [Client Quit]
yoongkang has joined #ruby
benlovell has quit [Ping timeout: 264 seconds]
sankaber has quit [Remote host closed the connection]
sarkis has joined #ruby
gregf has quit [Ping timeout: 272 seconds]
sankaber has joined #ruby
nofxx has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
yoongkang has quit [Ping timeout: 244 seconds]
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jamesfordummies has joined #ruby
jamesfordummies has left #ruby [#ruby]
arup_r has joined #ruby
moeabdol has joined #ruby
AndyBotwin has quit [Quit: Leaving]
iamvery has quit [Ping timeout: 276 seconds]
nyon is now known as pyon
tmtwd has joined #ruby
guacjack has joined #ruby
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ruboto>
mallu, To properly use gist, please enable syntax highlighting, either by choosing the language manually or by entering a proper filename. If you post multiple things, separate them into multiple files. If you have a Github account, please update your gist with new information instead of posting a new one.
ismael__ has quit [Remote host closed the connection]
<jhass>
then you would just compress the path
weemsledeux has joined #ruby
cdg has quit [Remote host closed the connection]
houhoulis has joined #ruby
<EllisTAA>
am i correct in thinking if i pass it the path then i can delete line 14?
zotherstupidguy has joined #ruby
ruurd has quit [Quit: ZZZzzz…]
<EllisTAA>
oh dang it works!
<jhass>
EllisTAA: zcat it
DLSteve has joined #ruby
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
IrishGringo has joined #ruby
blackmesa has joined #ruby
<EllisTAA>
jhass: thanks 4 the help
<jhass>
EllisTAA: seriously, zcat the result
<EllisTAA>
ill look it up but what’s that
<jhass>
a command, like gzip
<jhass>
decompresses it and prints the result to stdout
s00pcan has joined #ruby
s00pcan has quit [Remote host closed the connection]
s00pcan has joined #ruby
ruurd has joined #ruby
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
terminalrecluse has joined #ruby
gambl0re has quit [Read error: Connection reset by peer]
A124 has quit [Quit: '']
<EllisTAA>
ok gotta do the dishes first
solars has quit [Ping timeout: 240 seconds]
zapata has quit [Quit: WeeChat 1.3]
dfdfdf has quit [Quit: Leaving]
ruurd has quit [Quit: ZZZzzz…]
beauby has quit [Ping timeout: 252 seconds]
gambl0re has joined #ruby
finisherr has quit [Quit: finisherr]
symm- has quit [Ping timeout: 246 seconds]
Xeago has joined #ruby
purplexed- has joined #ruby
purplexed- has joined #ruby
terminalrecluse has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
adac has quit [Ping timeout: 240 seconds]
allcentury has joined #ruby
symm- has joined #ruby
dikaio has joined #ruby
<shevy>
I want robots that program for me
<akem2>
do i hear satan clauss?
zapata has joined #ruby
Xeago has quit [Remote host closed the connection]
solars has joined #ruby
benhuda has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ruurd has joined #ruby
Pupp3tm4st3r has quit [Remote host closed the connection]
beauby has joined #ruby
Yzguy has quit [Quit: Zzz...]
gix has joined #ruby
BSaboia has joined #ruby
BTRE has quit [Quit: Leaving]
arup_r has joined #ruby
adac has joined #ruby
beauby has quit [Ping timeout: 250 seconds]
gix has quit [Client Quit]
maloik has joined #ruby
Sp4rKy_ has quit [Remote host closed the connection]
Sp4rKy has joined #ruby
ruurd has quit [Quit: ZZZzzz…]
sparr has quit [Changing host]
sparr has joined #ruby
<sondr3>
hello, newbie question: I'm trying to wrap my head around OptionParser but can't figure out how to send a name on an option to another function... here's my current progress: https://gist.github.com/sondr3/c4739d6e17a6efdea4ae. It works fine except it doesn't seem to trigger anything in the lib file. Anybody care to help me a bit? Sorry if I'm missing something obvious
asas has joined #ruby
yoongkang has joined #ruby
<adaedra>
It's all your code?
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
mary5030 has joined #ruby
<sondr3>
well, I took most from the example I found on ruby-doc.org and modified it from there
<adaedra>
It's obviously not all the code, as it lacks at least opts definition
tlaxkit has joined #ruby
maloik has quit [Ping timeout: 272 seconds]
<sondr3>
oh, like that, yeah, I just ripped it out from the middle of everything, but since I just used the example on ruby-docs I figured that wasn't needed
<sondr3>
it all works fine, except I can't figure out how to "get" the name in the cli.rb file
saddad has joined #ruby
<adaedra>
Ah, it works?
<adaedra>
well, just pass the parameter to new then
pskosinski_ has joined #ruby
<sondr3>
uh, yeah, that's what I can't figure out how to do, hehe, quite new to this
ur5us has joined #ruby
gix has joined #ruby
<adaedra>
like any other function
<adaedra>
method*
yoongkang has quit [Ping timeout: 265 seconds]
pskosinski_ has quit [Remote host closed the connection]
adac has quit [Ping timeout: 255 seconds]
<adaedra>
the parameters you pass to new are passed to initialize
<droptone>
Question: When searching an array of hashes for a value, I normally use .select, is this the quickest method?
gambl0re has quit [Read error: Connection reset by peer]
pskosinski_ has joined #ruby
<adaedra>
For only one value?
<droptone>
such as test = [{"name" => "jim", "job" => "boss"}, {"name" => "steve", "job" => "vp"}]
_blizzy_ has quit [Quit: Leaving]
<droptone>
then test.select { |t| t['name'] == "jim" }
pskosinski_ has quit [Remote host closed the connection]
<droptone>
Yes, I only need one value
<adaedra>
If you just need the key, there's Hash#key
<droptone>
Well, no, I need all the values within that array entry
<sondr3>
okay, thanks guys, I'll figure it out :)
<droptone>
I need that hash
<jhass>
droptone: so your .first afterwards? use .find instead of select
<droptone>
so I need it to return the hash itself with the various parameters.
<adaedra>
Otherwise, yes, for one value you need Hash#find
<droptone>
Yes, jhass, exactly, so .find is better?
<droptone>
Perfect, thank you.
<jhass>
droptone: it doesn't allocate an array
<adaedra>
yes, as it will return first match
<droptone>
Yes, I am having to use .first.
toretore has quit [Ping timeout: 272 seconds]
<droptone>
Brilliant, thank you.
<jhass>
and stops on the first match
<droptone>
Is the syntax the same?
<norc>
I get an Error: uninitialized constant Pry::ObjectPath::StringScanner every time I try to tab complete require filesystem paths, i.e.: require "./<TAB>
<adaedra>
You have the doc above, linked by `derpy
<droptone>
test.find { |t| t['name'] == "jim" }
<norc>
This is from pry 0.10.3
toretore has joined #ruby
symm- has quit [Ping timeout: 240 seconds]
<adaedra>
but that's not a hash you're searching, droptone
<adaedra>
duh, I succeeded at misreading badly.
_ko1 has quit [Ping timeout: 240 seconds]
rgrmatt has quit [Remote host closed the connection]
finisherr has joined #ruby
malconis has joined #ruby
hrs has joined #ruby
mack25 has joined #ruby
hrs has quit [Remote host closed the connection]
pskosinski has quit []
maloik has joined #ruby
EllisTAA has quit [Quit: EllisTAA]
SenpaiSilver has quit [Quit: Leaving]
SCHAAP137 has joined #ruby
baweaver has quit [Remote host closed the connection]
ruurd has joined #ruby
<droptone>
adaedra: It's an array of hashes, no?
<adaedra>
yeah yeah ignore me
<adaedra>
I thought you had a simple hash
<droptone>
hah, no problem man.
<droptone>
I appreciate the help.
gregf has joined #ruby
<adaedra>
I read a tiny bit too fast sometimes :x
<droptone>
I'm at version 3 of this project, it's a major overhaul.
nolic has quit [Ping timeout: 244 seconds]
<droptone>
We're getting customers all over the world, so I'm having to add catchalls for all eventualities.
symm- has joined #ruby
<droptone>
I'm really glad we chose Ruby instead of Python when we began this project.
hrs has joined #ruby
maloik has quit [Ping timeout: 260 seconds]
<lemondom>
hmm
<lemondom>
but I use ansible over puppet :O
<lemondom>
am I a bad guy now? :
<norc>
Good lord, pry is so amazing. :<
<norc>
How did I survive all those years without it....
stannard has joined #ruby
<droptone>
Here's a question: I have code here that does the following: test = test2.to_s; test3 = test[2..-1]
<droptone>
Is there a way to combine the two statements, so I can convert the value to a string and assign the value [2..-1] in the same statement?
<droptone>
Like the way Ruby allows chaining methods like .to_time.strftime() and what not?
ta has quit [Remote host closed the connection]
<adaedra>
of course
<adaedra>
just chain :)
maloik has joined #ruby
<jhass>
droptone: [] is in fact just a method call, we could (but shouldn't) rewrite it to test.[](2..-1)
<jhass>
so test2.to_s[2..-1] is valid
<droptone>
Very nice, thank you.
BSaboia has quit [Ping timeout: 265 seconds]
glanzi has joined #ruby
mary5030 has quit [Remote host closed the connection]
gambl0re has joined #ruby
maloik has quit [Ping timeout: 250 seconds]
mary5030 has joined #ruby
cibs has quit [Ping timeout: 272 seconds]
cibs has joined #ruby
pdoherty has quit [Ping timeout: 272 seconds]
<Papierkorb>
Is there a way to alias_method a method on a instance alone?
<Mon_Ouie>
You can use that instance's singleton class
<Papierkorb>
is that the eigenclass?
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Mon_Ouie>
Yes, the methods to manipulate it use the word 'singleton' so that's how I refer to it
<Papierkorb>
thanks, reading up on that
troulouliou_div2 has joined #ruby
mary5030 has quit [Remote host closed the connection]
hrs has quit [Remote host closed the connection]
ismaelga has joined #ruby
<Papierkorb>
Mon_Ouie: that worked, thanks!
maloik has joined #ruby
nsuke has joined #ruby
saddad has quit [Ping timeout: 260 seconds]
tref has joined #ruby
auxbuss has joined #ruby
IrishGringo has quit [Ping timeout: 265 seconds]
Channel6 has joined #ruby
Jackneill has quit [Ping timeout: 264 seconds]
troulouliou_div2 has quit [Remote host closed the connection]
maloik has quit [Ping timeout: 276 seconds]
rbowlby has joined #ruby
aeontech has quit [Quit: aeontech]
lemondom_ has joined #ruby
eminencehc has joined #ruby
ur5us has quit [Remote host closed the connection]
freerobby has joined #ruby
lemondom has quit [Ping timeout: 252 seconds]
ta has joined #ruby
bluOxigen has quit [Ping timeout: 272 seconds]
nolic has joined #ruby
gambl0re has quit [Read error: Connection reset by peer]
beauby has joined #ruby
tref has quit [Quit: tref]
AlexRussia has joined #ruby
ta has quit [Ping timeout: 272 seconds]
gambl0re has joined #ruby
centrx has joined #ruby
pawnbox has quit [Remote host closed the connection]
symm- has quit [Ping timeout: 240 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<doddok>
what's the best CPU for ruby?
beauby has quit [Ping timeout: 272 seconds]
<doddok>
apple a9 seems the best
<doddok>
what do u think
auxbuss has quit [Quit: ZZZzzz…]
<Fire-Dragon-DoL>
doddok: I'm not sure why "best cpu" should exist for ruby. Isn't it something like XEON with lot of cores?
DLSteve has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<norc>
Papierkorb: It can be quite helpful to understand how Rubys Object model works behind the scenes. It makes everything from default asignee/receiver to instance methods really easy to understand. :)
yoongkang has joined #ruby
dstarh has joined #ruby
icbm has joined #ruby
<Papierkorb>
norc: I knew about the eigenclass stuff through def the_instance.the_method hacks, but didn't knew that there's #singleton_class. But thinking about it, is define_singleton_method by that a short-hand for self.singleton_class.define_method ?
<norc>
Papierkorb: Well, that method would be private.
<Papierkorb>
nothing a just-do-it #send won't fix
<norc>
So rather self.singleton_class.send(:define_method) which is really cumbersome
<norc>
But yes.
marr has joined #ruby
chipotle has quit [Ping timeout: 272 seconds]
mary5030 has joined #ruby
yfeldblum has quit [Remote host closed the connection]
<norc>
Papierkorb: Also, everytime you do class << self; end what you actually do is open the singleton class of whatever self is.
_blizzy_ has joined #ruby
<norc>
And set that to the new self
EllisTAA has joined #ruby
yfeldblum has joined #ruby
fedexo has quit [Ping timeout: 272 seconds]
ruid has joined #ruby
yoongkang has quit [Ping timeout: 265 seconds]
dstarh has quit [Client Quit]
pawnbox has joined #ruby
dmcp_ has joined #ruby
waka has quit [Read error: Connection reset by peer]
<norc>
Papierkorb: Also there is a much much much more common way to do self.singleton_class.send(:define_method)
<norc>
It's this:
<norc>
>> def self.people_do_this_for_class_methods; end
<shevy>
doddok for me it never seemed to be a problem; I usually buy very cheap machines altogether, only thing that I have had looked for where that the RAM was in the 4-8 Gig range
bruce_lee has quit [Read error: Connection reset by peer]
mack25 has quit [Quit: Cya]
weaksauce has joined #ruby
ruurd has quit [Quit: ZZZzzz…]
Xeago has joined #ruby
baweaver has joined #ruby
Xeago has quit [Read error: Connection reset by peer]
mary5030 has quit [Remote host closed the connection]
diegoaguilar has joined #ruby
pdoherty has joined #ruby
ruurd has joined #ruby
Xeago has joined #ruby
IrishGringo has joined #ruby
rgrmatt has quit [Ping timeout: 272 seconds]
rbowlby has quit [Remote host closed the connection]
arescorpio has joined #ruby
BlackCoyote has quit [Remote host closed the connection]
baweaver has quit [Ping timeout: 246 seconds]
allcentury has quit [Ping timeout: 246 seconds]
postmodern has joined #ruby
gambl0re has quit [Read error: Connection reset by peer]
ruurd has quit [Quit: ZZZzzz…]
jetpackjoe has joined #ruby
<postmodern>
what is the defacto way of handling optional dependencies? autoload the constant? Object.const_defined?(:ThatLib) ?
auxbuss has joined #ruby
<postmodern>
require the user require mylib/enable_optional_dependency
ismaelga has quit [Remote host closed the connection]
dmcp_ has quit [Quit: Disconnecting...]
ruurd has joined #ruby
gambl0re has joined #ruby
tref has quit [Quit: tref]
quazimodo has quit [Ping timeout: 240 seconds]
glanzi has quit [Remote host closed the connection]
ruurd has quit [Quit: Bye]
gambl0re has quit [Ping timeout: 265 seconds]
cdg has joined #ruby
sunya7a_ has joined #ruby
FreelancerBR has quit [Quit: Going offline, see ya! (www.adiirc.com)]
Ox0dea has quit [Quit: WeeChat 1.4-dev]
kirun has quit [Remote host closed the connection]
cwong_on_irc has joined #ruby
auxbuss has quit [Quit: ZZZzzz…]
beauby has joined #ruby
waka has joined #ruby
waka has quit [Changing host]
waka has joined #ruby
CBX has joined #ruby
eminencehc has quit [Remote host closed the connection]
<shevy>
probably or do a rescue LoadError perhaps
<postmodern>
shevy, so like require the dependency within the method, if they pass in the option to enable it
Ox0dea has joined #ruby
jetpackjoe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
duncannz has joined #ruby
Jardayn has joined #ruby
gambl0re has joined #ruby
doddok has quit [Quit: Leaving]
<shevy>
hmm
pawnbox has joined #ruby
auxbuss has joined #ruby
jetpackjoe has joined #ruby
<shevy>
I have a few gems where there are a bunch of important dependencies, which must be satisfied; for the other ones, such as local .rb files that are just addons to make it more convenient for me, I do silent begin/rescue and handle the cases where this constant is unavailable, usually via a Object.const_defined? check (or defining a convenience method such as: if available? :AsciiParty; AsciiParty.dance!; en
<shevy>
d; I do this only for small stuff like singular .rb files or small projects, for larger projects I use autoload, it seems to be better for when you have to require big projects with lots of .rb files
jetpackjoe has quit [Max SendQ exceeded]
Channel6 has quit [Quit: Leaving]
CloCkWeRX has joined #ruby
<jhass>
postmodern: I've seen that but also doing it at the top of the file and defining/setting something (constant or value in the gems configuration)
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
or just defined?/ const_defined? in the runtime code
rbowlby has joined #ruby
bihi has joined #ruby
pawnbox has quit [Ping timeout: 250 seconds]
CBX has quit [Quit: Leaving]
EllisTAA has quit [Quit: EllisTAA]
auxbuss has quit [Quit: I'm gone.]
eminencehc has joined #ruby
bb010g has quit [Quit: Connection closed for inactivity]
ta has joined #ruby
cdg has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
icbm has quit [Quit: Leaving]
pandaant has joined #ruby
eminencehc has quit [Remote host closed the connection]
norc has quit [Ping timeout: 246 seconds]
yoongkang has joined #ruby
freerobby has quit [Quit: Leaving.]
maloik has joined #ruby
centrx has quit [Remote host closed the connection]
centrx has joined #ruby
rgrmatt has joined #ruby
ta has quit [Ping timeout: 252 seconds]
yoongkang has quit [Ping timeout: 272 seconds]
solars has quit [Ping timeout: 244 seconds]
maloik has quit [Ping timeout: 250 seconds]
SCHAAP137 has quit [Quit: Leaving]
SCHAAP137 has joined #ruby
yfeldblum has quit [Ping timeout: 240 seconds]
varunwachaspati_ has quit [Quit: Connection closed for inactivity]
lkba has joined #ruby
sgambino has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
s2013 has joined #ruby
sgambino has quit [Client Quit]
Sembei has joined #ruby
cwong_on_irc has quit [Quit: Leaving.]
cwong_on_irc has joined #ruby
maloik has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
saddad has joined #ruby
BTRE has joined #ruby
pawnbox has joined #ruby
guacjack has quit [Ping timeout: 246 seconds]
houhoulis has quit [Remote host closed the connection]
allcentury has joined #ruby
s2013 has joined #ruby
maloik has quit [Ping timeout: 276 seconds]
pawnbox has quit [Ping timeout: 250 seconds]
maloik has joined #ruby
rbowlby has quit [Remote host closed the connection]
DrShoggoth has joined #ruby
rbowlby has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]