adeponte has quit [Remote host closed the connection]
<Spooner>
platzhirsch : No, you don't ned to do that, since rubygems will do it for you. You will need to start it manually (if testing) with: ruby -Ilib bin/command
emergion has quit [Ping timeout: 264 seconds]
jds has quit [Remote host closed the connection]
adeponte has joined #ruby
dankest has quit [Quit: Leaving...]
mjolk has quit [Quit: Leaving]
the_hack has joined #ruby
gyre007 has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
nari has quit [Ping timeout: 248 seconds]
tomzx has quit [Quit: tomzx]
viuo has quit [Ping timeout: 276 seconds]
S1kx has quit [Ping timeout: 240 seconds]
_carloslopes has joined #ruby
<platzhirsch>
Spooner: ah ok, so -l[library directory] ?
carloslopes has quit [Read error: Connection reset by peer]
fourq has quit [Ping timeout: 264 seconds]
<Spooner>
Not -l (lower L), -I (capital i).
LouisGB has quit [Ping timeout: 256 seconds]
<platzhirsch>
i for include
szck has quit [Quit: Leaving.]
<Spooner>
No idea.
<lupine>
protip for the year: don't have web services that receive yaml
matchaw_ has quit [Ping timeout: 260 seconds]
AxonetBE has left #ruby [#ruby]
viuo has joined #ruby
zastern has quit [Remote host closed the connection]
_carloslopes has quit [Remote host closed the connection]
Russell^^ has quit [Quit: Russell^^]
dougireton has quit [Quit: Leaving.]
x0F has quit [Read error: Connection reset by peer]
katherinem13 has quit [Remote host closed the connection]
gridaphobe has joined #ruby
c3vin has joined #ruby
katherinem13 has joined #ruby
daniel_- has joined #ruby
pyx has joined #ruby
mneorr has joined #ruby
mneorr has quit [Read error: Connection reset by peer]
mneorr has joined #ruby
pyx has quit [Client Quit]
Takehiro has joined #ruby
matchaw_ has joined #ruby
joofsh has quit [Remote host closed the connection]
jjang_ has joined #ruby
miphe has quit [Quit: Leaving]
gpato has joined #ruby
digitalsanctum has quit [Remote host closed the connection]
DrShoggoth has quit [Quit: Leaving]
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
freeayu__ has joined #ruby
jpfuentes2 has joined #ruby
carloslopes has joined #ruby
jjang has quit [Ping timeout: 276 seconds]
stunrr has joined #ruby
Maniacal has quit [Quit: Leaving]
stunrr has quit [Client Quit]
breakingthings has joined #ruby
szck1 has joined #ruby
horofox_ has joined #ruby
stim371 has quit [Quit: stim371]
brianpWins has quit [Quit: brianpWins]
pkrnj has joined #ruby
Takehiro has quit [Ping timeout: 248 seconds]
horofox has quit [Ping timeout: 244 seconds]
jromine has quit [Remote host closed the connection]
horofox_ is now known as horofox
emmanuelux has quit [Remote host closed the connection]
mercwithamouth has quit [Ping timeout: 246 seconds]
Nisstyre has quit [Ping timeout: 255 seconds]
flip_digits has joined #ruby
_46bit has joined #ruby
radic has quit [Quit: Verlassend]
jds has joined #ruby
slainer68 has quit [Remote host closed the connection]
S1kx has joined #ruby
slainer68 has joined #ruby
sealeaf has joined #ruby
<sealeaf>
how do you check if something is an instance of a class?
luckyruby has quit [Remote host closed the connection]
the_hack has quit [Quit: Computer has gone to sleep.]
radic has joined #ruby
slainer68 has quit [Remote host closed the connection]
tjbiddle_ has joined #ruby
jrist-doctor is now known as jrist
stkowski has quit [Quit: stkowski]
xnm has joined #ruby
baroquebobcat has quit [Ping timeout: 248 seconds]
<blazes816>
sealeaf: the_var.is_a?(String)
tjbiddle has quit [Ping timeout: 248 seconds]
<sealeaf>
blazes816: thanks
ossareh has joined #ruby
ajones has left #ruby [#ruby]
tjbiddle_ has quit [Ping timeout: 248 seconds]
_46bit has left #ruby [#ruby]
stkowski has joined #ruby
<RubNoob>
Gate have you seen a rails page not load a specific css file in some instances but not others?
Vert has joined #ruby
<RubNoob>
Gate I'm having an issue where sometimes when I click a link, it brings me to a page and the styling is correct (loads the css), but in other cases, the css page isn't loaded
dankest has joined #ruby
r3nrut has quit [Ping timeout: 256 seconds]
adkron has joined #ruby
main has quit [Ping timeout: 255 seconds]
havenn has quit [Read error: Connection reset by peer]
mercwithamouth has joined #ruby
nycjv321 has joined #ruby
<nycjv321>
" invalid byte sequence in UTF-8 (ArgumentError)" What does this mean? trynig to make a simple regex in Ruby
woolite64 has quit []
jds has quit [Ping timeout: 256 seconds]
<nycjv321>
hmmm im doing something wrong
Takehiro has joined #ruby
ryanf has quit [Ping timeout: 276 seconds]
yshh has joined #ruby
karasawa has joined #ruby
hotovson has quit [Remote host closed the connection]
blazes816 has quit [Quit: blazes816]
<Gate>
RubNoob: have you looked in your log to see if there is a corresponding error when it is missing?
slonimsky_1234 has joined #ruby
Goles has joined #ruby
IrishGringo has joined #ruby
<RubNoob>
Gate yes, actually, there are no errors on the server side, but the browser is reporting a 500 error when attempting to get stylsheets from the server
<RubNoob>
@Gate and it's not consistent, sometimes its one stylesheet, other times its a different one and the first one loaded just fine
<RubNoob>
Gate it is very confusing
dr_neek has joined #ruby
Goles has quit [Client Quit]
<Gate>
RubNoob: I presume you are on a recent version of rails? (3.*)
`brendan has joined #ruby
<RubNoob>
Gate yes, 3.2.8
Takehiro has quit [Ping timeout: 246 seconds]
<Gate>
RubNoob: same version I was on a few weeks ago :)
<RubNoob>
oh, should I update?
rismoney has quit [Ping timeout: 244 seconds]
<Gate>
RubNoob: definitely, there have been several major security fixes. However it probably won't solve your current problem.
<RubNoob>
Gate yea, I can't see how it would given I can't find anything specific to this error in this release
<Gate>
RubNoob: well, the problem your having is in a big moving part that I don't believe has been updated recently called the Asset Pipeline (forgive me if you know this already)
<RubNoob>
Gate yea, so I know of the asset pipeline, but not enough to know whether there is a specific issue with this
d2dchat has joined #ruby
<Gate>
There are things that I can imagine causing your problem, but I'm baffled by the fact that they are intermittent
slonimsky_1234 has left #ruby [#ruby]
slonimsky_1234 has joined #ruby
<Gate>
RubNoob: I would track down your apache logs (or whatever server you are seeing) and see if you can find out more information about the 500
<RubNoob>
Gate ok, thanks for the info
<Gate>
RubNoob: GL, I'll be away for a while, but I'll check back here later tonight.
ryanf has joined #ruby
sepp2k has quit [Remote host closed the connection]
freakazoid0223 has quit [Quit: Leaving]
<RubNoob>
Gate it actually happens on a page refresh
<RubNoob>
strange
AndIrc_65 has quit [Read error: Connection reset by peer]
taoru has joined #ruby
slonimsky_1234 has quit [Quit: slonimsky_1234]
naquad has quit [Ping timeout: 260 seconds]
<nycjv321>
why would I get this error when trying to do a regex in ruby? in `=~': invalid byte sequence in UTF-8 (ArgumentError) against a line in a block?
slainer68 has joined #ruby
<nycjv321>
im looping over an input file with each line as "line"
baroquebobcat has joined #ruby
<nycjv321>
I think Iknow why
tomzx has joined #ruby
<Spooner>
nycjv321 : Because you are using an invalid byte sequence in the string. We'd have to see the regexp to know exactly what is causing the pain.
IcyDragon has joined #ruby
<nycjv321>
The regex is "/.*/i" I think I know why. Line one has this "??+"
IceDragon has quit [Ping timeout: 248 seconds]
mmitchell has joined #ruby
<nycjv321>
what solves this is setting the position past the first four bytes. But the question is... is this normal?
carloslopes has quit [Remote host closed the connection]
<Spooner>
nycjv321: I'm guessing those aren't question marks, but just displayed as such.
<Spooner>
"??+".force_encoding("UTF-8") =~ /.*/i is fine.
<nycjv321>
spooner 'zacky
<nycjv321>
ah force_encoding is a good idea!
<Quadlex>
Time to buy a new laptop bag
miskander has joined #ruby
<Quadlex>
Ouch... Mission Workshop bags are gorgeous but pricy
slainer68 has quit [Ping timeout: 246 seconds]
marr has quit [Ping timeout: 246 seconds]
tomzx has quit [Quit: tomzx]
mengu has quit [Quit: Leaving]
dmerrick has quit [Quit: dmerrick]
<Spooner>
nycjv321 : Forcing it to ASCII might help. No idea.
naquad has joined #ruby
neurotech has joined #ruby
fyolnish has joined #ruby
<shevy2>
the joy of encoding - welcome to ruby 1.9
johnmilton has quit [Remote host closed the connection]
ryanh has quit [Quit: Computer has gone to sleep.]
speakingcode has quit [Disconnected by services]
wroathe has quit [Ping timeout: 252 seconds]
zeade has quit [Quit: Leaving.]
Xeago has quit [Remote host closed the connection]
<nfk>
shevy2, we were dissing ruby 1.9 for that in an unrelated channel just 5 hours ago
<nfk>
also, did you know that rails acts in really weird ways if one of the parent folders (not part of the rails project) contains UTF-8 characters?
<nfk>
i learned it the hard way
szck1 has quit [Quit: Leaving.]
baroquebobcat has quit [Quit: baroquebobcat]
TomyLobo has quit [Read error: Operation timed out]
banisterfiend is now known as banister`sleep
gridaphobe has quit [Ping timeout: 276 seconds]
hybris has joined #ruby
MissionCritical has quit [Read error: Connection reset by peer]
mrsolo has quit [Quit: Leaving]
nfk has quit [Quit: yawn]
timbobot112233 has joined #ruby
Spooner has quit []
stkowski has quit [Quit: stkowski]
lolcathost has quit [Ping timeout: 260 seconds]
lolcathost has joined #ruby
timbobot112233 has quit [Remote host closed the connection]
timbobot112233 has joined #ruby
slonimsky has joined #ruby
<nycjv321>
if my pattern is something like /Track Number/ and my input string is something like blahblahblah Track Number abasdhahsdhlasd any reason why it wouldn't find any matches?
timbobot112233 has quit [Remote host closed the connection]
timbobot112233 has joined #ruby
freeayu has quit [Read error: Connection reset by peer]
doug has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
<doug>
gotta two dimensional array, would like to find the shortest (textually) way to iterate over it. the loop innards has to have the current indices as well as the current value within the array...
<doug>
ary.each_with_index {...each_with_index { ... } } being one way
<doug>
was hoping there was something that didn't look like two loops
SCommette has joined #ruby
timbobot112233 has quit [Remote host closed the connection]
x82_nicole has joined #ruby
timbobot112233 has joined #ruby
timbobot112233 has quit [Remote host closed the connection]
timbobot112233 has joined #ruby
timbobot112233 has quit [Remote host closed the connection]
flaccid has joined #ruby
<flaccid>
hey guys in ruby how do i get the home directory of a specific user?
ephemerian has quit [Quit: Leaving.]
woolite64 has joined #ruby
Sgeo_ has joined #ruby
TomyLobo has joined #ruby
<nycjv321>
flaccid: get output of pwd?
<flaccid>
nycjv321: its not for the current user
<nycjv321>
flaccid: ah for a specific user
platzhirsch has quit [Read error: Connection reset by peer]
MissionCritical has joined #ruby
beilabs has quit [Disconnected by services]
beilabs_ has joined #ruby
timbobot112233 has joined #ruby
sealeaf has left #ruby [#ruby]
timbobot112233 has quit [Remote host closed the connection]
brandon_ has joined #ruby
timbobot112233 has joined #ruby
timbobot112233 has quit [Remote host closed the connection]
<flaccid>
i'm not sure if Dir.home is in ruby 1.8
timbobot112233 has joined #ruby
timbobot112233 has quit [Remote host closed the connection]
* Kovensky
is pretty sure one should just use 1.9
<flaccid>
not in my control
<Kovensky>
rbenv? :>
elaptics`away has quit [Ping timeout: 260 seconds]
<flaccid>
not in my control
timbobot112233 has joined #ruby
timbobot112233 has quit [Remote host closed the connection]
<postmodern>
flaccid, Gem.user_home
tcurdt has joined #ruby
<flaccid>
postmodern: thanks. how do i do that for a given user ?
Pip has quit [Ping timeout: 248 seconds]
timbobot112233 has joined #ruby
<flaccid>
postmodern: it does not take any arguments
timbobot112233 has quit [Remote host closed the connection]
pvh___ has quit [Quit: Connection closed for inactivity]
icole has quit [Remote host closed the connection]
slonimsky has quit [Quit: slonimsky]
<flaccid>
this is a pretty weird limitation of ruby it seems
timbobot112233 has joined #ruby
pcarrier has quit []
tcurdt has quit [Client Quit]
ttt has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
slonimsky has joined #ruby
jonahR has joined #ruby
daniel_- has quit [Quit: WeeChat 0.3.9.2]
<postmodern>
flaccid, ah no idea
<postmodern>
flaccid, ruby has an Etc library in stdlib
taoru_ has joined #ruby
freeayu has joined #ruby
szck has joined #ruby
jduan1981 has quit [Ping timeout: 265 seconds]
joeycarmello has quit [Remote host closed the connection]
freeayu has quit [Remote host closed the connection]
nari has joined #ruby
doug has left #ruby [#ruby]
timbobot112233 has quit [Remote host closed the connection]
timbobot112233 has joined #ruby
<nycjv321>
anyone familiar with regex?
<flaccid>
its going to be easiest to do `echo ~#{node['backup']['backup_user']}`.strip
timbobot112233 has quit [Remote host closed the connection]
<nycjv321>
I thought I was but apparently I don't know how to use them in Ruby can I pastebin some code and someone take a look why its not matching anything in my input text?
taoru has quit [Ping timeout: 244 seconds]
pencilcheck has quit [Remote host closed the connection]
mmitchell has quit [Remote host closed the connection]
<SEToChan>
but i aslo need somehow select count without limits
<SEToChan>
and i'm very new in ruby and rails (
medik has quit [Quit: medik]
<breakingthings>
#ruby pls, what's the prettiest way to make a ? method
<breakingthings>
that just involves, say a single conditional.
<ebobby>
def equals? (x); self == x; end
<breakingthings>
:d
jbw has joined #ruby
<breakingthings>
nice and all, but I'm afraid I was looking for an arbitrary argument, not a comparison to the object
<breakingthings>
say… if thing.coolness > 50
<ebobby>
i just gave you an example, im pretty sure you can work your way up from there, or it may be that I understood your question incorrectly
lolcathost has quit [Ping timeout: 248 seconds]
DrShoggoth has joined #ruby
cisco has joined #ruby
karasawa has quit [Ping timeout: 240 seconds]
rezzack has quit [Quit: Leaving.]
<breakingthings>
ebobby: I am wondering if there's a better way than if (condition) { true }; false
lolcathost has joined #ruby
<jpfuentes2>
do you mean using the ternary operator ?
<jpfuentes2>
value = thing.coolness > 50 ? :this_value_if_true : "this_value_if_false"
<ebobby>
the condition returns its value itself
<breakingthings>
right
<ebobby>
if it is a ? method then you mean a predicate, then oyu mean you return true or false
<breakingthings>
that's what I was looking for
<breakingthings>
thanks
<breakingthings>
I just felt like I was being stupid and I was
<ebobby>
we all are
<ebobby>
at some point or another
kumarat9pm has joined #ruby
<nycjv321>
is it possible to seek a file based on line instead of byte?
SCommette has joined #ruby
<ebobby>
nycjv321: although I am not sure if you can do that or not, why don't you simply read the file into an array and use the index for whatever you need?
Myconix has quit [Read error: Connection reset by peer]
<nycjv321>
I'm trying to make a parser
<ebobby>
although there are some disadvantages to what I am proposing of course.
<nycjv321>
so for example line 3 may be the beginning of an object definition but lines 4, 5, 6 may contain attributes
gyre007 has quit [Remote host closed the connection]
<jpfuentes2>
what are you parsing?
<jpfuentes2>
ruby code ?
<nycjv321>
jpfuentes2 : output of another app which is poorly formated
<nycjv321>
object and attributes are my way of describing parts of the output. Okay what i am trying to do is make a parse for the output of MKVInfo
LennyLinux has quit [Remote host closed the connection]
niklasb has quit [Ping timeout: 265 seconds]
<nycjv321>
ultimately I want to generate output for needed syntax to extract files from cli instead of having to read the man page I want my app to say "To extract audio and vidio use this command 'blah'
<nycjv321>
also I want to organize the files into objects/attributes for learning purposes e.g. output to xml, json just for fun
<rubyasker>
is there any syntax to do that in one line?
GoGoGarrett has quit [Remote host closed the connection]
<yfeldblum>
flyinprogramer, probably, mongoid checks whether the hash key is a special object that Symbol#gte returns, and then reconstructs a new Hash with a value of {"$gte" => value}
<rubyasker>
I know it doesn't work but... something like: {bar: my_hash.map {|id, value| value[:foo]}}
pkrnj has joined #ruby
<aquagrunty>
ryanf: yeah you can
dangsos has quit [Quit: Lost terminal]
<aquagrunty>
but it's not NEARLY as elegant
<rubyasker>
aquagrunty, how?
<aquagrunty>
overriding .__getattr__
<aquagrunty>
ugh
<rubyasker>
yeah... ugh!
<aquagrunty>
like you can make a hash of all the attributes you want to override and make them () a function
wiiw is now known as iGoog
<aquagrunty>
so it's not horrible
<aquagrunty>
but i like def i_used_to_be_an_attribute
<aquagrunty>
better
brandon|work has quit [Ping timeout: 246 seconds]
iGoog has left #ruby [#ruby]
<rubyasker>
I can write a function too and hide all the code, yes
<rubyasker>
but I didn't want :P
<aquagrunty>
rubyasker: thats fine
<aquagrunty>
my current business needs require unlimited abstraction
<aquagrunty>
i work for an airline, i'm trying to start a new underlying framework for the whole thing
<aquagrunty>
because my god our systems suck
<rubyasker>
lol
<aquagrunty>
i was lamenting here yesterday
<rubyasker>
require './app.rb' \n do_it_all true
<rubyasker>
the ultimate abstraction
<aquagrunty>
about how the entire loyalty database written using transact SQL statements only
<aquagrunty>
imagine that
<aquagrunty>
an entire application
<aquagrunty>
built using SQL statements
yfeldblum has quit [Ping timeout: 248 seconds]
<rubyasker>
is that the case in the system the airline is using?
<aquagrunty>
yeah
<rubyasker>
ohh
<huoxito>
odd question, is there a way to know if a class calls a method? without setting new attributes in this method or doing some other hacky stuff
<aquagrunty>
what do you mean? class calls a method?
<huoxito>
like
<aquagrunty>
set an attribute in the function @trigger = true and then test for that using another public method?
<huoxito>
class Test; def hey; end; end;
<huoxito>
class Test; hey; end;
<aquagrunty>
how to tell if what you're calling is an attribute or a method?
<huoxito>
There's no way to know if the class Test calls the class method 'hey'
<huoxito>
sorry
<huoxito>
class Test; def self.hey; end; end;
<huoxito>
yes that's another good question, it's just not possible
<aquagrunty>
are talking about breaking encapsulation?
<huoxito>
I'll give the force_ssl method example in Rails
<huoxito>
Is there a way to check in a test if a given class call that class method
<huoxito>
?
kenneth has joined #ruby
<rubyasker>
I would say you can compare the functions
<aquagrunty>
using a class variable and setting that variable to true when you hit the method?
<rubyasker>
but I didn't try it
<rubyasker>
like in: hey == Foo::hey
cheese1756 has quit [Ping timeout: 252 seconds]
dwu1 has joined #ruby
<huoxito>
aquagrunty, but then I'd have to change the method implementation
<aquagrunty>
can't you override and call the super class or something?
Takehiro has joined #ruby
<huoxito>
sure I can override
<aquagrunty>
sorry i'm a bit new to the language, still building my first major app
<huoxito>
but I didn't want to
<aquagrunty>
coming from python
kenneth has quit [Client Quit]
nonmadden has quit [Ping timeout: 260 seconds]
<huoxito>
Same here almost
<huoxito>
1 year of ruby
<aquagrunty>
uh
<aquagrunty>
2 weeks
<shevy2>
huoxito cool
icole has joined #ruby
mercwithamouth has quit [Ping timeout: 244 seconds]
<aquagrunty>
i love the onion layering effect of ruby
<shevy2>
huoxito hmm perhaps via caller() ? you could look at the call trace
<aquagrunty>
i can override whatever the hell i want >:3
<shevy2>
aquagrunty, yeah but there is no simple way to restore to the earlier code :(
<shevy2>
lemme change nick quickly
shevy2 is now known as shevy
<aquagrunty>
aw
<shevy>
aaah better
<aquagrunty>
bw use a DVCS if you don't already
<aquagrunty>
like hg
<aquagrunty>
(mercurial)
<aquagrunty>
it has saved my ass so many times
<aquagrunty>
being able to rollback to old versions of software
<aquagrunty>
without fucking everything up
<rubyasker>
can you pass functions as parameters or manipulate them without executing the code?
<aquagrunty>
?
<rubyasker>
I know it can be done for lambdas, but what about class methods?
<rubyasker>
def test(val); val+1; end; def foo(bar); bar.call 123; end
<aquagrunty>
do class methods exist outside of their scope?
<rubyasker>
how you call foo using test?
<aquagrunty>
modules are like classes from what i understand, but for functional "defs"
<shevy>
rubyasker what
<shevy>
dont you have a pastie please
<shevy>
aha
maletor has quit [Quit: Computer has gone to sleep.]
<shevy>
rubyasker, you can pass a proc into a method as argument
yfeldblum has joined #ruby
<shevy>
I think it is via &name_here
<rubyasker>
let me show you in JS: function test(val) {return val+1} function foo(bar) {return bar.call(123)}
<rubyasker>
foo(test) -> 124
<rubyasker>
(not tested code ^ :P)
<shevy>
so test() increments by one
chriskk has quit [Quit: chriskk]
<shevy>
and foo... can't you call test() inside directly? anyway, I think you want a proc there, for bar
<shevy>
I think the syntax would be foo(&bar)... hmm lemme look up...
<aquagrunty>
i think what you're looking for are pointers
<aquagrunty>
and yes, & sounds like it
<rubyasker>
not necessarily.. you don't need pointers in JS ;)
<aquagrunty>
idk though i haven't needed to use a pointer yet
<aquagrunty>
year rubyasker because in js
<aquagrunty>
objects are not called unless you explicitly define ()
<aquagrunty>
so you can pass dead objects around, essentially
<rubyasker>
yep, that's the reason it doesn't work as in JS unless you do something else
<rubyasker>
like adding & or whatever it needs
<aquagrunty>
C is the same way
<aquagrunty>
i think
<aquagrunty>
except they have ** and *
cheese1756 has joined #ruby
<shevy>
hmm I cant find the proper syntax
<rubyasker>
it can be done with lambdas
rippa has joined #ruby
<rubyasker>
but the challenge was to use any "normal" function
<aquagrunty>
i'm so glad i never need to touch C again :D
<aquagrunty>
the code behind ruby is quite elegant itself though
<rubyasker>
> str = "abcabcabc"; regexp = /bc/; s=-2; while ((s = (str[s..-1] =~ regexp || str.length)+s+3) < str.length) do puts s; end
<rubyasker>
1
<rubyasker>
4
<rubyasker>
7
anannie has quit [Ping timeout: 246 seconds]
<rubyasker>
shevy, don't try this at home lol
<rubyasker>
you don't even need to set s=-2 at the beginning: while ((s = (str[(s || -2)..-1] =~ regexp || str.length)+(s||-2)+3) < str.length) do puts s; end
opettaja has joined #ruby
rippa has quit [Ping timeout: 240 seconds]
<shevy>
cool
<shevy>
I suppose there is no way via one regex alone or?
<rubyasker>
(it is just for fun, DON'T use it)
<rubyasker>
I don't think so
h4mz1d has joined #ruby
Hanmac has joined #ruby
<rubyasker>
you mean without iterating?
generalissimo has quit [Remote host closed the connection]
pnkbst has joined #ruby
tagrudev has joined #ruby
hackerdude has quit [Remote host closed the connection]
mockra has quit [Remote host closed the connection]
gardnan has joined #ruby
mockra has joined #ruby
headius has joined #ruby
FroMaster has joined #ruby
<Hanmac>
rubyasker can you repeat the question? i missed it
<rubyasker>
what question?
<rubyasker>
shevy's question?
baroquebobcat has quit [Quit: baroquebobcat]
<Hanmac>
yeah i missed it because of my late login
<rubyasker>
> p = -2; "abcaaaabcabc".scan(/(.*?)bc/).map {|preffix| p += preffix.length + 2}
<rubyasker>
=> [1, 4, 7]
<rubyasker>
shevy, there you have a better approach
<FroMaster>
I just setup a ubuntu/ruby development environment and want to use the rails-prelaunch-signup app tutorial but use a prexisting git repository that my partner started working on. How do i git the existing repo? (i'm new to git/ruby but not to web development so confused on where to start)
<Hanmac>
FroMaster: git clone repositoryadress [dirname] where dirname is optional
mmokrysz has joined #ruby
fred909 has quit [Read error: Operation timed out]
<rubyasker>
err, wait. you need a .flatten before .map: p = -2; "abcaaabcabc".scan(/(.*?)bc/).flatten.map {|preffix| p += preffix.length+2} => [1, 6, 9]
mmokrysz has left #ruby [#ruby]
<rubyasker>
:)
<rubyasker>
Hanmac, the idea was to return all the beginning positions of the substring "bc" in "abcaaaabcabc"
<rubyasker>
do you know any method to do so easily?
gavinhughes has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<fuzai>
http://pastie.org/5653239 if message.content looks like "/userids 1" how could I extract that number into a variable?
toekutr has quit [Read error: Connection reset by peer]
serhart has quit [Quit: Leaving.]
nomenkun has joined #ruby
mneorr has quit [Remote host closed the connection]
Spami has quit [Quit: Leaving]
distax has left #ruby ["Leaving"]
gyre007 has joined #ruby
Elhu has joined #ruby
<ddd>
(message.content.split(' ', 2))[1]
<ddd>
don't need the , 2
stan has joined #ruby
gyre007 has quit [Ping timeout: 264 seconds]
samuel02 has joined #ruby
<fuzai>
I just figured it out with message.content.include
<fuzai>
thank you
<fuzai>
:)
<ddd>
np
stetho has joined #ruby
whowantstolivefo has quit [Ping timeout: 248 seconds]
<fuzai>
is there a simple way to put a command on a timer that doesn't block the code?
<xybre>
Okay I know I'm missing something obvious here, but I'm basically just trying to convert a large number into a base64 string.
<xybre>
I can do number.to_s(32) to get it in base 32, and I can call Base64.encode64 on a string to convert its bytes to base 64, but nothing that bridges that gap.
<ddd>
Like Base64.encode(ver_with_large_num.to_s) like that
<ddd>
?
<ddd>
nm
jochu has joined #ruby
<xybre>
That will encode the string representation of the integer, not the bits.
<xybre>
And by "string" I really just mean "text".
main has joined #ruby
<xybre>
If I could convert an integer to a bit string, I could base64 encode it.
jochu has left #ruby ["Leaving"]
jimeh has joined #ruby
chriskk has joined #ruby
TheFuzzball has joined #ruby
nicobrevin1 has joined #ruby
jds has quit [Remote host closed the connection]
koderde has quit [Quit: Leaving]
krz has joined #ruby
buibex has joined #ruby
tomzx has joined #ruby
<shevy>
guys
<shevy>
is it possible to use ruby webrick to serve ruby .cgi pages?
zarubin has quit [Ping timeout: 264 seconds]
TheFuzzball has quit [Quit: Computer has gone to sleep.]
<Mon_Ouie>
snake_case for variable and method names, CamelCase for constants (including class and method names). Some people prefer SHOUTING_CASE for constants that aren't class names.
<ddd>
Ruby enforces some naming conventions. If an identifier starts with a capital letter, it is a constant. If it starts with a dollar sign ($), it is a global variable. If it starts with @, it is an instance variable. If it starts with @@, it is a class variable. Method names, however, are allowed to start with capital letters. This can lead to confusion.
gyre008 has quit [Remote host closed the connection]
workmad3 has joined #ruby
buscon has joined #ruby
<topriddy>
thanks. succint
<topriddy>
only Class Names take the camel notation
<topriddy>
ddd: enforces is going too far. i doubt it does
<heftig>
topriddy: it does.
<topriddy>
well the first part isn't true. "If an identifier starts with a capital letter"
<heftig>
it's true.
<topriddy>
wow!!
<topriddy>
so i can't do AGE = 10 and later do AGE = 50
<heftig>
you can reassign constants, but you get a warning
<ddd>
topriddy: try using @Variable and see what ruby does. Try using using $ as anything but a global. yes. it does enforce its rules
<topriddy>
heftig: seen. not principle of least surprise coming from another language. thanks for pointing that out. thanks ddd
Xabarus has joined #ruby
dr_bob1 has joined #ruby
jimeh_ has joined #ruby
taoru_ has joined #ruby
slainer6_ has joined #ruby
dr_neek_ has joined #ruby
Morkel_ has joined #ruby
kevinykchan has quit [Remote host closed the connection]
<topriddy>
i'm in chapter two of Little book of Ruby, and they haven't point it out yet explicitly. I finished some short interactive learn ruby tutorial. No explicit mention too!
io_syl has quit [Quit: Computer has gone to sleep.]
<Spooner>
topriddy, If nothing surprised you coming from another language, you might as well stay in the other language :)
<topriddy>
loool
taoru_ has quit [Remote host closed the connection]
<topriddy>
O_O
matchaw__ has joined #ruby
* topriddy
whispers i didn't coin that term
piotr__ has joined #ruby
* topriddy
back to reading…boss mustn't catch me reading ruby @ work in any case. Java Shop
<Spooner>
Meaning that if it is the same, then there is no reason to move (not that you should go away :D).
<xybre>
Ruby isn't based on Java.
<workmad3>
topriddy: you could claim you're doing jruby ;)
<blaxter>
thanks lord
<xybre>
Ruby has other languages where sigils do mean something specific.
eka_ has joined #ruby
rdark has joined #ruby
<topriddy>
i know…its influenced by perl
wmoxam_ has joined #ruby
<workmad3>
perl and smalltalk
<xybre>
Uhm, kinda, but its really smalltalk.
dwu2 has joined #ruby
<topriddy>
is the phrase - Ruby is a dynamic language correct?
<workmad3>
topriddy: yes
taoru_ has joined #ruby
<topriddy>
or the classification of : Dynamic Languages => Python, Ruby,
My_Hearing has joined #ruby
<xybre>
It's freakishly dynamic.
My_Hearing has quit [Changing host]
My_Hearing has joined #ruby
digifiv5e_ has joined #ruby
<ddd>
topriddy: btw, a shitload of good links for ruby. http://iwanttolearnruby.com/ :-) regardless of skill level, you'll find something there to entertain and educate
<workmad3>
xybre: there's a lot of perl philosophy in ruby, IMO, even if there isn't a large amount of perl syntax crossover :)
<hoelzro>
do_this if that
<hoelzro>
that's perlish
<topriddy>
ddd: i just need to dig in some basics, then move to rails to properly appreciate it more. might use ruby for mainly OS admin tasks, scripting, and prototype and fun web apps initially
<hoelzro>
not to mention the regex syntax, and regexes being 1st class citizens
<workmad3>
topriddy: well, python and ruby aren't the only dynamic languages ;)
<hoelzro>
and $!
<ddd>
rails has nothing to do with 'appreciating' ruby
<workmad3>
topriddy: but yes, in the static/dynamic typing axis of comparison, ruby is definitely on the dynamic side
<topriddy>
ddd: i'm not going to be doing desktop apps in ruby
<xybre>
Rails is just a framework. I had to explain this to a friend of mine, he kept saying "I know Rails isn't Ruby"
<hoelzro>
althought $" in Ruby and Perl have very different meanings
<ddd>
rails is just an framework written in ruby, used on top of ruby to create web applications. there's whole worlds out there that you can build and never once touch rails
<topriddy>
so using the web app framework, rails, would allow me point to something i did in ruby vis a vis rails
<topriddy>
ddd: or would you suggest a cool work to do ?
<workmad3>
hoelzro: ok, I'm now schooled, there are more explicit perlisms is the syntax than I thought ;)
<ddd>
shoes, green shoes, (couple others that integrate with Qt, but I don't remember the names)
<workmad3>
hoelzro: but I know that my perl is quite basic, so not that surprising I didn't spot much
<hoelzro>
workmad3: I think it takes a Perl coder like myself to see it all ;)
reactormonk has quit [*.net *.split]
jimeh has quit [*.net *.split]
slainer68 has quit [*.net *.split]
piotr_ has quit [*.net *.split]
Morkel has quit [*.net *.split]
taoru has quit [*.net *.split]
Mon_Ouie has quit [*.net *.split]
dr_bob has quit [*.net *.split]
tagrudev has quit [*.net *.split]
Nisstyre has quit [*.net *.split]
dwu1 has quit [*.net *.split]
yfeldblum has quit [*.net *.split]
Liothen has quit [*.net *.split]
_hemanth_ has quit [*.net *.split]
roadt has quit [*.net *.split]
DrShoggoth has quit [*.net *.split]
tchebb has quit [*.net *.split]
jbw has quit [*.net *.split]
woolite64 has quit [*.net *.split]
dr_neek has quit [*.net *.split]
matchaw_ has quit [*.net *.split]
TomRone has quit [*.net *.split]
wmoxam has quit [*.net *.split]
icco has quit [*.net *.split]
moted has quit [*.net *.split]
digifiv5e has quit [*.net *.split]
Zolrath has quit [*.net *.split]
eka has quit [*.net *.split]
bjeanes has quit [*.net *.split]
fumbe has quit [*.net *.split]
eka_ is now known as eka
Morkel_ is now known as Morkel
jimeh_ is now known as jimeh
dr_neek_ is now known as dr_neek
jds has joined #ruby
<xybre>
I think Ruby pulls a lot of the good things from perl.. and a few bad things as well.
_hemanth_ has joined #ruby
My_Hearing is now known as Mon_Ouie
<workmad3>
topriddy: you can pick an arena and decide what tools and applications you want to try to create there with ruby
<ddd>
topriddy: point i'm making is that ruby is 100% usable real-world even if rails were to suddenly be blown out of existence, never to have ever been implemented. there are also frameworks like ramaze that do the same thing but far lighter, etc.
Solnse has joined #ruby
<ddd>
and there's what workmad3 just suggested as well
nari has quit [Ping timeout: 245 seconds]
<hoelzro>
the most important thing that Ruby brings in from Perl is TIMTOWTDI
<workmad3>
hoelzro: definitely :)
<Spooner>
ddd well, as someone trawling for Ruby contracts at the moment, I'm seeing 50 RoR things for every anything-else Ruby thing.
<workmad3>
hoelzro: and I really hated the python attitude of reversing that :)
sayan has joined #ruby
sayan has quit [Changing host]
sayan has joined #ruby
<hoelzro>
same
adambeynon has joined #ruby
<hoelzro>
that's pretty much why I stick with Perl
<hoelzro>
although I have made a 2013 goal of using Ruby more
<workmad3>
I like rails ;)
<hoelzro>
it's hard, though
* Hanmac
thinks that he should put *@yahoo.com on this spam list ...
<topriddy>
workmad3: windows applications? its easier just using the .NET or Java ecosystem for that. So web and admin task or say server are the realms
<ddd>
Spooner: how does that make ruby any less usable just because right now rails contracts are pervasive?
<Hanmac>
workmad3 i only like rails while i am sitting in a train
tchebb has joined #ruby
<topriddy>
on to learning, from above. I don't understand how/why class/methods can be constants>?
<topriddy>
Mon_Ouie: snake_case for variable and method names, CamelCase for constants (including class and method names). Some people prefer SHOUTING_CASE for constants that aren't class names.
<topriddy>
[10:33am]
<topriddy>
^^
<Mon_Ouie>
I meant class and module names*
allsystemsarego has joined #ruby
allsystemsarego has quit [Changing host]
allsystemsarego has joined #ruby
<Mon_Ouie>
class Foo; end; Foo.new
<topriddy>
but a class can be modified in rib right?
<topriddy>
irb*
<Mon_Ouie>
There, when you create the class Foo, you actually created a constant name "Foo"
nathanie0221 has joined #ruby
nathanie0221 has quit [Client Quit]
Paradox has quit [Ping timeout: 244 seconds]
<Mon_Ouie>
A constant means that you can't (or shouldn't, really) change the object it refers to
<topriddy>
oh okay. thought it was some new magical concept. thanks
<Mon_Ouie>
Not that you can't modify stuff within that object
moted has joined #ruby
<topriddy>
i mean one can inject or modify methods of a Class in irb
<Spooner>
ddd It doesn't strictly, but it does mean that to get Ruby work you effectively need Rails. Doesn't mean you can't do work without Rails though (and no reason, for example, you can't automate tasks in a Java workplace with Ruby, for example).
<xybre>
2You can always freeze an object if you don't want to change the object itself
<workmad3>
topriddy: you can reopen a class
<hoelzro>
can you freeze a class?
<hoelzro>
I hadn't thought about that before.
<Spooner>
ddd Though I'm hoping I find some way around it. Rails just doesn't appeal too much.
<Mon_Ouie>
You can indeed
<Mon_Ouie>
And yes, it prevents you from defining new methods
megha has quit [Quit: WeeChat 0.3.9.2]
yfeldblum has joined #ruby
<hoelzro>
that...is...awesome.
<xybre>
Spooner: A lot of job listings lie. Most of the last 3 projects I've worked on had very little Rails and was mostly pure Ruby development. Some places just use Rails because its a buzzword, or gives structure to their projects.
reactormonk has joined #ruby
Nisstyre has joined #ruby
<workmad3>
Mon_Ouie: does it prevent you from defining new methods on the singleton class of instances?
<Mon_Ouie>
Not sure about that
fumbe has joined #ruby
tagrudev has joined #ruby
* workmad3
goes away to try
<Mon_Ouie>
Yep, that too
jbw has joined #ruby
DrShoggoth has joined #ruby
<Spooner>
xybre, You give me some hope. Thanks!
<hoelzro>
workmad3: I would bet not
<workmad3>
hoelzro: aha, you can
roadt has joined #ruby
jacktrick has joined #ruby
<topriddy>
xybre: what would you rather use for web apps then?
<Mon_Ouie>
Really? I got a runtime error when I tried
francisfish has joined #ruby
<Spooner>
xybre, I'm also realising that some language-neutral (I need to be able to do X and just want an exe I can click on) projects might be well-suited to Ruby. I've been meaning to try contracting for a while, but only just got off my arse...
<ddd>
Spooner: i guess it depends on which 'market' you're applying in. there are many scientific and medical markets you can get ruby work in that have nothing to do with rails. (like the US national labs use ruby, NASA has internal jobs open for ruby programmers (wish i could get one. I have family that works at Johnson, JPL, and Ames Research Center, but nooo, can't get me one. thanks Uncle Thomas)
<topriddy>
meanwhile, anyone knows Java here? @@class_variable is same as static variables in Java right?
<workmad3>
>> class Foo; end; Foo.freeze; a = Foo.new; class << a; def bar; end; end; a.bar
<xybre>
Spooner: if you're doing anything other than just a basic website, you'll need backend systems which have very little to do with Rails. And most places have at least one Sinatra app because its just plain faster than Rails.
<Mon_Ouie>
I thought you meant the singleton class of the class itself
<ddd>
Spooner: but you're correct insofar as the current commerical mass markets
<workmad3>
ah, no, I was wondering if you could still extend instances
<Spooner>
topriddy, @@var is deprecated. You won't see it used in decent code. Look up "class instance variables" instead.
<workmad3>
so you could still make changes to specific local objects without polluting or messing around with the entire class structure
noxoc has joined #ruby
nemesit has joined #ruby
<Spooner>
ddd Yeah, I am interested in Sintatra stuff (Or even Rails as a service rather than building web sites). I'm just feeling my way really.
jds has quit [Ping timeout: 240 seconds]
<workmad3>
topriddy: @@vars aren't quite the same as static vars in java, iirc my java correctly
etank has quit [Ping timeout: 260 seconds]
<xybre>
topriddy: Rails is fine in my opinion. Its not perfect, but I've not used anything that was overall better. Sinatra is nice, but its uber minimal and lacks a load of features. I'd probably suggest Merb if it hadn't been eaten by Rails.
<xybre>
@@vars are weird, they're straight from smalltalk.
d2dchat has joined #ruby
<ddd>
Spooner: don't feel bad. I completely stepped away from anything rails, just to focus on pure ruby apps, only to come back to rails because its what puts food on the table and quickly
<workmad3>
topriddy: the difference is that only one @@var exists for the entire class hierarchy from the base class it is first defined in down
arturaz has joined #ruby
<workmad3>
topriddy: so if you make a change to an @@var anywhere, it is reflected across the entire hierarchy
dwu2 has quit [Quit: Leaving.]
<topriddy>
just like static class var members in java
<Spooner>
workmad3, Not strictly true. It depends on the order each class references it whether there are one or more different @@vars.
vlad_starkov has quit [Remote host closed the connection]
<workmad3>
topriddy: I thought in java a static var in a parent class wasn't shared across all classes derived from it
<Hanmac>
Spooner @@vars are not deprecated from the ruby devs, but i currently see no usage for it
<topriddy>
workmad3: hmm…true. (got to check again) X_x
<Mon_Ouie>
Pretty sure they are in C++ (then again, C++)
<Spooner>
Hanmac, Yes, OK, sorry, they aren't officially deprecated. There is just a better way and "noone" uses them any more (Rubymine shouts at me when I try to use one :D).
<workmad3>
topriddy: so that if you changed the static var in a derived class, that change isn't visible across all other derived classes from the parent class
<workmad3>
Mon_Ouie: yeah, well in C++, class definitions are more memory layout than anything else
<workmad3>
Mon_Ouie: C++ is also the only language I know where you can actually do object slicing :)
<xybre>
@@vars are useful for a very narrow set of things, if you're not careful, they can bite you though.
<workmad3>
@@vars would be better described as inheritance-hierarchy variables
<fuzai>
So if I can use array.include? "string" to find if a value exists in an array, how to I remove it?
<workmad3>
as that's then more descriptive of the actual scope of the damn things
nemesit|osx has joined #ruby
<Spooner>
fuzai, Array.delete "string"
<topriddy>
is there a concept of loading a file to irb? say i define some classes/methods/functions in a file and want to call/use from irb . i think i did this either in haskell/python (mixing things up these days…never learned any too deeply)
<workmad3>
Mon_Ouie: oh, what you can do in java but can't in ruby though, is shadow the parent static var with one in the derived class
gyre007 has joined #ruby
gyre007 has quit [Read error: Connection reset by peer]
timonv has joined #ruby
gyre007 has joined #ruby
<Mon_Ouie>
Indeed
adeponte has quit [Remote host closed the connection]
<Spooner>
workmad3, Except you can, if you define the @@var in the child before it is defined in the parent (for example if you have something like def frog; @@frog ||= []; end and it gets called on the child class first).
<workmad3>
Spooner: ok mr smart :P
<workmad3>
Spooner: that sounds more like a bug of an implementation optimisation though ;)
timmow has joined #ruby
<Spooner>
workmad3, I think it is one of the major reasons @@vars are not used.
karasawa has quit [Ping timeout: 252 seconds]
bapa has quit [Read error: Connection reset by peer]
<topriddy>
workmad3: just tried the require command. its not checking in the "relative directory" from where i launched irb from
<workmad3>
topriddy: that's because . isn't on the load path by default
<topriddy>
workmad3: might have to give a full path :(
<Spooner>
topriddy, require_relative
<workmad3>
topriddy: just do 'require "./..." ' in irb
greenarrow has joined #ruby
bapa has joined #ruby
<topriddy>
require ./myapp.rb
<topriddy>
?
<topriddy>
above doesn't work. says ***wrong number of arguments
<workmad3>
require "./myapp.rb"
<topriddy>
oh in quotes.
<workmad3>
or just require "./myapp"
<workmad3>
yeah, it's just a method call remember ;)
JonnieCache has joined #ruby
<workmad3>
and it takes a string
<Spooner>
Or require_relative "myapp.rb"
<topriddy>
oh true. treated it like an os command.
ber has joined #ruby
<workmad3>
Spooner: I don't think that works in irb
akemrir has joined #ruby
<Spooner>
workmad3, Oh yeah, crap.
<workmad3>
but yes, in normal rb files, you'd want to do require_relative, or ensure your load path is correct (something that things like rails and rubygems do for you)
<workmad3>
preferably, you should ensure your load path is correct, otherwise you're coupling your code to the relative position of two files
<topriddy>
workmad3: meanwhile, your tips work too well :D
<workmad3>
topriddy: it's important to not do require "./whatever" in normal code files ;)
<workmad3>
topriddy: as '.' is dependent on the launch location, not the file location
<topriddy>
workmad3: okay. noted sensei :D
Elhu has quit [Ping timeout: 252 seconds]
<topriddy>
workmad3: require_relative instead?
chussenot has joined #ruby
inffcs00 has joined #ruby
ViPi has quit [Quit: Computer has gone to sleep.]
<workmad3>
topriddy: the best solution is to make sure your application root code directories are in the ruby $LOAD_PATH
<workmad3>
topriddy: if you use require_relative, you just coupled that file's fs position to another file's fs position
<workmad3>
topriddy: you can't move either of them without changing the require_relative line
<topriddy>
one more thing, how do you guys know all the method names of a class/type/var also available lib functions??? In java there is IDE/Intellisense/Code Completion. There is also a detailed java doc
<ruby_date>
how can i reverse this expression? Date.ordinal(2012, n).to_time.to_i
<topriddy>
and to know the doc of a particular method? how to use it? intellisense in java tells you a lot on how to use the method, args, args ordering , return type etc
<Spooner>
topriddy, Use pry gem rather than vanilla irb. It makes that sort of inquiry a lot easier to read.
<workmad3>
ddd: .methods(true) is for not showing inherited methods, iirc
<ruby_date>
so i need to get Date.ordinal object from 1325361600
<ruby_date>
how can i do it?
Elhu has joined #ruby
br4ndon has joined #ruby
<ddd>
workmad3: ahh
<workmad3>
ddd: SomeClass.instance_methods is also an option
TheFuzzball has joined #ruby
greg5green has joined #ruby
<workmad3>
topriddy: the intellisense capabilities in ruby are not the same as in java (or rather, they're similar to what you can get in java if you start messing around with lots and lots of reflection)
<topriddy>
Spooner: i don't know what pry gem means. i just launch irb from mac bash. ***covers face***
<ddd>
github.com/pry/pry
<Spooner>
topriddy, gem install pry THEN just "pry" instead of "irb"
<ddd>
github.com/pry/pry/wiki
<topriddy>
okay
* topriddy
downloading
<ddd>
the README for the project will show you how to make pry the default even when you call 'irb'
<topriddy>
ddd: is that a good thing?
tomzx has quit [Quit: tomzx]
Elhu has quit [Client Quit]
<ddd>
um, yeah
<workmad3>
ddd: is it something other than a bash alias? :)
<ddd>
workmad3: yes ;)
<Spooner>
ruby_date, Time.at(1325361600).to_date
<Spooner>
(though that looks like it doesn't account for time zones on the return trip).
Elhu has joined #ruby
slainer6_ is now known as slainer68
<ruby_date>
Spooner: oh, thanks a lot
<sie>
Proc is simply a class for passing around blocks, correct?
ruby_date has quit [Quit: leaving]
<ddd>
actually I dont' see it there anymore, so, just add https://gist.github.com/e0ad5dcf53f786c228cc to your ~/.irbrc and it will cause pry to launch within irb's session. then just read pry's docs on how to use it. does everything irb does and more. pretty simple to use :)
wallerdev has quit [Quit: wallerdev]
RagingDave has joined #ruby
<Spooner>
sie proc/lambda are not quite the same as blocks, but in a general sense, yes.
pcboy_ has quit [Remote host closed the connection]
horofox has joined #ruby
vlad_starkov has joined #ruby
topriddy_ has joined #ruby
topriddy_ has quit [Read error: Connection reset by peer]
<Hanmac>
an block itself is not a proc ... like when you only do yield with an do ... end as block, it does not create proc objects, but when you do &block eigher as parameter in the method or as parameter for the method, it does create Proc objects
topriddy has quit [Remote host closed the connection]
topriddy has joined #ruby
nicobrevin1 has quit [Ping timeout: 265 seconds]
karasawa has quit [Read error: Connection reset by peer]
<Spooner>
ddd, I actually prefer to keep irb and pry separate. Pry can take 5s longer to load on Windows :/
<ddd>
hehe, yet another reason i won't waste my time with windows
cisco has quit [Quit: Leaving.]
<Hanmac>
hm pry is also a liitle bit slower with loading on linux too
<Muz>
There's a known issue with 'require' being poorly performant on Windows and a fix for it, but I can't seem to find it right now.
<ddd>
not had that problem on debian testing, ubuntu 12.04, or mac osx ML
<Muz>
I wouldn't be surprised if it was related to this though.
malkomalko has joined #ruby
<Spooner>
It is, but it makes enough difference in Windows if I just want to quickly test a one-liner (irb) or start a longer session (pry)
<Spooner>
Muz 1.9.3 is massively faster at requiring.
<Spooner>
*on Windows.
<Muz>
Ah, it probably nods towards that patch in 1.9.3
<Spooner>
I would have said 10s slower in 1.9.2 :D
<ddd>
that could be another reason. i don't touch anything 1.8.7. everything i work on is some patchlevel of 1.9.3
<Muz>
I can't recall if it's slow because of NTFS or if it'd still occur with a different FS.
karasawa has joined #ruby
topriddy has quit [Ping timeout: 276 seconds]
<Muz>
(Such as exFAT)
samuel02 has quit [Remote host closed the connection]
<Spooner>
Not sure. I think the 1.9.2->1.9.3 speedup was just optimising some super-dumb code, not OS-specific.
<Muz>
"The work of this project has already been merged into Ruby 2.0 and soon will be backported into Ruby 1.9.3."
topriddy has joined #ruby
<Muz>
Not sure which patchlevel release it made its way into though.
<topriddy>
God bless the person that mentioned pry…it is SWEET!!
<topriddy>
i like the colourings there
rippa has joined #ruby
<topriddy>
wish i could just even edit my program there and somehow output some classes to file or get my program in a file afterwards
<Spooner>
You might want to install ruby-doc too, since that gives you access to all the standard docs (like Array/String, etc). Save some time by installing pry-full and you get a whole sack of crazy :)
Guest59463 has quit [Read error: Connection reset by peer]
Guest59463 has joined #ruby
pcarrier has quit []
<Spooner>
topriddy, You can edit in pry. Just can't magically dump the current state of stuff you've build in the REPL
<topriddy>
heh. trade off
horofox has quit [Quit: horofox]
<Spooner>
Sorry, I mean you can edit source files in pry and re-load them.
<topriddy>
Spooner: using TextMate2 for file editing atm. would have loved something cooler. Like someone cool Mac Ruby dev settings
<workmad3>
topriddy: you could also ask banister what his colour scheme is and use that in your editor ;)
sepp2k has joined #ruby
<topriddy>
i have ruby-doc --- yet to read how to use it though. Left Little Book Ruby and now reading PickAxe
<workmad3>
topriddy: also, vim is a decent choice for a ruby editor with plenty of support
horofox has joined #ruby
horofox has quit [Client Quit]
<workmad3>
(or emacs, if you're that way inclined :P )
<Spooner>
topriddy, I use Rubymine IDE, but it isn't free except for opensource development (and sublime text for tiny scripts).
<topriddy>
workmad3: i would need a decent vim .vimrc for ruby then i think. and some tips. i don't mind using vim
<ddd>
I use RubyMine myself, but ther eis also Aptana Studio 3 which is another IDE like it, but is free
<ddd>
They also offer RadRails
stetho has quit [Quit: stetho]
<workmad3>
topriddy: I use the vimified .vimrc (poorly) with a few customisations and extra packages :)
<Spooner>
ddd thanks, I'll try Aptana
<ddd>
sublime text2, radrails, vim, textmate on the mac, whole bunch of editors and ides
<topriddy>
workmad3: please share .vimrc for ruby custom editing. and the extra packages….would stick to TextMate2 for a while more though.
tonini has quit [Remote host closed the connection]
<Spooner>
You don't need more than that really.
<Spooner>
Anything past notepad is fine :)
<ddd>
wow, in order for RubyMine to update my address on the license, they have to 'refund my order and reprocess it' in order to change my address??
<ddd>
also sent them 3 emails with the change of address in them, but they want *another* email with the new address? really?
<workmad3>
topriddy: I'm not exactly a stellar vim user though :)
fermion has joined #ruby
pcarrier has joined #ruby
<topriddy>
workmad3: thanks. same here. but some guy i introduced to programming some 3years ago, decided not to go with java but ruby (because of some asterix telephony software PBX on linux which supported it), now he;s so cool and productive in ruby. knows vim. If my student can learn it, i can too :D
<topriddy>
appreciate all of you much ***hugs***
<workmad3>
:)
<hoelzro>
topriddy: what resources are you using to learn Ruby?
akl_ has joined #ruby
<topriddy>
hoelzro: have read some several short tutorials, first: learn ruby (interactive online tutorial - pretty short), an old copy of (Little Book of Ruby - stopped at end of chapter 2), now i want to use PickAxe
tmi_ has joined #ruby
<hoelzro>
topriddy: if you're looking for a book and willing to spend a bit of money, I highly recommend "The Ruby Programming Language"
<hoelzro>
it's a fantastic book
<workmad3>
hoelzro: that's the pickaxe ;)
<workmad3>
oh wait sorre
kevinfagan has joined #ruby
dwu1 has joined #ruby
<workmad3>
getting programming ruby and ruby programming language mixed up
<hoelzro>
I would bet that at least 20% of my messages to this channel are recommendations for that book
<hoelzro>
I should become an affiliate =)
<JonnieCache>
the one with the birds on the front
<JonnieCache>
is the one you want :)
<hoelzro>
yup
<JonnieCache>
the pickaxe is good too though
<workmad3>
either would be good I suspect :)
<workmad3>
either way, I'd probably suggest that you pick a project to do in ruby now, get some more immersive learning done
<JonnieCache>
definitely
<workmad3>
or start solving project euler problems, do some katas in ruby...
<topriddy>
goal is to know enough fundamentals to do scripting and OS admin and then play with Rails or any reasoning web app to do a fun web app
<workmad3>
something to start immersing yourself in the language rather than just reading reams of text :)
the_hack has quit [Quit: Computer has gone to sleep.]
<Spooner>
And remember to Ruby.learn, not learn Ruby ;)
<topriddy>
other than Web projects, and simple admin one time scripts, i can't really think of what to use Ruby for. Same can be said for Python
<workmad3>
Spooner: how about Languages.learn :ruby ;)
<workmad3>
topriddy: I believe there are a few in here doing games in ruby atm too
<Spooner>
Yeah, I write games. They suck ;)
<workmad3>
topriddy: but basically, you can use ruby for pretty much any general task
<workmad3>
Spooner: I didn't say anyone wrote *good* games in ruby :P
emergion has joined #ruby
Takehiro has joined #ruby
fir_ed has joined #ruby
<wreckimnaked>
games in ruby, that's something new
<grzywacz>
trolololo
<workmad3>
topriddy: I've mostly stayed in the web-app sphere since I learned ruby (because that's where my job is now), and it's definitely the most visible aspect
the_hack has joined #ruby
jenrzzz has quit [Remote host closed the connection]
<topriddy>
even desktop apps are preferable windows or java. programming devices too, e.g POS, Printers, etc. most apis come with java/windows dlls
<workmad3>
topriddy: yeah, but you can use jruby on the JVM
moted has quit [Ping timeout: 244 seconds]
chriskk has quit [Quit: chriskk]
<topriddy>
"and deal with its own issues". :D
<topriddy>
really, i think i have gotten a better view…i should go off and study now. thanks all again
lolcathost has quit [Ping timeout: 260 seconds]
gregoryigelmund has joined #ruby
kjellski has joined #ruby
inffcs00 has quit [Ping timeout: 240 seconds]
jacktrick has quit [Quit: Leaving]
znake has joined #ruby
a_a_g has joined #ruby
inffcs00 has joined #ruby
Guest59463 has quit [Read error: Connection reset by peer]
Guest59463 has joined #ruby
pcarrier has quit []
Mon_Ouie has quit [Ping timeout: 256 seconds]
RagingDave has quit [Quit: Ex-Chat]
pcboy_ has joined #ruby
nathancahill has quit [Quit: nathancahill]
the_hack has quit [Quit: Computer has gone to sleep.]
s0ber has joined #ruby
sie has quit [Ping timeout: 265 seconds]
znake has quit [Quit: znake]
dwu1 has quit [Read error: Connection reset by peer]
<topriddy>
please see…happened after i installed vimified on mac bash
Xeago_ has joined #ruby
Xeago is now known as Guest91394
Guest91394 has quit [Killed (rajaniemi.freenode.net (Nickname regained by services))]
Xeago_ is now known as Xeago
<topriddy>
same happens trying to edit ruby code created through textmate2
hotovson has quit [Read error: Connection reset by peer]
hotovson has joined #ruby
chussenot_ has joined #ruby
niklasb has joined #ruby
Proshot has joined #ruby
taoru_ has quit [Remote host closed the connection]
browndawg has joined #ruby
chussenot has quit [Ping timeout: 260 seconds]
chussenot_ is now known as chussenot
JohnBat26 has joined #ruby
the_hack has joined #ruby
Pip has quit [Ping timeout: 264 seconds]
fir_ed has quit [Ping timeout: 260 seconds]
lolcathost is now known as Playground
* Hanmac
point finger and laughs about mac users
timonv has quit [Remote host closed the connection]
* csmrfx
Are you sure it is not the pythonists that are pointing the finger at ruby windows, ruby mac and debian rubygem users?
<csmrfx>
(and laughing))
bhavesh_a_p has joined #ruby
clooth has joined #ruby
<ddd>
Captain Chuckles ;)
haxrbyt__ has quit [Ping timeout: 260 seconds]
<bhavesh_a_p>
in ruby 'data members' means variables, objects ....?
<banister_>
bhavesh_a_p: what epression is never used but it will mean instance variables
<banister_>
'data members' is a C++ term
<banister_>
that expression*
<banister_>
c++ "data members + member functions" --> ruby "instance variables + methods"
haxrbyte has joined #ruby
<bhavesh_a_p>
actually I just read that in ruby methods are default public & data members are private
<bhavesh_a_p>
<banister_> thanks
haxrbyte_ has joined #ruby
hamed_r has joined #ruby
Virunga has joined #ruby
wreckimnaked has joined #ruby
<topriddy>
what??
Nisstyre has quit [Ping timeout: 244 seconds]
<banister_>
bhavesh_a_p: yeah that's true
* topriddy
sighs…back to textmate2 for now.
<banister_>
bhavesh_a_p: but it's more extreme, ivars are not only 'private', it's impossible to make them public
nicobrevin1 has quit [Ping timeout: 244 seconds]
<banister_>
if you want to access them u have to do it through a method
<bhavesh_a_p>
hm
<ddd>
banister_: i was mentally arguing against that statement until i realised duh, getter/setter is *exactly* that (dumbass me)
<bhavesh_a_p>
or we can make it public using like attr_accessor
<ddd>
bhavesh_a_p: still a method actually
c3vin has quit [Ping timeout: 240 seconds]
<Hanmac>
its possible to get instance variables without an attr getter, with obj.instance_variable_get(:@abc)
<bhavesh_a_p>
:) right
<ddd>
its just a dynamic way of creating the methods
<ddd>
Hanmac: does that bypass mass-assignment (iirc thats rails specific)
<ddd>
?
<fuzai>
Is there somthing like tidy for ruby code?
haxrbyte has quit [Ping timeout: 260 seconds]
dhruvasagar has quit [Ping timeout: 248 seconds]
browndawg has quit [Ping timeout: 240 seconds]
<topriddy>
Hanmac: you should help…not laugh :|
horofox_ has joined #ruby
<ddd>
the mass assignment being rails specific, not the method you mentioned
<Hanmac>
ddd i think yes, because it the instance_variable_set method does assign the variable directly and ignore all possible get or set methods
<ddd>
got it. thanks
<Hanmac>
same goes for instance_eval {}
dwnichols has joined #ruby
nwertman_ has joined #ruby
<banister_>
Hanmac: that's a method too
nwertman has quit [Ping timeout: 260 seconds]
yshh has joined #ruby
<ddd>
other than shitloads of typing, what would be insane about using that and not opening vars to mass-assignment? i mean i know that'd be a bucketload of extra typing easily solved by attr_accessible, but would it be a safer way? or am i missing something in the details of m-a?
chussenot has quit [Quit: chussenot]
<Hanmac>
>> class A; def abc; p "getter called"; return @abc;end; def abc=(value);p "setter called"; @abc = value; end; end; a = A.new; p a.abc; a.abc = 4; p a.instance_eval {@abc}; a.instance_eval {@abc = 5}
<ddd>
i mean i realize people wuld look at me insanely for typing it out like that when there's a shortcut, however, i fail to see why that would be an unsafe thing to do
<Hanmac>
ddd i dont know your called "mass-assignment" because it may reails specific and i didt see it before
sepp2k has quit [Quit: Leaving.]
<ddd>
Hanmac: vars are by default blocked from being assigned unless they are marked with attr_accessible in rails. just the mere fact of them existing (they are dynamically created from AR fields on a record) doesn't allow them to be assigned with the security change in rails (early 3.x iirc)
<apeiros_>
s/vars/attributes/
<apeiros_>
(you can't block vars)
<ddd>
apeiros_: you're right. i should have stated it that way. thank you
<ddd>
they're synonymous in my head
<Hanmac>
yeah when ivars attack they are unblockable :D
* apeiros_
protector of semantic details
<ddd>
heheh
ttt has quit [Remote host closed the connection]
yacks has joined #ruby
yshh has quit [Ping timeout: 260 seconds]
xemu has joined #ruby
cantonic has quit [Quit: cantonic]
Nisstyre has joined #ruby
tmi__ has joined #ruby
<topriddy>
does anyone else use vimified on mac vim successfuly? during installation the only thing that failed was vim-slim requiring a github password
<workmad3>
topriddy: I do... but I use macvim through the terminal
adkron has quit [Ping timeout: 255 seconds]
<topriddy>
workmad3: i don't have macvim. how do i get that?
<Xeago>
macvim through terminal, mind explaining?
tmi_ has quit [Ping timeout: 260 seconds]
<Xeago>
you mean the vim from macvim?
<workmad3>
Xeago: yeah
<workmad3>
Xeago: so it's the macvim build, but in terminal rather than GUI mode
<apeiros_>
oh, Xeago - sorry about monday, was already sleeping - but tonight?
<Xeago>
apeiros_: maybe, depends what time office closes
<Xeago>
haven't played since 2012-10
<Xeago>
workmad3: ctrlp vs command-t
geekbri has joined #ruby
c3vin has joined #ruby
<Xeago>
workmad3: have you set it up that it looks in /Applications/MacVim.app/wherever/the/dir/lives
pcboy_ has joined #ruby
<workmad3>
Xeago: ctrlp... command-t requires too much effort to set up
timonv has joined #ruby
samuel02 has joined #ruby
<Xeago>
I find it quite easy to setup, how is the performance/
<Xeago>
it is a few steps, which is annoying if vim doesn't have ruby
<Xeago>
but if it has ruby, it is all shiny stuff
<apeiros_>
Xeago: I played a bit, but still bronze (even though I win ~4 out of 5 games, but probably I just don't play enough)
<Xeago>
aight, cool!
<Xeago>
I got a new b.net code since the patch tho
<topriddy>
workmad3: do you remember having to provide github username/password while installing vimified? i'm using the lazy-man installation instruction
mmitchell has joined #ruby
<workmad3>
no, if that happens with vundler it's normally a sign that there's an incorrect repo name there
<topriddy>
i didn't install bundler….do i need too?
<apeiros_>
Xeago: pm, hope it's ok :)
grzywacz has quit [Quit: :wq]
<topriddy>
thought vimified was a layer on vundler according to wiki tho
dwnichols has quit [Ping timeout: 264 seconds]
baphled has quit [Ping timeout: 264 seconds]
Pip has joined #ruby
<Xeago>
bah, the top of a cucumber tastes like crap
<shevy>
is it very helpful to define private for classes in ruby?
<shevy>
it seems to reduce freedom
Takehiro has quit [Remote host closed the connection]
stopbit has joined #ruby
lkba has joined #ruby
<hoelzro>
I would create public methods as part of the API that users are encouraged to use/extend, and private methods for methods that may change or go away
<shevy>
hoelzro ah ok, so it becomes an element of public API design
spanner has quit [Read error: Connection reset by peer]
dougireton has quit [Quit: Leaving.]
Guest25886 has joined #ruby
scrapcode has joined #ruby
nkts has joined #ruby
xbayrockx has quit []
haxrbyte_ has quit [Remote host closed the connection]
spanner has joined #ruby
jds_ has joined #ruby
quest88 has joined #ruby
jonathanwallace has quit [Quit: WeeChat 0.3.9.2]
<hoelzro>
shevy: for me, yes
xeviox has joined #ruby
<hoelzro>
banister`sleep: very Smalltalky
jonathanwallace has joined #ruby
<banister`sleep>
hoelzro: that's the ultimate idea ;)
<banister`sleep>
getting there, slowly
<xeviox>
hi guys, I have string like "%VARIABLE%\nValue\n\n%VARIABLE..."
<hoelzro>
=)
mercwithamouth has joined #ruby
<xeviox>
how can I extract value of a specific variable?
<hoelzro>
xeviox: you mean getting the value of a Ruby variable by name?
<xeviox>
hoelzro: no, out from the string I posted
judesamp_ has joined #ruby
<hoelzro>
oh, I see what you mean
<csmrfx>
Whats a nice, clean ruby-webdriver project I should steal code from?
ExxKA has joined #ruby
kjellski has joined #ruby
judesamp_ has quit [Client Quit]
judesamp_ has joined #ruby
<scrapcode>
"NoMethodError: undefined method `p' for main:Object" I'm trying to replicate "print_r" in php in RubyFiddle.com to play with hashes and "map" for better understanding. Is it just fiddles fault that this method doesn't exist?
<xeviox>
I thought of using my_string[..., 1] with a regex that creates two groups (first variable name, second the value), but I don't know how to do this
cantonic has quit [Read error: Connection reset by peer]
phantasm66 has joined #ruby
phantasm66 has quit [Changing host]
phantasm66 has joined #ruby
headius has joined #ruby
cantonic has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
headius has quit [Client Quit]
jds_ has quit [Ping timeout: 252 seconds]
judesamp has quit [Ping timeout: 245 seconds]
judesamp_ is now known as judesamp
headius has joined #ruby
mmitchell has joined #ruby
invisime has left #ruby [#ruby]
browndawg has quit [Quit: Leaving.]
<hoelzro>
ah, another thing Ruby inherited from Perl: __END__/DATA
buibex has joined #ruby
whitedawg1 has quit [Quit: Leaving.]
jblack_ has quit [Ping timeout: 252 seconds]
greenarrow has quit [Ping timeout: 256 seconds]
greenarrow has joined #ruby
Nisstyre has quit [Ping timeout: 260 seconds]
<JonnieCache>
every time i remember that feature im thankful hardly anyone knows about it
<JonnieCache>
imagine if the rails lot had got excited about that feature 5 years ago. imagine the mess we'd be in haha
RagingDave has joined #ruby
elico has quit [Ping timeout: 276 seconds]
<xeviox>
is it possible to use string[...] with a variable?
jlast has joined #ruby
quest88 has quit [Quit: quest88]
<xeviox>
e. g. my_string[[a-z]] with my_sting[first-last]
<shevy>
xeviox, use a regex + match group
fourq has joined #ruby
scrapcode has left #ruby [#ruby]
<xeviox>
shevy: how can I build a regex with variables?
<xeviox>
and is it usable with string[...]
<shevy>
xeviox string support regex
elico has joined #ruby
<shevy>
"abcdef"[/cd/] # => "cd"
<shevy>
"abcdef"[/cdxx/] # => nil
pu22l3r has joined #ruby
<xeviox>
shevy: is it possible to use a variable instead of "cd" ?
<csmrfx>
sie: you can pipe output to a file if nothing else
<sie>
Hanmac, Oh, come on.
fermion has joined #ruby
<sie>
csmrfx, Well yeah, I guess I simply don't like how sprinkle does things.
LouisGB has quit [Ping timeout: 256 seconds]
<csmrfx>
well, I dont even know what sprinkle is and how you use it and where it outputs
<sie>
ner0x, Oh, really, why?
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
<ner0x>
sie: Brings a lot of people to the language.
<ner0x>
sie: Unfortunately you also get what you get with any mainstream framework/language, newbs by the hundreds.
rondale_sc has joined #ruby
philcrissman has quit [Remote host closed the connection]
<csmrfx>
look guys
<JonnieCache>
it brings more money to the jobs though :)
<csmrfx>
you clearly havent patrolled ##javascript or similar
<csmrfx>
##ruby is a small side alley shop with very low traffic
tmi_ has joined #ruby
<csmrfx>
if rails bothers you, just do what ##javascript did with !jquery
<csmrfx>
(an irc macro that tells people that this is not a rails channel and where to go)
luckyruby has quit [Remote host closed the connection]
<ericwood>
autokick people who mention rails
<csmrfx>
lol
<ericwood>
you have to rule with an iron fist, or else nobody will learn
<ner0x>
I have no problem with rails.
ericwood was kicked from #ruby by apeiros_ [you mentioned rails :-p]
* apeiros_
snickers
zommi has quit [Quit: Leaving.]
ericwood has joined #ruby
<ericwood>
damn
<apeiros_>
;-p
<csmrfx>
ha-ha
<Pip>
:D
<apeiros_>
you could #ruby-without-rails
<apeiros_>
or #rubyoffrails
<ericwood>
#rubyoffdarailz
<Hanmac>
#rubyonmonorails
dustint has joined #ruby
danieldocki has quit [Read error: Connection reset by peer]
<csmrfx>
#rubyonair
llaskin has joined #ruby
tmi_ has quit [Client Quit]
<Pip>
damn
<Hanmac>
#rubyoncrack ;D
<shevy>
#rubydavidhasslehoffiscooler
<llaskin>
is the require syntax different between 1.8.7 and 1.9.3 for example "require 'lib/Portal/Setup.rb'" worked in 1.8.7 and doesn't work in 1.9.3
ExxKA has quit [Quit: This computer has gone to sleep]
nfk has joined #ruby
<ericwood>
require_relative is what you want
<shevy>
llaskin they took out "./" from the path, I think, and added require_relative
<llaskin>
so it shoudl be require_relative ?
<llaskin>
ok
<csmrfx>
llaskin: you need require rubygems?
speakingcode has joined #ruby
<shevy>
llaskin or you install your project into ruby SITEDIR
<ericwood>
not in 1.9
<shevy>
require 'foobar'
<ericwood>
require rubygems was phased out iirc???
<csmrfx>
oh, its the wrong way around for that
tagrudev has quit [Remote host closed the connection]
<Pip>
#ruby-wet-bed
rismoney has left #ruby [#ruby]
dustint has quit [Remote host closed the connection]
nari has quit [Ping timeout: 240 seconds]
niklasb has quit [Ping timeout: 248 seconds]
Akinsola has joined #ruby
<apeiros_>
ericwood: correct
<ericwood>
good.
dustint has joined #ruby
<ericwood>
I always hated that
<ericwood>
but anyways, require_relative is what you want
<JonnieCache>
nooo
<apeiros_>
IMO require_relative = instafail
<apeiros_>
(with some rather rare exceptions)
<ericwood>
not in my experience
<JonnieCache>
just add the right dirs to the load path
<apeiros_>
it means you haven't understood $LOAD_PATH
<shevy>
I hate require_relative
<ericwood>
that's stupid, require_relative is awesome
* ericwood
feels cornered all of a sudden :|
<apeiros_>
ericwood: in 99.9% of all cases, you have a lib dir, and that's installed - it already IS in load path
buibex has quit [Remote host closed the connection]
<workmad3>
ericwood: it couples files together
<workmad3>
ericwood: nastily so
<apeiros_>
so a plain require would work just fine
<ericwood>
hmmm okay
<shevy>
ericwood well, I can avoid it if I can use require a project
<apeiros_>
the only case where it doesn't is during development
gansbrest has quit [Quit: Ex-Chat]
<apeiros_>
because during development, your thingy is not installed
nemesit has quit [Ping timeout: 240 seconds]
<Akinsola>
new
<Akinsola>
here
ananthakumaran has joined #ruby
<shevy>
it has extra word, so a bunch of require 'bla' looks different than require_relative 'bla'
slainer6_ is now known as slainer68
<shevy>
it annoys me visually :(
davidd12 has joined #ruby
marr has quit []
postmodern has quit [Quit: Leaving]
<shevy>
matz should have called it "import" :P
<apeiros_>
welcome here, Akinsola. On a sidenote, you're allowed to write more than 1 word per message ;-p
<Pip>
I just wrote a program in Ruby that keeps asking you if you wet bed; and it won't stop until you say "yes"
<shevy>
Pip are you really using ruby ...
rismoney has joined #ruby
<Pip>
I use recursion
Akinsola has left #ruby [#ruby]
<Pip>
shevy, define really
_nitti has quit [Remote host closed the connection]
<apeiros_>
Pip: so it'll stop too if I say 'no' often enough
<shevy>
as in WROTE something really ;)
<apeiros_>
(well, it'll stop violently…)
<Pip>
let me share it
locriani has joined #ruby
<shevy>
ok
dustint has quit [Remote host closed the connection]
davidd12 has quit [Remote host closed the connection]
yonahw has quit [Ping timeout: 260 seconds]
rondale_sc has quit [Remote host closed the connection]
jekotia has joined #ruby
<llaskin>
shevy: so you have to specify the folder name? so instead of require 'lib/Portal/Setup.rb' I should say require_relative 'trunk/lib/Portal/Setup.rb' ?
SCommette has joined #ruby
dougireton has quit [Quit: Leaving.]
<shevy>
llaskin I do not use require_relative. but as far as I know, you can just give the file path to require_relative, if you want to use it
sepp2k has joined #ruby
<llaskin>
its still spitting up
<shevy>
llaskin the alternative is to setup a proper project directory structure, with a lib/ directory, then install that somehow, like via setup.rb
<ericwood>
will ruby automagically know to check lib/ ?
<llaskin>
C:/SVN/rubymine_checkout/lib/Portal/Setup.rb:1:in `require_relative': cannot load such file -- C:/SVN/rubymine_checkout/lib/Portal/lib/File.rb (LoadError)
<shevy>
and when you then do: require 'foobar', you also have a file called foobar.rb that can call your other files in your project
<karl____>
Pip: try gets.to_s.chomp.downcase ?
<shevy>
aha so you are a windows guy ;<
<llaskin>
hah
<llaskin>
also i think i just figred out when i reread that
<shevy>
hmm
<shevy>
have you tried to leave out C: ?
<Pip>
karl____, No need to put to_s there
<Pip>
gets does get string
<shevy>
anywy, it should work from within irb llaskin
<shevy>
even on windows
<apeiros_>
llaskin: require 'Portal/Setup' should do it
x82_nicole has joined #ruby
<apeiros_>
since lib should be in $LOAD_PATH
nomenkun has quit [Remote host closed the connection]
fteem has quit [Read error: No route to host]
<llaskin>
lmfoa yes i did
<shevy>
Pip your script even works
<shevy>
I am impressed
fteem has joined #ruby
<llaskin>
it actually is working this way: require_relative '../Portal/Setup'
<Pip>
lol
dustint has joined #ruby
<apeiros_>
you're doing something wrong then
<apeiros_>
how do you start the executable?
<shevy>
llaskin see now I am beginning to hate require_relative even more
elico has joined #ruby
LouisGB has joined #ruby
tomask has joined #ruby
<shevy>
I can not remember ever having to do: require '../
* apeiros_
assumes `ruby bin/whatever`
scruple has joined #ruby
<csmrfx>
#in ruby code (adding directory to $LOAD_PATH
horofox_ has joined #ruby
<csmrfx>
$:.unshift File.join( %w{ /lib mylib } )
<apeiros_>
nah, just `ruby -Ilib bin/whatever`
swex has joined #ruby
<apeiros_>
no need to pollute code for development-time only things
danieldocki has joined #ruby
whitedawg has joined #ruby
<csmrfx>
heh, there are other ways but can't paste em from here
danieldocki has quit [Client Quit]
swex_ has quit [Ping timeout: 264 seconds]
lolcathost has quit [Ping timeout: 252 seconds]
danieldocki has joined #ruby
<csmrfx>
or, perhaps in your Daddy-ruby-file:
<csmrfx>
$:.unshift File.dirname(__FILE__)
<apeiros_>
if you really have to: lib_dir = File.expand_path('../../lib', __FILE__); $LOAD_PATH.unshift(lib_dir) if File.directory?(lib_dir)
<Hanmac>
manipulating loadpathi itself is not an good idea when you dont know that you do
* apeiros_
prefers absolute paths in $LOAD_PATH
<apeiros_>
Hanmac: +1
<apeiros_>
as is using require_relative…
<Hanmac>
require_relative should be safe to use
<apeiros_>
it's bad coupling.
<ericwood>
why is he right and I'm wrong?
<ericwood>
not fair
whitedawg has quit [Client Quit]
<apeiros_>
he's wrong too, if that makes you feel better :)
<ericwood>
nope
<apeiros_>
require_relative (except for some rare cases) = instafail
speakingcode has quit [Quit: leaving]
<ericwood>
for simple use I think require_relative is The Right Way™
adamjleonard has joined #ruby
<apeiros_>
use lib + plain require.
<apeiros_>
ericwood: never if "lib" is part of the path.
<ericwood>
but will the lib dir already be known by ruby?
* Hanmac
has skilled in Rightness and has an +1Right-Club
carloslopes has quit [Remote host closed the connection]
<apeiros_>
ericwood: again, on anything that is installed: yes.
<ericwood>
woooo
GoGoGarr_ has joined #ruby
<ericwood>
okay, apeiros_ is right, then
<apeiros_>
and when you're working/developing the thing, you can add it through -I
<Hanmac>
ericwood: only if you installed it as gem with an currect gemspec
<ericwood>
sorry, Hanmac
browndawg has joined #ruby
<ericwood>
oh
<ericwood>
well that seems like a lot of trouble
<Pip>
What's the factorial of 3000 ?
<ericwood>
Pip: too large
<apeiros_>
Pip: range + inject
asteve has joined #ruby
GoGoGarrett has quit [Ping timeout: 260 seconds]
zigomir has quit [Quit: zigomir]
<apeiros_>
and yeah, it's 9131 chars long, so not pasting here.
staafl has joined #ruby
elico has quit [Read error: Connection reset by peer]
<topriddy>
hi...at the risk of sounding like an idiot...i want to ask if one can pass unique code_blocks to a method in a single_call, and how one would differentiate them with the yield method
<apeiros_>
(2..3000).inject(:*) # this works perfectly fine
jduan1981 has joined #ruby
<xeviox>
code: http://pastebin.com/W6yRKt4w , error: `name': wrong number of arguments (0 for 1) (ArgumentError)
<shevy>
topriddy yield always accesses the block you gave to a method, you can check if a block was given, via "yield if block_given?"
<xeviox>
"pkt.to_s" works fine ..
<ericwood>
xeviox: you really, really, need to use attr_accessor and attr_reader
<shevy>
topriddy I do not know what you mean with "in a single_call"
<Hanmac>
yeah and its the same as the result of BigDecimal ... (but for a moment i thought that big decimal is more currect)
rismoney has left #ruby [#ruby]
dr_bob has joined #ruby
<apeiros_>
Hanmac: with Bignum you either get an accurate result or no result at all. it's not a float.
<xeviox>
ericwood: I check already, as you might recognized I'm new to ruby :(
<Hanmac>
xeviox: there is no method overloading, so your secound method overwrites the first one, and setter methods does have an "=" at the end
<ericwood>
xeviox: this isn't like java, you redefined url
<topriddy>
something like that
fteem has quit [Read error: Connection timed out]
<shevy>
hehe
<shevy>
apeiros_ once wanted to have multiple blocks to a method
<topriddy>
shevy: what have seen though is. call_block{code_block_1}
<ericwood>
xeviox: the issue is that you can't define methods with the same names and different numbers of arguments and expect them to all be unique
fteem has joined #ruby
<apeiros_>
shevy: "once"?
<shevy>
topriddy, yeah, only one block is allowed :(
<apeiros_>
I still do. and halsbe does have that.
<shevy>
hehehe
<topriddy>
not like i want it. I wondering if its possible, since i am learning syntax.
<ericwood>
xeviox: take a look at attr_reader and attr_accessor and use those to define your getters and setters instead
<apeiros_>
well, technically, blocks are ordinary arguments there.
<xeviox>
ah ok thanks!!
<apeiros_>
{…} is a code literal there
Kuifje has joined #ruby
<xeviox>
ericwood: I'll do :) thanks
Kuifje has joined #ruby
Kuifje has quit [Changing host]
<ericwood>
xeviox: you're a java programmer, aren't you? :P
buscon has quit [Quit: Leaving]
<xeviox>
ericwood: yes ^^
<Hanmac>
rtopriddy: you cant pass multible blocks without converting them with proc or lamba into real parameters
<shevy>
topriddy, you need to use halsbe one day then :P not sure why matz did not want more than one block, or perhaps the ruby parser would get confused, or some other syntax has to be changed
<apeiros_>
topriddy: you can come close to it using stabby-lambda syntax
<ericwood>
xeviox: luckily you don't have to type as much for simple things like this in ruby :P
<xeviox>
ericwood: it's always the problem when coming from another language, you may right the new one, but you right it in the style of the one you're coming from :(
<xeviox>
no it's also clear why "class.field = value" didn't work ..
<shevy>
topriddy well you dont have to use stabby lambda, in fact, you can use 20% of ruby and be more productive that way!
<apeiros_>
ok, I retract my statement - you *can* mix the syntaxes.
<xeviox>
*now
<Hanmac>
huch ... "{ "foo" => 12, foo: 13}" works on irb but "p { "foo" => 12, foo: 13}" works not :D
* apeiros_
is pretty sure that wasn't always the case
<apeiros_>
Hanmac: that's due to p{}
<apeiros_>
you need parens there
xbayrockx has joined #ruby
xbayrockx is now known as wf2f
<apeiros_>
it's considered to be a block
<shevy>
ewwww parens
<topriddy>
its a lil weird that the whole single data type for arrays arent single types unlike most c-like languages. Even Haskell (i think). But then in Ruby everything is an object...guess its just an array object
<shevy>
so you can omit the {} there too, haha hilarious
<Hanmac>
eregon: yeah free the parameters :D
<ericwood>
A++++ would code again
<eregon>
:)
<apeiros_>
fascinating, it worked in 1.9.2 too
<shevy>
ruby must be easily as good for golfing as perl is
<apeiros_>
I wonder why I was under the impression that the two styles were not mixable
<ericwood>
pretend they are
<shevy>
apeiros_ perhaps because your brain likes to keep things simple
<ericwood>
it's for the best
<csmrfx>
shevy: surely you've seen rubykoans
<shevy>
I feel not comfortable mixing syntaxes at all
<topriddy>
yeah...java
<shevy>
keep it all simple, for the sake of the kittens
generalissimo has joined #ruby
<csmrfx>
I love it how ruby isn't made for autistic mathematicians suffering from OCD with Aspergers
benlieb has joined #ruby
hamed_r has quit [Quit: Leaving]
<speakingcode>
topriddy: me too, by way of javascript tho. don't worry, once you have some good places to apply it, it's nice. just don't abuse it :-) it works great with the duck typing
csgui has quit [Quit: csgui]
<Hanmac>
csmrfx what means 0CD?
maletor has joined #ruby
<csmrfx>
Obsessive-Compulsive-Disorder
* Hanmac
is an aspi
<csmrfx>
ok no offense intended, just used metaphors to illustrate Haskell
buibex has quit [Ping timeout: 276 seconds]
ryanjh has joined #ruby
* Xeago
is an aspi too
* ericwood
is an ADDi
<Hanmac>
i havend see haskell yet, but ruby feels "natural"
<ericwood>
haskell doesn't feel natural
<ericwood>
unless you're a lambda calculastitician
<Xeago>
haskell is dark magic
<Sgeo_>
"natural" is entirely dependent on what you're used to
<Xeago>
seen that in ##crypto did not understand a thing
Spami has quit [Quit: Leaving]
<ericwood>
I was pretty decent with haskell for small things, but I never truly grokked monads
<Hanmac>
Xeago: than you havend seen what i did with C/C++/Ruby combined :P ... that what i would call "black magic"
<Sgeo_>
I've been immersed in Python for a while, so omitting parens to mean "get the method itself" is natural to me, and that doesn't work in Ruby
<ericwood>
it was good practice in functional programming, though, and made me a better ruby programmer
<Xeago>
Hanmac: I agree, the code I seen you paste here I also call black magic :)
<mwlang>
and I want to go tld at first level, then domain base at next, then leaf node is the "www', "ads", etc.
hashpuppy has quit [Quit: hashpuppy]
<mwlang>
its going to be quite large, so I figured general to specific is a good organizational structure and then I thought, "I bet somebody else has done this already"
baroquebobcat has joined #ruby
buibex has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
<speakingcode>
if you have am ethod that takes a class as a parameter, is the convention to capitalize or lowercase the paramaeter name?
madwilliamflint has joined #ruby
<speakingcode>
like def callSomethingOnAClass(someclass) someclass.something
dr_bob has quit [Quit: Leaving.]
Kovensky is now known as Ninomiya-kun
Ninomiya-kun is now known as Kovensky
<mwlang>
ok, I'll roll it myself -- I knew about reverse, just thinking about splitting off the "http://" and any trailing sub folders (which themselves will become keys.
emocakes has joined #ruby
<mwlang>
speakingcode: I think the convention is to call that parameter "klass" -- at least that's what I see in many cases
francisfish has quit [Read error: Connection reset by peer]
<bean>
mwlang: if you end up doing anything cool with it, you should open source it
banister`sleep has quit [Remote host closed the connection]
carloslopes has quit [Ping timeout: 255 seconds]
<lupine>
who knew self.class could be so expensive?
<mwlang>
change split(".") to split(/\.\//) and I'm done.
banister`sleep has joined #ruby
DatumDrop has joined #ruby
<xeviox>
as far as I've understand "attr_accessor" generates the method "attribut()" and "attribut=()" can someone explain why it is possible to use it like "object.attribute = value" (with a space)?
JMcAfreak has quit [Quit: leaving]
haxrbyte has joined #ruby
<chiel>
it's a ruby thing (that's about all i know, haha)
<Hanmac>
xeviox because its black magic
hoelzro is now known as hoelzro|away
<chiel>
it's a bit like how you can define [] and []= methods
JMcAfreak has joined #ruby
<chiel>
they provide obj[:key] = value and such
<Hanmac>
xeviox "3 == 4" is also magic, its parsed as "3.==(4)"
matled has quit [Remote host closed the connection]
<speakingcode>
hmm klass seems really vague in my use. i suppose a meaningful name with _class or _klass on the end would be okay. thanks mwlang
matled has joined #ruby
banister`sleep has quit [Ping timeout: 246 seconds]
v0n has quit [Quit: WeeChat 0.3.9.2]
v0n has joined #ruby
jduan1981 has joined #ruby
<xeviox>
ok thanks
itnomad has joined #ruby
haxrbyte has quit [Remote host closed the connection]
macmartine has joined #ruby
<xeviox>
so "class.attribute = value" gets parsed to "class.attribute= value" ?
haxrbyte has joined #ruby
francisfish has quit [Remote host closed the connection]
<lupine>
yes
<speakingcode>
xeviox: class or object?
Guest0223 has joined #ruby
<xeviox>
speakingcode: sorry object
<lupine>
strange things happen if you do, say, def foo=(a, b) then try to do something like foo = *[a,b]
<speakingcode>
i may be wrong but i think a class var is accessed with ::
<lupine>
but that's the basic idea
<lupine>
speakingcode, you can use . for either
chussenot has joined #ruby
banister`sleep has joined #ruby
<lupine>
so today, I'm mostly wrestling with *extremely* unperformant contractor code
<lupine>
ordinarily, knocking 100 seconds off runtime would be a job well done and off home early. today, it's the tip of the sodding iceberg
<Guest0223>
hi
<Guest0223>
where is everyone from
<Guest0223>
anyone from uk ?
<lupine>
moi
<chiel>
lies, you're clearly french!
Guest0223 has quit [Client Quit]
<lupine>
nein
samphippen has quit [Quit: Computer has gone to sleep.]
<chiel>
:D
nkts has quit [Remote host closed the connection]
<workmad3>
lupine: you're a member of UK royalty, right?
<lupine>
"let's call this method and some other ones - all slow - 21,761,269 times just to populate a poxy qt treeview, eh?"
<lupine>
workmad3, I hope not
blazes816 has joined #ruby
Hanmac has quit [Ping timeout: 245 seconds]
<workmad3>
lupine: just you're claiming to be UK and talking german...
<lupine>
if I am, I'll have to put myself up against a wall when the revolution comes
elux has joined #ruby
<workmad3>
lupine: and my massive knowledge of UK royalty (garnered from being british and therefore means 'practically no knowledge at all') reveals that the royal family is of german origin currently :)
<lupine>
they are indeed
megha has quit [Quit: WeeChat 0.3.9.2]
<workmad3>
lupine: besides... why would we want to throw the royals up against the wall? I'd much rather get clegg and cameron there :P
<workmad3>
lupine: the royals are just amusing
<lupine>
if only
timonv has joined #ruby
the_hack has quit [Quit: Leaving...]
maletor has joined #ruby
vlad_starkov has joined #ruby
voodoofish has quit [Ping timeout: 245 seconds]
<chiel>
any of you ever made a cap script for unicorn?
bluOxigen has joined #ruby
<chiel>
i've not really looked into it much yet, but was looking to use unicorn in production
blazes816 has quit [Remote host closed the connection]
dougireton has joined #ruby
jgrevich has joined #ruby
judesamp has joined #ruby
pu22l3r has quit [Remote host closed the connection]
amaya_the has quit [Quit: ChatZilla 0.9.89 [Firefox 17.0.1/20121128204232]]
sailias has quit [Quit: Leaving.]
pskosinski has joined #ruby
rvmeier has quit [Ping timeout: 246 seconds]
blazes816 has joined #ruby
dougireton has quit [Client Quit]
cibs has quit [Ping timeout: 245 seconds]
aganov has quit [Quit: aganov]
tomask has quit [Quit: Leaving]
horofox_ has quit [Quit: horofox_]
ananthakumaran has joined #ruby
stevechiagozie has quit [Quit: Computer has gone to sleep.]
stevechiagozie has joined #ruby
stevechiagozie has quit [Client Quit]
voodoofish has joined #ruby
<JonnieCache>
the royals are just ornament
jeffreybaird has quit [Ping timeout: 246 seconds]
<JonnieCache>
they can be exiled when the revoltion comes :)
<JonnieCache>
there are others who have higher wall-priority
<f0ster>
What is the difference between ruby-debug and debugger ?
jjbohn has joined #ruby
<JonnieCache>
ruby-debug is old and broken
<JonnieCache>
debugger is new, working, and nicely designed
clocKwize has joined #ruby
<JonnieCache>
debugger is based on nice new apis which are only in 1.9
a_a_g has joined #ruby
<JonnieCache>
its about 100x faster
stevechiagozie has quit [Read error: Connection reset by peer]
stevechiagozie has joined #ruby
<JonnieCache>
(i made that number up)
stan has quit [Ping timeout: 276 seconds]
Morkel has quit [Quit: Morkel]
<f0ster>
hmm, how can I Be sure which I am using. I am actually using rails, but I did something like 'rails console --debugger'
<f0ster>
but in the mist of following bad guidance from blogs yesterday i installed both debugger and ruby-debug-19-base
* lupine
makes a note to avoid trying to polish turds in the future
slainer68 has quit [Remote host closed the connection]
<fuzai>
http://pastie.org/5655828 When I use this piece of code when the sleep function is executed the main loop blocks. Is there a way to sleep without blocking the main loop?
<lupine>
I've got a bunch of WSAPI-based models, and a bunch of Qt TreeView models, and a giant contractor-made turd right in the middle of the two for propagating changes in one to t'other
wallerdev has joined #ruby
<lupine>
This ends. Here.
zph has joined #ruby
<f0ster>
JonnieCache: isnt there some way I can set a breakpoint in my code from irb/(rails console) without editting my code ?
cardoni has quit [Quit: cardoni]
answer_42 has joined #ruby
<JonnieCache>
f0ster:
<JonnieCache>
f0ster: yeah
<f0ster>
I cant find any documentation :/
<JonnieCache>
i think when you use rails console --debugger it tries to load ruby-debug
<JonnieCache>
i suggest you install pry-rails and pry-debugger into your project
ngoldman has joined #ruby
<JonnieCache>
and do it all though the pry console. that can do everything youre asking
<f0ster>
I thought rails would be easy to use but whenever I encounter a simple task its always 'install yet another gem'
joeycarmello has joined #ruby
<lupine>
it's generally faster than writing it yourself
carloslopes has joined #ruby
mneorr has joined #ruby
wroathe has joined #ruby
a_a_g has quit [Read error: Connection reset by peer]
a_a_g has joined #ruby
<JonnieCache>
the alternative to installing another gem is for all this stuff to be built into rails
<JonnieCache>
and god knows it doesnt need anything else built in
<f0ster>
just seems like a pretty basic requirement, debugging
berserkr has joined #ruby
<f0ster>
shouldnt have to install a 4th and 5th party gem to achieve it
<lupine>
maybe if rails were an IDE, you'd have a point
<lupine>
but it's a web framework, not an IDE
<f0ster>
true, but ruby has debugging built in
<JonnieCache>
not really
<lupine>
if that were true you wouldn't be installing extra gems, now
<workmad3>
f0ster: the rails server in dev mode exposes a debugging port to connect a debugger to, I believe
clocKwize has quit [Quit: clocKwize]
<f0ster>
sorry perhaps I was mislead
<lupine>
various rails IDEs come with magic debugger integration
dmiller has quit [Quit: WeeChat 0.3.9.2]
<workmad3>
f0ster: but rails isn't going to provide the actual debugger to connect to that for you
baphled has joined #ruby
<f0ster>
so apparently ruby-debug and debugger are useless with rails console/irb, and I should get pry and pry debug
dmerrick has joined #ruby
dmiller has joined #ruby
stim371 has joined #ruby
samphippen has joined #ruby
<workmad3>
f0ster: and many people don't like to set up debuggers through remote debugging ports (which tends to be what IDEs do for you), and so you have tools like ruby-debug and pry-debugger to allow different methods of debugging through console or terminals
<f0ster>
I guess I'm jsut nervous about installing dependency's left and right for problems in the future
<xeviox>
what is the preferred way for attr_accessors ? put all into a single line or one line per attribute?
<clooth>
Just wanted to come and say how I've missed you. (ruby)
nwertman has joined #ruby
<f0ster>
workmad3: do you use an ide ?
<apeiros_>
xeviox: if you can tell me how you document them on a single line…
<workmad3>
f0ster: no
<xeviox>
apeiros_: ok ^^ thanks
Elhu has quit [Quit: Computer has gone to sleep.]
<JonnieCache>
f0ster: the rails world loves lots of crazy dependencies, youd better get used to it ;)
<workmad3>
f0ster: I use vim, and tend to do debugging through watching test failures and isolating (when required) with printlines and exception traces rather than a breakpoint debugger
<JonnieCache>
thats one of its biggest problems
<xeviox>
apeiros_: ruby code is so expressive, it mostly doesn't need some documentation :P
<f0ster>
JonnieCache: before I Really knew rails at all (2 years ago) I had to migrate a 4 year old rails app at work and it was like DLL hell
DatumDrop has quit [Remote host closed the connection]
<f0ster>
granted that was before rvm et. all but
<workmad3>
JonnieCache: I have no idea what you mean...
nwertman has quit [Client Quit]
<workmad3>
JonnieCache: this rails app I'm working on atm only has 168 gem dependencies...
<f0ster>
JonnieCache: I Guess I should do better test driven development
<JonnieCache>
f0ster: now we have bundler which basically solves that problem
<JonnieCache>
youre right it was a bit like DLL hell back then
<JonnieCache>
but now its actually very good
* workmad3
recalls the rack 1.1 craziness
AltGrendel has joined #ruby
<f0ster>
so bundler will export all the dependencies so you dont run into the same problem, you just need the same version of rails and ruby on the other machine ?
joeycarmello has quit [Remote host closed the connection]
* workmad3
shudders
<workmad3>
f0ster: you don't even need the same version of rails, the rails gem is also managed by bundler :)
<f0ster>
however it happened, I was running down specific versions of mysql header files to get the right versions of the gems for AR to compile
<JonnieCache>
f0ster: only the same version of ruby
Dwarf has joined #ruby
<f0ster>
ah
<workmad3>
f0ster: you basically just need ruby (same version and patchlevel is generally advised), rubygems (preferably latest) and bundler installed
fermion has quit [Quit: P]
* f0ster
nods
<JonnieCache>
it locks all the dependencies, resolves conflicts, optimises version numbers within limits and so on
<workmad3>
f0ster: and then bundle install - voila, all the same versions of the gems are installed :)
<f0ster>
well if I'm committing to ruby anyways I might as well try pry
fermion has joined #ruby
<f0ster>
how does bundle relate to the Gemfile
<lupine>
well, development and production environments are very different
<JonnieCache>
the gemfile is the main thing bundler deals with
stim371 has quit [Quit: stim371]
<workmad3>
bundler is the thing that reads the Gemfile, works out a dependency graph to provision your app with and records that in Gemfile.lock
<lupine>
all my ruby applications - and dependencies - are in .deb packages on production
<lupine>
but I use gems and rvm in development
<f0ster>
ahh
<JonnieCache>
f0ster: pry is great i recommended it to you not because its essential for debugging but just because its very very useful in general
<workmad3>
it'll then set up the environment so that those gems are the only ones available during the ruby process
ananthakumaran has quit [Quit: Leaving.]
krz has quit [Quit: krz]
<f0ster>
great, thanks for all the input :)
<f0ster>
I try to avoid rails related questions here but its always a wash which channel will be more responsive
eldariof has joined #ruby
davidd12 has joined #ruby
<workmad3>
f0ster: one of the nice things about bundler is that it really is more of a provisioner... if you need to override a gem with a different implementation (e.g. a fork of a specific gem version with a patch in it) then you can tell bundler where to get the gem from (github repo, filesystem path or a different gem repo) and bundler will use that
<f0ster>
ahh
<f0ster>
I have to read up on the tools I have, just many pieces in motion
alvaro_o has joined #ruby
<f0ster>
I'm already using rvm too so hopefully i wont inadvertantely mess something up lol
fermion has quit [Client Quit]
<workmad3>
it's generally pretty easy to reset if something does mess up, especially with gemfiles
jonahR_ has joined #ruby
fermion has joined #ruby
<JonnieCache>
f0ster: yeah there are a lot of moving parts i can sympathise with that
mmitchell has quit [Remote host closed the connection]
<workmad3>
mess up a gemfile and accidentally updated to versions that break? easy, just revert your Gemfile.lock in the source control and it's undone
<JonnieCache>
thats modern web development in general though
skepti has quit [Quit: Leaving]
<workmad3>
as opposed to the pre-bundler version of working out which gems just updated manually and gem uninstalling them until you get back to a working solution...
csgui has quit [Quit: csgui]
arkiver has joined #ruby
mercwithamouth has quit [Ping timeout: 260 seconds]
gyre007 has quit [Remote host closed the connection]
<workmad3>
and yeah, the rails stack has, over the years I've been using it, definitely fractured into more pieces that you need to get a handle on... I could probably argue that each piece is simpler to master, but there's definitely more of them :)
<workmad3>
and it might be simpler to master the dozen or so parts of the environment, but it's still more to get a handle on when first learning than rails 2.3 was
jonahR has quit [Ping timeout: 265 seconds]
jonahR_ is now known as jonahR
miskander has joined #ruby
<JonnieCache>
a lot depends how how much you already know from other languages
miskander has quit [Client Quit]
<JonnieCache>
it must be insanely indimitading for true newbies to development to come into rails now
<Xeago>
yup
<Xeago>
even for me
<Xeago>
rails is scary
<JonnieCache>
having to learn rvm, git, bundler and so on, THEN learn rails itself
<f0ster>
so what should I know about gemsets in relation to gemfiles and bundler ?
<Xeago>
rvm, I'd say that is not an issue for rails?
ryanjh has quit [Quit: Computer has gone to sleep.]
<Xeago>
if you are lucky you have a recent version of ruby already
browndawg has quit [Ping timeout: 260 seconds]
vlad_starkov has quit [Remote host closed the connection]
<workmad3>
f0ster: you can pretty much safely ignore gemsets when using bundler
<f0ster>
workmad3: well I have rvm, so curious what I need to know if anything
<workmad3>
f0ster: they were a workaround at the time that rvm was released (which was before bundler was really hitting big time) to roughly the same problem
timonv has quit [Remote host closed the connection]
<f0ster>
ahh
jjbohn has quit [Quit: Leaving...]
<workmad3>
f0ster: in essence, a gemset is simply a distinct gem repository, so you could have a gemset with all the gems for a project in it
<f0ster>
but rvm also does ruby versioning.. a
brianpWins has joined #ruby
<f0ster>
Ahh
zeade has joined #ruby
jeffreybaird has quit [Quit: jeffreybaird]
<workmad3>
f0ster: and switch between gemsets to activate different projects, without having gem activation conflicts or weird breakages because a gem's dependency didn't specify an exact version
<f0ster>
okay
c0rn has joined #ruby
c0rn has quit [Client Quit]
daniel_-_ has joined #ruby
s1n4 has joined #ruby
daniel_-_ has quit [Client Quit]
daniel_-_ has joined #ruby
* f0ster
tinkers with pry
mercwithamouth has joined #ruby
daniel_-_ has quit [Client Quit]
slainer68 has quit [Remote host closed the connection]
c0rn has joined #ruby
daniel_- has quit [Ping timeout: 252 seconds]
jjbohn has joined #ruby
matled has quit [Ping timeout: 265 seconds]
cantonic has quit [Quit: cantonic]
nomenkun has joined #ruby
<Eiam>
JonnieCache: ha, yes its pretty wild
<Eiam>
I had to jump into working on a rails app with knowing 0 ruby, rvm, bundler, gems etc
cardoni has joined #ruby
francisfish has joined #ruby
<Eiam>
i still barely know them, but I know enough to do usually what I need to do. i hate whenever I run into problems with bundler, gemfiles or rvm which are by far the largest dev timesinks I have
timonv has joined #ruby
<JonnieCache>
you learn so much so fast though. im so glad i taught myself all this stuff in uni. they didnt teach me any of that stuff in the courses haha
cdt has quit [Ping timeout: 260 seconds]
<Eiam>
I had some bug in passenger phusion + rvm that look me 2 days to figure out
<Eiam>
ended up just uninstalling RVM
<JonnieCache>
theres a whole generation of developers thats now addicted to DRY, TDD and best practices/workflow in general because of rails
<Eiam>
because I couldn't find a solution that would work with rv enabled
<JonnieCache>
and thats a very good thing i think
baphled has quit [Ping timeout: 240 seconds]
ngoldman_ has joined #ruby
moted has joined #ruby
<csmrfx>
Because of rails?
<csmrfx>
Kinda overstating it
<Eiam>
^
<Eiam>
its just general programming atmosphere right now from where I stand
<Eiam>
its popular
AlbireoX has quit [Remote host closed the connection]
<Eiam>
it'll fade and something else will replace it
jduan1981 has quit [Quit: jduan1981]
<csmrfx>
Majority of the ones using DRY and TDD would probably be using something that starts with "java"
<csmrfx>
makes rails look marginal
<csmrfx>
just part of the wave yanno
AlbireoX has joined #ruby
ViPi has quit [Quit: Computer has gone to sleep.]
mahmoudimus has joined #ruby
<Eiam>
the wheel of time turns and programming languages & best practices come and pass, leaving memories that become legend. legend fades to myth and even myth is long forgotten when the age that gave it birth comes again
<banister`sleep>
Eiam: lol, you just watched the hobbit?
xeviox is now known as xeviox|awy
alex__c2022 has joined #ruby
includex has quit [Quit: Leaving...]
<Eiam>
banister`sleep: certrainly not, is he stealing stuff from robert jordan?
xeviox|awy is now known as xeviox
ngoldman has quit [Ping timeout: 265 seconds]
<banister`sleep>
Eiam: jsut the "legend turns into myth" thing
<Eiam>
cause the eye of the world came out in 1990 which is quite awhile before the hobbit movie was released
greg- has joined #ruby
<banister`sleep>
Eiam: haha, but the hobbit book came out ago ;)
<csmrfx>
but when did hobbit-the-book come out
kpshek has joined #ruby
maxmanders has quit [Remote host closed the connection]
jeffreybaird has joined #ruby
<Eiam>
banister`sleep: I'm not sure I want to say that because the hobbit movie did something that its present in the book
timonv has quit [Remote host closed the connection]
<Eiam>
certainly tolkiens hier would vehenmently disagree with that sentiment =)
<Eiam>
heir
<Eiam>
vehemently
<csmrfx>
ok, typoists, start your spell checkers!
<Eiam>
dunno why my auto correct was barfing on me =(
mercwithamouth has quit [Ping timeout: 252 seconds]
<Eiam>
so you said the movie, which I compared against. I have not read the hobbit book in a very very long time so I don't know if it also contains something similiar or not. It may well, given tolkiens general creation of the high fantasy genre
<Eiam>
despite authoring some of the most boring books I've ever read. anyway we are totall off track now =)
jds_ has joined #ruby
arkiver has quit [Quit: Leaving]
workmad3 has quit [Ping timeout: 260 seconds]
cardoni has quit [Ping timeout: 252 seconds]
davidd12 has quit [Remote host closed the connection]
<csmrfx>
Those books are not boring, it's just your attention span is so short
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
<Eiam>
yeah I managed to read 8 wheel of time books totallying 8000 pages
<csmrfx>
I wonder what would _why program to this discussion
<Eiam>
but i've got a terrible attention span
<ged>
Does anyone have a feel for whether it's acceptable/desired to use -rpath for Ruby extensions to ensure it loads the same version of the library it's linking against at gem-install time?
PragCypher has quit [Read error: No route to host]
<Eiam>
csmrfx: tolkien was clearly interested in creating languages & cultures, entire worlds. much of that process and detail is incredibly boring information unless you happen to be into fake history and fake languages that basically no one speaks. none of those are interesting to me
karamorf has joined #ruby
jds_ has quit [Ping timeout: 240 seconds]
<csmrfx>
ged you mean '-r'?
c3vin has quit [Ping timeout: 240 seconds]
[1]c3vin is now known as c3vin
<karamorf>
what does $_ do in Ruby? is it just like Perl?
<ged>
csmrfx: Neither: writing an extconf.rb for a Ruby extension.
<Eiam>
csmrfx: have not painted myself anywhere. programming languages are indeed communicated. yes, they are invented and often people invent ones that are mostly worthless or simply prove some particular point, they languish in disuse and dissapear
<Eiam>
much like tolkiens languages
<eka>
afaik tolkien based itself in the sanskrit language that he liked so much
<csmrfx>
Eiam: just going by what you said, you said it, not me
chussenot has quit [Quit: chussenot]
<Eiam>
csmrfx: you took the word spoken and translated it to audible, but spoken can just as easily mean communicated
<ged>
csmrfx: I want to ensure the shared library it links against at compile time is the same one it loads at runtime.
kpshek has quit []
<csmrfx>
s/said/wrote/
chrismcg is now known as zz_chrismcg
<Eiam>
i'm not going to get into a word nit pick over it. tolkiens language only has value because he has such a culture around him. look at tons of other languages with more ostensible value (esperanto?) than 'elvish' and they languish
<csmrfx>
ged: I do not know how to ensure that
<csmrfx>
I think you are at the mercy of path
<csmrfx>
I know of --disable-rpath but that would be the opposite, I guess
<Eiam>
tolkien was not a good author, his stories were not engaging to the majority of his audience. he invented a genre and its a wonderful genre, and he had some great concepts. his books sucked.
noxoc has quit [Quit: noxoc]
<karl____>
please take it to #tolkien
<Eiam>
anyway, done on that topic
<ged>
csmrfx: Well, -rpath adds directories to the dynamic linker's runtime search path, but I've never used it before.
<csmrfx>
Eiam: and Elvis was not popular, and lives in Helsinki
squidBits has joined #ruby
krawchyk has quit [Ping timeout: 265 seconds]
<ged>
But so many people have trouble with multiple installed versions of this library, I was thinking -rpath could help.
kdavh has joined #ruby
<jpfuentes2>
<csmrfx> Eiam: programming languages are "fake" and are not even meant to be spoken, are basically not spoken
<csmrfx>
ged: ever seen that "--with-libname-here" business?
AltGrendel has left #ruby [#ruby]
DrCode has quit [Ping timeout: 276 seconds]
<Gate>
jpfuentes2: yeah, but that code largely doesn't work on close inspection.
blueOxigen has joined #ruby
<jpfuentes2>
what do you doesn't *work* ?
a_a_g has quit [Quit: Leaving.]
mwlang has quit [Quit: mwlang]
ThaDick has joined #ruby
<ged>
csmrfx: Like --with-openssl-dir=/usr/lib ?
<Eiam>
jpfuentes2: as was pointed out, hes basically invented a sublanguage and stuffed it inside 'love'. thats a cool attribute of ruby and how we get so many DSL. I don't think that proves anything however.
bluOxigen has quit [Ping timeout: 256 seconds]
<jpfuentes2>
Eiam that is me, btw
<csmrfx>
ged: sometiems those also have lib version or some parameters, maybe thats what you want
shevy2 has joined #ruby
io_syl has joined #ruby
<Gate>
jpfuentes2: %w(i n c r e d i b l y).zip(*"wonderful") #=> NoMethodError: undefined method `each' for "wonderful":String
<Eiam>
jpfuentes2: well, cool article. I wouldn't go around speaking to anyone like that however. =)
<jpfuentes2>
what version of ruby are you using, gate ?
<ged>
csmrfx: Nah, that's for people *installing* the library. It doesn't affect the extension at runtime.
<Gate>
just saying, its awesome, but its taking literary licence with code.
<jpfuentes2>
works for me on 1.9.3
<f0ster>
I have an object created like, "#<WorkTeamAvailability id: 106, day_of_week: 0, work_team_id: 27, start_time: "2000-01-01 14:00:00"", I get an error when I try to do something like, this_object.start_time, saying it is an undefined method? the exception said the object was an ActiveRecord::Relation
<ged>
So people will do: --with-openssl-dir=/usr/local, which will let the gem install okay, but then if their linker doesn't look in /usr/local/lib when the extension is loaded, it can load one from /usr/lib, and that's the problem I'm trying to mitigate.
<Eiam>
jpfuentes2: does't work for me in 1.9.3-p0
<Eiam>
same error
<jpfuentes2>
why are you using p0 ? : )
<csmrfx>
Text is not "spoken" language
<csmrfx>
it is "written". FYI.
<Eiam>
jpfuentes2: I don't update without cause =p
<jpfuentes2>
pretty sure there are security issues w/ p0
<jpfuentes2>
that would be a good cause
<Gate>
jpfuentes2: doesn't work with p286 or p362 either
<Eiam>
csmrfx: : to make known in writing : state
<Eiam>
: to use or be able to use in speaking <speaks Spanish>
<Gate>
Now you could assume that he added methods to base classes, but what are we, barbarians?
shevy has quit [Ping timeout: 265 seconds]
DrCode has joined #ruby
<karl____>
please take this to #pedantry
<Eiam>
err speaking always have to do with verbal
<Gate>
heh, I hadn't noticed the link to love.rb
<csmrfx>
Ok, speaking has nothing to do with text, written things are the same as "spoken", Tolkien was a shitty author, and... what else Eiam
tjbiddle has joined #ruby
alvaro_o has quit [Quit: Ex-Chat]
mercwithamouth has joined #ruby
<csmrfx>
no, wait, "I dont care", actually
<Eiam>
csmrfx: I corrected that statement in the next line sheesh =P you do enjoy pedantry don't you
<Gate>
jpfuentes2: my fault, he *does* add methods to String and Array to make this work.
alvaro_o has joined #ruby
tjbiddle has quit [Remote host closed the connection]
<jpfuentes2>
yeah, it's definitely a working program
<jpfuentes2>
i'm surprised it doesn't work in the other high versions of 1.9.3 though
<jpfuentes2>
i'll check 'em out
<Gate>
jpfuentes2: I was just trying that small snipped sans his monkey-patching. I didn't realize he was injecting methods on to string. I have no doubt it will work with the monkeypatches.
<jpfuentes2>
btw, gate, that "he" is me
apeiros_ has quit [Remote host closed the connection]
tjbiddle has joined #ruby
<csmrfx>
like We::Wish.we_could { ... } would work without a module etc
pcarrier has quit [Read error: Connection reset by peer]
<jpfuentes2>
right, there's a lot of different ways to make the program work
osaut_ has joined #ruby
jeffreybaird has joined #ruby
sn0wb1rd has quit [Quit: sn0wb1rd]
<jpfuentes2>
some of my choices were made as a way to display the intricacies of the language
kidoz has joined #ruby
<jpfuentes2>
because my intention was to use it as a learning exercise with my daughter one day when she has enough ruby under her belt too understand the esoteric bits of the language
<Gate>
jpfuentes2: Ah, well then. My apologies. It is an awesome poem BTW.
<csmrfx>
Whats always_be: ?
<jpfuentes2>
thanks
havenn has quit [Remote host closed the connection]
<jpfuentes2>
always_be: is the ruby 1.9.3 hash syntax
<Gate>
jpfuentes2: I just saw the string/array zip and tried it out on its own and hadn't looked to see your monkeypatch which makes it work fine.
workmad3 has quit [Ping timeout: 244 seconds]
<csmrfx>
oh, right
<jpfuentes2>
instead of :my_symbol => value, you can use my_symbol: value
ossareh has quit [Ping timeout: 265 seconds]
<jpfuentes2>
agh, right, gate
<csmrfx>
why not:
osaut has quit [Ping timeout: 260 seconds]
osaut_ is now known as osaut
<jpfuentes2>
yeah you can git clone the repo and `ruby letter.rb`
a_a_g has joined #ruby
<jpfuentes2>
that should work as it requires the love.rb support file : )
<csmrfx>
hm, nm
<Hanmac>
Gate jpfuentes2 String does loose the each method .. so you need to specifiy what you want to iterate ... so its each_char.zip( ... )
<csmrfx>
I am way too tired to write code
andrewhl has quit [Remote host closed the connection]
<jpfuentes2>
%w(i n c) => array
<csmrfx>
I think I will go work on the *non-spoken* and -written language
ryanjh has joined #ruby
<jpfuentes2>
not a string
<Gate>
Which would detract from the point of the poem by injecting poorly contexted words
<Hanmac>
oh
<jpfuentes2>
so i you don't need an each/each_char .. you just need Array#zip
<Hanmac>
jpfuentes its about the "wonderful"
<jpfuentes2>
but i had to modify String#each => self.chars so that i could splat the wonderful string like so *"wonderful!"
jblack has quit [Ping timeout: 248 seconds]
<jpfuentes2>
String#chars gives an array of each character, which allows that to be passed to zip appropriately
<csmrfx>
btw why "wincredibly zip wonderful"?
<csmrfx>
;)
<f0ster>
having trouble accessing an attribute on my model, seems really straight forward if anyone can help: https://gist.github.com/4495480
<jpfuentes2>
%w() is a convenient way to make an array without all the quoting
<jpfuentes2>
it also put emphasis on "incredible"
<jpfuentes2>
by putting spacing b/t each letter
<csmrfx>
I mean, why not ditch the non-english when it was done elsewhere
<jpfuentes2>
i n c r e d i b l e VS incredible => stands out more
<Hanmac>
f0ster : #rubyonrails
<csmrfx>
wincredible zip wonderful is what it reads now
ryanjh has quit [Quit: Computer has gone to sleep.]
danneu has joined #ruby
rwilcox has joined #ruby
fred909 has joined #ruby
ossareh has joined #ruby
sailias has joined #ruby
DrCode has quit [Remote host closed the connection]
kdavh has quit [Remote host closed the connection]
arabi has joined #ruby
emocakes has quit [Client Quit]
<arabi>
I am a newbie ... I have some doubts regarding modules .....
kdavh has joined #ruby
eregon has quit [Ping timeout: 248 seconds]
<arabi>
1. Why puts classes inside module .. as I know module is for method sharing
<arabi>
2. Why wanna put modules inside class
ryanjh has joined #ruby
<Hanmac>
arabi 1&2 its like namespaces in C++
<arabi>
please help
eregon has joined #ruby
<arabi>
I don't know C++ :(
<whitequark>
banister`sleep: oh I thought it was #jruby
nemesit has joined #ruby
<banister`sleep>
haha
<arabi>
Hanmac, can you give me some resource covering the topics with good examples
<banister`sleep>
whitequark: meaning you dont actually want to be on #ruby or you just typed into the wrong window?
patronus1 has quit [Ping timeout: 256 seconds]
<whitequark>
banister`sleep: wrong window
<whitequark>
I've nothing against #ruby
shiroginne_ has quit [Quit: Connection closed for inactivity]
<arabi>
whether I wanna learn namespace of C++ prior to learnig ruby ???
<Hanmac>
arabi: like then you have two gems, "a" and "b", when both define Color classes you cant put them in a toplevel space because the methods would overwrite eachother ... thats why you define the classes as A::Color and B::Color
ebouchut has joined #ruby
<arabi>
Hanmac, give me some time to think about your reply thanks :)
patronus_ has joined #ruby
kdavh_ has joined #ruby
kdavh has quit [Ping timeout: 256 seconds]
elico has joined #ruby
joeycarmello has joined #ruby
ebouchut has quit [Client Quit]
karasawa has joined #ruby
<arabi>
Hanmac, thanks ... i got something from you lemme read PickAxe again and come back later .. have a nice time
arabi has quit [Quit: Leaving]
kdavh_ has quit [Remote host closed the connection]
mame1 has joined #ruby
megha has joined #ruby
mame0 has quit [Ping timeout: 248 seconds]
cantonic has joined #ruby
katzekintosh has joined #ruby
FroMaster2 has joined #ruby
jds_ has joined #ruby
<Eiam>
Hanmac: I have a bunch of classes that belong to a top level project, putting them in a module keeps it organized. The module has 4 classes in it that are all related to the module topic, but do different things
<Eiam>
Hanmac: wrong person =)
<Eiam>
^ arabi
niceume has joined #ruby
<Eiam>
oh he left
FroMaster has quit [Ping timeout: 265 seconds]
Axsuul has quit [Ping timeout: 265 seconds]
_nitti has quit [Remote host closed the connection]
niceume has quit [Client Quit]
strtok has joined #ruby
cantonic has quit [Ping timeout: 248 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
jds_ has quit [Ping timeout: 244 seconds]
JohnBat26 has joined #ruby
voodoofish430 has joined #ruby
DrCode has joined #ruby
akl_ has joined #ruby
<Hanmac>
i need an Nokogiri user, is someone there?
samphippen has joined #ruby
main has joined #ruby
<danneu>
Hanmac: depends on the question
<Hanmac>
danneu try to read from an XML file while $DEBUG is true
blueOxigen has quit [Ping timeout: 248 seconds]
jrist is now known as jrist-afk
samphippen has quit [Client Quit]
ingy has joined #ruby
llaskin1 has joined #ruby
ingy has left #ruby [#ruby]
mercwithamouth has quit [Ping timeout: 256 seconds]
Spami has quit [Quit: This computer has gone to sleep]
llaskin has quit [Ping timeout: 240 seconds]
jerius has quit [Ping timeout: 240 seconds]
<Hanmac>
danneu did something happen?
Neomex has joined #ruby
bluOxigen has joined #ruby
jduan1981 has joined #ruby
<ericwood>
so what's the nokogiri question?
patronus_ has quit [Ping timeout: 240 seconds]
LouisGB has quit [Read error: Connection reset by peer]
<Spooner>
Dann1, You've made us all look at swears! I'm telling on you!
DrShoggoth has joined #ruby
<ThaDick>
Trying to google this to no avail, was wondering if there is a tool/script that will convert all files in a ruby app to pdf? I know this is a horrible scenario, but the boss gets what the boss wants.
<ThaDick>
Sorry convert should be parse to pdf
krawchyk_ has quit [Remote host closed the connection]
<whit537>
Neither of the recommended install options give me the -e feature, afaict.
<Dann1>
is it a gem?
timonv has joined #ruby
nathancahill has quit [Read error: Connection reset by peer]
<whit537>
Yes, but ...
<Dann1>
Oh
<whit537>
`gem install foreman` gives me 0.60.2, which doesn't have -e afaict.
<ThaDick>
Yeah, I know there are plenty of pdf gems, but I was looking for something more specific … Something that would automate the process of identifying all files within the the application, then converting them to pdf … I guess I can just roll my own
<whit537>
Spooner: It is an option to the start subcommand, not foreman itself.
<Spooner>
I moved to sublime recently, I must admit, mainly because I'm using Linux more and don't want a pure Windows thingie.
<whit537>
$ foreman start -e foo.env
<whit537>
Like that.
<Spooner>
whit537, Aaaaah. Fair enough.
<whit537>
Okay, thanks for the help. :)
<karl____>
i'm doing nokogiri SAX parsing...can someone "read" out what this is doing: @state[:os] ||= {}
<Spooner>
karl____, @state[:os] = {} if @state[:os].nil? (could be clearer, perhaps)
<Dann1>
I'll be out for a bit now. Thanks for the minor help ^^
Dann1 has quit [Quit: Dann1]
<Spooner>
Sorry, I remember having exactly the same problem in Notepad++ actually.
<Spooner>
Don't remember if I resolved it :D
<xeviox>
I have this code: http://pastebin.com/CmmAdwtY but when I run it with "./myapp -a /path/to/a/file" I always get "Missing parameter: One or more packages". Any idea what I'm doing wrong?
<timonv>
karl____: @state[:os] || state[:os] = {}
Xeago has quit [Remote host closed the connection]
<timonv>
It's slightly different ;-)
<karl____>
Spooner; timonv THANK YOU!
<timonv>
xeviox: is there a shebang there?
mneorr has joined #ruby
<Spooner>
timonv, Not really. It would be written that way with: @state[:os] = state[:os] || {}
whit537 has left #ruby [#ruby]
<fuzai>
Is there any kind of module for ruby that i could give a function a zip code and it will return a weather summary for the zip code in a string?
<timonv>
which is different spooner
cantonic has quit [Quit: cantonic]
<timonv>
Yours reassigns ;-)
Dann1 has joined #ruby
<timonv>
xeviox: Also missing a require
Dann1 has quit [Client Quit]
<Spooner>
Oh yeah, I wasn't reading yours right. It is just horrid though and not consistent with the other op= (it works for ||, but not anything else).
Rym has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
kzar has joined #ruby
tvw has quit [Remote host closed the connection]
havenn has joined #ruby
DrCode has joined #ruby
Nisstyre has quit [Ping timeout: 260 seconds]
toekutr has joined #ruby
_nitti has joined #ruby
krawchyk has joined #ruby
ThaDick has left #ruby [#ruby]
cascalheira has joined #ruby
maletor has joined #ruby
jjbohn has quit [Quit: Leaving...]
h4mz1d has joined #ruby
freakazoid0223 has joined #ruby
Coolhand|laptop_ has joined #ruby
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
Coolhand|laptop has quit [Ping timeout: 265 seconds]
workmad3 has joined #ruby
sailias has joined #ruby
samphippen has joined #ruby
<xeviox>
timonv: yes both, I just posted relevant part of the code ..
apeiros_ has joined #ruby
<xeviox>
timonv: it must have something to do with the OptionParser
DrCode has quit [Remote host closed the connection]
thillux_ has joined #ruby
buibex has joined #ruby
Nisstyre has joined #ruby
Guest25886 has quit [Ping timeout: 260 seconds]
jrist-afk is now known as jrist
reset has quit [Quit: Leaving...]
thillux has quit [Ping timeout: 255 seconds]
Russell^^ has joined #ruby
NullByte is now known as Bulgaria
Rym has quit [Quit: Rym]
jeffreybaird has quit [Quit: jeffreybaird]
Russell^^ has quit [Client Quit]
jeffreybaird has joined #ruby
Russell^^ has joined #ruby
benlieb has quit [Quit: benlieb]
samuel02 has quit [Remote host closed the connection]
benlieb has joined #ruby
eldariof has quit []
Guest25886 has joined #ruby
grzywacz has joined #ruby
grzywacz has quit [Changing host]
grzywacz has joined #ruby
timonv has quit [Remote host closed the connection]
carloslopes has quit [Remote host closed the connection]
answer_42 has quit [Remote host closed the connection]
cdt has joined #ruby
benlieb has quit [Ping timeout: 248 seconds]
fteem has joined #ruby
kirun has quit [Ping timeout: 240 seconds]
Dann1 has joined #ruby
h4mz1d has quit [Ping timeout: 256 seconds]
nomenkun has quit [Remote host closed the connection]
fermion has joined #ruby
wermel has quit [Remote host closed the connection]
IrishGringo has quit [Quit: ChatZilla 0.9.89 [Firefox 17.0.1/20121128204232]]
<shevy>
"You never understand a problem as good as in the moment you solve it."
pkrnj has quit [Quit: Computer has gone to sleep.]
greg- has quit [Quit: greg-]
<fuzai>
if message.content =~ /command['trigger']/ Whats the correct way to put a variable between the //?
dr_neek has quit [Quit: dr_neek]
ryannielson has joined #ruby
mneorr_ has joined #ruby
<apeiros_>
fuzai: #{}
<fuzai>
oh ok
<ryannielson>
Anyone have any recommendations for a markdown to html parser? Preferrably written in pure ruby and supporting some of the Github markdown features.
<apeiros_>
ryannielson: maruku, not sure about pure ruby
<shevy>
is funny though because "Multiple ways of doing the same thing only leads to confusion. It has no benefit."... if all you have a hammer, everything will look like a nail
icco has joined #ruby
<ericwood>
I've used it before, it's teh awesomesauce
timonv has joined #ruby
<ryannielson>
Ya, ideally looking for something without any dependencies on c libraries to ease installation and stuff. But if it's that good I may be able to budge.
mneorr has quit [Ping timeout: 256 seconds]
<ericwood>
you'll be fine
DrCode has joined #ruby
_46bit has joined #ruby
digitalsanctum has quit [Remote host closed the connection]
<ryannielson>
ericwood: Alrighty, I'll give it a shot. Thanks for the suggestions everyone.
<graft>
it's simple and light, but it doesn't seem to be very fast... the rails 'pluck' command is much faster
<shevy>
Dann1, this resides in a file?
<Dann1>
The semi-retarded DOS programmind language
philcrissman has joined #ruby
<Dann1>
Google it for god's sake :)
stim371 has joined #ruby
pkrnj has joined #ruby
<graft>
you want to run dos commands in irb?
<Dann1>
Yes, like color and title.
<Dann1>
Mostly only those two.
<banister`sleep>
donyou can run 'dos' commands in pry by prepending a '.' to your command
<banister`sleep>
Dann1: i.e .dir
<havenn>
Dann1: Use Pry and prefix your batch with a dot, or can't you just shell out with backticks like?: `dir`
jrist is now known as jrist-brb
geekbri_ has quit [Remote host closed the connection]
<havenn>
Do system(), ``, exec and friends work with Windows? I've never tried?
<havenn>
Dann1: What banister said though, cause Pry is awesome!
theRoUS has quit [Ping timeout: 240 seconds]
<Dann1>
Ah
<Dann1>
Pry it'll be :D
<Dann1>
Oh mai glob
<Dann1>
I can automate missing gem installs with this thing
ngoldman has joined #ruby
nemesit has quit [Remote host closed the connection]
<Dann1>
8D
LouisGB has joined #ruby
<Dann1>
Also got win32console to get colours showing up
<Dann1>
Pretty pretty DOS
sepp2k1 has joined #ruby
<grzywacz>
Dann1, automate missing gem installs? sounds like you're going to backup a nice portion of the interwebs soon ;)
<Eiam>
I have some performance problems with a ruby script I'm working on. Is there a good resource i can use to dig into whats causing my performance issues ?
<grzywacz>
swarley, that's a fundamental optimization
<apeiros_>
they only guarantee no false positives, but don't guarantee no false negatives.
samphippen has quit [Quit: Computer has gone to sleep.]
<swarley>
File.atime(file)
<cina>
Hi, the documentation says Time.wday returns 0..6 for weekdays. Is there any convinient constant/variable for accessing these numbers by name?
<grzywacz>
Anyhow, it should be smarter/dumber than it is at this level.
<grzywacz>
*shouldn't
<grzywacz>
duh
<Eiam>
okay so, lets take this case then. Clearly I'm reloading a file wAY more often that I need to be. Is there a set of performance tools that would have highlighted this particular stupid mistake?
<swarley>
No
<apeiros_>
Eiam: ruby-prof
<grzywacz>
swarley, it's normal to mount filesystems with noatime, even local ones.
<Eiam>
apeiros_: I've got that open right now
<swarley>
That seems like an invitation to break things
h4mz1d has joined #ruby
<swarley>
what about ctime?
<apeiros_>
swarley: even if, point is that atime is not guaranteed
<apeiros_>
so any generic caching system using it is brittle
<swarley>
≪ swarley ≫ what about ctime?
hotovson has quit [Remote host closed the connection]
jjbohn has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
clooth has quit [Quit: clooth]
Kuifje has quit [Ping timeout: 248 seconds]
jeffreybaird has joined #ruby
jonathanwallace has joined #ruby
CaptainKnots has quit [Quit: bazinga!]
<Hanmac>
swarley ctime is the creation time, atime is the access time
rezzack has joined #ruby
<swarley>
oh, I thought ctime was the actual change time
CaptainKnots has joined #ruby
bean has quit [Quit: Computer has gone to sleep.]
<Dann1>
Woah
<Dann1>
I actually thought you all meant 'crime'
<Dann1>
Had me sitting here like 'what the hell is this'
<Eiam>
okay code modified. once it fails again ill start it up & see how it does with the changes, then ruby-prof & see what else it shows if its still slow
<Hanmac>
Dann1 yeah it its two :P
Nisstyre has joined #ruby
otters has quit [Ping timeout: 252 seconds]
matip has joined #ruby
Rym has joined #ruby
h4mz1d has quit [Ping timeout: 256 seconds]
zph has quit [Quit: Computer has gone to sleep.]
Coolhand|laptop_ has quit [Remote host closed the connection]
<Dann1>
:3
johnmilton has joined #ruby
buibex has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 255 seconds]
<Dann1>
Yessss
<Dann1>
Bottesque
<Dann1>
She worksss
<Dann1>
Wait
carloslopes has joined #ruby
pskosinski has quit [Quit: Learn Life's Little Lessons]
<Dann1>
Why won't she connect to the extra channel
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
elico has quit [Read error: No route to host]
asteve has quit [Quit: Computer has gone to sleep.]
wroathe has quit [Ping timeout: 248 seconds]
<fuzai>
http://rubyweather.rubyforge.org/ from the howto, the function require_gem isn't defined so says ruby. Could anyone explaint o me what i have to do to make this work?
<Muz>
fuzai: that example looks like it's from 2006. require_gem isn't needed anymore with recent versions of Ruby or Rubygems. You should be able to just 'require "gemnamehere"' in 1.9.X
<Muz>
I wouldn't be surprised if that library is broken in otherways though given the age.
<fuzai>
ok i'll just use the yahoo api instead
<fuzai>
it looks newer
<apeiros_>
require_gem is very old
<apeiros_>
it has been removed back in 1.8.x, I think 1.8.4 or something
zph has quit [Client Quit]
solidresolve has quit [Remote host closed the connection]
<apeiros_>
people used it wrongly… it was basically `gem *; require *` in one method
<apeiros_>
and since you shouldn't have to use the `gem *` method…
* Muz
recalls what's waiting for him at work tomorrow. That bastard 6 year old Rails app.
solidresolve has joined #ruby
xeviox has left #ruby ["Leaving"]
Zolrath has quit [Ping timeout: 260 seconds]
nemesit has joined #ruby
<Eiam>
Muz: could be worse, could be some bastardized sproutcore + rails app mixed with jquery
andrewhl has joined #ruby
mark_locklear has quit [Remote host closed the connection]
zph has joined #ruby
<Muz>
I don't think you full appreciate how overengineered and needlessly Enterprise this rails app is.
<Muz>
*fully
<Eiam>
I dunno, I work in "Enterprise"
<Eiam>
although I wish my rails app were overengineered =)
<Eiam>
it suffers from an extreme lack of…. engineering =)
Zolrath has joined #ruby
<shevy>
Muz!
<shevy>
you always do proper sentences on IRC
<Eiam>
but it sure can solve problems ha ha
<shevy>
you are my hero :)
<Muz>
shevy: are you doing FOSDEM this year?
<shevy>
I only do beer sessions
c3vin has quit [Ping timeout: 240 seconds]
<Eiam>
shevy: well, generally its poor form to end a sentence in the word "is" so… there is that ;P
v0n has quit [Ping timeout: 256 seconds]
reset has joined #ruby
bluOxigen has quit [Ping timeout: 244 seconds]
marr has joined #ruby
<shevy>
I mean the '.' Eiam
<shevy>
:)
<Eiam>
oh, psh
<shevy>
Eiam you now on the other hand are a born IRC person... you hate the .
<Eiam>
shevy: well I've been on IRC since the early 90s so… yeah
<llaskin1>
has the functionality of "next" changed in 1.9.3 from 1.8.7
<aedorn>
I have a sudden urge to make a "who has the best grammar on IRC" app.
<shevy>
to idle to power makes people lazy
banister`sleep has quit [Read error: Connection reset by peer]
<shevy>
yay aedorn
<Eiam>
aedorn: how would you handle oxford commas, and other sometimes argued or accepted in some circles not accepted in otherisms of english?
<shevy>
Eiam yeah, almost the same here, though more like the late 90s for me, with mIRC, I just find it interesting that some people use .
<fuzai>
Wow 4 weather modules and none of them work :(
<shevy>
never knew something like that even exists... I dont think anything like that exists in german
<shevy>
fuzai fate of natural code decay :)
<Eiam>
shevy: this is why the idea of someone writing an app to parse English (assumed, given its what we 'speak' here) amused me, given its many many rules, several of which are heavily argued both ways =)
jrist-brb is now known as jrist
<shevy>
yeah Eiam
<shevy>
I hate that colour does not work in CSS, only color does :(
twoism has joined #ruby
<canton7>
yeah, all programming spellings are american
<canton7>
urgh, but simplifies things
<shevy>
a lot, yeah
<shevy>
music notes have different words in the USA, as opposed to the UK
<shevy>
and the US version is much, much simpler and more logical
<canton7>
I'm always torn as to whether to give my function names english or american spellings :P
<canton7>
US note name are also much longer!
jasond has joined #ruby
<aedorn>
Eiam: Vote scale.
<shevy>
I was taught british english so I still use that, but for consistency I would prefer if everyone would stick to the same
<Mon_Ouie>
Also if you're writing an application that deals with french fries and chips… It's going to be pita :D
<canton7>
(especially with things like initialize/initialise)
<shevy>
la baguette
<shevy>
yeah canton7
<shevy>
damn
<shevy>
I thought initialize is the UK variant :<
<canton7>
nup
<canton7>
interestingly, aluminum is the original, and aluminium is the bastardisation though :P
<shevy>
hmm odd... in german, it is "aluminium"
<shevy>
this is sometimes the problem with US english
jds_ has joined #ruby
<shevy>
it seems so simplified that it can become incorrect
<banister`sleep>
canton7: where did u learn that? (re aluminium)
<banister`sleep>
canton7: got a link?
<canton7>
banister`sleep, can't remember I'm afraid. The name was changed to aluminium to sound more in line with the other elements, iirc
<shevy>
sorry I was wrong
<shevy>
1808, Sir Humphry Davy, called it "Aluminum", so it seems this one ought to be the correct variant
jjbohn has quit [Quit: Leaving...]
<fuzai>
Could someone point me in the right direction, i'm trying to scrape data from a website that has the data I want hiding in a <p class=""> tag that has a unique class name
<canton7>
ah, one article claims he started with aluminium, then went to aluminum, then back
<canton7>
fuzai, nokogiri
<banister`sleep>
canton7: Sir Humphry made a bit of a mess of naming this new element, at first spelling it alumium (this was in 1807) then changing it to aluminum, and finally settling on aluminium in 1812
<aedorn>
All words are a bastardization, though. There's no longer who is right or wrong, but what is accepted and not.
<havenn>
fuzai: +1 nokogiri
<canton7>
banister`sleep, that's the one
samphippen has joined #ruby
_46bit has joined #ruby
<banister`sleep>
canton7: alumium != aluminum ;)
daniel_- has quit [Ping timeout: 248 seconds]
<canton7>
yeah, I misread oops
cina has quit [Ping timeout: 246 seconds]
<shevy>
canton7 I've become a sucker for simplicity, less ambiguity, clear terms...
<canton7>
aedorn, bastardisation was too strong a word
miphe has joined #ruby
<aedorn>
canton7: I don't think. It's been used to describe American English for a century already. I think we're okay with it!
v0n has joined #ruby
cina has joined #ruby
<canton7>
this one's from new scientist: languages primarily spoken as a second language tend to be simpler, as adults prefer stricter grammar rules and more logical languages. however, languages which are primarily spoken as a first language, and so are learnt in childhood, tend to have more obscure rules and irregularities, as it reduces ambiguity, which is what children prefer
sailias has quit [Quit: Leaving.]
Spami has quit [Quit: This computer has gone to sleep]
_46bit has quit [Read error: Connection reset by peer]
<heftig>
hm. ambiguity? what about constructed languages like lojban?
jjbohn has joined #ruby
stevechiagozie has quit [Quit: Computer has gone to sleep.]
<shevy>
naaah
mmokrysz has joined #ruby
<canton7>
in the same vein, language from warmer counties, whose speakers would tend to use it outside, tend to be less efficient, but have more redundancy, giving better noise immunity. languages from colder places, whose speakers would use the language more indoors, tend to be more efficient
<shevy>
dead languages must not count!
DrShoggoth has quit [Quit: Leaving]
<shevy>
ruby is almost like simplified english, where you can communicate with a computer
rondale_sc has quit [Quit: rondale_sc]
pu22l3r has quit [Remote host closed the connection]
PragCypher has quit [Quit: Leaving]
kpshek has joined #ruby
<Dann1>
> Python
<shevy>
canton7, the part -> "as it reduces ambiguity, which is what children prefer" actually, I prefer less ambiguity too. but I also like being able to use different words (if they have a unique meaning)... the english languages has many more words than german, sometimes expressions "fit" much better when one can talk/think in english rather than in german
<shevy>
Dann1 but you must indent in python
<shevy>
it is more of a grammar nazi than ruby
<Dann1>
u.u
<swarley>
I'd argue that python is less readable than ruby
<shevy>
it is like shouting "Yes Sir!" properly in python
<swarley>
I like python and all
<Dann1>
I have such a strong urge to go watch monty python
<shevy>
swarley could be. except for "end". I don't think "end" gives a really needed readable advantage at all, in properly formatted, short code
<swarley>
but, it's not as close to natural language as ruby
<swarley>
shevy; it's needed unless ruby was to enforce indenture
<Eiam>
apeiros_: indeed the read in was causing as expected massive slow down. thanks for the confirmation/clarification
clooth has joined #ruby
<Dann1>
Good night everyone.
Hanmac has joined #ruby
<Dann1>
__all__.bid_farewell
Dann1 has quit [Quit: Dann1]
<Eiam>
swarley: I would disagree with that =) haha
<aedorn>
Bounding elements always make text easier to read in the long run. So having 'end' is a benefit until you have multiples of it in a cluster.
Rym has quit [Quit: Rym]
artOfWar has joined #ruby
<shevy>
oh god
<shevy>
I hate __foo__ naming schemes
lolcathost has quit [Ping timeout: 252 seconds]
<artOfWar>
I have a hash like {"object_id"=>"10151327573129919"}
<shevy>
though I like to use _ as variable name
<canton7>
oh, an actual question!
<shevy>
YAY
elico has joined #ruby
<shevy>
will it continue!
<artOfWar>
now when I try to access object_id I'm getting the actual object_id
<Eiam>
everyone quiet, lets see who can answer first..
<artOfWar>
....
<shevy>
Eiam lol
<canton7>
artOfWar, myHash['object_id']
<shevy>
ok, he is getting to it slowly
<canton7>
not myHash.object_id
<artOfWar>
thanks canton7
<shevy>
!!!
<artOfWar>
thanks @canton7
<shevy>
it was that simple!
<canton7>
I win :)
<shevy>
I thought he wanted to obtain some object from ObjectSpace
zph has quit [Quit: Computer has gone to sleep.]
_nitti_ has joined #ruby
<aedorn>
I give that a 2 on the entertainment scale. I shall now go fold socks.
<shevy>
objects with id 5, 163, 64977 - please step forward. object mating session will start in ten minutes
zph has joined #ruby
freakazoid0223 has quit [Read error: Connection reset by peer]
daniel_- has joined #ruby
malkomalko has joined #ruby
TheFuzzball has quit [Quit: Computer has gone to sleep.]
Pip has quit [Quit: Leaving]
stevechiagozie has joined #ruby
<Hanmac>
shevy what are you planing to do with this fixnums?
zz_chrismcg is now known as chrismcg
fourq has joined #ruby
maxmanders has quit [Ping timeout: 265 seconds]
<shevy>
Hanmac hmm no I'd like to fetch those objects... or perhaps have them always available, and restore them ... in a gameserver with many different objects
<shevy>
ObjectSpace._id2ref
horofox has joined #ruby
<shevy>
ewww... has a _ as part of its name...
joeycarmello has quit [Remote host closed the connection]
<Hanmac>
yeah i know, i checked them
adkron has quit [Ping timeout: 276 seconds]
_nitti has quit [Ping timeout: 276 seconds]
<shevy>
Hanmac is it possible to store all objects from a project, to disc, then load them up on game-startup again (in ruby)?
maxmanders has joined #ruby
zph has quit [Client Quit]
<shevy>
*disk
<Hanmac>
Marshal?
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
rwilcox has quit []
emmanuelux has joined #ruby
slainer68 has joined #ruby
<shevy>
hmm
<shevy>
will try
<Hanmac>
hm no the rank is not high enough .. i think you need a Colonel :D
grzywacz has quit [Ping timeout: 256 seconds]
<Hanmac>
shevy: information: there are objects that cant be marshalled ... you should keep that in mind
<shevy>
:<
<Eiam>
=0 I've been using marshal and appreciate its simplicity
Slivka has joined #ruby
<Eiam>
but I need to do streaming now (appending to the file repeatedly) and yeah, marshal...
<Eiam>
no workie for that
<Hanmac>
all instances of IO,Binding,Proc, Hash with default_proc, and each normal object with has singleton methods
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
tommyvyo has quit [Remote host closed the connection]
<Hanmac>
objects wich can be dumped while having singleton methods: true, false, nil, and each instance of Module or Class (but the singleton methods are not stored)
griffindy has quit [Quit: Computer has gone to sleep.]
<pskosinski>
Well… looks like is part of openssl too, for me works…
chrismcg is now known as zz_chrismcg
d2dchat has quit [Remote host closed the connection]
Xeago has joined #ruby
_nitti_ has quit [Remote host closed the connection]
haulbert has joined #ruby
jjbohn has quit [Quit: Leaving...]
gpato has quit [Ping timeout: 246 seconds]
<Hanmac>
shevy is that a problem?
headius has quit [Quit: headius]
_46bit has left #ruby [#ruby]
<shevy>
hmmm I am not sure yet
<shevy>
one thing on my todo list is to build a MUD from scratch
_nitti has joined #ruby
<shevy>
I started 5 years ago, then gave up after writing like 500 files, so much work...
banister`sleep has quit [Remote host closed the connection]
judesamp has joined #ruby
Neomex has quit [Quit: Neomex]
maxmanders has joined #ruby
jromine has joined #ruby
mmitchell has quit [Remote host closed the connection]
ry4nn has quit [Remote host closed the connection]
llaskin1 has left #ruby [#ruby]
Hanmac has quit [Ping timeout: 245 seconds]
banister`sleep has joined #ruby
<swarley>
MUD?
haulbert has quit [Ping timeout: 246 seconds]
gyre008 has joined #ruby
gpato has joined #ruby
Guest73173 has quit [Ping timeout: 256 seconds]
kjellski has joined #ruby
jblack has quit [Ping timeout: 255 seconds]
ebobby has joined #ruby
willob has quit [Quit: Leaving.]
zph has joined #ruby
graft_ has joined #ruby
graft_ has quit [Changing host]
graft_ has joined #ruby
lolcathost has joined #ruby
julian-delphiki has joined #ruby
julian-delphiki is now known as bean
havenn has quit [Remote host closed the connection]
v0n has quit [Ping timeout: 252 seconds]
havenn has joined #ruby
shtirlic has joined #ruby
bean has quit [Client Quit]
julian-delphiki has joined #ruby
jeffreybaird has quit [Quit: jeffreybaird]
timonv has joined #ruby
chussenot has joined #ruby
chussenot has quit [Client Quit]
judesamp has left #ruby [#ruby]
cina has quit [Ping timeout: 256 seconds]
Goles has quit [Quit: Out.]
jerius has quit []
cina has joined #ruby
phantasm66 has quit [Quit: *sleeeep….]
havenn has quit [Ping timeout: 264 seconds]
brianpWins has quit [Quit: brianpWins]
emocakes has joined #ruby
nwertman has quit [Read error: Connection reset by peer]
_nitti has quit [Remote host closed the connection]
gpato has quit [Ping timeout: 244 seconds]
<fuzai>
Could someone explain to me how to scape a div from an html file with a specific class name? I'm trying the examples here: http://ruby.bastardsbook.com/chapters/html-parsing/ but i'm not getting it
nwertman has joined #ruby
bean has joined #ruby
stkowski has joined #ruby
<ryanf>
fuzai: did you try page.css(".class-name") ?
<fuzai>
yea but the classname has a space in it
<fuzai>
i'll try it again
timonv has quit [Ping timeout: 260 seconds]
miphe has quit [Remote host closed the connection]
TomRone has quit [Ping timeout: 260 seconds]
<Xeago>
fuzai: a classname cannot have a space in it, it is a delimiter
<fuzai>
oh ok
<Xeago>
assuming it is html, right?
cina_ has joined #ruby
<fuzai>
yea
<fuzai>
i think i got it
<fuzai>
but i have a ton of extra white space
cina has quit [Ping timeout: 240 seconds]
cibs has joined #ruby
<fuzai>
how would i use gsub to remove whitespaces longer then 2 characters?
<fuzai>
i tried " asd ".gsub(/\w\w\w/, "") but no luck
io_syl has quit [Ping timeout: 248 seconds]
inokenty has quit [Remote host closed the connection]
thone_ has joined #ruby
<apeiros_>
fuzai: \w is not whitespace, \s is
thone has quit [Read error: Operation timed out]
<apeiros_>
and \s{2,} is 2 or more
<fuzai>
yea i just read that :)
<fuzai>
ah ok i was going to try \s\s
<fuzai>
\s\s+
pcarrier has joined #ruby
<apeiros_>
that'd be equivalent
<fuzai>
Cool
<fuzai>
:)
joshman_ has quit [Ping timeout: 240 seconds]
nicobrevin1 has quit [Ping timeout: 260 seconds]
io_syl has joined #ruby
IceDragon has joined #ruby
horofox has quit [Quit: horofox]
joshman_ has joined #ruby
<Xeago>
actually \s{2,} compiles more efficiently in most implementations
GoGoGarrett has quit [Remote host closed the connection]
digitalsanctum has quit [Remote host closed the connection]
TomRone has joined #ruby
philcrissman has quit [Remote host closed the connection]
digitalsanctum has joined #ruby
horofox has joined #ruby
alanp_ has joined #ruby
<apeiros_>
hu? why's that? I'd expect both compile to the same
nari has joined #ruby
havenn has joined #ruby
<apeiros_>
(of course, that's a naive expectation)
cibs has quit [Ping timeout: 245 seconds]
joshman_ has quit [Quit: Computer has gone to sleep.]
ryanneufeld has joined #ruby
jonathanwallace has quit [Ping timeout: 252 seconds]
blacktulip has quit [Remote host closed the connection]
digitalsanctum has quit [Ping timeout: 248 seconds]
syamajala has joined #ruby
alanp has quit [Ping timeout: 276 seconds]
_46bit has joined #ruby
Glacer232 has joined #ruby
stopbit has quit [Quit: Leaving]
<Xeago>
\s\s+ turns into atleast 2 checks, while \s{2,
pcarrier has quit []
<Xeago>
turns into 1 check that eats consecutive characters
<Xeago>
it doesn't remember/count/think about length
alanp_ is now known as alanp
pcarrier has joined #ruby
<apeiros_>
hm
_46bit has left #ruby [#ruby]
Spami has quit [Quit: This computer has gone to sleep]
mneorr_ has quit [Remote host closed the connection]
Beoran_ has joined #ruby
thillux_ has quit [Remote host closed the connection]
kjellski has quit [Quit: This computer has gone to sleep]
alex__c2022 has quit [Quit: alex__c2022]
otters has joined #ruby
segv- has quit [Quit: segv-]
jjbohn has joined #ruby
Beoran__ has quit [Ping timeout: 264 seconds]
shtirlic has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
GoGoGarrett has joined #ruby
Astralum has quit [Ping timeout: 252 seconds]
havenn has joined #ruby
F1skr has quit [Quit: WeeChat 0.3.9.2]
clooth has quit [Quit: clooth]
MrTroll has joined #ruby
jjbohn has quit [Ping timeout: 256 seconds]
<MrTroll>
sup peeps
pkrnj has joined #ruby
clooth has joined #ruby
jgarvey has quit [Quit: Leaving]
jlast has quit [Remote host closed the connection]
ryanjh has quit [Quit: Computer has gone to sleep.]
<MrTroll>
what is ruby
* MrTroll
is getting impatient
MrTroll has left #ruby [#ruby]
<fuzai>
Ruby is a gem
atmosx has joined #ruby
dmiller1 has joined #ruby
serhart has joined #ruby
Mon_Ouie has quit [Ping timeout: 256 seconds]
<speakingcode>
is there a method (probably owuld be part of enumerable i'm guessing) that takes two enumberables, a and b, and returns an enumerable that has all the elements which are in A but not in B..
<apeiros_>
Array#-
<apeiros_>
beware, set operation, means it will uniq the array
<speakingcode>
err, is that a minus sign?
<apeiros_>
yes
<speakingcode>
k. that's fine. working on sets here so no dups anyway
<speakingcode>
thankee
<apeiros_>
Array#- is read "instance method `-` of class Array"
<apeiros_>
# = instance method
<apeiros_>
:: = class method
<speakingcode>
k
dmiller has quit [Ping timeout: 265 seconds]
<apeiros_>
(e.g. Time::now vs. Time#strftime)
joeycarmello has joined #ruby
<speakingcode>
can i wrtie that as... array1 - arrayb
<apeiros_>
yes
mmitchell has joined #ruby
niklasb has joined #ruby
yonahw has joined #ruby
<speakingcode>
just out of curiosity, is there a version of that which doesn't uniq?
<aedorn>
So I have to log procedures - as in, when a route is added we have to send a log message, or when it gets removed - another log message. Currently we just keep log messages within the methods. I'm thinking of using delegation to call the methods, and write the log lines by matching the method to a corresponding file with some text substitution. Is there a better means to do this than my plan?
<apeiros_>
slash_nick: why do you insist on the wrong tool?
<apeiros_>
until time_is_out …end
<apeiros_>
oh, you're a crossposter. nvm.
<slash_nick>
i'm confused already...k
<aedorn>
doesn't loop do; end until .... work? Or was that begin; end until ...
<havenn>
slash_nick: Put your loop inside a Timeout: Timeout.timeout(time_in_seconds_here) do; loop do end end
<havenn>
I guess that is a bad use of exceptions.
<apeiros_>
Timeout.timeout considered harmful
syamajala has quit [Remote host closed the connection]
<havenn>
apeiros_: kk, yeah thought that seemed bad >.>
<slash_nick>
I read that... it's just being used in a test scenario
<slash_nick>
capybara is being an a-hole
cina has joined #ruby
niklasb has quit [Ping timeout: 252 seconds]
Takehiro has joined #ruby
<JohnTeddy>
Is there a way to specify what index places in an array I want. So if I have an array = [1, 2, 3]; how can I just print 0 and 2, without doing array[0] + array[2]?
peregrine81 has quit [Quit: Goodbye.]
kiyoura has joined #ruby
<JohnTeddy>
Can I put it all in the same argument, so array[0,2] or something?
allsystemsarego has quit [Quit: Leaving]
chriskk has quit [Ping timeout: 244 seconds]
<apeiros_>
JohnTeddy: Array#values_at
sepp2k1 has quit [Remote host closed the connection]
fyolnish has quit [Remote host closed the connection]
<aedorn>
array[x,y] does work also, at least in 1.9.
nari has quit [Ping timeout: 256 seconds]
<apeiros_>
aedorn: no
jjbohn has joined #ruby
<aedorn>
apeiros_: no?
<apeiros_>
Array#[] only works for slices, but he wants discrete indices.
gyre008 has quit [Remote host closed the connection]
<apeiros_>
Array#[] with 2 args is offset, length. the docs are pretty clear on that IMO.