<l4v2>
I’ve been stuck on it for a wile, I already looked, once I ask someoene I means I gave up looking. But no one in this field gets that.
<l4v2>
It’s why I should have picked blueberry picker :)
<shevy>
tomorrow is another day
solocshaw has joined #ruby
gnufied has quit [Quit: Leaving]
<l4v2>
I like getting things done, I don’t ahve patients
<jhass>
ruby-lang642: first of all the answer to the question is yes. Then given your arrows mean "parent", it's not incorrect, the right side is just missing a few items in the chain ;)
<l4v2>
So if anyone would like to walk me through how to solve this, that would be cool
<l4v2>
I got through all of the Array challenges easily, but Active Record is realy hard to me
mistermocha has quit [Ping timeout: 250 seconds]
<shevy>
activerecord is hard!
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<l4v2>
So why not just use SQL?
roamingdog has joined #ruby
<ruby-lang642>
l4v2: are you asking me?
<Radar>
ruby-lang642: no
<shevy>
don't ask me, I did not write activerecord; however had, if you work with ruby code, you will tend to abstract anyway unless you write plain SQL in which case, why need any programming language?
xall has quit [Ping timeout: 260 seconds]
<Radar>
l4v2: Show us your code again please.
tokynet has quit [Quit: Connection closed for inactivity]
<l4v2>
Oh, well I can paste the code and if anyone can explaine to me how ruby and Active Record go together better than the guides do, then that would be cool
mistermocha has joined #ruby
armyriad has joined #ruby
<Radar>
Well, I wrote the Active Record Query Interface guide.
tenc has quit [Ping timeout: 240 seconds]
<ruby-lang642>
jhass: just to be confirm, Foo.ancestors.first is == Foo.singleton_class ?
<jhass>
ruby-lang642: no. those are distinct hierarchies that only converge on Class
<Radar>
~~ class Foo; end; Foo.ancestors.first == Foo.singleton_class
<Radar>
>> class Foo; end; Foo.ancestors.first == Foo.singleton_class
<Radar>
l4v2: I don't see where you're declaring the color variable there either.
<l4v2>
Well the guides and Ruby docs were kind of confusing to me
SilverKey has joined #ruby
elifoster has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 260 seconds]
<l4v2>
I ended up just using ‘find’ in the docs to get the solutiions. I mean this stuff is weird, but with a little help it will click. I bet code school has a querying challenge I should try
<ruby-lang642>
jhass: oh ok I think I'm getting the hang of it after doing some more google searchers. So every object has a singleton_class, and class Foo is an object, so it has a singleton_class
<jhass>
ruby-lang642: exactly!
mistermo_ has quit [Ping timeout: 250 seconds]
swills has joined #ruby
<ruby-lang642>
does it show up in Foo.ancestors? if so, is it Foo ?
<l4v2>
ruby_lang642 (thumbs up image here)
<jhass>
ruby-lang642: no and no
mistermo_ has joined #ruby
<jhass>
ruby-lang642: Foo.ancestors.first == Foo
<jhass>
it's the same object, that holds true for the singleton class too, Foo.singleton_class.ancestors.first == Foo.singleton_class
mistermocha has quit [Ping timeout: 250 seconds]
pawnbox has quit [Ping timeout: 244 seconds]
<jhass>
the latter expression will be trivially true in any case, you can replace Foo with any valid Ruby expression you'd like
<jhass>
in the above example say_it is an instance method of foo.singleton_class
<l4v2>
How do I assign a ruby variable to a model? Or columne (not sure what is going on here) would it be like this color = [Car.color => "red")
<jhass>
ruby-lang642: yes
mistermocha has joined #ruby
MrBusiness3 is now known as MrBusiness
n1x-nz has joined #ruby
mistermo_ has quit [Ping timeout: 250 seconds]
solocshaw has quit [Ping timeout: 250 seconds]
solocshaw1 is now known as solocshaw
cdg has joined #ruby
<ruby-lang642>
out of curiousity is it possible to get behavior like bar = foo.new ? In pry it gives me an error, but I'm wondering if you can do that
<Radar>
l4v2: Which line are you trying to do that in?
<l4v2>
from a model I mean.
SilverKey has quit [Quit: Halted.]
<Radar>
l4v2: Are you trying to find all cars where the color is red?
<l4v2>
83
<Radar>
color = "red"
<Radar>
Car.create(:color => color)
<jhass>
ruby-lang642: yes you can, new is just am method call and Foo in class Foo is just a constant, so you can for example do class Foo; end; foo = Foo; bar = foo.new
<l4v2>
I’m not sure, it sounds like that, but maybe I only have to say color
<Radar>
Then Car.where(...)
<jhass>
ruby-lang642: but also class Foo; def new; :i_am_a_teapot; end; end; foo = Foo.new; bar = foo.new
<l4v2>
It still says undefined local variable or method `color'
Gasher has quit [Quit: Leaving]
<jhass>
ruby-lang642: Foo.new there is just calling the instance method new of the class Class (which Foo is an instance of)
<ruby-lang642>
hmm so after you modify the singleton_class of foo, can you make bar = foo.new and so it becomes an instance of foo? (i.e. it has the methods in the singleton_class not defined in Foo)
davedev24 has quit []
mistermocha has quit [Ping timeout: 250 seconds]
dhruvasagar has quit [Ping timeout: 264 seconds]
<jhass>
ruby-lang642: ah no, you can't make new instances of singleton classes, there's always only ever one, at least and at most, one instance of a singleton class
northfurr has joined #ruby
<ruby-lang642>
oh ok
bkxd has quit [Ping timeout: 240 seconds]
<ruby-lang642>
ok now I'm going to re-read what you wrote
jenrzzz has joined #ruby
arescorpio has joined #ruby
symm- has quit [Ping timeout: 246 seconds]
djbkd has quit [Quit: My people need me...]
<jhass>
ruby-lang642: btw while if you grasp this the solution to your problem will become immediately obvious, however it's certainly the long road to it. If you want to back out of it and come back if you're already more familiar with ruby that's perfectly fine. Just say it and we can show you a direct solution, you might just not fully get how it works yet then :)
thejamespinto has joined #ruby
solocshaw has quit [Ping timeout: 250 seconds]
zeroDi has quit [Quit: WeeChat 1.5]
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
keep things simple
banister has joined #ruby
replay has quit []
Xeago_ has joined #ruby
<ruby-lang642>
jhass: are instance methods, methods of the object and not in the singleton class, right?
Xeago_ has quit [Remote host closed the connection]
<jhass>
all ruby methods are in fact instance methods of some class
<jhass>
methods which are unique to a single object, are instance methods of that objects singleton class
solocshaw has joined #ruby
tenc has joined #ruby
marr has quit [Ping timeout: 260 seconds]
<ruby-lang642>
hmm i see
thejamespinto has quit []
<ruby-lang642>
i have to leave my computer for now, i will be thinking about this problem and will probably have to rejoin the chat under a different username
nando293921 has joined #ruby
<ruby-lang642>
i'll also be looking at the logs, so... basically i'll be back with more questions :)
<jhass>
cool, hf
<ruby-lang642>
thanks for all of the help so far jhass
<jhass>
yw
kirun has quit [Quit: Client exiting]
solocshaw has quit [Read error: Connection reset by peer]
solocshaw has joined #ruby
rcvalle has quit [Quit: rcvalle]
northfurr has quit [Quit: northfurr]
<Radar>
l4v2: Did you set color?
<Radar>
l4v2: color = "red"
<Radar>
l4v2: Also: direct messages at me if you want to speak to me. I've got IRC minimised most of the time.
nictrasavios has quit [Remote host closed the connection]
<l4v2>
Ok, cool thank you. No I wa sreading something on it
jaguarmagenta has joined #ruby
RegulationD has joined #ruby
northfurr has joined #ruby
northfurr has quit [Client Quit]
solocshaw has quit [Read error: Connection reset by peer]
solocshaw1 has joined #ruby
jaguarmagenta has quit [Ping timeout: 240 seconds]
RegulationD has quit [Ping timeout: 244 seconds]
solocshaw1 has quit [Read error: Connection reset by peer]
solocshaw has joined #ruby
pawnbox has joined #ruby
mclong has joined #ruby
dminuoso has joined #ruby
k3rn31 has joined #ruby
ekinmur has joined #ruby
ekinmur has quit [Client Quit]
AcidCrash0x00 has joined #ruby
chipotle has quit [Quit: cheerio]
pawnbox has quit [Ping timeout: 260 seconds]
arajakul1 has joined #ruby
AcidCrash has quit [Ping timeout: 260 seconds]
aaeron has joined #ruby
tenc has quit [Ping timeout: 244 seconds]
dminuoso has quit [Ping timeout: 264 seconds]
Es0teric has joined #ruby
speakingcode has quit [Ping timeout: 276 seconds]
centrx has quit []
roamingdog has joined #ruby
aaeron has quit [Quit: aaeron]
k3rn31 has quit [Quit: Computer has gone to sleep.]
solocshaw has quit [Ping timeout: 250 seconds]
rvchangue has quit [Quit: dead]
diegoaguilar has quit [Remote host closed the connection]
<passbe>
I try ::Contact and it doesn't work. I try namespacing the model ::Model::Contact and that still wont work
<passbe>
ruby 2.1 / grape
roamingdog has joined #ruby
pawnbox has joined #ruby
<adam12>
passbe: What's the error?
SilverKey has joined #ruby
GodFather has quit [Ping timeout: 240 seconds]
<passbe>
if i try just ::Contact then: NameError: uninitialized constant Contact
kraken has joined #ruby
kraken is now known as kraken_
<adam12>
And you're requiring the model file somewhere as well?
mclong has quit [Quit: Leaving]
<passbe>
with ::Model::Contact then: NameError: uninitialized constant API::V1::Contact::Model
shinnya has joined #ruby
roamingdog has quit [Remote host closed the connection]
<passbe>
adam12: correct but ill triple check that now
cdg has quit [Remote host closed the connection]
ekinmur has joined #ruby
<kraken_>
Alright, I'm really trying to understand object oriented design, and I was told to, instead of creating an array or values, create an array of objects that contain the values? What is the benefit of this? I cannot wrap my head around it. It just seems like an extra step!
<adam12>
passbe: I don't see anything wrong, presuming you're requiring that model file before you attempt to use it.
<adam12>
kraken_: Depends. Array of objects that could be primitives? Maybe not
coffeecupp has joined #ruby
<adam12>
kraken_: Any array of hashes? Maybe so.
<kraken_>
adam12, It's just an array of string values
<kraken_>
adam12, I was to to make it an array of object containing string values
<kraken_>
via readers
<adam12>
Well, to be pedantic, in Ruby strings are objects, so just tell them they are already objects! :p
MrBusiness2 has joined #ruby
<kraken_>
hahaha
<adam12>
I'd make them into their own object if there was a chance for more. Ie.
<adam12>
Consider a list of inputs for a web form
MrBusiness has quit [Ping timeout: 272 seconds]
Es0teric has quit [Quit: Computer has gone to sleep.]
<adam12>
You could get by with a list of strings, but then all of a sudden you need a hidden flag, disabled flag, different ID, etc.
Es0teric has joined #ruby
<adam12>
Or maybe they are names of people. Maybe they should be Person objects with name attributes. All depends on use case.
pawnbox has quit [Ping timeout: 260 seconds]
<passbe>
adam12: dear lord i should have triple checked the model. wasn't being included because of ** vs * in my Dir glob
<kraken_>
I see
<passbe>
adam12: thank you!
<adam12>
passbe: Cheers! :)
dhruvasagar has joined #ruby
<adam12>
kraken_: Sandy Metz is great for all things Object Orientated. I encourage you to check out her book POODR.
<kraken_>
adam12, thnanks for the suggestions, I've seen it mentioned many times
<adam12>
Some of her videos are great as well. She's keynoted a bunch of Ruby related conferences.
<adam12>
Not even for OO - she's very articulate and a pleasure to listen to.
dhruvasagar has quit [Ping timeout: 258 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
ptx0_ has joined #ruby
pnbeast has joined #ruby
solocshaw has quit [Ping timeout: 244 seconds]
ptx0 has quit [Quit: leaving]
Vile` has quit [Ping timeout: 276 seconds]
tenc has joined #ruby
MrBusiness3 has joined #ruby
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ptx0_ has quit [Quit: Lost terminal]
MrBusiness2 has quit [Ping timeout: 258 seconds]
duncannz has quit [Remote host closed the connection]
solocshaw has joined #ruby
Liam` is now known as lstanley
roamingdog has joined #ruby
allcentury has quit [Ping timeout: 244 seconds]
SCHAAP137 has quit [Quit: Leaving]
Sypheren has joined #ruby
choke has joined #ruby
SilverKey has quit [Quit: Halted.]
weaksauce has joined #ruby
ekinmur has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
solocshaw has quit [Ping timeout: 250 seconds]
Gasher has joined #ruby
mistermocha has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
neo_ has quit [Remote host closed the connection]
Channel6 has joined #ruby
nankyokusei has joined #ruby
arnonhongklay has joined #ruby
giz|work has quit [Ping timeout: 240 seconds]
coffeecupp has quit [Ping timeout: 260 seconds]
ss_much has joined #ruby
ullu has joined #ruby
mistermocha has joined #ruby
arajakul1 has quit [Ping timeout: 244 seconds]
nankyokusei has quit [Ping timeout: 244 seconds]
solocshaw has joined #ruby
ur5us has quit [Remote host closed the connection]
loseyourmind has joined #ruby
edwardly has quit [Ping timeout: 250 seconds]
dminuoso has joined #ruby
mistermocha has quit [Ping timeout: 250 seconds]
jrafanie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
solocshaw has quit [Ping timeout: 250 seconds]
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
dc1 has joined #ruby
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kraken_ has quit [Quit: Leaving]
d10n-work has quit [Quit: Connection closed for inactivity]
ptx0 has joined #ruby
ptx0 has quit [Changing host]
ptx0 has joined #ruby
dminuoso has quit [Ping timeout: 246 seconds]
solocshaw has joined #ruby
d0nn1e has quit [Ping timeout: 246 seconds]
mistermo_ has joined #ruby
joneshf-laptop has quit [Remote host closed the connection]
choke has joined #ruby
mistermocha has joined #ruby
d0nn1e has joined #ruby
nando293921 has quit [Quit: Lost terminal]
nando293921 has joined #ruby
misterm__ has joined #ruby
mistermo_ has quit [Ping timeout: 250 seconds]
neo_ has joined #ruby
mistermo_ has joined #ruby
mistermocha has quit [Ping timeout: 250 seconds]
misterm__ has quit [Ping timeout: 250 seconds]
mistermo_ has quit [Ping timeout: 250 seconds]
Azure has quit [Ping timeout: 272 seconds]
bdb-me has joined #ruby
davede has quit [Quit: Connection closed for inactivity]
smathy_afk has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mistermo_ has joined #ruby
pawnbox has quit [Ping timeout: 260 seconds]
Robert__ has joined #ruby
hahuang61 has quit [Ping timeout: 272 seconds]
moeabdol has joined #ruby
cyphase has joined #ruby
tristanp_ has quit [Read error: Connection reset by peer]
tristanp has joined #ruby
jinie has quit [Ping timeout: 250 seconds]
Robert__ has left #ruby [#ruby]
mistermocha has joined #ruby
mistermo_ has quit [Ping timeout: 250 seconds]
ReK2 has quit [Remote host closed the connection]
moeabdol has quit [Ping timeout: 246 seconds]
ReK2 has joined #ruby
hays_ has joined #ruby
hays has quit [Ping timeout: 240 seconds]
northfurr has joined #ruby
mistermocha has quit [Ping timeout: 250 seconds]
k3rn31 has joined #ruby
chipotle has quit [Quit: cheerio]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
mistermocha has joined #ruby
dhruvasagar has joined #ruby
gix has quit [Ping timeout: 260 seconds]
mistermocha has quit [Ping timeout: 250 seconds]
dhruvasagar has quit [Ping timeout: 260 seconds]
braincras has joined #ruby
gix has joined #ruby
giz|work has quit [Ping timeout: 260 seconds]
arajakul1 has joined #ruby
solocshaw has joined #ruby
Sypheren has quit [Ping timeout: 264 seconds]
mistermocha has joined #ruby
Madplatypus has quit [Quit: Connection closed for inactivity]
solocshaw has quit [Ping timeout: 276 seconds]
xall has joined #ruby
<shevy>
is there a non-regex way, ideally an elegant way by default, to check if an input string contains only numbers? e. g. x = "55"; with a regex it is simple, if x =~ /^\d+$/
mistermocha has quit [Ping timeout: 250 seconds]
k3rn31 has quit [Quit: Computer has gone to sleep.]
arajakul1 has quit [Quit: Leaving]
hk238 has joined #ruby
<adam12>
shevy: Integer(value) raises ArgumentError for anything it can't convert.
<adam12>
shevy: Not sure if that's elegant or not :)
<ruby[bot]>
adam12: # => invalid value for Integer(): "42foobar" (ArgumentError) ...check link for more (https://eval.in/595357)
cyphase has quit [Ping timeout: 264 seconds]
nictrasavios has joined #ruby
northfurr has quit [Quit: northfurr]
<shevy>
hmm
mistermocha has joined #ruby
RegulationD has joined #ruby
cyphase has joined #ruby
nankyokusei has joined #ruby
mistermo_ has joined #ruby
mistermocha has quit [Ping timeout: 250 seconds]
coffeecupp has quit [Quit: Lost terminal]
RegulationD has quit [Ping timeout: 244 seconds]
mistermocha has joined #ruby
northfurr has joined #ruby
mistermo_ has quit [Ping timeout: 250 seconds]
electrostat has quit [Read error: Connection reset by peer]
ptx0 has quit [Quit: Lost terminal]
nankyokusei has quit [Ping timeout: 276 seconds]
tjohnson has quit [Quit: Connection closed for inactivity]
mistermo_ has joined #ruby
mistermocha has quit [Ping timeout: 250 seconds]
ptx0 has joined #ruby
dminuoso has joined #ruby
mattwashere has joined #ruby
mistermo_ has quit [Ping timeout: 250 seconds]
kraken has joined #ruby
kraken is now known as kraken_
<kraken_>
Hey has anyone read POODR by Sandi Metz? Can someone please explain what she means by the word 'messages', as in when she says that she prefers messages over data, and that object send 'messages' to one another
roamingdog has joined #ruby
mistermocha has joined #ruby
mattwashere has quit [Ping timeout: 244 seconds]
<hk238>
kraken_ I can't explain it properly, but it refers to a concept called `message passing` which is one of the features useful for implementing an object oriented language. I think examples of that are things like datatypes.
dminuoso has quit [Ping timeout: 276 seconds]
sesquipedalian has quit [Ping timeout: 240 seconds]
<hk238>
well I'm not sure if this is accurate, but at least it's a comparison, for an example if you have a function `absolute value` and thne you'v edifferent kinds of number types, like integers, unsigned integers, floating points, and so on
<kraken_>
hk238, I'm jsut having a harder time trudging through than I thought. For instance, she recommends wrapping an instance variable in a method, and passing it as a 'message'. So is what a method returns a messages?
<kraken_>
hmm I see what you're saying with the absolute value
<hk238>
the `message passing` style of implementing these things would be that you pass this command to that thing, and it returns you the value. So for an example if you add another thing to the list of things that you could get an absolute value out of, you dont need to chang ethe `absoliute value`command, instead you just includ ea response in the newly defined thing
roamingdog has quit [Ping timeout: 246 seconds]
<hk238>
hmm although I might be confusing this with the concept of `data driven..` ... data driven. What was it
enterprisey has quit [Remote host closed the connection]
ptx0 has quit [Quit: Lost terminal]
<pilne>
the more locations that have the ability to modify the same piece of data, the harder things get to debug (in general).
mistermocha has quit [Ping timeout: 250 seconds]
<kraken_>
I see
<pilne>
it is much "safer" to send a message to retrieve a copy of data, than to send the data itself.
<hk238>
I'm confused about this for, well I was watchin a lecture on this a few days ago when going to bed, and now I cant remember it corretcly
hahuang61 has joined #ruby
<pilne>
however, sharing a mutable variable instead of copying it, will have lower overhead... but we aren't talking about "low level" like that when we think ruby in general :)
<hk238>
there was 3 concepts involved, but somehow I have formed categories for only two, and am miximg up the data driven approach with the message passing approach and cant tell what the difference is, I should go back and read up on tha Iguess... anyone else know what that distinction might be? ^^
sumobob has joined #ruby
<kraken_>
pilne, what do you mean by 'send a message'
Es0teric has quit [Read error: Connection reset by peer]
rattatmatt has quit [Remote host closed the connection]
ptx0 has joined #ruby
ptx0 has quit [Changing host]
ptx0 has joined #ruby
Es0teric has joined #ruby
rattatmatt has joined #ruby
loseyourmind has quit [Ping timeout: 246 seconds]
xall has quit [Ping timeout: 246 seconds]
<pilne>
object A contains data a, b and c. object W contains x, y, and z. there are (at least) two ways to let W know about information in A. 1st A can expose access to it's data (a, b, c) to the outside world, or it could be setup so that W sends a request (message) to A, requsting a copy of the data, in this scenario, only A can modify it's data by default/design, but in the first, one could (intentionally or not) allow outside things to
<pilne>
modify A's data.
hahuang61 has quit [Ping timeout: 264 seconds]
<pilne>
making/returning a copy is more "expensive" in terms of memory, cpu, and gc pressure, but if minimizing resource utilization is the key goal, you probably should be programming closer to the metal to begin with :)
<pilne>
keep in mind, i'm not an expert at this by any means
rattatmatt has quit [Ping timeout: 244 seconds]
<kraken_>
I see what you mean
<kraken_>
though
<kraken_>
That makes sense
<kraken_>
so instead of direct access to the variable, you wrap them into a message and send it off
<pilne>
yeup
arescorpio has quit [Quit: Leaving.]
<pilne>
fwiw, ruby tends to make it more like "you can't see this" "you can read this" and "you can access (read/modify) this"
Gasher has quit [Quit: Leaving]
<pilne>
(from the outside)
<pilne>
instead of "pure" messaging, but the "read" it can kinda be seen as a very similar approach, which will only make a "copy" if needed when called.
choke has joined #ruby
<pilne>
please someone correct me if i'm talking like ace ventura doing his "assy mcgee" impersonation
electrostat has joined #ruby
chare has joined #ruby
chare has quit [Client Quit]
<pilne>
hk, i'm still skimming data-driven programming and it isn't really clicking hard with me yet
allcentury has joined #ruby
dgncn has quit [Ping timeout: 244 seconds]
loseyourmind has joined #ruby
toretore has joined #ruby
<hk238>
hm
<hk238>
the lecture I was watching is from youtube Computer Science 61A lecture 15, I think the year for this one was 2007.. The topic of the lecture is generic operators (also video title I think)
dgncn has joined #ruby
<hk238>
it contained an example with squares and circles and different ways of implementing a system of calculating their `area` so that was like the absolute example
CloCkWeRX has joined #ruby
<pilne>
it seems lie sed and awk are "good" examples of it, and that pattern-matching is a big part of it
<hanmac>
pilne: hm thats true for String and small array struff ... like when you have a string like "abcde" and you get the substring from it "bcd" it didnt make a new copy of it but use shared memory if able until you modify one of them. ... do you mean something like that?
<pilne>
yes hanmac
<pilne>
the ruby runtime is getting so very slick these days :)
<hk238>
and the first case was `conventional approach` which was basically the worst way of defining things, in that method basically you write in side an operator how it deals with different types, like for an example some conditions.. if the type of this data is , then use that procedure.. and it's basically inefficient or awkward
<hk238>
the reasoning being that if yo add a new type like `orange` or whatever, and then you want to include that into the system, you've to look at the definitions of each operation
<hk238>
and add a new typetest, and a new procedure for the orange
<hk238>
so it just makes things more convoluted
mistermocha has quit [Ping timeout: 250 seconds]
<pilne>
i'll agree with that being quite akward
<hk238>
then there was a data directed approach, in which case the operators were defined i na different manner, kind of like as a table, so I'm not sure what exact implementation style was... I guess this was the confusing part
<hk238>
since the lecture is using schema or how you spell that? and I was going to bed, and when Im lying down, I cant see what the lecturer is typing
<hk238>
so anyway I dont know the details of the implementation, but I'm just guessing based on the contetx what it must be
<hk238>
and that is so you implement the operator procedure so that first there's a table of operations for each type, or something like that, and whne you include a new type, then you just add a row into the table.. But that seems awfully.. well exactly the same as the conventional approach
<hk238>
and thne there was message passing, which was that the operator doesnt need to know anything about the object
mistermocha has joined #ruby
<hk238>
instead it's defined in each object
<hk238>
or something like that
<hk238>
hmm I guess I dont know it accurately enough to make the difference out :o
cajone has quit [Ping timeout: 244 seconds]
<hk238>
or maybe the difference was that
stardiviner has quit [Quit: Code, Sex, Just fucking world.]
stardiviner has joined #ruby
<hk238>
I dont know I'm getting too confused about this
mistermocha has quit [Ping timeout: 250 seconds]
<pilne>
kinda sounds like there is some multiple dispatch involved in there too, but i'm tired as well.
dc1 has joined #ruby
ponga has joined #ruby
<hk238>
hmm maybe the difference was something of the sort that the function call included the type, either so that there isa routing layer with the type, that could be implemented as a table with functions
dhruvasa1 has joined #ruby
c355e3b has quit [Quit: Connection closed for inactivity]
<hk238>
or that there's a separate function for each type, but that doesnt seem very efficient....... Ahh I dont kno.w But the message passing thing is convenient and it was the 3rd case, so send the object the message `area` and expect the object to return a value as a return message or somtehing like that
<hk238>
kind of hoping someone would clear this up but I dont know.... I think it's good time to get some more coffee ^^
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bigkevmcd has joined #ruby
kt2 has joined #ruby
jaguarmagenta has joined #ruby
rattatmatt has joined #ruby
RegulationD has joined #ruby
n1x-nz has joined #ruby
<pilne>
my brain is gettin too fuzzy tbh, night all
jaguarmagenta has quit [Ping timeout: 260 seconds]
pilne has quit [Quit: Quitting!]
pawnbox has joined #ruby
RegulationD has quit [Ping timeout: 240 seconds]
hahuang61 has joined #ruby
bigkevmcd has quit [Quit: Outta here...]
zacstewart has quit [Read error: Connection reset by peer]
zacstewart has joined #ruby
pawnbox has quit [Ping timeout: 258 seconds]
d0lph1n98 has joined #ruby
yfeldblum has quit [Remote host closed the connection]
dminuoso has joined #ruby
moeabdol has joined #ruby
<nictrasavios>
I just learned about splat arguments. As a c guy.... "WHAT IS THIS MADNESS!"
dminuoso has quit [Ping timeout: 272 seconds]
chipotle has joined #ruby
moeabdol has quit [Ping timeout: 260 seconds]
<nictrasavios>
You mean ruby programmers don't like writing 15 overloaded method names, and protoyping all of them? Savages. I'm in love with it.
<hanmac>
nictrasavios: just wait how you will react when you see the double-splat ;P (its for using keyword arguments in newer ruby)
<nictrasavios>
I don't even think my book is new enough for that ;P.
loseyourmind has quit [Ping timeout: 272 seconds]
<nictrasavios>
It was written for ruby 1.9 and rails 3.
<hanmac>
nictrasavios: there you can see all the different parameter types: (d,e,f are for keyword stuff)
<nictrasavios>
I think if it wasen't 2:10am, my brain could slowly make sense of that.
northfurr has quit [Quit: northfurr]
<hanmac>
in most of the cases you might not need the keyword stuff, but maybe if you have to much parameters, you might end up using an option-hash ... the keyword args are a development from that
loseyourmind has joined #ruby
<nictrasavios>
Man, I'm still trying to get one 3rd party API to send me a list of users, another API to send me its, and then match them in a hash.
ledestin has joined #ruby
<nictrasavios>
Tricky part is, one API sends "usernames", and one is based off actual names, so it's like: if calendar[1] == messenger[1].firstname do users[messenger] = calendar XD
<hanmac>
example compared keyargs with option hash
<zeLemur>
whoever is using 1.8 should really upgrade though, that'll break a lot of things in rails
<zeLemur>
or AR
<toretore>
l4v2: the sql you want is "select * from cars where color = 'something' order by created_at desc", right?
<l4v2>
I’m not good with Active Record, I’m not great with Ruby. You guys are. That’s why I came here
<nofxx>
l4v2, also, on different subject: prefer #create! (notice the bang) there, so you won't have any silent failures on that
<toretore>
l4v2: yes, we are pretty good, so you should trust that we know what we're doing when we try to help you
<l4v2>
I know, but all day on this. I jsut want to see the answer and go to bed
<toretore>
l4v2: you could have solved this hours ago if you had listened to us hours ago
ruby-lang309 has joined #ruby
<zeLemur>
not a very great way to learn things
<ruby-lang309>
Is Bob the Blob here?
<l4v2>
I need the line exactly
<zeLemur>
if you always flip to the back of the answers book, you're going to fail the test
<toretore>
l4v2: we're not going to give you copy-paste solutions, you know this by now
<l4v2>
bye
<zeLemur>
ruby-lang309
<zeLemur>
what?
<zeLemur>
l4v2: that's a pretty crappy attitude. They're trying to help you learn
l4v2 has left #ruby [#ruby]
* baweaver
sighs
<baweaver>
that one won't learn
benlieb has quit [Quit: benlieb]
siaw23 has joined #ruby
<zeLemur>
they've been here before?
the_drow has joined #ruby
<baweaver>
yeah, but let's keep the offtopic over on #ruby-offtopic zeLemur
<toretore>
it's really strange how some people work so hard to not learn anything and end up spending so much more time on everything than they have to
xlegoman has quit [Quit: Leaving]
<siaw23>
I have a method like this “sanitize(excerpt, tags: 'em') “ with an error that’s saying “You should pass :tags as an Enumerable”. how do i pass a symbol as enumerable?
<zeLemur>
oops, ok, sorry
<baweaver>
siaw23 probably the valie
<baweaver>
value*
giz|work has joined #ruby
<baweaver>
tags: ['em']
tmtwd has joined #ruby
nictrasavios has quit [Ping timeout: 244 seconds]
<siaw23>
oh. is that so? let me check :D
ruby-lang309 has quit [Ping timeout: 250 seconds]
<toretore>
siaw23: what they actually mean is probably "anything that implements each"
<baweaver>
because a hash is enumerable
<siaw23>
right
<baweaver>
It's _technically_ correct, but vague for newer folks
terminalrecluse has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
roamingdog has joined #ruby
kraken_ has quit [Quit: Leaving]
roamingdog has quit [Ping timeout: 244 seconds]
rippa has joined #ruby
allcentury has joined #ruby
Nahra has quit [Remote host closed the connection]
rattatmatt has quit []
giz|work has quit [Ping timeout: 258 seconds]
xall has joined #ruby
allcentury has quit [Ping timeout: 276 seconds]
n__dles has joined #ruby
sumobob has quit [Ping timeout: 260 seconds]
allcentury has joined #ruby
emiltin has joined #ruby
allcentury has quit [Ping timeout: 240 seconds]
rbennacer has joined #ruby
coyo has quit [Ping timeout: 244 seconds]
rbennacer has quit [Remote host closed the connection]
Vile` has joined #ruby
jaguarmagenta has joined #ruby
pawnbox has joined #ruby
moeabdol has joined #ruby
hahuang61 has quit [Ping timeout: 260 seconds]
tildes has joined #ruby
craigp_ has joined #ruby
nando293921 has quit [Ping timeout: 244 seconds]
TomyLobo has joined #ruby
RegulationD has joined #ruby
pawnbox has quit [Ping timeout: 258 seconds]
jaguarmagenta has quit [Ping timeout: 276 seconds]
moeabdol has quit [Ping timeout: 258 seconds]
RegulationD has quit [Ping timeout: 244 seconds]
xall has quit [Ping timeout: 244 seconds]
dminuoso has joined #ruby
allcentury has joined #ruby
pnbeast has quit [Quit: leaving]
zacstewart has quit [Ping timeout: 252 seconds]
houhoulis has joined #ruby
allcentury has quit [Ping timeout: 244 seconds]
dminuoso has quit [Ping timeout: 244 seconds]
astrobunny has joined #ruby
amincd has joined #ruby
tax_ has joined #ruby
tmtwd has quit [Ping timeout: 244 seconds]
n1x-nz has joined #ruby
<amincd>
Hi, could someone explain the behavior of IO#readpartial http://ruby-doc.org/core-2.2.2/IO.html#method-i-readpartial to me? I realize this may be more of a *nix question.. Why does the second last code in the sample code not read everything in the pipe?
<amincd>
*second last line in the sample code
n1x-nz has quit [Read error: Connection reset by peer]
vuoto has joined #ruby
<toretore>
"If the byte buffer is not empty, it returns the data in the buffer. Otherwise if the stream has some content, it returns the data in the stream"
houhoulis has quit []
ta__ has quit [Ping timeout: 264 seconds]
ta_ has joined #ruby
Sucks has joined #ruby
chipotle has joined #ruby
<amincd>
toretore: so if the byte buffer is not empty, then it only returns the data in the buffer, and does not return the stream content?
<toretore>
tbh i've never used readpartial so this is just me guessing
zacstewart has joined #ruby
Sucks has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
Hobogrammer has quit [Quit: WeeChat 0.4.2]
houhoulis has quit [Client Quit]
<amincd>
toretore: your explanation makes sense. I panicked when I couldn't immediately understand how it worked and didn't bother to carefully read the explanation about reading the buffer if not empty and otherwise reading the content in the stream
emiltin has quit [Quit: Computer has gone to sleep.]
craigp_ has quit [Ping timeout: 244 seconds]
xall has joined #ruby
djbkd has joined #ruby
emiltin has joined #ruby
zacstewart has quit [Ping timeout: 250 seconds]
kareeoleez has joined #ruby
mistermocha has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
kareeole_ has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
Sucks has quit [Remote host closed the connection]
kareeoleez has quit [Ping timeout: 260 seconds]
ta__ has joined #ruby
houhoulis has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
mistermo_ has joined #ruby
serge_ has joined #ruby
mistermo_ has quit [Read error: Connection reset by peer]
ta_ has quit [Ping timeout: 264 seconds]
memorasus has joined #ruby
Sucks has joined #ruby
multi_io has quit [Ping timeout: 250 seconds]
mistermocha has joined #ruby
hahuang61 has joined #ruby
multi_io has joined #ruby
mistermo_ has joined #ruby
mistermo_ has quit [Read error: Connection reset by peer]
misterm__ has joined #ruby
mistermocha has quit [Ping timeout: 250 seconds]
misterm__ has quit [Read error: Connection reset by peer]
DoubleMalt has joined #ruby
mistermocha has joined #ruby
hahuang61 has quit [Ping timeout: 260 seconds]
RegulationD has joined #ruby
nankyokusei has joined #ruby
rann has joined #ruby
mistermo_ has joined #ruby
misterm__ has joined #ruby
mistermocha has quit [Ping timeout: 244 seconds]
KnownSyntax has quit [Ping timeout: 250 seconds]
RegulationD has quit [Ping timeout: 258 seconds]
nankyokusei has quit [Ping timeout: 246 seconds]
kareeole_ has quit [Ping timeout: 244 seconds]
mistermocha has joined #ruby
mistermo_ has quit [Ping timeout: 244 seconds]
Kero has quit [Ping timeout: 260 seconds]
misterm__ has quit [Read error: Connection reset by peer]
sunnyparkeunji has quit [Quit: Lost terminal]
Kero has joined #ruby
mistermo_ has joined #ruby
dminuoso has joined #ruby
mistermocha has quit [Ping timeout: 250 seconds]
<Yzguy>
anyone have experience with Sequel?
mistermocha has joined #ruby
allcentury has joined #ruby
pawnbox has joined #ruby
<apeiros>
?anyone Yzguy
<ruby[bot]>
Yzguy: Just ask your question, if anyone has, is or can, they will respond.
<apeiros>
and people over in #sequel probably all have
mistermocha has quit [Read error: Connection reset by peer]
dminuoso has quit [Ping timeout: 272 seconds]
<Yzguy>
i gotta qualify it or whatever
<apeiros>
a note on "json object":
<apeiros>
?jsonobject
<ruby[bot]>
there is no such thing as a JSON object. You either have a String containing serialized JSON, or you have ruby objects (usually Hashes/Arrays/Strings). Which is it?
<Yzguy>
heh
allcentury has quit [Ping timeout: 264 seconds]
chipotle has joined #ruby
<apeiros>
and in your case, Place.all.to_json you have a string which contains a serialized array (because "list of places" -> array)
mistermo_ has quit [Read error: Connection reset by peer]
pawnbox has quit [Ping timeout: 272 seconds]
<apeiros>
your `get '/places/:id'` is what you'd use to get a single place
mistermocha has joined #ruby
vuoto has quit [Remote host closed the connection]
msvbhat has joined #ruby
<Yzguy>
hrm
<Yzguy>
oh jeez, okay i understand how
<Yzguy>
i think i was expecting a structure like { 'places': [ {'id': 1, 'name': 'McMenamins'} ] }
ta_ has joined #ruby
binaryplease1 has joined #ruby
mistermocha has quit [Ping timeout: 252 seconds]
<Yzguy>
im crazy, ok this is working as I wanted
<spudowiar>
lol
ta__ has quit [Ping timeout: 264 seconds]
<Yzguy>
the weird curl output was messing me up with it showing the speeds n stuff
mistermocha has joined #ruby
SilverKey has joined #ruby
binaryplease has quit [Ping timeout: 276 seconds]
mistermocha has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
mistermo_ has joined #ruby
pawnbox has joined #ruby
xall has quit [Ping timeout: 260 seconds]
misterm__ has joined #ruby
mistermocha has quit [Ping timeout: 272 seconds]
binaryplease1 is now known as binaryplease
dc1 has joined #ruby
mistermocha has joined #ruby
houhoulis has quit [Remote host closed the connection]
mistermo_ has quit [Ping timeout: 244 seconds]
amincd has quit [Quit: Page closed]
lxsameer has joined #ruby
mistermo_ has joined #ruby
misterm__ has quit [Ping timeout: 258 seconds]
mistermo_ has quit [Read error: Connection reset by peer]
xall has joined #ruby
mistermo_ has joined #ruby
vuoto has joined #ruby
mistermocha has quit [Ping timeout: 250 seconds]
firstdayonthejob has joined #ruby
cyphase has quit [Ping timeout: 240 seconds]
mistermocha has joined #ruby
houhoulis has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
zacstewart has joined #ruby
mistermo_ has quit [Ping timeout: 250 seconds]
mistermo_ has joined #ruby
blackgoat has quit [Quit: WeeChat 1.5]
cyphase has joined #ruby
chipotle has quit [Quit: cheerio]
misterm__ has joined #ruby
mistermocha has quit [Ping timeout: 250 seconds]
zacstewart has quit [Ping timeout: 244 seconds]
misterm__ has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
mistermo_ has quit [Ping timeout: 250 seconds]
SilverKey has quit [Quit: Halted.]
moeabdol has joined #ruby
dc1 has quit [Ping timeout: 244 seconds]
mistermo_ has joined #ruby
misterm__ has joined #ruby
kareeoleez has joined #ruby
mistermocha has quit [Ping timeout: 250 seconds]
miqlas-H has joined #ruby
dc1 has joined #ruby
moeabdol has quit [Ping timeout: 272 seconds]
misterm__ has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
mistermo_ has quit [Ping timeout: 250 seconds]
mistermocha has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
cyphase has quit [Ping timeout: 272 seconds]
rann has quit [Ping timeout: 276 seconds]
hahuang61 has joined #ruby
mistermo_ has joined #ruby
allcentury has joined #ruby
jaguarmagenta has joined #ruby
misterm__ has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
Ishido has joined #ruby
cyphase has joined #ruby
vuoto has quit [Quit: Lost terminal]
harfangk has joined #ruby
mistermocha has joined #ruby
mistermo_ has quit [Ping timeout: 250 seconds]
hahuang61 has quit [Ping timeout: 264 seconds]
stardiviner has quit [Quit: Code, Sex, Just fucking world.]
RegulationD has joined #ruby
jaguarmagenta has quit [Ping timeout: 244 seconds]
mistermocha has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
misterm__ has quit [Ping timeout: 250 seconds]
allcentury has quit [Ping timeout: 244 seconds]
cyphase has quit [Ping timeout: 250 seconds]
mistermocha has quit [Read error: Connection reset by peer]
Es0teric has joined #ruby
mistermocha has joined #ruby
RegulationD has quit [Ping timeout: 246 seconds]
mistermo_ has joined #ruby
mistermo_ has quit [Read error: Connection reset by peer]
pawnbox has quit [Remote host closed the connection]
mistermo_ has joined #ruby
pawnbox has joined #ruby
dhruvasagar has joined #ruby
mistermocha has quit [Ping timeout: 250 seconds]
dhruvasa1 has quit [Ping timeout: 276 seconds]
MrBusiness3 is now known as MrBusiness
mistermo_ has quit [Read error: Connection reset by peer]
strigon33 has joined #ruby
mistermocha has joined #ruby
dminuoso has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
mistermo_ has joined #ruby
strigonLeader has quit [Ping timeout: 244 seconds]
misterm__ has joined #ruby
mistermocha has quit [Ping timeout: 250 seconds]
misterm__ has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
chipotle has joined #ruby
dminuoso has quit [Ping timeout: 276 seconds]
mistermo_ has quit [Ping timeout: 250 seconds]
ta__ has joined #ruby
marr has joined #ruby
mistermo_ has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
tildes has quit [Ping timeout: 264 seconds]
ta_ has quit [Ping timeout: 260 seconds]
Endie has joined #ruby
xall has quit [Ping timeout: 250 seconds]
mistermocha has joined #ruby
zeroDi has joined #ruby
bkxd has joined #ruby
misterm__ has joined #ruby
mistermo_ has quit [Ping timeout: 250 seconds]
misterm__ has quit [Read error: Connection reset by peer]
mistermo_ has joined #ruby
mistermocha has quit [Ping timeout: 250 seconds]
spider-mario has joined #ruby
yfeldblum has quit [Ping timeout: 250 seconds]
mistermocha has joined #ruby
sepp2k has joined #ruby
mistermo_ has quit [Ping timeout: 250 seconds]
AcidCrash0x00 has quit [Read error: Connection reset by peer]
AcidCrash has joined #ruby
tildes has joined #ruby
azor has joined #ruby
mistermocha has quit [Ping timeout: 252 seconds]
A124 has quit [Read error: No route to host]
tape88 has joined #ruby
tildes has quit [Ping timeout: 244 seconds]
Sucks has quit [Ping timeout: 260 seconds]
A124 has joined #ruby
chipotle has quit [Quit: cheerio]
allcentury has joined #ruby
zacstewart has joined #ruby
tildes has joined #ruby
colegatron has joined #ruby
strigon33 is now known as strigonLeader
houhoulis has quit [Remote host closed the connection]
yeticry has quit [Read error: Connection reset by peer]
allcentury has quit [Ping timeout: 260 seconds]
tildes has quit [Ping timeout: 240 seconds]
eugenmayer1 has joined #ruby
zacstewart has quit [Ping timeout: 264 seconds]
<eugenmayer1>
hello. Writing rake tasks, i fail with my includes. I tried to adjust LOAD_PATH, but still, i cannot require utils like this: https://goo.gl/Ijji4c
<eugenmayer1>
i could using ./utils/utils .. or using require_relative .. but i would try to avoid anything relative
<eugenmayer1>
more or less, either defining the includes relative to the Rakefile automatically (no matter in which rake task or which folder )
<eugenmayer1>
or by search-path. Any suggestions?
sdothum has joined #ruby
postmodern has quit [Quit: Leaving]
<apeiros>
what's the output of your `puts lib`?
nankyokusei has joined #ruby
<apeiros>
common pattern btw. is to have a "lib" dir and have that in $LOAD_PATH, not your project directory.
<eugenmayer1>
the realpath of the folder, where the Rakefile is located. The file you see is the Rakefile
<eugenmayer1>
i could do that wiht ulti
<apeiros>
eugenmayer1: I'm quite sure your output includes "Rakefile"
<apeiros>
which is why you should do as asked ("what's the output of your `puts lib`?") - would have saved some guessing and testing on my side :-p
siaw23 has quit [Read error: Connection reset by peer]
<eugenmayer1>
what would i use if i would like to avoid a regexp / strreplace?
<apeiros>
../ instead of ./ in your expand_path, or __dir__ instead of __FILE__
<eugenmayer1>
apeiros: blame it on me.
siaw23 has joined #ruby
<apeiros>
oh I do! :D
nankyokusei has quit [Ping timeout: 240 seconds]
hays_ is now known as hays
* eugenmayer1
feels punished - but deserved
<eugenmayer1>
__dir__ works great.
<jhass>
File.join(__dir__, "lib")
<jhass>
it should expand already
<apeiros>
File.expand_path('lib', __dir__)
<apeiros>
jhass: afair __dir__ isn't always expanded, just like __FILE__
<jhass>
"Returns the canonicalized absolute path of the directory of the file from which this method is called. It means symlinks in the path is resolved"
<eugenmayer1>
i used lib = File.expand_path('./lib', __dir__)
<apeiros>
oh, then it's either different from __FILE__, or that behavior got changed
<eugenmayer1>
who ever designed invoke or execute .. should try again.
craigp_ has joined #ruby
<jhass>
they can't unfortunately
emiltin has joined #ruby
<eugenmayer1>
Yes. And thats why it is so utterly broken + usless ;/
dc1 has quit [Ping timeout: 246 seconds]
<eugenmayer1>
the point that .reenable exists and has been ever documented. This method is the aquivalent of "pray and run"
<eugenmayer1>
pray, that the invoked task does himself not run other tasks. Or you end up having such a huge mess, calling a tasks, which skips other tasks, eventhough you reenabled him
<eugenmayer1>
also that "rembering i ran this task before" does not at all inspect the input arguments, and does not include them in his match, is .. man.
<jhass>
they can't because they're not with us anymore
hahuang61 has joined #ruby
<eugenmayer1>
jhass: I know that Jim has passed, sad enaugh to not repeat it all day long i guess. But that does not mean this needs to stay as is until end of time, isnt it
<apeiros>
tasks were not supposed to have input parameters. and writing tasks which should be library functions/methods is bad design. IMO if a task is more than ~5 lines -> write a class/library
<jhass>
eugenmayer1: I was just referring to "they should try again"
<eugenmayer1>
apeiros: the way tasks are designed, you should never exceed 1 single line - and that line calls your lib ( always )
lkb has joined #ruby
msvbhat has quit [Ping timeout: 260 seconds]
<apeiros>
eugenmayer1: I think some amount of glue code is ok in a task
<eugenmayer1>
apeiros: and designing tasks having no input parameter is more or less unbelievable :)
<apeiros>
but yes, that's the gist
<apeiros>
eugenmayer1: I don't say I agree with the "tasks have no input param" design
<apeiros>
but it makes sense in a system where tasks invoke other tasks - it's hard to have a sane "nested params" input scheme.
<eugenmayer1>
i love rake, but that 2 things kill me. Seriously
<apeiros>
I guess there too, if you need input params, rake is just the wrong tool. write an executable.
<apeiros>
which in turn can use your library
<eugenmayer1>
yes, and know
tax_ has quit [Quit: Leaving]
<eugenmayer1>
sure i use OptParser and stuff, but there are downsides - .e.g you can run rake from any subfolder
<eugenmayer1>
while, if the bins are not in "global include path, you cannot do that with them
<apeiros>
or use something like thor, I think that's built more towards those kinds of goals.
<apeiros>
"if the bins are not in "global include path" - uh, guess what, same applies to rake. you can't run rake if your shell can't find it.
RegulationD has joined #ruby
<apeiros>
and you can write any executable so it find the root of your project
<gettalong>
When invoking such a method, multiple temporary arrays are created due to the splats and I try to get rid of them
<apeiros>
*finds
spider-mario has quit [Read error: Connection reset by peer]
spider-mario has joined #ruby
craigp_ has quit [Ping timeout: 240 seconds]
<apeiros>
gettalong: did you measure that those temp arrays are a perf. issue or are you just mentarbating?
<eugenmayer1>
apeiros: you can put rake once in you path, thats it
minimalism has quit [Quit: minimalism]
<eugenmayer1>
very different if you add custom "executables" for each subproject. Its absolutely unpractical.
<gettalong>
apeiros: I measured with allocation_tracer and in my test case millions of arrays were created, so the GC overhead is certainly a problem
yfeldblum has joined #ruby
<apeiros>
gettalong: if it is truly a problem, then expect arrays and don't splat. i.e. drop all *'s there.
<apeiros>
eugenmayer1: use bundler then
<gettalong>
apeiros: I know that this would get rid of the temp arrays but then the methods where the calls get dispatched to need to accept an array instead of individual values
RegulationD has quit [Ping timeout: 276 seconds]
msvbhat has joined #ruby
<eugenmayer1>
apeiros: bundler will help with rake, but not with custom bins, doesnt it?
<apeiros>
helps with custom bins too
<eugenmayer1>
apeiros: lets say i put bin/exe1 into my project then i go to ./foo/bar and run bundle exec exe1
<eugenmayer1>
does this seriously work?
<gettalong>
apeiros: The reason for the splats is that the target methods have a varying number of arguments, they don't do something like `def method(*args*)` but `def method(r, g, b)`.
<apeiros>
no, you put your bin in a gem you depend on. might also work if your project is a gem itself and part of the Gemfile. don't think I tried that, though.
ta_ has joined #ruby
<apeiros>
gettalong: so? method([r,g,b]), you can choose, but you can't have both.
<apeiros>
gettalong: also afaik ruby 2.2 and 2.3 did quite a bit of optimization wrt arguments passing, so if you're not using the newest ruby, that's also something you should try.
<eugenmayer1>
apeiros: putting every bin in a gem - is that seriously a practical solution to a simple rake task? even infrastructural that is a huge overkill, or?
dminuoso has joined #ruby
DoubleMalt has quit [Ping timeout: 252 seconds]
<gettalong>
apeiros: thanks! I have looked at the Ruby bug tracker and saw some optimization wrt to keyword arguments and splats. Which is one of the reason I'm using keyword arguments bc they are now nearly as fast as regular ones
<eugenmayer1>
apeiros: thors looks very promising. Do i suggest right that it is like rake++ ?
ta__ has quit [Ping timeout: 260 seconds]
<apeiros>
eugenmayer1: you have a plethora of ways to solve this. you can also write a "myexec" which you install once, finds your project's root and executes the bin there. e.g. 'myexec foo input args' and if finds your bin/foo and calls it with 'input args'
<eugenmayer1>
apeiros: i had a look at a comperison before and though thor is more like capistrano
<apeiros>
eugenmayer1: plenty of other ways you could do it come to mind. be creative. solve your problem.
msvbhat has quit [Ping timeout: 264 seconds]
<apeiros>
I haven't looked too much into thor, so can't comment on that.
passbe has joined #ruby
<eugenmayer1>
apeiros: solving problems "just somehow" is not what a strive for, esp when i use rake for devops. It must be portable and easy to install, and most of the solutions you named are neither of this
<eugenmayer1>
"these"
clearlybaffled has joined #ruby
<apeiros>
eugenmayer1: um, I think you make it harder than it is
Endie1 has joined #ruby
Endie has quit [Read error: Connection reset by peer]
bkxd has quit [Ping timeout: 272 seconds]
clearlybaffled has quit [Remote host closed the connection]
<apeiros>
having "myexec" and installing it on machines is no more difficult than having rake. but hey, as said - be creative. solve your problem. it's not on me to solve your problem. I just show you some options.
dminuoso has quit [Ping timeout: 240 seconds]
chipotle has joined #ruby
<gettalong>
apeiros: I will then probably try something like `def invoke1(operator, op)`, `def invoke2(operator, op1, op2)`, ... since most of the operators have only up to four operands
harfangk has quit [Quit: harfangk]
DenSchub has quit [Quit: This should never happen.]
emiltin has quit [Quit: Computer has gone to sleep.]
DenSchub has joined #ruby
<miqlas-H>
Hi Guys!
<miqlas-H>
I trying to port the latest ruby to Haiku, but i got this: http://termbin.com/3v3g
<miqlas-H>
Do you guys have any idea, what went wrong?
mdw has joined #ruby
pandaant has joined #ruby
<apeiros>
miqlas-H: if you don't get help here, try the ruby-core mailing list.
firstdayonthejob has quit [Ping timeout: 260 seconds]
DenSchub has quit [Client Quit]
<miqlas-H>
apeiros: thanks
<shevy>
a happy segfault!
<miqlas-H>
Pretty happy segfault
DenSchub has joined #ruby
<miqlas-H>
Is there a an International SEGFAULT Day already?
<jhass>
as if your openssl claims to support stuff it doesn't actually or so
<jhass>
resolve symbol "___tls_get_addr" returned: -2147478780
<miqlas-H>
Somebody told me, it is defined in gcc; it gets patched in runtime loader.
DenSchub has quit [Client Quit]
DenSchub has joined #ruby
trampi has joined #ruby
<miqlas-H>
I trying to compile it in chroot. Outside it compiles fine, but not in chroot. I make something wrong.
<miqlas-H>
Maybe something missing from chroot.... or something like that.
the_drow has quit [Quit: This computer has gone to sleep]
<miqlas-H>
I actually hate if i see warnings during the compiling. I get always warnings before the error coming, so it is a Pavlov-reflex for me, i think.
<eugenmayer1>
apeiros: are you doing devops?
<eugenmayer1>
apeiros: any, thank you a lot. You helped me big times!
<apeiros>
not on a scale where I'd call it "devops"
<apeiros>
yw
lupine has quit [Ping timeout: 258 seconds]
dhruvasagar has quit [Ping timeout: 244 seconds]
mdw has quit [Quit: Sleeping Zzzzz]
lupine has joined #ruby
bkxd has joined #ruby
bonhoeffer has joined #ruby
<bonhoeffer>
how could i read 10 1 10 1 10 from stdin into an array
moeabdol has joined #ruby
<shevy>
if it is a string, .split(' ') on it
dhruvasagar has joined #ruby
ardian_ has joined #ruby
zenguy_pc has quit [Ping timeout: 276 seconds]
allcentury has joined #ruby
zenguy_pc has joined #ruby
<ardian_>
Hello I am trying to understand some code but this syntax is not well known to me, and I am not sure what it is really doing.
<shevy>
it can be like: module Aws; class Image ... or vice versa... or two classes... or two modules
<apeiros>
ardian_: Aws is either a module or a class, within which the Image constant is defined
dhruvasagar has quit [Ping timeout: 244 seconds]
moeabdol has quit [Ping timeout: 276 seconds]
jinie has joined #ruby
<ardian_>
namespace ? this is a bit new to me, I am learning ruby. Thanks I will read more on that.
zacstewart has joined #ruby
allcentury has quit [Ping timeout: 252 seconds]
nankyoku_ has quit [Remote host closed the connection]
zacstewart has quit [Ping timeout: 250 seconds]
harfangk has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
giz|work has joined #ruby
zeroDi has quit [Quit: WeeChat 1.5]
harfangk has quit [Client Quit]
<hanmac>
hey shevy did you heard about "Yoda_conditions" before? XD
astrobunny has quit [Remote host closed the connection]
blackthor has joined #ruby
<jhass>
if 1 == var
moeabdol has joined #ruby
<hanmac>
jhass: yeah i laughed when i read that in another ruby article
<shevy>
hanmac did not hear it
hahuang61 has joined #ruby
jaguarmagenta has joined #ruby
A124 has quit [Ping timeout: 260 seconds]
craigp_ has joined #ruby
symm- has quit [Ping timeout: 250 seconds]
emiltin has joined #ruby
<miqlas-H>
Can you guys ecplain me the Yoda conditions?
moeabdol has quit [Ping timeout: 260 seconds]
<jhass>
miqlas-H: if 1 == var instead of if var == 1
A124 has joined #ruby
hogetaro has quit [Quit: Leaving...]
<jhass>
"1 is this thing?" instead of "is this thing 1?"
hahuang61 has quit [Ping timeout: 258 seconds]
jaguarmagenta has quit [Ping timeout: 240 seconds]
<shevy>
hey
<shevy>
that is japanese english!
RegulationD has joined #ruby
tomphp has joined #ruby
<miqlas-H>
what is the result if i compare something to 1 in ruby?
sarbs has quit [Ping timeout: 276 seconds]
elcontrastador has quit [Ping timeout: 276 seconds]
<shevy>
42
<shevy>
I guess it is unusual to have the var appear on the right side
nrk has quit [Quit: WeeChat 1.4]
JoL1hAHN has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
sarbs has joined #ruby
CloCkWeRX has quit [Quit: Leaving.]
<spudowiar>
miqlas-H: first case calls Fixnum#==, second calls var.==
strigon33 has joined #ruby
<miqlas-H>
spudowiar: i have no idea about ruby, so i cannot understand you, sorry.
<miqlas-H>
i'm just porting ruby,
<spudowiar>
miqlas-H: well, operators are just method calls
RegulationD has quit [Ping timeout: 276 seconds]
<spudowiar>
miqlas-H: you'll want to learn the language at a lower level if you're porting it
sdothum has joined #ruby
<shevy>
oh good explanation
<apeiros>
spudowiar: they may not be porting it for their own purposes
<spudowiar>
shevy: sarcasm?
<spudowiar>
apeiros: but still
strigonLeader has quit [Ping timeout: 244 seconds]
<miqlas-H>
spudowiar: i'm using ruby (trough jekyll) since long time, but the programming site isn't interresting me. Just he posrting. And as ruby got c based bootstrap, i can port it and test it with jekyll.
cajone has quit [Remote host closed the connection]
<apeiros>
spudowiar: na, if I'd be porting packages for an OS, I wouldn't want to learn each package. it's not necessary for the task of "porting".
<spudowiar>
apeiros: ah, I see
<spudowiar>
apeiros: I get what you're saying
<miqlas-H>
i just want to update the haiku package to the latest one. Thats all.
<shevy>
spudowiar where do you read sarcasm?
hightower2 has quit [Remote host closed the connection]
blackthor has quit []
<miqlas-H>
We already have a working ruby port, but it is a bit old: ruby 2.2.2p95 (2015-04-13 revision 50295) [i586-haiku]
<spudowiar>
shevy: "oh good explanation" reads a bit like "yeah... You think *that* is a good way to explain it -- no way! lol"
<shevy>
spudowiar naaaah, I have no idea how you interprete it but just to make it clear, there was no sarcasm in my statement, I simply have not thought about that difference at all
<spudowiar>
shevy: well, to me, anyway
dminuoso has joined #ruby
moeabdol has joined #ruby
<spudowiar>
shevy: oh OK. Thanks :)
<miqlas-H>
As i'm not a software developer, i cannot understand too much tings. But configure && make possible for me.
<spudowiar>
It might be #==? I'm not sure
<spudowiar>
Idk tho
<spudowiar>
No, it's just #==
cajone has joined #ruby
<miqlas-H>
But i know a bit python, c and c++, so i thnk i can port some things.
<spudowiar>
Essentially, in Ruby, every operator is a method of the first operand. For a binary operator, the second operand is passed as an argument.
<shevy>
miqlas-H if it just would not segfault already!
<spudowiar>
ideally (a == b) == (b == a) but not always
<spudowiar>
shevy: haha
TomyLobo has quit [Ping timeout: 264 seconds]
<jhass>
miqlas-H: this does look more like a Haiku than a Ruby issue tbh, probably one of your compatibility layers missing in the chroot
bonhoeffer has quit [Ping timeout: 250 seconds]
dminuoso has quit [Ping timeout: 240 seconds]
d0lph1n98 has quit [Ping timeout: 276 seconds]
<miqlas-H>
It segfaults :(
conta has quit [Ping timeout: 264 seconds]
<jhass>
the segfault is just the symptom
<jhass>
your dynamic linker returning an invalid reference is the issue
Mon_Ouie has joined #ruby
DoubleMalt has quit [Ping timeout: 258 seconds]
SCHAAP137 has joined #ruby
emiltin has quit [Quit: Computer has gone to sleep.]
tildes has quit [Ping timeout: 244 seconds]
<miqlas-H>
jhass: i'm reading about phlosophy, what it means then?
<jhass>
sorry?
<miqlas-H>
did i made sething wrng in my life? maybe the linker want to show me, tat something wrong in my lifestyle.
<miqlas-H>
that there is
<jhass>
heh
<miqlas-H>
maybe i should chage on my lifestyle.
<jhass>
tls in this context standing for thread local storage instead of transport layer security is quite mean I guess
miqlas-H has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
tildes has quit [Ping timeout: 272 seconds]
zacstewart has joined #ruby
dc1 has quit [Ping timeout: 240 seconds]
RegulationD has quit [Ping timeout: 260 seconds]
nankyokusei has joined #ruby
hanmac has quit [Ping timeout: 272 seconds]
zacstewart has quit [Ping timeout: 240 seconds]
DoubleMalt has joined #ruby
<shevy>
hmmmmmm
<shevy>
ruby and kant ... this channel can be weird sometimes
strigon33 is now known as strigonLeader
ta__ has joined #ruby
allcentury has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
ta_ has quit [Ping timeout: 264 seconds]
jenrzzz has quit [Ping timeout: 258 seconds]
nadir has quit [Quit: Connection closed for inactivity]
jenrzzz has joined #ruby
hanmac has joined #ruby
hahuang61 has joined #ruby
hahuang61 has quit [Ping timeout: 250 seconds]
Pumukel has joined #ruby
<gettalong>
apeiros: Regarding are conversation about splats: I updated the code to not use splats where possible while still providing a useful and easy to use API. Result: 81% fewer arrays created and 23% faster for my test case :) Now only about 5 times slower than Java code doing the same
dminuoso has joined #ruby
Mia has joined #ruby
Nahra has joined #ruby
dminuoso has quit [Ping timeout: 276 seconds]
ponga has quit []
Endie1 has quit [Quit: Leaving.]
nankyokusei has quit [Remote host closed the connection]
hays has quit [Quit: No Ping reply in 180 seconds.]
hays has joined #ruby
boboc has joined #ruby
msvbhat has joined #ruby
pandaant has quit [Remote host closed the connection]
DTZUBDUB has quit [Ping timeout: 272 seconds]
d0lph1n98 has joined #ruby
yfeldblum has quit [Ping timeout: 250 seconds]
dextertzu has quit [Read error: Connection reset by peer]
Endie has joined #ruby
DTZUZU has quit [Ping timeout: 246 seconds]
DTZUZU has joined #ruby
<sandelius>
gettalong do the same in crystal and bench it :)
boboc has quit []
<jhass>
just don't actually use any arrays, splats would be faster there
elementaru has joined #ruby
c0mrad3 has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
DTZUBDUB has joined #ruby
ta_ has joined #ruby
ta__ has quit [Ping timeout: 264 seconds]
RegulationD has joined #ruby
lkb_ has joined #ruby
<gettalong>
sandelius: I actually looked at crystal last weekend and ported some parsing code to crystal. The Ruby code uses StringScanner and Crystal code is based on the Crystal json code.
<gettalong>
sandelius: The speed difference wasn't drastic, though. The crystal code took about 7sec and the Ruby code 10sec.
loseyoumind has quit [Ping timeout: 272 seconds]
zacstewart has joined #ruby
moeabdol has quit [Ping timeout: 260 seconds]
averagejeoux has joined #ruby
RegulationD has quit [Ping timeout: 252 seconds]
lkb has quit [Ping timeout: 272 seconds]
<gettalong>
jhass: the problem is that the splat operator creates arrays and this was the problem in my case
dhruvasagar has joined #ruby
<jhass>
gettalong: in crystal that is ;)
c355e3b has joined #ruby
<jhass>
did you compile your thingy with --release?
<gettalong>
sandelius: I will definitely look more into Crystal in the future but right now I rather complete the Ruby code
<gettalong>
jhass: Ah, good to know ;) And yes, did compile with --release
<sandelius>
gettalong Ruby is more than enough 95% of the times soo go for it :)
<jhass>
well if you want to us to look over it for any obvious optimizations hop into #crystal-lang ;)
zacstewart has quit [Ping timeout: 250 seconds]
dhruvasagar has quit [Ping timeout: 252 seconds]
msvbhat has quit [Ping timeout: 264 seconds]
<gettalong>
sandelius: Yeah, you are completely right. My code in Ruby outperforms some code in C++ after I though a bit more about the problem ;-) -- see https://gist.github.com/gettalong/8955ff5403fe7abb7bee and the benchmark for e.pdf (hexapdf vs qpdf)
<gettalong>
jhass: thanks, I was there last week and you already helped me :)
<jhass>
heh, sorry I don't memoize nicks :)
jenrzzz has quit [Ping timeout: 260 seconds]
lxsameer has quit [Quit: WeeChat 1.5]
<gettalong>
jhass: No problem. As I said I will need to learn the Crystal basics so that I have a better understanding of how to do things in crystal
gettalong has quit [Changing host]
gettalong has joined #ruby
jenrzzz has joined #ruby
tomphp has joined #ruby
davedev24 has joined #ruby
jaguarmagenta has joined #ruby
hahuang61 has joined #ruby
lkb_ has quit [Quit: Wychodzi]
GodFather has joined #ruby
lkb has joined #ruby
jaguarmagenta has quit [Ping timeout: 246 seconds]
hahuang61 has quit [Ping timeout: 250 seconds]
hogetaro has joined #ruby
<shevy>
until it will become crystal clear
ekinmur has joined #ruby
aryaching has joined #ruby
Yzguy has quit [Quit: Zzz...]
Es0teric has joined #ruby
dminuoso has joined #ruby
cajone has quit [Ping timeout: 240 seconds]
dminuoso has quit [Ping timeout: 276 seconds]
Who has joined #ruby
ekinmur has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ptx0 has quit [Ping timeout: 272 seconds]
freerobby has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
loseyoumind has joined #ruby
AlexRussia has joined #ruby
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gregf has quit [Quit: WeeChat 1.5]
freerobby has quit [Quit: Leaving.]
RegulationD has joined #ruby
zacstewart has joined #ruby
Ishido has quit [Remote host closed the connection]
RegulationD has quit [Ping timeout: 276 seconds]
kareeoleez has quit [Remote host closed the connection]
benlieb has joined #ruby
gregf has joined #ruby
dhruvasagar has joined #ruby
zacstewart has quit [Ping timeout: 244 seconds]
Ishido has joined #ruby
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
Tempesta_ has joined #ruby
dhruvasagar has quit [Ping timeout: 244 seconds]
Mia has quit [Read error: Connection reset by peer]
adambeynon_ has joined #ruby
zzak____ has joined #ruby
solocshaw has joined #ruby
err_ok_ has joined #ruby
jmhmccr_ has joined #ruby
solocshaw has quit [Read error: Connection reset by peer]
staticfox` has joined #ruby
staticfox has quit [Disconnected by services]
frode15243_ has joined #ruby
rheddry has joined #ruby
dhk has joined #ruby
Lloyd__ has joined #ruby
benlieb_ has joined #ruby
staticfox` is now known as staticfox
Cyrus1 has joined #ruby
meinside_ has joined #ruby
Hates__ has joined #ruby
jimcroft_ has joined #ruby
im0b_ has joined #ruby
daxroc_ has joined #ruby
solocshaw has joined #ruby
pizzaops_ has joined #ruby
vikid_ has joined #ruby
bttf_ has joined #ruby
zrl__ has joined #ruby
KINGSABRI___ has joined #ruby
spidermario has joined #ruby
ggherdov_ has joined #ruby
madhatter has joined #ruby
Some-body_ has joined #ruby
angelixd_ has joined #ruby
c0mrad3___ has joined #ruby
Prira has joined #ruby
abort_ has joined #ruby
pabs_ has joined #ruby
piotrj_ has joined #ruby
sunya7a__ has joined #ruby
Azure|dc has joined #ruby
Lewix_ has joined #ruby
kapowaz_ has joined #ruby
arlek has joined #ruby
RazorX- has joined #ruby
orangey is now known as openmedbot
twodayslate_ has joined #ruby
cfillion_ has joined #ruby
jinie_ has joined #ruby
bestie_ has joined #ruby
tvsutton_ has joined #ruby
sorah_ has joined #ruby
SirFunk_ has joined #ruby
darix- has joined #ruby
hfp__work has joined #ruby
electrostat_ has joined #ruby
mexis_ has joined #ruby
aef_ has joined #ruby
Soulcutter has joined #ruby
helpa has quit [Remote host closed the connection]
c0mrad3 has quit [Ping timeout: 258 seconds]
pizzaops has quit [Ping timeout: 258 seconds]
jokke1 has joined #ruby
teotwaki has quit [Ping timeout: 258 seconds]
Bugboy1028 has quit [Ping timeout: 258 seconds]
RazorX has quit [Ping timeout: 258 seconds]
arthurnn has quit [Ping timeout: 258 seconds]
tessi_zz has quit [Ping timeout: 258 seconds]
dunj4 has quit [Ping timeout: 258 seconds]
benlieb has quit [Ping timeout: 258 seconds]
jinie has quit [Ping timeout: 258 seconds]
ggherdov has quit [Ping timeout: 258 seconds]
andersh has quit [Ping timeout: 258 seconds]
kapowaz has quit [Ping timeout: 258 seconds]
aef has quit [Ping timeout: 258 seconds]
Affix has quit [Ping timeout: 258 seconds]
jmhmccr has quit [Ping timeout: 258 seconds]
bestie has quit [Ping timeout: 258 seconds]
adambeynon has quit [Ping timeout: 258 seconds]
err_ok has quit [Ping timeout: 258 seconds]
frode15243 has quit [Ping timeout: 258 seconds]
twodayslate has quit [Ping timeout: 258 seconds]
zzak___ has quit [Ping timeout: 258 seconds]
jimcroft has quit [Ping timeout: 258 seconds]
tjvc has quit [Ping timeout: 258 seconds]
FernandoBasso has quit [Ping timeout: 258 seconds]
tekacs has quit [Ping timeout: 258 seconds]
M-mistake has quit [Ping timeout: 258 seconds]
nchambers has quit [Ping timeout: 258 seconds]
apeiros has quit [Ping timeout: 258 seconds]
scorphus has quit [Ping timeout: 258 seconds]
im0b has quit [Ping timeout: 258 seconds]
hayden__ has quit [Ping timeout: 258 seconds]
amitchellbullard has quit [Ping timeout: 258 seconds]
solars has quit [Ping timeout: 258 seconds]
Vile` has quit [Ping timeout: 258 seconds]
meinside has quit [Ping timeout: 258 seconds]
bttf has quit [Ping timeout: 258 seconds]
Tempesta has quit [Ping timeout: 258 seconds]
abort has quit [Ping timeout: 258 seconds]
DarthGandalf has quit [Ping timeout: 258 seconds]
tubbo has quit [Ping timeout: 258 seconds]
angelixd has quit [Ping timeout: 258 seconds]
rflot has quit [Ping timeout: 258 seconds]
zrl_ has quit [Ping timeout: 258 seconds]
daxroc has quit [Ping timeout: 258 seconds]
Sou|cutter has quit [Ping timeout: 258 seconds]
bunzz has quit [Ping timeout: 258 seconds]
tobiasvl has quit [Ping timeout: 258 seconds]
aspiers has quit [Ping timeout: 258 seconds]
matp has quit [Ping timeout: 258 seconds]
Azure has quit [Ping timeout: 258 seconds]
Lewix has quit [Ping timeout: 258 seconds]
spastorino has quit [Ping timeout: 258 seconds]
iooner has quit [Ping timeout: 258 seconds]
Phanes has quit [Ping timeout: 258 seconds]
llua has quit [Ping timeout: 258 seconds]
CustosLimen has quit [Ping timeout: 258 seconds]
cfillion has quit [Ping timeout: 258 seconds]
pabs has quit [Ping timeout: 258 seconds]
hfp_work has quit [Ping timeout: 258 seconds]
Tharbakim has quit [Ping timeout: 258 seconds]
jokke has quit [Ping timeout: 258 seconds]
vikid has quit [Ping timeout: 258 seconds]
avdi has quit [Ping timeout: 258 seconds]
Lloyd has quit [Ping timeout: 258 seconds]
tvsutton has quit [Ping timeout: 258 seconds]
levifig has quit [Ping timeout: 258 seconds]
Luna_Moonfang has quit [Ping timeout: 258 seconds]
TheBrayn has quit [Ping timeout: 258 seconds]
moss has quit [Ping timeout: 258 seconds]
bazzy has quit [Ping timeout: 258 seconds]
sorah has quit [Ping timeout: 258 seconds]
Guest73139 has quit [Ping timeout: 258 seconds]
Cyrus has quit [Ping timeout: 258 seconds]
spider-mario has quit [Ping timeout: 258 seconds]
electrostat has quit [Ping timeout: 258 seconds]
whiteline has quit [Ping timeout: 258 seconds]
piotrj has quit [Ping timeout: 258 seconds]
KINGSABRI__ has quit [Ping timeout: 258 seconds]
Hates_ has quit [Ping timeout: 258 seconds]
darix has quit [Ping timeout: 258 seconds]
xxneolithicxx has quit [Ping timeout: 258 seconds]
SirFunk has quit [Ping timeout: 258 seconds]
SenpaiSilver has quit [Ping timeout: 258 seconds]
Sammichmaker has quit [Ping timeout: 258 seconds]
raddazong has quit [Ping timeout: 258 seconds]
mexis has quit [Ping timeout: 258 seconds]
Todd has quit [Ping timeout: 258 seconds]
Shidash has quit [Ping timeout: 258 seconds]
sunya7a_ has quit [Ping timeout: 258 seconds]
Prira_ has quit [Ping timeout: 258 seconds]
thejoecarroll has quit [Ping timeout: 258 seconds]
dcope has quit [Ping timeout: 258 seconds]
ullu has joined #ruby
dcope has joined #ruby
helpa has joined #ruby
benlieb_ is now known as benlieb
tedwards has joined #ruby
Some-body_ is now known as DarthGandalf
electrostat_ is now known as electrostat
Olipro_ has joined #ruby
hfp__work is now known as hfp_work
darix- is now known as darix
dcope has quit [Changing host]
dcope has joined #ruby
bazzy- has joined #ruby
hahuang61 has joined #ruby
SenpaiSilver has joined #ruby
LW_Luna has joined #ruby
err_ok_ is now known as err_ok
bestie_ is now known as bestie
Olipro_ is now known as Guest71530
zzak____ is now known as zzak___
tubbo has joined #ruby
CustosLimen has joined #ruby
adambeynon_ is now known as adambeynon
whiteline has joined #ruby
tessi_zz has joined #ruby
matp has joined #ruby
Affix has joined #ruby
jmhmccr_ is now known as jmhmccr
frode15243_ is now known as frode15243
solocshaw has quit [Ping timeout: 260 seconds]
llua has joined #ruby
Tharbakim has joined #ruby
memorasus has quit [Remote host closed the connection]
tekacs has joined #ruby
thejoecarroll has joined #ruby
Shidash has joined #ruby
TheBrayn has joined #ruby
jimcroft_ is now known as jimcroft
iooner has joined #ruby
Affix is now known as Guest66202
hayden__ has joined #ruby
teotwaki has joined #ruby
pizzaops_ is now known as pizzaops
aspiers has joined #ruby
avdi has joined #ruby
memorasus has joined #ruby
solars has joined #ruby
Phanes has joined #ruby
Phanes has quit [Changing host]
Phanes has joined #ruby
xxneolithicxx has joined #ruby
biberu has joined #ruby
xxneolithicxx has quit [Max SendQ exceeded]
Hates__ is now known as Hates_
c0mrad3___ is now known as c0mrad3
meinside_ is now known as meinside
spidermario is now known as spider-mario
apeiros has joined #ruby
kapowaz_ is now known as kapowaz
M-mistake has joined #ruby
nchambers has joined #ruby
vikid_ is now known as vikid
spastorino has joined #ruby
xxneolithicxx has joined #ruby
Vile` has joined #ruby
twodayslate_ is now known as twodayslate
tjvc has joined #ruby
bunzz has joined #ruby
tjvc has quit [Changing host]
tjvc has joined #ruby
arthurnn has joined #ruby
dunj3 has joined #ruby
arlek_ has joined #ruby
andersh has joined #ruby
moeabdol has joined #ruby
northfurr has joined #ruby
Lloyd__ is now known as Lloyd
amitchellbullard has joined #ruby
Bugboy1028 has joined #ruby
im0b_ is now known as im0b
tvl has joined #ruby
tvl is now known as tobiasvl
hahuang61 has quit [Ping timeout: 250 seconds]
rflot has joined #ruby
spudowiar has quit [Ping timeout: 276 seconds]
Lewix_ is now known as Lewix
arlek has quit [Ping timeout: 246 seconds]
chip_ has joined #ruby
daxroc_ is now known as daxroc
<shevy>
freenode splittings?
nando293921 has joined #ruby
arlek has joined #ruby
bttf_ is now known as bttf
nhhc has quit [Quit: Leaving]
FernandoBasso has joined #ruby
zrl__ is now known as zrl_
moeabdol has quit [Ping timeout: 250 seconds]
ggherdov_ is now known as ggherdov
arlek_ has quit [Ping timeout: 272 seconds]
Hyuk has joined #ruby
kirun has joined #ruby
arlek_ has joined #ruby
macsteps has joined #ruby
Tempesta_ is now known as Tempesta
Tempesta has quit [Changing host]
Tempesta has joined #ruby
arlek has quit [Ping timeout: 246 seconds]
darix has quit [Quit: Changing server]
darix has joined #ruby
unknown| has joined #ruby
arlek has joined #ruby
dminuoso has joined #ruby
spudowiar has joined #ruby
arlek_ has quit [Ping timeout: 272 seconds]
arlek_ has joined #ruby
d0lph1n98 has quit [Ping timeout: 264 seconds]
<A124>
Does anyone know how to communicate with BDB from current Ruby?
<jhass>
is this a one off thing or something you need some more permanent solution for?
nadir has joined #ruby
Snowy has joined #ruby
arlek has quit [Ping timeout: 246 seconds]
Snowy has quit [Client Quit]
Snowy has joined #ruby
catt has joined #ruby
<catt>
hello
<jhass>
hi
<A124>
jhass Both.
<catt>
I need to properly configure the fontpath in the vncserver script when I launch the command 'vncserver :1 -geometry 1680x1050 -depth 32'
<catt>
I need to configure properly*
ullu has quit [Ping timeout: 258 seconds]
<jhass>
A124: heh. Well as it stands Ruby's ecosystem looks dim on this front. If you want to spend the effort on porting the existing gem or making a new one that'd be great, but I think personally I'd look into an alternative, Ruby might simply not be the right tool here
dhruvasagar has quit [Ping timeout: 272 seconds]
arlek_ has quit [Ping timeout: 276 seconds]
<A124>
Crap. I am just iterating over databases and cannot find a good one.
<A124>
Except cassandra, which is not that simple.
craigp_ has quit [Ping timeout: 244 seconds]
<jhass>
A124: oh so this isn't some legacy to convert but something new entirely?
pLaToOn is now known as pLaTo0n
pLaTo0n has quit [Changing host]
pLaTo0n has joined #ruby
<jhass>
catt: is that a question? I'm not sure how it relates to Ruby
tomphp has joined #ruby
<catt>
Yes, a question.
vuoto has quit [Remote host closed the connection]
<jhass>
well, could you elaborate?
tomphp has quit [Client Quit]
<eugenmayer1>
jhass: how can you even be that friendly in that case. Huge calmness over there :)
<jhass>
catt: you should get some output with some command to run, did you run that command?
hahuang61 has joined #ruby
northfurr has quit [Quit: northfurr]
northfurr has joined #ruby
edwardly has quit [Ping timeout: 240 seconds]
macsteps has quit [Remote host closed the connection]
<catt>
jhass: the output is what you say.
emiltin has joined #ruby
<eugenmayer1>
jhass: interesting point there ( tltr the fully thing, but still ). I am failing with the "treat with respect" aspect regulary, when the 'other person' obviously has not respect at all
<A124>
jhass Yes, new. I even did my flat file databases, but since my knowledge grew. I do not know about good libraries and stuff, if they even exist, and implementing own DB does take time to do it properly, test and benchmark. Indexing and more. I have uses for both key-value and columns, thouch I could cheat on that. So far I got trick with memcache interface on top of bdb, but that does not [...]
<A124>
[...] support cursor, so..
<jhass>
eugenmayer1: this is obviously just language barrier
<jhass>
catt: so all good?
<eugenmayer1>
jhass: looks like that
ta__ has joined #ruby
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
<catt>
All bad.
jaguarmagenta has quit [Ping timeout: 276 seconds]
<eugenmayer1>
jhass: Or its Donald :)
<jhass>
catt: please make a gist showing us everything you did so far including all output
<jhass>
?gist catt
<ruby[bot]>
catt: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<jhass>
eugenmayer1: most people use $EDITOR and $SHELL ;)
Es0teric has joined #ruby
nictrasavios has joined #ruby
<jhass>
vim/zsh being probably the most popular, but emacs, {sublime,atom}/{zsh,fish,bash} are not unseen
<eugenmayer1>
the reason i ask: i am not a real ruby expert at all. Everytime i write ruby, i struggle due to the autocompletition being that bad in ruby ( due to the language itself .. ) - so i have to look up every method of array/hash/string/gem something
<A124>
jhass Well, documents, small / larger (bytes to hundreds of kb). That is ideas for key-value with encryption that can use multiple blocks variably. The other is hash table basicaly and meta, tags, and stuff, but the the hashes and data might be tree-like, aka a column record could be multiple of same type.
tildes has joined #ruby
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<A124>
eugenmayer1 Sublime is nice. Atom also, but Atom is kinda slow
<jhass>
?pry eugenmayer1
<ruby[bot]>
eugenmayer1: Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
<jhass>
A124: that sounds very... general
<jhass>
it's hard to make good suggestions for a description of your project like that
dminuoso has joined #ruby
<A124>
jhass First case is general blob store, yes, the other is specific.
<eugenmayer1>
A124: you seem to stick to nosql already - am i right
<jhass>
catt: I don't see anything related to Ruby or RVM in your gist
<A124>
eugenmayer1 Yeah, seems so.
<eugenmayer1>
reading attributes like tags, trees .. most probably relates to "relations" and that is a pretty good argument against the usage of EVERY nosql
<eugenmayer1>
decide wheather you have relations, or not. I intentionally did not say "want relations" not matter what you want - what does the application/domain enforces
<eugenmayer1>
if you have relations, keep your fingers way from nosql.
ta_ has joined #ruby
<eugenmayer1>
Secondly, if you have, like you describe, heavy structured data and you _care_ about the structure - do not use nosql
<jhass>
postgresql has become a fairly good polyglot actually
tildes has quit [Ping timeout: 246 seconds]
<eugenmayer1>
what jhass said.
<jhass>
the graph stuff is missing in it though
ta__ has quit [Ping timeout: 258 seconds]
<eugenmayer1>
A124: if you really do no have a _really_ good use case for nosql or you are not sure, always pick postgresql
armyriad has quit [Ping timeout: 250 seconds]
<jhass>
unless you need graph stuff that isn't for GIS stuff (then use PostGIS)
Xeago_ has joined #ruby
<eugenmayer1>
A124: i use percona/postgresql/mongodb depending on the app, sometimes 2 of them at the same time.
armyriad has joined #ruby
<eugenmayer1>
but i really start to dislike mongo, heavily and am looking for alternatives
<jhass>
but for simple schema less key value stuff you can just use an hstore column in postgresql
<eugenmayer1>
KV can be redist also, if it does not need to persist
<A124>
eugenmayer1 Tried, but that means running postgresql, small DB like BDB that can be archived, backep up and copied is simpler for document store. And cassandra is nice with blobs and stuff, but the setup needs more and .. requirements are larger.
dminuoso has quit [Ping timeout: 276 seconds]
SCHAAP137 has quit [Quit: Leaving]
cajone has joined #ruby
<A124>
Will take a look at percona and mongo, I was there when mongo started, well it was not yet mongo, but the improvements over last years are massive.
<jhass>
xapian might solve the metadata stuff for you, didn't really look into it yet
ta_ has quit [Remote host closed the connection]
SCHAAP137 has joined #ruby
<eugenmayer1>
A124: i do myself not really suggest mongo. They have a HUGE QA issue accross all ecosystems
<eugenmayer1>
(remember, i am not really biased against mongo .. i am using it mysql )
nankyokusei has joined #ruby
<eugenmayer1>
i heard about RethinkDB being pretty solid, maybe Riak. Others maybe.
<eugenmayer1>
A124:
nankyokusei has quit [Ping timeout: 244 seconds]
<eugenmayer1>
if you though really have a lot of classifications of entities like tags/ categories, dates and you want to filter on them, also provide filter for users or similar ( could be the case in what you described ) use a facetted search like elasticsearch or solr
<eugenmayer1>
the important aspect here is, if you will offer either drill-down views on your data, or filters (intelligent filters which give the use a set of values possible, not just "enter somehting here" uups nothing found, try again)
mistermocha has joined #ruby
rbennacer has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
firstdayonthejob has joined #ruby
mistermo_ has joined #ruby
misterm__ has joined #ruby
mistermocha has quit [Ping timeout: 244 seconds]
tourist_F has joined #ruby
mistermocha has joined #ruby
tildes has joined #ruby
rbennacer has quit [Remote host closed the connection]
mistermo_ has quit [Ping timeout: 250 seconds]
Who has quit [Quit: Who]
tmtwd has joined #ruby
User458764 has joined #ruby
mistermo_ has joined #ruby
emiltin has quit [Quit: Computer has gone to sleep.]
<jhass>
but keep in mind that you have less than a year left of support from canonical for that ubuntu version
pawnbox has quit [Ping timeout: 250 seconds]
nankyokusei has joined #ruby
davedev24 has quit [Remote host closed the connection]
<nictrasavios>
Even Mint 17 (Current version, installed a few days ago), only had Ruby 1.9 in the default repos. Since it includes the newest ubuntu repos, that means even current ubuntu is behind.
<nictrasavios>
I've actually, and this is sad to say considering I'm on a near decade of using linux, how to find if a package I want exists in the defaults without searching through packages.ubuntu.com. Possibly OT, but I wish finding working dev tools was a little easier.
<ManWithNoName>
jhass: Thanks for the tip ! I'm a beginner with linux, I didn' think that we need to add other repositories.
ledestin has joined #ruby
<jhass>
ManWithNoName: why are you starting with a 4 years old linux if it's your first?
yma__gib has joined #ruby
tmtwd has quit [Ping timeout: 240 seconds]
tristanp_ has joined #ruby
<ManWithNoName>
jhass : I'm using vagrant with virtualbox. Precise don't need lot of MB and is always supported until April 2017. So I thought it was a good way to begin
ledestin has quit [Ping timeout: 276 seconds]
tristanp has quit [Ping timeout: 250 seconds]
rbennacer has joined #ruby
Endie has joined #ruby
<ManWithNoName>
jhass: I can install ruby v2.2 but when I try to switch with this version "sudo ruby-switch --set ruby2.2" and then "ruby -v", it always display v1.8.7
<nictrasavios>
Test
<nictrasavios>
Sorry, client bugged out.
<jhass>
ManWithNoName: try logging out and back in again
<jhass>
ManWithNoName: and does ruby2.2 -v work?
sepp2k has quit [Ping timeout: 244 seconds]
sepp2k has joined #ruby
<ManWithNoName>
jhass: That works fine after log out then log in ! Thanks
memorasus has quit [Remote host closed the connection]
voodoofish430 has joined #ruby
SCHAAP137 has quit [Ping timeout: 276 seconds]
RegulationD has joined #ruby
voodoofish4301 has quit [Ping timeout: 276 seconds]
RegulationD has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
mozzarella has quit [Quit: WeeChat 1.4]
firstdayonthejob has quit [Quit: WeeChat 1.5]
memorasus has joined #ruby
nictrasavios has left #ruby ["My whole life has been unlimited code works."]
dhruvasagar has joined #ruby
nictrasavios has joined #ruby
xall has joined #ruby
diegoviola has quit [Quit: WeeChat 1.5]
SCHAAP137 has joined #ruby
dhruvasagar has quit [Ping timeout: 264 seconds]
the_drow has quit [Quit: This computer has gone to sleep]
joneshf-laptop has joined #ruby
pLaTo0n has quit [Read error: Connection reset by peer]
Snowy has quit [Remote host closed the connection]
AlexRussia has quit [Ping timeout: 260 seconds]
hahuang61 has joined #ruby
aries_liuxueyang has quit [Quit: No Ping reply in 180 seconds.]
xall_ has joined #ruby
aries_liuxueyang has joined #ruby
hahuang61 has quit [Ping timeout: 250 seconds]
xall has quit [Ping timeout: 258 seconds]
diegoviola has joined #ruby
firstdayonthejob has joined #ruby
triangles has quit [Quit: Leaving]
Xeago__ has quit [Remote host closed the connection]
electrostat has quit [Read error: Connection reset by peer]
freerobby has joined #ruby
macsteps has joined #ruby
Xeago has joined #ruby
electrostat has joined #ruby
sesquipedalian has joined #ruby
last_staff has joined #ruby
RegulationD has joined #ruby
pilne has joined #ruby
<nictrasavios>
So, there is a gem that I want to use that requires MongoDB. I see a a lot "cloud solutions" and such, is there a database that is simple, local, secure and doesn't rely on other services?
<nictrasavios>
Or a way that I can include a little local DB on a heroku server, without using mLab or relying on free services that might disappear tomorrow?
<adaedra>
There's no way of having a MongoDB on heroku?
JoL1hAHN has joined #ruby
RegulationD has quit [Ping timeout: 244 seconds]
<nictrasavios>
I know absolutely nothing about mongoDB, the last time I did any web-stuff, mySQL was the standard and LAMP was king.
<nictrasavios>
So, I don't know if its possible to have puma/sinatra open a little local db, and just store stuff there, or how that would work with git-commits and pushes to the server
neo_ has joined #ruby
AlexRussia has quit [Ping timeout: 250 seconds]
miqlas-H has joined #ruby
ullu has quit [Ping timeout: 260 seconds]
ManWithNoName has joined #ruby
<nictrasavios>
If it's not mongo, and another database like thing (YAML?), that's fine. I'll just fork the gem
electrostat has quit [Read error: Connection reset by peer]
nwmcsween_ has joined #ruby
<nictrasavios>
18$/mo for cloud hosted db ;P.
giz|work has joined #ruby
<unknown|>
glad to help, sorry not free
<nictrasavios>
Not really a help there, since I asked about local, not cloud hosted
electrostat has joined #ruby
<unknown|>
thought u said on heroku
<unknown|>
not know bout the services
<adam12>
nictrasavios: Whatcha building?
ctp__ has joined #ruby
Coldblackice has joined #ruby
scepticulous has joined #ruby
<nictrasavios>
I'm trying to implement the slack-ruby-server gem, which uses mongodb, but I don't want to use any sort of cloud hosted db. I just want it to make a little file on the server, store what i needs, and pull from the file. Same way Apache/PHP/MySQL used to all work together/
<nictrasavios>
adam12, I'm actually in the process of converting my app from working with slack-ruby-bot to slack-ruby-server since slack-ruby-bot requires an API token (for a custom bot).but I'm deploying a full app, which only gives a Client token. I don't know enough about slack or ruby to know if I can convert slack-ruby-bot to use the Client ID
moeabdol has joined #ruby
ctp__ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<nictrasavios>
For all I know, if I pass slack-ruby-bot the client token It'll just work, and I'll look like a complete idiot.
howdoi has quit [Quit: Connection closed for inactivity]
ManWithNoName has left #ruby ["Leaving"]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
dminuoso has joined #ruby
moei has quit [Quit: Leaving...]
moeabdol has quit [Ping timeout: 250 seconds]
<nictrasavios>
Nope, that failed ;P
moei has joined #ruby
conta has quit [Ping timeout: 244 seconds]
Dimik has quit [Ping timeout: 240 seconds]
dminuoso has quit [Ping timeout: 240 seconds]
Gasher has joined #ruby
ctp__ has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
yma__gib has joined #ruby
lkb has quit [Quit: Wychodzi]
slowmatt has quit [Ping timeout: 246 seconds]
rbennacer has quit [Remote host closed the connection]
slowmatt has joined #ruby
patrick_star_3 has joined #ruby
fantazo has joined #ruby
patrick_star has quit [Ping timeout: 244 seconds]
yma__gib has quit [Ping timeout: 276 seconds]
yfeldblum has joined #ruby
dhruvasagar has joined #ruby
Es0teric has joined #ruby
freerobby has quit [Quit: Leaving.]
<nictrasavios>
*sigh*. The trials of a C dev trying to become a ruby dev. I'm in over my head.
macsteps has quit [Remote host closed the connection]
RegulationD has joined #ruby
<Mon_Ouie>
I prefer the first one. That way, if you ever create a subclass of Product, the method will still work because you do not explicitly reference Product anywhere.
sergey_makagon has joined #ruby
<ruby-lang642>
oh okay, so if I do that I should also change line 33 right? From Product.find_by => self.class.find_by?
yma__gib has quit [Ping timeout: 276 seconds]
miqlas-H has quit [Ping timeout: 276 seconds]
yma__gib has joined #ruby
<Mon_Ouie>
Yes, that's what I'd do (Even though admittedly self.class looks a bit awkward because you need the explicit self to call it)
Rickmasta has joined #ruby
ctp__ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
RegulationD has quit [Ping timeout: 240 seconds]
<ruby-lang642>
yeah that's why i changed it to Product since my last change.
<ruby-lang642>
thanks for the tips
macsteps has joined #ruby
jgt1 has joined #ruby
noobQ has quit [Quit: WeeChat 0.4.2]
freerobby has joined #ruby
LoneHerm_ has quit [Remote host closed the connection]
sumobob has quit [Ping timeout: 250 seconds]
macsteps has quit [Remote host closed the connection]
triangles has quit [Quit: Leaving]
<spudowiar>
how can I change an instance variable from a RSpec context without affecting other contexts
<spudowiar>
or should I choose a different name?
yma__gib has quit [Ping timeout: 276 seconds]
kareeoleez has joined #ruby
Qommand0r has quit [Quit: Exiting...]
<spudowiar>
forget that
<spudowiar>
I think
dextertzu has joined #ruby
conta has joined #ruby
shinnya has quit [Ping timeout: 250 seconds]
<nictrasavios>
ruby-lang642: I feel like I've hit a wall of understanding. I know exactly what I want to do, and have no idea where to begin implimenting it.
Who has quit [Quit: Who]
kareeoleez has quit [Ping timeout: 240 seconds]
rbennacer has quit [Remote host closed the connection]
rbennacer has joined #ruby
joonty has joined #ruby
hahuang61 has joined #ruby
joonty has quit [Client Quit]
<ruby-lang642>
hm maybe i can help, what is it that you want to do?
<spudowiar>
jhass: hope you don't mind me harassing you :) do you know how to isolate a context, because if I've defined an instance variable in the context above, defining it again inside, will change it on the outside
yma__gib has joined #ruby
siaw23 has joined #ruby
<Mon_Ouie>
I don't think protected affects methods defined as def self.foo
<ruby-lang642>
hmm so I should remove it then? I was trying to keep that method hidden from outside of the subclasses
<Mon_Ouie>
You can explicitly open Item's singleton class (class << self; …; end inside the Item class) and use protected and 'def item; …; end' there.
nankyokusei has joined #ruby
<ruby-lang642>
nictrasavios: is there a brief summary for differences between slack bots vs slack apps?
tvw has quit [Remote host closed the connection]
<ruby-lang642>
>> class F; class << self; def m; end; end; end; F.protected_methods
jaguarmagenta has quit [Ping timeout: 260 seconds]
<Mon_Ouie>
You would still need to call protected inside the class << self; …; end block
<ruby-lang642>
oh right :P
<ruby-lang642>
>> class F; class << self; protected; def m; end; end; end; F.protected_methods
<nictrasavios>
ruby-lang642: https://api.slack.com/slack-apps, A slack app is a combination of a slack bot, and commands and webhooks on top of that
yma__gib has quit [Ping timeout: 260 seconds]
<nictrasavios>
ruby-lang642: You can see in that web page that bot users are like a subset of the Slack App.
<Mon_Ouie>
Also FYI the bot ignores requests by users who aren't identified with NickServ to avoid spam
conta has quit [Ping timeout: 264 seconds]
<ruby-lang642>
oh ok
<ruby-lang642>
i'll just run it on pry
<nictrasavios>
ruby-lang642: But, you can create all of these "parts" of the app on their own, outside of them being bundled as an app.When they're seperate, every command/bot/webhook has its own API key, as an APP, they all share 1
<ruby-lang642>
nictrasavios: do you understand webhooks and whatnot?
<nictrasavios>
ruby-lang642: Yup,I have all the commands, webooks and the bot written. The problem is unifying them into the slack app.
nankyokusei has quit [Ping timeout: 272 seconds]
<ruby-lang642>
Mon_Ouie: thanks for pointing out the protected bit out. Do you think the choice I made for that is optimal? It violates DRY
<nictrasavios>
ruby-lang642: I know slack-ruby-post is a dependency of, and included in slack-ruby-server, but due to his lack of documentation, I have no idea what the conversion even entails, let alone where to start.
<Mon_Ouie>
ruby-lang642: The short-hand for that is just 'attr_reader :items'
<Mon_Ouie>
It creates an instance method, but class methods of Item are just instance methods of Item's singleton class
<nictrasavios>
ruby-lang642: You can instantly see why I understand one, and am lost on the other.
dminuoso has joined #ruby
KINGSABRI___ has quit [Remote host closed the connection]
<ruby-lang642>
Mon_Ouie: so I commented out def.self and put in the attr_reader, in the class definition. It doesn't work. Did I have to put the attr_reader inside class << self ?
<Mon_Ouie>
Yes, you have to call attr_reader on Item's singleton class for it to define a class method on Item
macsteps has joined #ruby
<ruby-lang642>
nictrasavios: one sec, i'm trying to read the links you gave me and fix something of my code
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<nictrasavios>
Not a problem, I'll be here for another 4-9 hours. (No joke)
<ruby-lang642>
lol
<ruby-lang642>
Mon_Ouie: what about the repeating code returning @items? Or maybe I can alias .all
<Mon_Ouie>
alias seems reasonable, although it seems strange that you would have two methods. Is it expected that some subclasses will override one of the methods to make them behave differently?
<Mon_Ouie>
Also you don't need to do "some #{object.to_s}", String interpolation implicitly calls to_s anyway
<Mon_Ouie>
And instead of looking at the internal state of the object through instance variable, I would call a method on the object (using #public_send), that way you can filter by attributes that aren't necessarily implemented as instance variables (e.g. they're computed from other variables, or they're the result of a long computation which is cached in an ivar after the first time you call the method)
yma__gib has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
allcentury has quit [Ping timeout: 276 seconds]
<ruby-lang642>
i removed the #to_s and am now trying to understand your 2nd message, so i'll be a moment
zeroDi has joined #ruby
Yzguy has joined #ruby
bnagy has quit [Ping timeout: 244 seconds]
bnagy has joined #ruby
macsteps has quit [Remote host closed the connection]
<ruby-lang642>
Mon_Ouie: so instead of instance_var_get use #send?
yma__gib has quit [Ping timeout: 260 seconds]
davedev24 has quit []
<Mon_Ouie>
Preferably #public_send, which won't let you call private methods
nadir has joined #ruby
<ruby-lang642>
oh got it. I was looking through available methods of a dummy class and missed #public_send.
SilverKey has joined #ruby
<al2o3-cr>
send will send a message to a pig-e-on on the high rollers `hola`
aries_liuxueyang has quit [Quit: No Ping reply in 180 seconds.]
freerobby has quit [Quit: Leaving.]
neo_ has joined #ruby
davedev24 has joined #ruby
jackjackdripper has joined #ruby
aries_liuxueyang has joined #ruby
AlexRussia has joined #ruby
allcentury has joined #ruby
swills has quit [Quit: Leaving]
rbennacer has quit [Remote host closed the connection]
diegoviola has joined #ruby
GodFather has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 264 seconds]
dminuoso has joined #ruby
Xiti has joined #ruby
madgen has quit [Ping timeout: 240 seconds]
kavanagh has joined #ruby
SilverKey has quit [Quit: Halted.]
SCHAAP137 has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
dminuoso has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
kavanagh has quit [Remote host closed the connection]
kavanagh has joined #ruby
allcentury has quit [Ping timeout: 260 seconds]
kavanagh has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
firstdayonthejob has quit [Quit: WeeChat 1.5]
MrBusiness2 has joined #ruby
Sucks has joined #ruby
AlexRussia has quit [Ping timeout: 244 seconds]
dc2 has joined #ruby
MrBusiness has quit [Ping timeout: 272 seconds]
<diegoviola>
I need to write a parser for some json feed and load that data on redis, there is a mfield in there, so when I ctrl-c the script and I re-run it I want to resume where I left of, but I have no idea how to do the resume part
<diegoviola>
I know I could use the mtime field
kavanagh has joined #ruby
kareeoleez has joined #ruby
enterprisey has quit [Remote host closed the connection]
quakephil has quit [Read error: Connection reset by peer]
Mia has quit [Read error: Connection reset by peer]
RegulationD has joined #ruby
dc2 has quit [Ping timeout: 258 seconds]
LoneHerm_ has joined #ruby
RegulationD has quit [Ping timeout: 252 seconds]
firstdayonthejob has joined #ruby
mdw has quit [Quit: Sleeping Zzzzz]
chip_ has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
LoneHerm_ has quit [Ping timeout: 276 seconds]
mozzarella has joined #ruby
gizmore has joined #ruby
chip_ has quit [Remote host closed the connection]
solocshaw has joined #ruby
mtkd has quit [Ping timeout: 276 seconds]
vjacob has joined #ruby
mtkd has joined #ruby
meatchicken has quit [Ping timeout: 240 seconds]
meatchicken has joined #ruby
kareeoleez has quit [Remote host closed the connection]