sailias has quit [Read error: Connection reset by peer]
<zzak_>
afaik, it should just work if you install that package
<jpwhiting>
gem list does show rails (2.3.14
sailias has joined #ruby-lang
wardrop has quit [Ping timeout: 272 seconds]
<jpwhiting>
zzak_: yes, the problem is it doesn't "just work" I've heard from a few places that the ubuntu/debian packaging of ruby is bad, and I'm finding out myself why
<zzak_>
try reporting the bug to launchpad or the ubuntu q&a forum
<jpwhiting>
now I need to fix it and provide patches to ubuntu probably with fixes
bousquet has joined #ruby-lang
<jpwhiting>
but first I need it to work locally so I know what the problem is :) so then I can give them patches that fix the issues
NemesisD has quit [Ping timeout: 264 seconds]
<zzak_>
i think zenspider is right, you're barking up the wrong tree. try #ubuntu or #rubyonrails if you cant get help on launchpad or via ubuntu community resources
<jpwhiting>
k, /me asks on rubyonrails, thx
sailias has quit [Client Quit]
pkrnj has quit [Quit: Computer has gone to sleep.]
lsegal has joined #ruby-lang
<jpwhiting>
zzak_: why did you say "but that is wrong" doesn't ruby-rails 2.3 require ruby-rack ~>1.1.0 ?
<jpwhiting>
i.e. ruby-rack 1.4.1 wont work
mistym has joined #ruby-lang
dhruvasagar has joined #ruby-lang
<zenspider>
sounds like the ruby-rails package either doesn't install railties properly (or at all)
<zenspider>
jpwhiting: he also said n/m
pkrnj has joined #ruby-lang
<zenspider>
I sorta like the idea at ubuntu packages a too new version of rack and a too old version of rails and they don't play together well. :)
<jpwhiting>
zenspider: ah, ok
<jpwhiting>
hmm, the only railties package is ruby-railties-3.2
<jpwhiting>
that goes with ruby-rails 3.2 not 2.3 right?
<zenspider>
yup
pkrnj has quit [Client Quit]
<zenspider>
ah
<zenspider>
no
<jpwhiting>
no?
<zenspider>
the problem is much easier
<zenspider>
there is no "rails" to require in 2.3
<zenspider>
so your test is a false negative
io_syl has quit [Quit: Computer has gone to sleep.]
levifig has quit [Excess Flood]
<jpwhiting>
rails 2.3 doesn't provide a gem or something to require?
<zenspider>
do: require "rails/version"
<jpwhiting>
require 'rails/2.3.14' fails the same way
mistym has quit [Remote host closed the connection]
<jpwhiting>
oh, or do you mean require 'rails', '2.3.14'
levifig has joined #ruby-lang
<zenspider>
no, I mean require "rails/version"
<jpwhiting>
rails/version ? interesting, ok
pkrnj has joined #ruby-lang
levifig has quit [Excess Flood]
Xzyx987X has joined #ruby-lang
<jpwhiting>
so require 'rails/version' works fine, but rake --trace db:setup still fails because it can't find initializer
<zenspider>
so now you know you have it installed correctly
<zenspider>
can you require "initializer" ?
ivanoats has joined #ruby-lang
ivanoats has quit [Changing host]
ivanoats has joined #ruby-lang
<jpwhiting>
nope
<jpwhiting>
same error as I get from rake
<jpwhiting>
LoadError: no such file to load -- initializer
levifig has joined #ruby-lang
<zenspider>
well... I'm looking at 2.3.9 and there is both a lib/initializer.rb and lib/rails/version.rb in railties
<zenspider>
so maybe you still have a packaging issue
<zenspider>
you'll have to probe the package for that
Honeycomb has quit [Quit: Leaving.]
gregmore_ has quit [Ping timeout: 245 seconds]
<jpwhiting>
yes, I also have /usr/lib/ruby/vendor_ruby/rails/version.rb
cirenyc has joined #ruby-lang
<jpwhiting>
zenspider: strace rake --trace db:setup shows it's looking for initializer.rb in /usr/share/rubygems-integration/1.8/gems etc.
cirenyc has quit [Client Quit]
<jpwhiting>
but it's in /usr/lib/ruby/vendor_ruby/
<zenspider>
jesus ubuntu fucks everything up
<jpwhiting>
indeed
<jpwhiting>
btw, which distro are you using?
<zenspider>
so it looks like you have a pathing issue
<zenspider>
make sure that directory is in your $LOAD_PATH
<jpwhiting>
exactly
<jpwhiting>
any idea how I can fix it? does ruby use env variables?
<jpwhiting>
RUBY_LOAD_PATH or just LOAD_PATH?
<zenspider>
don't assume I use a "distro". I work primarily on osx and freebsd
<jpwhiting>
ah, gotcha
<jpwhiting>
cool
<zenspider>
jpwhiting: well... I assume if you can require "rails/version" that SOMETHING is pointing you at that directory... or you have something REALLY messed up like a mix of gems and packages
<zenspider>
actually... worry about the latter
<jpwhiting>
mix of gems and packages? that's definitely possible?
<jpwhiting>
mix of gems and packages? that's definitely possible.
<jpwhiting>
I did gem install at one point to try to get this to "just work" but it didn't :)
<jpwhiting>
I nuked everything from /var/lib/gems though, so shouldn't have any gems left around
<jpwhiting>
though I did find rails was in /usr/local/bin, so maybe some things are still there...
<zenspider>
I'm guessing you don't have vendor_ruby in your pathing, but you DO have some mix of gems
<zenspider>
tho how you don't have initializer... maybe you have something in the 2.2 series installed. I don't remember when the initializer stuff come to fruition
pabloh has quit [Quit: Saliendo]
<jpwhiting>
initializer is itself a gem?
<jpwhiting>
I thought it was just part of ruby-rails 2.3
<jpwhiting>
but that was just a guess since ruby-rails-2.3 provided an initializer.rb file
<jpwhiting>
I don't see any initializer ruby gem though
mistym has joined #ruby-lang
Domon has joined #ruby-lang
<jpwhiting>
zenspider: how can I tell what paths I do have?
<jpwhiting>
LOAD_PATH is the only thing with vendor_ruby in it, and only because I just added it
<jpwhiting>
for environment variables
<zenspider>
initializer is just a file in railties
<jpwhiting>
ok, that's what I was thinking, ok
<zenspider>
why ubuntu installs stuff into a directory that they don't have added to their packaged ruby is beyond me
pkrnj has quit [Quit: Computer has gone to sleep.]
<jpwhiting>
in GEM PATHS
<zenspider>
that's fine
<jpwhiting>
zenspider: maybe they have added it to their packaged ruby
<jpwhiting>
how can I check
<zenspider>
but that isn't the path you have above
<zenspider>
you checked
<zenspider>
you had to add the directory to $LOAD_PATH
<jpwhiting>
ah, the strace
<zenspider>
which means they didn't
<jpwhiting>
even adding it to LOAD_PATH didn't help
<jpwhiting>
what's supposed to set LOAD_PATH ?
<zenspider>
I have yet to say LOAD_PATH
<zenspider>
I've said $LOAD_PATH _every_ time
<jpwhiting>
oh
<jpwhiting>
not a bash environment variable?
<jpwhiting>
i.e. export LOAD_PATH=blah
<jpwhiting>
echo $LOAD_PATH
<zenspider>
we're not in #bash, we're in #ruby-lang
<zenspider>
ruby sets $LOAD_PATH with a bunch of stuff calculated at compile time
<jpwhiting>
ok
<jpwhiting>
how do I set $LOAD_PATH then?
<zenspider>
rubygems adds a ton to it, based on gem activations during runtime
<zenspider>
jpwhiting: presumably... you use a non-broken ruby with non-broken packages
<zenspider>
either the gem packaging is broken or the ruby is
<jpwhiting>
ok, where does non-broken ruby with non-broken packages set $LOAD_PATH ?
<zenspider>
you can run with `ruby -Idir:dir:dir` manually
<zenspider>
it sets it at startup time
<zenspider>
if you were using rubygems, this would be a nonissue. you'd require a file, rubygems finds it, adds the loadpath, and then forwards the require up
<jpwhiting>
zenspider: interesting, I'm beginning to think the best way to go forward is to install only rubygems then in the obs-api postinst run gem1.8 install rails
<jpwhiting>
and go
MehLaptop has joined #ruby-lang
<jpwhiting>
forget about these silly broken beyond belief debian/ubuntu ruby packages
<zenspider>
not to say that ubuntu didn't also break their rubygems... I think they mostly just neutered updating
<jpwhiting>
it's possible
<jpwhiting>
anyway, I'll change my approach tomorrow and see how far that gets me
<dominikh>
Unfortunately, this video is not available in Germany because it may contain music for which GEMA has not granted the respective music rights
<injekt>
wtf kind of character is that
<injekt>
haxing up your blahs
<yorickpeterse>
dominikh: heh, works here
<injekt>
lol germany
<dominikh>
yorickpeterse: you're not german, are you :P
<judofyr>
injekt: it's åwesome
<yorickpeterse>
No, I'm from Glorious Netherlands
<dominikh>
yeah... you don't have the inglorious GEMA
<dominikh>
but hey, upside, we're safe from rick rolls
<yorickpeterse>
we have BREIN and Buma/stemra
<judofyr>
can gem name contain unicode chars?
<judofyr>
gem install <snowman>
<dominikh>
yorickpeterse: they don't want lolhuge amounts per view from youtube though :)
<dominikh>
*amounts of money
<injekt>
judofyr: yes
<dominikh>
snowman is the funniest you can come up with? how about RTL code in your gem name
<yorickpeterse>
Hm interesting, Gem::Specification also takes Korean letters
<yorickpeterse>
please don't let it be a penis, please don't let it be a penis
nXqd has joined #ruby-lang
<yorickpeterse>
oh, just some dumb person
sebasoga has quit [Ping timeout: 272 seconds]
<andrewvos>
you wanted it to be a penis
sebasoga has joined #ruby-lang
smt has joined #ruby-lang
<andrewvos>
pub lunch time!!
smt has quit [Client Quit]
smt has joined #ruby-lang
sebasoga has quit [Read error: Connection reset by peer]
sebasoga has joined #ruby-lang
<dominikh>
far better than a penis
zomgbie has quit [Ping timeout: 256 seconds]
sebasoga has quit [Ping timeout: 252 seconds]
nkr has joined #ruby-lang
sebasoga has joined #ruby-lang
r0bby has quit [Ping timeout: 240 seconds]
sebasoga has quit [Ping timeout: 252 seconds]
sebasoga has joined #ruby-lang
zomgbie has joined #ruby-lang
kristofferrr has quit [Quit: ❤]
sebasoga has quit [Ping timeout: 260 seconds]
sebasoga has joined #ruby-lang
jxie has quit [Quit: leaving]
MaddinXx has joined #ruby-lang
sebasoga has quit [Ping timeout: 248 seconds]
zomgbie has quit [Ping timeout: 248 seconds]
sebasoga has joined #ruby-lang
glebm has joined #ruby-lang
barttenbrinke has quit [Remote host closed the connection]
smt has quit [Ping timeout: 276 seconds]
sebasoga has quit [Ping timeout: 260 seconds]
sebasoga has joined #ruby-lang
cirenyc has joined #ruby-lang
KU0N has joined #ruby-lang
apeiros_ has quit []
sebasoga has quit [Ping timeout: 248 seconds]
sebasoga has joined #ruby-lang
beho has joined #ruby-lang
apeiros_ has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
cirenyc has quit [Ping timeout: 252 seconds]
gnufied has joined #ruby-lang
alessio_rocco has quit [Ping timeout: 260 seconds]
carloslopes has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
alessio_rocco has joined #ruby-lang
barttenbrinke has joined #ruby-lang
sailias has joined #ruby-lang
setmeaway has quit [Ping timeout: 264 seconds]
emocakes has quit [Quit: emocakes]
charliesome has quit [Ping timeout: 240 seconds]
dorei has joined #ruby-lang
DEac- has quit [Read error: Connection reset by peer]
DEac- has joined #ruby-lang
io_syl has quit [Ping timeout: 260 seconds]
iamjarvo has joined #ruby-lang
io_syl has joined #ruby-lang
<yorickpeterse>
<3 ensure
sailias has quit [Quit: Leaving.]
madish has joined #ruby-lang
kgrz has quit [Quit: Computer has gone to sleep.]
hasimo has quit [Remote host closed the connection]
wobblini has quit [Ping timeout: 255 seconds]
glebm has quit [Quit: Computer has gone to sleep.]
hapster has joined #ruby-lang
anonymuse has joined #ruby-lang
io_syl has quit [Ping timeout: 272 seconds]
zomgbie has joined #ruby-lang
fire has joined #ruby-lang
zomgbie has quit [Ping timeout: 255 seconds]
zomgbie has joined #ruby-lang
skade has joined #ruby-lang
alessio_rocco has quit [Ping timeout: 272 seconds]
alessio_rocco has joined #ruby-lang
mistym has joined #ruby-lang
chekcmate has joined #ruby-lang
<chekcmate>
hi guys
<judofyr>
hi!
cored has quit [Ping timeout: 248 seconds]
jerrytgarcia has joined #ruby-lang
iamjarvo has quit [Quit: Leaving.]
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
kgrz has joined #ruby-lang
wmoxam has joined #ruby-lang
mistym has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 248 seconds]
levifig has quit [Excess Flood]
levifig has joined #ruby-lang
zomgbie has quit [Quit: Lost terminal]
<chekcmate>
judofyr: how's it going?
<chekcmate>
you alright?
<judofyr>
yup, yup
alessio_rocco has quit [Ping timeout: 264 seconds]
<chekcmate>
:)
alessio_rocco has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
Swimming_Bird has quit [Max SendQ exceeded]
Swimming_Bird has joined #ruby-lang
dustint has joined #ruby-lang
<judofyr>
chekcmate: you?
<chekcmate>
judofyr: I'm fine, thanks - just found out the wonders of STDOUT.write + \r hehe
<judofyr>
chekcmate: :D
<chekcmate>
judofyr: what's your opinion on rubygems?
<chekcmate>
=> require 'rubygems' to be precise
<apeiros_>
chekcmate: should use $stdout, not STDOUT
<judofyr>
chekcmate: require 'rubygems' isn't needed in Ruby 1.9 :)
<apeiros_>
(yes, silly, but this is one of the rare cases where the global is to be preferred over the constant)
<chekcmate>
apeiros_: thanks for the hint!
<chekcmate>
judofyr: meh... I hope we finish migrating to 1.9 soon ._.
<chekcmate>
apeiros_: how come?
<apeiros_>
chekcmate: a) all Kernel methods use the globals, b) you can reassign to $std* and keep the STD* constants as a backup
<chekcmate>
apeiros_: I can understand b), but why is so positive about a)? could you point it out to me please?
<chekcmate>
*what
zomgbie has joined #ruby-lang
<whitequark>
chekcmate: std* are naturally globals
<whitequark>
there is one per process. this is the definition of a global (variable).
<whitequark>
the problem with using globals, usually, is that they needlessly restrict your code, more specifically the amount of instances of context corresponding to that code you may simultaneously have
<whitequark>
in this case, it's not an issue.
rsl has joined #ruby-lang
<apeiros_>
chekcmate: a) means you're consistent with how core/stdlib works if you use $std* vars
_protagoras271_ has quit [Remote host closed the connection]
<chekcmate>
hm alright
<chekcmate>
so $std* > STD* when it comes to this in ruby
sailias has joined #ruby-lang
levifig has quit [Excess Flood]
<judofyr>
chekcmate: basically $stdout is what puts and print uses by default
<zomgbie>
\q
<chekcmate>
so this is like going the "direct way"?
zomgbie has quit [Quit: leaving]
<judofyr>
chekcmate: STDOUT is *the* STDOUT (fd no. 1)
zomgbie has joined #ruby-lang
levifig has joined #ruby-lang
<judofyr>
chekcmate: so I can do `$stdout = StringIO.new` if I want to capture all stdout from an app
hasimo has joined #ruby-lang
kurko_ has joined #ruby-lang
kurko_ has quit [Max SendQ exceeded]
zomgbie has left #ruby-lang [#ruby-lang]
kurko_ has joined #ruby-lang
kurko_ has quit [Max SendQ exceeded]
kurko_ has joined #ruby-lang
sailias has quit [Ping timeout: 272 seconds]
kristofferrr has joined #ruby-lang
hasimo has quit [Ping timeout: 248 seconds]
breakingthings has joined #ruby-lang
sebasoga has quit [Quit: Computer has gone to sleep.]
mistym has joined #ruby-lang
sebasoga has joined #ruby-lang
noop has quit [Remote host closed the connection]
sailias has joined #ruby-lang
rue has joined #ruby-lang
MaddinXx has quit [Remote host closed the connection]
beho has quit [Read error: Operation timed out]
<chekcmate>
judofyr: ok, I got it now, thanks! :)
sebasoga has quit [Ping timeout: 252 seconds]
<eam>
injekt: thanks. I actually need compatibility with existing puppet templates so I'm stuck with erb
sebasoga has joined #ruby-lang
yfeldblum has joined #ruby-lang
sebasoga_ has joined #ruby-lang
dc5ala has joined #ruby-lang
alessio_rocco has quit [Ping timeout: 252 seconds]
fire has quit [Quit: WeeChat 0.4.0]
sebasoga has quit [Ping timeout: 256 seconds]
alessio_rocco has joined #ruby-lang
sebasoga_ has quit [Read error: Connection reset by peer]
xeronic has joined #ruby-lang
sebasoga has joined #ruby-lang
gustavnils has joined #ruby-lang
sebasoga has quit [Ping timeout: 248 seconds]
sduckett has joined #ruby-lang
sebasoga has joined #ruby-lang
sebasoga has quit [Client Quit]
mistym has quit [Remote host closed the connection]
sebasoga has joined #ruby-lang
sebasoga has quit [Read error: Connection reset by peer]
sebasoga has joined #ruby-lang
sebasoga has quit [Remote host closed the connection]
<yorickpeterse>
I while ago I bumped into this Gem that supposedly makes it easier to write Ruby wrappers around command line apps. Does anybody know what Gem this could be?
engel has quit [Read error: Connection reset by peer]
iamjarvo has joined #ruby-lang
chekcmate has quit [Quit: Page closed]
enebo has joined #ruby-lang
rue has quit [Remote host closed the connection]
kurko_ has quit [Ping timeout: 240 seconds]
kurko_ has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
sebasoga has joined #ruby-lang
S1kx has quit [Quit: Leaving]
__Big0__ has joined #ruby-lang
yalue has joined #ruby-lang
Criztian has quit [Remote host closed the connection]
krohrbaugh has quit [Read error: Connection reset by peer]
alessio_rocco has quit [Ping timeout: 255 seconds]
jerrytgarcia has quit [Read error: Connection reset by peer]
alessio_rocco has joined #ruby-lang
jerrytgarcia has joined #ruby-lang
<injekt>
yorickpeterse: enom?
<injekt>
ah maybe not
<yorickpeterse>
Eh no
<yorickpeterse>
Basically it was this Gem that made it less of a pain to deal with options of external commands and such
<injekt>
ah
<yorickpeterse>
So that you don't have to do shit like Open3.popen3('git', 'clone', '--foo=bar') ...
<yorickpeterse>
However, after searching for at least an hour I still can't find it
<apeiros_>
yorickpeterse: I think nowadays you just use Process.spawn, no?
<apeiros_>
but curious about that gem, i.e., how it makes it easier
zmack has quit [Remote host closed the connection]
<yorickpeterse>
not sure if it's worth using but I want to at least take a look at it
<yorickpeterse>
The alternative is that I instead write some Ruby code to create .deb files, which I can't be fucked doing
<yorickpeterse>
(right now I wrap around fpm)
gnufied has quit [Quit: Leaving.]
<yorickpeterse>
Fuck this, I'll just stick to open3
Criztian has joined #ruby-lang
sduckett has quit [Quit: leaving]
wallclockbuilder has quit [Read error: Connection reset by peer]
wallclockbuilder has joined #ruby-lang
mr_white_ has joined #ruby-lang
<yorickpeterse>
Also god damn it, every libarchive binding is pretty much dead
<apeiros_>
yorickpeterse: ping hanmac over in #ruby, he's working on one
<yorickpeterse>
I know, but the last release of said Gem was in 2011
<yorickpeterse>
and it doesn't support directories based on what I see in the commits
__Big0__ has quit [Remote host closed the connection]
__Big0__ has joined #ruby-lang
gnufied has joined #ruby-lang
<apeiros_>
yorickpeterse: as far as I know, he's working on it right now. might be he doesn't push his local work…
<judofyr>
whitequark: it is interesting though, how the Ruby community just doesn't believe in tools™
<cored>
judofyr: agree
<cored>
also there is another weird thing that I see
<whitequark>
judofyr: there is no point in using tools (like in Java-world) against a dynamically typed language
<yorickpeterse>
cored: define tools
<cored>
I've been working professionaly with Ruby for about 3 years now, I've watch a lot of talks about TDD good practice and stuffs
<cored>
but most of the people that I've work with are not following those practice
<judofyr>
whitequark: ehm. Smalltalk is a dynamically typed language, and tools help there :)
<whitequark>
judofyr: elaborate?
<cored>
I've even search github profiles for people like Jim Weirich to see how is he is building his Rails apps, which in my imho that framework is doing more damage than good in the long wrong
<judofyr>
whitequark: Smalltalk is basically one big tool (you can tweak your application as it's running)
<injekt>
smalltalk debugger <333
<cored>
yorickpeterse: I can compare things like Smalltalk dev env or .NET integration
<whitequark>
judofyr: as far as I know, they first created themselves a problem (non-human-readable serialization for software) then heroically solved it
<whitequark>
this is one valid approach indeed
<whitequark>
but it replaces the edit-save-run-checkin approach with the tools operating upon a smalltalk image
<judofyr>
cored: what's your background?
benlovell has quit [Quit: Computer has gone to sleep.]
<whitequark>
cored: `framework` isn't doing anything. a framework making things easy will attract unexperienced programmers, which, after some point, make the whole field look unprofessional
<whitequark>
not a single thing of what I've just described is inherently bad
<whitequark>
especially when the framework is well designed (doesn't have a multitude of obvious flaws which prevent it to be used for its most common application)
zmike has joined #ruby-lang
__Big0__ has quit [Remote host closed the connection]
srbaker has joined #ruby-lang
__Big0__ has joined #ruby-lang
<cored>
judofyr: what do you mean by that?
<cored>
whitequark: yes that's the pint
<judofyr>
pint? yes please!
<cored>
hehe
<cored>
s/pint/point
<judofyr>
cored: it seems to me that you're new to Ruby/Rails? I was just wondering what languages/frameworks you've been using earlier.
<whitequark>
cored: what's the point?
<cored>
whitequark: I just read Giles book regarding Rails and really I see most of this flaws myself
<whitequark>
cored: summarize? I didn't read it.
<cored>
whitequark: I don't think Rails is that well designed, if it's get in your way to build things, yes it's good for starting out but after 10 months what will happen with your mind
<cored>
judofyr: oh, Java/.NET
<cored>
whitequark: well basically, my point is that theory for ood is there already, but Ruby community seems to ignores it, just because of Rails
<cored>
I think Rails way of doing things is the one provoking this, because I can't see a lot of people trying to do the right things on their apps
<whitequark>
cored: I think we should begin with the fact that the model Java/.NET have by definition has not much to do with OO
alessio_rocco has quit [Ping timeout: 272 seconds]
<cored>
no no
<cored>
don't get me wrong
<cored>
you are right on that part
<cored>
you can build pretty awful stuffs in any env
alessio_rocco has joined #ruby-lang
<whitequark>
ok. so what do you mean by Ruby OOD? Clearly it couldn't share much with Java OOD.
<whitequark>
in particular, the thing DHH talks about is very very wrong in Java.
<cored>
in Java?
<cored>
well, in fact nop
<cored>
in Java you should be doing DI, also I think it's helps to do it in Ruby because you centrialize the creation of objects for your app
<whitequark>
in Java you can't avoid DI, of course
gnufied has quit [Quit: Leaving.]
<cored>
the part I said about .NET it's was because Rails do pretty good things to start out, but in the long run you end up with a bad application from the pov of maintainability
<whitequark>
the point is that DI is not a concept which stands on its own; it's a crutch designed to work around inflexibility of the language
<whitequark>
cored: oh, I have an article about that
<cored>
on the .NET front MS is doing an effort to teach the right way of doing things from the grown up
<cored>
not showing oyu how to do a 15 blog because in the end
<cored>
who is doing that?
<cored>
whitequark: please, do share
<whitequark>
cored: lemme find it
barttenbrinke has quit [Remote host closed the connection]
<whitequark>
in the meanwhile: "15 minute blog" is very important
carloslopes has quit [Remote host closed the connection]
<cored>
why ?
<whitequark>
your $software should be focused on achieving its goal, in this case building websites, not on some abstract OO concepts or whatever. You invoke the concepts because you need them; they're not a goal but a tool
<cored>
well
<cored>
in that matter
<whitequark>
"FrameworkX follows good object-oriented design and allows you to build websites." Bzzt. "FrameworkY lets you conveniently build websites (and also has good design)." Correct.
<cored>
if your final goal is giving value your application when you see it as a developer shouldn't be shouting 'Rails' all over the place
<cored>
because my business logic doesn't have anything to do with Rails
<cored>
there is a very good talk regarding this from uncle bob
<whitequark>
cored: separate your business logic into a service layer!
<whitequark>
that's indeed very good practice
<cored>
the thing is that I can't find his code or the way he do things with Rails
<cored>
yes but you have to do a lot of hacks to accomplish that
jonahR has quit [Quit: jonahR]
<whitequark>
and it's perfectly applicable to Rails apps; I use that, for example
<cored>
I'm going into another route this days
<whitequark>
cored: it depends. so far, I didn't really find it hacky.
<cored>
Sinatra throwing Json, ember.js frontend
<cored>
I'm hoping to get dm2 soon
<cored>
and that will be my utopic stack on Ruby
<whitequark>
dm2 is a thing to be desired
<whitequark>
I wait for it too
tdy_ has quit [Ping timeout: 252 seconds]
__Big0__ has quit [Remote host closed the connection]
<whitequark>
sinatra isn't exactly a jewel of design either
<cored>
but the thing is that I see that a lot of people is talking about problems like slow tests
<judofyr>
I've been waiting for 2 years or so :)
<cored>
but when they try to solve those problems they do hacks
Rarrikins_h has joined #ruby-lang
<whitequark>
cored: tests are slow because in essence, all rails tests are integration tests
<whitequark>
due to AR
kgrz has quit [Quit: Computer has gone to sleep.]
<cored>
whitequark: at least it's just a route engine it doesn't try to force things on me
<cored>
whitequark: yes
<cored>
whitequark: see the problem there
<whitequark>
I'd happily jump over from AR to something better; but there isn't
<cored>
that's really a shame and that's just drop down productivity
__Big0__ has joined #ruby-lang
<cored>
:-(
<yorickpeterse>
whitequark: Sequel
<whitequark>
I absolutely agree
<cored>
sorry guys
<whitequark>
yorickpeterse: ew
<cored>
I'm just suffering a lot
Rarrikins has quit [Ping timeout: 264 seconds]
<whitequark>
cored: I understand your pain
<yorickpeterse>
whitequark: ehm, wat? Sequel is pretty fucking awesome
<yorickpeterse>
I'd love for a bit more pedantic type system in Ruby
<yorickpeterse>
At least being able to say "Object X *requires* method Y" would be nice, without having to write shit like assert_responds_to(:fuckyou)
<whitequark>
yorickpeterse: read the paper about Typed Scheme. something like "gradual typing of scheme in presence of type annotations"
<whitequark>
it does what you want
<whitequark>
and yes, I can answer every question like that with "read paper X"
Stilo has joined #ruby-lang
<yorickpeterse>
hehe, I figured
beiter has quit [Quit: beiter]
<whitequark>
you're by far not the first one to think of that, or even to figure out some ways to do it
<yorickpeterse>
I never assumed that was the case
* whitequark
kinda did, a year ago. not explicitly, but well...
<yorickpeterse>
In fact, quite the opposite. I expected (and still do) people to point and laugh
<whitequark>
well, it turns out that no one has tried to do what I want to do with ruby
<whitequark>
but they did it with self
<whitequark>
and self ~ ruby
<whitequark>
and smalltalk = ruby :)
<whitequark>
research sponsored by sun microsystems, heh
mistym_meeting is now known as mistym
fragamus has joined #ruby-lang
barttenbrinke has joined #ruby-lang
rue has joined #ruby-lang
<whitequark>
yorickpeterse: also remember the Object::Object::Object weirdness?
sush24 has joined #ruby-lang
<whitequark>
turns out C++ has it too, which is hilarious for some reason
dc5ala has quit [Quit: Ex-Chat]
<yorickpeterse>
wat
<yorickpeterse>
(I knew about the first, not the latter)
<banisterfiend>
but an actual baked-in legend might be good
<banisterfiend>
"Hollow arrow-heads denote the ‘super class’ pointer and opaque arrow-heads denote the ‘class’ pointer. Blue ovals indicate regular classes and the grey their singleton classes."
<banisterfiend>
bbl naptime
<rue>
I thought that was a new C-family language
heftig has quit [Quit: Quitting]
<zzak_>
naplang
<whitequark>
napalm
<whitequark>
excellent self-descriptive name for a new C-family lang
<rue>
I thought like ->, -|>, o>, and so on
breakingthings has quit []
hasimo has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 252 seconds]
setmeaway has joined #ruby-lang
madish has quit [Quit: ChatZilla 0.9.90 [Firefox 16.0.1/20121026125834]]
<jpwhiting>
hey all, if I use gem fetch delayed_job --version '<3.0' it grabs the delayed-job 2.1.4 gem, but then the gem2deb of that .gem file doesn't contain a .gemspec file
ivanoats has quit [Remote host closed the connection]
pr0ton has joined #ruby-lang
neverminding_ has joined #ruby-lang
neverminding has quit [Read error: Connection reset by peer]
neverminding_ is now known as neverminding
Mon_Ouie has quit [Ping timeout: 248 seconds]
neverminding has quit [Read error: Connection reset by peer]
neverminding has joined #ruby-lang
carloslopes has joined #ruby-lang
wallclockbuilder has quit [Read error: Connection reset by peer]
wallclockbuilder has joined #ruby-lang
yalue has quit [Quit: Leaving]
carloslopes has quit [Remote host closed the connection]
wallclockbuilder has quit [Remote host closed the connection]
davidw has joined #ruby-lang
joevandyk has quit [Quit: joevandyk]
apeiros_ has joined #ruby-lang
<davidw>
I have two nokogiri nodes. How do I grab everything between them?
<davidw>
I'm grossed out by the idea of simply doing a string split, but it looks so much easier...
Nisstyre has quit [Quit: Leaving]
skade has quit [Ping timeout: 245 seconds]
davidbalbert is now known as davidbalber|away
<apeiros_>
davidw: traverse with a good old until loop
skade has joined #ruby-lang
postmodern has joined #ruby-lang
ivanoats has joined #ruby-lang
jhn has joined #ruby-lang
davidbalber|away is now known as davidbalbert
fragamus has joined #ruby-lang
yfeldblum has joined #ruby-lang
snarfmason has joined #ruby-lang
snarfmason has quit [Client Quit]
S1kx has joined #ruby-lang
<lectrick>
Is it even possible to design an ImmutableHash class?
jpwhiting has quit [Quit: Konversation terminated!]
QaDeS has joined #ruby-lang
<ryanf>
lectrick: why not?
kakobrekla has joined #ruby-lang
<lectrick>
ryanf: well, one potential problem is that if a variable which contains a hash is passed into a method, I don't think there's a way to, say, "autodup" the hash so that the reference to the hash's values in the previous context never changes, even if the method itself modifies the hash
sn0wb1rd has quit [Quit: sn0wb1rd]
<lectrick>
ryanf: I suppose I could key it based off some unique binding identifier
kakobrekla has left #ruby-lang [#ruby-lang]
<lectrick>
but that would slow things down quite a bit I would imagine
sush24 has quit [Ping timeout: 250 seconds]
<ryanf>
lectrick: well, a "hash" is really a mapping of references to key objects -> references to values
<lectrick>
actually, is there even a way to uniquely identify a context? binding.hash and binding.object_id constantly change
<ryanf>
you can make the references immutable by not giving the hash an api for mutating them
NemesisD has joined #ruby-lang
sn0wb1rd has joined #ruby-lang
<lectrick>
ryanf: so basically just disabling []= on the hash and any child hashes?
<ryanf>
lectrick: you'd probably want to just make a new container class from scratch, because hash has lots of destructive methods
<ryanf>
or check out Hamster, which comes with an immutable hash class
<lectrick>
ryanf: ah, you're right
<lectrick>
holy shit, TIL about hamster
sush24 has joined #ruby-lang
sush24 has quit [Client Quit]
djwonk has joined #ruby-lang
joevandyk has joined #ruby-lang
<lectrick>
"Hamster’s hash doesn’t provide an assignment (#[]=) method. The reason for this is simple yet irritating: Ruby assignment methods always return the assigned value, no matter what the method itself returns." Um, why couldn't he just modify []= to return self (or self copy) instead?
bluepojo has joined #ruby-lang
emocakes has joined #ruby-lang
<mistym>
lectrick: Return value of assignment methods is always the assigned value and can't be overridden even with an explicit return in the method body.
<lectrick>
mistym: wow. how did I not know this.
<lectrick>
that is... incorrect design lol
rippa has quit [Read error: Connection reset by peer]
<lectrick>
yup, i had to try it myself... ain't that a bitch
pr0ton has quit [Ping timeout: 264 seconds]
<lectrick>
it's a method, why wouldn't it just return what the method returns... I'm rather shocked
<mistym>
Assignment chaining would get weird if you could override that. a = b = 5, with a != b
<whitequark>
lectrick: because you can do all sorts of strange things
<whitequark>
especially with multiple assignment
<whitequark>
like (a[1], b) = *c
<lectrick>
is the advantage of that worth the cost? hrmm
<mistym>
What's the use case for return value being different from assignment value?
sockmonk has quit [Ping timeout: 245 seconds]
<breakingthings>
it would break lotsa stuff we sometimes take for granted.
<whitequark>
lectrick: chaining of assignments is commonplace
djwonk has quit []
<mistym>
breakingthings: Your name is appropriate
<whitequark>
breaking it would break a very common assumption
<lectrick>
your username is disturbingly relevant to that lol
<breakingthings>
Language constructs get special treatment
<breakingthings>
ye.
<breakingthings>
that's why i do.
<lectrick>
ok so I still don't see how it would break multiple assignment. in (a[1], b) = *c with a[1]= returning a instead of c.first, a[1] still gets modified just fine
<lectrick>
a = b = 5, b=5 returns b (which has value 5), so then a = b which means a = 5 too, again I don't follow
<lectrick>
mistym: ^
<lectrick>
Now, if we're talking *c = (a[5]=2, 6), then yes, that would break. But how often is *that* actually done?
<mistym>
lectrick: Ah, but say a = b['foo'] = 5 #=> a != 5; a == b
r0bgleeson has joined #ruby-lang
<mistym>
lectrick: Your example of a = b = 5 could fail if someone redefined #=
<r0bgleeson>
you can't redefine the assignment operator for lvars
<lectrick>
can you even redefine = ? I didn't think you could
<r0bgleeson>
you can define setters
<mistym>
Yeah, that was a bad example.
<mistym>
a = b.c = 5, rather than a = b = 5
<lectrick>
I guess what I'm saying is, it would be nice if modifying what []= returned was available to ruby devs.
<mistym>
I guess I feel like the lack of flexibility is made up for by the lack of flexibility
<lectrick>
Modifying '=' itself is a whole 'nother topic...
<mistym>
e.g. you can rely on what assignment does
<r0bgleeson>
setters always return their argument, no matter what you return
<mistym>
r0bgleeson: Right, the same with #[]= which we're talking about here
<r0bgleeson>
i see, okay
<lectrick>
mistym: yeah, I get it, in that later example (a = b.c = 5) but I feel like that's kind of code-smelly to begin with
<mistym>
lectrick: True, and it's a pretty contrived example. I guess the point I'm trying to make is that knowing what assignment will do is common enough that being able to rely on it outweighs the lack of flexibility
<lectrick>
Being able to override '=' would be interesting, you could basically have a variable that couldn't be reassigned or which could hook into its own reassignment
<lectrick>
"being able to rely on it" aka just knowing your classes? That seems like a rationalization.
sailias has quit [Ping timeout: 272 seconds]
<breakingthings>
lectrick: nobody likes an edge case
nXqd has joined #ruby-lang
<lectrick>
class MyHash< Hash; def []=(*args); super; self; end; end; mh=MyHash.new; mh[:key]='value' #=> "value". That's just wrong. I explicitly returned something else, I'm writing a method, it just happens to override a builtin.
rue has quit [Read error: Connection reset by peer]
jstemmer has quit [Remote host closed the connection]
neverminding has quit [Quit: neverminding]
<lectrick>
breakingthings: what do you think of ^ then?
<breakingthings>
lectrick: an interesting response, I'll give you that
<breakingthings>
but []= being a language construct that ruby is nice enough to give you access to, I find it to be a special little bastard.
<lectrick>
apparently it's a little too special
<breakingthings>
maybe.
<breakingthings>
but I think it's worth it to preserve consistency in what manifests itself as a language construct
<breakingthings>
though I suppose it could be possible that this is entirely a matter of implementation, that ruby is actually wrapping your []= call in it's own that ignores the return value.
<breakingthings>
possible that it's just never been thought of as being needed, but it's also possible that they are fully aware and ignore it for the consistency.
wmoxam has quit [Quit: leaving]
slyphon has quit [Quit: slyphon]
<lectrick>
wouldn't "preserving consistency" mean that me overriding []= returns what I told it to return, just like overriding + would? class MyHash<Hash; def +(o); self; end; end; mh=MyHash.new; mh + 5 #=> {:key=>"value"}
<lectrick>
breakingthings: ^
<breakingthings>
lectrick: not to an API user
<breakingthings>
[]= manifests itself as a language construct
<breakingthings>
you're not actually calling []= as a function directly
<breakingthings>
ruby is calling it for you in it's assignment process
<lectrick>
even if you override it?
<banisterfiend>
breakingthings: its*
<banisterfiend>
;)
<breakingthings>
banisterfiend: thanks.
<breakingthings>
too tired for grams.
<lectrick>
class MyHash< Hash; def []=(*args); 'Not calling super at all!'; end; end; mh=MyHash.new; mh[:key]='value' #=> "value"
<lectrick>
Hrmph. Even if you don't even call super, you still get the assigned value back. Even if it does nothing :/
<breakingthings>
Yeah.
<breakingthings>
It's a language construct so it places itself above your needs.
<breakingthings>
Not necessarily saying that's a good thing, or that it's the end-all-be-all,
<breakingthings>
but that's how it is and I think there is potentially good reasons for doing so.
<lectrick>
I know it's probably protocol and all, but as someone who just realized this for the first time, it looks a little ugly. Of course, that's just my opinion.
<breakingthings>
Oh no, it's ugly from an API designer's standpoint.
<breakingthings>
But it saves the utter confusion of someone running into language constructs acting awkwardly in edgecases
<lectrick>
isn't everything "awkward" until it's the "new norm"?
<breakingthings>
And sure, they would learn if they looked at that thing's API and saw what it was doing, but being a language construct it initially appears to ruby newbies as being above api override
<breakingthings>
Again, I'm not saying you don't have valid reasons.
cored has quit [Remote host closed the connection]
<lectrick>
:) Understood.
<breakingthings>
Just saying that I think these ones are important too.
ivanoats has quit [Remote host closed the connection]
carloslopes has joined #ruby-lang
carloslopes has quit [Remote host closed the connection]
__Big0__ has quit [Remote host closed the connection]
carloslopes has joined #ruby-lang
ddd has quit [Ping timeout: 245 seconds]
fn_ has quit [Ping timeout: 256 seconds]
ddd has joined #ruby-lang
carloslopes has quit [Ping timeout: 256 seconds]
ivanoats has joined #ruby-lang
joevandyk has quit [Quit: joevandyk]
ivanoats has quit [Read error: Connection reset by peer]
ivanoats has joined #ruby-lang
ivanoats has joined #ruby-lang
ivanoats has quit [Changing host]
ivanoats has quit [Read error: Connection reset by peer]
ivanoats has joined #ruby-lang
pr0ton has quit [Ping timeout: 248 seconds]
ivanoats has quit [Ping timeout: 260 seconds]
joevandyk has joined #ruby-lang
wyhaines_ has joined #ruby-lang
wyhaines has quit [Read error: No route to host]
Rarrikins has joined #ruby-lang
Rarrikins_h_f has quit [Ping timeout: 248 seconds]
ivanoats has joined #ruby-lang
neverminding has joined #ruby-lang
slyphon has joined #ruby-lang
ivanoats has quit [Ping timeout: 245 seconds]
torrieri has quit [Quit: Leaving...]
pr0ton has joined #ruby-lang
iamjarvo has quit [Quit: Leaving.]
forrest has quit [Quit: Leaving]
mixandgo has quit [Quit: mixandgo]
slyphon has quit [Ping timeout: 245 seconds]
jpwhiting has joined #ruby-lang
<jpwhiting>
hey all, having a bit of confusion here, I'm trying to run a ruby rails application, but when I run rake --trace db:setup or load the web ui it says delayed_job < 3.0 isn't available
<jpwhiting>
but gem list shows I have delayed_job 2.1.4
<jpwhiting>
any idea how I can track down why it can't see that gem?
<theoros>
why doesn't File.umask reflect the same file permissions created through %x[touch /tmp/foo], even though %x[umask;] matches bash shell `umask` output
mistym has quit [Remote host closed the connection]
torrieri has joined #ruby-lang
dustint has quit [Ping timeout: 276 seconds]
ivanoats has quit [Read error: Connection reset by peer]
ivanoats has joined #ruby-lang
ivanoats has joined #ruby-lang
ivanoats has quit [Changing host]
<theoros>
oh hm, no, sorry, the issue seems to be that File.open is not using File.umask
hasimo has joined #ruby-lang
Xzyx987X has quit [Ping timeout: 272 seconds]
ivanoats has quit [Read error: Connection reset by peer]
ivanoats has joined #ruby-lang
ivanoats has quit [Changing host]
ivanoats has joined #ruby-lang
ivanoats has quit [Ping timeout: 248 seconds]
Criztian has joined #ruby-lang
torrieri has quit [Ping timeout: 260 seconds]
Xzyx987X has joined #ruby-lang
maxmanders has quit [Quit: Computer has gone to sleep.]
mistym has joined #ruby-lang
Rarrikins has quit [Ping timeout: 260 seconds]
kith_ has joined #ruby-lang
kith has quit [Read error: Operation timed out]
Rarrikins has joined #ruby-lang
<theoros>
something even weirder, actually. umask in bash says files should come out as rwxr-xr-x but touch and redirection create them with rw-r--r-- so i guess my linux-fu is off
enebo has joined #ruby-lang
slyphon has joined #ruby-lang
davidw has quit [Ping timeout: 245 seconds]
vlad_starkov has joined #ruby-lang
anonymuse has quit [Quit: Leaving...]
<zenspider>
theoros: show some code
<zenspider>
umask in bash says files should come out as that IF they're created with 0777
pr0ton has quit [Quit: pr0ton]
<zenspider>
if you're creating them with 0755, that'll have a different outcome
hasimo has quit [Remote host closed the connection]
vlad_starkov has quit [Ping timeout: 264 seconds]
<theoros>
zenspider: i think i was forgetting that umask restricts, it doesn't grant. so umask of 0022 won't necessarily allow write permissions on files
gregmore_ has joined #ruby-lang
<theoros>
zenspider: and files are by default not executable, for security reasons
hasimo has joined #ruby-lang
yfeldblum has joined #ruby-lang
pr0ton has joined #ruby-lang
<theoros>
which sort of scuppers my plan of using 0777 & ~File.umask with File.open to get "proper" defaults
<zenspider>
correct
<theoros>
i don't want to mandate file permissions in my program though
Rarrikins has quit [Ping timeout: 260 seconds]
<theoros>
basically i'm using a Tempfile and i don't want g-rwx,o-rwx on it after i move it
<zenspider>
I'm guessing you're overthinking this
<zenspider>
the user sets their umask. you create a file. everyone is happy
<theoros>
file upload --> Tempfile --> move it somewhere --> want to fix the modes to act as if i'd touch'd
<theoros>
Tempfile comes out as 600 because it goes in /tmp, and 600 is for security
mercwith1mouth has joined #ruby-lang
<zenspider>
so chmod it after you move it
<theoros>
what value do i pick to pass to chmod without relying on ~File.umask?
<theoros>
or do i just also negate all executable and be done with it
<zenspider>
~File.umask is fine
<zenspider>
it is what you and it against that you need to think about
<zenspider>
whatever is appropriate for the file
Criztian has quit [Remote host closed the connection]
<theoros>
hm, well, i suppose so, although leaving them executable seems like a bad idea
<zenspider>
soooo. don't and it against the execute bits
<zenspider>
again... do what seems appropriate for the file, and then allow the user to mask out bits they don't want as well
<theoros>
well, yeah :)
<zenspider>
this isn't hard
<theoros>
it felt like there'd be a way to say "give me the same defaults as if the shell had created this file"
<theoros>
but the two issues of umask and what touch gives you are orthogonal
<zenspider>
no... they're not
<theoros>
okay not orthogonal, but
<zenspider>
touch will do 0666 & ~File.umask, which is an appropriate permission for a regular read/write file, masked against the user's desired umask
hasimo_ has joined #ruby-lang
<zenspider>
so in my case, with a umask of 0002 I get 0664
<theoros>
right, i get that
<theoros>
i guess what i'm trying to say is that i didn't quite realise touch masked against 0666 instead of 0777 :)
<zenspider>
why the fuck would it?
<zenspider>
that just doesn't even make sense
<theoros>
couldn't see the forest for the trees.
torrieri has joined #ruby-lang
<theoros>
i knew it, but not while i was thinking about File.umask and why values weren't matching touch && ls -la
methods has joined #ruby-lang
methods has left #ruby-lang [#ruby-lang]
kain_ has joined #ruby-lang
hasimo has quit [Ping timeout: 245 seconds]
<theoros>
clearly 0666 is a sane default, i'm not suggesting otherwise.
kain__ has joined #ruby-lang
kain has quit [Ping timeout: 252 seconds]
<zenspider>
0644 might be more sane. depends on the context
<theoros>
sure
charliesome has joined #ruby-lang
<theoros>
in this case, "sane" is "whatever touch or echo foo > bar would give"
apeiros_ has quit [Remote host closed the connection]