apeiros changed the topic of #ruby-lang to: Nick registration required to talk || Ruby 2.0.0-p247: http://ruby-lang.org (Ruby 1.9.3-p448) || Paste >3 lines of text on http://gist.github.com
JoshuaPaling has joined #ruby-lang
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ecnalyr has quit [Ping timeout: 245 seconds]
tkuchiki has joined #ruby-lang
kek has quit [Remote host closed the connection]
nathanstitt has quit [Quit: I growing sleepy]
kek has joined #ruby-lang
ryanf has joined #ruby-lang
kurko_ has quit [Quit: Computer has gone to sleep.]
nathanstitt has joined #ruby-lang
jxie has joined #ruby-lang
kek has quit [Ping timeout: 245 seconds]
hhatch has quit [Ping timeout: 245 seconds]
nazty has quit [Ping timeout: 245 seconds]
woollyams has joined #ruby-lang
mistym has joined #ruby-lang
yfeldblum has quit [Remote host closed the connection]
SteveBen_ has joined #ruby-lang
yfeldblum has joined #ruby-lang
Nilium has quit [Ping timeout: 245 seconds]
earthquake has quit [Quit: earthquake]
Coincidental has quit [Remote host closed the connection]
SteveBen_ has quit [Remote host closed the connection]
Coincidental has joined #ruby-lang
hotpancakes has joined #ruby-lang
hotpancakes has quit [Read error: Connection reset by peer]
hotpancakes has joined #ruby-lang
Coincidental has quit [Ping timeout: 272 seconds]
hotpancakes has quit [Remote host closed the connection]
hogeo has joined #ruby-lang
sepp2k1 has quit [Quit: Leaving.]
Coincidental has joined #ruby-lang
Nilium has joined #ruby-lang
kek has joined #ruby-lang
nofxx has joined #ruby-lang
ecnalyr has joined #ruby-lang
jxie has quit [Read error: Connection reset by peer]
jxie has joined #ruby-lang
kek has quit [Ping timeout: 272 seconds]
ecnalyr has quit [Ping timeout: 245 seconds]
havenwood has quit [Remote host closed the connection]
cnivolle_ has quit [Remote host closed the connection]
cnivolle has joined #ruby-lang
<micalexander>
is there any what to shorten a class instantiation instead of having to call Module::Class.method besides using a variable?
postmodern has joined #ruby-lang
cnivolle has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 245 seconds]
<micalexander>
How about this one. Do I need to call Module::Class.method or is it safe to call Class.method even if there is a module wrapped around the class being called
<micalexander>
?
duphus has quit [Quit: Leaving.]
TheMoonMaster has quit [Excess Flood]
duphus has joined #ruby-lang
stamina has quit [Ping timeout: 260 seconds]
TheMoonMaster has joined #ruby-lang
earthquake has joined #ruby-lang
Domon has joined #ruby-lang
jxie has quit [Quit: leaving]
Domon has quit [Ping timeout: 272 seconds]
hotpancakes has joined #ruby-lang
Olipro has quit [Ping timeout: 260 seconds]
kek has joined #ruby-lang
Domon has joined #ruby-lang
pkrnj has quit [Ping timeout: 268 seconds]
flip_digits has quit []
hotpancakes has quit [Ping timeout: 260 seconds]
ecnalyr has joined #ruby-lang
kek has quit [Ping timeout: 245 seconds]
flip_digits has joined #ruby-lang
earthquake has quit [Quit: earthquake]
ecnalyr has quit [Ping timeout: 245 seconds]
Johz has quit [Quit: Leaving]
shinnya has quit [Ping timeout: 268 seconds]
kurko_ has joined #ruby-lang
earthquake has joined #ruby-lang
arooni-mobile__ has quit [Ping timeout: 245 seconds]
arooni-mobile has quit [Ping timeout: 265 seconds]
kitak_ has joined #ruby-lang
kitak has quit [Read error: Connection reset by peer]
<r0bgleeson>
micalexander: it depends on the context, constant resolution can be different depending on how you've opened the class.
arooni-mobile__ has joined #ruby-lang
<r0bgleeson>
micalexander: if you want easy accesss to the constant you can include MyModule to access its constants from current self
<r0bgleeson>
if you open the class with indentation nesting, constant lookup will traverse back to Object via the nesting
arooni-mobile__ has quit [Max SendQ exceeded]
<r0bgleeson>
if you open the class on a single line(Foo::Bar), constant resolution goes through that class/module ancestry tree & not the nesting scope
arooni-mobile__ has joined #ruby-lang
zz_michael_mbp is now known as michael_mbp
bf4 has joined #ruby-lang
Senjai has quit [Ping timeout: 248 seconds]
SteveBenner09 has quit [Quit: Leaving]
arooni-mobile has joined #ruby-lang
arooni-mobile__ has quit [Ping timeout: 252 seconds]
julweber_ has joined #ruby-lang
julweber has quit [Ping timeout: 245 seconds]
arooni-mobile has quit [Ping timeout: 248 seconds]
kurko_ has quit [Ping timeout: 245 seconds]
kurko_ has joined #ruby-lang
symm- has quit [Read error: Operation timed out]
Mr_Wharfsnort has quit [Quit: Leaving]
Mr_Wharfsnort has joined #ruby-lang
kek has joined #ruby-lang
arooni-mobile__ has joined #ruby-lang
Senjai has joined #ruby-lang
ecnalyr has joined #ruby-lang
kek has quit [Ping timeout: 268 seconds]
kurko_ has quit [Quit: Computer has gone to sleep.]
ecnalyr has quit [Ping timeout: 245 seconds]
arooni-mobile has joined #ruby-lang
Mr_Wharfsnort has quit [Ping timeout: 260 seconds]
bf4 has quit [Ping timeout: 265 seconds]
hotpancakes has joined #ruby-lang
flip_digits has quit []
saarinen has joined #ruby-lang
Senjai has quit [Remote host closed the connection]
Senjai has joined #ruby-lang
saarinen has quit [Quit: saarinen]
slyphon has joined #ruby-lang
michael_mbp is now known as zz_michael_mbp
saarinen has joined #ruby-lang
nisstyre has joined #ruby-lang
saarinen has quit [Client Quit]
Coincidental has quit [Remote host closed the connection]
Coincidental has joined #ruby-lang
Mr_Wharfsnort has joined #ruby-lang
Coincidental has quit [Ping timeout: 272 seconds]
yfeldblum has joined #ruby-lang
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
earthquake has quit [Quit: earthquake]
tkuchiki has quit [Remote host closed the connection]
cads has joined #ruby-lang
earthquake has joined #ruby-lang
duphus has quit [Quit: Leaving.]
Mr_Wharfsnort has quit [Quit: Leaving]
duphus has joined #ruby-lang
ledestin has joined #ruby-lang
kek has joined #ruby-lang
mistym has quit [Remote host closed the connection]
yfeldblum has quit [Remote host closed the connection]
ecnalyr has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
kek has quit [Ping timeout: 272 seconds]
jxie has joined #ruby-lang
ecnalyr has quit [Ping timeout: 245 seconds]
jxie has quit [Client Quit]
duphus has left #ruby-lang [#ruby-lang]
imperator has joined #ruby-lang
bzalasky has joined #ruby-lang
Coincidental has joined #ruby-lang
postmodern has quit [Quit: Leaving]
MrPoT4tO has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
bzalasky has joined #ruby-lang
thepumpkin has quit [Remote host closed the connection]
bzalasky has quit [Ping timeout: 268 seconds]
arooni-mobile has quit [Ping timeout: 245 seconds]
arooni-mobile__ has quit [Ping timeout: 272 seconds]
tkuchiki has joined #ruby-lang
Elico has quit [Quit: Elico]
lsegal has quit [Read error: Connection reset by peer]
lsegal has joined #ruby-lang
bzalasky has joined #ruby-lang
kek has joined #ruby-lang
tomzx_mac has quit [Ping timeout: 240 seconds]
bzalasky has quit [Remote host closed the connection]
ecnalyr has joined #ruby-lang
bzalasky has joined #ruby-lang
kek has quit [Ping timeout: 272 seconds]
postmodern has joined #ruby-lang
Elico has joined #ruby-lang
ecnalyr has quit [Ping timeout: 245 seconds]
Barrin6 has joined #ruby-lang
bzalasky has quit [Ping timeout: 272 seconds]
hahuang61 has joined #ruby-lang
hahuang65 has quit [Ping timeout: 248 seconds]
tkuchiki has quit [Ping timeout: 245 seconds]
bzalasky has joined #ruby-lang
havenwood has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
bzalasky has quit [Remote host closed the connection]
bzalasky has joined #ruby-lang
bzalasky has quit [Read error: Connection reset by peer]
<micalexander>
When creating a file with a lot of text, is it better to have a skeleton file that ruby can pull from or place all of the text in the class that will be creating it. I know this might be at the developers preference but thats kinda what Im looking for at this point
<darix>
micalexander: depends on what you do with all the text
alekst has joined #ruby-lang
<micalexander>
darix: just a yaml config file
<imperator>
sounds like a job for a template
nigerianceo has joined #ruby-lang
<micalexander>
imperator: That was my third option
<micalexander>
which is pretty much a skeleton corect?
<imperator>
yep
<darix>
micalexander: use a template then
hotpancakes has joined #ruby-lang
<micalexander>
Is there any good place to start as to where to find info or is there a recommended gem for this, or is the standard to roll your own?
bf4 has joined #ruby-lang
momomomomo has joined #ruby-lang
Oak has quit [Ping timeout: 248 seconds]
<micalexander>
also where is the proper place to store the erb file in my gem?
tkuchiki has joined #ruby-lang
<banisterfiend>
lib/gem_name/templates/ i guess
<workmad3>
micalexander: you could also use the data section at the end of a ruby file
hotpancakes has quit [Ping timeout: 246 seconds]
<micalexander>
cool, anybody have a good source of reference that explains creating files with erb?
<micalexander>
workmad3: so this replaces the need to have a seperate erb file?
<workmad3>
micalexander: yup
<micalexander>
workmad3: so this is prob good if the file is small?
tomzx_mac has quit [Ping timeout: 252 seconds]
<micalexander>
workmad3: which in my case is
<workmad3>
micalexander: yes, and if you don't need much in the way of dev-customisation
<workmad3>
micalexander: if you just need something quick and simple then this means you don't need to establish some form of directory structure to place a single external template :)
<micalexander>
workmad3: so Data.read pulls in everything from the section under __END__?
<workmad3>
micalexander: yup
<workmad3>
micalexander: DATA is a file handle that points to the text after __END__
imperator has quit [Quit: Valete!]
<micalexander>
workmad3: nice
mahlon_ is now known as mahlon
robbyoconnor has quit [Ping timeout: 248 seconds]
tris has quit [Excess Flood]
tris has joined #ruby-lang
<micalexander>
workmad3: one more question, if later in my program I will be generating many files, is it better to just create the template folder and do it that what as to keep all the files in one place?
<workmad3>
micalexander: yeah, at that point I'd start having a template directory
<maloik>
k
<workmad3>
micalexander: I'd also start considering Thor instead of hand-rolling that sort of tool ;)
lfox has joined #ruby-lang
<micalexander>
ok cool thank for providing a couple of ways to look at this thing
<micalexander>
I am using thor
<micalexander>
workmad3: so that brings up another question
<workmad3>
micalexander: if you're already using thor, this is all moot :) thor has established ways to set the template directory and commands to process templates
<micalexander>
If I have thor controlling my cli class and its and its calling my configuration class and my configuration class is the one creating the template is it recommended to pull thor into my configuration class as well? I ask this because then Id have to wrap all of the methods inside my configuration class in a no_task do block
<workmad3>
micalexander: I wouldn't have a config class generating a template
<workmad3>
micalexander: I'd pull data out of the config class in my Thor class to generate the template
<micalexander>
workmad3: well thats the class that controls the configuration file changing variables etc
<workmad3>
micalexander: right... that's got little bearing on generating a template though
<workmad3>
micalexander: your config class holds a lot of data and provides it to other bits of your app
<micalexander>
workmad3:explain
<micalexander>
workmad3: true
<workmad3>
micalexander: so why isn't your template generation being passed this config object in order to generate? why is the config class itself generating files?
<workmad3>
micalexander: it's a violation of SRP :)
<micalexander>
workmad3: I figured it was srp. That was my point of doing it this way. configuration was incharge of itself
<workmad3>
micalexander: describe everything the config class uses without using the word 'and'
<workmad3>
s/uses/does
hagabaka has joined #ruby-lang
elia has joined #ruby-lang
<workmad3>
micalexander: currently the way I'd describe your config class would be 'loads config values from a file and saves config values to a file and exposes config files to the application'
<workmad3>
micalexander: which implies 3 responsibilities to me ;)
<micalexander>
workmad3: um ok, the config class does... check to see if there is a config class if not creates it, it does update the config file by user input (I have an interactive menu class that calls this class ), it does set the config settings for other classes to use thats pretty much it
<workmad3>
micalexander: each ',' there is an 'and'
<micalexander>
workmad3: I dont like you :)
<workmad3>
micalexander: ;)
<micalexander>
workmad3: ok Im over it
<workmad3>
micalexander: you had it nicely encapsulated btw ;)
<micalexander>
so is it good practice to have the cli doing it
ebetancourt has joined #ruby-lang
<workmad3>
micalexander: it's still somewhat a violation of SRP... however, Thor exposes templating with a single command so it's pretty clean anyway
<micalexander>
workmad3: so is it good practice to have the cli doing it
<workmad3>
micalexander: heh :) you're looking for an absolute answer still, eh? :P
<micalexander>
workmad3: wouldnt the cli be in violation of SRP?
hogeo has quit [Remote host closed the connection]
<workmad3>
micalexander: the answer is 'it depends'
lun__ has quit [Remote host closed the connection]
<micalexander>
I guess im new to ruby and just wanna do things the ruby way first then I will fond my own
hogeo has joined #ruby-lang
lun__ has joined #ruby-lang
arooni-mobile__ has quit [Ping timeout: 245 seconds]
thepumpkin has joined #ruby-lang
<workmad3>
micalexander: the ruby way is to not get too hung up on things, as long as your code is clean, elegant and works :)
arooni-mobile has quit [Ping timeout: 260 seconds]
wallerdev has joined #ruby-lang
<workmad3>
micalexander: so as long as things weren't messy, I'd quite happily use thor's templating... if I needed more control, I'd do it myself in my own ConfigFile class
<micalexander>
workmad3: just saying there are many ands in the cli
<workmad3>
micalexander: I already admitted that using Thor violates the SRP
<workmad3>
micalexander: but it's still neat code there :) as you have a 'template' method that already does templating
<micalexander>
workmad3: ohhh ok i didnt see that
<micalexander>
So would you say cli classes typically violate SRP
<workmad3>
micalexander: that depends ;)
<micalexander>
workmad3: oh hll, are you a sensei some where?
hogeo has quit [Ping timeout: 240 seconds]
lun__ has quit [Ping timeout: 252 seconds]
<micalexander>
workmad3: you speak like Mr Miyagi. ;)
headius has joined #ruby-lang
<workmad3>
micalexander: heh :)
<workmad3>
micalexander: ideally, a CLI class will just bind command-line operations to your library
<workmad3>
micalexander: and in that sense, it's a single responsibility
ohsix has quit [Ping timeout: 248 seconds]
<workmad3>
micalexander: and as long as your CLI class's implementation stays at that level of abstraction, it's a single responsibility
thepumpkin has quit [Ping timeout: 272 seconds]
Voker57 has quit []
<workmad3>
micalexander: so your CLI class will essentially declare what each command does, without really saying how
<workmad3>
micalexander: if you start getting into how, you just lowered the abstraction level of the entire class, and now you're likely to end up with a lot of responsibilities there :)
hahuang61 has joined #ruby-lang
<workmad3>
micalexander: however, some apps really don't justify separating these responsibilities out
<micalexander>
workmad3: ok some things to think about
<micalexander>
cool
<workmad3>
micalexander: it really all boils down to 'design isn't free, there is no short cut' :)
<workmad3>
micalexander: and in a lot of cases, the only answer to a design question couched in general terms is 'it depends' :)
micalexander has quit [Remote host closed the connection]
micalexander has joined #ruby-lang
Elico has quit [Quit: Elico]
Elico has joined #ruby-lang
<yorickpeterse>
so apparently somebody died here due to the storm
h_kon has joined #ruby-lang
<yorickpeterse>
welp
micalexander has quit [Ping timeout: 272 seconds]
bantic has joined #ruby-lang
<workmad3>
yorickpeterse: :/
mbj has quit [Ping timeout: 268 seconds]
[spoiler] has joined #ruby-lang
mistym has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
thepumpkin has joined #ruby-lang
ledestin has quit [Ping timeout: 272 seconds]
elia has joined #ruby-lang
ledestin has joined #ruby-lang
mbj has joined #ruby-lang
hotpancakes has joined #ruby-lang
h_kon has quit [Remote host closed the connection]
imperator has joined #ruby-lang
hahuang61 has quit [Ping timeout: 252 seconds]
mytrile has quit [Remote host closed the connection]
momomomomo has quit [Quit: momomomomo]
hotpancakes has quit [Ping timeout: 240 seconds]
MaddinXx_ has quit [Remote host closed the connection]
<maloik>
ljarvis: you use dnsimple right? do they offer email forwarding ?
<maloik>
cant tell for sure on the site
<ljarvis>
maloik: yes
<zzak>
just create an mx record
<ljarvis>
yeah they have a custom section for adding forwarding emails, but you can just add an mx record
scampbell has quit [Ping timeout: 272 seconds]
wallerdev has quit [Quit: wallerdev]
bzalasky has joined #ruby-lang
momomomomo has joined #ruby-lang
jsullivandigs has joined #ruby-lang
rsl has quit [Remote host closed the connection]
jsullivandigs has quit [Remote host closed the connection]
<maloik>
but that'll only work for the entire domain, right?
jsullivandigs has joined #ruby-lang
<maloik>
you need an actual mailserver if you want to forward x@example.com to some gmail address and y@example.com to another email address ?
hotpancakes has joined #ruby-lang
<maloik>
unless I'm getting wrong how those work :)
rsl has joined #ruby-lang
robbyoconnor has joined #ruby-lang
robbyoconnor has quit [Client Quit]
retro|cz has quit [Ping timeout: 272 seconds]
enebo has joined #ruby-lang
mbj_ has joined #ruby-lang
breakingthings has quit [Ping timeout: 245 seconds]
TheMoonMaster has quit [Excess Flood]
breakingthings has joined #ruby-lang
TheMoonMaster has joined #ruby-lang
mbj has quit [Ping timeout: 268 seconds]
mbj_ has quit [Ping timeout: 266 seconds]
jiuweigui has joined #ruby-lang
cads has quit [Ping timeout: 245 seconds]
bastilian has quit [Ping timeout: 243 seconds]
mbj has joined #ruby-lang
cads has joined #ruby-lang
micalexander has joined #ruby-lang
MaddinXx_ has joined #ruby-lang
mbj has quit [Ping timeout: 260 seconds]
bzalasky has quit [Remote host closed the connection]
zakame has joined #ruby-lang
rippa has joined #ruby-lang
bzalasky has joined #ruby-lang
wallerdev has joined #ruby-lang
yfeldblum has joined #ruby-lang
hotpancakes has quit [Remote host closed the connection]
CaptainJet has joined #ruby-lang
<darix>
maloik: if you set up MX records you need a mail server yes
<darix>
but if i recall correctly you can also let google be MX for your domain
julweber has quit [Remote host closed the connection]
<maloik>
yea but as I said then that only works if all emails are on gmail I suppose
<darix>
well yes
julweber has joined #ruby-lang
tubbo has joined #ruby-lang
<yorickpeterse>
grrrr, ERB
<maloik>
I mean, for now that's fine... only one I need will go to my gmail anyway
<maloik>
but still I like the flexibility
tubbo has left #ruby-lang ["WeeChat 0.4.2-rc2"]
zakame has quit [Read error: Connection reset by peer]
elia has quit [Ping timeout: 245 seconds]
julweber has quit [Ping timeout: 272 seconds]
shinnya has joined #ruby-lang
<[spoiler]>
darix, maloik: regarding the email thing: Hotmail also offers a similar service (and I actually favour it over GMail, which is pretty rare since I'm a Google fan)
Y_Ichiro_ has quit [Ping timeout: 245 seconds]
mistym has quit [Remote host closed the connection]
arooni-mobile has joined #ruby-lang
arooni-mobile__ has joined #ruby-lang
arooni-mobile__ has quit [Max SendQ exceeded]
arooni-mobile__ has joined #ruby-lang
symm- has joined #ruby-lang
CaptainJet has quit [Ping timeout: 248 seconds]
CaptainJet has joined #ruby-lang
Jeticus has joined #ruby-lang
davispuh has joined #ruby-lang
CaptainJet has quit [Ping timeout: 245 seconds]
jithu_ has quit [Quit: Mother, did it need to be so high?]
bantic has quit [Quit: bantic]
bantic has joined #ruby-lang
tbuehlmann has quit [Remote host closed the connection]
amerine has quit [Quit: Computer has gone to sleep.]
nigerianceo has quit []
tylersmith has quit [Remote host closed the connection]
intellitech has quit [Quit: SMOKE BOMB!]
__butch__ has joined #ruby-lang
slyphon has joined #ruby-lang
Authenti1ator has left #ruby-lang [#ruby-lang]
MrZYX|off is now known as MrZYX
mistym has joined #ruby-lang
havenwood has joined #ruby-lang
JohnBat26 has joined #ruby-lang
lfox has quit [Quit: ZZZzzz…]
lfox has joined #ruby-lang
MrZYX is now known as MrZYX|off
elia has joined #ruby-lang
MrZYX|off is now known as MrZYX
zakame_ has joined #ruby-lang
lukeroberts_ has quit [Ping timeout: 247 seconds]
lfox has quit [Quit: ZZZzzz…]
vondruch has quit [Ping timeout: 272 seconds]
momomomomo has quit [Quit: momomomomo]
jxie has joined #ruby-lang
jvrmaia has joined #ruby-lang
gix has quit [Ping timeout: 245 seconds]
x0f_ has joined #ruby-lang
saarinen has joined #ruby-lang
saarinen has quit [Client Quit]
gix has joined #ruby-lang
saarinen has joined #ruby-lang
bantic has quit [Quit: bantic]
x0f has quit [Ping timeout: 252 seconds]
hahuang61 has joined #ruby-lang
nazty has joined #ruby-lang
solars has quit [Ping timeout: 252 seconds]
nigerianceo has joined #ruby-lang
kek has quit [Remote host closed the connection]
momomomomo has joined #ruby-lang
momomomomo has quit [Client Quit]
zakame_ has quit [Ping timeout: 245 seconds]
Coincidental has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #ruby-lang
amerine has joined #ruby-lang
michael_mbp is now known as zz_michael_mbp
cnivolle has quit [Remote host closed the connection]
MaddinXx_ has quit [Remote host closed the connection]
hotpancakes has joined #ruby-lang
sepp2k has quit [Quit: Konversation terminated!]
hotpancakes has quit [Ping timeout: 240 seconds]
elia has quit [Quit: (IRC Client: textualapp.com)]
Technodrome has joined #ruby-lang
lfox has joined #ruby-lang
nazty has quit [Ping timeout: 240 seconds]
tylersmith has joined #ruby-lang
imperator has quit [Quit: Valete!]
arturro has joined #ruby-lang
arturro has quit [Client Quit]
lfox has quit [Remote host closed the connection]
achru has joined #ruby-lang
lfox has joined #ruby-lang
amerine has quit [Ping timeout: 256 seconds]
achru has quit [Client Quit]
achru has joined #ruby-lang
lun__ has joined #ruby-lang
achru has quit [Client Quit]
achru has joined #ruby-lang
benlovell has quit [Ping timeout: 245 seconds]
Squarepy has quit [Quit: Leaving]
jxie has quit [Ping timeout: 240 seconds]
sepp2k has joined #ruby-lang
Technodrome has quit [Quit: Technodrome]
ecnalyr has quit [Ping timeout: 245 seconds]
nofxx has joined #ruby-lang
Pupeno_ has joined #ruby-lang
a1ph4g33k has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
yfeldblu_ has joined #ruby-lang
Pupeno has quit [Ping timeout: 250 seconds]
Pupeno_ has quit [Ping timeout: 248 seconds]
yfeldblu_ has quit [Read error: Connection reset by peer]
<cschneid>
is there a `to_range` in the style of `to_str` or `to_s`?
nigerianceo has joined #ruby-lang
Technodrome has joined #ruby-lang
momomomomo has quit [Quit: momomomomo]
<mistym>
cschneid: There isn't, since that would be a pretty ambiguous case to provide a direct transformation. Range.new() allows you to specify beginning and end points though, so you can have: ary = [1,2,3,4,5]; Range.new(ary.first, ary.last)
<drbrain>
cschneid: no, typically you implement #each or some other method that returns an Enumerator
<mistym>
And Ruby 2.0(?) includes #to_enum as a standard transformation
arBmind has quit [Quit: Leaving.]
bf4 has quit [Ping timeout: 248 seconds]
<drbrain>
cschneid: if you want a range as boundaries, not to enumerate (like a range of floats) implement #include?, #cover?, #member?
ebetancourt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
relix has joined #ruby-lang
r0bglees0n has joined #ruby-lang
KM has joined #ruby-lang
faces has quit [Read error: Connection reset by peer]
face has joined #ruby-lang
slyphon has quit [Ping timeout: 272 seconds]
UziMonkey has quit [Read error: Connection reset by peer]
pkondzior___ has quit [Write error: Connection reset by peer]
pipework has quit [Read error: Connection reset by peer]
Kabaka has quit [Ping timeout: 240 seconds]
efrainolivares has quit [Read error: Connection reset by peer]
UziMonkey has joined #ruby-lang
pkondzior___ has joined #ruby-lang
pipework has joined #ruby-lang
KM|3 has quit [Read error: Connection reset by peer]
<cschneid>
drbrain: mistym: well, I'm implementing a TimeRange class, but for interop purposes with things expecting a traditional start..stop type range I wanted a conversion method
lmadrigal has joined #ruby-lang
<cschneid>
I'll just invent .to_range() for this one.
<drbrain>
cschneid: if something needs a Range object, it's broken
<cschneid>
hmm, ya, so maybe a decorator for this would be easier. Really it's a range, with the extra knowledge it's a range of time objects (with extra helper methods on it)
enebo has quit [Quit: enebo]
<cschneid>
so delegating to an inner range object would allow me to implement the traditional range methods for "free", and then tack my own stuff on top.
<drbrain>
cschneid: yep, and the caller shouldn't care what class of object you give it
<cschneid>
yep.
datanoise has joined #ruby-lang
<mistym>
lianj: Hm, yeah, that's not what I would have expected either
<drbrain>
lianj: perl
Coincidental has quit [Remote host closed the connection]
<mistym>
"If pattern is a single space, str is split on whitespace, with leading whitespace and runs of contiguous whitespace characters ignored."
Coincide_ has quit [Read error: Connection reset by peer]
spuk has quit [Ping timeout: 246 seconds]
<mistym>
lianj: :(
Coincide_ has joined #ruby-lang
Coincidental has quit [Read error: Connection reset by peer]
spuk has joined #ruby-lang
datanoise has quit [Ping timeout: 272 seconds]
dingus_khan has quit [Remote host closed the connection]
dingus_khan has joined #ruby-lang
lun__ has quit [Remote host closed the connection]
pglombardo has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
tomzx_mac has joined #ruby-lang
imperator has quit [Quit: Leaving]
skade has joined #ruby-lang
pkrnj has quit [Quit: Computer has gone to sleep.]
nigerianceo has quit []
omninonsense has joined #ruby-lang
specialblend has quit [Quit: specialblend]
spuk has quit [Changing host]
spuk has joined #ruby-lang
[spoiler] has quit [Ping timeout: 268 seconds]
MrZYX is now known as MrZYX|off
kek has joined #ruby-lang
omninonsense is now known as [spoiler]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Technodrome has quit [Quit: Technodrome]
kek has quit [Ping timeout: 246 seconds]
Technodrome has joined #ruby-lang
datanoise has joined #ruby-lang
slyphon has joined #ruby-lang
nathanstitt has joined #ruby-lang
Coincide_ has quit [Remote host closed the connection]
spuk has quit [Ping timeout: 265 seconds]
Coincidental has joined #ruby-lang
MrPoT4tO has quit [Read error: Connection reset by peer]
MrPoT4tO has joined #ruby-lang
lfox has quit [Quit: ZZZzzz…]
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
captain_chen has joined #ruby-lang
CoreData has joined #ruby-lang
bantic has quit [Quit: bantic]
kitak has joined #ruby-lang
headius has quit [Quit: headius]
headius has joined #ruby-lang
captain_chen has quit [Ping timeout: 250 seconds]
hhatch has quit [Ping timeout: 245 seconds]
skade has quit [Quit: Computer has gone to sleep.]
julweber has joined #ruby-lang
captain_chen has joined #ruby-lang
<captain_chen>
Could someone spare some time to help me?
efrainolivares_ has joined #ruby-lang
efrainolivares has quit [Ping timeout: 272 seconds]
sepp2k has quit [Quit: Leaving.]
pkrnj has joined #ruby-lang
<oddmunds>
captain_chen: just ask your question, and if someone knows the answer they'll answer you
cnivolle has quit [Remote host closed the connection]
flip_digits has joined #ruby-lang
<captain_chen>
I'm writing an IR system for school that needs to use the vector space model, my program so far only handles the extraction of text from a file that is structured in a certain way.