ChanServ changed the topic of #ruby-lang to: Ruby 1.9.3-p125: http://ruby-lang.org | Paste >3 lines of text on http://pastie.org or use a gist
fayimora_ has joined #ruby-lang
cantonic has quit [Ping timeout: 265 seconds]
cantonic_ is now known as cantonic
heftig has joined #ruby-lang
Weems has joined #ruby-lang
Weems has quit [Changing host]
Weems has joined #ruby-lang
wallerdev has joined #ruby-lang
spectra- has joined #ruby-lang
whitequa1k has joined #ruby-lang
kanlacism has joined #ruby-lang
whitequark has quit [Ping timeout: 264 seconds]
xtagon has quit [Ping timeout: 264 seconds]
fayimora has quit [Ping timeout: 264 seconds]
spectra has quit [Ping timeout: 264 seconds]
lupine_85 has quit [Ping timeout: 264 seconds]
fayimora_ is now known as fayimora
wpaulson_ has joined #ruby-lang
burntbit has quit [Ping timeout: 276 seconds]
yannis_ has joined #ruby-lang
lupine_85 has joined #ruby-lang
yannis is now known as Guest6114
Guest6114 has quit [Ping timeout: 272 seconds]
flowerpot has joined #ruby-lang
<veex> pry?
msaffitz has joined #ruby-lang
heftig has quit [Quit: leaving]
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
slyphon has joined #ruby-lang
heftig has joined #ruby-lang
jperry2 has quit [Quit: jperry2]
kyrylo has quit [Quit: WeeChat 0.3.8]
neocoin has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
wmoxam has joined #ruby-lang
wpaulson_ has quit [Read error: Connection reset by peer]
akira989 has joined #ruby-lang
yannis_ has left #ruby-lang [#ruby-lang]
arooni-mobile has joined #ruby-lang
timepilot has joined #ruby-lang
arooni-mobile has quit [Remote host closed the connection]
heftig has quit [Remote host closed the connection]
heftig has joined #ruby-lang
jperry2 has joined #ruby-lang
Phelps has joined #ruby-lang
<Phelps> I'm an issue with Net::HTTP and use_ssl: https://gist.github.com/2946274
chrismcg is now known as zz_chrismcg
heftig has quit [Ping timeout: 245 seconds]
jperry2 has quit [Quit: jperry2]
arooni-mobile has joined #ruby-lang
arooni-mobile has quit [Remote host closed the connection]
akira989 has quit [Ping timeout: 252 seconds]
shyouhei has joined #ruby-lang
jxie_ has joined #ruby-lang
carloslopes has joined #ruby-lang
akira989 has joined #ruby-lang
heftig has joined #ruby-lang
jxie has quit [Ping timeout: 245 seconds]
heftig has quit [Client Quit]
ben_m has quit [Quit: Leaving]
stardiviner has joined #ruby-lang
ryanf has joined #ruby-lang
UNIXgod has quit [Ping timeout: 265 seconds]
umttumt has joined #ruby-lang
neoesque has joined #ruby-lang
dvorak has quit [Remote host closed the connection]
akira989 has quit [Ping timeout: 265 seconds]
wpaulson has joined #ruby-lang
savage- has joined #ruby-lang
VegetableSpoon has quit [Remote host closed the connection]
ryanf has quit [Quit: broken pipes |||]
carloslopes has quit [Quit: Leaving]
Banistergalaxy has joined #ruby-lang
pip has quit [Ping timeout: 245 seconds]
ryanf has joined #ruby-lang
dvorak has joined #ruby-lang
timepilot has quit [Quit: timepilot]
seanstickle has quit [Quit: Nihil sub sole novum]
akira989 has joined #ruby-lang
sepp2k has quit [Remote host closed the connection]
ryanf has quit [Quit: broken pipes |||]
burntbit has joined #ruby-lang
gsav has quit [Read error: Connection reset by peer]
Banistergalaxy has quit [Ping timeout: 264 seconds]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
gsav has joined #ruby-lang
wpaulson has quit [Read error: Connection reset by peer]
wpaulson has joined #ruby-lang
heftig has joined #ruby-lang
woollyams has quit [Read error: Connection reset by peer]
pip has joined #ruby-lang
pip has quit [Changing host]
pip has joined #ruby-lang
woollyams has joined #ruby-lang
wpaulson has quit [Read error: Connection reset by peer]
dgs has quit [Ping timeout: 245 seconds]
pip has quit [Ping timeout: 255 seconds]
<tubbo`cloud> how do i get File.read to start from the nth line down?
savage- has quit [Remote host closed the connection]
arooni-mobile has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
jbsan_ has joined #ruby-lang
jbsan has quit [Ping timeout: 265 seconds]
jbsan_ is now known as jbsan
kanlacism has quit [Quit: leaving]
ryanf has joined #ruby-lang
qpingu has joined #ruby-lang
spurling has joined #ruby-lang
zz_wasnotrice is now known as wasnotrice
Cope has joined #ruby-lang
<Cope> Hi - I've got an array of strings; I'd like to reject all line before a line which matches a regex, and then keep the lines between that line and another line, matching a different regex, before rejecting the rest.
<bnagy> tubbo`cloud: you don't, but you can call File.readline n times first
gnufied has joined #ruby-lang
<Cope> ie I want to create a slice based on a starting regex and ending regex
<Cope> any suggestions for an elegant way to do this? the array is not large, so memory won't be an issue
<erikh> maybe scan(/(one)(.*)(two)/) use the first as a token of sorts, follow through to the second index of the array
<bnagy> Cope: what about ary.drop_while ... keep_while ...
<veex> Any automation testing channels around IRC?
<erikh> what kind of automation?
<erikh> continuous integration?
* Cope reads about drop_while
vesan_ has quit [Read error: Connection reset by peer]
<veex> Yes, like Selenium or Coded UI type custom data driven automation.
<tubbo`cloud> bnagy: so i can do like @file = File.open..., then 8.times { @file.readline }?
<erikh> veex: check out #trvais
<erikh> travis
<veex> RFT, Selenium, Coded UI, Test Complete
<bnagy> tubbo`cloud: more or less yeah, or just File.readlines.drop(8)
<tubbo`cloud> oh sweet
<tubbo`cloud> that looks much easier to read
<veex> For example, I build custom frameworks for clients using object mapping/factory methods that drive automation scripts for UI testing.
<erikh> veex: if you're just looking for something you can do locally, check out capybara, selenium-webdriver and cucumber.
<veex> The problem I run into with Selenium is a lack of object mapping. It's all stored in XML and need to use XPATH to map those objects to actual methods within my factory object.
gsav has quit [Read error: Connection reset by peer]
<erikh> yeah, so cucumber + capybara use zero xml
<erikh> or at least, it's all very well abstracted
gsav has joined #ruby-lang
gsav has quit [Client Quit]
Asher has quit [Quit: Leaving.]
<veex> I need a tutorial how to map objects!
<erikh> google?
Asher has joined #ruby-lang
stderr_ has joined #ruby-lang
* veex never heard of this term
vesan has joined #ruby-lang
ramonmaruko has quit [Remote host closed the connection]
<Cope> bnagy: so looks like I can do drop_while, or slice_before to remove the head of the array, but i'd need a 2nd pass to remove the tail
<veex> Wow CapyBara is incredible
<Cope> Ideally want slice_between! :)
<erikh> yo ucould use that token approach I suggested :)
<Cope> erikh: i missed that! *reads*
<erikh> it's not particularly clever, but it should work
<veex> How do I use Visual Studio to write ruby for Selenium?
<erikh> veex: good luck.
<veex> Do I have to load up Eclipse with this?
<erikh> :)
<veex> Or Aptana?
ramonmaruko has joined #ruby-lang
<erikh> you could just use something like notepad++
<Cope> veex: sublime is really nice
<erikh> or yeah, that.
mtm3 has joined #ruby-lang
akira989 has quit [Remote host closed the connection]
rippa has joined #ruby-lang
<bnagy> Cope: doing drop_while / slice_before and the same after is just as efficient
burntbit has quit [Read error: Connection reset by peer]
<bnagy> because when you chain them it's still O(n) (the tail drop is only operating on the shortened array)
chimkan_ has joined #ruby-lang
<bnagy> sorry O(2n) my bad
<bnagy> I just noticed slice_before myself, tbh
<samuelkadolph> You don't include scalars in O
<bnagy> you're telling the story
<veex> Okay, so with CapyBara, is there a way to abstract basic web UI elements like (page title, button, image, etc) and automatically pass in the actual parameters with each new project? So I'm not writing code again and again?
<veex> Than write a GUI ontop of it for manual testers?
<veex> So they can drag and drop
* Cope looks at Enumerable#chunk
<erikh> ooh you could use strscan
<erikh> can't believe I didn't think of that.
<erikh> ri StringScanner. it might be exactly what you need.
brunocoelho has joined #ruby-lang
dhruvasagar has joined #ruby-lang
Boohbah has quit [Remote host closed the connection]
<veex> erik, you're a genius.
<erikh> I'm really not
<Cope> erikh: interesting stuff
<samuelkadolph> He's really not
<samuelkadolph> :P
<veex> don't lie to yourself
<erikh> samuelkadolph: heheheh
<samuelkadolph> Whoa, when did ruby get a string scanner?
<erikh> oh 1.4 or so
<samuelkadolph> Hmm, never seen it before
<erikh> yeah, you have to require 'strscan'
<erikh> it hides very welll
<erikh> there are lots of unsung gems in the stdlib
<erikh> err, to pun a little.
<samuelkadolph> "must_C_version"
<samuelkadolph> return self
<samuelkadolph> Ahahahaha
<samuelkadolph> What a stupid method
<erikh> samuelkadolph: haven't seen you in a while; how have you been?
<samuelkadolph> erikh: Good, been busy with my new job at Shopify
<samuelkadolph> How about you?
<erikh> not bad. doing the devops thing.
<erikh> no longer @ wildfire but I'm at a smaller shop and am pretty happy.
<samuelkadolph> Cool
outoftime has joined #ruby-lang
<veex> shopify? Cool. Do you know much about shopkick samuelkadolph ?
chimkan_ has quit [Quit: chimkan_]
<veex> congratulations eric!
<bnagy> Cope: honestly, drop_while / take_while is as efficient as anything else - they both shortcut
<bnagy> and it's readable
rippa has quit [Ping timeout: 246 seconds]
<samuelkadolph> veex: Never heard of it
<bnagy> ary.drop_while {|e| e !~ /foo/}.take_while {|e| e=~/foo/}
<Cope> bnagy: agree; but fun to play with strscan!
<veex> that's an implicit block?
<Cope> will definiely use drop_while and take_while for ease of use
<veex> Here's an idea for typing with the string scanner. You know how swipe on a mobile device automates word selection? Like IRC, you can press tab to fill out someone's username, why not have that for just general regular typing? Use a File.open (/lib/dictionary.xml) and than use stringscanner methods to match words with the a word that is most likely to be a match?
chimkan has joined #ruby-lang
pip has joined #ruby-lang
pip has quit [Changing host]
pip has joined #ruby-lang
<erikh> veex: require 'abbrev'
<erikh> or ri Abbrev
<veex> what does ri and abbrev do?
akira989 has joined #ruby-lang
outoftime has quit [Quit: Leaving]
<Cope> veex: ri is like a 3rd generation pi - irrational number, related to chaos theory.
<veex> oh god
lzhz has quit [Ping timeout: 272 seconds]
pip has quit [Ping timeout: 255 seconds]
<erikh> veex: 'ri' is a tool to get documentation
<erikh> it comes with ruby.
<erikh> you use it at your shell or cmd.exe
<erikh> Abbrev, well, you should use ri to find out :)
<Cope> sorry, veex - lack of sleep leads to bad jokes
spurling has left #ruby-lang [#ruby-lang]
msaffitz has quit [Quit: Computer has gone to sleep.]
<veex> Okay, so let's say erik, that I'm creating that little app. I first open a dictionary file and have error handling, than I have some logic to pick up typing, put it in an array, use the abbrev methods to somehow sort, and than use string scanner to somehow scan the dictionary for closely matching words with the same first few letters.
<veex> Cope, joking will not be tolerated with Ruby Mining. Only the most serious emotionless discussion is permitted.
* Cope smiles... seriously.
<erikh> haha
<erikh> veex: abbrev does almost everything you want -- no strscan required.
<erikh> anyhow, I need to get this chef server working
<erikh> bbl
gsav has joined #ruby-lang
Boohbah has joined #ruby-lang
wmoxam has quit [Quit: leaving]
gsav has quit [Client Quit]
savage- has joined #ruby-lang
_madcoder_ has quit [Ping timeout: 260 seconds]
lzhz has joined #ruby-lang
andrew_ has joined #ruby-lang
zz_chrismcg has quit [Ping timeout: 260 seconds]
VGoff has quit [Excess Flood]
andrew__ has quit [Ping timeout: 260 seconds]
zz_chrismcg has joined #ruby-lang
VGoff has joined #ruby-lang
charliesome has joined #ruby-lang
pip has joined #ruby-lang
pip has quit [Changing host]
pip has joined #ruby-lang
akira989 has quit [Remote host closed the connection]
jxie_ has quit [Remote host closed the connection]
pip has quit [Ping timeout: 256 seconds]
perryh_away is now known as perryh
perryh is now known as perry
savage- has quit [Remote host closed the connection]
flowerpot has quit [Remote host closed the connection]
mtm3 has quit [Ping timeout: 245 seconds]
macmartine has quit [Quit: macmartine]
mistym has quit [Remote host closed the connection]
mistym has joined #ruby-lang
zmack has joined #ruby-lang
macmartine has joined #ruby-lang
<erikh> hello
<erikh> I am full of whisky now
<erikh> life is good.
<Cope> :)
gsav has joined #ruby-lang
A1241 has quit [Quit: Leaving.]
brunocoelho has quit [Ping timeout: 256 seconds]
ryanf has quit [Quit: leaving]
pip has joined #ruby-lang
pip has quit [Changing host]
pip has joined #ruby-lang
pip has quit [Ping timeout: 255 seconds]
pip has joined #ruby-lang
pip has quit [Changing host]
pip has joined #ruby-lang
yxhuvud has joined #ruby-lang
andrew_ has quit [Remote host closed the connection]
andrew_ has joined #ruby-lang
pip has quit [Ping timeout: 255 seconds]
chuck has joined #ruby-lang
andrew_ has quit [Ping timeout: 272 seconds]
neocoin has quit [Remote host closed the connection]
andrew_ has joined #ruby-lang
kitallis has joined #ruby-lang
zmack has quit [Remote host closed the connection]
<veex> How do you install a patch in eclipse?
<veex> class/module name must be CONSTANT
<veex> when using the class: class Hello
<veex> puts “Hello Ruby World”
<veex> end
<veex> def hello
<veex> end
pip has joined #ruby-lang
pip has quit [Changing host]
pip has joined #ruby-lang
<erikh> veex: I think you're going to find most of the users in here don't want anything to do with eclipse
macmartine has quit [Quit: macmartine]
Asher has quit [Remote host closed the connection]
<veex> I'm fed up with all the errors just in environment settings.
Asher has joined #ruby-lang
<erikh> also you need quotes around your strings.
<erikh> puts "Hello Ruby World"
<erikh> corundum: learn to program?
<corundum> A good Ruby tutorial for newbies to programming: http://pine.fm/LearnToProgram/. NOTE: For linux installation section (in Chapter 0), the filename presented is just a example.
<erikh> read that.
kaos has joined #ruby-lang
mytrile has joined #ruby-lang
pip has quit [Ping timeout: 255 seconds]
<veex> errr....I wish I were a newbie to programming. I'm a blatent disaster who destroys software.
<veex> I'm like an experienced idiot. Is their a term for that? Sort of a derivative of newbie.
<erikh> a newbie.
<erikh> it's ok to be a newbie
<erikh> the people that are vile are the people who are newbies and don't think they are.
qpingu has quit [Quit: Leaving.]
<erikh> wahoo matz just tweeted my nginx project
<veex> Can I be a newbie with a degree in computer science and worked 4 years as a programmer?
* veex calls myself a newfail
<veex> Just used to C# and Java
pip has joined #ruby-lang
mtm3 has joined #ruby-lang
Boohbah has quit [Remote host closed the connection]
<veex> When I was younger, I'd get kicked from every IRC channel within at least a day. I've matured a little.
zmack has joined #ruby-lang
<erikh> veex: yes. there are lots of fairly green programmers with degrees
<erikh> don't sweat it, we all grow up sooner or later.
chimkan has quit [Quit: chimkan]
pip has quit [Ping timeout: 255 seconds]
<veex> I don't feel so stupid then :)
andrew_ has quit [Remote host closed the connection]
<erikh> veex: the best thing you can do for yourself is learn to teach yourself.
andrew_ has joined #ruby-lang
<erikh> now that you have a degree and know all those fancy algorithms and data structures, teaching yourself beyond that will obi-wan your shit
<erikh> "more powerful than you can imagine" and all that.
<erikh> did I mention I'm drunk?
gouthamvel has joined #ruby-lang
zmack has quit [Remote host closed the connection]
gouthamvel has left #ruby-lang [#ruby-lang]
zmack has joined #ruby-lang
chimkan has joined #ruby-lang
spuk has quit [Ping timeout: 240 seconds]
burgestrand has quit [Quit: Leaving.]
andrew_ has quit [Ping timeout: 276 seconds]
pip has joined #ruby-lang
pip has quit [Changing host]
pip has joined #ruby-lang
kaos has quit [Ping timeout: 245 seconds]
<TTilus> could it possibly be monday morning for you?
<erikh> almost
solars has joined #ruby-lang
pip has quit [Read error: Connection reset by peer]
tonni has joined #ruby-lang
<veex> That's fantastic stuff. I thought you were ALWAYS.uppcase drunk erikh ?
<erikh> no, I don't drink very often.
<veex> Early Monday morning is a great time to start.
<erikh> haha yes.
<erikh> I need to sleep
<erikh> later.
<veex> BJ's in Foster City is always a good place to cure your thirst.
<erikh> Foster City's a bit of a trek.
dhruvasagar has quit [Quit: Lost terminal]
dhruvasagar has joined #ruby-lang
<veex> How far is that from you?
<erikh> I'm in menlo park
<veex> Rose $ Crown is where I enjoyed.
<erikh> but I don't drive, so foster city's a bit out of the way.
<erikh> yeah, that's a nice spot.
<erikh> crowded though, like the rest of palo alto.
zmack has quit [Remote host closed the connection]
<veex> I walked in with a group of offshore people. A super hot secretary from Colombia began hitting on me.
<veex> Said she was head of the house secretary at Facebook.
<erikh> ha
<veex> That's the place to go...
<erikh> I'm married.
zmack has joined #ruby-lang
<veex> What's the wife about? Bring her for a nice spa out there :)
tomb_ has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
outsmartin has joined #ruby-lang
mytrile has quit [Read error: Connection reset by peer]
heftig has quit [Quit: leaving]
mytrile has joined #ruby-lang
<veex> have a good night erikh :)
* veex doesn't drink at all
solars has quit [Ping timeout: 252 seconds]
mytrile has quit [Read error: Connection reset by peer]
mytrile has joined #ruby-lang
mssola has joined #ruby-lang
A124 has joined #ruby-lang
ramonmaruko has quit [Ping timeout: 264 seconds]
ramonmaruko has joined #ruby-lang
tomb_ has joined #ruby-lang
workmad3 has joined #ruby-lang
wasnotrice is now known as zz_wasnotrice
Boohbah has joined #ruby-lang
neocoin has joined #ruby-lang
igotnolegs has quit [Quit: Computer has gone to sleep.]
mtm3 has quit [Ping timeout: 264 seconds]
workmad3 has quit [Ping timeout: 240 seconds]
qwerxy has joined #ruby-lang
woollyams has quit [Ping timeout: 256 seconds]
outsmartin has quit [Quit: Leaving.]
dc5ala has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
brushbox has quit [Quit: Leaving.]
francisfish has joined #ruby-lang
stardiviner has quit [Quit: my website: http://stardiviner.dyndns-blog.com/]
neocoin has quit [Remote host closed the connection]
qwerxy has quit [Quit: offski]
rippa has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
gsav has quit [Read error: Connection reset by peer]
Boohbah has quit [Remote host closed the connection]
burgestrand has joined #ruby-lang
saLOUt has joined #ruby-lang
vmoravec has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
gnufied has joined #ruby-lang
srbartlett has quit [Remote host closed the connection]
Boohbah has joined #ruby-lang
LarryLv has joined #ruby-lang
srbartlett has joined #ruby-lang
publicvoid__ has quit [Ping timeout: 260 seconds]
retro|cz has quit [Ping timeout: 265 seconds]
veex has quit [Remote host closed the connection]
srbartlett has quit [Ping timeout: 250 seconds]
veex has joined #ruby-lang
solars has joined #ruby-lang
heftig has joined #ruby-lang
rolfb has joined #ruby-lang
JohnBat26 has joined #ruby-lang
gregmoreno has quit [Ping timeout: 252 seconds]
zz_chrismcg has left #ruby-lang [#ruby-lang]
chrismcg has joined #ruby-lang
nevynxxx has joined #ruby-lang
cdt has joined #ruby-lang
sora_h is now known as s0ra_h
Criztian has joined #ruby-lang
veex has quit [Remote host closed the connection]
veex has joined #ruby-lang
qwerxy has joined #ruby-lang
perry is now known as perryh_away
kaiwren has joined #ruby-lang
skinny_much has joined #ruby-lang
Fullmoon has joined #ruby-lang
futurechimp has joined #ruby-lang
workmad3 has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
skinny_much has quit [Remote host closed the connection]
skinny_much has joined #ruby-lang
CodeBlock has quit [Changing host]
CodeBlock has joined #ruby-lang
Boohbah has quit [Remote host closed the connection]
postmodern has joined #ruby-lang
robotmay has joined #ruby-lang
gregmoreno has joined #ruby-lang
gouthamvel has joined #ruby-lang
gouthamvel has left #ruby-lang [#ruby-lang]
tallship has quit [Read error: Connection reset by peer]
adambeynon has joined #ruby-lang
NeVeR has joined #ruby-lang
Boohbah has joined #ruby-lang
NeVeR has left #ruby-lang [#ruby-lang]
NeVeR_ has joined #ruby-lang
tallship has joined #ruby-lang
Viliny has joined #ruby-lang
<Viliny> Hello! Anyone here familiar with fileutils?
<Viliny> can i copy a file and have the destination filename changed?
neoesque has quit [Quit: Bye!]
jordan` is now known as mouni
mouni is now known as jordan`
<postmodern> Viliny, yes just specify a full destination path
<Viliny> ah i see, thank you postmodern :)
<Viliny> and sorry for the tardy response, at work.
<postmodern> Viliny, no worries :) see http://rubydoc.info/stdlib/fileutils for usage
<Viliny> postmodern: i had that page open via google search as well, im just a little lost without examples :)
fayimora has quit [Ping timeout: 246 seconds]
<NeVeR_> FileUtils.cp '/path/to/file.ext', '/path/to/newfile.ext'
<Viliny> and files without extension?
<Viliny> will it assume they are directories?
<NeVeR_> nope.. if there is a directory called newfile, it will put it in newfile, else it will call the file newfile
<Viliny> excellent
<Viliny> quick regexp problem:
<Viliny> This script was ment to identify files by extension
<Viliny> now i noticed the files i need to work with have a identifier_ prefix instead
S1kx has quit [Read error: No route to host]
<Viliny> such as "arrival_1294323.ext"
postmodern has quit [Ping timeout: 272 seconds]
S1kx has joined #ruby-lang
<NeVeR_> is_arrival =~ /^arrival_/
<Viliny> filelist = Dir["#{sourced}/*#{filetype}"].to_a; is what i used, can i just do filelist = Dir["#{sourced}/#{ident}_*"].to_a instead?
ohsix has quit [Remote host closed the connection]
<NeVeR_> should work fine
<Viliny> excellent, thanks for the help NeVeR_ !
<NeVeR_> np
ohsix has joined #ruby-lang
<NeVeR_> I'm very new to Ruby :) I was crazy about perl until recently (3 weeks ago), until I got converted to Ruby
<NeVeR_> ruby is amazing :D
d3vic3 has joined #ruby-lang
s0ra_h is now known as sora_h
conceal_rs_ has quit [Read error: Operation timed out]
conceal_rs_ has joined #ruby-lang
<Viliny> hehe, yeah :)
<Viliny> im trying to open a new file for logging, embedding the timestamp in the filename doesn't seem to as easy as (Time.now) -> should the parenthesis have a # in front of it or something?
<yorickpeterse> #{Time.now}
<yorickpeterse> So for example `puts "Hello, the current time is #{Time.now}"
skinny_much has quit [Remote host closed the connection]
qwerxy has quit [Ping timeout: 244 seconds]
skinny_much has joined #ruby-lang
<Viliny> this actually made it write the exact same thing in the txt file: f.puts '004 #{Time.now} ####'
futurechimp has quit [Ping timeout: 246 seconds]
<Viliny> rest of it actually works perfectly
tjadc has joined #ruby-lang
d3vic3 has quit [Ping timeout: 246 seconds]
qwerxy has joined #ruby-lang
futurechimp has joined #ruby-lang
<yorickpeterse> File.open("some_file.txt") { |handle| handle.write("#{Time.now}") }
<yorickpeterse> Note the use of double quotes
d3vic3 has joined #ruby-lang
<Viliny> i changed the script to append to a static log file instead
<Viliny> makes more sense than having a separate log file for each processed file
rolfb has quit [Quit: Leaving...]
<Viliny> so the only thing that needs a timestamp now is the log entry
<yorickpeterse> err, File.open should have the file mode. Forgot to add that
<yorickpeterse> Also, pastie some of the code in a pastebin
sora_h is now known as s0ra_h
neocoin has joined #ruby-lang
s0ra_h is now known as sora_h
<Viliny> here we go: http://pastebin.com/aGGKmNig
<yorickpeterse> Well, for starters fix the indentation
<yorickpeterse> Ruby uses 2 spaces per indentation level
<yorickpeterse> Also, you're using single quotes
<yorickpeterse> as mentioned you should use double quotes as otherwise it will be used as a literal string
<Viliny> oh, im used to indent with tab
<bnagy> indent however you want
<yorickpeterse> Ruby uses 2 spaces, no tabs :)
rolfb has joined #ruby-lang
<Viliny> okay, double quotes made a difference in syntax highligting
skinny_much has quit [Remote host closed the connection]
<bnagy> fuck 2 spaces
<yorickpeterse> bnagy: #troll is to the left
<Mon_Ouie> The "end" should be at the same level as the File.open though
<bnagy> I use 4 spaces cause I can't read 2, and anyone who tells me I can't can die in a fire
<Viliny> Mon_Ouie: it's all a little trashball thrown together still
<bnagy> as long as the level line up people can make their editor show them whatever they like
<Viliny> currently using notepad++ here on this windows xp machine at work, it all looks nice
<Viliny> thank you yorickpeterse, i swapped out my script content with that
<yorickpeterse> np
<Viliny> weird, log file still shows:
<Viliny> 004 Time.now ####
<Viliny> C:/DISY/ODEX_test/004/Arrival_180612100819.txt
<Viliny> ####################
<yorickpeterse> Ah
<yorickpeterse> You've quoted "Time.now" (which I missed
<yorickpeterse> f.puts "004 #{"Time.now"} ####" should be f.puts "004 #{Time.now} ####"
<Viliny> im currently trying without the quotes
<Viliny> and that worked :)
<yorickpeterse> Also, I recommend using the Logger class for logging instead of re-inventing the wheel of logging formats
<Viliny> okay! looks like we have a working thing here then
<Viliny> oh, i wasn't aware there was such a thing
<Viliny> oh this looks good, but i think a simple write to file will do for now. i only need to see which files processed when
<Viliny> i'll probably start using that once things get a little more fleshed out here though
saLOUt has quit [Ping timeout: 265 seconds]
futurechimp has quit [Quit: This computer has gone to sleep]
neocoin has quit [Remote host closed the connection]
sora_h is now known as s0ra_h
shevy has joined #ruby-lang
neocoin has joined #ruby-lang
futurechimp has joined #ruby-lang
skinny_much has joined #ruby-lang
s0ra_h is now known as sora_h
skinny_much has left #ruby-lang [#ruby-lang]
zmack has quit [Remote host closed the connection]
Kero has quit [Read error: Operation timed out]
zmack has joined #ruby-lang
Kero has joined #ruby-lang
neocoin has quit [Ping timeout: 244 seconds]
retro|cz has joined #ruby-lang
wpaulson has joined #ruby-lang
wpaulson has quit [Client Quit]
skinny_much has joined #ruby-lang
heftig has quit [Quit: leaving]
ppoe has joined #ruby-lang
ppoe has left #ruby-lang [#ruby-lang]
skinny_much has left #ruby-lang [#ruby-lang]
kaiwren has quit [Quit: kaiwren]
dejongge has joined #ruby-lang
voker57 has quit [Remote host closed the connection]
<Defusal_> im guessing %r{} is the best way of matching paths with regex
Hakon|mbp has joined #ruby-lang
woollyams has joined #ruby-lang
fayimora has joined #ruby-lang
neoesque has joined #ruby-lang
umttumt has quit [Remote host closed the connection]
Criztian has quit [Read error: Connection reset by peer]
Criztian has joined #ruby-lang
Criztian has quit [Read error: Connection reset by peer]
Criztian_ has joined #ruby-lang
Dreamer3 has quit [Quit: Leaving...]
saLOUt has joined #ruby-lang
lupine_85 has quit [Changing host]
lupine_85 has joined #ruby-lang
nisstyre has quit [Quit: Leaving]
<Defusal_> anyone have any suggestions about refactoring parts of a model into multiple files?
<Defusal_> parts being different kinds of helper methods
mark_locklear has joined #ruby-lang
kaiwren has joined #ruby-lang
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
solars has quit [Quit: WeeChat 0.3.5]
d3vic3 has quit [Quit: leaving]
ddollar has left #ruby-lang ["Textual IRC Client: http://www.textualapp.com/"]
saLOUt has quit [Ping timeout: 260 seconds]
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
solars has joined #ruby-lang
solars has quit [Quit: WeeChat 0.3.5]
solars has joined #ruby-lang
larissa has joined #ruby-lang
shevy has left #ruby-lang [#ruby-lang]
larissa has quit [Quit: Saindo]
gentz has quit [Ping timeout: 246 seconds]
tjadc has quit [Read error: Operation timed out]
Axsuul has quit [Ping timeout: 276 seconds]
gentz has joined #ruby-lang
tjadc has joined #ruby-lang
jds has quit [Remote host closed the connection]
jperry2 has joined #ruby-lang
gix has quit [Ping timeout: 246 seconds]
tjadc has quit [Quit: No Ping reply in 180 seconds.]
tjadc has joined #ruby-lang
CCD has joined #ruby-lang
gix has joined #ruby-lang
sepp2k has joined #ruby-lang
dv310p3r has joined #ruby-lang
kain has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 265 seconds]
My_Hearing has joined #ruby-lang
gouthamvel has joined #ruby-lang
corecode has left #ruby-lang [":wq"]
jimmy1980 has joined #ruby-lang
brunocoelho has joined #ruby-lang
robotmay_ has joined #ruby-lang
jolasveinninn has joined #ruby-lang
chimkan__ has joined #ruby-lang
yannis has joined #ruby-lang
scampbell has joined #ruby-lang
robotmay has quit [Ping timeout: 246 seconds]
solars has quit [Ping timeout: 240 seconds]
chimkan has quit [Ping timeout: 265 seconds]
chimkan__ is now known as chimkan
DefV has quit [Read error: Connection reset by peer]
umttumt has joined #ruby-lang
gouthamvel has left #ruby-lang [#ruby-lang]
chimkan has quit [Read error: Connection reset by peer]
chimkan__ has joined #ruby-lang
tjadc has quit [Ping timeout: 255 seconds]
neocoin has joined #ruby-lang
tjadc_ has joined #ruby-lang
tommyvyo has joined #ruby-lang
carloslopes has joined #ruby-lang
brushbox has joined #ruby-lang
tjadc_ has quit [Client Quit]
solars has joined #ruby-lang
Fullmoon has quit [Ping timeout: 246 seconds]
futurechimp has quit [Quit: This computer has gone to sleep]
digitalbane has joined #ruby-lang
jolasveinninn has quit [Quit: Leaving]
brunocoelho has quit [Remote host closed the connection]
frem has joined #ruby-lang
andrew_ has joined #ruby-lang
sailias has joined #ruby-lang
andrew_ has quit [Remote host closed the connection]
andrew_ has joined #ruby-lang
kurko_ has joined #ruby-lang
futurechimp has joined #ruby-lang
mistym has quit [Remote host closed the connection]
andrew_ has quit [Ping timeout: 272 seconds]
chimkan__ has quit [Quit: chimkan__]
sailias has quit [Quit: Leaving.]
veex has quit [Ping timeout: 276 seconds]
veex has joined #ruby-lang
outoftime has joined #ruby-lang
heftig has joined #ruby-lang
bglusman has joined #ruby-lang
yannis has quit [Quit: yannis]
yugui_zzz is now known as yugui
zmack has quit [Remote host closed the connection]
neocoin has quit [Remote host closed the connection]
saLOUt has joined #ruby-lang
neoesque has quit [Quit: Bye!]
NeVeR_ has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
gsav has joined #ruby-lang
kaos77 has joined #ruby-lang
kurko__ has joined #ruby-lang
yannis has joined #ruby-lang
neocoin has joined #ruby-lang
krohrbaugh has joined #ruby-lang
sockmonk has joined #ruby-lang
kurko_ has quit [Ping timeout: 276 seconds]
fgomez has quit [Remote host closed the connection]
hynkle has joined #ruby-lang
agilob has quit [Quit: Reconnecting]
agilob has joined #ruby-lang
bryancp has joined #ruby-lang
gsav has quit [Read error: Connection reset by peer]
WillMarshall has joined #ruby-lang
Fullmoon has joined #ruby-lang
yannis has quit [Read error: Connection reset by peer]
yannis has joined #ruby-lang
bglusman has quit [Remote host closed the connection]
saLOUt has quit [Ping timeout: 245 seconds]
pkondzior has joined #ruby-lang
yugui is now known as yugui_zzz
gsav has joined #ruby-lang
My_Hearing is now known as Mon_Ouie
kaiwren has quit [Quit: kaiwren]
crankharder has joined #ruby-lang
sailias has joined #ruby-lang
wmoxam has joined #ruby-lang
kunsel has joined #ruby-lang
tcopp has joined #ruby-lang
brushbox has quit [Quit: Leaving.]
riffraff has joined #ruby-lang
<Defusal_> ruby-doc.org is down :(
<matled> yeah, is there any mirror?
<mistym> Oh no ;.;
<mistym> matled: There's also rubydoc.info, which has a different interface
msaffitz has joined #ruby-lang
andrew_ has joined #ruby-lang
gouthamvel has joined #ruby-lang
<yorickpeterse> Might be me but rubydoc.info doesn't seem to have everything
<yorickpeterse> Ah it does, I was just overlooking it
Jay_Levitt has joined #ruby-lang
Jon_Brisbin has joined #ruby-lang
j_brisbin has joined #ruby-lang
Jon_Brisbin has quit [Client Quit]
<matled> I should really check how complicated it is to start such a documentation server locally
kaiwren has joined #ruby-lang
vaelen has joined #ruby-lang
j_brisbin has quit [Ping timeout: 245 seconds]
enebo has joined #ruby-lang
kunsel has quit []
kunsel has joined #ruby-lang
<Mon_Ouie> yard server -g
kurko__ has quit [Ping timeout: 246 seconds]
kunsel has quit [Client Quit]
kunsel has joined #ruby-lang
<yorickpeterse> meh, can be done a lot easier for the Ruby doc
<yorickpeterse> generate it once, let Nginx serve it from that point on
WillMarshall has quit [Quit: Computer has gone to sleep.]
<Defusal_> is using sysseek(-n, IO::SEEK_END) and rescuing Errno::EINVAL when the file is not large enough the best possible way to seek to n chars from the end of a file?
hynkle has quit [Quit: hynkle]
akira989 has joined #ruby-lang
<matled> Defusal_: you can find out the total length by seeking to the end and then compute the offset you want to go to ([0, length - n].min)
<Defusal_> matled, i guess that could work too :)
<Mon_Ouie> Defusal_: That's good, except you should normally use #seek instead of #sysseek
Skif has quit [Ping timeout: 240 seconds]
kurko__ has joined #ruby-lang
<Defusal_> well sysseek works and it is what this gem has always used, so i leave it as is
jxie has joined #ruby-lang
kaos77 has quit [Remote host closed the connection]
<matled> Mon_Ouie: for core and stdlib I have to download the ruby source code?
burgestrand has quit [Quit: Leaving.]
gouthamvel has left #ruby-lang [#ruby-lang]
jimmy1980 has quit [Ping timeout: 255 seconds]
bfreeman has quit [Quit: bfreeman]
hynkle has joined #ruby-lang
carloslopes has quit [Ping timeout: 272 seconds]
jxie has quit [Quit: leaving]
jxie has joined #ruby-lang
JohnBat26 has quit [Ping timeout: 265 seconds]
Jay_Levitt has quit [Quit: Linkinus - http://linkinus.com]
jimmy1980 has joined #ruby-lang
kurko__ has quit [Ping timeout: 276 seconds]
zmack has joined #ruby-lang
thone has joined #ruby-lang
saLOUt has joined #ruby-lang
thone_ has quit [Ping timeout: 246 seconds]
bglusman has joined #ruby-lang
kurko__ has joined #ruby-lang
umttumt has quit [Remote host closed the connection]
futurechimp has quit [Ping timeout: 260 seconds]
bglusman has quit [Ping timeout: 276 seconds]
ryez has joined #ruby-lang
futurechimp has joined #ruby-lang
Bwild has joined #ruby-lang
perryh_away is now known as perryh
jimmy1980 has quit [Ping timeout: 246 seconds]
solars has quit [Ping timeout: 245 seconds]
msaffitz has quit [Quit: Computer has gone to sleep.]
rolfb has quit [Quit: Leaving...]
gregf has quit [Quit: WeeChat 0.3.8]
kunsel has quit []
kaiwren_ has joined #ruby-lang
soxet has joined #ruby-lang
umttumt has joined #ruby-lang
<soxet> Is $SAFE=4 safe enough to run code unsanitized code from users
kaiwren has quit [Ping timeout: 246 seconds]
kaiwren_ is now known as kaiwren
<andrewvos> no
<soxet> andrewvos, Can you expand on that? What exploits are there for 1.9
bryancp has quit [Remote host closed the connection]
francisfish has quit [Remote host closed the connection]
sora_h is now known as s0ra_h
d3vic3 has joined #ruby-lang
jbwiv has joined #ruby-lang
kaiwren has quit [Quit: kaiwren]
<frem> I don't understand why this doesn't work. Anyone? https://gist.github.com/f01e5b5579d64955c0c9
francisfish has joined #ruby-lang
tbuehlmann has joined #ruby-lang
<frem> oh. never mind. -_-
robotmay_ has quit [Remote host closed the connection]
<andrewvos> soxet: I just wouldn't trust it.
<MouseTheLuckyDog> Anyone know what's up with ruby-doc?
kitallis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
solars has joined #ruby-lang
futurechimp has quit [Quit: This computer has gone to sleep]
lsegal has joined #ruby-lang
<andrewvos> MouseTheLuckyDog: Seems to be broken
savage- has joined #ruby-lang
sailias has quit [Quit: Leaving.]
macmartine has joined #ruby-lang
jxie has quit [Ping timeout: 246 seconds]
nevynxxx has quit [Quit: leaving]
elliotcm has joined #ruby-lang
msaffitz has joined #ruby-lang
umttumt has quit [Remote host closed the connection]
sailias has joined #ruby-lang
perryh is now known as perry
gsav_ has joined #ruby-lang
VGoff is now known as VGoff_afk
gsav has quit [Ping timeout: 256 seconds]
VGoff_afk is now known as VGoff
VGoff is now known as VGoff_afk
VGoff_afk is now known as VGoff
futurechimp has joined #ruby-lang
moxie_ has joined #ruby-lang
bryancp has joined #ruby-lang
achiu has joined #ruby-lang
<moxie_> Just curious. Suppose you have a class with string attributes first_name and last_name… and you have a method #say_hello that tries to concatenate those strings. If one of the attributes is not defined, is it "right" to raise something before it tries?
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
voker57 has joined #ruby-lang
kaiwren has joined #ruby-lang
kaiwren has quit [Client Quit]
elliotcm has quit [Quit: elliotcm]
<andrewvos> moxie_: Well, dependes
<andrewvos> depends*
<andrewvos> Is it an error, or do you instead just want to say "Hello Andrew"
VGoff is now known as VGoff_afk
<andrewvos> Instead of "Hello Andrew Vos"
carloslopes has joined #ruby-lang
akira989 has quit [Remote host closed the connection]
publicvoid__ has joined #ruby-lang
<moxie_> the first name, last example was arbitrary… it could be integers… I guess maybe your answer is sufficient though… is there a suitable response even with this missing attributes… if there is, cool, if not, it's going to raise anyways
gianlucadv has quit [Excess Flood]
gianlucadv has joined #ruby-lang
butchanton has joined #ruby-lang
burgestrand has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
tomb_ has quit [Quit: Computer has gone to sleep.]
carloslopes has quit [Quit: Leaving]
<andrewvos> You could raise an exception
carloslopes has joined #ruby-lang
<andrewvos> But it doesn't sound right though
<andrewvos> The object shouldn't be saying "don't use me like this"
<andrewvos> It should take firstname and lastname as a parameter
<andrewvos> And if the developer doesn't pass these in, then he/she fucked up.
<andrewvos> Right beer time
dc5ala has quit [Quit: Ex-Chat]
bfreeman has joined #ruby-lang
akira989 has joined #ruby-lang
akira989 has quit [Remote host closed the connection]
hynkle has quit [Ping timeout: 244 seconds]
asahi has joined #ruby-lang
burgestrand has quit [Ping timeout: 245 seconds]
NeVeR_ has joined #ruby-lang
cdt has quit [Quit: Ex-Chat]
gsav has joined #ruby-lang
gsav_ has quit [Ping timeout: 246 seconds]
<moxie_> andrewvos: A better example => https://gist.github.com/4addbf3376773d5c1935
<moxie_> you're suggesting that the current_interval method should take those required values as arguments?
dejongge has quit [Ping timeout: 252 seconds]
chrismcg is now known as zz_chrismcg
Bwild has quit [Quit: leaving]
futurechimp has quit [Quit: Leaving]
burgestrand has joined #ruby-lang
workmad3 has quit [Ping timeout: 246 seconds]
injekt has joined #ruby-lang
<injekt> erikh: ping
pvh has quit [Quit: Connection closed for inactivity]
fayimora has quit [Quit: Busy…..zzzzz]
<rue> OMG twice in one week
<injekt> haha
krohrbaugh has quit [Quit: Leaving.]
francisfish has quit [Remote host closed the connection]
mrsolo has joined #ruby-lang
bryancp has quit [Remote host closed the connection]
<erikh> injekt: pong
tomb_ has joined #ruby-lang
Bwild has joined #ruby-lang
krohrbaugh has joined #ruby-lang
hynkle has joined #ruby-lang
JohnBat26 has joined #ruby-lang
cdt has joined #ruby-lang
achiu has quit [Ping timeout: 240 seconds]
gouthamvel has joined #ruby-lang
sailias has quit [Ping timeout: 240 seconds]
moxie_ has quit [Quit: moxie_]
stepnem has quit [Ping timeout: 245 seconds]
tomb_ has quit [Ping timeout: 244 seconds]
gouthamvel has quit [Ping timeout: 255 seconds]
cynosure has quit [Read error: Connection reset by peer]
<slyphon> would it really be too much trouble for Struct to define #to_hash ffs?
cynosure has joined #ruby-lang
rolfb has joined #ruby-lang
robwilliamsukio has joined #ruby-lang
<tubbo> slyphon: you realize that doing that will make rails not scale
<tubbo> so yes, it is too much trouble
<tubbo> ;-)
<tubbo> RUBY!
brianpWins has quit [Quit: brianpWins]
<slyphon> ha
gouthamvel has joined #ruby-lang
rafmagana has joined #ruby-lang
achiu has joined #ruby-lang
<rue> Ho
<rolfb> how can I have nice colors in `ri` ?
gouthamvel has left #ruby-lang [#ruby-lang]
solars has quit [Ping timeout: 256 seconds]
asahi has quit [Quit: Leaving.]
<erikh> slyphon: you can use it like a hash.
<erikh> also ostruct can do to_hash IIRC.
stepnem has joined #ruby-lang
<slyphon> yeah, but i need an actual hash
<slyphon> yeah
<slyphon> but not Struct
<slyphon> which is just kinda dumb
<erikh> ostruct is dog slow though.
<slyphon> yeah, only time i use it is when i'm following along with the optparse example and then go "Wait a sec! i'm using ostruct!!"
bryancp has joined #ruby-lang
<erikh> heh.
_whitelogger has joined #ruby-lang