<Radar>
dcope: Do you have to use Net::HTTP or are you doing it because of masochistic tendencies?
<dcope>
Radar: i'm just using net:http to keep it simple. this is just a simple shell script i'm playing with. :)
pawnbox has joined #ruby
<Radar>
Net::HTTP is not "simple"
microt has left #ruby ["WeeChat 1.3"]
<Radar>
I recommend using Excon or HTTParty so that you don't have to battle with Net::HTTP's crap API
<dcope>
Radar: well, simple to setup. i was just trying to stick in with built in libraries.
<dcope>
request_uri did the trick though! thank you :D
<svankmajer>
I've a Hash with three keys: a, b, and c. I want to map their elements like this: `a.flat_map { |i| b.flat_map { |j| c.map {|k| [i, j, k] } } }`. Now, how could I do this, not knowing how many keys the Hash has? How can one nest those `map`s "dynamically", based on a number of collections? Jesus. I don't know anymore if this is making any sense whatsoever.
bronson has quit [Remote host closed the connection]
<svankmajer>
their values, which are arrays* (e.g. of integers)
polyidus has joined #ruby
ghormoon has joined #ruby
hxegon_AFK is now known as hxegon
devbug_ has joined #ruby
Tricon has quit [Remote host closed the connection]
Tricon has joined #ruby
hxegon is now known as hxegon_AFK
hxegon_AFK is now known as hxegon
krz has quit [Ping timeout: 276 seconds]
<Ox0dea>
svankmajer: It's not entirely clear what you're asking, but I suspect you want something from Ruby's limited supply of combinatorics.
<djellemah>
afaics, it's one way to do what Haskell calls scanl. Anybody know of ruby implementations? I want to see how the possible wrinkles are handled. I can only find some snippets on stackoverflow.
uglybandersnatch has quit [Ping timeout: 252 seconds]
vondruch has joined #ruby
<jhass>
I'd use each_with_object but that's about as good as it gets
jaruga has joined #ruby
neanderslob_ has quit [Remote host closed the connection]
neanderslob has joined #ruby
jeanlinux has joined #ruby
<apeiros>
meh, I'd probably do ary.map(&:last).compact.inject(:+)
devbug_ has quit [Ping timeout: 240 seconds]
<apeiros>
oh
<apeiros>
misread. you push to an array.
<jhass>
apeiros: I think you misread it :)
<apeiros>
yeah. it's still early morning. not had my caffeine yet :D
<jhass>
sure there's a mathematical term for that, cumulative sequence or something?
<apeiros>
looks like a running total?
<djellemah>
yup - prefix sum, cumulative sum
<apeiros>
total=0; ary.map { |item| total+item }
<apeiros>
total=0; ary.map { |item| total+=item }
tvw has joined #ruby
LoneHerm_ has joined #ruby
jeanlinux has quit [Remote host closed the connection]
<djellemah>
that as well. I'm wondering if there's any point in having the totals collection (and the last total) passed around via reduce or each_with_object. Or if it's easier to just have them as locals like ^
pawnbox has quit [Remote host closed the connection]
maner has joined #ruby
pawnbox has joined #ruby
<jhass>
boils down to preference I'd say
copperb0lt has quit [Quit: WeeChat 1.4]
<djellemah>
I can't really think of anything more solid than that either ;-)
sandstrom has joined #ruby
Es0teric has joined #ruby
Es0teric has quit [Max SendQ exceeded]
LoneHerm_ has quit [Ping timeout: 252 seconds]
copperb0lt has joined #ruby
Es0teric has joined #ruby
Es0teric has quit [Max SendQ exceeded]
Es0teric has joined #ruby
Es0teric has quit [Max SendQ exceeded]
bronson has joined #ruby
Es0teric has joined #ruby
SCHAAP137 has joined #ruby
terlar has joined #ruby
shredding has joined #ruby
gbgdev has joined #ruby
bronson has quit [Ping timeout: 260 seconds]
hahuang61 has joined #ruby
firstdayonthejob has quit [Ping timeout: 248 seconds]
jeanlinux has joined #ruby
jeanlinux has quit [Remote host closed the connection]
binaryplease1 has joined #ruby
wldcordeiro has quit [Ping timeout: 244 seconds]
hahuang61 has quit [Ping timeout: 250 seconds]
biberu has joined #ruby
<morfin>
apeiros, i thought you can collect
ixti has quit [Ping timeout: 240 seconds]
electriv has joined #ruby
baweaver has quit [Remote host closed the connection]
tjbiddle has quit [Quit: tjbiddle]
<morfin>
oh no, not collect but inject/reduce
Es0teric has quit [Quit: Computer has gone to sleep.]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
the_drow has joined #ruby
anisha has quit [Ping timeout: 246 seconds]
anisha_ has quit [Client Quit]
anisha_ has joined #ruby
vondruch has quit [Ping timeout: 276 seconds]
malcolmva has quit [Ping timeout: 252 seconds]
pawnbox has quit [Remote host closed the connection]
atmosx has joined #ruby
pawnbox has joined #ruby
drptbl has joined #ruby
krzkrzkrz has quit [Ping timeout: 250 seconds]
c0x has joined #ruby
devbug has quit [Ping timeout: 268 seconds]
Es0teric has joined #ruby
krzkrzkrz has joined #ruby
<c0x>
Hello People!!
wldcordeiro has joined #ruby
duncannz has quit [Remote host closed the connection]
FooMunki has joined #ruby
<jhass>
hi
araujo has quit [Quit: Leaving]
araujo has joined #ruby
nerium has joined #ruby
mark2 has joined #ruby
nobitanobi has joined #ruby
whiteline has quit [Ping timeout: 246 seconds]
nobitanobi has quit [Client Quit]
neanderslob has quit [Ping timeout: 248 seconds]
lipoqil has joined #ruby
vondruch has joined #ruby
sarlalia1 has joined #ruby
krzkrzkrz has quit [Ping timeout: 248 seconds]
sarlalia1 has quit [Client Quit]
sergey_makagon has joined #ruby
FooMunki has quit [Read error: Connection reset by peer]
neanderslob_ has joined #ruby
Xeago has joined #ruby
RegulationD has joined #ruby
mikhael_k33hl has left #ruby ["Leaving"]
eregi has joined #ruby
CloCkWeRX has joined #ruby
GBrawl has joined #ruby
malcolmva has joined #ruby
Snowy has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
BLuEGoD has joined #ruby
RegulationD has quit [Ping timeout: 252 seconds]
eregi has quit [Ping timeout: 246 seconds]
gbgdev has quit [Remote host closed the connection]
joonty has joined #ruby
GBrawl has quit [Quit: (null)]
aufi_ has joined #ruby
aufi has quit [Ping timeout: 260 seconds]
skade has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
sandstrom has joined #ruby
paatalaBhairavi has quit [Read error: Connection reset by peer]
LoneHermit has joined #ruby
but3k4 has joined #ruby
paatalaBhairavi has joined #ruby
stan has joined #ruby
aupadhye has quit [Ping timeout: 240 seconds]
but3k4 has quit [Ping timeout: 248 seconds]
<morfin>
that thing with foo.each(&:bar) confusing me
<morfin>
>> 10.to_proc
<ruby[bot]>
morfin: # => undefined method `to_proc' for 10:Fixnum ...check link for more (https://eval.in/532491)
Trioxin has joined #ruby
<Trioxin>
I'm new to ruby. I installed rbenv via my distro's package manager. should I be using rbenv as root when installing a ruby or from the my user context?
troulouliou_div2 has joined #ruby
<Trioxin>
none of the install tutorials mention this
f4cl3y has joined #ruby
<morfin>
you can install for your user only
mfaeh has joined #ruby
<morfin>
basically all ruby stuff located in ~/.rbenv
sepp2k has joined #ruby
<Trioxin>
is it going to drop it into whatever directory im in?
<Trioxin>
oh
troulouliou_div2 has quit [Remote host closed the connection]
baweaver has joined #ruby
Snowy has quit [Remote host closed the connection]
<morfin>
no
<morfin>
into /home/username/.rbenv
<Trioxin>
hrm. it's showing the latest version it has is 2.2.0-preview1
<morfin>
mm
<Trioxin>
probably because I used apt-get?
<morfin>
you can install rbenv not from apt-get
aupadhye has joined #ruby
baweaver has quit [Ping timeout: 240 seconds]
<morfin>
that gives some freedom - i think you can even run your projects in jail without problems(one project - one jail)
<jhass>
igam: the outer parens are pretty meaningless there
<igam>
Not to a lisper :-)
<jhass>
just a grouping expression
<igam>
Quite useful with paredit in emacs actually.
krzkrzkrz has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
<morfin>
you can want do something like (x.f 1,2).bar :foo
<jhass>
ugh, that's ugly
<jhass>
in that case just x.f(1, 2).bar :foo
Es0teric has joined #ruby
<igam>
x.f(1, 2).bar :foo is harder to read. Now you have to know priority levels and to parse them.
<jhass>
I disagree
<igam>
with ((x.f 1,2).bar :foo) you don't have to think, the parentheses tell it all. Lisp is nice.
<jhass>
there's no precedence rules needed there
<morfin>
i heard in Lisp you count parentheses to be fine )
<jhass>
then go write lisp instead of ruby
<igam>
I wish, but because of you, ruby is installed everywhere instead of lisp.
<jhass>
don't try to write ruby like it's lisp
<jhass>
are you trying to troll? because that's not welcome here
TomyLobo has joined #ruby
<igam>
Then modify the syntax of ruby. I can, so I will.
mg^ has quit [Ping timeout: 276 seconds]
Xeago has quit [Remote host closed the connection]
sandstrom has quit [Ping timeout: 276 seconds]
crdpink2 has quit [Ping timeout: 250 seconds]
marr has joined #ruby
marr has quit [Client Quit]
sandstrom has joined #ruby
glcx has quit [Quit: Quitte]
DaniG2k has joined #ruby
marr has joined #ruby
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pandaant has quit [Remote host closed the connection]
glcx has joined #ruby
glcx has quit [Changing host]
glcx has joined #ruby
haxrbyte has joined #ruby
yardenbar has joined #ruby
lxsameer has joined #ruby
jayc0b0 has quit [Remote host closed the connection]
chouhoulis has quit [Remote host closed the connection]
<djellemah>
pythonistas indent their 'end' lines, c++/java folks use {} for all blocks, lispers and ocamlers say (obj.method arg). Javascripters never leave out the () and ; brainfuckers use only symbols
workmad3 has joined #ruby
ext0 has joined #ruby
BtcBen has quit [Ping timeout: 252 seconds]
M-mistake has joined #ruby
Guest34101 has joined #ruby
<yorickpeterse>
x.f(1, 2).bar :foo is no harder to read than (x.f 1,2).bar :foo
<yorickpeterse>
In fact, I'd argue the latter is harder to read as it relies on explicitly defined precedences
<yorickpeterse>
whereas the former is just the natural way of writing it
<yorickpeterse>
And people like jhass aren't the reason Ruby is installed everywhere. The reason is because Ruby actually works, is widely used and useful to many
<yorickpeterse>
Meanwhile Lisp users continue to brag about how great it is, yet it's a fraction of the industry
<yorickpeterse>
I wonder why
<gregf_>
lisp is quite unreadable imo, prolly a write once language
gbgdev has joined #ruby
M-mistake has quit [Quit: node-irc says goodbye]
gbgdev has quit [Read error: Connection reset by peer]
gbgdev has joined #ruby
M-shine has quit [Quit: node-irc says goodbye]
glcx has quit [Quit: Quitte]
jeanlinux has joined #ruby
sergey_makagon has quit [Remote host closed the connection]
sandstrom has quit [Quit: My computer has gone to sleep.]
sandstrom has joined #ruby
pawnbox has quit [Remote host closed the connection]
jeanlinux has quit [Remote host closed the connection]
pawnbox has joined #ruby
n008f4g_ has joined #ruby
moeabdol3 has joined #ruby
<djellemah>
I find джэллемах quite hard to read. But there are lots of people who find it very easy.
whiteline has joined #ruby
troulouliou_div2 has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
<Trioxin>
should I be able to run script coded in 2.1..5 on 2.3.0?
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<wolfedale>
And it's returning Nil in my case (all the time).
charliesome has joined #ruby
<wolfedale>
I checked Mail.new and Mail.read(mail) and so on.
trinaldi has joined #ruby
<wolfedale>
Any clue how to check bcc address from STDIN?
<mikar>
is there some sort of shorthand that translates weeks/days/hours into seconds? i'd like a timeout in seconds and a variable input of something like "2:hours" or "3.5:minutes"
openstruct has joined #ruby
crdpink2 has joined #ruby
shredding has quit [Ping timeout: 240 seconds]
aufi_ has quit [Ping timeout: 260 seconds]
<adaedra>
I don't think there's something directly, but you could have something like `UNIT = { second: 1, minute: 60, hour: 3600 }` and `second_duration = duration * UNIT[unit]`
blackms has quit [Ping timeout: 264 seconds]
tim_s007 has quit [Ping timeout: 268 seconds]
gnagh has quit [Quit: leaving]
sdothum has joined #ruby
UtkarshRay has quit [Ping timeout: 240 seconds]
<djellemah>
mikar: active_support/core_ext/numeric/time.rb has methods for that. Maybe one of the other time gems has something as well.
<f4cl3y>
Hey guys, I know this is rather trivial question for most of you, but this my first project. I was wondering if there a "best practice" to handle configurations in Ruby?
cyclonis has quit [Ping timeout: 244 seconds]
<f4cl3y>
And if anyone would recommend using Thor for CLI stuff?
<jhass>
f4cl3y: I believe configuration is highly specific to your project, target environment and userbase and thus there's no universal best solution possible
baweaver has joined #ruby
<f4cl3y>
jhass: Thank you!
trosborn has quit [Quit: trosborn]
DaniG2k has quit [Quit: leaving]
electriv has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
auzty has quit [Quit: Leaving]
ebbflowgo has joined #ruby
callen92 has joined #ruby
blackms has joined #ruby
baweaver has quit [Ping timeout: 250 seconds]
callen92 has quit [Client Quit]
lxsameer has joined #ruby
Xeago has joined #ruby
UtkarshRay has joined #ruby
moeabdol3 has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
<Takumo>
Hi all, how do I set the background fill color for a page in PrawnPDF?
jeanlinux has joined #ruby
moeabdol3 has quit [Ping timeout: 252 seconds]
johnmilton has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Slice^ has joined #ruby
zapata has quit [Ping timeout: 260 seconds]
dgncn has quit [Excess Flood]
Snowy has quit [Remote host closed the connection]
pawnbox_ has joined #ruby
pawnbox_ has quit [Remote host closed the connection]
jeanlinux has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 248 seconds]
dgncn has joined #ruby
DmitryBochkarev has joined #ruby
charlemagne has joined #ruby
skade has joined #ruby
dgncn has quit [Excess Flood]
evidex has quit [Remote host closed the connection]
chocoelho has joined #ruby
evidex has joined #ruby
sandstrom has joined #ruby
Shaboum has joined #ruby
dgncn has joined #ruby
sgambino has joined #ruby
pawnbox has joined #ruby
electriv has joined #ruby
niksrc has joined #ruby
<wolfedale>
hmm, how to execute something like this from ruby?
<wolfedale>
/usr/sbin/sendmail -G -i "$@" < @mail
<wolfedale>
Where only @mail is a ruby object.
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
duckpuppy has joined #ruby
p1k has joined #ruby
mfaeh has quit [Remote host closed the connection]
<p1k>
hello
charlemagne has quit [Remote host closed the connection]
Macaveli has joined #ruby
charlemagne has joined #ruby
<p1k>
is there a ruby sort equivalen to python's e.g. key = lambda a: a[0] ? I see that sort takes a block but that seems like a full fledged compare
trinaldi has quit [Ping timeout: 248 seconds]
<hanmac>
p1k checkout sort_by
<p1k>
thanks that's exactly what I was looking for
chouhoulis has joined #ruby
augcesar has quit [Quit: CyberScript - O ministério da saúde adverte: usar CyberScript causa dependência! (www.cyberscript.org)]
helpa has quit [Remote host closed the connection]
augcesar has joined #ruby
helpa has joined #ruby
charlemagne has quit [Ping timeout: 276 seconds]
jeanlinux has joined #ruby
moos3 has joined #ruby
<shevy>
wolfedale I don't know what is $@ but you can do everything with system() `` or popen*
chouhoulis has quit [Ping timeout: 240 seconds]
eregi has joined #ruby
Shaboum has quit [Quit: WeeChat 1.4]
<chridal>
The Resque poll timer is set to every 5 seconds but this slows down our workers by a lot
<chridal>
Would there be a drawback to setting this to for instance 0.1s?
troulouliou_div2 has joined #ruby
saneax is now known as saneax_AFK
<jhass>
wolfedale: hint: Kernel#system takes the same argument forms as documented on Kernel#spawn
cyclonis has joined #ruby
Aviio has quit [Quit: Leaving.]
eregi has quit [Ping timeout: 244 seconds]
tvon has quit [Quit: tvon]
Domaldel has joined #ruby
n008f4g_ has quit [Ping timeout: 276 seconds]
n008f4g_ has joined #ruby
diegoviola has joined #ruby
aryaching has joined #ruby
GBrawl has joined #ruby
but3k4 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bronson has joined #ruby
Snowy has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
electriv has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<wolfedale>
jhass: I'm trying but still not sure how to do it :(
jeanlinux has quit [Remote host closed the connection]
trinaldi has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
charlemagne has joined #ruby
jeanlinux has joined #ruby
but3k4 has joined #ruby
hahuang61 has joined #ruby
solars has quit [Ping timeout: 260 seconds]
CustosLim3n has quit [Quit: CustosLimen]
hahuang61 has quit [Ping timeout: 264 seconds]
<jhass>
well, what did you try so far?
tvon has joined #ruby
bry4n has quit [Ping timeout: 264 seconds]
charlema_ has joined #ruby
charlemagne has quit [Read error: No route to host]
atmosx has quit [Remote host closed the connection]
joonty has quit [Read error: Connection reset by peer]
joonty has joined #ruby
jottr has joined #ruby
ebbflowgo has quit [Quit: ebbflowgo]
last_staff has quit [Quit: last_staff]
RegulationD has joined #ruby
AlphaAtom has quit [Ping timeout: 276 seconds]
n008f4g_ has quit [Ping timeout: 240 seconds]
charlema_ has quit [Ping timeout: 246 seconds]
RegulationD has quit [Ping timeout: 246 seconds]
Abrin_AWAY has quit [Ping timeout: 244 seconds]
aufi_ has joined #ruby
Rickmasta has joined #ruby
mfaeh has joined #ruby
moeabdol3 has joined #ruby
gbgdev has quit [Read error: Connection reset by peer]
gbgdev has joined #ruby
synthroid has joined #ruby
augcesar has quit [Remote host closed the connection]
jottr has quit [Quit: WeeChat 1.4]
jottr has joined #ruby
UtkarshRay has quit [Remote host closed the connection]
tonyynot has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
UtkarshRay has joined #ruby
Domaldel has quit [Quit: Leaving]
aupadhye has quit [Ping timeout: 260 seconds]
fexilal has joined #ruby
cyclonis has quit [Ping timeout: 244 seconds]
Snowy has quit [Remote host closed the connection]
Ishido has quit [Remote host closed the connection]
chouhoulis has joined #ruby
lxsameer has quit [Ping timeout: 244 seconds]
Ishido has joined #ruby
chouhoulis has quit [Ping timeout: 260 seconds]
solars has joined #ruby
joonty has quit [Ping timeout: 244 seconds]
anisha_ has quit [Quit: Leaving]
leventix has joined #ruby
ropeney has joined #ruby
hxegon has joined #ruby
Spami has joined #ruby
siaw has quit [Quit: siaw]
Xeago has quit [Remote host closed the connection]
symm- has quit [Quit: Leaving...]
Xeago has joined #ruby
tungd has joined #ruby
kam270 has joined #ruby
shevy has quit [Ping timeout: 246 seconds]
zotherstupidguy has joined #ruby
haxrbyte has quit [Remote host closed the connection]
haxrbyte has joined #ruby
haxrbyte has quit [Remote host closed the connection]
haylon has joined #ruby
codecop has quit [Remote host closed the connection]
haxrbyte has joined #ruby
mfaeh has quit []
leventix_ has joined #ruby
GBrawl has quit [Quit: (null)]
malconis has joined #ruby
hxegon has quit [Quit: BRB]
malconis has quit [Remote host closed the connection]
haxrbyte has quit [Client Quit]
baweaver has joined #ruby
leventix_ has left #ruby [#ruby]
malconis has joined #ruby
vishwa has joined #ruby
baweaver has quit [Ping timeout: 250 seconds]
howdoi has joined #ruby
ramortegui has joined #ruby
freerobby has joined #ruby
c0x has quit [Remote host closed the connection]
leventix_ has joined #ruby
trinaldi has quit [Ping timeout: 264 seconds]
ramortegui has quit [Client Quit]
dstarh has joined #ruby
saneax_AFK is now known as saneax
nennes has joined #ruby
Slice^ has quit [Quit: This computer has gone to sleep]
saneax is now known as saneax_AFK
hs366 has joined #ruby
saneax_AFK is now known as saneax
shevy has joined #ruby
bluOxigen_ has joined #ruby
Snowy has joined #ruby
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
Trioxin has left #ruby ["Konversation terminated!"]
last_staff has joined #ruby
shevy has quit [Ping timeout: 246 seconds]
vikas027 has joined #ruby
vikas027 has left #ruby [#ruby]
joonty has joined #ruby
nando293921 has joined #ruby
jyaworski has joined #ruby
Macaveli has quit [Ping timeout: 276 seconds]
Ishido has quit [Remote host closed the connection]
Macaveli has joined #ruby
freerobby has quit [Quit: Leaving.]
UtkarshRay has quit [Remote host closed the connection]
drptbl has joined #ruby
Ishido has joined #ruby
dima_ has joined #ruby
UtkarshRay has joined #ruby
eregi has joined #ruby
DmitryBochkarev has quit [Ping timeout: 246 seconds]
kam270 has quit [Read error: Connection reset by peer]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
trinaldi has joined #ruby
CustosLimen has joined #ruby
wolfedale has quit [Ping timeout: 244 seconds]
nando293921 has quit [Quit: Lost terminal]
shevy has joined #ruby
eregi has quit [Ping timeout: 248 seconds]
bMalum has joined #ruby
nando293921 has joined #ruby
hxegon has joined #ruby
chouhoulis has joined #ruby
tungd has quit [Quit: Dreaming...]
unl0ckd has joined #ruby
Xeago has quit [Remote host closed the connection]
nobitanobi has joined #ruby
Jardayn has joined #ruby
Xeago has joined #ruby
jottr has quit [Ping timeout: 260 seconds]
mostlybadfly has quit [Quit: Connection closed for inactivity]
kristofferR has joined #ruby
danjack has joined #ruby
<danjack>
hello
chouhoulis has quit [Ping timeout: 244 seconds]
dfinninger has joined #ruby
<danjack>
if i parse [a,b,c] from yaml to ruby, it will give me an array of strings [:a, :b, :c], is there a way to define a one line yaml array of symbols?
Prominent has joined #ruby
r4z3r has quit [Max SendQ exceeded]
Xeago has quit [Read error: Connection reset by peer]
Xeago_ has joined #ruby
r4z3r has joined #ruby
n008f4g_ has joined #ruby
dfinninger has quit [Client Quit]
justbleed has joined #ruby
Snowy has quit [Remote host closed the connection]
Xeago has joined #ruby
r4z3r has quit [Max SendQ exceeded]
r4z3r has joined #ruby
freerobby has joined #ruby
Xeago has quit [Read error: Connection reset by peer]
Prominent has quit [Ping timeout: 252 seconds]
Xeago_ has quit [Ping timeout: 260 seconds]
Xeago has joined #ruby
gbgdev has quit [Remote host closed the connection]
sandstrom has quit [Quit: My computer has gone to sleep.]
kies has quit [Ping timeout: 252 seconds]
aegis3121 has joined #ruby
shanemcd has joined #ruby
mary5030 has joined #ruby
sandstrom has joined #ruby
hahuang61 has joined #ruby
Xeago has quit [Ping timeout: 244 seconds]
Guest34101 has joined #ruby
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
your example is an array of symbols, but anyway, yaml doesn't know symbols
solars has quit [Ping timeout: 260 seconds]
<jhass>
so no
<shevy>
danjack you should be able to store symbols in yaml e. g. via "- !ruby/symbol a" for :a or rather an array with :a
<jhass>
ah right, that weird stuff
Anderson69s_Deb has quit [Ping timeout: 260 seconds]
<jhass>
note it's incompatible with other yaml parsers than psych
<shevy>
I guess in principle you could extend yaml to allow for that
<shevy>
ruby code would strike me as even shorter than the yaml though, if you only have one-word things to store %i( a b c ) # => [:a, :b, :c]
gbgdev has quit [Remote host closed the connection]
Tricon has quit [Ping timeout: 244 seconds]
configged has joined #ruby
zotherstupidguy has quit [Ping timeout: 248 seconds]
configged- has joined #ruby
tvw has quit []
sandstrom has joined #ruby
The_Phoenix has joined #ruby
aufi_ has quit [Quit: Konversation terminated!]
tricon_ has quit [Remote host closed the connection]
Tricon has joined #ruby
aufi has joined #ruby
gbgdev has joined #ruby
B1n4r10 has quit [Ping timeout: 244 seconds]
openstruct has joined #ruby
baweaver has joined #ruby
solars has joined #ruby
baweaver has quit [Ping timeout: 250 seconds]
hs366 has quit [Quit: Leaving]
evidex has joined #ruby
eregi has joined #ruby
aufi has quit [Ping timeout: 240 seconds]
glcx has joined #ruby
aegis3121 has quit [Ping timeout: 276 seconds]
al2o3-cr has quit [Read error: Connection reset by peer]
Rodya_ has joined #ruby
Rodya_ has quit [Remote host closed the connection]
jhack has quit [Quit: jhack]
jhack has joined #ruby
prefix has joined #ruby
rubie has joined #ruby
Rodya_ has joined #ruby
marxarelli has joined #ruby
n008f4g_ has quit [Ping timeout: 244 seconds]
floatingpoint has quit [Ping timeout: 246 seconds]
<rubie>
hi all: i have a scale that goes from -50 to 50 but i need to fit that inside a range of 0-255 (rgb colors), so when my scale is -50 i get 0 and when the scale is 50 i would get 250, any ideas how to solve this?
jyaworski_ has joined #ruby
<jhass>
with math
jyaworski has quit [Ping timeout: 268 seconds]
jyaworski_ is now known as jyaworski
<rubie>
is there any particular kind of math that would work best?
<ljarvis>
multiplication and divisionz
solars has quit [Ping timeout: 252 seconds]
andikr has quit [Remote host closed the connection]
trinaldi_ has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
trinaldi has quit [Disconnected by services]
trinaldi_ is now known as trinaldi
<gregf_>
-50 to 50 is 100 , so divide 255 by 100?
jaruga has quit [Ping timeout: 268 seconds]
<gregf_>
s/255/256/
<igam>
rubie: depends also on how you want to map your range. Linearly? Quadratically? Exponentially? etc
roshanavand has quit [Quit: This computer has gone to sleep]
edwinvdgraaf has joined #ruby
djbkd has quit [Remote host closed the connection]
aeontech has quit [Quit: aeontech]
<pushcx>
humans are more sensitive to green than red and especially blue, so if you just linearly ramp over all three your colors will not be accurately understood
terminalrecluse has joined #ruby
roshanavand has joined #ruby
troulouliou_div2 has quit [Remote host closed the connection]
Guest38 has joined #ruby
sandstrom has joined #ruby
jhack has quit [Quit: jhack]
Macaveli has quit [Ping timeout: 260 seconds]
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
jaruga has quit [Remote host closed the connection]
roshanavand has quit [Quit: This computer has gone to sleep]
jaruga has joined #ruby
maletor has joined #ruby
atmosx has joined #ruby
TomyLobo has joined #ruby
baweaver has joined #ruby
openstruct has quit []
connor_goodwolf has joined #ruby
momomomomo has quit [Quit: momomomomo]
ivanskie has joined #ruby
neanderslob_ has quit [Quit: No Ping reply in 180 seconds.]
poguez_ has joined #ruby
JohnBat26 has joined #ruby
neanderslob_ has joined #ruby
baweaver has quit [Ping timeout: 240 seconds]
ixti has joined #ruby
st0mar has joined #ruby
jaruga has quit [Quit: jaruga]
shinnya has quit [Ping timeout: 244 seconds]
tvsutton_ has quit [Quit: Quit]
roshanavand has joined #ruby
cyclonis has quit [Ping timeout: 240 seconds]
symm- has joined #ruby
roshanavand has quit [Client Quit]
TomyLobo has quit [Ping timeout: 252 seconds]
cyclonis has joined #ruby
asmodlol has quit [Ping timeout: 240 seconds]
kfpratt has joined #ruby
skade has joined #ruby
Snowy has quit [Remote host closed the connection]
<shevy>
I use marque + pink
sneakerhax has joined #ruby
nennes has quit [Quit: Leaving]
roshanavand has joined #ruby
igam has quit [Ping timeout: 244 seconds]
Xeago has quit [Ping timeout: 268 seconds]
st0mar has quit [Read error: Connection reset by peer]
st0mar has joined #ruby
niksrc has quit [Quit: Leaving]
<bob_f>
Hi, is there a nice Ruby idiom for setting a default argument on a method and catching whether the value is the default, or a value passed in by the caller ?
<bob_f>
I need to differentiate between `nil` and `no value` so `nil` is not an appropriate sentinel value.
kriskropd has joined #ruby
<bob_f>
I have just done `class Sentinel; end; def foo(arg = Sentinel)` but wondering if there is a cleaner way.
Lucky_ABA has joined #ruby
boontdustie has joined #ruby
erts has joined #ruby
wldcordeiro has quit [Ping timeout: 244 seconds]
AnoHito has joined #ruby
dangerousdave has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dangerousdave has joined #ruby
erts has quit [Client Quit]
cyclonis has quit [Ping timeout: 244 seconds]
mondok has quit [Ping timeout: 244 seconds]
erts has joined #ruby
AnoHito_ has quit [Ping timeout: 244 seconds]
erts has quit [Client Quit]
<shevy>
bob_f nothing in built
<jhass>
bob_f: IME the real issue is that you need to differentiate it, it hints that your API is either too complex or not well designed
kfpratt has quit [Remote host closed the connection]
Mon_Ouie has joined #ruby
hahuang61 has joined #ruby
kfpratt has joined #ruby
roshanavand has quit [Quit: This computer has gone to sleep]
<bob_f>
jhass: In this case, I pass the argument to hash.fetch(foo, default) so if I use `default = nil` then I never know if the value was absent.
<jhass>
wrong, you can just .has_key?(foo)
<bob_f>
Sure, but then that's two (admittedly fast) lookups. It's not very clean.
<jhass>
but that you need to know is still a smell IMO
elifoster has quit [Ping timeout: 244 seconds]
<bob_f>
Fixing one smell with another isn't much of a solution. ;)
Macaveli_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
I smell flowers in the air
<jhass>
what would be the other smell? I mean how is not needing to know whether it was the default or not a smell?
kfpratt has quit [Remote host closed the connection]
skade has quit [Quit: Computer has gone to sleep.]
asmodlol has joined #ruby
<bob_f>
jhass: I'm saying that I need to pass a caller-provided argument as the default to hash.fetch and then act accordingly if the result is not found in the hash. You're saying that this is a smell (I believe).
boontdustie has quit [Ping timeout: 252 seconds]
<jhass>
yes
<bob_f>
Using .has_key? is not a good solution - if the implementation changes to (e.g.) a database lookup, then I have two slow calls when I only need one.
<jhass>
having a default and needing to know whether it's in use is a smell IMO
RegulationD has joined #ruby
niksrc has joined #ruby
<jhass>
at best it hints a bad or incomplete default
<bob_f>
So I'm wondering if there is a nicer way to do hash.fetch with a default argument, but still know whether the result is the [user-supplied] default (which could be `nil`) or that the result was not found.
<jhass>
I'm questioning that you need to know
B1n4r10 has quit [Ping timeout: 248 seconds]
treehug88 has joined #ruby
Mon_Ouie has quit [Quit: WeeChat 1.4]
allcentury has joined #ruby
<bob_f>
Because if the value is not found, then it means there is a configuration problem and an appropriate error/warning must be raised.
<bob_f>
The caller can pass a default if it wants to, but it doesn't have to.
jackjackdripper has joined #ruby
<jhass>
you probably should just disallow nil as a user provided default or something, I still don't have enough context to get specific
<bob_f>
I'd expect to be able to pass both an absolute value as well as a block. Seems a bit mean to pass the cruft on to the caller instead of hiding it in one place. :)
<jhass>
it's a pattern used in core
<bob_f>
Sure, but it's common to accept both absolute and block, in my experience.
<jhass>
then you have to use has_key? to get to a sane implementation
aeontech has joined #ruby
<bob_f>
I guess I'll just stick with what I have, in that case.
<bob_f>
Don't want to ruin someone's day if they decide to move the config to a web service.
st0mar has quit [Ping timeout: 252 seconds]
<jhass>
I find it very ugly, but just my opinion I guess
idefine_ has joined #ruby
<bob_f>
Thanks for the help regardless.
idefine has quit [Ping timeout: 240 seconds]
zast has joined #ruby
<bob_f>
Yeah, me too, was hoping there'd be some Rubytastic version. The `fetch` call with a block is likely something I'll use at some point though so thanks for the tip.
ponga has quit [Quit: Connection closed for inactivity]
Guest41507 has quit [Ping timeout: 252 seconds]
sergey_makagon has joined #ruby
sergey_makagon has quit [Client Quit]
shanemcd_ has joined #ruby
pawnbox has quit [Remote host closed the connection]
cyclonis has quit [Ping timeout: 260 seconds]
tvw has joined #ruby
cyclonis has joined #ruby
jhack has joined #ruby
jhack has quit [Client Quit]
boontdustie has quit [Remote host closed the connection]
pawnbox has joined #ruby
shanemcd_ has quit [Ping timeout: 240 seconds]
arlek has joined #ruby
cyclonis has quit [Ping timeout: 244 seconds]
<gizmore>
'evening'; %w can i store a block that remembers class_eval somehow?
<jhass>
you can store a block that class evals another block
<gizmore>
so the class_eval inside that block would work
<gizmore>
redundancy... but a way
<gizmore>
thank you
sp4rrow has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
mark2 has quit [Remote host closed the connection]
rubie has quit [Remote host closed the connection]
<apeiros>
you can also just store the block
<apeiros>
gizmore: and class_eval that at any time
kgirthofer has quit [Quit: Leaving]
arlek has quit [Ping timeout: 248 seconds]
edwinvdgraaf has quit [Remote host closed the connection]
niksrc has quit [Ping timeout: 260 seconds]
solars has joined #ruby
<gizmore>
apeiros: greetings... what i would need: class_eval(klass_name) do |klass| now i am inside klass / klass_name
jmarinelli has joined #ruby
jmarinelli is now known as yuung
<apeiros>
um, class_eval is klass.class_eval do … end
rubie has joined #ruby
<apeiros>
see Object.const_get and Module#class_eval
ramfjord has quit [Ping timeout: 246 seconds]
julieeharshaw has quit [Quit: ZZZZZzzzz]
kgirthofer has joined #ruby
moos3 has quit [Ping timeout: 276 seconds]
steffkes has quit [Ping timeout: 260 seconds]
<yuung>
i'm trying to use VCR in my rails app, and in the method i'm trying to test, i use Hash#transform_keys which is a Rails method. it seems that when i test with VCR, this method isn't added. how can i amend this?
julieeharshaw has joined #ruby
siaw has joined #ruby
edwinvdg_ has joined #ruby
nando293921 has quit [Ping timeout: 244 seconds]
<kaleido>
yuung: #rubyonrails
<kaleido>
they will have better answers
<gizmore>
apeiros: nvm... just was just a bug / typo :) ignore
yuung has quit [Read error: Connection reset by peer]
chipotle has quit [Ping timeout: 260 seconds]
skade has joined #ruby
roshanavand has quit [Quit: This computer has gone to sleep]
st0mar has quit [Ping timeout: 246 seconds]
uxp has quit [Read error: Connection reset by peer]
rubie has quit [Read error: Connection reset by peer]
uxp has joined #ruby
zast has joined #ruby
rubie has joined #ruby
kies has joined #ruby
DynamicMetaFlow has quit [Ping timeout: 244 seconds]
<cb>
Hi there, I am new to ruby and looking for an scheduler which i can manage from my Rails-Application. So that a User could change the Timings of certain Tasks. Any recommendations?
p1k has quit [Ping timeout: 248 seconds]
eregi has quit [Ping timeout: 248 seconds]
eregi has joined #ruby
Xiti has quit [Quit: Xiti]
momomomomo has joined #ruby
slash_join is now known as slash_nick
baweaver has quit [Ping timeout: 240 seconds]
Xiti has joined #ruby
yqt has joined #ruby
shanemcd_ has quit [Ping timeout: 276 seconds]
allcentury has quit [Quit: WeeChat 1.2]
ferr1 has quit [Quit: WeeChat 1.4]
dravine has joined #ruby
aeontech has joined #ruby
cwenner has joined #ruby
wilbert has joined #ruby
ldnunes has quit [Ping timeout: 268 seconds]
edwinvdg_ has quit [Read error: Connection reset by peer]
edwinvdgraaf has joined #ruby
evidex has quit [Ping timeout: 250 seconds]
Es0teric has joined #ruby
Abrin_AWAY has joined #ruby
dravine has quit [Quit: dravine]
dopie has joined #ruby
roshanavand has joined #ruby
dopie has quit [Client Quit]
amargherio has quit [Ping timeout: 240 seconds]
aeontech has quit [Ping timeout: 252 seconds]
ldnunes has joined #ruby
ramfjord has joined #ruby
aeontech has joined #ruby
mfaeh has quit []
nando294021 has joined #ruby
shadoi has joined #ruby
fostertheweb has joined #ruby
shanemcd_ has joined #ruby
Snowy has joined #ruby
neanderslob_ has quit [Quit: No Ping reply in 180 seconds.]
neanderslob_ has joined #ruby
infra-red has joined #ruby
x77686d has joined #ruby
B1n4r10 has quit [Ping timeout: 260 seconds]
aegis3121 has joined #ruby
al2o3-cr has quit [Ping timeout: 244 seconds]
vdamewood has joined #ruby
idefine has quit [Read error: Connection reset by peer]
st0mar has joined #ruby
idefine has joined #ruby
zast has quit [Remote host closed the connection]
thevaliantx has joined #ruby
shanemcd_ has quit [Ping timeout: 268 seconds]
infra-re_ has quit [Ping timeout: 248 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
haylon has quit [Read error: Connection reset by peer]
cyclonis has joined #ruby
jgpawletko has joined #ruby
f4cl3y has quit [Ping timeout: 276 seconds]
sauvin has quit [Read error: Connection reset by peer]
mdw has joined #ruby
trosborn has joined #ruby
TomyLobo has joined #ruby
mdw_ has joined #ruby
idefine_ has joined #ruby
idefine has quit [Read error: Connection reset by peer]
theery has joined #ruby
mdw has quit [Ping timeout: 276 seconds]
ta_ has joined #ruby
mdw_ is now known as mdw
momomomomo has quit [Quit: momomomomo]
infra-re_ has joined #ruby
momomomomo has joined #ruby
devbug has joined #ruby
idefine_ has quit [Remote host closed the connection]
idefine has joined #ruby
<kgirthofer>
hey all - new to developing ruby gems, I'm updating an old gem to start and I'd like to update some of the deps in Gemfile.lock - how do I update them? seems everytime I run bundler it overwrites
jottr has joined #ruby
infra-red has quit [Ping timeout: 244 seconds]
dcunit3d has joined #ruby
jenrzzz has joined #ruby
n008f4g_ has joined #ruby
peteyg has quit [Ping timeout: 244 seconds]
bronson has quit [Remote host closed the connection]
idefine has quit [Read error: Connection reset by peer]
idefine_ has joined #ruby
djbkd has joined #ruby
momomomomo has quit [Quit: momomomomo]
BtcBen has joined #ruby
mondok has joined #ruby
mallu has joined #ruby
<gizmore>
woho :) uncaught throw #<ActiveRecord::Magic::MissingDependency: ActiveRecord::Magic::Spec::User depends on {:"ActiveRecord::Magic::Gender"=>1}>
mallu has quit [Client Quit]
<gizmore>
now i simply can annotate update steps and depend on them :)
<gizmore>
stupid rails migrations are too bloated
baweaver has joined #ruby
<gizmore>
ActiveRecord::Magic also features a global object cache... where each row is always the same instance
<gizmore>
and it´s my first spec driven development project
shadoi has quit [Quit: Leaving.]
medicate has joined #ruby
aegis3121 has quit [Ping timeout: 246 seconds]
<gizmore>
helper classes for code reload at runtime. a logfile system that closes rarely used logfiles after a few minutes, and some more stuff i will depend my new ruby chatbot on \o/
<gizmore>
and a new proof that p == np
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
jottr_ has joined #ruby
shanemcd_ has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
idefine has joined #ruby
idefine_ has quit [Ping timeout: 244 seconds]
openstruct has joined #ruby
<xpt>
there is a proof that p == np already?
jottr has quit [Ping timeout: 276 seconds]
<xpt>
Someone else took mine 1 million dollars?
<cwenner>
/ignore gizmore
mary5030 has quit [Read error: Connection reset by peer]
roshanavand has quit [Quit: This computer has gone to sleep]
<aegis3121>
I lied about the matcher, sorry. I didn't realize until I wrote out the syntax.
<SaintAardvark>
Hi all -- I've got a Rakefile that does some jsonlinting on files, and I want that task to be run when I run "rake test". Is there a way to do this?
<Cohedrin>
and stub that request to return an erorr
<SaintAardvark>
so far the docs I've seen have been focused on running spec tests, which isn't what I'm after here
<aegis3121>
(or just stub whatever method it is to raise)
nerium has quit [Quit: nerium]
mondok has quit [Ping timeout: 276 seconds]
<yuung>
aegis3121, Cohedrin, hm - so i don't think i'll really be able to simulate the way i'd like. but i'll take what you said into consideration. thanks!
idefine has joined #ruby
idefine has quit [Remote host closed the connection]
<Ox0dea>
It's probably the case that your test task isn't actually the one being invoked there.
iooner has quit [Ping timeout: 268 seconds]
<SaintAardvark>
0x0dea: not sure I understand - are you saying that there's another test task somewhere that's being included somehow?
cyclonis has joined #ruby
<Ox0dea>
SaintAardvark: Well, given that you've defined your :test and :jsonlint tasks identically, that they don't behave identically is certainly suspicious.
<SaintAardvark>
yeah, couldn't figure that out...was wondering if 'test' was a special keyword for Rakefiles or some such
iooner has joined #ruby
<Ox0dea>
It's not; it's just a convention, but those can bite you too.
* SaintAardvark
just noticed that the nick is Ox0dea, not the other way around
<Ox0dea>
Leading digits aren't permitted here. :(
idefine has quit [Remote host closed the connection]
idefine has joined #ruby
robbyoconnor has joined #ruby
<SaintAardvark>
ok, managed to get around this by adding "task test: ['jsonlint']" to the Rakefile...that now invokes jsonlint, which barfs on a bad file
rmulligan has quit [Remote host closed the connection]
<Ox0dea>
Aye, that's what I suggested from the first. :P
skade has joined #ruby
cyclonis has quit [Ping timeout: 240 seconds]
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nb_bez___ has joined #ruby
mdw has quit [Ping timeout: 252 seconds]
saneax_AFK is now known as saneax
aeontech has joined #ruby
<SaintAardvark>
I need to pay more attention :-)
ta_ has quit [Read error: Connection reset by peer]
ta_ has joined #ruby
<Ox0dea>
Can't speak as to why jsonlint is barfing other than to suggest you're probably feeding it some not-JSON.
cdg has quit [Remote host closed the connection]
cyclonis has joined #ruby
cdg has joined #ruby
snockerton has joined #ruby
cdg_ has joined #ruby
<SaintAardvark>
ah, that was because I'd deliberately borked one of the json files in order to make sure I was catching errors
shanemcd has quit [Ping timeout: 240 seconds]
znz_jp has quit [Ping timeout: 248 seconds]
[Butch] has quit [Ping timeout: 244 seconds]
cdg has quit [Ping timeout: 240 seconds]
shanemcd has joined #ruby
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]