skade has quit [Quit: Computer has gone to sleep.]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sneakerhax has quit [Ping timeout: 260 seconds]
ftj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
swills has joined #ruby
mariano has quit [Quit: leaving]
<shevy>
hmm... if we have a string "abcdefghiabcaa" is there a simple way to obtain all positions of "a"? e. g. in an array.. [0,8,11,12] or whatever there
mariano has joined #ruby
GriffinHeart has joined #ruby
<mariano>
hi dudes. I'm implementing a gem to parse proxy servers from many listing websites, and i'm having a hard time when trying to dynamically load classes. If anyone can give me some directions, please message me. Thank you all
mwlang has quit [Quit: mwlang]
<mariano>
I already iterated over all files in the folder, requiring them. But the classes those modules contain can't be reached.
<Ox0dea>
mariano: How do you mean?
<Ox0dea>
If they're namespaced within a module, you'll have to access them with the fully qualified name: `YourModule::YourClass`
htmldrum has joined #ruby
<mariano>
well, i have this folder with several .rb files. Each one of them contains a class. When i open a pry session , I try to access those classes with a fully qualified name, but the most inner namespace (the one that contains the classes) can't be reached
<Ox0dea>
Then it must be the case that you've not loaded the file which introduces that name.
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
<mariano>
i can send you the code to clarify. The module that introduces the classes is named SpecificParsers
<Ox0dea>
Post as much of the code as you figure is relevant to https://gist.github.com/ and share the link here.
<Ox0dea>
You won't be able to recreate your directory structure, though. :/
<mariano>
yes.. would it help more if i share the link to the repo?
<mariano>
or would it bee TMI?
ravishankarjha has quit [Ping timeout: 260 seconds]
<Ox0dea>
That's entirely your prerogative, I suppose.
ravishankarjha has joined #ruby
bruce_lee has joined #ruby
pawnbox has joined #ruby
domgetter has joined #ruby
justin_pdx has joined #ruby
blaxter has quit [Read error: Connection reset by peer]
idefine has quit [Remote host closed the connection]
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ramfjord has joined #ruby
pawnbox has quit [Ping timeout: 260 seconds]
htmldrum has quit [Ping timeout: 252 seconds]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ravishan_ has joined #ruby
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
ravishankarjha has quit [Ping timeout: 250 seconds]
GinoMan2440 has quit [Read error: Connection reset by peer]
GinoMan2440 has joined #ruby
ur5us has quit [Remote host closed the connection]
senayar has quit [Ping timeout: 265 seconds]
krobzaur has joined #ruby
ftj has joined #ruby
FooMunki has quit [Quit: FooMunki]
aeterne has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 244 seconds]
cd83x has quit [Remote host closed the connection]
kristofferR has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ravishankarjha has joined #ruby
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dopamean_ has joined #ruby
ravishan_ has quit [Ping timeout: 260 seconds]
dopamean_ has quit [Client Quit]
dopamean_ has joined #ruby
GriffinHeart has quit []
swills has quit [Remote host closed the connection]
dopamean_ has quit [Client Quit]
dopamean_ has joined #ruby
AyyMDed is now known as Ispira
dopamean_ has quit [Client Quit]
dopamean_ has joined #ruby
swills has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
drewo has joined #ruby
jenrzzz has joined #ruby
CloCkWeRX has joined #ruby
<bazz_>
if I have a module providing library functions (they are all `def self.` methods) .. and calling them in absolute scope is painful for every invocation .. is there a simple way of reducing the "scope-overhead" ? I'd rather not simply include the parent module out of concern of possible including non-class functions that *could* be there (although it is likely not a possibility)
SenpaiSilver has quit [Quit: Leaving]
ramfjord has quit [Ping timeout: 246 seconds]
MrSamuel has joined #ruby
SenpaiSilver has joined #ruby
ftj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<bazz_>
Is my library design alright? I like doing "Library.func" .. but with scoping this can sometimes be "Library::Feature::func" or more
<bazz_>
!s/Feature::/Feature\./
<Kuukunen>
< bazz_> Is my library design alright? I like doing "Library.func" .. but with scoping this can sometimes be "Library::Feature::func" or more
<bazz_>
..
<bazz_>
!s/Feature\:\:/Feature\./
<Kuukunen>
< bazz_> ..
<bazz_>
lol ..
swills has quit [Remote host closed the connection]
northrup has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
swills has joined #ruby
ramfjord has joined #ruby
ledestin has joined #ruby
devbug has quit [Quit: ZZZzzz…]
justin_pdx has quit [Quit: justin_pdx]
symm- has quit [Ping timeout: 260 seconds]
stardiviner has quit [Ping timeout: 252 seconds]
<postmodern>
for CI solutions besides Travis, what do people recommend? CircleCI? Semaphore?
<pipework>
postmodern Also, I might have a couple PR's inc to chruby and ruby-install. I'm using them in an env where it's not just user install, the user has no access to sudo but has brew.
<postmodern>
pipework, ah weird
<pipework>
postmodern: basically, my user is not an admin on this machine (I have the admin user password, but these should work without sudo)
<pipework>
my brew is also installed under these conditions. I've been fixing stuff all day!
hahuang65 has joined #ruby
|2701 has quit [Quit: Connection closed for inactivity]
braincrash has quit [Quit: bye bye]
tildes_ has joined #ruby
jud has quit [Quit: Leaving]
justin_pdx has quit [Quit: justin_pdx]
hahuang65 has quit [Ping timeout: 265 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
xcesariox has joined #ruby
cdg has joined #ruby
braincrash has joined #ruby
twe4ked has quit [Ping timeout: 276 seconds]
pawnbox has joined #ruby
twe4ked has joined #ruby
Lycaonian has quit [Quit: Leaving]
gix has quit [Ping timeout: 252 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
SilverKey has joined #ruby
pawnbox has quit [Ping timeout: 240 seconds]
devbug has quit [Quit: ZZZzzz…]
gix has joined #ruby
krobzaur has joined #ruby
TheHodge has quit [Quit: Connection closed for inactivity]
devbug has joined #ruby
devbug has quit [Client Quit]
xxneolithicxx has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
Azure has quit [Remote host closed the connection]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ule>
shevy: are u there?
<ule>
shevy: I'm trying to understand the reason for that ? on the method definition
<ule>
since ? on the end of methods returns booleans
<baweaver>
ule: it has no real significance as a language feature, only as a pattern most people follow
scottschecter has quit [Remote host closed the connection]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
moeabdol has joined #ruby
davedev24 has quit [Remote host closed the connection]
hahuang65 has quit [Ping timeout: 265 seconds]
greves has joined #ruby
johnmilton has quit [Ping timeout: 246 seconds]
moeabdol has quit [Ping timeout: 276 seconds]
greves has quit [Ping timeout: 265 seconds]
hahuang65 has joined #ruby
rkazak has joined #ruby
UserInNeed has quit [Changing host]
UserInNeed has joined #ruby
hahuang65 has quit [Ping timeout: 260 seconds]
djbkd has joined #ruby
rbennacer has quit [Remote host closed the connection]
saneax_AFK is now known as saneax
johnmilton has joined #ruby
Rickmasta has joined #ruby
slackbotgz has quit [Remote host closed the connection]
diegoviola has quit [Quit: WeeChat 1.5]
Guest43764 has left #ruby ["Leaving"]
rkazak has quit [Quit: Sleep.....ing....]
ramfjord has quit [Ping timeout: 244 seconds]
rubie has joined #ruby
Devalo has joined #ruby
arescorpio has quit [Quit: Leaving.]
ramfjord has joined #ruby
Devalo has quit [Ping timeout: 250 seconds]
hk238 has joined #ruby
Mia has quit [Read error: Connection reset by peer]
Anderson69s has joined #ruby
<bazz_>
are there any good learning resources for building an API in Ruby? Google shows a lot of results for "Web APIs / API wrappers / Rails API" but I just mean .. it more simply.. how to best use the Ruby language when creating my own API abstractions
kareeoleez has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 276 seconds]
ravishankarjha has quit [Remote host closed the connection]
bluOxigen_ has joined #ruby
ravishankarjha has joined #ruby
eljimmy has joined #ruby
lkba has quit [Remote host closed the connection]
Anderson69s has quit [Quit: Time to EAT, SLEEP OR WHATEVER BYE!!!!!]
bluOxigen has quit [Ping timeout: 276 seconds]
Anderson69s has joined #ruby
pawnbox has joined #ruby
Anderson69s has quit [Client Quit]
Anderson69s has joined #ruby
SilverKey has quit [Quit: Halted.]
Anderson69s has quit [Client Quit]
rubie has quit [Remote host closed the connection]
greves has joined #ruby
Anderson69s has joined #ruby
Anderson69s has quit [Client Quit]
pawnbox has quit [Ping timeout: 244 seconds]
cdg has quit [Remote host closed the connection]
bronson has joined #ruby
eljimmy has quit [Quit: This computer has gone to sleep]
cdg_ has joined #ruby
smathy_afk has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sauvin has joined #ruby
greves has quit [Ping timeout: 246 seconds]
tk__ has joined #ruby
<nofxx>
bazz_, get a ORM/ODM for your db of choice, add a serializer thing and just use rack..
<nofxx>
padrino/sinatra... there's a new one only for this kind of stuff iirc
bronson has quit [Ping timeout: 252 seconds]
rkazak has joined #ruby
cdg_ has quit [Ping timeout: 276 seconds]
<bazz_>
nofxx, I don't why you would assume I need a DB ... writing API abstractions is much broader a topic .. and I'm more focused on the language charactertics .. for example a proper strategy to create API functions and override them in Ruby .. I already do it successfully but I feel my method is a little dirty
<bazz_>
so in my world I'm talking about a set of general functions ... with other classes/modules that "override" those general API funcs with implementation details
<nofxx>
well, ruby does that, don't need a fw
<bazz_>
but I'm having trouble properly organizing the material for some reason, hence I'm interested in learning material
<bazz_>
don't need a 'fw' ?
<nofxx>
framework
davedev24 has joined #ruby
xxneolithicxx has quit [Quit: Leaving.]
<bazz_>
Well I already expressed I'm interested in how to best use the Ruby language to write clean APIs ...
yfeldblum has quit [Ping timeout: 276 seconds]
<bazz_>
someone please :3 ^
rehat has quit [Read error: Connection reset by peer]
azor has joined #ruby
ravishankarjha has quit [Remote host closed the connection]
d0lph1n98 has quit [Ping timeout: 240 seconds]
nando293921 has quit [Remote host closed the connection]
tildes_ has joined #ruby
ravishankarjha has joined #ruby
solocshaw has quit [Ping timeout: 260 seconds]
dikaio has joined #ruby
davedev24 has quit [Ping timeout: 276 seconds]
cd83x has quit []
<azor>
How is everyone doing?
<bazz_>
I'm wondering how to write clean interfaces (API) .. in general and in Ruby language
<bazz_>
clean Library interfaces - if that narrowing helps
crameth has quit [Read error: Connection reset by peer]
<baweaver>
problem with distilled information is that it's meant to be brief, not an in detail guide.
moeabdol has quit [Ping timeout: 246 seconds]
<bazz_>
Yeah but this is activating the right parts of my brain
<baweaver>
Also, as with alcohol, the lighter weight you are the harder distilled information is going to hit you
<baweaver>
focus on one thing at a time
tildes_ has quit [Ping timeout: 250 seconds]
cdg has quit [Ping timeout: 276 seconds]
<bazz_>
I do agree with you -- multi-pass over my API with this document is better than a single-digest and attempt
ur5us has joined #ruby
droptone has joined #ruby
tmtwd has joined #ruby
<droptone>
Question: What's a better way to write if !(provider == "service1" || provider == "test2" || provider == "internal3" )
<droptone>
Isn't there a way to leverage .include?
<droptone>
like if !provider.includes?("service1", "test2", "internal3")
<droptone>
The thing is, I want it to match, not just see if the string exists within provider
Yeomra has joined #ruby
bruno- has joined #ruby
<droptone>
If I write ["service1", "test2", "internal3"].any? { |name| provider.include? name } that matches even if part of the string is present in provider
<droptone>
Disregard, I got it by switching .include? with ==
<Ox0dea>
And `10055/100r` if you want a Rational result.
<Ox0dea>
_orangejuice: Sure thing.
symm- has quit [Quit: Leaving...]
<Caerus>
se yaa later #ruby :)
Devalo has joined #ruby
weemsledeux has joined #ruby
matp has quit [Remote host closed the connection]
Caerus is now known as Caerus|Away
moeabdol has quit [Ping timeout: 252 seconds]
davedev24 has quit [Ping timeout: 250 seconds]
drewo has joined #ruby
auxbuss has quit [Quit: ZZZzzz…]
blackmes1 has quit [Ping timeout: 246 seconds]
Devalo has quit [Ping timeout: 250 seconds]
skweek has joined #ruby
karapetyan has quit [Remote host closed the connection]
drewo has quit [Ping timeout: 260 seconds]
auxbuss has joined #ruby
karapetyan has joined #ruby
stannard has joined #ruby
karapetyan has quit [Remote host closed the connection]
Lomex has quit [Remote host closed the connection]
mdw has quit [Quit: Sleeping Zzzzz]
flashpoint9 has quit [Remote host closed the connection]
karapetyan has joined #ruby
GodFather has joined #ruby
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
symm- has joined #ruby
karapetyan has quit [Remote host closed the connection]
dionysus69 has quit [Remote host closed the connection]
stannard has quit [Remote host closed the connection]
senayar has joined #ruby
ramfjord has joined #ruby
saneax_AFK is now known as saneax
dionysus69 has joined #ruby
senayar has quit [Ping timeout: 276 seconds]
blackgoat has joined #ruby
adgtl has quit [Remote host closed the connection]
elaptics`away is now known as elaptics
ur5us has joined #ruby
hahuang65 has joined #ruby
rbennacer has joined #ruby
last_staff has joined #ruby
GodFather has quit [Ping timeout: 276 seconds]
karapetyan has joined #ruby
banister has joined #ruby
bronson has joined #ruby
hahuang65 has quit [Ping timeout: 240 seconds]
mdw has joined #ruby
bluOxigen has joined #ruby
dantevergil has joined #ruby
dantevergil has quit [Max SendQ exceeded]
bluOxigen_ has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
blaxter has joined #ruby
bluOxigen has quit [Ping timeout: 244 seconds]
Emmanuel_Chanel has quit [Ping timeout: 276 seconds]
yaw has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yos7ph has quit [Quit: Leaving]
pawnbox has joined #ruby
ftj has joined #ruby
cdg has joined #ruby
karapetyan has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
Emmanuel_Chanel has joined #ruby
stannard has joined #ruby
adgtl has joined #ruby
drewo has joined #ruby
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blackmes1 has joined #ruby
drewo has quit [Ping timeout: 260 seconds]
karapetyan has joined #ruby
Gasher has joined #ruby
blackmes1 has quit [Ping timeout: 244 seconds]
stannard has quit [Remote host closed the connection]
symm- has quit [Ping timeout: 246 seconds]
d0lph1n98 has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
LoneHermit has joined #ruby
karapetyan has quit [Remote host closed the connection]
stannard has joined #ruby
skweek has quit [Ping timeout: 276 seconds]
LoneHermit has quit [Ping timeout: 260 seconds]
moeabdol has joined #ruby
karapetyan has joined #ruby
greg has joined #ruby
greg has quit [Remote host closed the connection]
skade has joined #ruby
zacstewart has joined #ruby
senayar has joined #ruby
rodfersou has joined #ruby
zacstewart has quit [Ping timeout: 276 seconds]
CloCkWeRX has quit [Ping timeout: 260 seconds]
senayar has quit [Ping timeout: 246 seconds]
yaw has joined #ruby
mostlybadfly has joined #ruby
htmldrum has joined #ruby
ftj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
auxbuss has quit [Quit: ZZZzzz…]
CausaMortis has quit [Ping timeout: 260 seconds]
CloCkWeRX has joined #ruby
User458764 has joined #ruby
zotherstupidguy has quit [Ping timeout: 240 seconds]
akem has quit [Ping timeout: 260 seconds]
<User458764>
Hi, in foo[5].bar, how do you prevent a NoMethodError for nil Object?
pawnbox has quit [Remote host closed the connection]
<User458764>
I know I can do a unless div[5] end but is it exists a one line code which return ""
pawnbox has joined #ruby
auxbuss has joined #ruby
akem has joined #ruby
DoubleMalt has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
LoneHerm_ has joined #ruby
wof has joined #ruby
htmldrum has quit [Ping timeout: 252 seconds]
<shevy>
User458764 perhaps via .try or the lonely operator &. - I would however had check first whether I would have a nil object there, nil objects do not respond to [] method
<User458764>
shevy thanks I didn't .try method I solved my problem with a ternary operator but I will also check your solution
skade has quit [Quit: Computer has gone to sleep.]
nanoz has joined #ruby
tmtwd has joined #ruby
davedev24 has joined #ruby
drewo has quit [Ping timeout: 276 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
bluOxigen_ has joined #ruby
rbennacer has quit [Remote host closed the connection]
bluOxigen has quit [Ping timeout: 260 seconds]
ftj has joined #ruby
idletask has quit [Quit: .]
Pupeno has joined #ruby
LoneHerm_ has quit [Remote host closed the connection]
davedev24 has quit [Ping timeout: 276 seconds]
blackmes1 has joined #ruby
rubie has joined #ruby
Emmanuel_Chanel_ has joined #ruby
blackgoat has quit [Quit: WeeChat 1.4]
rubie has quit [Remote host closed the connection]
Emmanuel_Chanel has quit [Ping timeout: 260 seconds]
blackmes1 has quit [Ping timeout: 252 seconds]
charliesome has joined #ruby
naftilos76 has joined #ruby
Chachi has joined #ruby
stannard has quit [Remote host closed the connection]
Emmanuel_Chanel_ is now known as Emmanuel_Chanel
auxbuss has quit [Quit: ZZZzzz…]
yos7ph has joined #ruby
stannard has joined #ruby
ftj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
davedev24 has joined #ruby
yos7ph has quit [Client Quit]
CloCkWeRX has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
stannard has quit [Remote host closed the connection]
tmtwd has quit [Ping timeout: 276 seconds]
akem has quit [Quit: Quitte]
stannard has joined #ruby
tk__ has quit [Quit: ばいばい]
auxbuss has joined #ruby
idefine has joined #ruby
blackmes1 has joined #ruby
senayar has joined #ruby
jhack has joined #ruby
crameth has joined #ruby
nicoulaj has joined #ruby
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
banister has joined #ruby
zacstewart has joined #ruby
idefine has quit [Ping timeout: 276 seconds]
<_orangejuice>
I have a Customer class with :name, etc. instance variables and a Order class with :id, :customer_name. How do I let the new_order = Order.new grab the customer from the Customer class?
senayar has quit [Ping timeout: 244 seconds]
<_orangejuice>
Usually this is done with foreign keys in a DB. I'm trying to learn by building a standalone ruby program.
dmr8 has joined #ruby
<apeiros>
_orangejuice: :foo is a symbol, not an instance variable. @foo is an instance variable.
<_orangejuice>
I meant attr_accessor :name, :email
<apeiros>
"the customer from the Customer class" makes no sense to me. did you mean the name?
<apeiros>
otherwise: Customer.new gives you a customer instance.
zacstewart has quit [Ping timeout: 260 seconds]
<_orangejuice>
Yes a reference of the who the customer is for that order.
<apeiros>
not sure where the db comes in either - unless you leave out massive amounts of context…
auxbuss has quit [Quit: I'm gone.]
<apeiros>
well, you'd probably either pass it in in the constructor, or you'd have an accessor
yos7ph has joined #ruby
<apeiros>
class Order; def initialize(customer); @customer = customer; end; end; order = Order.new(Customer.new)
hahuang65 has joined #ruby
<_orangejuice>
Thats what I was trying to understand.
Chachi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<_orangejuice>
That makes sense. For Order.new can I already access instance variables for an existing Customer instance?
<_orangejuice>
*from an existing customer instance
<_orangejuice>
Sorry If I'm not articulating correctly.
<apeiros>
you can access their accessors (methods)
<apeiros>
you can't access ivars from "outside" in ruby (which is why you have to define accessors, or write that kind of methods yourself)
stannard has quit [Remote host closed the connection]
<apeiros>
nb, `attr_accessor :foo` is equivalent to `def foo; return @foo; end; def foo=(value); @foo = value; end`
yos7ph has quit [Client Quit]
<apeiros>
i.e., it just defines two methods for you.
rodferso1 has joined #ruby
hahuang65 has quit [Ping timeout: 246 seconds]
codecop has joined #ruby
bronson has joined #ruby
mariano has joined #ruby
<_orangejuice>
Ok. I misunderstood them as variables. That makes sense. So how does one create a bunch of customers (objects). Then later if one wants to create an order from the existing customers.
rodfersou has quit [Ping timeout: 250 seconds]
firstdayonthejob has joined #ruby
<apeiros>
customer = Customer.new; order = Order.new(customer)
<_orangejuice>
I understand attr_accessor :name, :email are getter and setter methods
<apeiros>
yes, defines #name(), #name=(value), #email and #email=(value) methods which set and read @name and @email
<_orangejuice>
That seems straightforward. What memory is that customer stored it? Thats why I bought up databases.
<_orangejuice>
Thank you apeiros. I appreciate you mapping your answer to my problem.
bronson has quit [Ping timeout: 252 seconds]
<apeiros>
variables are ram
drewo has joined #ruby
<apeiros>
if you want to persist the data, you need some kind of serialization in order to store your objects to a file or a db (which in the end will be a file / files too)
bruno- has quit [Ping timeout: 240 seconds]
duderonomy has quit [Ping timeout: 265 seconds]
bruno- has joined #ruby
<_orangejuice>
I see. Very cool. This makes a lot of sense. So in a typical web form, I'll collect/parse customer data, store it in a local variable, then database. For a order, grab customer data stuff from the database, since my local variables are clueless?
drewo has quit [Ping timeout: 246 seconds]
<apeiros>
yes, in a typical web-app you'll use a db for persistency and populate your variables from that and/or from the form input
<_orangejuice>
:) Thank you apeiros
duderonomy has joined #ruby
hck89 has joined #ruby
<mariano>
hi all. I'm having an odd problem with pry and requiring many files by iterating them. When I start pry and run the require line manually, the require is made correctly. But if i comment out the pry call and just run the code, the require doesn't seem to work. If anyone can give me a hand, i will provide a gist. Thank you all in advance.
senayar has joined #ruby
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
bruno- has quit [Ping timeout: 252 seconds]
Lomex has joined #ruby
<mariano>
is it possible that pry is making the require statement work when it normally would not?
kareeoleez has quit [Remote host closed the connection]
karapetyan has quit [Ping timeout: 276 seconds]
GodFather has joined #ruby
Lomex has quit [Ping timeout: 260 seconds]
sarbs_ has joined #ruby
sarbs has quit [Ping timeout: 252 seconds]
sarbs_ is now known as sarbs
Yiota_ has quit [Client Quit]
kareeoleez has joined #ruby
rafadc has joined #ruby
kareeoleez has quit [Remote host closed the connection]
kareeoleez has joined #ruby
yaw has quit [Read error: Connection reset by peer]
Yiota_ has joined #ruby
LoneHermit has joined #ruby
htmldrum has joined #ruby
karapetyan has joined #ruby
stardiviner has quit [Quit: Code, Sex, Just fucking world.]
rafadc has quit [Remote host closed the connection]
GodFather has quit [Ping timeout: 240 seconds]
karapetyan has quit [Remote host closed the connection]
rafadc has joined #ruby
karapetyan has joined #ruby
wldcordeiro has quit [Ping timeout: 252 seconds]
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
yaw has joined #ruby
LoneHermit has quit [Remote host closed the connection]
karapetyan has quit [Remote host closed the connection]
JoshGlzBrk has joined #ruby
hosttor` has quit [Read error: Connection reset by peer]
Caerus|Away has quit [Ping timeout: 276 seconds]
Yiota_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
blackmes1 has quit [Ping timeout: 260 seconds]
Yiota_ has joined #ruby
fedexo has joined #ruby
Caerus|Away has joined #ruby
GodFather has joined #ruby
the_drow has joined #ruby
felltir has joined #ruby
elifoster has joined #ruby
lukeholder has joined #ruby
wldcordeiro has joined #ruby
the_drow has quit [Read error: Connection reset by peer]
yaw has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<KrzaQ>
Is there a way to use the return value of a block in string.scan?
Ishido has joined #ruby
<KrzaQ>
'cruel world 123'.scan(/[a-z]+/){|w| w.reverse }.join(' ') <-- I'd like it to become 'leurc dlrow'
yaw has joined #ruby
Yiota_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
the_drow has joined #ruby
the_drow has quit [Max SendQ exceeded]
the_drow has joined #ruby
blur3d has quit [Quit: blur3d]
sepp2k has quit [Ping timeout: 265 seconds]
sepp2k1 has joined #ruby
ta_ has quit [Read error: Connection reset by peer]
SCHAAP137 has quit [Quit: Leaving]
nanoz has quit [Read error: Connection reset by peer]
ta_ has joined #ruby
<shevy>
hmm
<shevy>
was that not the use case of itself or tap or something along those lines?
Yiota_ has joined #ruby
drewo has joined #ruby
htmldrum has quit [Ping timeout: 260 seconds]
krobzaur has joined #ruby
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
BTRE has quit [Ping timeout: 260 seconds]
<KrzaQ>
I don't understand
lxsameer has joined #ruby
haxrbyte_ has quit [Read error: Connection reset by peer]
<KrzaQ>
the docs only show examples with printing
haxrbyte has joined #ruby
LoneHerm_ has joined #ruby
<KrzaQ>
I have another question, hopefully not stupid: I have a list of filenames, I want only those that exist. I can use the clunky block version, but I'd much rather use .select(&:File.exists?) <-- is there a way to make it work?
P4Titan has joined #ruby
<shevy>
not with the & when you require arguments
stannard has joined #ruby
LoneHerm_ has quit [Remote host closed the connection]
hck89 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<_orangejuice>
initializing
<Ox0dea>
_orangejuice: You have to make them keyword arguments.
the_drow has joined #ruby
P4Titan has left #ruby ["party"]
Coldblackice has quit [Ping timeout: 244 seconds]
cdg has quit [Remote host closed the connection]
minimalism has joined #ruby
Rodya_ has quit [Remote host closed the connection]
lkba has quit [Remote host closed the connection]
<_orangejuice>
Ox0dea: I tried initialize (args), each block, instance_variable_set k, v.
zacstewart has joined #ruby
<Ox0dea>
_orangejuice: Now you should try making `name` and `email` keyword arguments.
drewo has joined #ruby
Ocratech has quit [Read error: Connection reset by peer]
rafadc has joined #ruby
Ocratech has joined #ruby
felltir has quit [Remote host closed the connection]
Vingador has quit [Ping timeout: 246 seconds]
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
symm- has joined #ruby
rafadc has quit [Remote host closed the connection]
zacstewart has quit [Ping timeout: 250 seconds]
felltir has joined #ruby
the_drow has quit [Read error: Connection reset by peer]
felltir has quit [Client Quit]
Rodya_ has joined #ruby
<shevy>
mariano one simple explanation can be that Dir[] there returns an empty array
Nanuq has joined #ruby
cdg has joined #ruby
<mariano>
oh yes, but strangely, it doesn't when i run it from the pry session
hahuang65 has joined #ruby
lukeholder has joined #ruby
<mariano>
if i copy/paste the line while in the pry session, it returns a list of required files
<mariano>
but when i run the whole .rb file it doesn not get executed.
<mariano>
really odd
rafadc has joined #ruby
yude_ has joined #ruby
the_drow has joined #ruby
the_drow has quit [Max SendQ exceeded]
<shevy>
probably because you rely on __FILE__ there
Azure has joined #ruby
yude has quit [Ping timeout: 276 seconds]
Rodya_ has quit [Ping timeout: 276 seconds]
the_drow has joined #ruby
hahuang65 has quit [Ping timeout: 265 seconds]
<shevy>
if you have it installed and lay out as a gem-structured project, what I often do is to just ask the project where it is like... if your project is called foobar ... Dir[Foobar.base_dir?+'specific_parsers/*.rb'].each or something like that (when I have such a method
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
_orangejuice: You misspelled `initialize` there.
rafadc has quit [Remote host closed the connection]
mdw has joined #ruby
<_orangejuice>
Wow! Thats 2 hours of my life that won't come back. Thanks Ox0dea
<Ox0dea>
mariano: Be advised that on 2.0+, you can use Kernel#__dir__ as an easy way to get hold of the directory in which the currently executing file lives.
<Ox0dea>
_orangejuice: Use pain as a teacher.
<Ox0dea>
Sorry about missing that in your first paste. :/
<_orangejuice>
I've been at it for a while. Thanks :((
<Ox0dea>
brent__: It used to be $boom2; now it's $boom6.
<Ox0dea>
Mystery solved.
<brent__>
when i use $SAFE, it passes the first test and fails
rbennacer has quit [Remote host closed the connection]
<Ox0dea>
?!
<brent__>
the 2nd
<Ox0dea>
brent__: Maybe step away from the keyboard a bit.
<Ox0dea>
Clear your head.
johnny56 has joined #ruby
<brent__>
lol
Pupeno has joined #ruby
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
finisherr has left #ruby [#ruby]
<Ox0dea>
I realize that $SAFE is a vaguely relevant identifier here, but it's pretty obvious that $boom<x> is the one you're after.
<brent__>
yeah that was my initial though
<brent__>
since it's changing
<brent__>
however it failed all the tests
<Ox0dea>
You have to extract the value stored in the global.
<Ox0dea>
The answer won't be 2; it'll be whatever's in $boom2.
<brent__>
i understand that
nando293921 has quit [Ping timeout: 276 seconds]
johnny56_ has quit [Ping timeout: 264 seconds]
UserInNeed is now known as [-__-]
moeabdol has joined #ruby
<brent__>
had to learn eval
chouhoulis has joined #ruby
Pupeno has quit [Ping timeout: 276 seconds]
idefine has quit [Remote host closed the connection]
zenlot has joined #ruby
<brent__>
i was using global_variables.grep/boom/ to find it and then pass it, but didn't realize i was passing it as a symbol the firs ttime
<Ox0dea>
Ah, right.
<Ox0dea>
There really ought to be Kernel#global_variable_get.
ur5us has joined #ruby
zenlot6 has quit [Ping timeout: 246 seconds]
Rodya_ has joined #ruby
SilverKey has quit [Quit: Halted.]
Pupeno has joined #ruby
moeabdol has quit [Ping timeout: 252 seconds]
kareeoleez has quit [Remote host closed the connection]
<brent__>
is there another way to have turned that symbol into a it's var name, or extract the value from ti?
<brent__>
x = global_variables.grep /boom/ $wireCode = eval(x.first.to_s) is what i did
chouhoulis has quit [Ping timeout: 250 seconds]
idefine has joined #ruby
CloCkWeRX has joined #ruby
ddffg has joined #ruby
Devalo has joined #ruby
<Ox0dea>
None of which I'm aware. I suspect you could use Fiddle to get a pointer into the global variable table and seek around for the matching VALUE, but that's overkill.
Rodya_ has quit [Ping timeout: 250 seconds]
Trynemjoel has quit [Ping timeout: 264 seconds]
skweek has joined #ruby
idefine has quit [Remote host closed the connection]
johnny56 has quit [Read error: Connection reset by peer]
rubie has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
SilverKey has joined #ruby
choke has joined #ruby
johnny56 has joined #ruby
Rodya_ has joined #ruby
Devalo has quit [Ping timeout: 250 seconds]
bruno- has joined #ruby
rubie has quit [Ping timeout: 252 seconds]
codecop has quit [Remote host closed the connection]
<brent__>
well thanks for your help Ox0dea, must of thought iw as crazy not trying boom
<Ox0dea>
brent__: Only for a second or two. :P
<Ox0dea>
(Okay, ten-ish.)
Jackneill has quit [Ping timeout: 260 seconds]
Rodya_ has quit [Read error: No route to host]
Rodya_ has joined #ruby
blackmes1 has joined #ruby
rafadc has joined #ruby
LoneHermit has quit [Remote host closed the connection]
<brent__>
lol
<Ox0dea>
At any rate, treat that kata as having taught you some things to never do. :P
<brent__>
uggh, been struggling w/ some of the 3/4 kyu katas
Rodya_ has quit [Remote host closed the connection]
senayar has joined #ruby
rafadc has quit [Ping timeout: 252 seconds]
nando293921 has joined #ruby
<brent__>
Ox0dea: what is your favorite place for practice problems?
blackmes1 has quit [Ping timeout: 246 seconds]
<Ox0dea>
brent__: I enjoyed Ruby Quiz when it was a thing.
hahuang65 has joined #ruby
duncannz has joined #ruby
senayar has quit [Ping timeout: 244 seconds]
pawnbox has quit [Ping timeout: 244 seconds]
houhoulis has quit [Remote host closed the connection]
hahuang65 has quit [Ping timeout: 250 seconds]
houhoulis has joined #ruby
houhouli_ has joined #ruby
spider-mario has quit [Remote host closed the connection]
houhouli_ has quit [Remote host closed the connection]
rafadc has joined #ruby
houhouli_ has joined #ruby
<brent__>
what about now?
millerti has joined #ruby
houhoulis has quit [Ping timeout: 265 seconds]
houhoulis has joined #ruby
_blizzy_ has joined #ruby
<Ox0dea>
I had ~120 Project Euler solutions, but then they went down for a while and I forgot my credentials.
flashpoint9 has joined #ruby
_blizzy_ has quit [Remote host closed the connection]
<brent__>
can you see other peoples solutions on project eueler?
<Ox0dea>
If they post them in the forum, sure.
choke has quit [Ping timeout: 276 seconds]
firstdayonthejob has quit [Ping timeout: 276 seconds]
charliesome has joined #ruby
houhouli_ has quit [Ping timeout: 260 seconds]
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gchaos has quit [Ping timeout: 260 seconds]
northrup has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
prab97 has joined #ruby
gchaos has joined #ruby
stardiviner has joined #ruby
ledestin has joined #ruby
sp4rrow_ has quit [Ping timeout: 260 seconds]
sp4rrow has joined #ruby
solocshaw has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
sp4rrow has quit [Client Quit]
flashpoint9 has joined #ruby
yude has quit [Read error: Connection timed out]
biberu has quit [Read error: Connection reset by peer]
millerti has joined #ruby
rbennacer has joined #ruby
yude has joined #ruby
yude has quit [Max SendQ exceeded]
SilverKey has quit [Remote host closed the connection]
SilverKey has joined #ruby
pibby has quit [Quit: leaving]
dsuper7 has joined #ruby
Ebok has joined #ruby
kirun has quit [Quit: Client exiting]
rbennacer has quit [Remote host closed the connection]