Phanes has quit [Quit: ...shout as you did in rome...]
Phanes has joined #ruby
Phanes has quit [Changing host]
Phanes has joined #ruby
<pnes>
my 6 year old just tried my ecigarette for the first time
Madplatypus has joined #ruby
<aidalgol>
What's the difference between the Date class that's in global scope in a fresh IRB session and whatever `require "date"` loads?
jenrzzz has quit [Ping timeout: 250 seconds]
<aidalgol>
I haven't installed any special date library, so they're both part of standard Ruby. Is the former just left around for backwards compatibility?
aryaching has quit [Ping timeout: 264 seconds]
aryaching has joined #ruby
Immune has joined #ruby
Pumukel has quit [Ping timeout: 260 seconds]
Pumukel has joined #ruby
giz|work has joined #ruby
dhollinger has quit [Quit: WeeChat 1.0.1]
<matthewd>
aidalgol: My irb has no Date defined at startup
mainfram has joined #ruby
<aidalgol>
matthewd: Which version? I'm using a slightly older version because I'm using the version from Debian stable: ruby2.1
giz|work has quit [Ping timeout: 240 seconds]
mainfram has left #ruby [#ruby]
Pumukel has quit [Ping timeout: 260 seconds]
yaewa has joined #ruby
cibs has quit [Ping timeout: 240 seconds]
heelpmeplz has quit [Read error: Connection reset by peer]
<leitz>
Running the tests puts the plot as "Rainbow Bright", which is the expected if the file load fails.
the_drow has quit [Remote host closed the connection]
<leitz>
Running the CharacterTools.rb in irb gives a proper response of some plot.
moos3 has quit [Ping timeout: 250 seconds]
<leitz>
What am I missing?
<PalaHO>
c
Pumukel has joined #ruby
<Mon_Ouie>
You're probably not running the code from the same directory
eregon_ is now known as eregon
ec0 has quit [Ping timeout: 258 seconds]
<leitz>
Mon_Ouie, that was it. Fixed, I think.
<leitz>
Is this the best way to use a global variable like $DATA_PATH? File.open("#{$DATA_PATH}/plots.txt", "r")
Pumukel has quit [Ping timeout: 264 seconds]
pokalyis has joined #ruby
<Mon_Ouie>
I would use a constant instead
<leitz>
What would make a constant better?
<leitz>
I'm a Ruby Newbie, for the most part.
<Mon_Ouie>
Constants can be scoped, global variables all share the same namespace. Also since there doesn't seem to be any reason for $DATA_PATH to change during the execution of the program a constant would better match the intent.
M-mistake has joined #ruby
<apeiros>
$LOAD_PATH << File.expand_path("../../lib", __FILE__) # that does not belong into library code
<apeiros>
a) lib is added to your load path by rubygems
<apeiros>
b) if anything at all is responsible for setting up load paths, its your executable (stuff in bin/)
<apeiros>
b) cont.: stuff in bin/, ruby (e.g. with -I), pry (e.g. with -I)
the_rhizo3 has joined #ruby
firstdayonthejob has joined #ruby
M-manveru has joined #ruby
<leitz>
Mon_Ouie, you are right. The DATA_PATh won't change duing program running. I was mostly copying the $LOAD_PATH systax.
<leitz>
Err...syntax
<leitz>
apeiros, I've been calling some of the libraries independantly. For example, there's a test case for each one and I have been organically growing things as needed.
<apeiros>
leitz: that does not change anything about what I said.
<leitz>
Not a lot of cohesion in the program yet, that's part of the version 2 refactor going on.
<apeiros>
it still does not belong there.
<apeiros>
it's not a libraries duty to set up $LOAD_PATH. if you put it there, you do it wrong.
<apeiros>
*library's
JeanCarloMachado has joined #ruby
<leitz>
apeiros, I'm doing lots of things wrong. That's the joy of learning; finding and improving. In the case of LOAD_PATH some of the earlier work failed unless it was there, so I made a habit of putting it there.
<apeiros>
leitz: and the point of learning is that when you're told you're doing something wrong, you don't go defensive. you fix it :-p
<leitz>
apeiros, my XChat can't translate that. :)
<apeiros>
get a sensible unicode/emoji capable font :-p
<apeiros>
it was a thumb-up
<leitz>
Ah, cool. Thank you!
<leitz>
Yeasterday I started converting methods to taking options as a hash instead of ordered input. Had a fun time figuring out a particular failure.
Xiti has joined #ruby
kspencer has quit [Ping timeout: 240 seconds]
<leitz>
Fixed that bit, it was a nesting issue. Still need to fix all the methods though. That's the big push. That, and adding the plots and Keirsey stuff I'm doing now.
Vile` has joined #ruby
Pumukel has joined #ruby
<apeiros>
use named arguments instead of hash
<apeiros>
there's no (or in rare cases only a little) difference in usage, only one in definition. but it's much more self-explanatory than a hash argument.
<apeiros>
also often nicer since you can easier specify defaults and required options
Pumukel has quit [Ping timeout: 240 seconds]
edwinvdgraaf has quit [Read error: Connection reset by peer]
edwinvdgraaf has joined #ruby
The_Phoenix has joined #ruby
<leitz>
apeiros, I thought the hash was the way to use named arguments. Guess I have to go re-read that section.
Pumukel has joined #ruby
nankyokusei has joined #ruby
pawnbox has quit [Ping timeout: 258 seconds]
karmatr0n has joined #ruby
claudiuinberlin has quit [Remote host closed the connection]
Vlat- has joined #ruby
claudiuinberlin has joined #ruby
<leitz>
Ah, test fails if I haven't written the file it's referencing. :)
Pumukel has quit [Ping timeout: 264 seconds]
craigp has joined #ruby
nankyokusei has quit [Ping timeout: 260 seconds]
karmatr0n has quit [Ping timeout: 240 seconds]
Pumukel has joined #ruby
jgt3 has quit [Ping timeout: 244 seconds]
vizvamitra has joined #ruby
Derperperd has quit [Read error: Connection reset by peer]
rrichardsr3 has joined #ruby
jeanlinux has quit [Remote host closed the connection]
jeanlinux has joined #ruby
blackmesa has quit [Ping timeout: 252 seconds]
<leitz>
Mon_Ouie, a question on CONSTANTS. I declared is as: DATADIR = "../../data" and tried to refer to it as: if File.exist?("#{DATADIR}/tempraments.txt")
<apeiros>
>> def foo(named:, arg: "default); end
<ruby[bot]>
apeiros: # => /tmp/execpad-9b4842edec6a/source-9b4842edec6a:5: syntax error, unexpected tGVAR, expecting ')' ...check link for more (https://eval.in/626435)
<leitz>
Not working. The file is there if I use the $DATA_PATH: if File.exist?("#{$DATA_PATH}/tempraments.txt")
<leitz>
apeiros, so named: would have to be set and arg would have a default if not set.
<apeiros>
both can be called as `foo named: "value"`
<apeiros>
correct
Pumukel has quit [Ping timeout: 260 seconds]
miqlas-H has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
Derperperd has quit [Read error: Connection reset by peer]
c0mrad3 has joined #ruby
<apeiros>
named args has 4 advantages: a) you can read from the code which options exist, b) you don't have to extract them from the hash, c) you can set defaults/requirements, d) it's more performant
<leitz>
Ah, a Ruby 2-ism.
Pumukel has joined #ruby
<apeiros>
well, I hope you use ruby 2.3. no reason for a new project to remain on an older ruby :)
Derperperd has joined #ruby
Derperperd has quit [Read error: Connection reset by peer]
<leitz>
some of last week's work was to remove the requirement for SQLite support. You get more with it, but the program wil lwork without.
<leitz>
This week I'll work on removing the JSON requirement.
<leitz>
Maybe. I like JSON.
Pumukel has quit [Ping timeout: 260 seconds]
mixtli has quit [Ping timeout: 244 seconds]
dminuoso has quit [Ping timeout: 265 seconds]
pandaant has quit [Remote host closed the connection]
RegulationD has joined #ruby
e4xit has joined #ruby
Vlat- has left #ruby [#ruby]
Derperperd has quit [Read error: Connection reset by peer]
Derperperd has joined #ruby
Pumukel has joined #ruby
RegulationD has quit [Ping timeout: 244 seconds]
Derperperd has quit [Read error: Connection reset by peer]
ta_ has joined #ruby
Derperperd has joined #ruby
e4xit has quit [Quit: Right I'm out!]
Derperperd has quit [Read error: Connection reset by peer]
e4xit has joined #ruby
Derperperd has joined #ruby
Pumukel has quit [Ping timeout: 264 seconds]
lightheaded has quit [Ping timeout: 258 seconds]
Pumukel has joined #ruby
ta_ has quit [Ping timeout: 265 seconds]
minimalism has quit [Quit: minimalism]
minimalism has joined #ruby
lightheaded has joined #ruby
Pumukel has quit [Ping timeout: 260 seconds]
crystal77 has joined #ruby
reednj_ has joined #ruby
Alina-malina has joined #ruby
ponga has joined #ruby
Alina-malina has quit [Changing host]
Alina-malina has joined #ruby
FernandoBasso has joined #ruby
Pumukel has joined #ruby
<leitz>
Time to get ready for church. See you all later.
leitz has quit [Quit: Nappy time]
lxsameer has quit [Ping timeout: 240 seconds]
Pumukel has quit [Ping timeout: 264 seconds]
blackmesa has joined #ruby
reednj_ has quit [Quit: WeeChat 1.5]
dreamyspell_ has joined #ruby
dreamyspell_ has quit [Remote host closed the connection]
lxsameer has joined #ruby
Weavel has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
ltd_ has quit [Ping timeout: 240 seconds]
ltd_ has joined #ruby
ledestin has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
Rodya_ has quit [Remote host closed the connection]
bkxd has quit [Ping timeout: 244 seconds]
jgt3 has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
Derperperd has quit [Read error: Connection reset by peer]
etehtsea has joined #ruby
TheFox has joined #ruby
Pumukel has joined #ruby
GodFather has joined #ruby
Derperperd has joined #ruby
craigp has quit [Ping timeout: 276 seconds]
jgt3 has quit [Ping timeout: 260 seconds]
rrichardsr3 has quit [Read error: Connection reset by peer]
moos3 has joined #ruby
rrichardsr3 has joined #ruby
rrichardsr3 has quit [Max SendQ exceeded]
Pumukel has quit [Ping timeout: 258 seconds]
rrichardsr3 has joined #ruby
Derperperd has quit [Read error: No route to host]
lxsameer has quit [Ping timeout: 276 seconds]
preyalone has joined #ruby
<danst>
>church >2016 >#ruby
<danst>
I hope he's a preacher
Pumukel has joined #ruby
Derperperd has joined #ruby
mixtli has joined #ruby
moos3 has quit [Ping timeout: 240 seconds]
Pumukel has quit [Ping timeout: 260 seconds]
dminuoso has joined #ruby
mixtli has quit [Ping timeout: 244 seconds]
jud has joined #ruby
ihre has quit [Ping timeout: 276 seconds]
etehtsea has quit [Ping timeout: 244 seconds]
Derperperd has quit [Read error: Connection reset by peer]
GodFather has quit [Quit: Ex-Chat]
GodFather has joined #ruby
Derperperd has joined #ruby
dminuoso has quit [Ping timeout: 244 seconds]
airdisa has joined #ruby
Derperperd has quit [Read error: Connection reset by peer]
Derperperd has joined #ruby
monoprotic has joined #ruby
monoprotic has quit [Changing host]
monoprotic has joined #ruby
c0ldfr0nt has quit [Quit: leaving]
diprotic has quit [Ping timeout: 240 seconds]
pawnbox has joined #ruby
zacts has joined #ruby
AzureStigma has joined #ruby
vuoto has quit [Ping timeout: 244 seconds]
vuoto has joined #ruby
The_Phoenix1 has joined #ruby
The_Phoenix has quit [Ping timeout: 265 seconds]
tectonic has joined #ruby
rrichardsr3 has quit [Quit: He who dares .... wins.]
blackmesa has quit [Ping timeout: 260 seconds]
Derperperd has quit [Read error: Connection reset by peer]
Rodya_ has joined #ruby
Derperperd has joined #ruby
Pumukel has joined #ruby
etehtsea has joined #ruby
GodFather has quit [Ping timeout: 240 seconds]
Pumukel has quit [Ping timeout: 260 seconds]
bPqArhZYBx has quit [Remote host closed the connection]
Pumukel has joined #ruby
spudowiar has joined #ruby
blackmesa has joined #ruby
LoneHermit has joined #ruby
zacts has quit [Ping timeout: 258 seconds]
ledestin has quit [Ping timeout: 244 seconds]
aazsdk has quit [Ping timeout: 244 seconds]
Pumukel has quit [Ping timeout: 264 seconds]
aazsdk has joined #ruby
polysics has joined #ruby
LoneHermit has quit [Ping timeout: 252 seconds]
uvhrLnsaYG has joined #ruby
kspencer has joined #ruby
ledestin has joined #ruby
aazsdk_ has joined #ruby
aazsdk has quit [Ping timeout: 260 seconds]
aazsdk_ is now known as aazsdk
Pumukel has joined #ruby
jgt3 has joined #ruby
<chrisseaton>
I want to use `attr_reader :patched?`, to give myself a #patched? method, but I can't assign @patched? without using metaprogramming can I? Does anyone have a better pattern to do this?
AzureStigma is now known as AzureStigma|Away
Vile` has quit [Quit: .]
AzureStigma|Away has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
uvhrLnsaYG has quit [Remote host closed the connection]
vuoto has quit [Remote host closed the connection]
AzureStigma has joined #ruby
giz|work has joined #ruby
tobacco__ has joined #ruby
claudiuinberlin has quit [Remote host closed the connection]
mrtg9970 has joined #ruby
jgt3 has quit [Ping timeout: 265 seconds]
claudiuinberlin has joined #ruby
mrtg9970 has quit [Client Quit]
jeanlinux has joined #ruby
vuoto has joined #ruby
mrtg9970 has joined #ruby
tectonic has quit []
giz|work has quit [Ping timeout: 265 seconds]
tobacco_joe has quit [Ping timeout: 240 seconds]
mrtg9970 has quit [Client Quit]
Pumukel has quit [Ping timeout: 264 seconds]
qba73 has joined #ruby
JimK has joined #ruby
crystal77 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ta_ has joined #ruby
danielius has joined #ruby
jeanlinux has quit [Ping timeout: 265 seconds]
<JimK>
exit
JimK has quit [Client Quit]
Pumukel has joined #ruby
Limix has joined #ruby
Limix has quit [Client Quit]
zacts has joined #ruby
sleepee has quit [Quit: Leaving]
dminuoso has joined #ruby
<apeiros>
chrisseaton: you can define your own `attr_flag :patched` (or `attr_flag :patched?`). use either define_method or class_eval to implement it. you should put it on Module as an instance method.
nadir has joined #ruby
<apeiros>
and no, @patched? is not a valid ivar name. you have to use @patched or something else without ? at the end.
<chrisseaton>
attr_flag that's a good idea
ta_ has quit [Ping timeout: 240 seconds]
Pumukel has quit [Ping timeout: 260 seconds]
ihre has joined #ruby
dminuoso has quit [Ping timeout: 258 seconds]
danielius has quit [Remote host closed the connection]
vuoto has quit [Remote host closed the connection]
rgtk has joined #ruby
vuoto has joined #ruby
Pumukel has quit [Ping timeout: 264 seconds]
Emmanuel_Chanel has quit [Ping timeout: 250 seconds]
ta_ has quit [Remote host closed the connection]
bmurt has joined #ruby
moos3 has joined #ruby
rgtk has left #ruby [#ruby]
rgtk has joined #ruby
rgtk has left #ruby [#ruby]
rgtk_ has joined #ruby
<rgtk_>
How is it that `URI(url)` is same as `URI.parse(url)`, does ruby provide magic method for former call?
Emmanuel_Chanel has joined #ruby
<rgtk_>
It looks like `URI(url)` is calling main#URI which is pretty dirty.
moos3 has quit [Ping timeout: 252 seconds]
bmurt has quit [Ping timeout: 240 seconds]
<linduxed>
rgtk_: some modules do that :-/
Immune has joined #ruby
andrewvos has joined #ruby
<rgtk_>
URI is in stdlib. Same as Set which monkeypatch Array... Well, I guess every lagnauge has to have some not-so-good edges.
conta has joined #ruby
aryaching has joined #ruby
KINGSABRI___ has joined #ruby
diego1 has joined #ruby
FernandoBasso has quit [Quit: Leaving]
Pumukel has joined #ruby
beilabs has joined #ruby
KINGSABRI has quit [Ping timeout: 244 seconds]
jackjackdripper has joined #ruby
giz|work has quit [Ping timeout: 240 seconds]
pokalyis has quit [Read error: Connection reset by peer]
vuoto has quit [Remote host closed the connection]
pokalyis has joined #ruby
rsampaio_ has quit [Ping timeout: 244 seconds]
Pumukel has quit [Ping timeout: 260 seconds]
bmurt has joined #ruby
rgtk_ has quit [Quit: Page closed]
vuoto has joined #ruby
preyalone has quit [Quit: Connection closed for inactivity]
rsampaio_ has joined #ruby
Pumukel has joined #ruby
moonythedwarf_ has joined #ruby
jgt3 has joined #ruby
tdy has quit [Ping timeout: 244 seconds]
moon_ has quit [Ping timeout: 265 seconds]
vuoto has quit [Quit: Lost terminal]
vuoto has joined #ruby
danielpk has joined #ruby
Pumukel has quit [Ping timeout: 264 seconds]
Pumukel has joined #ruby
jgt3 has quit [Ping timeout: 244 seconds]
Miron has quit [Remote host closed the connection]
Azure has quit [Remote host closed the connection]
jgnagy_ has joined #ruby
tercenya_ has joined #ruby
Pumukel has quit [Ping timeout: 264 seconds]
danielpk has quit [Quit: danielpk]
blackmesa has joined #ruby
jgnagy has quit [Ping timeout: 250 seconds]
tercenya has quit [Ping timeout: 250 seconds]
twistedpixels has quit [Ping timeout: 250 seconds]
jrod has quit [Ping timeout: 250 seconds]
knog has quit [Ping timeout: 250 seconds]
jrod has joined #ruby
scottalan has quit [Ping timeout: 250 seconds]
scottalan has joined #ruby
meth has quit [Quit: Bye!]
Pumukel has joined #ruby
blackmesa has quit [Ping timeout: 250 seconds]
pythonator has joined #ruby
bauruine_ has joined #ruby
zacts has quit [Ping timeout: 250 seconds]
<pythonator>
i'm having an issue with Watir. any ideas friends? /var/lib/gems/1.9.1/gems/watir-webdriver-0.9.3/lib/watir-webdriver/elements/element.rb:565:in `const_get': wrong constant name Watir::Locators::Element::Validator (NameError)
ghostlight has quit [Ping timeout: 258 seconds]
DTZUZU has quit [Quit: WeeChat 1.4]
twistedpixels has joined #ruby
twistedpixels has quit [Changing host]
twistedpixels has joined #ruby
kira has joined #ruby
ghostlight has joined #ruby
ghostlight has quit [Max SendQ exceeded]
ghostlight has joined #ruby
ghostlight has quit [Max SendQ exceeded]
ghostlight has joined #ruby
ghostlight has quit [Max SendQ exceeded]
Cohedrin has joined #ruby
ghostlight has joined #ruby
ghostlight has quit [Max SendQ exceeded]
Pumukel has quit [Ping timeout: 260 seconds]
ghostlight has joined #ruby
ghostlight has quit [Max SendQ exceeded]
last_staff has joined #ruby
ghostlight has joined #ruby
ghostlight has quit [Max SendQ exceeded]
ghostlight has joined #ruby
ghostlight has quit [Max SendQ exceeded]
ghostlight has joined #ruby
ghostlight has quit [Max SendQ exceeded]
ghostlight has joined #ruby
ghostlight has quit [Max SendQ exceeded]
ghostlight has joined #ruby
ghostlight has quit [Max SendQ exceeded]
ghostlight has joined #ruby
ghostlight has quit [Max SendQ exceeded]
<apeiros>
!fixcon ghostlight
<apeiros>
pythonator: sounds like you're using a ruby which is too old for your gem.
<apeiros>
pythonator: I'd report a bug to the gem authors, they should specify the minimal ruby version.
Rodya_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
Koshian has quit [Ping timeout: 250 seconds]
aryaching has quit [Ping timeout: 264 seconds]
harfangk has joined #ruby
tmtwd has joined #ruby
mr_rich101 has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
binaryplease1 has joined #ruby
jeanlinux has joined #ruby
binaryplease has quit [Ping timeout: 250 seconds]
ych has joined #ruby
tobacco_joe has joined #ruby
tectonic has quit []
Koshian has joined #ruby
rsampaio_ has quit [Ping timeout: 258 seconds]
jeanlinux has quit [Ping timeout: 265 seconds]
tobacco__ has quit [Ping timeout: 244 seconds]
minimalism has joined #ruby
Axy has joined #ruby
Mia has quit [Ping timeout: 244 seconds]
Limix has joined #ruby
Miron has joined #ruby
RegulationD has joined #ruby
zapata has quit [Ping timeout: 258 seconds]
Rodya_ has quit [Remote host closed the connection]
binaryplease1 is now known as binaryplease
mixtli has joined #ruby
Pumukel has joined #ruby
Dimik has joined #ruby
Rodya_ has joined #ruby
ta_ has joined #ruby
nankyokusei has joined #ruby
RegulationD has quit [Ping timeout: 250 seconds]
flashpoint9 has joined #ruby
Pumukel has quit [Ping timeout: 260 seconds]
jgt3 has joined #ruby
ta_ has quit [Ping timeout: 276 seconds]
nankyokusei has quit [Ping timeout: 244 seconds]
youch has joined #ruby
flashpoint9 has quit [Ping timeout: 250 seconds]
No_One has joined #ruby
jgt3 has quit [Ping timeout: 240 seconds]
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zapata has joined #ruby
Pumukel has joined #ruby
elifoster has joined #ruby
youch has quit [Ping timeout: 265 seconds]
ych has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pythonator has quit [Quit: Lost terminal]
blackmesa has joined #ruby
Pumukel has quit [Ping timeout: 265 seconds]
Pumukel has joined #ruby
loechel has joined #ruby
blackmesa has quit [Ping timeout: 265 seconds]
Pumukel has quit [Ping timeout: 264 seconds]
elifoster has quit [Quit: out]
edwinvdg_ has joined #ruby
loechel has quit [Ping timeout: 264 seconds]
edwinvdgraaf has quit [Ping timeout: 250 seconds]
blackmesa has joined #ruby
Pumukel has joined #ruby
jgpawletko has joined #ruby
jgpawletko has quit [Client Quit]
kies has quit [Ping timeout: 265 seconds]
nanoz has quit [Read error: Connection reset by peer]
Pumukel has quit [Ping timeout: 264 seconds]
Madplatypus has joined #ruby
SteenJobs has quit [Quit: SteenJobs]
Pumukel has joined #ruby
Coldblackice has joined #ruby
l4v2 has quit [Quit: l4v2]
harai has joined #ruby
ctp has joined #ruby
lxsameer has quit [Ping timeout: 276 seconds]
Pumukel has quit [Ping timeout: 264 seconds]
lightheaded has joined #ruby
kies has joined #ruby
<foxxx0>
has anyone a good example for implementing semver URLs in sinatra using namespaces? or anything regarding semver URLs in sinatra?
Pumukel has joined #ruby
moneylotion has joined #ruby
<foxxx0>
currently i have namespaces like: namespace '/api/v1/users' do {...} end; and for example i would like that namespace to respond to v1, v1.0 and v1.0.0 within the URL
Pumukel has quit [Ping timeout: 260 seconds]
<PalaHO>
is there a aquivalence of hmac python lib in ruby ?
<PalaHO>
equivalance
Xiti has quit [Quit: Xiti]
Pumukel has joined #ruby
<PalaHO>
?
harai54 has joined #ruby
Bish has joined #ruby
<Bish>
hi, can i consider Net::SMTP to be thread safe?
<Bish>
there is nothing Mutex-like to be found, but i figured maybe something like Socket is already thread safe?
harai has quit [Ping timeout: 240 seconds]
miqlas-H has joined #ruby
Pumukel has quit [Ping timeout: 260 seconds]
Davedev28 has joined #ruby
lxsameer has joined #ruby
moonythedwarf_ has quit [Ping timeout: 252 seconds]
moon_ has joined #ruby
beilabs has quit [Remote host closed the connection]
beilabs has quit [Read error: Connection reset by peer]
lxsameer has joined #ruby
lxsameer has quit [Max SendQ exceeded]
beilabs has joined #ruby
<Bish>
Thread.wakeup!
pythonator has joined #ruby
<pythonator>
Hey. I've been working on this for about 2 hours straight now... I'm using Ruby 1.9.1 with Watir-Webdriver 0.9.3... and some of the built-in functionality (such as object.click to click on a button) is resulting in a NameError: wrong constant name Watir::Locators::Element::Validator... so, i have ruby 2.3 installed as well, but the gem isnt found. is there any way to copy & paste the gem installed for
<pythonator>
1.9.1 over to 2.3?
Pumukel has joined #ruby
spudowiar has quit [Quit: bye]
<pythonator>
when i try to gem install i get a /usr/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an
Pumukel has quit [Ping timeout: 264 seconds]
igniting has joined #ruby
postmodern has joined #ruby
kira has quit [Ping timeout: 260 seconds]
lightheaded has quit [Read error: Connection reset by peer]
<croberts>
just wanted to make sure i was looking at the right spot
miqlas-H has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
Pumukel has quit [Ping timeout: 250 seconds]
doublemalt_ has joined #ruby
Coldblackice has joined #ruby
Pumukel has joined #ruby
nankyokusei has quit [Ping timeout: 258 seconds]
Coldblackice has quit [Max SendQ exceeded]
Coldblackice has joined #ruby
workmad3 has joined #ruby
doublemalt__ has quit [Ping timeout: 264 seconds]
<Bish>
matthewd: that sucks
Pumukel has quit [Ping timeout: 260 seconds]
<Bish>
a good multithreaded ruby would be too good
<Papierkorb>
you can use JRuby?
<Bish>
well, i use too many things with c extension
<Bish>
which would fall into the category "not good"
<Bish>
but actually i never tried jruby, should do that
<matthewd>
Seems like putting full high-level locking into every class is going to take a fair bit of programmer and CPU effort, for a relatively rare requirement
<Bish>
gil free threads sounds promising i guess
<linduxed>
Bish: if you don't rely all too much on external gems then alternative ruby implementations are a decent alternative
<Bish>
rare requirement for the usual ruby programmer*
<Bish>
linduxed: im afraid those exist rarely
<linduxed>
Bish: i've heard good things about both JRuby and Rubinius, their primary downsides being that a lot of gems break due to those expecting a GIL
Pumukel has joined #ruby
symm- has quit [Quit: Leaving...]
tomaz_b has quit [Ping timeout: 244 seconds]
<matthewd>
Bish: You know SMTP, right?
tmtwd has quit [Ping timeout: 276 seconds]
<Bish>
matthewd: yes.
<Bish>
well that was not related to SMTP
<Bish>
linduxed: i tried rubinius i LOVEEE it, but it sucks
<linduxed>
Bish: care to elaborate?
<Bish>
it burns my cpu to the ground, and is still slower than MRI in all cases i observed
<linduxed>
oh, interesting
<Bish>
but the fact that it can burn my cpu to the ground was enough to think it's cool
<linduxed>
well, i don't know if the project is still being developed: i heard something about development slowing down
* linduxed
might be wrong though
<matthewd>
Bish: So given that SMTP can't multiplex several messages across a connection at the same time, it just doesn't seem like a big deal to throw a mutex around the connection
<Bish>
yes, but i just started using threads with Mail.deliver ( of the mail gem )
<matthewd>
(or make separate connections for each thread)
<Bish>
mail servers started complaining about 1 connection / mail
<Bish>
so i went with .delivery_method :smtp_connection
<Bish>
which turns out to disable threading :3
Xiti has joined #ruby
Xiti has quit [Changing host]
Xiti has joined #ruby
<Bish>
u gotta love ruby for writing nice code, but it always has a price
<Bish>
goddamnit why does everything have to have a price
<matthewd>
I... ??
<matthewd>
If you want to use a single connection, you can't do more than one thing at once
<Bish>
linduxed: yeah maybe they saw (like me) that the benefits aren't there
<Bish>
linduxed: crystal looks more promising right now ;)
<Bish>
matthewd: yeah i know..
Pumukel has quit [Ping timeout: 244 seconds]
<matthewd>
I must be confused, because I don't see how that's a ruby / nice code problem, and not just an intrinsic property of the underlying protocol
Pumukel has joined #ruby
<matthewd>
(I'd personally just use local sendmail delivery to solve the problem in question.. though that gives you less tracking of the remote acceptance, obviously)
<Bish>
matthewd: it's cool, i will do something in between
<matthewd>
.. because what you need is a queue, and a suitably-sized pool of outgoing connections, and something to put one through the other.... and someone already wrote one of those.
lightheaded has quit [Remote host closed the connection]
<optiz0r>
evening all. I'm trying to debug a third party tool that's throwing an "Error: undefined method `delete' for 1:Fixnum" error, but without giving a stack trace, so I've no idea where in the code it's being thrown. Trying to use rdebug to grab a stack trace. tried "catch NoMethodError", "c", but it doesn't stop. Anyone able to give me some pointers on how to catch this?
<Bish>
i can safely return out of a synchronize block?
<matthewd>
Bish: Yes
<Bish>
how does that work?
<matthewd>
synchronize uses an ensure to always unlock on the way out
haraigo has joined #ruby
Davedev28 has quit [Read error: Network is unreachable]
Pumukel has quit [Ping timeout: 264 seconds]
MrBusiness2 has joined #ruby
conah has joined #ruby
harai54 has quit [Ping timeout: 264 seconds]
Pumukel has joined #ruby
ddffg has quit [Quit: Leaving]
<matthewd>
optiz0r: `ruby -d` will report all exceptions as they're raised, even if they get rescued
Davedev28 has joined #ruby
<optiz0r>
matthewd: lovely thank you, think that's exactly what I need :)
shellie_ has quit [Remote host closed the connection]
heelpmeplz has quit [Read error: Connection reset by peer]
MrBusiness3 has quit [Ping timeout: 250 seconds]
jgt3 has joined #ruby
<Bish>
matthewd: god thats awesome
heelpmeplz has joined #ruby
<Bish>
who comes up with that
<Bish>
but that'd be control flow with errors, right?
<Bish>
which is considered bad practice?
<matthewd>
Bish: People not busy adding thread safety to everything just in case? ;)
Pumukel has quit [Ping timeout: 260 seconds]
tobacco_joe has quit []
<matthewd>
No errors involved; `ensure` is just what it says on the tin: a guarantee that if the stack is unwound through this point for any reason (including errors, but, per the above, not exclusively so), it'll make sure this code is run first
flashpoint9 has quit [Remote host closed the connection]
claudiuinberlin has quit []
flashpoint9 has joined #ruby
<Bish>
that's just great
m_abdelfattah has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
whiteline has quit [Ping timeout: 244 seconds]
rsampaio_ has joined #ruby
whiteline has joined #ruby
<apeiros>
other ways to pass by an ensure: throw, break and just letting the begin/end block finish
<matthewd>
> There is no provision for repairing or checking the health of a connection; connections should be self-repairing. This is true of the Dalli and Redis clients.
karmatr0n has joined #ruby
<Bish>
okay cool, so i could put my smtpconnection wrapper into it
<Bish>
which checks up on itself
<matthewd>
So I think that means you'd use the pool to manage a set of wrapper objects, which handle the reconnect bit.. yeah, that :)
<Bish>
great, thank you very much!!
<Bish>
i will sleep about that now
<Bish>
you've been a great help!
<matthewd>
Just instead of throwing it out if it goes bad, it internally reconnects
<matthewd>
You're very welcome :)
<Bish>
but that monster was fun to write
nando293921 has joined #ruby
youch has quit [Ping timeout: 252 seconds]
<Bish>
but my code doesn't deadlock.. does it?
akira616 has joined #ruby
akira616 has left #ruby ["Leaving"]
skweek has quit [Ping timeout: 244 seconds]
the_rhizo3 has quit [Ping timeout: 265 seconds]
<matthewd>
I don't think so. The nested lock makes me a bit uneasy, but I couldn't come up with a way to get it stuck -- at least before I hit the more obvious problem.
karmatr0n has quit [Ping timeout: 252 seconds]
DarthGandalf has quit [Ping timeout: 276 seconds]
<Bish>
okay, thanks alot again ;) good night/day whatever time is it at your place
lightheaded has joined #ruby
Pumukel has joined #ruby
DarthGandalf has joined #ruby
code_zombie has joined #ruby
code_zombie has left #ruby ["Leaving"]
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
flashpoint9 has quit [Remote host closed the connection]
<Radar>
What is the input and output of that function?
ltd_ has joined #ruby
Derperperd has joined #ruby
<PalaHO>
data = {'name' : namen 'type' : type}
<PalaHO>
for exemple of input
<jgnagy>
if you require 'json', most objects have a .to_json() method
Pumukel has quit [Ping timeout: 264 seconds]
<PalaHO>
oh ok
Rodya_ has joined #ruby
<PalaHO>
but i think json.dumpS just sort the input
<PalaHO>
am i wrong ?
<PalaHO>
no ok
<PalaHO>
i understood
<PalaHO>
i will use .to_json()
<jgnagy>
I think python's json.dumps has an option to sort by keys, but it doesn't do it by default
<PalaHO>
this a OpenSSL::HMAC object
<PalaHO>
yeah i saw that
<PalaHO>
how can i sort my json like that ?
<elomatreb>
Ruby's json doesn't offer that. You would likely have to sort the object you're trying to dump
<PalaHO>
ok
Oog has quit []
<jgnagy>
exactly
retail_investor is now known as hammond
<PalaHO>
cool thank you guys ! :)
<jgnagy>
I'm not too familiar with the content of the state of an OpenSSL::HMAC object, but if it providers and Enumerable you can probably use .sort_by() {} to get what you're looking for
<jgnagy>
provides*
<jgnagy>
an*
<jgnagy>
sheesh so many typos
Pumukel has joined #ruby
<PalaHO>
ok so all Enumarable obj can be sort by .sort_by() like in python
<jgnagy>
yes
<jgnagy>
it is an instance method of Enumerable
<elomatreb>
PalaHO: sort_by sorts using the return value of a block. There is also just ".sort", which often works too
<jgnagy>
sort_by can be more efficient in many cases though
<elomatreb>
jgnagy: A source for that? It seems a little unintuitive that a possibly native-optimized method would be slower than one involving calling blocks
<jgnagy>
"All sort does is compare the items in the enumerable by their built-in comparator method (<=>) or using the block if one is passed to it. So essentially, when given a block, sort runs the block for every comparison it needs to do and expects to get back 1 when the first object is greater, -1 for the second, and 0 if they are equal. You can probably guess why this is a terrible idea in a case like ours. I was parsing the time
<jgnagy>
for each and every comparison!"
<elomatreb>
ah, ok. Thank you for the article, didn't know this
Pumukel has quit [Ping timeout: 264 seconds]
ta_ has joined #ruby
statelesscode_ has joined #ruby
statelesscode has quit [Ping timeout: 240 seconds]
statelesscode_ is now known as statelesscode
<jgnagy>
no problem
ta_ has quit [Ping timeout: 265 seconds]
Madplatypus has quit [Quit: Connection closed for inactivity]