<drbrain>
erikh: for bonus points, you could put superclass methods in the nav pane
<zenspider>
yay! a tool to extract parse errors to as small a piece as I dare
<drbrain>
erikh: but that should be a separate pull request
kvirani has joined #ruby-lang
lsegal has joined #ruby-lang
shevy has joined #ruby-lang
Defusal has joined #ruby-lang
Defusal has joined #ruby-lang
macmartine has joined #ruby-lang
tenderlove has joined #ruby-lang
savage- has joined #ruby-lang
krzkrzkrz has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
krohrbaugh has joined #ruby-lang
<erikh>
drbrain: ok, I'll read it now
<erikh>
drbrain: works for me, I'll try to make some progress on it later tonight
<erikh>
I will probably create two pull requests as you suggested.
<erikh>
nav pane should be easy now that we have a way to get at it, though, so I might just do it tonight too.
datanoise has joined #ruby-lang
igotnolegs has joined #ruby-lang
z3r00ld has joined #ruby-lang
z3r00ld has quit [#ruby-lang]
krzkrzkrz has joined #ruby-lang
dcorbin has joined #ruby-lang
slimfit has joined #ruby-lang
gix has joined #ruby-lang
<owen1>
bundle command is stuck on 'Fetching source index from http://rubygems.org/'. i tried to define all my gems with exact version in the Gemfile, but it didn't help
<devn>
owen1: make sure you don't have a hanging ruby process out there somewhere
<devn>
ps aux | grep ruby
<owen1>
devn: let me see
Jerald has joined #ruby-lang
fattastic has joined #ruby-lang
RORgasm has joined #ruby-lang
kurko_ has joined #ruby-lang
drumond19 has joined #ruby-lang
ramu3 has joined #ruby-lang
workmad3 has joined #ruby-lang
ridders24 has joined #ruby-lang
shtirlic_ has joined #ruby-lang
neoesque has joined #ruby-lang
mistym has joined #ruby-lang
<postmodern>
i want to support the ability to use alternate ruby shells in my library
<postmodern>
such as: ripl or pry
<postmodern>
what env variable should i use: RUBY_SHELL? RUBYSHELL?
gnufied has joined #ruby-lang
dhruvasagar has joined #ruby-lang
senthil has joined #ruby-lang
boxmo has joined #ruby-lang
seanstickle has joined #ruby-lang
andrewhl has joined #ruby-lang
jfelchner has joined #ruby-lang
jtoy has joined #ruby-lang
krzkrzkrz has joined #ruby-lang
nofxx has joined #ruby-lang
gix has joined #ruby-lang
<mistym>
Whoa, is rubygems down?
ericmuyser has joined #ruby-lang
ramonmaruko has joined #ruby-lang
seoaqua has joined #ruby-lang
<seoaqua>
is there any package to process uri path? e.g. href="#" , href="javascript:void()", href="path/to/something.php"
<seoaqua>
erikh, i just found a post,maybe i should use URI::merge
slyphon has joined #ruby-lang
drumond19 has joined #ruby-lang
ramu3 has joined #ruby-lang
<seoaqua>
this is working ^_^
jolohaga has joined #ruby-lang
jolohaga has joined #ruby-lang
jolohaga has joined #ruby-lang
indeterminate has joined #ruby-lang
jolohaga has joined #ruby-lang
fgomez has joined #ruby-lang
rippa has joined #ruby-lang
jolohaga has joined #ruby-lang
dr0id has joined #ruby-lang
WillMarshall has joined #ruby-lang
ramu3 has joined #ruby-lang
gouthamvel has joined #ruby-lang
gouthamvel has quit [#ruby-lang]
Luxx_ has joined #ruby-lang
ryanf_ has joined #ruby-lang
apeiros_ has joined #ruby-lang
yxhuvud has joined #ruby-lang
|Vargas| has joined #ruby-lang
nuclearsandwich has joined #ruby-lang
RORgasm has joined #ruby-lang
boxmo has joined #ruby-lang
amerine_ has joined #ruby-lang
geekfactor has joined #ruby-lang
kings has joined #ruby-lang
ryanf_ has joined #ruby-lang
x0F__ has joined #ruby-lang
<seoaqua>
could someone help with:
<seoaqua>
/usr/lib/ruby/1.9.1/uri/common.rb:176:in `split': bad URI(is not URI?): http://app.baidu.com/365rili (URI::InvalidURIError)
<seoaqua>
there's no error in irb
apeiros_ has joined #ruby-lang
gouthamvel has joined #ruby-lang
gouthamvel has quit [#ruby-lang]
<Kero>
is irb also v1.9.1 ?
<apeiros_>
$ irb -v
<apeiros_>
irb 0.9.6(09/06/30)
<apeiros_>
irb is old
* Kero
was responding to seoaqua :)
<apeiros_>
I don't have the backlog, but since the newest irb is 0.9.6, it can't be 1.9.1 ;-)
<Kero>
but it can be ruby 1.9.1; with multiple rubies installed, you'd want to be sure if ruby fails and irb does not
<apeiros_>
ah, I see what you meant
febeling has joined #ruby-lang
<seoaqua>
Kero, 1.9.3 in archlinux
<seoaqua>
Kero, sorry, irb 0.9.6(09/06/30)
<seoaqua>
i dont think the uri is invalid, that is odd
kitallis has joined #ruby-lang
fukushim_ has joined #ruby-lang
<Kero>
if there's a difference between ruby program and irb snippet, there might be something in the program that is interfering, perhaps overriding a method. grow the snippet to the entire program and see when it blows up.
* Kero
has to leave now
jolohaga has joined #ruby-lang
<seoaqua>
thanks
dhruvasagar has joined #ruby-lang
workmad3 has joined #ruby-lang
febeling has quit [#ruby-lang]
MDmalLION has joined #ruby-lang
<MDmalLION>
pc or osx
solars has joined #ruby-lang
<seoaqua>
pc
<seoaqua>
i've got this. it was a URI::HTTP instance, i should use the to_s method
sandbags has joined #ruby-lang
Zolrath has joined #ruby-lang
MDmalLION has joined #ruby-lang
fgomez has joined #ruby-lang
<seoaqua>
another problem, i havent found the answer since yesterday
<seoaqua>
/usr/lib/ruby/1.9.1/webrick/httputils.rb:353:in `gsub': incompatible encoding regexp match (ASCII-8BIT regexp with UTF-8 string) (Encoding::CompatibilityError)
<seoaqua>
i got all links from a webpage with Mechanize, and print them
<seoaqua>
the printing encountered the encoding error
IPGlider has joined #ruby-lang
<hagabaka>
do you have coding: utf-8 comment at the beginning of the rb file?
<MDmalLION>
I think so
publicvoid_ has joined #ruby-lang
dr0id has joined #ruby-lang
<seoaqua>
yes
<seoaqua>
i should remove it? what if i need to write utf8 characters in the program?
<seoaqua>
the error happens without the comment
mtkd has joined #ruby-lang
<seoaqua>
im just printing, why it triggers 'gsub'?
mtkd has joined #ruby-lang
<hagabaka>
no, I thought it might be because you didn't have it
<hagabaka>
seoaqua: mechanize is getting a URI::InvalidURIError , so does your page have non-ascii and unescaped URIs?
<seoaqua>
hagabaka, yes, its chinese :)
JohnBat26 has joined #ruby-lang
<hagabaka>
URI.escape handles UTF-8 strings, but WEBrick::HTTPUtils.escape does not. I don't know why there need to be two methods for it...
<hagabaka>
also I don't know why mechanize uses WEBrick's instead lf URI.escape...
bjensen has joined #ruby-lang
<seoaqua>
hagabaka, there is no exception when mechanize handles the links. the problem happens when i print the Mechanize::Page::Link.uri
<seoaqua>
hagabaka, or, when i convert the link.uri to be string
<hagabaka>
yeah, it's in the uri method
judofyr has joined #ruby-lang
<seoaqua>
where is the bug,then? in URI or Mechanize?
RORgasm has joined #ruby-lang
<seoaqua>
ignore:)
<hagabaka>
I think in WEBrick, you could probably monkeypatch WEBrick::HTTPUtils.escape to just call URI.escape, to avoid the problem
Fullmoon has joined #ruby-lang
<hagabaka>
I tested with a Chinese UTF-8 string, and WEBrick::HTTPUtils.escape gives the same error, but if I force_encoding it to 'ASCII-8BIT' it returns the same as URI.escape
<seoaqua>
do you mean to redeclare the method in that class? im a newbie
<hagabaka>
but maybe WEBrick's escape is only intended for internal use or something, then it's a bug in mechanize
<seoaqua>
what if i redeclare the to_s method in Mechanize::Page::Link?
<andrewvos>
rippa: Not the best, but meh it works.
geekfactor has joined #ruby-lang
dostoyidiot has joined #ruby-lang
sandbags has joined #ruby-lang
zmack has joined #ruby-lang
francisfish has joined #ruby-lang
bjensen has joined #ruby-lang
ridders24 has joined #ruby-lang
IPGlider has joined #ruby-lang
jstemmer has joined #ruby-lang
ridders24 has joined #ruby-lang
<ridders24>
Why do i get the error `readlines': can't convert nil into String (TypeError) with http://pastie.org/3779868 . Im trying to find folders that match the var "column1" or "column2" or both together
<canton7>
ridders24, ARVG is probably empty
<ridders24>
woops
<ridders24>
cant believe i missed that
<canton7>
hehe :P
kiddorails has joined #ruby-lang
<ridders24>
the script has given me some unusual results, its provided the folder name of some but has then given the full path of a file as well with its extention. Why?
<shevy>
hehe
<shevy>
you are still on the folder script problem? :)
<shevy>
though I think most people will call it a directory
<andrewvos>
LYNCH THE WINDOWS USER
<shevy>
ridders24, please. start to indent correctly
<shevy>
you have 3x "end" from line 11 to 13, all at the same indent level
<shevy>
and please do not do "find("C:/") do |path| if F"
<shevy>
after |foo| make a newline if you must chain more conditionals into this
<shevy>
also, how do you invoke that script?
<shevy>
File.readlines(from_file) <-- you should turn this into a variable, and check for nil. and if it is nil, assign a default name or directory location
seanstickle has joined #ruby-lang
<ridders24>
im so confused
<ridders24>
whats wrong with find ("c:/") ?
<canton7>
ridders24, it's the fact that you've got an if statements traight after it -- it's rather unclear
<ridders24>
canton7: what is ARGV[0] || 'some_default ' ?
<canton7>
ridders24, actually I'm going to change that....
<canton7>
done
piyush_ranjan has joined #ruby-lang
<canton7>
not too nice from the user's point of view, but you get the idea
<canton7>
that's a bit better
RORgasm has joined #ruby-lang
leex has joined #ruby-lang
<canton7>
ridders24, what does your script do? It seems to me that iterating over the whole of C:/ is going to be hugely inefficient
<leex>
Hi, I am using Base64 and Sockets to transmit data, but it happens that Base64 has a '\n' within the string and then when do socket.puts Base64.encode64("some long string") I have to do 2 or more times socket.gets on the other side, any idea how to avoid that?
<shevy>
you can modify your string before using .encode64 ?
cjs226 has joined #ruby-lang
<shevy>
ridders24 the most important thing is to try and bring clarity and intent into your code, a structure that supports this, helps a lot, not only others who look at the code, but also yourself when a few years lateron you stare at old code you wrote
<shevy>
what canton7 did was provide the user of that script with a helpful fail message in case it was not used "properly"
yalue has joined #ruby-lang
<shevy>
and exit in case it is nil
<ridders24>
ohh i see
<shevy>
so that script is now better, because you know that the variable below CAN no longer be nil at that point, as we exit earlier in that case
<shevy>
it is like a logical exclusion of (potential) errors
<leex>
shevy: hmm, I am crypting stuff with aes and then I am using Base64 to encode it, but that yields strings like this: "...\n...=\n" and the first \n is rather annoying ;)
<shevy>
and __FILE__ has the name of the .rb script
<ridders24>
basically im trying to locate folders that match the variables of column1 and column2 and then want to list them. The idea is to eventually copy the folders and its content to another location
<canton7>
ridders24, I only stuck the __FILE__ in because it's pretty standard to see a script retuning "Usage: the_file.rb options..." if used incorrectly
<shevy>
leex, yeah I am not quite sure what you need... because if it is just a string .gsub(/\n/,'') would be enough... but perhaps you can not do this. but now you also say... you want to remove only the first \n ? )
<ridders24>
canton7: anything that helps :)
<leex>
shevy: well if I remove it the Base64.decode64 won't return the same string
<canton7>
leex, one slightly hacky way: terminate the string with two newlines, and use gets("\n\n") on the receiving side
<canton7>
leex, maybe a slightly better way: wrap some proper serialisation format (json, xml, etc) around the string
burgestrand has joined #ruby-lang
mssola has joined #ruby-lang
<leex>
canton7: ok ;)
<leex>
I will try them, even get("
<leex>
gets("\n\n") could lead to trouble
<leex>
but json sounds fine
<canton7>
yeah, it's hacky as I say :P Better IMO than replacing \n with something else in the encoded string though
gouthamvel has joined #ruby-lang
Sailias has joined #ruby-lang
gd_ has joined #ruby-lang
<gd_>
hi all
jtoy has joined #ruby-lang
mark_locklear has joined #ruby-lang
<gd_>
im trying to splat the elements of an array into an other array like tihs: [:baz] << *[:foo, :bar] # expected result = [:baz, :foo, :bar]
<gd_>
is there a graceful way doin this?
<rippa>
[:baz].concat [:foo, :bar]
<gd_>
rippa: thnx!
<gd_>
rippa: any idea why my code does not work?
<rippa>
<< takes one argument
<gd_>
...ok next i read the docs
<gd_>
thnx for the help!!
jperry has joined #ruby-lang
MDmalLION has joined #ruby-lang
dr0id has joined #ruby-lang
mistym has joined #ruby-lang
stepnem has joined #ruby-lang
kitallis has joined #ruby-lang
<leex>
canton7: tr("\n","") it is, since the b64encode method is supposed to add a newline for every 60th character, or you can use Base64.strict_encode64 which doesn't add that \n (newline) at the end or after 60 chars.
<leex>
so for my 1.8 applications tr and for my > 1.9.2 strict_encode64
kiddorails has joined #ruby-lang
<canton7>
ah, nice
kvirani has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
gnufied1 has joined #ruby-lang
dv310p3r has joined #ruby-lang
gnufied2 has joined #ruby-lang
gnufied3 has joined #ruby-lang
shajinx has joined #ruby-lang
<shajinx>
how to know about version of ruby packege installer?
morozovm has joined #ruby-lang
<shajinx>
i am using rvm for like
<shajinx>
rvm use 1.9.2p125
<shajinx>
but i m not sure about that version
<shajinx>
ple tell me what i have to write
hynkle has joined #ruby-lang
kitallis has joined #ruby-lang
<judofyr>
shajinx: hm? "ruby -v" shows the Ruby version
<leex>
after using "rvm use ..." you can use ruby -v to tell you with version was selected
jobicoppola has joined #ruby-lang
mattyoho has joined #ruby-lang
mistym has joined #ruby-lang
codewrangler has joined #ruby-lang
<shajinx>
thanks dude
<shajinx>
i have 1 onither prob..
<shajinx>
when i m starting my rails server..its showing error as..
<shajinx>
DEPRECATION WARNING: railtie_name is deprecated and has no effect. (called from <class:Engine> at /home/shajin/.rvm/gems/ruby-1.9.2-p290/bundler/gems/spree_paypal_express-073f2f814dd8/lib/spree_paypal_express.rb:5)
<shajinx>
=> Booting WEBrick
<shajinx>
=> Rails 3.0.7 application starting in development on http://0.0.0.0:3000
<shajinx>
/home/shajin/soletron-SoletronSpree/app/models/product_decorator.rb:31: warning: class variable access from toplevel
<shajinx>
/home/shajin/soletron-SoletronSpree/app/models/product_decorator.rb:535: warning: class variable access from toplevel
<shajinx>
/home/shajin/soletron-SoletronSpree/app/models/product_decorator.rb:719: warning: class variable access from toplevel
<shajinx>
/home/shajin/soletron-SoletronSpree/app/models/product_decorator.rb:728: warning: class variable access from toplevel
<shajinx>
/home/shajin/soletron-SoletronSpree/app/models/product_decorator.rb:731: warning: class variable access from toplevel
<shajinx>
/home/shajin/soletron-SoletronSpree/app/models/product_decorator.rb:735: warning: class variable access from toplevel
<shajinx>
[2012-04-13 06:02:17] INFO WEBrick 1.3.1
<shajinx>
[2012-04-13 06:02:17] INFO ruby 1.9.2 (2011-07-09) [i686-linux]
<shajinx>
[2012-04-13 06:02:17] WARN TCPServer Error: Address already in use - bind(2)
<shajinx>
Exiting
<shajinx>
/home/shajin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize': Address already in use - bind(2) (Errno::EADDRINUSE)
<shajinx>
from /home/shajin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/utils.rb:73:in `new'
<shajinx>
from /home/shajin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners'
<judofyr>
shajinx: use pastie.org for pasting
<shajinx>
from /home/shajin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/utils.rb:70:in `each'
<shajinx>
from /home/shajin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners'
<shajinx>
from /home/shajin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:74:in `listen'
<shajinx>
from /home/shajin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize'
<shajinx>
from /home/shajin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize'
<shajinx>
from /home/shajin/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.2.4/lib/rack/handler/webrick.rb:10:in `new'
<judofyr>
jesus
<shajinx>
from /home/shajin/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.2.4/lib/rack/handler/webrick.rb:10:in `run'
<shajinx>
from /home/shajin/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.2.4/lib/rack/server.rb:217:in `start'
<shajinx>
from /home/shajin/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.7/lib/rails/commands/server.rb:65:in `start'
<shajinx>
from /home/shajin/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.7/lib/rails/commands.rb:30:in `block in <top (required)>'
<shajinx>
from /home/shajin/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.7/lib/rails/commands.rb:27:in `tap'
<shajinx>
from /home/shajin/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.7/lib/rails/commands.rb:27:in `<top (required)>'
<shajinx>
from script/rails:6:in `require'
<shajinx>
from script/rails:6:in `<main>'
<Mon_Ouie>
I think he pasted it all at once and can't stop it now
<judofyr>
shajinx: this is the real error: Address already in use - bind(2) (Errno::EADDRINUSE)
<shajinx>
can any pls tell me what i have to do run overcome from this
<judofyr>
shajinx: you're only running something on port 3000
<shajinx>
and run the server..?
<TTilus>
shajinx: #rubyonrails ... no?
<judofyr>
shajinx: either close the server you have on port 3000, or run ./script/rails server -p 3001
<canton7>
whoaaaa that's a lot of spam
Jake232 has joined #ruby-lang
<shajinx>
thanks judofyr
<shajinx>
but there are some warnings ..?
countskm has joined #ruby-lang
<judofyr>
shajinx: what class variable do you use at app/models/product_decorator.rb:31 ?
mstratman has joined #ruby-lang
<shajinx>
@@exempt_product_types
msisk has joined #ruby-lang
<shajinx>
judofyr r u there
<shajinx>
i having some query?
<shevy>
lol
<shevy>
spamattack!
heftig has joined #ruby-lang
gregf has joined #ruby-lang
dejongge has joined #ruby-lang
jobicoppola has joined #ruby-lang
sandbags has joined #ruby-lang
enebo has joined #ruby-lang
A124 has joined #ruby-lang
<shajinx>
can any one tell me in ..
<shajinx>
my project when first time visiting one popup add comes .
<shajinx>
how to remove that ??
tbuehlmann has joined #ruby-lang
cleaner72 has joined #ruby-lang
<TTilus>
that one requires quite a chrystall ball...
gsav has joined #ruby-lang
<TTilus>
shajinx: probably none of us understood what you just asked
<shajinx>
ok
<shajinx>
i will explain again/
<shajinx>
there is a project,which is already completed...
<shajinx>
but there is one modification is needed as...
<shajinx>
when user first time visit this site..
<shajinx>
one pop up advertisement template appears over the home page..
<cleaner72>
Is there a way to update Ruby on Windows without downloading and instaling a complete new package? I'm running ruby 1.9.3p0 en want to update to 1.9.3.p125 and am looking voor an update or patch command but can not find it.
<canton7>
shajinx, that's not a ruby question in the slightest
<shajinx>
how to remove this popup
<shajinx>
this is developed on ror
<andrewvos>
shajinx: Delete the code that creates the popup.
<ridders24>
why is this listing the the folder and then the file with its extention? http://pastie.org/3780550 ?
<ridders24>
it also appears to be listing rather odd windows files :S
<tobiasvl>
ridders24: what is the expected behavior?
<TTilus>
shajinx: you are still not on #rubyonrails
<tobiasvl>
why don't you expect it to print folders and files with extensions, as well as odd windows files?
<canton7>
ridders24, what sort of 'rather odd windows files'
<ridders24>
tobiasvl: i thought it was going to list the dir locations that match "column1" or "column2" or both
<TTilus>
ridders24: please, be specific
<ridders24>
canton7: for example C:/Windows/System32/DriverStore/FileRepository/mdmkortx.inf_amd64_neutral_197568
<ridders24>
7236603184/mdmkortx.inf
<canton7>
ridders24, if checks with the path of the file contains column1, and whether column2 exists
<canton7>
ridders24, and what's wrong with that? Does the path contain the value from column1?
<TTilus>
ridders24: you arent matching against both column1 and column2, only agains column1
RORgasm has joined #ruby-lang
<TTilus>
ridders24: for column2 it only checks if the value of it evaluates to true
rdavila has joined #ruby-lang
<ridders24>
well the first problem is that a file, and i was after a folder name. and as far as i can see no value in column1 or two matches the file i pasted you
gouthamvel has joined #ruby-lang
<canton7>
ridders24, you're checking whether the path contains column1, but printing the path+filename if it does
outoftime has joined #ruby-lang
<canton7>
ridders24, what are the contents of the from_file ?
<ridders24>
Case Ref:
<ridders24>
1010LKRL/24/2
<ridders24>
1010LKRL/24/1
<ridders24>
1207HR/7
<ridders24>
2875FD/01
<ridders24>
2875FD/02
<ridders24>
2875FD/03
<ridders24>
2875FD/04
<ridders24>
2875FD/05
<canton7>
in a pastie please!
<ridders24>
3719SSR/11/1
<ridders24>
3719XYZ/11
<ridders24>
5745LKRL/100/1
<ridders24>
5745LKRL/100/2
<canton7>
don't paste random shit into IRC
<ridders24>
5745LKRL/100/3
<ridders24>
5745LKRL/100/4
<ridders24>
6486SR/1/1
<ridders24>
6486SR/1/2
<ridders24>
6603ABB/03/1
<ridders24>
6603FD/01
<ridders24>
6603FD/02
<ridders24>
6603FD/03
<ridders24>
6603FD/04
<ridders24>
6603FD/05
<ridders24>
6603FD/06
<tobiasvl>
oh man
<TTilus>
AARGH!
<ridders24>
6603FD/07
<ridders24>
6603FD/08
<canton7>
STOP!
<ridders24>
6603FD/09
<ridders24>
sorryyyy
<tobiasvl>
please see the topic
<TTilus>
ridders24: do not, and i repeat, DO NOT do that EVER again
<TTilus>
ridders24: Dir.glob("C:/**/*#{column1}*/**/*#{column2}*").each do |path| ...
<TTilus>
ridders24: craft the glob to match the structure of your paths
<TTilus>
ridders24: do you know the structure?
kvirani has joined #ruby-lang
<ridders24>
it will vary potentially from folder to folder
<ridders24>
some could be 3 levels in and other could be 4 levels in
<TTilus>
ridders24: /**/ matches any depth of dirs
<TTilus>
ridders24: are col1 and col2 full or partial names of dirs or files?
<TTilus>
ridders24: is that known?
<TTilus>
ridders24: Dir.glob("C:/**") should give you all the files
<ridders24>
in theory full names, but col1 and col2 could be combined in some instances
<ridders24>
sorry Im after just the folder names
<ridders24>
with col1 and col2 are
<TTilus>
sorry gotta go
<TTilus>
hope you get that working
<ridders24>
TTilus: thankyou for that code it works really well :)
IPGlider has joined #ruby-lang
<bnagy>
gosh, globbing turned out to be right?
<bnagy>
lawdy lawdy
<ridders24>
is globbing bad?
<bnagy>
no it's what I suggested days ago
esad has joined #ruby-lang
<corsican>
haha
optikalmouse has joined #ruby-lang
<rue>
lawd{y,}
<ridders24>
:P
<corsican>
(just catching up on scrollback)
<corsican>
has anyone here used the net/ssh library in depth?
mattyoho has joined #ruby-lang
thone has joined #ruby-lang
<andrewvos>
corsican: I have used it
<andrewvos>
corsican: What's the problem Borhan
<andrewvos>
Brohan*
<jammi>
corsican: not in depth, but if someone has, it would be nice to have an sshd library too. I started an eventmachine hack to do that, handshakes, but doesn't progress further. I looked at the net/ssh sources and couldn't figure out where to begin to use the crypto
Sailias has joined #ruby-lang
<jammi>
looked a bit intertwined to be reusable as an net/sshd library, but I could be wrong
<shajinx>
pls help me on this problem?
<shajinx>
there is a project,which is already completed...
<shajinx>
but there is one modification is needed as...
<shajinx>
when user first time visit this site..
<shajinx>
one pop up advertisement template appears over the home page..
<shajinx>
how to remove this popup
<shajinx>
this is developed on ror
<shajinx>
just tell me what type of code is there.
<shajinx>
and where.
<canton7>
shajinx, we've told you twice. #rubyonrails
<canton7>
and there's absolutely no way of knowing what's happening with only that amount of information
<canton7>
it's almost certainly a javascript question, anyway
<corsican>
andrewvos: everything works fine, but I run into problems when I'm using it to execute an app on the remote machine... IF execution takes too long
<corsican>
if the remote machine has a timeout set, sometimes the connection drops before I get output back from the remote command
<corsican>
I was wondering if there's a way to somehow "ping" the machine while waiting, to let it know not to drop the ssh connection
<corsican>
jammi: I know a bit about the crypto stuff, I'll take a look at it a bit later if you want
<corsican>
it's a good question
<andrewvos>
yeah there is
<andrewvos>
KeepAlive or something
<andrewvos>
TCPKeepAlive?
gouthamvel has quit [#ruby-lang]
<jammi>
corsican: ok
rdavila has joined #ruby-lang
dv310p3r has joined #ruby-lang
<corsican>
andrewvos: ahh yes... thanks!
<corsican>
I knew there was something and I was racking my brain
RORgasm has joined #ruby-lang
<corsican>
jammi: yeah it shouldn't be too difficult to change the underlying socket to be server rather than client
<corsican>
jammi: is that your code? or the code you've been trying to use?
frode15243 has quit ["Leaving"]
<jammi>
corsican: yes. didn't spend too many hours; spent some time with net/ssh and got bored / gave up
Indian has joined #ruby-lang
<jammi>
as that was the logical next point to use
<corsican>
giving up is often the logical next point when it comes to coding ;)
<jammi>
yeah, there's always something more interesting around the corner :)
<jammi>
and an ssh ruby server would be fun, possibly usable as an remote debugging interface and such, but I don't really _need_ one yet
<jammi>
cases like implementing a remote console over ssh for a ruby web server and such
<jammi>
could be just irb or pry handling the io after a successful connection
<jammi>
or some other shell, could even be used like a modern variont of an oldschool (modem-age) bbs
<jammi>
..or as a transport for some form or another of a rpc protocol. should be almost as easily debuggable as plain telnet by using any ssh client, just more secure
<corsican>
I can't believe there isn't already a decent like "net/sshd" out there
<corsican>
but yeah it would be neat to have one working
<jammi>
I couldn't believe that either, but at least there wasn't anything an year ago
mattyoho has joined #ruby-lang
mattyoho has joined #ruby-lang
RubyRedGirl has quit [#ruby-lang]
florentg2 has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
kitallis has joined #ruby-lang
kitallis has joined #ruby-lang
headius has joined #ruby-lang
kitallis has joined #ruby-lang
crackity_jones has joined #ruby-lang
slimfit has joined #ruby-lang
datanoise has joined #ruby-lang
slimfit has joined #ruby-lang
srbaker has joined #ruby-lang
wallerdev has joined #ruby-lang
sym- has joined #ruby-lang
<Defusal>
having to remember to model.reload before updating or reading from a database model whenever the action is made in a callback, such as after an IO operation or timer, is pretty annoying. if only there was a better way
<sym->
hi
<sym->
do you guys prefer to use `if str =~ /blah(foo)/` and then followed by using $1?
<sym->
or something like `if m = str.match(/blah/)`
* chris2
uses =~
<chris2>
or string[/regexp/]
<sym->
hmm
<sym->
oh... that last one is great, didn't know about it
<chris2>
or string[/regexp/, backref]
<sym->
hmm, wonder what backref is for
<chris2>
well, 1 for $1 etc
<chris2>
by default its $&
<sym->
so rusty... I need to read up on this again
<sym->
ahhh... gotcha
<mistym>
sym-: Personally I'm not a fan of $1, etc. If I'm using captures, I prefer using MatchData objects and either indexing from them or using the #captures array it can provide
<sym->
I see... I'm using MatchData too, but mostly by accident. looking at other people's code everybody seems to be using =~ so I wondered
<sym->
str[/regex/, index] sounds terrific though, I will be using that :D
<tubbo>
Defusal: usually the convention is Model.find(:first, {host: "0.0.0.0"})
<tubbo>
Defusal: or even better, Model.where(host: "0.0.0.0").first
jolohaga has joined #ruby-lang
<tubbo>
Defusal: the latter is more conventional in Ruby, because .first is a common method on collections, and Model.where() returns a collection
<Defusal>
tubbo, you are assuming it is ActiveRecord, it is not
<Defusal>
tubbo, where(...).first returned the same thing, i did make sure
<Defusal>
as did where(...).count
<Defusal>
but its is MongoMapper
<tubbo>
Defusal: lol well there's your problem
<Mon_Ouie>
How could we know what framework you're using?
<tubbo>
yeah haha
<tubbo>
it only looks practically EXACTLY like AR...
vesan has joined #ruby-lang
<tubbo>
Defusal: you insinuated it was ActiveRecord by its syntax and posting in #rubyonrails ;-)
<Defusal>
Mon_Ouie, you can't but could have made somewhat of an assumption based on the api not being AR compatible
<Defusal>
tubbo, err what? i am not in #ror
<tubbo>
omg
<Mon_Ouie>
I don't know AR, I just assumed you were using whatever Rails used because I'd guess that would be the most popular choice
<tubbo>
Defusal: i thought we were in #ror just now
<tubbo>
haha
<Defusal>
tubbo, negative ;)
<tubbo>
Defusal: well i also use MongoMapper but Mongoid is the new hotness these days
<Defusal>
i try to never join that channel, as it is full of clueless question spam, and few people who really know what is going on
<Defusal>
tubbo, yeah i have always had issues when migrating to Mongoid, and have had to revert my models and waste plenty time, so i am not amped for that
<Defusal>
don't ask me about the issues, as it's been far too long since i did that
<tubbo>
oh really?
<Defusal>
but either way, a random issue is no reason to switch frameworks, that doesn't usually end well in my experience
<Defusal>
i just hope that doesn't happen again, while my platform is live, as that would cause a serious problem
<tubbo>
Defusal: hehe i like #ror because it makes me feel like A Smart Ruby Developer™
<Defusal>
<Mon_Ouie> I don't know AR, I just assumed you were using whatever Rails
postmodern has joined #ruby-lang
<tubbo>
Defusal: you also have to be careful with Mongo, as it stores a large portion of your data in memory
<tubbo>
so if the server dies your data that's in RAM is gone
<Defusal>
Mon_Ouie: hint, i learnt rails at the same time as ruby many years ago, but have almost never used rails, other than briefly for two contracted projects
<Defusal>
so although i use ActiveSupport, and ActiveRecord on projects that do require SQL, i use sinatra for my web applications, as they are embedded into other applications
<tubbo>
Defusal: yeah i had no idea how far along in the project you were...definitely don't switch frameworks if you already have shit built out in mongomapper
<Defusal>
indeed
kvirani has joined #ruby-lang
<Defusal>
i have worked on this project for about a month so far
<tubbo>
i like sinatra
<Defusal>
its at about 5000 lines already
<Defusal>
excluding empty lines
savage-_ has joined #ruby-lang
<Defusal>
and thats quite a bit since i write pretty compact code for personal projects
<tubbo>
eww
<tubbo>
one file?
<tubbo>
sinatra's great for little stuff but i hate using those single-file frameworks for huge projects
<tubbo>
like the CherryPy for Sick-Beard is MONSTROUS :)
Axsuul has joined #ruby-lang
alexkane has joined #ruby-lang
kvirani has joined #ruby-lang
savage-__ has joined #ruby-lang
jtoy has joined #ruby-lang
Hakon|mbp has joined #ruby-lang
<canton7>
tubbo, sinatra scales out quite nicely to multiple files
<tubbo>
canton7: that's true
<Defusal>
tubbo, one file? lol
* tubbo
has only written single-file apps with Sinatra
<Defusal>
who would put anywhere close to 5000 lines in a single file, goodness
<canton7>
also check out Padrino, if you're after something more beefy that isn't rails
<tubbo>
lol
<tubbo>
i'm good with rails
<Defusal>
the web application is still mainly in one file at the moment, due to it being a rapid prototype
<Defusal>
but the web application only makes up a small part of the total platform
<Defusal>
and its mostly for handling websocket events
<Defusal>
so im not using too much of actual sinatra
nofxx has joined #ruby-lang
boxmo has joined #ruby-lang
boxmo1 has joined #ruby-lang
<erikh>
starbucks wireless
<erikh>
so slooooow
Radium has joined #ruby-lang
robotmay has joined #ruby-lang
burgestrand has joined #ruby-lang
<optikalmouse>
erikh: ew starbucks
jtoy has joined #ruby-lang
bglusman has joined #ruby-lang
nofxx has joined #ruby-lang
nofxx has joined #ruby-lang
rdavila has joined #ruby-lang
macmartine has joined #ruby-lang
bjensen has joined #ruby-lang
tenderlove has joined #ruby-lang
Sailias has joined #ruby-lang
tenderlove has joined #ruby-lang
Indian has joined #ruby-lang
florentg2 has joined #ruby-lang
bryanl has joined #ruby-lang
FACEFOX has joined #ruby-lang
FACEFOX has joined #ruby-lang
nofxx has joined #ruby-lang
Radium has joined #ruby-lang
FACEFOX has joined #ruby-lang
FACEFOX has joined #ruby-lang
workmad3 has joined #ruby-lang
asahi1 has joined #ruby-lang
jtoy has joined #ruby-lang
FACEFOX has joined #ruby-lang
bryanl has joined #ruby-lang
FACEFOX has joined #ruby-lang
bjensen has joined #ruby-lang
FACEFOX has joined #ruby-lang
deobald has joined #ruby-lang
FACEFOX has joined #ruby-lang
savage- has joined #ruby-lang
Radium_ has joined #ruby-lang
Radium_ has joined #ruby-lang
jfelchner has joined #ruby-lang
Hakon|mbp has joined #ruby-lang
melter has joined #ruby-lang
<apeiros_>
drbrain: ping - when would you actually use a latch?
<drbrain>
apeiros_: I don't (usually) but tenderlove is using them for a non-blocking Queue
<apeiros_>
drbrain: as far as I understand, a latch does not manage waiting threads - so it's like being optimistic that no concurrent access will happen, i.e., that the number of times a process hits a "busy latch" is low, so the latch becomes cheaper than locking?
<drbrain>
sounds right
<apeiros_>
ok
<drbrain>
I think the latch is just being used to force consumers to wait
<apeiros_>
thanks for the explanation :)
<apeiros_>
yeah, "resource is busy, try again later"
<drbrain>
since it's tenderlove's project he'll have to fill in the details
hahuang65 has joined #ruby-lang
Hakon|mbp has joined #ruby-lang
<tenderlove>
I have a thread that accesses a non-blocking queue, but I don't want the thread to try popping anything off the queue until I've filled it
<tenderlove>
so I have a latch that keeps the thread from processing the queue until I say it's ok
<apeiros_>
but wouldn't the thread be spinning then instead of sleeping? since with a latch it itself is responsible for trying again…
<tenderlove>
apeiros_: no, the latch puts the thread to sleep
<tenderlove>
so the scheduler won't run it
<apeiros_>
hrm… but then another thread has to wake up the sleeping thread - which contradicts how I understood how a latch works :-/
<tenderlove>
yes, I have a main thread that wakes up all the threads waiting on the latch
<apeiros_>
wouldn't that make it more like a barrier than a latch?
<rolfb>
drbrain: thanks, also cool of you to get my comment in there :)
<drbrain>
that way you knew you saw the whole thing :)
savage- has joined #ruby-lang
fgomez has joined #ruby-lang
hackingoff has joined #ruby-lang
<rolfb>
drbrain: but i didn't
<rolfb>
but now i have
<rolfb>
and it was greeeeeeeeat
workmad3 has joined #ruby-lang
srbartlett has joined #ruby-lang
<rolfb>
i'm a bit confused on the difference between concurrency and parallelism
<apeiros_>
to be taken with a grain of salt: parallel means it's really two or more entities working at the same time (think 2 cores), whereas concurrency can also mean one entity works at multiple things in an interleaved manner
<apeiros_>
(think single-core running multiple things "at the same time", while it isn't really running at the same time, just seems to be)
<apeiros_>
the grain of salt is mostly that I may be mixing up the terms :)
<Defusal>
anyone use spawn(cmd, umask: ...) before?
RORgasm has joined #ruby-lang
<Defusal>
from what i understand, the umask is subtracted from 777 to make the new permissions, so 777-007 should be 770, yet using umask: 007 results in newly created file permissions being -rw-rw---, which causes a permission error
<erikh>
umask doesn't usually include the execute bit
<erikh>
subtracted from the number of the beast!
* erikh
queues the iron maiden
<Defusal>
erikh, reading the file causes EACCES
<erikh>
I'm not sure what that has to do with anything
<Defusal>
how do i solve this if umask doesnt support x?
<erikh>
dunno!
<Defusal>
bleh
<Defusal>
linux permissions really screw me over often
<Defusal>
and on top of it, permission errors cause my EventMachine to kill ruby completely some of the time
<Defusal>
terminate called after throwing an instance of 'std::runtime_error'
<Defusal>
what(): failed to close nonexistent acceptor
heftig has joined #ruby-lang
danishman has joined #ruby-lang
piyush_ranjan has joined #ruby-lang
<Defusal>
erikh, and that EACCES occurs when using File.open(path, "r")
<workmad3>
Defusal: I believe that 007 on a new file is the equivalent of 006 from 666
<workmad3>
ah, erikh already mentioned that :)
<Defusal>
workmad3, yes, but that doesn't explain this issue
<workmad3>
you shouldn't need execute for reading anyway... however if your ruby process is running as another user in a different group, you wouldn't have access
<workmad3>
and if that's the case, you probably want a umasx of 002 if you want to share the data
<workmad3>
*umask
<Defusal>
workmad3, the point of spawning with the umask is to make the files that are created have read and write for the group
<Defusal>
the ruby process belongs to the group
<Defusal>
yet it fails anyway :(
cjs226 has joined #ruby-lang
<workmad3>
Defusal: you always manage to find odd errors don't you :)
<Defusal>
indeed D:
<Defusal>
bleh
<workmad3>
Defusal: the user and group of the file and the process definitely seem correct?
<erikh>
check with lsof.
<Defusal>
workmad3, yup
<Defusal>
erikh, check what?
<Defusal>
i can see the file has the correct user and group
<erikh>
the user and group access
<erikh>
of the process, not the file.
<Defusal>
i am running the process as my own user
<Defusal>
over SSH
<erikh>
ok!
<Defusal>
and 'groups' does contain the group
<workmad3>
Defusal: and nothing could have changed it?
<Defusal>
so yeeeaaa :(
<workmad3>
within the ruby process?
<Defusal>
workmad3, definitely not
<workmad3>
ok... very, very odd then
<Defusal>
i have a proxy script that is spawned with sudo from a defered thread which does the actual process spawning after becoming the correct user and then returns the pid of the spawned process
<Defusal>
that is so that my ruby process does not have to run as root or change user
<workmad3>
err... so things are playing around with the process uid and gid then?
<Defusal>
so yeah, yet another permission error that is gonna drive me up the wall :/
* erikh
whistles softly
<Defusal>
workmad3, the proxy script does yes, but it works perfectly, i use it for a ton of things
<Defusal>
to give you an example, it logs two lines to a log file everytime it spawns a process
<Defusal>
and after a week of development and testing, the log file was over 300MB
<workmad3>
yay? :P
<Defusal>
so yeah, theres nothing wrong with that
<Defusal>
i guess i'll have to leave this till tomorrow
<Defusal>
which means wasting time on permissions again tomorrow :(
<workmad3>
well... it just seems odd that you're having issues with permissions with trying to read a file which has no read outside of group and user, and you've got something that is playing around with process uid and gid stuff, and that's the only thing aronud that's doing it
<Defusal>
as i said, my ruby process runs as my own user
<workmad3>
so I'd be tempted to spit out what the process uid and gid are in ruby just before attempting to read the file, just to check that it definitely isn't an issue there
Hakon|mbp has joined #ruby-lang
<workmad3>
because otherwise none of this makes any sense
<Defusal>
there is no uid or gid stuff in the main ruby application
<Defusal>
but ok, i will do so
<Defusal>
hmm
nahh has joined #ruby-lang
<Defusal>
the uid and gid of the process are my own uid