Spami has quit [Quit: This computer has gone to sleep]
moeabdol has joined #ruby
mnrmnaugh has joined #ruby
cdg has joined #ruby
binaryplease has joined #ruby
william3 has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
kriskropd has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
jolts has joined #ruby
jolts has quit [Max SendQ exceeded]
GriffinHeart has joined #ruby
mfb2 has quit [Ping timeout: 276 seconds]
flashpoint9 has joined #ruby
lemur has quit [Ping timeout: 250 seconds]
bruno- has quit [Read error: Connection reset by peer]
moeabdol has quit [Ping timeout: 260 seconds]
william3 has quit [Ping timeout: 250 seconds]
ixti has joined #ruby
jenrzzz has joined #ruby
Azure has quit [Ping timeout: 250 seconds]
flashpoint9 has quit [Remote host closed the connection]
Emmanuel_Chanel has joined #ruby
bruno- has joined #ruby
mfb2 has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
Dimik1 has joined #ruby
bronson has joined #ruby
kareeoleez has joined #ruby
diegoviola has quit [Read error: Connection reset by peer]
stardiviner has joined #ruby
swills has joined #ruby
LoneHerm_ has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
kareeoleez has quit [Ping timeout: 276 seconds]
diegoviola has joined #ruby
lkba_ has quit [Ping timeout: 276 seconds]
workmad3 has joined #ruby
GriffinHeart has joined #ruby
johnmilton has joined #ruby
doublemalt_ has quit [Remote host closed the connection]
mfb2 has quit [Ping timeout: 250 seconds]
workmad3 has quit [Ping timeout: 260 seconds]
pawnbox has joined #ruby
mfb2 has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
smathy is now known as smathy_afk
rahult_ has quit [Ping timeout: 276 seconds]
thejamespinto_ is now known as thejamespinto
mfb2 has quit [Ping timeout: 246 seconds]
ropeney has joined #ruby
pawnbox has quit [Ping timeout: 260 seconds]
GriffinHeart has joined #ruby
kaleido has quit [Changing host]
kaleido has joined #ruby
jpfuentes2 has joined #ruby
thejamespinto_ has joined #ruby
Authenticator has joined #ruby
mfb2 has joined #ruby
rubie has joined #ruby
brainslug has joined #ruby
thejamespinto has quit [Ping timeout: 250 seconds]
rodfersou has joined #ruby
LastWhisper____ has joined #ruby
Kharma has joined #ruby
mfb2 has quit [Ping timeout: 260 seconds]
idefine has quit [Read error: Connection reset by peer]
shibly has joined #ruby
idefine has joined #ruby
<shibly>
What are the disadvantages of ruby?
<ropeney>
lol
<kaleido>
hard quaestion to answer when youre so specific, can you be ore vague?
<ropeney>
it's all perspective
<pipework>
shibly: They exist deep within yourself and are only manifested within ruby. It is a reflection of yourself.
bruno- has quit [Read error: Connection reset by peer]
xxneolithicxx has joined #ruby
johnmilton has quit [Remote host closed the connection]
idefine has quit [Read error: Connection reset by peer]
jgrevich has joined #ruby
idefine has joined #ruby
stannard has joined #ruby
<shibly>
Can anyone answer?
kies has joined #ruby
rahult has joined #ruby
PaulCapestany has quit [Quit: .]
bruno- has joined #ruby
jgrevich has quit [Ping timeout: 244 seconds]
SilverKey has joined #ruby
vdamewood has quit [Quit: Life beckons.]
tenzan has joined #ruby
stannard has quit [Ping timeout: 240 seconds]
<ramfjord_>
shibly: ruby is not suitable for applications where performance is of paramount concern - be it memory or CPU
<ramfjord_>
I worked a a company that made their own mapreduce framework in ruby - that was a really bad idea
<ramfjord_>
similarly it would be a bad idea to use it for embedded systems
GriffinHeart has quit [Remote host closed the connection]
PaulCapestany has joined #ruby
<ramfjord_>
ruby uses duck typing, which can be considered an advantage or a disadvantage. You're not going to get a nice IDE like eclipse to do a bunch of autocompletes for you, but you do get a lot of freedom
<havenwood>
ramfjord_: mruby ftw?
ledestin has joined #ruby
baweaver has quit [Remote host closed the connection]
<havenwood>
re embedded*
cdg has quit [Remote host closed the connection]
<ramfjord_>
you miss out type safety, but most rubyists will argue that you should be guaranteeing behavior with unit tests anyway
cdg has joined #ruby
<shibly>
Is using thread available and good in ruby?
GriffinHeart has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
wldcordeiro has joined #ruby
<ramfjord_>
yeah, that... the main "Matz" ruby implementation (MRI) has a global interpreter lock which prevents multiple statements from being executed concurrently in a single process
<havenwood>
shibly: Ruby uses system threads. It's implementation-specific whether or not there's a global vm lock but the reference implementation currently has one.
mfb2 has joined #ruby
markfletcher has joined #ruby
<shibly>
So there is no problem with thread?
RegulationD has joined #ruby
<havenwood>
shibly: Threads are a fairly low level concurrency primitive and they're fraught with peril.
rodferso1 has joined #ruby
<ramfjord_>
There are languages with better built in concurrency support for a lot of use cases
william3 has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
<Arcaire>
See: Go, Erlang.
<shibly>
ramfjord_: What did you mean by performance?
<Arcaire>
Probably better off with Go than Erlang to be honest.
cdg has quit [Ping timeout: 246 seconds]
<shibly>
ramfjord_: Is performance related with cpu,memory?
<ramfjord_>
I still get a lot of benefit out of using threads in ruby - they are super easy to use, just not super concurrent. Good for things like making concurrent API calls, where there may be a wait between each call
rodfersou has quit [Ping timeout: 276 seconds]
<ramfjord_>
both - if you want to be super strict about your memory management, you probably don't want anything with a garbage collector built in
<ramfjord_>
cpu sort of problems are often mitigated by using libraries which are backed by fast C libraries
<Arcaire>
>JRuby maps Ruby threads to Java threads, which are usually mapped directly to native threads.
<ramfjord_>
for instance the ruby CSV library isn't slow at all, and I wouldn't chose anything else
<Arcaire>
It's mapping all the way down.
GriffinHeart has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
<ramfjord_>
but in Jruby (or rubinius) you miss out on a lot of libraries that work on MRI
RegulationD has quit [Ping timeout: 260 seconds]
<Arcaire>
shibly: The general rule of thumb is that if you can't tell what the disadvantages of Ruby are with respect to your current project, you probably don't need to worry about them.
<ramfjord_>
Arcaire: +1
<Arcaire>
Most of them boil down to a couple things: It's not the highest performing language, and people who use NodeJS will endlessly tell you to start using JavaScript.
william3 has quit [Ping timeout: 276 seconds]
<Arcaire>
If neither of those concern you, you should use Ruby (imo). It's a wonderful language that got a lot of things right based on mistakes other languages made.
PaulCapestany has quit [Read error: Connection reset by peer]
<ramfjord_>
I like to think of it as a nice mix of perl and smalltalk - super practical and super object oriented
<Arcaire>
>nice
<Arcaire>
>Perl
<Arcaire>
The substances you're taking must be of the highest quality known to man.
<Arcaire>
;)
PaulCapestany has joined #ruby
<Arcaire>
But in seriousness, that's the direction that Matz wants/wanted Ruby to go originally, iirc.
<ramfjord_>
I also really like Bundler - ruby's main dependency manager
GriffinHeart has quit [Remote host closed the connection]
elifoster has joined #ruby
<Arcaire>
The general library ecosystem around Ruby is honestly awesome.
<ramfjord_>
For concurrency I've been looking into celluloid, but I don't have much experience with the actor model
<Arcaire>
There's a few issues I have with it but are mostly small edge-case irks I've found regarding ecosystem security.
<ramfjord_>
tbh for the most part I've been using Queue + Threadpool
<Arcaire>
Celluloid is pretty good.
<Arcaire>
In a lot of cases you can ignore the actor model entirely and just use Celluloid/IO.
<ramfjord_>
but I'm not making anything complicated
<Arcaire>
(I do that lol)
wilbert has joined #ruby
<Arcaire>
I wrote an IRC services system (think Nickserv, Chanserv) using Celluloid/IO. Good performance even under a stress test.
rodferso1 has quit [Quit: leaving]
<kaleido>
is node even 50% js anymore?
<ramfjord_>
Arcaire: so my main use case is making a ton of API calls, and loading them into a database (preferably on a single connection/transaction)
agentmeerkat has quit [Ping timeout: 240 seconds]
<ramfjord_>
do you think that's something Celluloid would be better suited for than Queue + ThreadPool (one thread with reading from a queue, a bunch of api call threads writing to it)?
zzach has joined #ruby
zzach1 has quit [Ping timeout: 244 seconds]
<ramfjord_>
the thing that I've really thought would be best for this would be to ignore the queue/threads, and just call select on a socket pool hehe
<ramfjord_>
but afaik no libraries do this, and I'd have to actually manually write the http requests to the pool of TcpSockets
LoneHerm_ has quit [Remote host closed the connection]
<ramfjord_>
aaaaand there's absolutely no reason it needs to be that performant anyway
LoneHerm_ has joined #ruby
william3 has joined #ruby
<Arcaire>
ramfjord_: Hm you'll probably want the actor pooling and supervision anyway then.
<Arcaire>
I was using the simplistic celluloid for async TCP but single socket.
<shibly>
Did ruby take anything from python? Any syntax similarity? Or any concept of feature?
mfb2 has quit [Ping timeout: 240 seconds]
UKn0Me is now known as BobaFett
<Arcaire>
Yes
<Arcaire>
Lots
<shibly>
Can you metion few of those?
amclain has quit [Ping timeout: 260 seconds]
william3 has quit [Ping timeout: 260 seconds]
BobaFett is now known as UKn0Me
FooMunki has quit [Quit: FooMunki]
rubie has quit [Remote host closed the connection]
smathy_afk has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
GriffinHeart has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
LoneHerm_ has quit [Remote host closed the connection]
Chagel has joined #ruby
stannard has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
bruno- has joined #ruby
wilbert has quit [Quit: quit]
Devalo has joined #ruby
shibly has left #ruby [#ruby]
stannard has quit [Ping timeout: 250 seconds]
rahult_ has joined #ruby
shayan has joined #ruby
william3 has joined #ruby
rahult has quit [Ping timeout: 250 seconds]
Chagel_ has joined #ruby
Devalo has quit [Ping timeout: 250 seconds]
Chagel has quit [Ping timeout: 276 seconds]
ICantCook has joined #ruby
jaguarmagenta has joined #ruby
statelesscode has quit [Quit: statelesscode]
william3 has quit [Ping timeout: 276 seconds]
Spami has joined #ruby
pawnbox has joined #ruby
Spami has quit [Remote host closed the connection]
moeabdol has joined #ruby
jaguarmagenta has quit [Ping timeout: 276 seconds]
mfb2 has joined #ruby
Es0teric has joined #ruby
pawnbox has quit [Ping timeout: 250 seconds]
rubie has joined #ruby
Ebok has quit [Ping timeout: 240 seconds]
moeabdol has quit [Ping timeout: 260 seconds]
rubie has quit [Remote host closed the connection]
mfb2 has quit [Ping timeout: 260 seconds]
Ebok has joined #ruby
ramfjord_ has quit [Ping timeout: 276 seconds]
LoneHermit has joined #ruby
lkba has joined #ruby
baweaver has joined #ruby
xxneolithicxx has quit [Quit: Leaving.]
jenrzzz has quit [Ping timeout: 276 seconds]
amclain has joined #ruby
LoneHermit has quit [Ping timeout: 260 seconds]
GriffinHeart has quit [Remote host closed the connection]
<machinewar>
is there any way to version an API without copying all the code?
<machinewar>
since you can't really depend on most of it between versions right?
<machinewar>
at least any of the business logic around the response bodies
baweaver has quit [Ping timeout: 250 seconds]
mfb2 has joined #ruby
arescorpio has joined #ruby
htmldrum has quit [Ping timeout: 250 seconds]
<flaf>
Hi, I'm using ruby 2.1.8 and I'm trying to do something like “curl --key $my_privkey --cert $my_cert --cacert $ca_cert https://xxxx” (it's 2-way SSL) but in ruby with 'net/http'. I have problems with the ssl part. Do you have examples in the web which could help me?
BSaboia has joined #ruby
droptone_ has left #ruby [#ruby]
jobewan has joined #ruby
mfb2 has quit [Ping timeout: 268 seconds]
braincrash has quit [Quit: bye bye]
stannard has joined #ruby
jaguarmagenta has joined #ruby
rubie has joined #ruby
Trynemjoel has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
bronson has joined #ruby
stannard has quit [Ping timeout: 276 seconds]
bruno- has joined #ruby
mfb2 has joined #ruby
braincras has joined #ruby
jyaworski has joined #ruby
phaza_ has quit [Ping timeout: 260 seconds]
bronson has quit [Ping timeout: 252 seconds]
Dimik1 has quit [Ping timeout: 276 seconds]
<Arcaire>
What problems, flaf?
zast has joined #ruby
mfb2 has quit [Ping timeout: 250 seconds]
<Arcaire>
Client-side certificate auth or what?
skol has joined #ruby
postmodern has joined #ruby
ixti has quit [Quit: WeeChat 1.4]
GriffinHeart has quit [Remote host closed the connection]
phaza has joined #ruby
jyaworski has quit [Remote host closed the connection]
stannard has joined #ruby
shayan has quit [Quit: shayan]
jyaworski has joined #ruby
frem_ has quit [Quit: Connection closed for inactivity]
finisherr has joined #ruby
rubie has quit [Remote host closed the connection]
jyaworski has quit [Client Quit]
Blaguvest has quit [Remote host closed the connection]
GriffinHeart has joined #ruby
stannard has quit [Ping timeout: 250 seconds]
diegoviola has quit [Quit: WeeChat 1.4]
GriffinHeart has quit [Remote host closed the connection]
jgrevich has joined #ruby
<flaf>
Arcaire: in fact, I find no example in the web to just make the equivalent of my curl command above.
baweaver has joined #ruby
<flaf>
ie how to set my priv key, my cert and the cert of the CA.
rubie has quit [Remote host closed the connection]
YaknotiS has quit [Ping timeout: 260 seconds]
Devalo has joined #ruby
idefine has quit [Ping timeout: 240 seconds]
rahult_ has joined #ruby
astrobun_ has joined #ruby
rahult has quit [Ping timeout: 276 seconds]
YaknotiS has joined #ruby
Dimik1 has joined #ruby
speaking1ode has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
sauvin has joined #ruby
bluOxigen has joined #ruby
<Radar>
Abhijit: Uh, that looks to be depending on a specific Rails version? Isn't the solution to just upgrade to the most modern version of Rails specific to your app?
<Radar>
So if you have a 3.2 app, upgrade to 3.2.22.2
finisherr has quit [Quit: finisherr]
agit0 has joined #ruby
<Abhijit>
Radar, ok so its should be taken care by ruby / rails and not by os. fine.
<Radar>
Abhijit: It should be taken care of by your application's Gemfile
<Abhijit>
yeah. but due to one another get restriction i am stuck to 4.1.8 rails.
machinewar has quit [Remote host closed the connection]
<Abhijit>
gem*
wasane has joined #ruby
<Abhijit>
i just wanted to know confirm that its os responsibility or not.
<Arcaire>
Abhijit: It's not the OS responsibility.
<Arcaire>
These things aren't installed by the OS and aren't in the package manager archives, it's stuff you gotta manage yourself.
<Arcaire>
Also that vulnerability isn't an issue unless you do stupid things with the Rails render method.
<Arcaire>
I work in infosec and I've only seen it in the wild once.
kareeoleez has quit [Remote host closed the connection]
<ujjain>
Your block takes 1 argument, but the Regexp matched 0 arguments. (Cucumber::ArityMismatchError) - features/step_definitions/my_steps.rb:310:in `/^the output should be 'Err, timeout, ouch'$/'
yfeldblum has quit [Remote host closed the connection]
matp has joined #ruby
karapetyan has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 268 seconds]
lkba has joined #ruby
<apeiros>
hm, Ox0dea, I bet you've investigated this - is there a way to have capturing groups higher than 9 in the \1-\9 notation in sub? e.g. str.sub(/(.) […](.)/, '\11') - straight \11 sadly inserts 11, not capturing group 11
<siaw>
the error i’m getting tells me it can load the file from folder B’s path
Madplatypus has quit [Quit: Connection closed for inactivity]
<siaw>
meaning it’s not searching folder A at all
<jhass>
siaw: can you reask with the actual paths relative to your project root please?
The_Phoenix has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
I feel like the abstraction here will just add confusion
The_Phoenix has quit [Max SendQ exceeded]
PedramT has quit [Remote host closed the connection]
<Ox0dea>
siaw: require_relative '../B/foo'
lxsameer has quit [Ping timeout: 252 seconds]
blaxter has joined #ruby
araujo has quit [Ping timeout: 276 seconds]
evidex_ has joined #ruby
karapetyan has quit [Ping timeout: 244 seconds]
meee has joined #ruby
polysics has quit []
<siaw>
Ox0dea: require_relative '../B/foo' works
jterra_ has joined #ruby
<siaw>
:)
<Ox0dea>
\o/
polysics has joined #ruby
<siaw>
thanks you
<siaw>
thank*
gnufied has joined #ruby
<Ox0dea>
Happy to help. :)
eregon_ has joined #ruby
The_Phoenix has joined #ruby
araujo has joined #ruby
joonty1 has joined #ruby
<toretore>
siaw: what's the reason you want to use require_relative instead of just require?
meee has left #ruby [#ruby]
pandaant has joined #ruby
araujo has quit [Max SendQ exceeded]
<siaw>
toretore: i don’t know
mnrmnaugh_ has joined #ruby
icey_ has joined #ruby
s1kx_ has joined #ruby
<siaw>
i was expecting require to work
<siaw>
but it wasn't
<toretore>
siaw: in general, you shouldn't require relative to the source file, you should expect the file you're requiring to be in $PATH
blackmesa has quit [Ping timeout: 260 seconds]
<siaw>
so in which cases can we use require_relative then?
joneshf-laptop_ has joined #ruby
Rixius|Alt has joined #ruby
n008f4g_ has joined #ruby
<toretore>
when you have a really good reason to
Adam_FrVancouver has quit [Ping timeout: 276 seconds]
nisstyre has quit [Ping timeout: 276 seconds]
jterra has quit [Ping timeout: 276 seconds]
eregon has quit [Ping timeout: 276 seconds]
joonty has quit [Ping timeout: 276 seconds]
yeticry has quit [Ping timeout: 276 seconds]
moeabdol has joined #ruby
jaruga___ has quit [Ping timeout: 276 seconds]
catpoop has quit [Ping timeout: 276 seconds]
evidex has quit [Ping timeout: 276 seconds]
icey has quit [Ping timeout: 276 seconds]
s1kx has quit [Ping timeout: 276 seconds]
joneshf-laptop has quit [Ping timeout: 276 seconds]
janelleb has quit [Ping timeout: 276 seconds]
Rixius has quit [Ping timeout: 276 seconds]
<toretore>
and if you don't know why then you probably don't have one
nisstyre_ has joined #ruby
stardiviner has quit [Ping timeout: 240 seconds]
Adam_FrVancouver has joined #ruby
blackmesa has joined #ruby
<siaw>
meaning i should still use require here?
moeabdol has quit [Ping timeout: 276 seconds]
yeticry has joined #ruby
<shevy>
siaw for instance, in my gems I can use require() just fine, I don't have to use require_relative()
<Ox0dea>
siaw: `require` will search every directory in $LOAD_PATH for a matching file; toretore is suggesting that it would be better for you to get '../B' into $LOAD_PATH and then just require 'foo'.
<toretore>
siaw: probably, but it's hard to say without knowing anything about your project
navneet_ has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
<toretore>
you should require('services/snapchat_svg_service')
william3 has quit [Remote host closed the connection]
<toretore>
or just require('snapchat_svg_service')
<siaw>
i tried that alread and i get “cannot load such file -- services/snapchat_svg_service”
<toretore>
depending on what you put in $LOAD_PATH
<siaw>
ah
<siaw>
so have to put $LOAD_PATH on top of the line
lxsameer has joined #ruby
william3 has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
<toretore>
no
xMopxShell has quit [Ping timeout: 260 seconds]
<toretore>
$LOAD_PATH gets set externally
ponga has quit [Quit: Connection closed for inactivity]
<Ox0dea>
Huh?
<toretore>
it's not your file that makes this decision
<Ox0dea>
That's simply not the case.
<toretore>
it's the invoker, whoever that may be
<toretore>
could be `ruby -I.` or there could be some setup done in another file
xMopxShell has joined #ruby
thorgi has joined #ruby
htmldrum has joined #ruby
zenlot has quit [Read error: Connection reset by peer]
mfb2 has joined #ruby
zenlot has joined #ruby
rbennacer has quit [Ping timeout: 252 seconds]
Shashikant86 has joined #ruby
<siaw>
anyway after a successfull require
<siaw>
i get “uninitialized constant Developer::SnapchatSvgService”
<siaw>
on line “include SnapchatSvgService”
stannard has joined #ruby
<siaw>
what did i do wrong?
rbennacer has joined #ruby
<siaw>
“SnapchatSvgService” is the name of the module in the file i just required
<siaw>
:/
Devalo has joined #ruby
navneet_ has quit [Ping timeout: 276 seconds]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<tobiasvl>
include?
stannard has quit [Read error: Connection reset by peer]
<siaw>
yeap. or not?
navneet_ has joined #ruby
Shashika_ has joined #ruby
<tobiasvl>
oh well maybe
<tobiasvl>
pastebin your code
<siaw>
i’m trying to INCLUDE the module from that file
<siaw>
ok
<toretore>
pastebin ..
<toretore>
:(
<tobiasvl>
"pastebin" as a generalized term :)
<tobiasvl>
I don't want to say "paste" your code because that can easily be misinterpreted
<toretore>
"gist" works well
<tobiasvl>
maybe I should say "gist" your code since that's what's in the topic
<tobiasvl>
yeah
lacrosse has joined #ruby
<shevy>
just dump it here!
htmldrum has quit [Ping timeout: 260 seconds]
<jhass>
siaw: given this is rails after all, I'd recommend to not explicitly require it at all, instead make sure to follow conventions and perhaps adjust autoload_paths accordingly
aganov has quit [Remote host closed the connection]
Devalo has quit [Ping timeout: 250 seconds]
<tobiasvl>
wow your indentation is all over the place
Shashikant86 has quit [Ping timeout: 240 seconds]
<tobiasvl>
siaw: move the require_relative inside Developer or move the include outside Developer?
stardiviner has joined #ruby
<shevy>
drunkentation
Shashika_ has quit [Client Quit]
<siaw>
tobiasvl: same error outside Developer “uninitialized constant SnapchatSvgService”
<siaw>
i think it’s got to do with how Rails work with file inclusion
<toretore>
probably
<tobiasvl>
siaw: well that's not the same error, earlier it said Developer::SnapchatSvgService
<tobiasvl>
but yeah maybe some rails stuff
<toretore>
autoload ftl
polysics_ has joined #ruby
<siaw>
yeah right
<toretore>
siaw: are you restarting the server?
<siaw>
nope
<toretore>
do that
<jhass>
siaw: so either ensure app/ is in your autoload_paths and name it Services::SnapchatSvgService or ensure app/services is in your autoload_paths and then it should work without require
polysics has quit [Ping timeout: 268 seconds]
<toretore>
so now that we know it's a rails app, rails has ways to add directories to the $LOAD_PATH which you should use instead of require_relative
<toretore>
or, what jhass said
jaruga___ has joined #ruby
last_staff has quit [Quit: last_staff]
<siaw>
yeah
<siaw>
i’m using rails 5 beta 3 which makes things even worse
<siaw>
it hasn’t got that autoload_paths :D
<workmad3>
`app/*` is added to your autoload paths by default, so you should be able to just add a directory there
<workmad3>
but you'll probably need to restart the server and run `spring stop`
bruno- has joined #ruby
<workmad3>
(unless you've already taken spring out of your Gemfile :) )
darkxploit has quit [Ping timeout: 250 seconds]
<siaw>
nope
<siaw>
doing that now
haraoka has quit [Ping timeout: 250 seconds]
BTRE has quit [Read error: Connection reset by peer]
<jhass>
I'm still biased as to whether I preferred it would create an alias or delegate instead of a copy
<siaw>
and i was like “wth is this?”
polysics_ has quit [Ping timeout: 260 seconds]
<workmad3>
siaw: if you only want it accessible directly on the module, you can also define it with `def self.get_svg_image(username)`
<workmad3>
siaw: doing `def get_svg_image(username)` and then using `module_function` on it will make the method available both on the module and to objects where you mixed in the module
moeabdol has joined #ruby
<siaw>
i get it
lxsameer has quit [Ping timeout: 260 seconds]
<siaw>
thanks heroes :)
<siaw>
app working perfectly as expected
pawnbox has quit [Remote host closed the connection]
stardiviner has quit [Ping timeout: 260 seconds]
pawnbox has joined #ruby
<jhass>
?styleguide siaw
n008f4g_ has quit [Ping timeout: 250 seconds]
* jhass
slaps ruby[bot]
<jhass>
anyway, read one, at least your tabbing is a complete mess
darkxploit has joined #ruby
navneet_ has quit [Remote host closed the connection]
<Ox0dea>
JulienITARD: But you also want to keep the 5-digit sequence.
<Ox0dea>
#split destroys the delimiter.
<shreeve>
looking for an easy way to: iterate through an enumerable, evaluating a block for each element and returning the first non-nil result (not the first non-nil element)
<jackdaniel>
ach, delimiter has to be preserved. Sorry, misread the example
<Ox0dea>
There's nothing on Enumerable for this, and an explicit break loop is verboten.
mikecmpb_ has joined #ruby
nobitanobi has joined #ruby
kfpratt has joined #ruby
nobitanobi has quit [Remote host closed the connection]
<JulienITARD>
jhass: i'll try it
htmldrum has quit [Ping timeout: 246 seconds]
mfb2 has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
phaza has quit [Ping timeout: 246 seconds]
mikecmpbll has quit [Ping timeout: 252 seconds]
skol has joined #ruby
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
malconis has joined #ruby
nobitanobi has joined #ruby
mfb2 has quit [Ping timeout: 268 seconds]
navneet_ has quit [Remote host closed the connection]
godzillaenlacasa has joined #ruby
araujo has joined #ruby
platzhirsch has joined #ruby
<apeiros>
jhass: :-S
araujo has quit [Max SendQ exceeded]
<jhass>
shreeve: or .lazy.map(&:foo).drop_while(&:nil?).first
<apeiros>
jhass: I'll reboot when I'm back home (~1h)
swills has joined #ruby
nobitano_ has joined #ruby
<jhass>
that's not the proper fix :P
araujo has joined #ruby
Chagel has joined #ruby
ChiefAlexander has joined #ruby
<xpt>
?pr
<ruby[bot]>
You think this is broken, could be done better, or have a good feature idea? Submit an issue on the concerned project, or even better, fix it and submit a Pull Request! ;)
araujo has quit [Max SendQ exceeded]
ChiefAlexander has quit [Remote host closed the connection]
araujo has joined #ruby
nobitan__ has joined #ruby
araujo has quit [Read error: Connection reset by peer]
nobitan__ has quit [Client Quit]
ChiefAlexander has joined #ruby
<apeiros>
jhass: I know. A proper fix is about 1-2 months away. or 3-4 reboots. I think we'll manage :)
pawnbox has joined #ruby
idefine has joined #ruby
nobitanobi has quit [Ping timeout: 276 seconds]
skol has quit [Remote host closed the connection]
nobitano_ has quit [Ping timeout: 276 seconds]
ule has left #ruby [#ruby]
mfb2 has joined #ruby
rodfersou has quit [Quit: leaving]
anagha_ has joined #ruby
<anagha_>
hello
phaza has joined #ruby
<anagha_>
How does a string split work?
sepp2k has joined #ruby
<anagha_>
String#split('Fear is the path to the dark side')
shreeve has quit [Ping timeout: 250 seconds]
<anagha_>
For the above line code the output was just "string"
dionysus69 has joined #ruby
mfb2 has quit [Ping timeout: 246 seconds]
stannard has joined #ruby
JagaJaga has joined #ruby
<jhass>
anagha_: String#split is documentation notation, it refers to the instance method split of the class String
<JagaJaga>
Hello! Anyone form Korea here?
<jhass>
?aynone
<jhass>
?anyone
<jhass>
meh, I tried :P
<JagaJaga>
s/form/from
<xpt>
?anyone JagaJaga
<ruby[bot]>
JagaJaga: Just ask your question, if anyone has or can, they will respond.
<ddv>
JagaJaga: What Korea
<xpt>
JagaJaga: there
<ddv>
South or North
araujo has joined #ruby
<xpt>
jhass: there
<JagaJaga>
South :)
<jhass>
anagha_: so 'Fear is the path to the dark side' is the string instance here
<jhass>
xpt: thanks
<xpt>
no problem
ramortegui has quit [Quit: Ex-Chat]
<jhass>
anagha_: you want to call the split method on it
<jhass>
anagha_: a method call has the form of instance.method(arguments)
garethrees has joined #ruby
stannard has quit [Ping timeout: 244 seconds]
jhass has left #ruby ["WeeChat 1.4"]
jhass has joined #ruby
<jhass>
?ping
<ruby[bot]>
pong
<jhass>
apeiros: there, part & rejoin worksaround too
phaza has quit [Ping timeout: 240 seconds]
speaking1ode has quit [Ping timeout: 260 seconds]
_blizzy_ has joined #ruby
_blizzy_ has quit [Remote host closed the connection]
lacrosse has quit [Quit: Connection closed for inactivity]
nando293921 has joined #ruby
sepp2k has quit [Quit: Leaving.]
n008f4g_ has quit [Ping timeout: 276 seconds]
n008f4g_ has joined #ruby
griffindy has joined #ruby
agent_white has joined #ruby
sadin has joined #ruby
pLaToOn has quit [Read error: Connection reset by peer]
TvL2386 has quit [Ping timeout: 260 seconds]
rubie has joined #ruby
mfb2 has joined #ruby
stannard has joined #ruby
hartuok has joined #ruby
<agent_white>
Morn
sepp2k has joined #ruby
morochena has joined #ruby
TvL2386 has joined #ruby
tinnvec_ has quit [Remote host closed the connection]
<norc>
mustmodify: My real mistake was that I accidentally tried using an attr_reader to write back.
<mustmodify>
yeah that's not confusing.
<mustmodify>
:P
darkxploit has quit [Ping timeout: 244 seconds]
<mustmodify>
I mean, not the bug, but the code.
<mustmodify>
Don't do that. :P
LoneHermit has quit [Remote host closed the connection]
SilverKey has joined #ruby
<norc>
mustmodify: No it is confusing, but it is one of these things that are unlikely to change.
mfb2 has quit [Ping timeout: 252 seconds]
sadin has quit [Remote host closed the connection]
<apeiros>
mustmodify: pass-through equations - you must modify it. passing through stuff to make them equate is bad, m'kay? (I have no idea what a pass-through equation is)
phaza has quit [Ping timeout: 240 seconds]
<mustmodify>
You're unlikely to stop having local variables with the same name as declared messages? Well then you're going to have a hard life.
<mustmodify>
apeiros: thanks. Yeah, I think it's just not a good name.
<mustmodify>
apeiros: or it's very specific to my situation.
<apeiros>
mustmodify: care to enlighten us about the context?
Chagel has quit [Ping timeout: 246 seconds]
<apeiros>
google yields one equation which is used to intersect two lines…
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sadin has joined #ruby
<norc>
mustmodify: Ruby is not known for making incompatible changes.
bruno- has quit [Read error: Connection reset by peer]
<mustmodify>
sure. I have what I'm calling a micro-emr. We don't do a lot of EMR stuff, but we do collect data, do some conversions, etc., solely in support of a medical report. Some results, like bmi, are calculated based on height and weight. So we have equations. We also have some results, like Physiological Age, which are mapped to a specific other value. It isn't calculated... it's just a reference to another equation-or-value.
darkxploit has joined #ruby
wldcordeiro has quit [Ping timeout: 260 seconds]
<mustmodify>
So instead of writing code to support that separately, I just created an equation with a single variable.
<jhass>
well, MRI isn't, the community is doing it quite a bit more than elsewhere IME
<norc>
jhass: Agreed.
<mustmodify>
it's a pass-through equation in that we aren't doing any math... we're just passing another value through.
Xeago has quit [Remote host closed the connection]
AlexRussia has joined #ruby
<norc>
jhass: But even JRuby strives to mimic MRIs behaviour with all the bizarre things.
<jhass>
well sure, it tries to be a drop in replacement
<waxxy>
excuse my ignorance, but if it's a value, why would you call it an equation?
<apeiros>
mustmodify: ok, not sure I fully grasped what you're saying. but I guess I wouldn't have the term "equation" in it if there is no math.
<norc>
Heck I even managed to find a corner case where I managed to actually crash MRI and JRuby using the same code. That made me smile.
<norc>
Fully compatible, even the bugs!
Xeago has joined #ruby
bruno- has joined #ruby
htmldrum has joined #ruby
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
AlexJakeGreen has quit [Remote host closed the connection]
mfb2 has joined #ruby
norc has quit [Ping timeout: 250 seconds]
sepp2k has quit [Ping timeout: 268 seconds]
skislak has quit [Ping timeout: 276 seconds]
shibly has joined #ruby
<shibly>
I can't choose one. Python or Ruby, which one should i choose for web development?
<apeiros>
toss a coin
<apeiros>
why do you think we could make the decision for you?
<tubbo>
shibly: python
szulak has joined #ruby
htmldrum has quit [Ping timeout: 268 seconds]
<shibly>
tubbo, Why?
mfb2 has quit [Ping timeout: 240 seconds]
<apeiros>
oh right, and:
haylon has joined #ruby
<apeiros>
?crosspost shibly
<ruby[bot]>
shibly: Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
finisherr has joined #ruby
<tubbo>
because the coin flip resulted in heads ;)
<apeiros>
^5 tubbo :D
x77686d has joined #ruby
mlakewood has quit [Quit: mlakewood]
marr has quit [Ping timeout: 244 seconds]
<shevy>
shibly is evil? :(
<apeiros>
shevy: I wouldn't go as far as calling cross-posters evil. why?
bruno- has quit [Read error: Connection reset by peer]
garethrees has quit [Ping timeout: 276 seconds]
<shevy>
he crossposted!
bruno- has joined #ruby
<tubbo>
shibly: why only python & ruby?
rapha_ has quit [Quit: WeeChat 1.4]
<tubbo>
i put it to you! how did you come up with this choice?
<shevy>
tubbo hmm was there not a similar conversation yesterday...
kareeoleez has joined #ruby
Shashikant86 has joined #ruby
<shibly>
tubbo, What else would you want to select?
<tubbo>
shibly: all of these languages, while generally regarded as "general purpose", can be used for web development. and you'd be surprised at how many of your favorite sites are implemented in wacky languages for web dev.
rkazak has joined #ruby
<shevy>
hehe
Xeago has quit [Remote host closed the connection]
<shevy>
I like whacky
<jhass>
shibly: pick Crystal!
JulienITARD has quit [Quit: Leaving]
<shibly>
tubbo, You didn't mention C#.NET, java
<shevy>
ohhh you indeed forgot crystal tubbo!
<kaleido>
C# and java make baby jesus cry
<shevy>
lol
diegoaguilar has quit [Remote host closed the connection]
daguilaraguilar has quit [Remote host closed the connection]
<kaleido>
.NET was used by the nazis in 1939
<apeiros>
kaleido: that's no reason not to choose them!
<tubbo>
shibly: you are correct.
<mustmodify>
kaleido: LOL
<tubbo>
shevy: i am currently developing a web framework in crystal SHHHHHHH
DaniG2k has joined #ruby
smathy has joined #ruby
<shevy>
yay!
<shevy>
apeiros had a big ass web framework in php
<shevy>
manveru too I think
<tubbo>
shibly: have you done any programming before or are you just getting started to the whole thing?
Shashikant86 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<TomyWork>
what do i need to implement in order to sort an array of my class's instances? <=>?
<apeiros>
TomyWork: yes
<shibly>
tubbo, I have worked with php, rails
<apeiros>
TomyWork: for good measure, also include Comparable
Shashikant86 has joined #ruby
<shibly>
tubbo, And doing fun with django
mfb2 has joined #ruby
sepp2k has joined #ruby
blackmesa has joined #ruby
<tubbo>
shibly: i came from php as well
cschneid has joined #ruby
bronson has joined #ruby
myntcake has quit [Ping timeout: 260 seconds]
<tubbo>
also did some stuff in python for Sick-Beard which was pretty fun, but reminded me about how much more i enjoyed ruby
Devalo has joined #ruby
<apeiros>
heh, over in #python: `17:12 philr: shibly: Ruby`
Shashikant86 has quit [Max SendQ exceeded]
<tubbo>
nice
<shibly>
apeiros, But he didn't mention the reason to use ruby.
<apeiros>
tubbo: and of course thanks for the compliment! :D
<tubbo>
we were trying to replace sidetiq
<shevy>
apeiros wrote so many things that he is already forgetting half of his old stuff - like butler! ;P
<apeiros>
shevy: na, didn't forget. it just became heck of a lot more difficult to maintain that stuff with a 100% job :-/
shibly has left #ruby ["Leaving"]
<apeiros>
and I have far too many fun side projects
mfb2 has quit [Ping timeout: 250 seconds]
bronson has quit [Ping timeout: 252 seconds]
Devalo has quit [Ping timeout: 250 seconds]
synthroid has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 276 seconds]
rbennacer has joined #ruby
kits has joined #ruby
eregon_ is now known as eregon
aufi_ has quit [Ping timeout: 276 seconds]
rbennace_ has quit [Ping timeout: 240 seconds]
<TomyWork>
apeiros hmm i just figured out that i only have a "less than" operation on the backend
rbennace_ has joined #ruby
<TomyWork>
i tried implementing < instead and including Comparable... didn't work
<TomyWork>
./foo.rb:66: stack level too deep (SystemStackError)
x77686d has quit [Remote host closed the connection]
myntcake has joined #ruby
x77686d has joined #ruby
rbennacer has quit [Ping timeout: 244 seconds]
<smathy>
Sounds like you're probably calling <=> within your <=>
Yiota has joined #ruby
agentmeerkat has joined #ruby
IrishGringo has joined #ruby
kareeoleez has quit [Remote host closed the connection]
<TomyWork>
does Comparable do that?
kareeoleez has joined #ruby
fedexo has joined #ruby
tubuliferous has joined #ruby
<TomyWork>
well i removed Comparable and added a few more non-<=> operators. now it no longer crashes
<TomyWork>
but it doesnt sort
<TomyWork>
i'll check my criterion
nando294021 has joined #ruby
mfb2 has joined #ruby
SilverKey has quit [Quit: Halted.]
KnownSyntax_ has joined #ruby
aswen has quit [Quit: WeeChat 1.4]
bradleyprice has joined #ruby
Yiota has quit [Ping timeout: 252 seconds]
shredding has joined #ruby
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
<smathy>
Does Comparable do what? It doesn't insert <=> calls into your <=> method, nor create other infinite loops.
KnownSyntax has quit [Ping timeout: 268 seconds]
mfb2 has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Ping timeout: 276 seconds]
<TomyWork>
well i dont know... i'm not doing any recursion
<TomyWork>
not even accidental
<TomyWork>
Comparable gives me < > <= >= == if i define <=>
<TomyWork>
i need the inverse :)
shibly has joined #ruby
<shevy>
the inverse?
armyriad has joined #ruby
<TomyWork>
or a way to sort given <, <=, ==, !=, >=, and >
<shibly>
shevy, What did you mean by philosophy?
<shevy>
shibly http://www.artima.com/intv/ruby.html - you'll notice a difference when you are using ruby (and have been using another programming language before, such as PHP)
SilverKey has joined #ruby
<shevy>
things such as .map versus .collect
tubuliferous has quit [Ping timeout: 250 seconds]
<shevy>
if it would be python, there would be only .map
cdg has quit [Ping timeout: 276 seconds]
<smathy>
TomyWork, they all call <=> - that's the whole idea of redefining <=>
<smathy>
TomyWork, so maybe you're calling one of those in your <=>
[Butch] has joined #ruby
tubuliferous has joined #ruby
mfb2 has joined #ruby
<smathy>
(which would explain why the SystemStackError went away when you stopped including Comparable.
stennowork has joined #ruby
<TomyWork>
smathy i dont have a <=> yet
terlar has quit [Ping timeout: 250 seconds]
<shibly>
Python users will suggest to use python, ruby users will suggest to use ruby, then which one is to select?
kareeoleez has quit [Remote host closed the connection]
marr has joined #ruby
Yiota has joined #ruby
<TomyWork>
perl
<shibly>
Others will say that their language is good.
<TomyWork>
i'm kidding. perl is horrible
<shibly>
TomyWork, Perl is old.
Asher has quit [Read error: Connection reset by peer]
<shibly>
TomyWork, Why is perl horrible.
<TomyWork>
because it's old
<smathy>
TomyWork, I'm so lost, you started out asking about <=> - you're telling me that you didn't override that? That *is* what you have to override to affect sort.
mlakewood has joined #ruby
<shibly>
Perl is higly used in linux system.
<stennowork>
are native extensions written exclusively in C, or can they also be written in C++?
<shevy>
shibly but the difference is so small
rubie has quit [Remote host closed the connection]
<TomyWork>
smathy ok i'll start over: i want to sort an array of instances of my class, and i have every comparison operator except <=>
Asher has joined #ruby
<stennowork>
this tutorial i am following says in order to install passenger, you need c++
<smathy>
TomyWork, why do you have the other operators?
<stennowork>
(install from gem)
<shevy>
stennowork you can use C++ too. hanmac here does so, he maintains one wxwidgets binding for ruby in C++ https://github.com/Hanmac/rwx
<stennowork>
i see, thanks
<TomyWork>
smathy because the backend implements them
<TomyWork>
it does not implement anything similar to <=>
<smathy>
TomyWork, what's "the backend"?
<TomyWork>
dpkg --compare-versions
JagaJaga has joined #ruby
<shibly>
shevy, Difference of what?
shredding has quit [Ping timeout: 250 seconds]
siaw has joined #ruby
<hanmac>
stennowork: you can do: C++ stuff <=> C function <=> Ruby API to connect ruby with C++ functions
Yiota has quit [Ping timeout: 246 seconds]
<TomyWork>
hanmac wont Inline work?
<stennowork>
i see
resin has quit [Quit: leaving]
<stennowork>
thanks for the info
<smathy>
TomyWork, umm, I'm reading between the lines a bit here, so your class represents a package, and you're wanting to do various comparisons on them, and you thought in order to do that you had to implement all the comparison operators in your own class?
<shevy>
shibly between ruby and python
mfb2 has quit [Ping timeout: 260 seconds]
<smathy>
TomyWork, and now you're stuck because the tool you're calling out to doesn't have any notion of <=> ?
<TomyWork>
smathy i thought that would be helpful, yes :)
<hanmac>
TomyWork: hm i use macros to turn C++ getter/setter into c functions i can bind to the ruby api
<TomyWork>
i could implement <=> in terms of the others, but i dont want to shell out more than necessary
Yiota has joined #ruby
mfb2 has joined #ruby
<shevy>
whoa... cool site. that looks better than rubydoc
kits has quit [Quit: Leaving]
wilbert has joined #ruby
Chagel has joined #ruby
<smathy>
TomyWork, read what I linked you to.
<TomyWork>
smathy "The class must define the <=> operator" - i dont have one
<stennowork>
assuming i know 1.9.2 pretty well, how difficult would it be to get used to 2.x?
<smathy>
TomyWork, if you want sort then you have to have one.
bruno- has quit [Read error: Connection reset by peer]
<smathy>
TomyWork, ...and read the whole thing.
<TomyWork>
i already did 20 minutes ago :)
<shevy>
stennowork should be quite simple really. may depend on how much code you have
<smathy>
TomyWork, excellent, so you realize you made a mistake implementing each of the other comparison operators individualy..
<stennowork>
oki
<shevy>
1.8.x to 1.9.x was bigger than 1.9.x to 2.x really
<stennowork>
acn-
<stennowork>
right, thats what i wanted to ask :P
<TomyWork>
smathy like i said, i want to minimize the amount of dpkg invocations for performance reasons
<brent__>
Hello, hoping to get some help w/ this battleship game i'm working on, I"m getting an error when running the rspec test saying wrogn number of arguments. the attached gist has the Board & Game class along w/ the error https://gist.github.com/brentluna/7bea3c5091938f90c79e156936056ed0
<stennowork>
1.8., where string[index] still returned the char code :P
<shevy>
hehe
<shevy>
I still use [number1,number2] out of habit!
<smathy>
TomyWork, that goal has zero impact on the way to proceed.
elifoster has joined #ruby
<TomyWork>
smathy but if every invocation of <=> shells out on average 2 times
<TomyWork>
then that's bad
ChiefAlexander has quit [Remote host closed the connection]
<brent__>
i was under the impression taht since i'm using the splat operator, i was actually giving the board#[] method 2 args instead of 1
<mustmodify>
brent__: I don't think your gist's line numbers are the same as in your original file... line 43 is blank.
<brent__>
you may be right
<smathy>
TomyWork, how are you doing it for the other operators? Just do it the same, it'll have the same perf impact.
<brent__>
let me see what it corresponds to
<TomyWork>
c++'s sort stuff uses a less than operator (or was it less-or-equal?), so i figured maybe ruby has that too
Couch has quit [Ping timeout: 260 seconds]
andikr has quit [Remote host closed the connection]
<brent__>
mustmodify: it's referring to line 45 the #[] method
amclain has joined #ruby
synthroid has joined #ruby
<smathy>
TomyWork, ...but now you've read that Comparable page, so you know better.
<TomyWork>
smathy the other operators shell out once each
aegis3121 has quit [Ping timeout: 240 seconds]
<TomyWork>
smathy yes i know better about what's necessary in order to use the Comparable mixin
<smathy>
TomyWork, because you already shelled out once for the object itself, but you can't `sort` an array of your objects like that.
idefine_ has joined #ruby
noobsu has quit []
<shevy>
brent__ you probably still only pass the first argument, in array form there. you can find out though, add a second argument via a "," and then the invocation would happen without the error assumingly
<TomyWork>
doesnt mean there isnt a sorting algorithm somewhere that's based on less-than operators
<smathy>
TomyWork, if you're worried about performance then I'd approach that problem separately, eg. by caching.
araujo_ has joined #ruby
wilbert has quit [Ping timeout: 260 seconds]
rbennace_ has quit [Ping timeout: 260 seconds]
<mustmodify>
brent__: How do you initialize your grid? I suspect what you want is @grid[row, col]
<stennowork>
could procs/lambdas be considered first class function (method) objects?
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
<toretore>
stennowork: yes
<smathy>
TomyWork, I'm sure you could write your own, but it doesn't matter because in an array of objects it will always be comparing two at a time, hence two shell-outs.
<TomyWork>
smathy there's not a lot of caching i can do. dpkg --compare-versions already does compare the plain version numbers
<stennowork>
right, fair
bruno- has joined #ruby
<TomyWork>
it doesnt compare packages if that's what you thought
<smathy>
TomyWork, you can use sort_by in Ruby to make that only shell out once for each unique object, or you can create your own caching solution.
<brent__>
mustmodify: the gird is intialized as a arg for initializing the game
idefine_ has quit [Remote host closed the connection]
<smathy>
TomyWork, but you can cache the result of the shell-out.
<mustmodify>
brent__: show me
<brent__>
it's a 2-dimensional array
idefine_ has joined #ruby
<TomyWork>
smathy did i mention that debian's version comparison is a complicated algorithm?
<smathy>
TomyWork, you mention a lot of irrelevant stuff.
antgel has joined #ruby
<mustmodify>
brent__: well then [x, y] instead of [x][y]
<smathy>
TomyWork, why do you think that impacts the solution?
Dimik has joined #ruby
joonty1 has quit [Ping timeout: 260 seconds]
<mustmodify>
brent__: [x][y] would be for an array of arrays.
idefine has quit [Ping timeout: 252 seconds]
<brent__>
mustmodify: it's the first 2 methods of the Board class, can you elaborate why it would be [x, y] instead of [x][y]
gdp has quit [Quit: Leaving]
araujo has quit [Ping timeout: 276 seconds]
<brent__>
it is: @grid = Array.new(10){ Array.new(10) }
symm- has joined #ruby
<TomyWork>
i cant compare them without dpkg --compare-versions. so the only caching i could do would only be useful if the same pair of objects is compared twice. a good sorting algorithm (i.e. not bogosort) will not let that happen
<TomyWork>
even bubblesort compares each pair at most once
shibly has left #ruby ["Leaving"]
<mustmodify>
brent__: missed that method somehow. So you have an array of arrays.
<TomyWork>
hence its O(n²) complexity (and not like O(n³) or something)
helpa has quit [Remote host closed the connection]
carella_ has joined #ruby
mark_66 has quit [Remote host closed the connection]
helpa has joined #ruby
<smathy>
TomyWork, again, reading between the lines, you're saying that what you're calling out two needs to be sent the two different packages for any comparison? So in your `<` implementation you're shelling out once, but sending BOTH versions/package-details?
<mustmodify>
brent__: please add your failing test to the gist.
<smathy>
*to
<brent__>
mustmodify: it is in the gist
rkazak has quit [Ping timeout: 250 seconds]
diegoaguilar has joined #ruby
diegoaguilar has quit [Max SendQ exceeded]
<TomyWork>
smathy my < implementation is roughly: return system("dpkg --compare-versions '#{@version}' lt '#{other.version}'")
anagha_ has quit [Quit: Connection closed for inactivity]
the_drow has quit [Quit: This computer has gone to sleep]
carella has quit [Ping timeout: 250 seconds]
<mustmodify>
brent__: great. When you said that I was like, "I know I didn't miss *that*."
<mustmodify>
brent__: why [[1,1]] instead of just 1,1?
<smathy>
TomyWork, ok, and what does that return?
araujo_ has quit [Quit: Leaving]
<TomyWork>
true if @version is less than other.version, false otherwise
<brent__>
mustmodify: where? in the rspec test?
<mustmodify>
brent__: rather, [1,1]
<smathy>
TomyWork, ...so false if they're the same?
<brent__>
expect(game.board[[1,1]])..?
<TomyWork>
smathy yes
<mustmodify>
yes, board is an array of arrays. So you want to first access the row, then the column.
<smathy>
Heh, ok, so that's terrible.
<mustmodify>
So you want game.board[1,1]
<brent__>
i just noticed that as well
<brent__>
it's a given rspec file that we had to pass
<mustmodify>
brent: Oh... hm...
<TomyWork>
it's only terrible if you want to implement <=> with it :)
blackms has quit [Quit: Leaving]
<brent__>
but it seems like it should be game.board[1, 1].to eq(:x)
agit0 has quit [Quit: zzzZZZ….]
RegulationD has joined #ruby
<smathy>
TomyWork, well no, it's terrible for ANY engine that follows a standard approach to collation.
rbennacer has joined #ruby
<smathy>
TomyWork, collating always needs three different values for less, same, greater.
<brent__>
mustmodify: removing the extra [] from the test gets it to pass,
<mustmodify>
Yep. is this for a tutorial or a class?
<smathy>
TomyWork, it'd be the same if you wanted to have a DB of some sort order those for you.
<smathy>
TomyWork, and there's no other call you can make to just get some sort of consolidated value for the version? A plain integer or bitmask or something that would make sense out in the real world?
<brent__>
it seems like it shoudl only have single brackets, based on my knowledge
rbennacer has quit [Read error: Connection reset by peer]
<brent__>
I guess a class. prepwork for a bootcamp
rbennacer has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
<mustmodify>
brent__: either way, check the original spec to verify. If that's right, and you think it's not likely a typo. then I would ...
<mustmodify>
I would never do it that way, so I don't know.
<mustmodify>
Let's see.
tessi has quit [Quit: tessi]
<TomyWork>
"The elements are compared using operator<"
<mustmodify>
Ah... If Game#board was a hash, which is how you would simulate a 2-dimensional array, then it would work.
allcentury has joined #ruby
<mustmodify>
it would be like {[1,1] => nil, [1,2] => nil, [1,3] => ..., ... [5, 5] => ... }
<mustmodify>
Or really, just Hash.new
baweaver has joined #ruby
<mustmodify>
which would take up less memory than the way you're doing it. Still, I would rather the spec be implementation-agnostic.
<TomyWork>
smathy nope. librpm has a 3-way comparison function, though, which i'm going to use once i get to RPMs :)
ramfjord has joined #ruby
DaniG2k has quit [Quit: leaving]
<TomyWork>
but for .debs, i havent found a 3-way comparison function
<TomyWork>
or a library, for that matter
<brent__>
mustmodify: i was looking over the forums, it looks like they expect you to right a different syntatic sugar method for [] and []=
<smathy>
TomyWork, you did, not sure what your point is, you want to use C++ instead?
<smathy>
TomyWork, doesn't even need to be the cmp operator, just needs to give you a meaningful value.
carella_ has quit [Remote host closed the connection]
<mustmodify>
brent__: do you have enough to solve your issue?
<brent__>
giving it a shot now
hartuok has quit [Quit: Page closed]
Xeago has joined #ruby
<brent__>
it sounds like they want the #[] to take 1 arg isntead fo 2
<TomyWork>
my point is, either you're saying C++ doesn't use a standard approach to collation or using a '<' operator to sort things is a standard approach to collation :)
Raboo has quit [Remote host closed the connection]
<smathy>
TomyWork, definitely the sort algorithms you can use with just a < approach are limited.
Raboo has joined #ruby
<TomyWork>
in what way?
Spami has joined #ruby
bruno- has joined #ruby
<TomyWork>
C++ sorts just fine. even has a stable sort
<brent__>
mustmodify, so i changed the #[] to [](pos);row,col = pos; @grid[row][col];end and then removed the splat from the BattleshipGame#attack method and seemed to work
<shevy>
\o/
bradleyprice has quit [Remote host closed the connection]
<TomyWork>
toretore owww, now how do i get to that function? :D
* TomyWork
digs
Rodya_ has joined #ruby
jaguarmagenta has joined #ruby
Xeago has quit [Ping timeout: 260 seconds]
senayar has quit [Ping timeout: 268 seconds]
<TomyWork>
oh wait, that isn't apt, it's a rubygem
kspencer has joined #ruby
<brent__>
thanks for the help mustmodify
<smathy>
TomyWork, I'm not going to explain the complexities of into sort algorithms to you (for free), if you're interested in the theory here then you can start here: https://en.wikipedia.org/wiki/Three-way_comparison
wilbert has joined #ruby
antgel has quit [Ping timeout: 250 seconds]
blackmesa has joined #ruby
Alayde has quit [Ping timeout: 244 seconds]
yxhuvud has quit [Remote host closed the connection]
<mustmodify>
brent__: ok. I don't have a problem with them requiring you to have a specific implementation, but know that, on an interface level, that isn't what I would call a good long-term solution.
idefine_ has quit [Remote host closed the connection]
<mustmodify>
brent__: good luck.
idefine has joined #ruby
<brent__>
mustmodify, woudl you mind explaining?
St1gma has quit [Quit: laters]
bradleyprice has joined #ruby
<mustmodify>
sure. awkward or implementation-specific interfaces suck.
jaguarmagenta has quit [Ping timeout: 252 seconds]
<TomyWork>
smathy well if you bring in the mathematics. order relations are defined by what's less-than what. all else follows.
johnbat26 has joined #ruby
<mustmodify>
brent__: because they pin you down.
<TomyWork>
or more commonly less-or-equal
<brent__>
are you referring to the need for the specific syntatic sugar method?
bruno- has quit [Read error: Connection reset by peer]
<TomyWork>
but it's really equivalent, because (a<b) == !(b<a)
<TomyWork>
err one second
charliesome has joined #ruby
<TomyWork>
but it's really equivalent, because (a<=b) == !(b<a)
<mustmodify>
I often find myself changing back-end implementations because an app has grown and that part of the code is now slow or doesn't meet a new requirement. I don't want to have a cascading sequence of things to change. I want to change just the one part. So your interfaces need to work hard to hide the inner mechanisms.
ferr has quit [Quit: WeeChat 1.4]
Norrin has quit [Max SendQ exceeded]
mikecmpbll has joined #ruby
edwinvdgraaf has quit [Ping timeout: 244 seconds]
yxhuvud has joined #ruby
<brent__>
could you provide an example of what you would change to "hide the inner mechanisms"
<mustmodify>
brent__: So I would rather the test be game.board[1,1]. No matter how you store the board, you can use a `def []` method and provide results.
<mustmodify>
sure.
<mustmodify>
let's see.
rbennacer has quit [Ping timeout: 240 seconds]
phaza has joined #ruby
Norrin has joined #ruby
rbennacer has joined #ruby
idefine has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 276 seconds]
tvw has quit [Remote host closed the connection]
mikecmpb_ has quit [Ping timeout: 244 seconds]
bruno- has joined #ruby
mikecmpbll has quit [Ping timeout: 260 seconds]
baweaver has quit [Remote host closed the connection]
<toretore>
tribals: Array is a method defined on Kernel
<toretore>
it's not a "call" to the Array class
RegulationD has joined #ruby
<TomyWork>
libapt-pkg is the library... let's see if i can get at that with ffi :)
<toretore>
tribals: for Kernel#Array specifically, it will try to convert whatever it's given to an array
_wwwBukoLaycom has joined #ruby
<smathy>
TomyWork, umm, no, there's DoCmpVersion starting at line 127. That calls CmpFragment - which is where the cmp logic is.
<TomyWork>
oh, probably not... it uses start/end pointers and it's a C++ thing
<tribals>
toretore: thanks! i didn't think of that
<TomyWork>
smathy well i cant just compare fragments
<smathy>
TomyWork, ...and seeing as you seem to think that presence within C++ legitimizes comsci methodologies, here's C++'s qsort, take note of the function you need to provide to it: http://www.cplusplus.com/reference/cstdlib/qsort/
idefine has quit [Remote host closed the connection]
<toretore>
TomyWork: that's (kind of) what i linked you to
<smathy>
toretore, yeah, your link caused me to go looking.
<TomyWork>
cstdlib is C compatibility stuff
<toretore>
gem install apt-pkg
rubie_ has joined #ruby
rubie has quit [Ping timeout: 252 seconds]
bruno- has quit [Read error: Connection reset by peer]
sadin has joined #ruby
<toretore>
def <=>(other); Debian::AptPkg.cmp_version(version, other.version); end
<toretore>
done
<smathy>
TomyWork, ok, no winning with you then. Fine, you're right, the whole concept of cmp is something totally restricted to the fringes of computer science, only used in every DB to do collation, qsort, Ruby, Python, C, Perl, ....
<smathy>
toretore, `include Comparable`
<TomyWork>
smathy X isn't worthless just because Y also exists
bradleyprice has quit [Remote host closed the connection]
bradleyprice has joined #ruby
<smathy>
TomyWork, what did I say was worthless? You're in #ruby asking how to do sorting and you've never stopped resisting doing it the way Ruby (and a bunch of other platforms) do it.
_wwwBukoLaycom has quit [K-Lined]
<TomyWork>
i was only arguing that both are valid, that C++ does it differently than ruby and since ruby usually has a dozen ways of doing something, i figured, maybe that also applies to sorting
<smathy>
...despite me telling you numerous times that it didn't.
<smathy>
Anyway, HAND.
fmcgeough has joined #ruby
mnrmnaugh has quit [Disconnected by services]
mnrmnaugh has joined #ruby
<TomyWork>
toretore thanks a lot. now i'm curious about whether dpkg uses libapt-pkg, though :)
<TomyWork>
but it is separate and it looks the same in the current source
perlgod has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
iamvery has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<smathy>
...might be easier to announce the things it DOES have.
fedexo has quit [Ping timeout: 268 seconds]
carella has joined #ruby
davedev24 has joined #ruby
idefine has quit [Remote host closed the connection]
tubuliferous has joined #ruby
igam has quit [Ping timeout: 250 seconds]
benlieb has joined #ruby
crazyphil2 has joined #ruby
p0p0pr37_ has joined #ruby
KnownSyntax has joined #ruby
phaza has quit [Ping timeout: 268 seconds]
bluOxigen_ has joined #ruby
_kfpratt has joined #ruby
AnoHito_ has joined #ruby
pwnd_nsfw` has joined #ruby
coooas has quit [Ping timeout: 268 seconds]
bluOxigen has quit [Ping timeout: 268 seconds]
crazyphil has quit [Ping timeout: 268 seconds]
valeri_ufo has quit [Ping timeout: 268 seconds]
Guest38576 has quit [Ping timeout: 250 seconds]
crazyphil2 is now known as crazyphil
EdwardIII has quit [Ping timeout: 268 seconds]
yo61_ has quit [Ping timeout: 268 seconds]
ddv has quit [Ping timeout: 268 seconds]
valeri_ufo has joined #ruby
sonne has quit [Ping timeout: 250 seconds]
crdpink has joined #ruby
RazorX- has joined #ruby
eggoez has quit [Ping timeout: 268 seconds]
mg^ has quit [Ping timeout: 268 seconds]
Kim^J has quit [Ping timeout: 268 seconds]
Puffball has quit [Quit: No Ping reply in 180 seconds.]
sadin has quit [Read error: Connection reset by peer]
hpltsy has joined #ruby
diegoaguilar has quit [Ping timeout: 250 seconds]
joonty1 has joined #ruby
sadin has joined #ruby
tinnvec_ has joined #ruby
Affix has joined #ruby
diegoaguilar has joined #ruby
iamvery has joined #ruby
blaxter has quit [Quit: foo]
KnownSyntax_ has quit [Ping timeout: 268 seconds]
kfpratt has quit [Ping timeout: 268 seconds]
gregf has quit [Ping timeout: 268 seconds]
zrl_ has quit [Ping timeout: 268 seconds]
AnoHito has quit [Ping timeout: 268 seconds]
crdpink2 has quit [Ping timeout: 268 seconds]
p0p0pr37 has quit [Ping timeout: 268 seconds]
p0p0pr37_ is now known as p0p0pr37
Affix is now known as Guest17477
Puffball has joined #ruby
mnrmnaugh__ has joined #ruby
RazorX has quit [Ping timeout: 268 seconds]
mg^ has joined #ruby
johnbat26 has joined #ruby
joneshf-laptop_ has quit [Ping timeout: 246 seconds]
Kim^J has joined #ruby
Alayde has joined #ruby
pwnd_nsfw has quit [Ping timeout: 250 seconds]
eregon_ has joined #ruby
griffindy has quit [Max SendQ exceeded]
tinnvec has quit [Ping timeout: 268 seconds]
mnrmnaugh_ has quit [Ping timeout: 268 seconds]
chosen1 has quit [Ping timeout: 268 seconds]
amoeba has joined #ruby
MaienM_ has quit [Ping timeout: 268 seconds]
manveru has quit [Ping timeout: 268 seconds]
kapowaz has quit [Ping timeout: 268 seconds]
TheBrayn has quit [Ping timeout: 268 seconds]
eregon has quit [Ping timeout: 268 seconds]
joconcepts has quit [Ping timeout: 268 seconds]
moos3 has quit [Ping timeout: 268 seconds]
ta_ has joined #ruby
DenSchub has joined #ruby
chris2 has quit [Ping timeout: 268 seconds]
DenSchub has quit [Ping timeout: 268 seconds]
tribals has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
kapowaz has joined #ruby
joconcepts has joined #ruby
ddv has joined #ruby
FastJack has quit [Ping timeout: 268 seconds]
sonne has joined #ruby
Alayde_ has joined #ruby
gregf has joined #ruby
ghr has quit [Ping timeout: 250 seconds]
yo61_ has joined #ruby
blaxter has joined #ruby
Log1x has quit [Ping timeout: 250 seconds]
idefine has joined #ruby
Spami_ has joined #ruby
ereslibre has joined #ruby
ereslibre has joined #ruby
manveru has joined #ruby
bmn has quit [Ping timeout: 250 seconds]
yorickpeterse has quit [Ping timeout: 250 seconds]
joonty1 has quit [Ping timeout: 250 seconds]
v1n has quit [Ping timeout: 250 seconds]
ereslibre_laptop has quit [Ping timeout: 250 seconds]
yorickpeterse has joined #ruby
triangles has joined #ruby
FastJack has joined #ruby
tjvc has quit [Ping timeout: 268 seconds]
rikai has quit [Ping timeout: 260 seconds]
htmldrum has joined #ruby
ramfjord has quit [Ping timeout: 276 seconds]
bmn has joined #ruby
PaulCapestany has quit [Max SendQ exceeded]
Alayde has quit [Ping timeout: 276 seconds]
Fire-Dragon-DoL has quit [Ping timeout: 250 seconds]
kaleido has quit [Remote host closed the connection]
PaulCapestany has joined #ruby
phaza has joined #ruby
Fire-Dragon-DoL has joined #ruby
MaienM_ has joined #ruby
EdwardIII has joined #ruby
v1n has joined #ruby
FooMunki_ has joined #ruby
idefine has quit [Remote host closed the connection]
dumdedum has joined #ruby
ghr has joined #ruby
tjvc has joined #ruby
tjvc has quit [Changing host]
tjvc has joined #ruby
tjvc has quit [Max SendQ exceeded]
<slash_nick>
working on an ancient machine ;)
tjvc has joined #ruby
tjvc has quit [Changing host]
tjvc has joined #ruby
sadin has quit [Read error: Connection reset by peer]
Spami has quit [Ping timeout: 275 seconds]
Log1x has joined #ruby
Log1x has quit [Changing host]
Log1x has joined #ruby
DenSchub has quit [Quit: This should never happen.]
htmldrum has quit [Ping timeout: 240 seconds]
bluOxigen has joined #ruby
bluOxigen_ has quit [Ping timeout: 244 seconds]
ryotarai_ has joined #ruby
hpltsy has quit [Read error: Connection reset by peer]
DenSchub has joined #ruby
astrobun_ has joined #ruby
aegis3121 has joined #ruby
trollface has joined #ruby
bnagy_ has joined #ruby
firstdayonthejob has joined #ruby
eggoez has joined #ruby
dostoyevsky has joined #ruby
xsdg has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
Cohedrin_ has joined #ruby
SilverKey has quit [Quit: Halted.]
crankhar1er has joined #ruby
wldcordeiro has joined #ruby
torandu_ has joined #ruby
LiquidIn1ect has joined #ruby
ahuman_ has joined #ruby
Weavel_ has joined #ruby
phaza has quit [Ping timeout: 260 seconds]
yfeldblum has joined #ruby
Gasher has quit [Quit: Leaving]
antgel has joined #ruby
agentmee1kat has joined #ruby
x77686d has quit [Quit: x77686d]
Cohedrin has quit [Ping timeout: 276 seconds]
tw1sted_ has joined #ruby
hoylemd_ has joined #ruby
kp666 has quit [Quit: Leaving]
atmosx_alt has joined #ruby
meinside_ has joined #ruby
zenlot6 has joined #ruby
n008f4g_ has quit [Ping timeout: 260 seconds]
shortdudey123_ has joined #ruby
manveru_ has joined #ruby
elusiveother_ has joined #ruby
<TomyWork>
what's on it?
huyderman_ has joined #ruby
phaza has joined #ruby
<slash_nick>
a whole world of things
<TomyWork>
i mean which distro
zenguy_pc2 has joined #ruby
<slash_nick>
ah... centos
Nilium_ has joined #ruby
<TomyWork>
oh, didnt know they had ruby 1.9 yet
Rixius has joined #ruby
MRB[alt] has joined #ruby
MRB[alt] is now known as Matthew__
greenhat- has joined #ruby
imajes_ has joined #ruby
Bilge- has joined #ruby
Papierko- has joined #ruby
bmn has quit [*.net *.split]
manveru has quit [*.net *.split]
blaxter has quit [*.net *.split]
kapowaz has quit [*.net *.split]
carella has quit [*.net *.split]
Weavel has quit [*.net *.split]
agentmeerkat has quit [*.net *.split]
szulak has quit [*.net *.split]
banister has quit [*.net *.split]
vdamewood has quit [*.net *.split]
johnmilton has quit [*.net *.split]
zenlot has quit [*.net *.split]
Rixius|Alt has quit [*.net *.split]
s1kx_ has quit [*.net *.split]
FooMunki has quit [*.net *.split]
hk238 has quit [*.net *.split]
lsmola has quit [*.net *.split]
astrobunny has quit [*.net *.split]
tagaulap has quit [*.net *.split]
sauvin has quit [*.net *.split]
YaknotiS has quit [*.net *.split]
Matthew_ has quit [*.net *.split]
meinside has quit [*.net *.split]
gmci has quit [*.net *.split]
torandu has quit [*.net *.split]
tw1sted has quit [*.net *.split]
Elysia has quit [*.net *.split]
spastorino has quit [*.net *.split]
joeyjones has quit [*.net *.split]
ahuman has quit [*.net *.split]
ekem has quit [*.net *.split]
crankharder has quit [*.net *.split]
huyderman has quit [*.net *.split]
hoylemd has quit [*.net *.split]
Alina-malina has quit [*.net *.split]
thomasfedb has quit [*.net *.split]
flughafen has quit [*.net *.split]
elusiveother has quit [*.net *.split]
Paradox has quit [*.net *.split]
LiquidInsect has quit [*.net *.split]
greenhat has quit [*.net *.split]
SirFunk has quit [*.net *.split]
Nilium has quit [*.net *.split]
ryotarai has quit [*.net *.split]
Papierkorb has quit [*.net *.split]
err_ok has quit [*.net *.split]
shortdudey123 has quit [*.net *.split]
mroth has quit [*.net *.split]
zenguy_pc has quit [*.net *.split]
Bilge has quit [*.net *.split]
atmosx has quit [*.net *.split]
dostoyev1ky has quit [*.net *.split]
bnagy has quit [*.net *.split]
xsdg_ has quit [*.net *.split]
hinbody has quit [*.net *.split]
imajes has quit [*.net *.split]
callumacrae has quit [*.net *.split]
stryek has quit [*.net *.split]
deepak has quit [*.net *.split]
jpinnix_______ has quit [*.net *.split]
tobiasvl has quit [*.net *.split]
FooMunki_ is now known as FooMunki
Nilium_ is now known as Nilium
ryotarai_ is now known as ryotarai
imajes_ is now known as imajes
Matthew__ is now known as Matthew_
Papierko- is now known as Papierkorb
stryek has joined #ruby
YaknotiS has joined #ruby
<slash_nick>
it's not the latest centos... not sure what latest would've shipped with
bruno- has joined #ruby
tagaulap_ has joined #ruby
joeyjones has joined #ruby
flughafen has joined #ruby
rikai has joined #ruby
SirFunk has joined #ruby
thomasfedb has joined #ruby
thomasfedb has quit [Changing host]
thomasfedb has joined #ruby
Xeago has joined #ruby
shortdudey123_ is now known as shortdudey123
ekem has joined #ruby
<TomyWork>
i'm kidding of course, but centos is usually a bit old
meinside_ is now known as meinside
sauvin has joined #ruby
bmn has joined #ruby
manveru_ is now known as manveru
lsmola has joined #ruby
gmci has joined #ruby
s1kx_ has joined #ruby
Elysia has joined #ruby
karapetyan has quit [Remote host closed the connection]
cdg has joined #ruby
phaza has quit [Ping timeout: 252 seconds]
Alina-malina has joined #ruby
<smathy>
Heh, using the distro's ruby, always fun.
johnmilton has joined #ruby
nibbo_ has quit [Ping timeout: 260 seconds]
<stennowork>
i actually just installed ruby on centos
Alina-malina has quit [Changing host]
Alina-malina has joined #ruby
ramfjord has joined #ruby
<stennowork>
but, of course, using rvm
callumacrae has joined #ruby
<slash_nick>
yeah... of course i'd build a solution on ruby 2.3.0 that I'd need to use in 1.8.5-land... undetermined whether I can get a modern ruby in this env or whether I'll have to implement the moving window (#each_cons) myself.
<stennowork>
and now i have ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
<stennowork>
1.8.5?
<stennowork>
old
Xeago has quit [Ping timeout: 260 seconds]
idefine has joined #ruby
<TomyWork>
slash_nick so you tried rvm and the likes?
nibbo has joined #ruby
frem_ has joined #ruby
err_ok has joined #ruby
6JTAACLKH has joined #ruby
hinbody has joined #ruby
carella has joined #ruby
err_ok has quit [Changing host]
err_ok has joined #ruby
<slash_nick>
"ancient"
frem_ has quit [Changing host]
frem_ has joined #ruby
nibbo has quit [Changing host]
nibbo has joined #ruby
<smathy>
I'm sure that whatever gems are working with 1.8 will not work with 2.3
<stennowork>
oh kinda missed the intro on that
<stennowork>
feels bad
6JTAACLKH has quit [Remote host closed the connection]
<slash_nick>
TomyWork: oh no it's not a how-do-i issue... this is a not-my-decision issue
* slash_nick
shrugs... stdlib.
<smathy>
Oh look, hxegon is here, you came out the other side of your rebuild?
<slash_nick>
^ smathy
kaleido has joined #ruby
<hxegon>
smathy slash_nick Sort of... Arch worked, but OS X didn't. I reinstalled and I'm going to try again tonight.
<smathy>
slash_nick, huh?
<smathy>
You can't install a later ruby because of some stdlib error?
yfeldblum has quit [Remote host closed the connection]
<smathy>
hxegon, bummer, at least no brick.
<slash_nick>
no, i dont care about which gems work because i'm using stdlib...
bradleyprice has quit [Remote host closed the connection]
<TomyWork>
slash_nick wait, whose braindead decision was it to force you to use a ruby version whose sucessor's successor's successor is already EOL?
yfeldblum has joined #ruby
<smathy>
Ah ok. I can't imagine not using an gems :)
<slash_nick>
TomyWork: whether i'm forced to is still undetermined...
<TomyWork>
(is 2.1 EOL yet? this page here says end of march)
mfb2_ has joined #ruby
spastorino has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
evidex_ has quit [Remote host closed the connection]
idefine has quit [Ping timeout: 252 seconds]
bruno- has joined #ruby
deepak has joined #ruby
blackmesa has joined #ruby
TheBrayn has joined #ruby
mroth has joined #ruby
<TomyWork>
(ah, nothing except security fixes since end of march)
tax has quit [Ping timeout: 276 seconds]
kapowaz has joined #ruby
mfb2__ has joined #ruby
RegulationD has quit [Remote host closed the connection]
mfb2_ has quit [Read error: Connection reset by peer]
chris2 has joined #ruby
jpinnix_______ has joined #ruby
gizmore has joined #ruby
zrl_ has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mfb2 has quit [Ping timeout: 252 seconds]
jackjackdripper has joined #ruby
johnbat26 has quit [Ping timeout: 244 seconds]
phaza has joined #ruby
SCHAAP137 has joined #ruby
rcvalle has joined #ruby
jhack has joined #ruby
blackmesa has quit [Ping timeout: 276 seconds]
blackmesa has joined #ruby
nanoz has joined #ruby
allcentury has quit [Quit: WeeChat 1.2]
wilbert has quit [Ping timeout: 260 seconds]
jackjackdripper has quit [Quit: Leaving.]
idefine has joined #ruby
symm- has quit [Ping timeout: 244 seconds]
jackjackdripper has joined #ruby
bradleyprice has joined #ruby
tvw has joined #ruby
jackjackdripper has quit [Client Quit]
jackjackdripper has joined #ruby
stennowork has quit [Quit: Verlassend]
mfb2__ has quit [Remote host closed the connection]
TomyWork has quit [Ping timeout: 244 seconds]
mfb2 has joined #ruby
crdpink has quit [Ping timeout: 250 seconds]
crdpink2 has joined #ruby
n008f4g_ has joined #ruby
blackmesa has quit [Ping timeout: 276 seconds]
SilverKey has joined #ruby
last_staff has joined #ruby
cdg has quit [Remote host closed the connection]
codecop has joined #ruby
cdg has joined #ruby
pandaant has quit [Remote host closed the connection]
mfb2 has quit [Remote host closed the connection]
karapetyan has joined #ruby
jackjackdripper1 has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
johnbat26 has joined #ruby
phaza has quit [Ping timeout: 260 seconds]
stannard has quit [Remote host closed the connection]
bronson has joined #ruby
mr_rich101 has quit [Ping timeout: 276 seconds]
syk has joined #ruby
charliesome has joined #ruby
jackjackdripper has quit [Ping timeout: 260 seconds]
Rodya_ has quit [Remote host closed the connection]
kitallis has quit [Ping timeout: 276 seconds]
phaza has joined #ruby
bronson has quit [Remote host closed the connection]
chouhoulis has quit [Remote host closed the connection]
karapetyan has quit [Ping timeout: 244 seconds]
jordanm has joined #ruby
mr_rich101 has joined #ruby
kitallis has joined #ruby
chouhoulis has joined #ruby
agentmeerkat has joined #ruby
stannard has joined #ruby
charliesome has quit [Read error: Connection reset by peer]
charliesome has joined #ruby
baweaver has joined #ruby
agentmee1kat has quit [Ping timeout: 276 seconds]
charliesome has quit [Read error: Connection reset by peer]
<duracrisis>
sharkman has joined #ruby
<sharkman>
what does def [](k); @hash[k.to_s]; end
<sharkman>
do?
<sharkman>
especially what is the def []() syntax mean
charliesome has joined #ruby
<jhass>
[] is just a valid method name
<jhass>
you can invoke it like foo.[](bar)
<jhass>
but ruby also rewrites foo[bar] to foo.[](bar)
chouhoulis has quit [Ping timeout: 260 seconds]
phaza has quit [Ping timeout: 250 seconds]
yfeldblum has quit [Ping timeout: 268 seconds]
charliesome has quit [Client Quit]
aiguu has joined #ruby
MagePsycho has joined #ruby
<sharkman>
yikes okay
<sharkman>
thanks
ramfjord has quit [Ping timeout: 246 seconds]
drptbl_ has quit [Quit: My MAC has gone to sleep. zZz..]
Lomex has joined #ruby
baweaver has quit [Ping timeout: 250 seconds]
tessi has joined #ruby
baweaver has joined #ruby
idefine has quit [Remote host closed the connection]
mikecmpbll has joined #ruby
karapetyan has joined #ruby
karapetyan has quit [Remote host closed the connection]
Alayde_ has left #ruby ["WeeChat 1.1.1"]
karapetyan has joined #ruby
s00pcan has quit [Read error: Connection reset by peer]
s00pcan_ has joined #ruby
mfb2 has joined #ruby
<ytti>
not yikes, simple :)
<ytti>
less special cases/expectaions
<ytti>
4-2 is actually 4.-(2)
<ytti>
exceptions not expectations
kareeoleez has joined #ruby
joonty1 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
bradleyprice has quit [Remote host closed the connection]
bradleyprice has joined #ruby
karapetyan has quit [Remote host closed the connection]
mfb2 has quit [Remote host closed the connection]
mfb2 has joined #ruby
rippa has quit [Ping timeout: 250 seconds]
mfb2 has quit [Remote host closed the connection]
mfb2 has joined #ruby
Rodya_ has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
joonty1 has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
<shevy>
beer not water
jhack has quit [Quit: jhack]
dsimon has joined #ruby
karapetyan has joined #ruby
<dsimon>
hey all; i think i'm a bit confused about enumerators
<hanmac>
yeah but i gets more complicated when ruby has a difference between "-3" and "- 3" ;P
<dsimon>
because i want to do lazy calculation in some cases but not in others
<baweaver>
?xy
<ruby[bot]>
it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
SilverKey has quit [Quit: Halted.]
ledestin has joined #ruby
elifoster has quit [Ping timeout: 250 seconds]
<dsimon>
let's say i have an array that i want to filter on something expensive
<baweaver>
find will break out when it finds something
<dsimon>
sometimes i'm interested in getting all the filtered results
<baweaver>
then make a flag
<dsimon>
but other times i only want to know if there are *any*
crank1988 has quit [Ping timeout: 240 seconds]
<dsimon>
i thought i could return an enumerator in either case, and call either .any? or .to_a on it depending on the use case
<dsimon>
or, suppose i only wanted the first 3 results regardless of how many
<dsimon>
and so on; the usual stuff that's handy about lazy evaluation
<hanmac>
hey checkout take_while:
<hanmac>
>> (1..10).take_while.each {|i| puts "AT #{i}"; i <= 2}
<baweaver>
though admittedly I haven't used it myself in any live code
<baweaver>
and don't know much about it
nalitia has joined #ruby
<dsimon>
hm
crank1988 has joined #ruby
<dsimon>
i tried putting it as `arr.select.lazy.each`
<dsimon>
but no effect?
idefine has joined #ruby
jobewan has joined #ruby
<nalitia>
How can I require a module with name "Xyz" when there is already a class loaded with name "Xyz"? I always get "Xyz is not a module (TypeError)"
<baweaver>
fair warning that I never really use it so anything I say on it is guesswork from Haskell
<shevy>
lol
<dsimon>
so then what's the use of select w/o block which returns an enumerator?
aegis3121 has joined #ruby
<baweaver>
Not sure honestly
<baweaver>
never had a use for it
jaguarmagenta has quit [Ping timeout: 244 seconds]
<baweaver>
probably is one, but not one I'm immediately aware of.
<shevy>
just like monads!
<baweaver>
Anyways, food time for me. Ox0dea or jhass would probably know the magic there better than me.
<baweaver>
A monad is just a monoid in the category of an endofunctor.
Es0teric has joined #ruby
* TomyLobo
hits shevy's monads
baweaver has quit [Remote host closed the connection]
<TomyLobo>
there, i found a use
darkxploit has joined #ruby
MagePsycho has quit [Ping timeout: 240 seconds]
tvon has joined #ruby
darkxploit has quit [Max SendQ exceeded]
darkxploit has joined #ruby
x77686d has joined #ruby
idefine has joined #ruby
<jhass>
dsimon: I only read the beginning, but Enumerator executes each method in the chain for all elements at once, passing the result of the previous invocation to the next item in the chain. There's Enumerator::Lazy available through Enumerable#lazy (iirc), which executes the whole chain for each item before going to the next item
perlgod has joined #ruby
perlgod has quit [Client Quit]
william3 has joined #ruby
ramfjord has joined #ruby
<dsimon>
jhass, is there any particular reason then to call methods like select without a block?
<dsimon>
rather than just getting an enumerator first and then using its Enumerable methods in the usual way with a block
william3 has quit [Remote host closed the connection]
<jhass>
Enumerator::Lazy is much much newer than Enumerator, I guess they simply didn't repeat that odd behavior ;)
<dsimon>
fair enough :-)
htmldrum has joined #ruby
TomyLobo has quit [Read error: Connection reset by peer]
<sphex_>
hey. I need to generate and send emails with Unicode in the subject field. Any one could recommend a module by any chance? I have zero experience with ruby and emails... Ideally it wouldn't need an SMTP server and could just spawn off sendmail(1).
karapetyan has quit [Remote host closed the connection]
<smathy>
jhass, actually the non-lazy behavior makes sense to me. [ nil, false, 1 ].select.each {|x|x} should return the same as [ nil, false, 1 ].select {|x|x}
<dsimon>
sphex_, this is a little off-topic, but you are almost always better off routing through an email server if you don't want to get blocked by spam filters
<dsimon>
attempting to directly connect to the recipient's server will usually not go well, because of greylisting, DNS-based mail server verification, etc.
<sphex_>
jhass: alright. I haven't found how yet, but I'll keep looking. probably just need to word-encode manually the header when needed...
<jhass>
I know that Mail::Address properly handles it for names in the To/From etc headers
<jhass>
I would have expected it just handles it for the subject too
<sphex_>
dsimon: oh yeah.. in this specific case the server already seems to have a good reputation and has been sending emails directly for years now. people can still setup a relaying local MTA if they want though. I just hate adding extra, mandatory configurations to things...
bronson has quit [Ping timeout: 252 seconds]
phaza has joined #ruby
<dsimon>
no worries then, just wanted to keep you from getting bitten by the same thing i did a while back :-)
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bruno- has quit [Read error: Connection reset by peer]
bruno- has joined #ruby
chouhoulis has joined #ruby
phaza has quit [Ping timeout: 252 seconds]
<sphex_>
jhass: huh, you're right. it all just works. I messed up my testing. :/
moos3 has joined #ruby
aef has quit [Remote host closed the connection]
jrafanie_ has joined #ruby
morochena has joined #ruby
gregf has quit [Read error: Connection reset by peer]
<sphex_>
eh, it seems like a pretty great module
davedev2_ has joined #ruby
morochena has quit [Client Quit]
davedev24 has quit [Ping timeout: 276 seconds]
joonty1 has joined #ruby
davedev24 has joined #ruby
davedev2_ has quit [Read error: Connection reset by peer]
jhack has quit [Ping timeout: 276 seconds]
jrafanie has quit [Ping timeout: 246 seconds]
sepp2k has quit [Quit: Leaving.]
phaza has joined #ruby
joonty1 has quit [Ping timeout: 250 seconds]
MagePsycho has quit [Ping timeout: 260 seconds]
<theRoUS>
is there a non-file mutex mechanism that supports LOCK_SH and LOCK_EX? and not just exclusive all-or-nothing locking?
govg has joined #ruby
GinoMan2440 has quit [Ping timeout: 260 seconds]
codecop has quit [Remote host closed the connection]
GinoMan2440 has joined #ruby
Lomex has quit [Remote host closed the connection]
zeroXten has quit [Remote host closed the connection]
MagePsycho has joined #ruby
carella has quit [Remote host closed the connection]
<dsimon>
it's particularly useful to call on Hash as well
tenderlove has joined #ruby
<dsimon>
to transform one hash into another
x77686d has joined #ruby
Madplatypus has joined #ruby
govg has quit [Ping timeout: 250 seconds]
jrafanie_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
phaza has joined #ruby
<hxegon>
dsimon agreed, a lot of HOF stuff in ruby feels really awkward when trying to return a hash
replay has joined #ruby
replay has quit [Max SendQ exceeded]
<dsimon>
i mean, obviously it's just map(&block).to_h, but i don't like sticking stuff onto the `end` of multi-line blocks
<dsimon>
i feel like it's easy to miss there
dionysus69 has joined #ruby
replay has joined #ruby
rikai has quit [Ping timeout: 244 seconds]
<dsimon>
HOF?
poerror has joined #ruby
sdothum has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
<hxegon>
dsimon higher order function, so stuff like map, reduce, anything that takes a function as input.
poerror has left #ruby [#ruby]
<dsimon>
ah, gotcha
bradleyprice has joined #ruby
idefine has joined #ruby
bronson has joined #ruby
<hxegon>
dsimon facets has a lot of niceties for stuff like partial application, and function composition. Most of the code I write is just stuff like
sdothum has joined #ruby
synthroid has quit []
polishdub has quit [Quit: Leaving]
stannard has quit [Remote host closed the connection]
<hxegon>
def foo x; foo.map { |e| e.something x }; end
Ami00 has quit [Quit: Залишаю]
freerobby has quit [Quit: Leaving.]
maneken has joined #ruby
bradleyprice has quit [Ping timeout: 260 seconds]
bronson has quit [Ping timeout: 252 seconds]
idefine has quit [Ping timeout: 240 seconds]
stannard has joined #ruby
stannard has quit [Remote host closed the connection]
rikai has joined #ruby
bradleyprice has joined #ruby
<hxegon>
hmm... I was going to say partial application would clear that up, but I thing functions would have to be first class objects. So I'd have to rewrite a bunch of stuff to return Procs and Lambdas.
stannard has joined #ruby
<maneken>
Hello ruby people. I'm a php developer, I have no experience with ruby, but I'm thinking about starting a project. It's gonna be a CRM/ERP open-source software, and I want to create something absolutely basic that could be extended with plugins so that anyone can contribute.
senayar has joined #ruby
senayar has joined #ruby
<maneken>
Can you help with any resources to help with the plugin design?
ljames has joined #ruby
Akkad has joined #ruby
Rodya_ has joined #ruby
<gizmore>
maneken: it is going to be a web2.0 website?
mfb2 has joined #ruby
<gizmore>
plugins, generally, need an interface they obey to
<maneken>
gizmore, yes
<gizmore>
maybe like "config options"
<gizmore>
are you going to use rails?
<havenwood>
maneken: See the Sequel and Roda plugin systems.
<havenwood>
maneken: I don't think a CRM is a good first Ruby project.
rahult has joined #ruby
Rodya_ has quit [Remote host closed the connection]
<gizmore>
any project is a good first ruby project, imo :)
Rodya_ has joined #ruby
<gizmore>
and any v3 version is the best version!
mfb2 has quit [Remote host closed the connection]
lxsameer has joined #ruby
<maneken>
i have experience in PHP. I suppose it's gonna be easier for me to use symphony or some other php framework, but I find it boring and i wanted to try something else
<havenwood>
maneken: Ruby is lovely.
<gizmore>
Ruby has a really nice syntax (coming from php too)
<gizmore>
btw, i am working on chatbot which has a plugin system too.... https://github.com/gizmore/ricer4-tcp this is a raw tcp/ip connector plugin for it :)
<gizmore>
both is the same, of course, but require keeps track of files loaded already
sameerynho has joined #ruby
lxsameer has quit [Ping timeout: 268 seconds]
idefine has joined #ruby
<gizmore>
so if you "load" a file, you just always overwrite (or create) definitions
<gizmore>
you can simply do:
<gizmore>
> class String; def to_s; "aaa"; end; end; "hello".to_s
lvn has joined #ruby
sharkman has joined #ruby
sharkman has quit [Max SendQ exceeded]
<gizmore>
which would override the String's to_s implementation and return "aaa" always
sharkman has joined #ruby
<gizmore>
easy to mess up core stuff.... soooo flexible =)
<gizmore>
there is a lot discussion on the net about monkey patching and alike, but first you need to know that loading a file can just overwrite existing code without problems
<gizmore>
unlike php
<gizmore>
where "class Foo{}; class Foo{};" gives a crash
<gizmore>
in ruby class Foo; end; class Foo; end; would both just work on the Foo class definitions
<gizmore>
and either overwrite or create definitions
<gizmore>
in PHP, monkey patching is not possible, iirc
<gizmore>
in Ruby you should not do it, but can :) (and will!)
idefine has quit [Ping timeout: 276 seconds]
<gizmore>
in PHP i wrote a chatbot and gave up on code reloading on runtime (PECL extension for it sucks)
freerobby has joined #ruby
sameerynho has quit [Ping timeout: 252 seconds]
<gizmore>
in Ruby it was no problem :)
<gizmore>
simply call "load" again on all files, and all methods are updated again \o/
aiguu has quit [Quit: WeeChat 1.4]
Robbie has joined #ruby
<gizmore>
unloading methods that had been removed would be a problem, but i ignore that :P
Robbie has quit [Client Quit]
Robbie has joined #ruby
<gizmore>
i assume WEBRick ignores that as well (a dev http server in rails)
SilverKey has joined #ruby
noobsu has joined #ruby
aupadhye has quit [Quit: Leaving]
polysics has joined #ruby
idefine has joined #ruby
idefine has quit [Remote host closed the connection]
Robbie has quit [Client Quit]
idefine has joined #ruby
joneshf-laptop has joined #ruby
CausaMortis has joined #ruby
hxegon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
gizmore: WEBRick doesn't do the code reloading, rails does
Rutixz has quit [Remote host closed the connection]
VeryBewitching has quit [Quit: Konversation terminated!]
chipotle has quit [Quit: cheerio]
renderfu_ has quit [Ping timeout: 268 seconds]
mfb2 has quit [Ping timeout: 250 seconds]
jhack has quit [Quit: jhack]
mfb2_ has quit [Ping timeout: 244 seconds]
neanderslob has quit [Remote host closed the connection]
<xingped>
hey, can anyone help me understand what "prototypal inheritance" means, how it works in ruby, and how it's different from classical inheritance?
cschneid has quit [Remote host closed the connection]
Rutix has joined #ruby
Rutix has joined #ruby
SilverKey has joined #ruby
jobewan has quit [Ping timeout: 252 seconds]
fmcgeough has joined #ruby
duderonomy has joined #ruby
fmcgeough has quit [Client Quit]
rahult has joined #ruby
<smathy>
xingped, is this an assignment?
rahult is now known as rahult_
agentmeerkat has quit [Ping timeout: 252 seconds]
rahult_ is now known as rahult
<xingped>
smathy, not quite. i have an interview tomorrow for a position teaching full stack web dev. they know i've never used ruby, but i need to learn anyways and this is one of the things talked about. crash coursing myself the past couple days on ruby
yfeldblum has quit [Ping timeout: 250 seconds]
<xingped>
i've only used PHP for backend dev prior to this
Chagel has joined #ruby
<smathy>
xingped, ok, and you're sure the question is about ruby? Ruby is primarily a class-inheritance based language, and in the web world the classic example of prototypical inheritance is Javascript.
Azure has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jackjackdripper1 has joined #ruby
<xingped>
hm... it's a "mock teaching session" interview, but it's a bit vague on whether they meant ruby or javascript. maybe they meant javascript
chipotle has joined #ruby
chipotle has quit [Client Quit]
<hxegon>
xingped I would think they mean JS, as ruby (allegedly) has poor support for that kind of thing
Rutix has quit [Remote host closed the connection]
<baweaver>
prototypes are straight Javascript
<xingped>
haha, alright, thanks ya'll
<xingped>
never done prototypal anything in javascript either
<smathy>
xingped, so ruby does _kinda_ have the mechanism via mixins, but in the ruby world no one refers to it as prototypical inheritance because ruby's primary method of inheritance is class-based.
graft has joined #ruby
graft has joined #ruby
s1kx_ has quit [Quit: bai]
Chagel has quit [Ping timeout: 246 seconds]
<smathy>
xingped, so maybe to cover all bases, take a quick look at mixins in ruby, they're easy, and then get into JS.
<xingped>
alright, thanks smathy
freerobby has joined #ruby
<graft>
heyo, so often i do: def initialize(foo,bar); @foo = foo; @bar = bar; end - is there a way to do this implicitly, i.e. initialize directly into an instance var?
<graft>
like def initialize(@foo,@bar) or something
rodfersou has quit [Quit: leaving]
wldcordeiro has quit [Ping timeout: 252 seconds]
jackjackdripper has quit [Ping timeout: 260 seconds]
nickjj_ is now known as nickjj
<smathy>
xingped, but seriously, I'm over 25 years as a dev, over 10 in ruby, and if I went for a job and they asked me about prototypical inheritance in ruby I'd say: "Huh? You mean javascript right."
<baweaver>
not really for that without passing it a hash and dynamically assign them
<baweaver>
which presents its own dangers
<smathy>
graft, no, but you can do a parallel assignment: @foo, @bar = foo, bar;
<graft>
smathy: yeah... still seems like a waste of characters
<xingped>
smathy, haha, good to know. new to ruby so didn't know it wasn't really a thing in ruby
<smathy>
I can't cure your biases against characters.
Azure has joined #ruby
<smathy>
xingped, yep, good luck.
<Nilium>
What do you have against glyphs
whippythellama has quit [Quit: WeeChat 1.4]
mfb2 has joined #ruby
<graft>
they cost mana
<baweaver>
you could make a macro type method for it based on attr_{reader, writer, accessor}
<smathy>
graft, once I wanted to be able to just say: `def initialize @foo, @bar; end` - but y'know, it passed.
bradleyprice has joined #ruby
<baweaver>
>> class Test < Struct.new(:foo, :bar); end; Test.new(1,2)