<adingman>
The only reason I care about redefining existing operations is that using the ones defined on string returns an object of class string rather than my subclass.
<Ox0dea>
adingman: The link addresses that concern.
<adingman>
thanks
<Ox0dea>
Near the bottom, if you're in a hurry.
<adingman>
hurry and learning to do things "right" in this language are warring with each other.
<shevy>
just use a hack then
<Ox0dea>
Use three hacks for maximum efficaciousness.
ramfjord has quit [Ping timeout: 260 seconds]
ESpiney has joined #ruby
andywojo has quit [Ping timeout: 265 seconds]
domgetter has joined #ruby
dlitvak has quit [Ping timeout: 246 seconds]
n0vo has joined #ruby
n0vo has joined #ruby
dlitvak has joined #ruby
<adingman>
I'm utterly befuddled by the "solutions".
annomander has joined #ruby
<Ox0dea>
Delegate is pretty "magical", but it's just what you want.
<Ox0dea>
Ergo, consider taking the time to figure out what's going on. :P
<adingman>
:-)
<Ox0dea>
But preferably *not* by using the source, Luke, in this case.
<adingman>
If I inherit from SimpleDelegator, where am I telling it what class to delegate to?
<shevy>
huh
<shevy>
"A concrete implementation of Delegator, this class provides the means to delegate all supported method calls to the object passed into the constructor and even to change the object being delegated to at a later time with #__setobj__."
<annomander>
also, I've got an object that I'm trying to pass as an argument to a function. that object has an attribute 'attr'. For that function to access 'attr' I absolutely need something like 'attr_reader attr' as part of my class, right?
tectonic has quit []
<p1k>
the example at the top of the docs I assumed applied to both, but I guess I didn't look further down
<domgetter>
annomander: either that or an explicit method named attr that returns the value of @attr
<domgetter>
annomander: and it would be attr_reader :attr
<Ox0dea>
annomander: You could also use #instance_variable_get, but you probably shouldn't just yet.
<domgetter>
You need the colon before the attribute name
<annomander>
thanks
<domgetter>
yea don't use #instance_variable_get except for educational reasons
<Ox0dea>
?
<domgetter>
oooorrr, you're making some weird new framework and you need to access things in a weird way
Axy has joined #ruby
Axy has quit [Changing host]
Axy has joined #ruby
paul___ has quit [Remote host closed the connection]
nkwsy has joined #ruby
braincra- has quit [Quit: bye bye]
Mia has quit [Ping timeout: 250 seconds]
<adingman>
Ox0dea, sortof. Anyone who uses this code to secure data would have to be an idiot.
<Ox0dea>
That's valid Ruby code. Draw what conclusions you will. :P
dextertzu has joined #ruby
<domgetter>
That it has a bit of Perl in it? ;)
grassdog_ has joined #ruby
s00pcan has quit [Remote host closed the connection]
<doni>
Hello guys, I am new here, I want to know that is there any guide for how to develop ruby-core, what I am doing is adding a feature the ruby-core/lib/csv.rb, but I have no idea to test the feature, So I want a guide for this.
KennethSteel has quit [Remote host closed the connection]
cajone_afk is now known as cajone
<doni>
domgetter: Thanks, I will take a look.
<domgetter>
doni: I just tweeted Aaron Patterson if he knows any good guides to set up a testing environment for contributing to Ruby. If he responds, you can see it here: https://twitter.com/domgetter/status/679533532411133952
dr3w has joined #ruby
<domgetter>
He is (or at least was) on the Ruby core team
bronson has quit [Remote host closed the connection]
Ox0dea has quit [Quit: WeeChat 1.4-dev]
p1k has quit [Ping timeout: 256 seconds]
emilkarl has joined #ruby
dopie has quit [Quit: Lost terminal]
dopie has joined #ruby
ta has quit [Ping timeout: 255 seconds]
emilkarl has quit [Client Quit]
skcin7 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chouhoulis has joined #ruby
dwfait has joined #ruby
pocketprotector is now known as t_
t_ is now known as pocketprotector
certainty has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dopie has quit [Quit: leaving]
tlarevo has joined #ruby
tlarevo has quit [Remote host closed the connection]
dopie has joined #ruby
h99h9h88 has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
fullofcaffeine has joined #ruby
devoldmx has joined #ruby
duckpuppy has joined #ruby
dopie has quit [Client Quit]
qiukun has joined #ruby
devoldmx_ has quit [Ping timeout: 260 seconds]
dopie has joined #ruby
PedramT has joined #ruby
edj_ has joined #ruby
certainty has quit [Ping timeout: 246 seconds]
duckpuppy has quit [Ping timeout: 245 seconds]
harushimo has quit [Quit: Leaving]
arescorpio has quit [Quit: Leaving.]
<camus>
Hello, I have a list of my customer emails and I'm querying an API that will let me know which are the most active on social media. The API returns JSON, I made a mistake and forgot to cache the email address associated w/ each result.
<camus>
Could someone please help me figure out how I store the email address I'm interpolating with the corresponding JSON result I'm writing locally?
framling has joined #ruby
PedramT has quit [Remote host closed the connection]
adgtl has joined #ruby
krz has quit [Ping timeout: 272 seconds]
PedramT has joined #ruby
p1k has joined #ruby
houhoulis has quit [Remote host closed the connection]
cwong_on_irc has joined #ruby
idefine has joined #ruby
ramfjord has quit [Ping timeout: 246 seconds]
moeabdol has joined #ruby
PedramT has quit [Remote host closed the connection]
c355e3b has quit [Quit: Connection closed for inactivity]
<n0vo>
How come when I check out TCPSocket on rubydocs it only shows two methods yet when I see other peoples code examples I seed things like .accept and .read and stuff
tubulife- has quit [Ping timeout: 260 seconds]
vdamewood has joined #ruby
edj_ has quit [Quit: Page closed]
p1k has quit [Ping timeout: 245 seconds]
dr3w has quit [Ping timeout: 244 seconds]
nbdy has joined #ruby
krz has joined #ruby
bkxd has joined #ruby
darkf has joined #ruby
<shevy>
n0vo it may subclass another class that offers these methods perhaps
smactive has quit [Remote host closed the connection]
<shevy>
here is the ancestor chain [TCPSocket, IPSocket, BasicSocket, IO, File::Constants, Enumerable, Object, Kernel, BasicObject]
grassdog_ has joined #ruby
michaeldeol has joined #ruby
certainty has joined #ruby
idefine has joined #ruby
dwfait has quit [Quit: dwfait]
bronson has joined #ruby
ta has joined #ruby
PedramT has quit [Remote host closed the connection]
siddharth has quit [Quit: Connection closed for inactivity]
Ishido has joined #ruby
adgtl has joined #ruby
idefine has joined #ruby
rodfersou has joined #ruby
Kn|t3 has joined #ruby
shanemcd has joined #ruby
Ishido has quit [Read error: Connection reset by peer]
Ishido has joined #ruby
karapetyan has joined #ruby
moeabdol has quit [Ping timeout: 265 seconds]
ElFerna has joined #ruby
adgtl has quit [Ping timeout: 260 seconds]
htmldrum has quit [Ping timeout: 256 seconds]
idefine has quit [Ping timeout: 245 seconds]
the_nick_me has joined #ruby
devoldmx has joined #ruby
shanemcd has quit [Ping timeout: 260 seconds]
sdothum has joined #ruby
lubekpl has joined #ruby
devoldmx has quit [Ping timeout: 255 seconds]
andywojo has joined #ruby
Kn|t3 has quit [Quit: Kn|t3]
ElFerna has quit [Ping timeout: 260 seconds]
ElFerna has joined #ruby
emilkarl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chussenot has quit [Quit: chussenot]
aibot has joined #ruby
jbrhbr1 has quit [Quit: Leaving.]
andywojo has quit [Ping timeout: 260 seconds]
ruu_ has joined #ruby
bnizzle1 has left #ruby [#ruby]
Kn|t3 has joined #ruby
nfk|laptop has joined #ruby
<fexilal>
+32.0
<fexilal>
0
idefine has joined #ruby
pawnbox has quit [Remote host closed the connection]
symm- has joined #ruby
pawnbox has joined #ruby
rgtk has joined #ruby
dlitvak has joined #ruby
qiukun has quit [Quit: qiukun]
blackmesa has quit [Ping timeout: 240 seconds]
symm- has quit [Client Quit]
idefine has quit [Ping timeout: 256 seconds]
dlitvak_ has quit [Ping timeout: 250 seconds]
pawnbox has quit [Ping timeout: 245 seconds]
Kn|t3 has quit [Quit: Kn|t3]
rgtk has quit [Ping timeout: 246 seconds]
ElFerna has quit [Ping timeout: 260 seconds]
solenoids has quit [Ping timeout: 272 seconds]
moeabdol has joined #ruby
radgeRayden has quit [Ping timeout: 250 seconds]
chouhoulis has joined #ruby
tubuliferous_ has joined #ruby
mlangenberg has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
moeabdol has quit [Client Quit]
Axy has quit [Ping timeout: 265 seconds]
<mlangenberg>
Is this the best way to initialize an anonymous struct multiple times? `People = %w(Amy Bob Charles).map { |n| Struct.new(:name).new(n) }`
BSaboia has quit [Ping timeout: 276 seconds]
<mlangenberg>
I noticed the syntax for this in Go is really elegant. Wondering about a Ruby version.
tubuliferous_ has quit [Ping timeout: 255 seconds]
BSaboia has joined #ruby
Zamerick_ has joined #ruby
Bloomer has quit [Remote host closed the connection]
chussenot has joined #ruby
moeabdol has joined #ruby
adgtl has joined #ruby
radgeRayden has joined #ruby
mlangenberg has quit [Quit: mlangenberg]
TheHodge has joined #ruby
adgtl_ has joined #ruby
adgtl_ has quit [Client Quit]
rgtk has joined #ruby
jcdesimp has quit [Remote host closed the connection]
adgtl has quit [Ping timeout: 264 seconds]
duckpuppy has joined #ruby
solenoids has joined #ruby
sigurding has quit [Ping timeout: 265 seconds]
blackmesa has joined #ruby
themsay has joined #ruby
pawnbox has joined #ruby
minimalism has quit [Quit: minimalism]
duckpuppy has quit [Ping timeout: 240 seconds]
FooMunki has joined #ruby
jschmid has joined #ruby
adgtl has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
mlangenberg has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
<soahccc>
mlangenberg: personally I very rarely see the use of Struct/OpenStruct in ruby... Generally you have your own classes so that you can add, whenever you like, more methods, attributes, etc.
ElFerna has joined #ruby
htmldrum has joined #ruby
dlitvak_ has joined #ruby
dlitvak has quit [Ping timeout: 246 seconds]
FooMunki has quit [Quit: FooMunki]
<mlangenberg>
Okay, I use Struct quite often. OpenStruct not so much.
BrunoSaboia has joined #ruby
<mlangenberg>
a Struct can be used for grouping related arguments or attributes in a hash.
p1k has joined #ruby
last_staff has quit [Read error: Connection reset by peer]
<DefV>
I don't get how the #include? on a range of date isn't fixed yet
<yxhuvud>
defv: use cover?
<DefV>
why
<yxhuvud>
because it works.
<DefV>
what's the use case anyone would want to use include? over cover? ?
chouhoulis has quit [Ping timeout: 260 seconds]
conta has joined #ruby
bubbys has quit [Ping timeout: 246 seconds]
gregf has joined #ruby
<shevy>
I remember that lots of blog entries have shown examples via .include? but I haven't seen one showing .cover? yet
shanemcd_ has joined #ruby
ramfjord has joined #ruby
shanemcd has quit [Ping timeout: 276 seconds]
dlitvak has quit [Ping timeout: 264 seconds]
agit0 has joined #ruby
yardenbar has quit [Ping timeout: 276 seconds]
PedramT has joined #ruby
Abhijit has joined #ruby
<Abhijit>
hi
dlitvak has joined #ruby
RealLinuX has quit [Quit: Leaving]
<Abhijit>
i am trying to install this gem for my rails project. https://github.com/edgarjs/ajaxful-rating i tried manually with gem install and also by including it in my projects gemfile and bundle. but it do not create any scripts folder and there is no generate scripts on scripts folder of !/.rsm
<Abhijit>
~/.rvm
lacuna has joined #ruby
lacuna has quit [Changing host]
lacuna has joined #ruby
xet7 has joined #ruby
cpup has joined #ruby
bweston92 has quit [Read error: Connection reset by peer]
shanemcd_ has quit [Read error: Connection reset by peer]
PedramT has quit [Ping timeout: 255 seconds]
agit0 has quit [Quit: zzzZZZ….]
Abhijit has quit [Quit: Bye.]
ramfjord has quit [Ping timeout: 245 seconds]
hxegon has joined #ruby
shanemcd has joined #ruby
synthroid has quit [Remote host closed the connection]
ElFerna has joined #ruby
agit0 has joined #ruby
dlitvak has quit [Remote host closed the connection]
dlitvak has joined #ruby
Mon_Ouie has quit [Quit: WeeChat 1.3]
chussenot has joined #ruby
elaptics is now known as elaptics`away
karapetyan has quit [Remote host closed the connection]
pandaant has quit [Remote host closed the connection]
duckpuppy has joined #ruby
Fezzler has joined #ruby
scepticulous has quit [Ping timeout: 240 seconds]
tvon has quit [Quit: leaving]
cdg has quit [Remote host closed the connection]
BSaboia has joined #ruby
kies^ has joined #ruby
renderfu_ has joined #ruby
elaptics`away is now known as elaptics
timonv has joined #ruby
hectortrope has joined #ruby
elaptics is now known as elaptics`away
arup_r has joined #ruby
renderf__ has quit [Ping timeout: 250 seconds]
Guest32 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lacuna has quit [Remote host closed the connection]
vondruch has quit [Quit: Ex-Chat]
devoldmx has joined #ruby
atomical_ has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
lacuna has joined #ruby
lacuna has quit [Changing host]
lacuna has joined #ruby
morfin60 is now known as morfin
zdman135 has joined #ruby
renderfu_ has quit [Read error: Connection reset by peer]
renderfu_ has joined #ruby
<thoraxe>
https://gist.github.com/thoraxe/e8884a1b1fb7a1a4ed18 - given an array of objects like these, I'm trying to find any object in the array that has a particular list id **and** a particular card label with a particular id
<thoraxe>
so in essence I'm trying to find objects in somearray where :list_id=>"565c88490972e1a33c359a6d" and :card_labels has an element with "id"=>"54d4de9c74d650d5671cb3c7"
<thoraxe>
i can do this with iteration, but I'm sure there's a more sexy ruby way to do it
dlitvak has quit [Remote host closed the connection]
polishdub has joined #ruby
atomical has quit [Ping timeout: 260 seconds]
devoldmx has quit [Ping timeout: 255 seconds]
chouhoulis has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
hinbody has quit [Quit: leaving]
Ishido has joined #ruby
nfk|laptop has joined #ruby
skade has quit [Ping timeout: 265 seconds]
fullofcaffeine has joined #ruby
tvon has joined #ruby
dualbus has quit [Quit: WeeChat 1.2]
baroquebobcat has quit [Quit: baroquebobcat]
skade has joined #ruby
dlitvak has joined #ruby
vikas027 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Contigi has joined #ruby
jbrhbr has joined #ruby
marr has quit [Read error: Connection reset by peer]
tvon has quit [Client Quit]
senayar has quit []
ElFerna has quit [Ping timeout: 276 seconds]
bradleyprice has joined #ruby
<thoraxe>
looks like enumerable/select
<thoraxe>
just trying to figure out the combination
Rodya_ has joined #ruby
hectortrope has quit [Remote host closed the connection]
dlitvak has quit [Ping timeout: 276 seconds]
aegis3121 has joined #ruby
tvon has joined #ruby
elaptics`away is now known as elaptics
synthroid has joined #ruby
baroquebobcat has joined #ruby
solocshaw has joined #ruby
bradleyprice has quit [Ping timeout: 245 seconds]
skade has quit [Ping timeout: 255 seconds]
rgtk has joined #ruby
Kn|t3 has quit [Ping timeout: 264 seconds]
Kn|t3 has joined #ruby
davejlong has joined #ruby
edwinvdgraaf has quit [Ping timeout: 264 seconds]
ascarter has joined #ruby
atomical has joined #ruby
rgtk has quit [Ping timeout: 246 seconds]
ramfjord has joined #ruby
<thoraxe>
sprint_lists[1].cards[1].card_labels.include? ("id"=>"54d4de9c74d650d5671cb3c7") hmm this doesn't work
the_nick_me has joined #ruby
lacuna has quit [Remote host closed the connection]
conta has quit [Read error: Connection reset by peer]
atomical_ has quit [Ping timeout: 246 seconds]
conta has joined #ruby
skade has joined #ruby
paradoja has joined #ruby
Hounddog has quit [Remote host closed the connection]
<shevy>
thoraxe .include? is too simplistic
<thoraxe>
yeah i think i need some weird find nested with something else
<thoraxe>
well, depends on what you mean by "proper"
<apeiros>
after all, you're poking around in arrays of hashes of arrays of whatever
elaptics is now known as elaptics`away
jmdade has joined #ruby
<apeiros>
"using X" btw. isn't an excuse to come up with classes yourself :-p
<thoraxe>
not sure what you know about trello, but basically a card can have labels. those labels themselves are a bunch of key/value info
<apeiros>
+not
cassioscabral has quit [Read error: Connection reset by peer]
<thoraxe>
so, with this particular gem, the card's object has a card_labels attribute that is an array of hashes
<apeiros>
I know of trello that it's similar to pivotal
<apeiros>
and I'd assume that "id" is a standard attribute. and finding a card by id would probably be a standard operation.
<thoraxe>
i am trying to find all cards (given an array of card objects) who have a particular label
<thoraxe>
yes, but i am not trying to find a card by id.
<apeiros>
so I'd expect cards.find(id) or similar to be present.
<thoraxe>
i am trying to find cards who have a particular label
<thoraxe>
and that LABEL has an id
<thoraxe>
card.find(id) works fien.
<apeiros>
almost the same thing then.
<thoraxe>
i want card.find_by_label_id which...
<apeiros>
card.where(label: label_id)
<apeiros>
or somesuch
<apeiros>
which behind the scenes may very well do what you just wrote.
<thoraxe>
except there's an added constraint in my case that the card has to be on a particular list
<apeiros>
(unless you tell me that label is nonstandard)
<apeiros>
thoraxe: so?
<thoraxe>
no label itself appears to be a class too
nertzy has joined #ruby
<thoraxe>
i guess i need to look at .where
jaequery has joined #ruby
<apeiros>
I made `where` up
<apeiros>
it was an example for how I'd expect a potential API to look like
amclain has joined #ruby
blackmesa has joined #ruby
cassioscabral has joined #ruby
jaequery has quit [Client Quit]
nickjj has quit [Ping timeout: 276 seconds]
fullofcaffeine has quit [Remote host closed the connection]
<thoraxe>
well, i didn't write the gem or the classes, so i'm just trying to make do with what is here, and given a list of card objects the ugly find/select/whatever I was trying to do seemed like the quickest resolution
<thoraxe>
i'm not even sure how to go about extending the card class to support finding cards by list and card id
<thoraxe>
err label id
<thoraxe>
because behind the scenes i would expect to end up writing the same exact ugly function
mdw has joined #ruby
<thoraxe>
i guess i don't really understand what you're suggesting, apeiros
<thoraxe>
i'm not really a programmer
<apeiros>
I say dealing with nested hashes and arrays is stupid.
<thoraxe>
so given what i'm working with, what do you suggest?
<apeiros>
use (or write, if necessary) proper classes which provide sane interfaces, instead of poking around in those nested structures.
fullofcaffeine has joined #ruby
<thoraxe>
so instead of an ugly command or two, i should rewrite all the things?
krz has quit [Quit: WeeChat 1.2]
skade has quit [Ping timeout: 245 seconds]
agit0 has quit [Quit: zzzZZZ….]
<thoraxe>
sprint_lists[1].cards.find { |card| card.card_labels.any? { |label| label["id"] == "54d4de9c74d650d5671cb3c7" } } <- this seems to be close to what I want, but it's only returning the first card
timonv has quit [Ping timeout: 256 seconds]
nocd has quit [Quit: nocd]
RegulationD has joined #ruby
djbkd has quit [Remote host closed the connection]
zdman135 has quit [Remote host closed the connection]
shanemcd has quit [Remote host closed the connection]
TheHodge has quit [Quit: Connection closed for inactivity]
karapetyan has joined #ruby
sigurding has quit [Quit: sigurding]
jmignault has quit [Quit: Lunch]
DoubleMalt has quit [Ping timeout: 260 seconds]
blaxter has quit [Quit: foo]
dlitvak has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ruu_ has joined #ruby
karapetyan has quit [Ping timeout: 260 seconds]
fullofcaffeine has quit [Remote host closed the connection]
sandstrom has joined #ruby
smactive has joined #ruby
InvGhost has quit [Read error: Connection reset by peer]
jcdesimp has quit [Quit: Leaving...]
fullofcaffeine has joined #ruby
InvGhost has joined #ruby
sandstrom has quit [Client Quit]
Wsewolod has joined #ruby
dlitvak has quit [Ping timeout: 260 seconds]
dlitvak has joined #ruby
beast has quit [Quit: Leaving]
aegis3121 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blt has joined #ruby
konsolebox has joined #ruby
benlieb has joined #ruby
cassioscabral has quit [Quit: cassioscabral]
lacuna has joined #ruby
smactive has quit [Ping timeout: 246 seconds]
ramfjord has quit [Ping timeout: 264 seconds]
davedev24 has joined #ruby
konsolebox has quit [Max SendQ exceeded]
cassioscabral has joined #ruby
blackmesa has quit [Ping timeout: 245 seconds]
konsolebox has joined #ruby
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
beast has joined #ruby
dr3w has joined #ruby
ascarter has joined #ruby
polysics has joined #ruby
bronson has joined #ruby
Rodya_ has quit [Quit: Leaving...]
atomical_ has joined #ruby
jaequery has joined #ruby
diegoviola has joined #ruby
mark06 has joined #ruby
Darin_ has joined #ruby
jbrhbr has quit [Quit: Leaving.]
atomical has quit [Ping timeout: 260 seconds]
<Darin_>
Anyone know how I would start to program a farkle game?
andywojo has quit [Ping timeout: 255 seconds]
tvw has quit []
icbm has quit [Quit: Leaving]
<apeiros>
thoraxe: context matters of course. if it's half a dozen lines of ugly code which you'll never touch again - well, then use the ugly code.
<apeiros>
Darin_: what's a farkle game?
adgtl has quit [Remote host closed the connection]
<Darin_>
It's the Dice game where certain rolls and combinations of numbers get certain points.
marsjaninzmarsa has quit [Remote host closed the connection]
<thoraxe>
apeiros: it's basically one line of code if i can figure out the right incantation of enum methods
<thoraxe>
apeiros: otherwise it's a small loop over a small list of objects and reject any that don't have some stuff, which is slow, but works and this can be super low performance
<Darin_>
I understand what I would have to do (I think) in psudocode. But I am at a place in my programming where I know the basics and know what things are, but not exactly what to do with what I know.
marsjaninzmarsa has joined #ruby
Rickmasta has joined #ruby
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nertzy has quit [Quit: This computer has gone to sleep]
tubulife- has joined #ruby
p0wn3d_ has quit [Ping timeout: 246 seconds]
<Darin_>
It's frustrating not knowing where to go from here.
marr has joined #ruby
atomical has joined #ruby
wolffles has quit [Read error: Connection reset by peer]
nettoweb has joined #ruby
adgtl has joined #ruby
blt has quit [Quit: WeeChat 1.3]
karapetyan has joined #ruby
atomical_ has quit [Ping timeout: 260 seconds]
bronson has quit [Remote host closed the connection]
nickjj has joined #ruby
dlitvak_ has joined #ruby
fullofcaffeine has quit [Remote host closed the connection]
wolffles has joined #ruby
dlitvak has quit [Ping timeout: 256 seconds]
tubulife- has quit [Ping timeout: 260 seconds]
davedev2_ has joined #ruby
Darin_ has quit [Ping timeout: 252 seconds]
chussenot has quit [Ping timeout: 265 seconds]
karapetyan has quit [Ping timeout: 260 seconds]
dlitvak_ has quit [Ping timeout: 260 seconds]
dlitvak has joined #ruby
the_nic__ has joined #ruby
pdoherty has quit [Ping timeout: 265 seconds]
davedev24 has quit [Ping timeout: 260 seconds]
gheegh has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
the_nick_me has quit [Ping timeout: 264 seconds]
conta has quit [Read error: Connection reset by peer]
polysics has quit []
conta has joined #ruby
agit0 has joined #ruby
justinweiss has joined #ruby
nettoweb has joined #ruby
agit0 has quit [Client Quit]
mary5030 has joined #ruby
mary5030 has quit [Read error: Connection reset by peer]
mary5030 has joined #ruby
Jackneill has quit [Quit: Leaving]
BaroMeter has joined #ruby
shanemcd has joined #ruby
conta has quit [Read error: Connection reset by peer]
karapetyan has joined #ruby
jbrhbr has joined #ruby
Wsewolod has quit [Ping timeout: 250 seconds]
ruu_ has quit [Ping timeout: 246 seconds]
zdman135 has joined #ruby
conta has joined #ruby
cyfr0n1 has joined #ruby
mdw has quit [Quit: Sleeping Zzzzz]
kies^ has quit [Ping timeout: 276 seconds]
timonv has joined #ruby
mdw has joined #ruby
cyfr0n has quit [Ping timeout: 255 seconds]
BaroMeter has quit [Remote host closed the connection]
armyriad has joined #ruby
jcdesimp has joined #ruby
the_nick_me has joined #ruby
mlangenberg has joined #ruby
the_nic__ has quit [Ping timeout: 256 seconds]
zdman135 has quit [Remote host closed the connection]
xet7 has quit [Quit: Leaving]
SnowGlobe has quit [Remote host closed the connection]
johnzorn has quit [Ping timeout: 260 seconds]
CloCkWeRX has joined #ruby
ibouvousaime_ has quit [Ping timeout: 260 seconds]
mlangenberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
atomical has joined #ruby
ElFerna has joined #ruby
devoldmx has joined #ruby
zdman135 has quit [Read error: Connection reset by peer]
dlitvak has quit [Ping timeout: 240 seconds]
zdman135 has joined #ruby
<wolffles>
why does arr[2,3] of arr = [1,2,3,4,5,] return arr[3,4,5] ? shouldnt it return 2 positions?
ht__ has joined #ruby
<jhass>
wolffles: [start, length] and [start..end]
<wolffles>
ohhh
jbrhbr has quit [Quit: Leaving.]
hxegon is now known as hxegon_AFK
arup_r has quit []
Trynemjoel has quit [Ping timeout: 250 seconds]
devoldmx has quit [Ping timeout: 276 seconds]
abronca has joined #ruby
dlitvak has joined #ruby
Spami has joined #ruby
nfk|laptop has quit [Ping timeout: 256 seconds]
the_nick_me has quit [Remote host closed the connection]
n0vo has quit [Quit: Lost terminal]
Trynemjoel has joined #ruby
jmignault has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
queequeg2 has quit [Quit: leaving]
sneakerhax has joined #ruby
nfk|laptop has joined #ruby
zdman135 has quit [Remote host closed the connection]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<wolffles>
how would i do arr = [“a”, “b”, “c”, “d”] with positions = [3, 1, 2, 0] return it as x = dbca? cuz right im doing x[positions] but thats obviously not right. should i just do an iterator like x[positions[i]] then i+=1?
DrCode has quit [Read error: Connection reset by peer]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jackjackdripper has joined #ruby
Gnut has joined #ruby
p0wn3d_ has joined #ruby
Jackneill has joined #ruby
rigel_ has joined #ruby
rubynoobie has joined #ruby
<Gnut>
How would I go about converting a hash of {'key1'=>'val1', 'key2'=>'val2'} to the list ['key1=val1', 'key2=val2']
dotix has joined #ruby
<rigel_>
in learn ruby the hard way exercise 41 a line of code reads
<rigel_>
is it assigning a caps variable or passing a keyword argument like python does. so far ruby's support for keyword argument seems to have a : in some way
shanemcd has quit [Remote host closed the connection]
<adaedra>
wolffles: positions.map { |n| arr[n] }
<jhass>
wolffles: .values_at(*positions)
beast_ has joined #ruby
hinbody has joined #ruby
<adaedra>
Ruby has too many methods :p
<havenwood>
Gnut: map
<havenwood>
Gnut: map { |k, v| "#{k}=#{v}" }
<adaedra>
rigel_: looks like an assignment
<rigel_>
so the order is what matters then with multiple optional (non-keyword) arguments?
<Gnut>
havenwood: Perfect! Thank you
<M-prosodyContext>
Order by
dotix has quit [Ping timeout: 265 seconds]
bronson has joined #ruby
<adaedra>
rigel_: yes
<rigel_>
adaedra: thanks
azgil has joined #ruby
bronson has quit [Remote host closed the connection]
bronson has joined #ruby
Rickmasta has joined #ruby
dotix has joined #ruby
solocshaw has quit [Ping timeout: 250 seconds]
<wolffles>
jhass: that worked perfectly with my little block. i dont understand what the * before positions does
hxegon_AFK is now known as hxegon
bronson has quit [Remote host closed the connection]
rubynoobie has quit [Ping timeout: 252 seconds]
rgtk has joined #ruby
<adaedra>
wolffles: it's a splat. It takes the array contents and pass them as arguments.
jbrhbr has joined #ruby
solocshaw has joined #ruby
duckpuppy has quit [Ping timeout: 272 seconds]
bronson has joined #ruby
bronson has quit [Remote host closed the connection]
dotix has quit [Remote host closed the connection]
zdman135 has joined #ruby
tectonic has joined #ruby
rgtk has quit [Ping timeout: 246 seconds]
FernandoBasso has quit [Quit: Leaving]
solocshaw has quit [Remote host closed the connection]
Yzguy has joined #ruby
solocshaw has joined #ruby
cdg has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
<wolffles>
thanks adaedra
zdman135 has quit [Read error: Connection reset by peer]
sp1rs has joined #ruby
zdman135 has joined #ruby
<sp1rs>
Hi
<sp1rs>
i have installed rspec, but when i tried $rspec on terminal it says that command not found
<havenwood>
riceandbeans: *Everything* but `nil` and `false` are truthy.
<riceandbeans>
!!1
<havenwood>
riceandbeans: #=> true
Trynemjoel has quit [Ping timeout: 250 seconds]
<shevy>
riceandbeans would you want nil to be true :)
<havenwood>
riceandbeans: There's no way to create a falsey value other than `nil` and `false`.
<riceandbeans>
this concept of falsiness scares me and I find it uncomfortable
<jbrhbr>
riceandbeans: what's your reference point?
<riceandbeans>
define 'reference point'
<jbrhbr>
past experiences that contrast with what you are learning now
<riceandbeans>
I do ruby and perl, some python, but I don't get super deep into any of them, I'm not making masterpieces by myself
A124 has quit [Read error: Connection reset by peer]
<riceandbeans>
I'd say I'm most comfortable in perl
<jbrhbr>
perl and python both have truthiness and falsiness
<riceandbeans>
still, falsey and truthy sound weird
<jbrhbr>
both with slightly different rules
davejlong has joined #ruby
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Papierkorb>
riceandbeans: it's a common concept in scripting languages (at least).
aegis3121 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jbrhbr>
those terms are colloquial and used in all languages, but they are more official in ruby than in the others
aegis3121 has joined #ruby
rgtk has joined #ruby
Trynemjoel has joined #ruby
<jbrhbr>
riceandbeans: in python, [], '', None, and 0 are all falsey, for example, but none of them would satisfy an object quality check against False
kies^ has joined #ruby
rrichardsr3 has joined #ruby
<Papierkorb>
uargh, that's PHP-style ugly right there
lannonbr has joined #ruby
mdw has joined #ruby
<jbrhbr>
object equality*
A124 has joined #ruby
rgtk has quit [Remote host closed the connection]
eldariof has quit []
<riceandbeans>
my education has never been formal with computing
<riceandbeans>
anyway
cassioscabral has quit [Quit: cassioscabral]
<jbrhbr>
i think your state of alarm is reasonable
<riceandbeans>
I don't think for my particular case that I need to worry about truthy or falsey for my predicate methods
<riceandbeans>
I'm checking for specific things and either doing return true or return false on the methods
<jbrhbr>
the fact that languages differ on these semantics is arguably an indication of ambiguity with respect to one's intuition around how they should function
<havenwood>
riceandbeans: Just be glad it's not JavaScript where `!![] #=> true` and `!!"" #=> false`... Etc, etc.
doodleha_ has joined #ruby
<riceandbeans>
:( I had been hoping to pick up JS within the next few months...
beast has quit [Remote host closed the connection]
jobewan is now known as jobewan_away
azgil has quit [Quit: Leaving]
beast_ has quit [Quit: Leaving]
jobewan_away has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
azgil has joined #ruby
<hxegon>
Joffery == Malfoy?
<Ox0dea>
Same actor, even. :P
<Begi>
I've a little question.
<Ox0dea>
?ask
<ruboto>
Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
dopie has joined #ruby
<hxegon>
Joffrey is in Dark knight too. How awesome would GOT be if the king of the north was straight up batman.
yqt has joined #ruby
<Begi>
In a lot of other languages, we can do for example False + 1 = 1. in Ruby, we can't. I guess it's a matter of definition, but why this choice ?
<Begi>
>> false + 1
<ruboto>
Begi # => undefined method `+' for false:FalseClass (NoMethodError) ...check link for more (https://eval.in/489954)
<Ox0dea>
Begi: That expression *shouldn't* make sense, and in Ruby it doesn't.
DoubleMalt has quit [Ping timeout: 264 seconds]
<Ox0dea>
`false` is not implicitly equal to 0, and that's great.
<hxegon>
Begi ... what does False + 1 mean in other languages? that doesn't make sense.
htmldrum has quit [Ping timeout: 260 seconds]
<Ox0dea>
$ python -c 'print(False + 1)'
<Ox0dea>
1
<Begi>
With Perl, it works too
Didac has quit [Ping timeout: 240 seconds]
crdpink2 has joined #ruby
prestorium has quit [Quit: Leaving]
<Ox0dea>
Wanting to do arithmetic on booleans almost certainly means you don't understand your problem or your data well enough.
<hxegon>
*facepalms
ruid has quit [Ping timeout: 260 seconds]
crdpink has quit [Ping timeout: 250 seconds]
<Begi>
I like use true and false like int. That was my little question. Sometimes, it's useful
<Ox0dea>
When?
synthroid has quit []
fullofcaffeine has quit [Remote host closed the connection]
<Begi>
(it's not I like, I sometimes use)
<Ox0dea>
Could you provide an example?
<Begi>
Actually, i've no idea...
<Ox0dea>
Yay! <3
<Ox0dea>
!next
<hxegon>
I would argue that there is no case where doing that is the best option, but that could be strong language shaping.
dopie has quit [Quit: Lost terminal]
dopie has joined #ruby
<Ox0dea>
I mean, I do use `^= 1` to "flip a switch" that I want to use as an index, but that more clearly conveys intent than `foo = !foo` to do the flip.
varunwachaspati has quit [Quit: Connection closed for inactivity]
xapak has joined #ruby
futilegames has quit [Ping timeout: 255 seconds]
bradleyprice has quit [Ping timeout: 240 seconds]
solocshaw has joined #ruby
mistermocha has joined #ruby
yokel has quit [Ping timeout: 255 seconds]
xapak has left #ruby [#ruby]
blt has joined #ruby
atomical_ has joined #ruby
nerium has joined #ruby
dlitvak has quit [Ping timeout: 256 seconds]
karapety_ has quit [Remote host closed the connection]
karapetyan has joined #ruby
DaniG2k has joined #ruby
atomical has quit [Ping timeout: 260 seconds]
<shevy>
Begi for instance: if variable.is_a? Fixnum
mistermocha has quit [Ping timeout: 276 seconds]
<shevy>
Begi however it may be easier to either raise if the input is invalid; or convert into the target format that you want to have, before you send to the if/else clause inside of your method
yokel has joined #ruby
<Begi>
Ok, thanks shevy !
mistermocha has joined #ruby
conta__ has quit [Read error: Connection reset by peer]
yashinbasement has joined #ruby
Didac has quit [Ping timeout: 250 seconds]
solocshaw has quit [Remote host closed the connection]
solocshaw has joined #ruby
karapetyan has quit [Ping timeout: 260 seconds]
mistermocha has quit [Remote host closed the connection]
mistermocha has joined #ruby
fullofcaffeine has joined #ruby
conta has joined #ruby
shanemcd has quit [Remote host closed the connection]
mary5030_ has joined #ruby
mdw has quit [Quit: Sleeping Zzzzz]
yokel has quit [Ping timeout: 260 seconds]
bradleyprice has joined #ruby
rakm has joined #ruby
davejlong has quit [Remote host closed the connection]
mdw has joined #ruby
xapak has joined #ruby
<xapak>
Hello.
mary5030 has quit [Ping timeout: 272 seconds]
<xapak>
I compile Ruby through rbenv (ruby-build), but for some reason, for 2.2.4 (2.2.0 installs just fine) last message is this (and the process looks as if it is stuck), do you think it’s actually doing something and I should wait, or it’s really stuck?
<xapak>
CPU usage is definitely not high during that part, which makes me think it stalled.
fullofcaffeine has quit [Remote host closed the connection]
fullofcaffeine has joined #ruby
yokel has joined #ruby
abronca has quit [Quit: abronca]
Didac has joined #ruby
ta has joined #ruby
pawnbox has joined #ruby
ohaibbq has quit [Ping timeout: 260 seconds]
moei has joined #ruby
moei has quit [Client Quit]
grn has joined #ruby
wolffles has joined #ruby
<shevy>
sounds as if it is stuck trying to compile the openssl bindings
conta has quit [Read error: Connection reset by peer]
<shevy>
you should in principle be able to use ruby without openssl, or compile them lateron if you cd to ext/openssl/ there
fullofcaffeine has quit [Remote host closed the connection]
conta has joined #ruby
dotix has joined #ruby
<xapak>
shevy, but do you know of a way to truly know if it’s stuck? That’s the thing, make CPU consumption is so low, that I still don’t know what’s really going on.
pawnbox has quit [Ping timeout: 264 seconds]
fullofcaffeine has joined #ruby
<shevy>
no real idea; I don't think this can happen if you compile directly without rbenv though, at least I never had an infinite loop myself. I don't use rbenv though so you have to ask someone who used rbenv a lot ultimately
DaniG2k has quit [Quit: leaving]
<havenwood>
xapak: You can install 2.2.4 for rbenv with ruby-install (which will use your system openssl package rather than shipping its own :O): ruby-install --install-dir ~/.rbenv/versions/2.2.4 ruby 2.2.4
<havenwood>
xapak: Add one or more checksum flags with ruby-install for Ruby 2.2.4 if you'd like since the definition hasn't been synced yet: --sha256 31203696adbfdda6f2874a2de31f7c5a1f3bcb6628f4d1a241de21b158cd5c76
<havenwood>
xapak: Eeeek... Yeah, I'd just use ruby-install in any case. :)
conta has quit [Ping timeout: 256 seconds]
conta_ has joined #ruby
<xapak>
Coolio. Thank you all for the comments.
mary5030_ has quit [Remote host closed the connection]
al2o3-cr has joined #ruby
<havenwood>
xapak: you're welcome
rgtk has joined #ruby
mary5030 has joined #ruby
dhollinger has joined #ruby
fullofcaffeine has quit [Remote host closed the connection]
h99h9h88 has quit [Remote host closed the connection]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mary5030 has quit [Remote host closed the connection]
yokel has quit [Ping timeout: 260 seconds]
ht__ has quit [Client Quit]
davejlong has quit [Ping timeout: 246 seconds]
mary5030 has joined #ruby
grn has quit [Remote host closed the connection]
mistermocha has quit [Ping timeout: 240 seconds]
xapak has left #ruby [#ruby]
FastJack has quit [Ping timeout: 250 seconds]
atomical has joined #ruby
htmldrum has joined #ruby
moei has joined #ruby
<shevy>
xmas xmas xmas
<Zarthus>
Are we there Yeti?
rgtk has quit [Ping timeout: 246 seconds]
nocd has quit [Quit: nocd]
fullofcaffeine has joined #ruby
FastJack has joined #ruby
grn has joined #ruby
yokel has joined #ruby
nkwsy has joined #ruby
jessemcgilallen has quit [Ping timeout: 260 seconds]
atomical_ has quit [Ping timeout: 260 seconds]
<havenwood>
The Elfabet has Noel: [*?a..?z].rotate(11).drop(1).rotate(-11)
dopie has quit [Quit: Lost terminal]
jmdade has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dnewkerk has joined #ruby
duckpuppy has joined #ruby
lalalaaa has joined #ruby
colegatron has joined #ruby
DoubleMalt has joined #ruby
<havenwood>
Or as we'll be able to say this Christmas: 'a'.upto('z').grep_v /l/
ellistaa has joined #ruby
<ellistaa>
is there a dif between methods and functions? i’m wondering why in ruby we have methods instead of functions
DoubleMalt has quit [Remote host closed the connection]
camilasan has joined #ruby
yos7ph has joined #ruby
beast has joined #ruby
duckpuppy has quit [Ping timeout: 240 seconds]
nkwsy_ has joined #ruby
pdoherty has joined #ruby
last_staff has quit [Quit: last_staff]
doodleha_ has joined #ruby
nkwsy has quit [Ping timeout: 255 seconds]
beast_ has joined #ruby
atomical_ has joined #ruby
hectortrope has quit [Remote host closed the connection]
skcin7 has joined #ruby
doodleha_ has quit [Read error: Connection reset by peer]
agit0 has quit [Quit: zzzZZZ….]
atomical has quit [Ping timeout: 265 seconds]
Begi has quit [Ping timeout: 246 seconds]
pawnbox has joined #ruby
smactive has joined #ruby
Fezzler has joined #ruby
kadoppe has quit [Ping timeout: 260 seconds]
pawnbox has quit [Ping timeout: 245 seconds]
shanemcd has joined #ruby
kadoppe has joined #ruby
speaking2ode has quit [Ping timeout: 245 seconds]
fexilal has quit [Ping timeout: 260 seconds]
lenwood has joined #ruby
<sorbo_>
ellistaa: everything in ruby is an object, so even "free" functions are associated with an object
aegis3121 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<adaedra>
ellistaa: that's basic POO. The difference between functions and methods is that the latter acts on an object.
<adaedra>
OOP*
<sorbo_>
since functions associated with objects are methods, functions and methods are more or less the same thing in ruby
fullofcaffeine has quit [Remote host closed the connection]
<adaedra>
There's technically no functions as such in Ruby :)
<sorbo_>
^ ++
user083 has quit [Ping timeout: 245 seconds]
idefine has quit []
RegulationD has quit [Remote host closed the connection]
aegis3121 has joined #ruby
<adaedra>
But methods are not proper to Ruby. Have objects, have methods. C++ has methods. PHP has methods. And many other languages do.
<ellistaa>
so in other languages like js, functions that belong to prototypes are still called functions … why aren’t they called methods?
Faisal has joined #ruby
Faisal has quit [Remote host closed the connection]
yos7ph has quit [Quit: Leaving]
<ellistaa>
is this a rule in CS that if a function belongs to an object it becomes a method?
<adaedra>
Because JS is a special snowflake which loves to do everything differently /s
ESpiney has quit [Read error: Connection reset by peer]
shanemcd has quit [Ping timeout: 276 seconds]
vikas027 has joined #ruby
<KrzaQ>
Can I assign-expand an array to a hash? I'd like somethign like h[:foo,:bar,:baz] = [1,2,3] => {foo: 1, bar: 2, baz:3}
<zenspider>
al2o3-cr: ah cool. I didn't know that trick
<KrzaQ>
I don't want indexes in my array, it was just an example. I guess not the best one
<adaedra>
I have a manually generated rubydoc folder I feed to ri. Works with the rest.
<zenspider>
adaedra: for the core/stdlib stuff??
cassioscabral has joined #ruby
sigurding has quit [Client Quit]
<adaedra>
zenspider: yeah
lkba has quit [Remote host closed the connection]
<zenspider>
adaedra: why?
shanemcd has joined #ruby
dorei has quit []
<adaedra>
because I somehow didn't have the core docs and, for the use I do (feed it to the bot), it seemed ok and I was lazy to fix the real issue, silly me. It seemed to work until now.
ellistaa has quit [Quit: ellistaa]
n_blownapart has joined #ruby
<zenspider>
hah
<havenwood>
&ri Module.module_function
<`derpy>
No results
wildlander has joined #ruby
grn has quit [Remote host closed the connection]
<zenspider>
do you install your own rubies? if so, there's a make task to build the rdoc and install it
ta has quit [Remote host closed the connection]
<adaedra>
".module_function not found, maybe you meant: YARD::CodeObjects::MethodObject#module_function?"
<adaedra>
It may be system ruby on the distant machine
Aasha has joined #ruby
pwnd_nsfw has quit [Ping timeout: 240 seconds]
nerium has quit [Quit: nerium]
<adaedra>
Lazyness, developper best and worst friend.