<platzhirsch>
If it has a state, it's not functional
<Ox0dea>
False.
<Ox0dea>
Programming is a subset of mathematics, not strictly equal to it.
riskish has joined #ruby
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nyon is now known as quater-nyon
chouhoulis has quit [Remote host closed the connection]
hinbody has quit [Quit: leaving]
<platzhirsch>
Well, I stand on that, I really don't mind. Even Haskell can't follow with this one completely through, especially when it comes to IO and usage of Monads, even they can't avoid introducing a state
tiagonobre has quit [Quit: Connection closed for inactivity]
<Ox0dea>
platzhirsch: You stand on what? That truly functional programs should just make the machine run a little hotter?
<platzhirsch>
You can call it false and put emphasis on it by ending it with a period . ;) but these are my definitions, I learned them this way in my studies, if you can point me to some thorough definitions that say otherwise, be my guest
<Ox0dea>
> put emphasis on it by ending it with a period
<platzhirsch>
What's wrong now?
<Ox0dea>
It's rather tragic how quickly that interpretation has managed to spread.
<Ox0dea>
Proplery ending sentences is now passive-aggressive.
<Ox0dea>
*Properly
<platzhirsch>
so tragic, fills me with sorrow every morning
RegulationD has joined #ruby
<Ox0dea>
>> make_adder = -> n { -> x { n + x } }; add3 = make_adder[3]; add3[2]
<Ox0dea>
(Virtually) any object can have a #[] method.
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
baweaver has quit [Remote host closed the connection]
slackbotgz has quit [Remote host closed the connection]
<cyrus_mc>
Ox0dea: I figured something like this .. but in the class I posted above I don't see it referencing this library (woudln't it need to include/require it or inherit this class or create an instance of that class to access it)
<cyrus_mc>
doh .. just saw it
<cyrus_mc>
never mind
lxsameer has quit [Quit: Leaving]
<Ox0dea>
cyrus_mc: Not your fault; it was tucked away a bit.
<cyrus_mc>
it was
robinboening has quit [Quit: robinboening]
bigmac has quit [Ping timeout: 240 seconds]
ngscheurich has quit [Ping timeout: 264 seconds]
tkuchiki has joined #ruby
<platzhirsch>
But I never denied that Ruby doesn't incorporate functional programming aspects, I only said if it has a state it's not functional. That's why only add3 is functional, embedded in an imperative environment which relies on objects, states and order of execution
<Ox0dea>
platzhirsch: I'm not sure I follow. You've conceded that `add3` is both functional and that it has state, which is a contradiction of your own terms.
mary5030 has quit [Remote host closed the connection]
mary5030 has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
michael_mbp has quit [Excess Flood]
pengin has quit [Remote host closed the connection]
ramfjord has joined #ruby
howdoico1 has joined #ruby
tkuchiki has quit [Ping timeout: 240 seconds]
cajone has quit [Read error: Connection reset by peer]
<platzhirsch>
sigh, the definition of add3 is functional, add3 itself is still an object
devoldmx has joined #ruby
tuxero has quit [Quit: tuxero]
evanjs has joined #ruby
quater-nyon is now known as hamilto-nyan
mary5030 has quit [Ping timeout: 240 seconds]
<Ox0dea>
platzhirsch: Then my initial question stands. Why isn't `add3` itself functional?
<Ox0dea>
How does it violate the mathematical definition?
workmad3 has joined #ruby
solocshaw has quit [Read error: Connection reset by peer]
michael_mbp has joined #ruby
solocshaw has joined #ruby
Adran has left #ruby [#ruby]
Ropeney has joined #ruby
allcentury has joined #ruby
benlovell has joined #ruby
<Ox0dea>
(Spoiler alert: it doesn't.)
hamilto-nyan has quit [Quit: F...ix you, Emacs!!!]
quater-nyon has joined #ruby
tkuchiki has joined #ruby
<platzhirsch>
Because it depends on side-effects, it's not enough to just declare it. The function exists within the scope of an object, it needs that, in order to be invoked you have to make it part of a code that is executed in a procedural way
Igorshp has joined #ruby
<Ox0dea>
platzhirsch: You've got it backwards. It's the "scope" that exists within the "function", so to speak.
devoldmx has quit [Ping timeout: 272 seconds]
j4cknewt_ has quit [Read error: Connection reset by peer]
j4cknewt has joined #ruby
<platzhirsch>
If the order of execution doesn't matter, it's functional, but here the order is crucial so we get a result
bronson has quit [Remote host closed the connection]
giuseppesolinas has joined #ruby
giuseppesolinas_ has joined #ruby
casadei_ has joined #ruby
EllisTAA has quit [Quit: EllisTAA]
workmad3 has quit [Ping timeout: 252 seconds]
Igorshp has quit [Remote host closed the connection]
paulcsmith has joined #ruby
<Ox0dea>
platzhirsch: The division "function" relies on some definition of "predecessor"; does that mean division isn't functional?
<platzhirsch>
For me it would be strictly functional, if once declared and bound to it's name, it cannot be changed, because there is no order, no change possible, it's just declared as it is and that's the only thing that matters. The example is imperative, because all it's part have a state, that depend on each other, variable assignment, invoking the objects by sending methods to them here [](3)
tatsuo has joined #ruby
benlovell has quit [Ping timeout: 255 seconds]
<Ox0dea>
You're using a lot of words to say almost nothing of consequence.
tkuchiki has quit [Remote host closed the connection]
opensource_ninja has quit [Quit: opensource_ninja]
<platzhirsch>
You're talking about mathematical functions, where as I am talking about the functional programming paradigm
<platzhirsch>
I guess that's where most of the confusion comes from
<Ox0dea>
platzhirsch: It was you who initially declared that programs can't be functional in the mathematical sense.
<Ox0dea>
Because state.
Wolland has quit []
asdasdas has joined #ruby
<pipework>
Ooh nerd-off!
* pipework
grabs the popcorn
<platzhirsch>
Exactly
jenrzzz has quit [Ping timeout: 250 seconds]
casadei_ has quit [Ping timeout: 264 seconds]
blackmesa has joined #ruby
rezzack has joined #ruby
<platzhirsch>
Ox0dea: Listen, you're absolutely right. I think you have very well demonstrated how smart you are, I mean that was the point of this whole discussion, who can outsmart who with his definitions, pretty mindless. But I am not too put off, at least it made me go through my old uni notes and read up again about how we defined that stuff, still love it
asdasdas has left #ruby [#ruby]
<Ox0dea>
Ad hominem means you lose, bud.
d5sx43 has joined #ruby
d5sx43 has quit [Client Quit]
skweek has joined #ruby
skweek has quit [Remote host closed the connection]
ledestin has joined #ruby
marr has quit [Ping timeout: 250 seconds]
<platzhirsch>
This basically screams for a Hitler comparison, just to make the Internet laugh
<platzhirsch>
Yes Ox0dea, you won the argument
<platzhirsch>
on the Internet
evanjs has quit [Remote host closed the connection]
<Ox0dea>
platzhirsch: But you learned something!
<Ox0dea>
What a foolish thing about which to be butthurt.
<platzhirsch>
You write very inflammatory
bmurt has joined #ruby
blackmesa has quit [Ping timeout: 264 seconds]
cajone has joined #ruby
<Ox0dea>
Offense cannot be given.
baweaver has joined #ruby
zenspider has joined #ruby
atomical has joined #ruby
<zenspider>
can I get someone to ping envy.zenspider.com ??
<platzhirsch>
sure dude
<platzhirsch>
doesn't pong much
<zenspider>
looks down, but I'm on shitty SF wireless
<zenspider>
much, or at all?
bricker has quit [Ping timeout: 244 seconds]
FernandoBasso has quit [Quit: WeeChat 1.3]
<zenspider>
actually, the fact that my proxy isn't holding "zenspider" here, means it's dead. how is it that it ONLY goes out when I trevel? I how does it know?
redondo has quit [Ping timeout: 264 seconds]
j4cknewt has quit [Read error: Connection reset by peer]
<platzhirsch>
Hope it's not on a Raspberry Pi ;)
<jhass>
well, comcast
<jhass>
not too surprised I guess :P
vdamewood has joined #ruby
<zenspider>
that was the next plan... call in and see if it is them or me
<jhass>
I do get pretty far into their network though
<zenspider>
cable is up. host is down. comcast business support can barely understand "ping" so... *shrug*
cantaberry has quit [Ping timeout: 260 seconds]
workmad3 has joined #ruby
yfeldblum has quit [Ping timeout: 240 seconds]
wallerdev has quit [Quit: wallerdev]
<zenspider>
argh. luckily my neighbors have a key
wildlander has quit [Quit: Saliendo]
sharkman has quit [Quit: Leaving]
<zenspider>
ah. neighborhood lost power... my UPS may have stayed off
<craysiii>
not a very good UPS :P
tatsuo has quit [Remote host closed the connection]
<zenspider>
well... it can signal to the box to shutdown cleanly because it is running out. In those cases, I don't think the server comes back up when power is restored
<drbrain>
it's been out for an hour or two now over there
<zenspider>
tho, maybe I should have a scheduled "on" time, so it'll always recover if I just wait it out
<zenspider>
drbrain: about as long as I've been trying to use shitty SF cafe networks. :)
j4cknewt has quit [Read error: Connection reset by peer]
giuseppesolinas_ has quit [Quit: This computer has gone to sleep]
giuseppesolinas has quit [Quit: This computer has gone to sleep]
<zenspider>
yeah. it's been restored, server jsut didn't come back up
<zenspider>
I really should move it offsite so I can switch to fiber
towski_ has quit [Remote host closed the connection]
karapetyan has joined #ruby
drewvanstone has joined #ruby
maletor has quit []
<zenspider>
welp... guess I'm not releasing minitest today :)
dravine has joined #ruby
casadei_ has joined #ruby
renancarvalho has joined #ruby
rattatmatt has joined #ruby
jobewan has quit [Quit: Leaving]
Technodrome has quit [Quit: Technodrome]
karapetyan has quit [Ping timeout: 240 seconds]
RobertBirnie has joined #ruby
workmad3 has joined #ruby
roxtrongo has quit [Ping timeout: 244 seconds]
drewvanstone has quit [Ping timeout: 255 seconds]
tatsuo has quit [Remote host closed the connection]
<zenspider>
hrm... should be back up :/
Kricir has joined #ruby
<platzhirsch>
Any suggestions for this code to write it either shorter or more understandable? https://gist.github.com/platzhirsch/41326d2df2dd631470ce Personally I'd just hack it in one line, but that won't help others really understand what's going on. It basically padds up a certain number with zeros if there are not enough and converts the number to a base 36
tatsuo has joined #ruby
Kricir has quit [Read error: Connection reset by peer]
Kricir has joined #ruby
jackjackdripper has quit [Ping timeout: 256 seconds]
Narzew has quit [Remote host closed the connection]
eat_multi has joined #ruby
<ICantCook>
yes
bronson has quit [Remote host closed the connection]
michael_mbp has quit [Excess Flood]
swgillespie has joined #ruby
michael_mbp has joined #ruby
tjbiddle has joined #ruby
solocshaw has quit [Ping timeout: 240 seconds]
aghalarp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<beauby>
centrx: how about doing `def g; yield; end; def f; g do yield; end; end`, will the implicit block be resolved in f or in g?
benlovell has joined #ruby
dorei has quit []
workmad3 has joined #ruby
agent_white has joined #ruby
agent_white has quit [Client Quit]
benlovell has quit [Ping timeout: 240 seconds]
ddrmanxbxfr has joined #ruby
freerobby1 has quit [Quit: Leaving.]
jimmybomb1 has joined #ruby
<jimmybomb1>
hey guys, im developing a web api and im having a debate with my colleagues whether we should put guid in our 'GET' urls.. do you guys think this is a smell? if it is what are the alternatives to put in get urls (assuming that all our resources already have guid assigned to them as their id)?
crdpink2 has quit [Ping timeout: 240 seconds]
workmad3 has quit [Ping timeout: 268 seconds]
crdpink2 has joined #ruby
<beauby>
jimmybomb1: This question is probably more suited to #rubyonrails, or a more general purpose webdev channel
<jimmybomb1>
alright thanks
wldcordeiro has joined #ruby
dopamean_ has joined #ruby
meatherly has quit []
rezzack has quit [Ping timeout: 240 seconds]
jimmybomb1 has quit [Quit: Leaving]
crdpink has joined #ruby
devoldmx has joined #ruby
bruno- has joined #ruby
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
stardiviner has quit [Ping timeout: 268 seconds]
wldcordeiro has quit [Ping timeout: 240 seconds]
crdpink2 has quit [Ping timeout: 260 seconds]
crdpink has quit [Ping timeout: 240 seconds]
pontiki has joined #ruby
Rodya_ has quit [Remote host closed the connection]
devoldmx has quit [Ping timeout: 264 seconds]
<Ox0dea>
>> def g; yield; end; def f; g do yield; end; end; f { caller[0, 3] } # beauby
<ruboto>
Ox0dea # => ["/tmp/execpad-3ef329ea5a54/source-3ef329ea5a54:2:in `block in f'", "/tmp/execpad-3ef329ea5a54/sourc ...check link for more (https://eval.in/437821)
bruno- has quit [Ping timeout: 250 seconds]
<Ox0dea>
Dammit. I forgot that'd be so ugly.
cantaberry has joined #ruby
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
crdpink has joined #ruby
<jt__>
is "Class#method" is just a convention but no actual meaning? I notice on rails route there is this 'class#method'
<Ox0dea>
jt__: Right, it's just notational convention for instance methods.
pontiki has quit [Client Quit]
crdpink has quit [Client Quit]
crdpink has joined #ruby
<jt__>
how about the former the one on rails route? e.g get 'link' => 'link#new'
ryez has joined #ruby
howdoico1 has quit [Ping timeout: 264 seconds]
aghalarp has joined #ruby
<Ox0dea>
jt__: Same meaning, for all intensive porpoises.
scoot has joined #ruby
<jt__>
ok, thanks
<beauby>
>> class A; def self.a(&block); Class.new do block.call; end; end; class B < A; a do p self; end; # Ox0dea
<ruboto>
beauby # => /tmp/execpad-3df07b561a1f/source-3df07b561a1f:7: syntax error, unexpected end-of-input, expecting ke ...check link for more (https://eval.in/437822)
<beauby>
>> class A; def self.a(&block); Class.new do block.call; end; end; end; class B < A; a do p self; end; # Ox0dea
<ruboto>
beauby # => /tmp/execpad-35c10e772dae/source-35c10e772dae:7: syntax error, unexpected end-of-input, expecting ke ...check link for more (https://eval.in/437823)
<Ox0dea>
beauby: One more. :P
<beauby>
Damn, sorry, I have to get better at one-lining ruby
<beauby>
>> class A; def self.a(&block); Class.new do block.call; end; end; end; class B < A; a do p self; end; end; # Ox0dea
<beauby>
And that's what I nailed my issue down to
<beauby>
I want `self` to be that of `Class.new` here
<beauby>
I had some hope it would be some implicit blocks limitation when I started with yield, but it seems to make no difference
meatherly has quit [Ping timeout: 252 seconds]
stardiviner has joined #ruby
aghalarp has quit [Ping timeout: 256 seconds]
<Ox0dea>
beauby: Are you sure you want to call the block and have that be the body of the class?
<beauby>
Ox0dea: yes I am
<Ox0dea>
beauby: I'm pretty sure #instance_eval could be finagled into doing your monstrous bidding.
tejasmanohar has quit [Ping timeout: 256 seconds]
tejasmanohar has joined #ruby
<beauby>
Ox0dea: Thanks, I'll look that up. Basically what I'd like to achieve is, inside a class `B < A`, having a class method from `A`, let's say `implicit_define_class` called like `implicit_define_class do ... end`, that would actually create a class inside `A`, with body what's provided in the given block
aghalarp has joined #ruby
jackjackdripper1 has quit [Quit: Leaving.]
<beauby>
>> class A; def self.a(&block); Class.new.instance_eval do block.call; end; end; end; class B < A; a do p self; end; end; # Ox0dea
Xeago has quit [Read error: Connection reset by peer]
jgt has joined #ruby
Technodrome has quit [Quit: Technodrome]
vjdhama has quit [Read error: Connection reset by peer]
SCHAAP137 has joined #ruby
<shevy>
the picture looks so fake
mdih has quit [Ping timeout: 246 seconds]
michael_mbp has quit [Excess Flood]
<bnagy>
Ox0dea: ha. That regex is the same as using sub but I don't use crazy perl globals :)
<KervyN>
like every selfy
<shevy>
nah
<bnagy>
the $' is cute though, I didn't know that one
firstdayonthejob has quit [Ping timeout: 272 seconds]
ruurd has quit [Quit: ZZZzzz…]
* bnagy
saves up for golf
jenrzzz has joined #ruby
bigbadbear has quit [Ping timeout: 268 seconds]
scoot has quit [Remote host closed the connection]
michael_mbp has joined #ruby
sabrehagen has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<sabrehagen>
i've never use a ruby gem before. i just typed `gem install pdf-extract` which succeeded, now typing `pdf-extract` as per the docs yeilds "command not found". how do i use the gem? (https://github.com/CrossRef/pdfextract)
<ruboto>
apeiros # => no implicit conversion of #<Class:0x4112fee4> into Array (TypeError) ...check link for more (https://eval.in/438048)
tkuchiki has joined #ruby
<apeiros>
ljarvis: where did you see differences appear?
davedev24 has joined #ruby
avelldiroll has quit [Quit: WeeChat 0.3.8]
beast has joined #ruby
michael_mbp has quit [Excess Flood]
tjbiddle has joined #ruby
tvw has joined #ruby
amystephen has joined #ruby
platzhirsch has quit [Ping timeout: 255 seconds]
Xeago has quit [Remote host closed the connection]
UtkarshRay has joined #ruby
michael_mbp has joined #ruby
tkuchiki has quit [Ping timeout: 240 seconds]
Xeago has joined #ruby
rikkipitt has joined #ruby
pocketprotector has quit [Ping timeout: 240 seconds]
avelldiroll has joined #ruby
amystephen has quit [Ping timeout: 250 seconds]
leafybasil has joined #ruby
leafybas_ has joined #ruby
Iskarlar has joined #ruby
leafybasil has quit [Read error: Connection reset by peer]
ndrei has quit [Ping timeout: 240 seconds]
sheepman has joined #ruby
platzhirsch has joined #ruby
<sheepman>
hi all, whats the best way of getting the pid of a running process (i.e. not the pid of the ruby script thats running) ?
benlovell has quit [Ping timeout: 250 seconds]
devoldmx has joined #ruby
stan has joined #ruby
SylarRuby has quit [Remote host closed the connection]
pecpec has quit [Remote host closed the connection]
<adaedra>
A process you started? A random process on the system?
benlovell has joined #ruby
Iskarlar has left #ruby [#ruby]
<sheepman>
Random process
blackmesa has joined #ruby
<sheepman>
looks like sys-proctable to me but i was hoping for something simpler as in, without pulling in an additional gem
<certainty>
pgrep -f
<certainty>
depends on what you know about the process
<certainty>
also /proc is pretty accessible
keksi_ has joined #ruby
sepp2k has joined #ruby
<sheepman>
certainty, i guess pgrep will work for me
arup_r has quit [Remote host closed the connection]
<sheepman>
just wanted to stick inside ruby but meh :)
devoldmx has quit [Ping timeout: 246 seconds]
<keksi_>
hey, im using rbenv for handling my ruby versions. rbenv says that I only have 2.2.1 installed, but ruby -v says its using 2.0. So I think I have a random v. 2.0 installed, which I want to get rid of, what do?
<certainty>
i'm curious if there's a way without forking a shell. I'm not aware of a way (without gems)
<certainty>
reading information from /proc is perfectly possible though
<sheepman>
ok thanks certainty
ruurd has quit [Quit: ZZZzzz…]
tjbiddle has quit [Ping timeout: 240 seconds]
rikkipitt has quit [Quit: Leaving...]
startupality has quit [Quit: startupality]
ndrei has joined #ruby
blaxter has joined #ruby
benlovell has quit [Ping timeout: 260 seconds]
bronson has joined #ruby
yfeldblu_ has quit [Ping timeout: 256 seconds]
pocketprotector has joined #ruby
iamninja_ has joined #ruby
karapetyan has quit [Read error: Connection reset by peer]
karapetyan has joined #ruby
tjbiddle has joined #ruby
benlovell has joined #ruby
tjbiddle has quit [Remote host closed the connection]
iamninja has quit [Read error: Connection reset by peer]
solocshaw has joined #ruby
Kendos-Kenlen has joined #ruby
ndrei has quit [Ping timeout: 246 seconds]
solocshaw has quit [Remote host closed the connection]
solocshaw has joined #ruby
dravine has quit [Read error: Connection reset by peer]
dravine has joined #ruby
ndrei has joined #ruby
bronson has quit [Ping timeout: 268 seconds]
pecpec has joined #ruby
startupality has joined #ruby
j4cknewt has quit [Remote host closed the connection]
leafybas_ has quit [Read error: Connection reset by peer]
BackEndCoder has quit [Ping timeout: 246 seconds]
leafybasil has joined #ruby
arup_r has joined #ruby
arup_r has quit [Remote host closed the connection]
startupality has quit [Quit: startupality]
duncannz has quit [Ping timeout: 255 seconds]
ndrei has quit [Ping timeout: 272 seconds]
diegoviola has quit [Quit: WeeChat 1.3]
lolmaus has joined #ruby
<ljarvis>
apeiros: I'm not sure now actually, moved on. Maybe there wasn't a difference, I found it odd that to_h didn't work like to_hash in that situation but actually it seems quite consistent
jenrzzz has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
startupality has joined #ruby
davedev24 has quit []
krz has quit [Ping timeout: 264 seconds]
jenrzzz has quit [Ping timeout: 244 seconds]
<yorickpeterse>
ljarvis: wow, you're back
BackEndCoder has joined #ruby
Burgestrand has quit []
Timba-as has joined #ruby
renderful has joined #ruby
emilkarl has quit [Quit: emilkarl]
arup_r has joined #ruby
hs366 has joined #ruby
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
j4cknewt has quit [Remote host closed the connection]
leat has joined #ruby
apt-get has joined #ruby
Phil-Work has joined #ruby
<Phil-Work>
can someone tell me what this code does? Struggling to Google as I have no idea what kind of programming structure it is...
<Phil-Work>
b1.use Call, UploadIsoFile do |env2, b2|
<Phil-Work>
... some code ...
<Phil-Work>
end
mattprelude has joined #ruby
j4cknewt has joined #ruby
<canton7>
execute the method 'b1.use', passing in the parameters Call and UploadIsoFile (which looks like they're classes). Also pass in an anonymous function, which takes the parameters env2 and b2, and may or may not return something...
karapetyan has quit [Remote host closed the connection]
michael_mbp has quit [Excess Flood]
emilkarl has joined #ruby
<Phil-Work>
canton7, so... what relevance does it have as a control structure?
<Phil-Work>
in what instance will the "some code" execute?
Siyfion has joined #ruby
<Phil-Work>
if b1.use returns something trueish?
<canton7>
'some code' is an anonymous function, which is passed to 'b1.use'. It will execute if and when the code in 'b1.use' executes it
<jhass>
Phil-Work: it's passed to b1.use, which can call it or store it for calling it later
<Phil-Work>
ah, ok
<Phil-Work>
I see now
<Phil-Work>
b1 is presumably an object?
<Phil-Work>
how do I see what it is an instance of so I can find "use"?
<canton7>
probably. it may be a local method which returns an object, but it's probably an object :P
vivcheri has joined #ruby
<canton7>
'p b1'
<canton7>
or 'puts b1.class'
dhjondoh has quit [Remote host closed the connection]
<Phil-Work>
"Vagrant::Action::Builder"
<Phil-Work>
excellent - thanks
<Phil-Work>
gives me something to go on
rodfersou has joined #ruby
dhjondoh has joined #ruby
<vivcheri>
Hi, I am trying a vagrant installation of bosh-lite and I am getting the following error http://paste.ubuntu.com/12530122/
<vivcheri>
How do I resolve this ?
Kariel has joined #ruby
<Kariel>
Hi everyone.
moeabdol has joined #ruby
cajone has quit [Quit: Leaving.]
<jhass>
vivcheri: do you see a Gemfile?
blackmesa has quit [Ping timeout: 250 seconds]
michael_mbp has joined #ruby
dionysus69 has joined #ruby
allomov has joined #ruby
<vivcheri>
jhass: Iam new to ruby
<vivcheri>
jhass: Do you mean to_specs ?
<jhass>
no I mean whether you see a file called "Gemfile"
tomphp has quit [Read error: Connection reset by peer]
<vivcheri>
re-running the bosh target 192.168.50.4 lite
Cysioland has joined #ruby
<vivcheri>
jhass: It works now
<Cysioland>
Is there a gem that converts something like '1h10m30s' to seconds?
<jhass>
Cysioland: chronic_duration or so
<vivcheri>
jhass: Thanks a lot
<vivcheri>
I am logged into the bosh director.
<jhass>
no idea what went wrong there
<jhass>
probably fixed in a less ancient rubygems version than what Ruby 1.9/Ubuntu ships
blackmesa has quit [Ping timeout: 252 seconds]
tomphp has quit [Ping timeout: 250 seconds]
shredding has quit [Ping timeout: 272 seconds]
pecpec has quit [Remote host closed the connection]
tomphp has joined #ruby
<shevy>
hehe
Burgestrand has joined #ruby
<Cysioland>
jhass++
<Cysioland>
thank mr jhass
<Cysioland>
bye
Cysioland has left #ruby ["thank mr jhass"]
blackmesa has joined #ruby
sdothum has joined #ruby
phutchins2 has joined #ruby
diegoviola has joined #ruby
ndrei has joined #ruby
bruno- has joined #ruby
unop has quit [Ping timeout: 240 seconds]
FernandoBasso has joined #ruby
workmad3 has joined #ruby
blackmesa has quit [Ping timeout: 252 seconds]
bronson has joined #ruby
phutchins2 has quit [Read error: No route to host]
eGGsha has joined #ruby
[k- has joined #ruby
patientj has left #ruby ["WeeChat 1.0.1"]
workmad3 has quit [Ping timeout: 250 seconds]
bronson has quit [Ping timeout: 256 seconds]
tvw has quit [Remote host closed the connection]
krz has joined #ruby
r00ster has joined #ruby
Salehi has quit [Quit: Leaving]
greenarrow has quit [Quit: 500]
minimalism has quit [Quit: leaving]
<vivcheri>
jhass: Are you still there ?
tvw has joined #ruby
<yorickpeterse>
jhass: oooh, I see you've been promoted to Mr now
<matti>
yorickpeterse: ;]
<yorickpeterse>
(っ´ω`)っ
<matti>
Haha
<matti>
:)
<vivcheri>
jhass: I am asked to add a route on step 4 in the bosh lite documentation.
<vivcheri>
Wondering what route is he meaning ?
<jhass>
doesn't the readme or other docs explain?
<jhass>
I never even saw that stuff before either
<matti>
Mr Hass.
<matti>
Souds very official.
<apeiros>
mr zyx
<vivcheri>
jhass: No
Technodrome has quit [Quit: Technodrome]
<yorickpeterse>
but so who will be the other Mr or Mrs jhass? :>
<matti>
Hey apeiros
<apeiros>
oy matti
<matti>
Oh pardon me. Mr apeiros :)
<vivcheri>
There is a add-route binary in the bin folder under the bosh-lite binary
<apeiros>
matti: I prefer deity
<matti>
Hehe
<matti>
apeiros-sama?
<matti>
:)
<apeiros>
or actually… proto-deity
<yorickpeterse>
apeiros-senpai
<jhass>
vivcheri: so run it?
<jhass>
?apeiros
<ruboto>
apeiros is nobody. They're one of the four people with founders access in the #ruby channel, owner of ruboto the channel bot and ruby-community.com the companion website for the #ruby channel
<jhass>
nobody doesn't need any titles
Ryzokuken has joined #ruby
<vivcheri>
jhass: done.
<Ryzokuken>
Hey
<Ryzokuken>
Anyone up?
<Ryzokuken>
I had a little problem
<Ryzokuken>
Could you help?
<jhass>
?ask
<ruboto>
Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
<Ryzokuken>
I wanted to serialize an array of objects
<Ryzokuken>
How could I achieve that?
<yorickpeterse>
Serialize to what?
allcentury has joined #ruby
<Ryzokuken>
String
<Ryzokuken>
Binary
nuck has quit [Read error: Connection reset by peer]
<absklb>
i installed bundler 1.10.6 and my canvas lms script cant fint it. it complains that i have old version of bundler. but gem list b shows it at 1.10.6 which is needed by canvas
andyrs has quit [Quit: gone to sleep. ZZZzzz…]
andyrs has joined #ruby
Tempesta has quit [Client Quit]
karapetyan has joined #ruby
Tempesta has joined #ruby
dstarh has joined #ruby
Igorshp has quit [Remote host closed the connection]
<r0x0rZ>
yorickpeterse: works like a charm now. thank you!
<ljarvis>
yorickpeterse: no, had lots of trouble the last few weeks. We exchange contracts a few months ago but it was still being built. We move in this weekend
<Ryzokuken>
Because wherever it is, its not called
elperdut has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<yorickpeterse>
Ryzokuken: ........
<Ryzokuken>
It worked
<yorickpeterse>
"use p"
<yorickpeterse>
"I used alert"
<yorickpeterse>
I'm done
<ljarvis>
yorickpeterse: jesus that upload.. glorious
<yorickpeterse>
You're on your own
* certainty
admires yorickpeterse for his patience
<tobiasvl>
Ryzokuken: and when you used p, what did it output?
bronson has joined #ruby
<sabrehagen>
using jquery's html function as a setter (http://api.jquery.com/html/) with html that contains the string '\text' converts the \t to a tab. how do i make it not interpret escaped characters?
<Ryzokuken>
Sorry :(
pyoor has joined #ruby
gurix has joined #ruby
<ljarvis>
sabrehagen: this is #ruby
<yorickpeterse>
ljarvis: it really helps uploading cat pictures
<ljarvis>
that is not Ruby
Kallis has joined #ruby
<Ryzokuken>
P is not outputting anything
<sabrehagen>
ljarvis: wow sorry, new irc client and confused the channel :)
<Ryzokuken>
Nothing shootsup
drewvanstone has quit [Ping timeout: 264 seconds]
<Ryzokuken>
No p
<Ryzokuken>
No kernel.p
<Ryzokuken>
Nothing
<Ryzokuken>
+ I'm sorry
elperdut has joined #ruby
s2013 has joined #ruby
<ljarvis>
sabrehagen: no worries :)
<Ryzokuken>
Forgive me
<pyoor>
what is the safest way to include a variable in a string? I'm currently using "foo #{bar}" but special characters in bar is causing the string to be truncated.
<Ryzokuken>
Help me figure out
<ljarvis>
pyoor: what kind of special characters?
<Ryzokuken>
yorickpeterse: pls?
<ljarvis>
Ryzokuken: please stop hitting return so often. You can type many things on a single line
kies^ has quit [Ping timeout: 246 seconds]
<pyoor>
ljarvis \' - I'm calling a string as part of a regex
<pyoor>
My regex is - data = data.sub(/<head.*?>/im, "\\0\n<script type='text/javascript'>\n#{foo}\n</script>")
slayerja_ has quit [Read error: Connection reset by peer]
<ljarvis>
pyoor: I don't understand what you want exactly, but if it's a regexp maybe you want Regexp.escape
<yorickpeterse>
Ryzokuken: No, I have work to get done
RegulationD has quit [Ping timeout: 255 seconds]
<Ryzokuken>
:(
<pyoor>
ljarvis: this is part of the replace string
<ljarvis>
pyoor: then I don't understand the problem
slayerjain has joined #ruby
<yorickpeterse>
haha, somebody is trying to parse JS with regex it seems
<imperator>
uri question. if I have "http://myaccount.blob.core.windows.net", and I call URI.parse on it to get a uri object, is there a method to just get "myaccount"? Or am I just supposed to split the host manually?
thejoecarroll has joined #ruby
* imperator
is dealing with "canonical urls"
nhhagen has quit [Remote host closed the connection]
davidt has quit [Quit: Leaving]
stardiviner has quit [Ping timeout: 268 seconds]
<absklb>
anyone using canvas lms here?
bigbadbear has joined #ruby
<jhass>
imperator: URI doesn't specify a decomposition for authority I think
<jhass>
so yeah, split
Kallis has quit [Read error: Connection reset by peer]
alveric has joined #ruby
<imperator>
jhass, thanks
<imperator>
wonder if Addressable does
hinbody has joined #ruby
Evanescence has joined #ruby
teclator has quit [Quit: leaving]
<jhass>
highly doubt it
Xeago_ has quit [Remote host closed the connection]
<jhass>
an URI doesn't care too much about the structure of it
InternetFriend has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<imperator>
ok, thanks, figured that but thought I'd ask
voltalio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Coraline>
absklb: what do you need to know about Canvas?
timanema has quit [Quit: leaving]
leafybasil has quit [Ping timeout: 252 seconds]
startupality has quit [Quit: startupality]
RegulationD has quit [Ping timeout: 264 seconds]
rbennacer has joined #ruby
* imperator
grumbles about the Hash.new constructor
kies^ has joined #ruby
bronson has quit [Ping timeout: 250 seconds]
weemsledeux has joined #ruby
<absklb>
Coraline, it was giving me error regarding one mocha.git repo on git hub. it said me to do bundle install to check it out. i did. still same error. but now i after many tries i diid bundle update and now finally it is getting that repo!
<absklb>
Coraline, still not solved though. can use your help if you are free.
<jhass>
?anyone absklb
<ruboto>
absklb, Just ask your question, if anyone has or can, they will respond.
* absklb
knows.
<Coraline>
What's not solved? It sounds like it works now?
<absklb>
he repilied and my next reply is going to take time due to bundle update in progress hence....
<absklb>
Coraline, i will know once this bundle update fiinishes
<Coraline>
She
spcmastertim has joined #ruby
Xeago has joined #ruby
auzty has quit [Quit: Leaving]
<shevy>
he reptilied?
<jhass>
don't you know we're ruled by reptiloids?
<absklb>
:-)
<shevy>
I was an eye witness when dinosaurs were programming!
startupality has joined #ruby
nopc0de is now known as j2k
<Burgestrand>
And then the great refactor, now no more dinosaurs.
<shevy>
yeah
<imperator>
and then.....someone used a goto statement
<imperator>
adios programming dinosaurs
ruurd has quit [Quit: ZZZzzz…]
workmad3 has joined #ruby
tenderlove has quit [Remote host closed the connection]
tenderlove has joined #ruby
tenderlove has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
youngbaks has joined #ruby
tenderlove has joined #ruby
leafybasil has joined #ruby
j2k is now known as j2k_
nolic has joined #ruby
NeverDie has joined #ruby
voltalio has joined #ruby
leafybas_ has joined #ruby
leafybasil has quit [Read error: Connection reset by peer]
krz has joined #ruby
polysics has joined #ruby
blackmesa has quit [Ping timeout: 264 seconds]
hs366 has quit [Read error: Connection reset by peer]
<absklb>
libxml2 is missing. is that to be installed by gem or os?
<Coraline>
OS
workmad3 has quit [Ping timeout: 264 seconds]
<absklb>
ok
polysics has quit [Client Quit]
<absklb>
I did sudo apt-get install ruby-libxml libxml2 libxml2-dev and still get error for libxml in canvas bundle update?
<absklb>
whats wrong?
ragingcake has quit [Ping timeout: 240 seconds]
ryze has quit [Quit: Leaving]
bluOxigen has quit []
<absklb>
so it says nokogiri needs its own libxml not random by os.
<absklb>
but i can make it use os one. shall i?
bluOxigen has joined #ruby
<apt-get>
absklb: the easiest way might be to "gem install nokogiri"
<absklb>
i think its already installed. its now trying to update
<absklb>
let me try though
<yorickpeterse>
hihi, nokogiri
<absklb>
??
marvin81 has quit []
<havenwood>
yorickpeterse: I was just thinking of Oga.
<yorickpeterse>
havenwood: how romantic
<yorickpeterse>
havenwood: Oga also thinks a lot about you
* havenwood
cries a single tear
<yorickpeterse>
(͡° ͜ʖ ͡°)
ruurd has joined #ruby
devoldmx has joined #ruby
axl_ has joined #ruby
vjdhama has quit [Read error: Connection reset by peer]
Evanescence has quit [Ping timeout: 252 seconds]
Evanescence has joined #ruby
MVPhelp has quit [Remote host closed the connection]
slayerja_ has joined #ruby
dionysus69 has quit [Ping timeout: 256 seconds]
devoldmx has quit [Ping timeout: 268 seconds]
Technodrome has joined #ruby
EllisTAA has joined #ruby
rbennacer has quit [Remote host closed the connection]
InternetFriend has joined #ruby
tkuchiki has quit [Remote host closed the connection]
rbennacer has joined #ruby
tatsuo has quit [Quit: Leaving...]
slayerjain has quit [Ping timeout: 272 seconds]
gurix has joined #ruby
tkuchiki has joined #ruby
asxbr has quit [Ping timeout: 246 seconds]
drptbl_ has quit [Quit: My MAC has gone to sleep. zZz..]
ragingcake has joined #ruby
p0wn3d__ has quit [Ping timeout: 260 seconds]
dopamean_ has joined #ruby
chthon has quit [Ping timeout: 244 seconds]
rbennacer has quit [Remote host closed the connection]
<shevy>
you nerds!
banister has joined #ruby
<adaedra>
no u
rbennacer has joined #ruby
ruurd has quit [Quit: ZZZzzz…]
dopie has joined #ruby
FernandoBasso has quit [Quit: Leaving]
<shevy>
you french!
<adaedra>
Plait-il ?
RegulationD has joined #ruby
workmad3 has joined #ruby
wookiehangover has quit [Ping timeout: 240 seconds]
mary5030 has quit [Remote host closed the connection]
<shevy>
slightly better, now what is the behaviour that is confusing?
mary5030 has joined #ruby
<pyoor>
I'm trying to make a replacement in a string but the replacement string contains \\'. For some reason, the replacement string is split into two parts
<Kendos-Kenlen>
C'est bon la baguette !
<pyoor>
The second occuring at the end of the source string
<Kendos-Kenlen>
Vive la baguette, le pain et les bérêts ! :D
rodfersou has quit [Ping timeout: 260 seconds]
<shevy>
I can't even get the example to work
absklb has quit [Remote host closed the connection]
<shevy>
pyoor yeah, File.read() will give you a string, File.readlines() an array. for .gsub you can use a {} variant
fedexo has joined #ruby
<Burgestrand>
pyoor: ^
Evanescence has quit [Quit: Code, Sex, Just fucking world.]
emilkarl has quit [Quit: emilkarl]
darkf has quit [Quit: Leaving]
<Burgestrand>
pyoor: when you pass "bar" as a second argument to #sub, it will be interpreted by Ruby in a special way, replacing things prefixed by \\.
prestorium has joined #ruby
<Burgestrand>
pyoor: if instead you pass it as a block, e.g. "Your string".sub(/regex/) { "replacement" }, it won't be interpreted in this special way.
arashb has quit [Remote host closed the connection]
<Burgestrand>
pyoor: Yes. Skip the second argument.
dopamean_ has joined #ruby
<Burgestrand>
pyoor: foo.sub(/<head>/) { bar }
<pyoor>
awesome - thanks again for that
bmurt has joined #ruby
<Burgestrand>
pyoor: Ruby will use the return value of the block (code inside curly braces), which is "bar", and will *not* interpret it in the special way that String#sub interprets its second argument.
<pyoor>
I completely missed that in the documentation
<Burgestrand>
pyoor: Most people do, including me, I've been bitten by it before. :)
sshuff|gone is now known as sshuff
<Burgestrand>
String#sub and String#gsub be crazy when it comes to backslashes in the replacement string.
cschneid_ has joined #ruby
<pyoor>
well thanks again - I've been stuck on this for a few hours this morning
<pyoor>
trying different string concatenation, etc - thinking that was the issue
<Burgestrand>
pyoor: Nope, it's just String#sub being incredibly weird.
<Burgestrand>
Most of the time the stdlib does useful things, String#sub is a rare occurrence.
SylarRuby has quit [Remote host closed the connection]
<shevy>
off-topic, perhaps someone knows, I just want to know if it is possible - if you have a rails site, can you easily generate a .pdf from this, by just using ruby code? (I currently use wkhtmltopdf)
<lagweezle>
shevy: Generate a PDF of/from .. what, exactly?
workmad3 has quit [Ping timeout: 252 seconds]
<shevy>
hmm let's say you just have a single page in rails, let's say ... hmm... just a page with lots of pictures
<shevy>
or perhaps a pay-stuff formular :)
pietr0 has joined #ruby
Xeago has quit [Remote host closed the connection]
blackmesa has joined #ruby
mdih has quit [Ping timeout: 272 seconds]
einarj has quit [Remote host closed the connection]
Xeago has joined #ruby
freerobby has joined #ruby
rwyoung has joined #ruby
<shevy>
wkhtmltopdf works quite ok so far, the only minor issue I see so far is with the inner-page padding being too large in the .pdf file
dopamean_ has quit [Ping timeout: 240 seconds]
jdawgaz has joined #ruby
rbennacer has quit [Remote host closed the connection]
shredding has quit [Ping timeout: 252 seconds]
Yzguy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
beauby has joined #ruby
<pyoor>
Burgestrand: is it possible to still use backreferences in block code?
blackmesa has quit [Ping timeout: 268 seconds]
<Burgestrand>
pyoor: yes, but not by doing it how you did before. The first parameter to the block is the matched text.
<Burgestrand>
pyoor: inside the block, the magic global variable "current match" is also properly set, $~, which is a MatchData object containing information about the current match.
<havenwood>
siaw: Works for the one arbitrary example you gave.
<havenwood>
siaw: :P
elperdut has joined #ruby
<siaw>
havenwood: haha ok :)
benlovell has quit [Ping timeout: 260 seconds]
<havenwood>
siaw: Or are you wanting to match the smartquotes too? If you do a gist with a bunch of examples I'm sure there's someone here who can't resist matching all of them.
<Burgestrand>
Like with Time.strptime!
* havenwood
likes the idea that the DB's timestamp has smartquotes
Soda has joined #ruby
<siaw>
i found a solution anyway thank you :)
yfeldblum has quit [Ping timeout: 240 seconds]
<havenwood>
siaw: Hopefully not Regexp-based!
<Burgestrand>
Hopefully using strptime!
<havenwood>
siaw: What did you go with?
<havenwood>
^
pontiki has quit [Ping timeout: 250 seconds]
mghaig has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
spcmastertim has joined #ruby
rgb-one has quit [Ping timeout: 240 seconds]
Alina-malina has joined #ruby
<mghaig>
In an initialize method i'm trying to set an instance var to an argument only if it's a float and raise an argument error if it's anything else, is this valid ruby, when i run it in irb it always raises the error...
<mghaig>
@distance = distance if distance.is_a? Float else raise ArgumentError, "Distance must be a Float."
mattprelude has quit [Ping timeout: 260 seconds]
vjdhama has quit [Remote host closed the connection]
<mghaig>
can it not be a one-liner?
<jhass>
better not
vjdhama has joined #ruby
<Burgestrand>
It's not more concise because it's on one line.
<apeiros>
mghaig: I prefer: raise TypeError, "Distance must be a Float" unless distance.is_a?(Float); @distance = distance
<Burgestrand>
More lines is not always worse code! Your code is beautiful, let it fly in all its glory.
<jhass>
replace the ; with a newline
<apeiros>
mghaig: but I'd question why you have that requirement
krisquigley has quit [Remote host closed the connection]
<apeiros>
^5 jhass (despite different err classes)
<shevy>
the whole world is written on one line!
<mghaig>
ok thanks so much. i didn't consider the unless. and the type error is probably better for this case
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Kendos-Kenlen has joined #ruby
parduse has joined #ruby
mghaig has quit []
<jhass>
shevy: World.new ?
<Burgestrand>
I built a thing, https://github.com/elabs/serial, and I've been looking at some alternatives that solve the same problem, e.g. ActiveModel::Serializers, JBuilder, RABL. Are there any other popular alternatives that I've missed to have a look at?
casadei has joined #ruby
<Burgestrand>
(aside from building a hash and sprinkling if-statements)
<Burgestrand>
(I asked the same question in #RoR last week I believe, which gave me RABL, hadn't seen that one before.)
soc42 has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
p0wn3d__ has quit [Ping timeout: 255 seconds]
bricker has joined #ruby
eosinx has joined #ruby
TomyLobo has joined #ruby
nolic has joined #ruby
parduse has quit [Ping timeout: 250 seconds]
bronson has joined #ruby
symm- has joined #ruby
vivcheri has quit [Quit: Page closed]
jamesaxl has joined #ruby
djbkd has joined #ruby
ebragaparah has joined #ruby
workmad3 has joined #ruby
Kendos-Kenlen has quit [Quit: Konversation terminated!]
SylarRuby has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
Rickmasta has joined #ruby
Vae_DuckZ has quit [Quit: Konversation terminated!]
djbkd has quit [Ping timeout: 264 seconds]
weaksauce has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
iamninja has quit [Read error: Connection reset by peer]
iamninja has joined #ruby
malconis_ has joined #ruby
malconis_ has quit [Remote host closed the connection]
malconis has quit [Read error: Connection reset by peer]
<Burgestrand>
Sou|cutter: Thanks! I'm just on my way home now, so I'll have a thorough look tomorrow. :)
<shevy>
say you have such a logo http://shevegen.square7.ch/COOKBOOKS_LOGO.png ... does anyone of you know of a simple way to randomly alternate all colours, via ruby? (can use imagemagick/rmagick of course) I want to do so programmatically rather than manually
Burgestrand has quit [Client Quit]
bmurt has quit []
skade has joined #ruby
jamesaxl has quit [Ping timeout: 246 seconds]
startupality has quit [Quit: startupality]
davedev24 has quit [Read error: Connection reset by peer]
rbennacer has quit [Remote host closed the connection]
davedev24 has joined #ruby
speakingcode has joined #ruby
codecop has quit [Remote host closed the connection]
<wallerdev>
def hi puts it on the object instantiated by that class
sufyan``` has quit [Remote host closed the connection]
baweaver has quit [Disconnected by services]
lemur is now known as baweaver
andyrs has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
lemur has joined #ruby
wallerdev_ has joined #ruby
barhum2013 has quit [Ping timeout: 246 seconds]
rehat has quit []
workmad3 has joined #ruby
bruno- has joined #ruby
<EmeraldExplorer>
wallerdev: Oh, I think I see. So is self like static in anyway?
<EmeraldExplorer>
BTW im referring to Java
<EmeraldExplorer>
... if you know about that language
iamvery has joined #ruby
<deject3d>
no self is not like static
wallerdev has quit [Ping timeout: 265 seconds]
wallerdev_ is now known as wallerdev
<EmeraldExplorer>
deject3d: what is the difference?
<deject3d>
what is your understanding of static?
* baweaver
grabs popcorn
<EmeraldExplorer>
deject3d: static is a method of a class, not an object, and can be used from any other class ex: ClassName.method
phutchins has quit [Ping timeout: 260 seconds]
eat_multi has quit [Ping timeout: 240 seconds]
<deject3d>
and what about the context of variables?
meatherly has joined #ruby
<deject3d>
yes you can use ClassName.method() on a static method named 'method' in your example.. but you know why, right?
polly_wog has joined #ruby
<EmeraldExplorer>
deject3d: because it is part of the class...
nateberkopec has joined #ruby
<EmeraldExplorer>
deject3d: not an object
siaw has joined #ruby
workmad3 has quit [Ping timeout: 246 seconds]
bruno- has quit [Ping timeout: 244 seconds]
pragmatism has joined #ruby
based_pdev_ has joined #ruby
blaxter has quit [Quit: foo]
<EmeraldExplorer>
Also one last question, how do I quickly do many def objectName.methodName s without repeating objectName? I know I have it in my notes somewhere but I can't seem to find it :,(
<pipework>
I've also rarely used them in procs for default_proc in hashes that were super short.
andyrs has quit [Quit: gone to sleep. ZZZzzz…]
<pipework>
But that's not a good reason
lulzmachine has joined #ruby
<shevy>
EmeraldExplorer I actually don't use such short methods :)
HAL2328 has joined #ruby
HAL2328_ has joined #ruby
HAL2328_ has quit [Remote host closed the connection]
<shevy>
except for p object
yfeldblum has quit [Ping timeout: 240 seconds]
evanjs has quit [Remote host closed the connection]
<pipework>
s/object/method/
<pipework>
Which is an object, a method object!
jas02 has quit [Ping timeout: 246 seconds]
broconne has joined #ruby
jas02 has joined #ruby
andyrs has joined #ruby
skade has joined #ruby
<shevy>
pipemethod
<dfockler>
the classic ruby Method object
eat_multi has joined #ruby
Musashi007 has quit [Quit: Musashi007]
* apeiros
still sad that UnboundMethod#bind does not accept just any obj as argument
Igorshp has joined #ruby
tkuchiki has joined #ruby
symm- has quit [Ping timeout: 264 seconds]
tuxero has joined #ruby
<dfockler>
has to be on the same class huh?
<apeiros>
or subclass, yes
sepp2k has quit [Quit: Leaving.]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dfockler>
Can't just slap methods onto classes willy nilly
<pipework>
Neither willy nor nilly should involved in the decision making process here.
arup_r has joined #ruby
ndrei has joined #ruby
<broconne>
I have been trying to solve an issue for a while now.. Googled high and low.. Looked at a lot of different alternatives (including omnibusing a gem w/ ruby just to get around it). But I feel like I must be missing something obvious.. I have a gem I made.. every time I run it.. I get a warning about unresolved specs because multiple versions of gems exist on a system (I think). Is there a way to get around the warning? if I bundle exec, it works fine.. But
<dfockler>
broconne: that's what bundler is for
jas02 has quit [Ping timeout: 240 seconds]
spcmastertim has quit [Ping timeout: 240 seconds]
spider-mario has joined #ruby
<broconne>
dfockler.. I get that.. I guess. but is there really know way to create a gem and have it just be something people can execute? Or is that why chef has appbundler, omnibus, etc?
nym has joined #ruby
<pipework>
broconne: Sure! You just have to use bundler's ruby interface.
Pupeno has quit [Remote host closed the connection]
<pipework>
As early as possible in the invocation.
<broconne>
I mean, it does execute.. it just spits out a bunch of warnings that more than one gem exists.. kind of just want to shutup the warnings and have it pick one that matches my specs.
<broconne>
pipework. what do you mean, just setting it to an exact version like appbundler does?
<broconne>
its how I guess chef gets around this problem.
Igorshp has quit [Ping timeout: 265 seconds]
<broconne>
but it generates an executable with a locked down list of gems.
<dfockler>
That's what your Gemfile.lock is for, so you have a set of dependent gems
<broconne>
but the Gemfile.lock doesn't get installed w/ a gem right?
bmurt has joined #ruby
<dfockler>
no
<broconne>
like gem install doesn't generate a Gemfile.lock, right?
<pipework>
broconne: You'd make your gem have dependencies in the gemspec.
<dfockler>
^
<broconne>
pipework: I do..
<broconne>
then I build a gem
jenrzzz has quit [Ping timeout: 264 seconds]
<pipework>
broconne: If the gem is the app, the gem needs all the dependencies in the gemspec.
<broconne>
then someone else runs the gem that happens to have two versions of a dependency isntalled (I don't care which one gets used). and they get a warning message.
<shevy>
broconne normally a gem will just have a .gemspec, Gemfile* variants were introduced by bundler
<broconne>
yep.. i have a gemspec
<pipework>
broconne: When you say 'run the gem' do you mean that they call an executable that the gem ships with?
<broconne>
pipeowrk: yes call the executable
<pipework>
broconne: You can tab-complete nicks if your IRC client isn't terrible.
<broconne>
and when I do.. I get this:
<broconne>
WARN: Unresolved specs during Gem::Specification.reset:
<broconne>
ohai (~> 8.0)
<broconne>
but about 10 other gems listed
<shevy>
how do you get that
<broconne>
I run my gem executable
Macaveli has joined #ruby
<broconne>
which is generated by rubygems (according to the comment)
<pipework>
broconne: 'I run', as in direct invocation that looks like what?
<shevy>
not sure that pipework meant that
<pipework>
`my_gem_executable`?
<pipework>
`bundle exec my_gem_executable`?
<broconne>
my_gem_executable
renderful has quit [Remote host closed the connection]
<broconne>
without bundle
<broconne>
after the gem is insalled with "gem install my_gem"
Juanchito has quit [Quit: Connection closed for inactivity]
dionysus69 has joined #ruby
<shevy>
this should require a bin/my_gem_executable file
last_staff has quit [Quit: last_staff]
RegulationD has joined #ruby
<broconne>
yes. I have my executable in there
<broconne>
and rubygems then seems to generate another one for me.
<shevy>
one with the shebang line changed I guess
<broconne>
that does the load, etc.
tjohnson has quit [Quit: Connection closed for inactivity]
<broconne>
mine doesn't have a shebang
<shevy>
as far as I know, only the top line is changed, are you sure that this will do the load instead?
jackjackdripper has joined #ruby
<broconne>
that is rubygems job I thought.
<broconne>
no, it generated a whole new thing
<broconne>
then does a load Gem.bin_path at hte bottom
<shevy>
it does not know what it should load, that is what the lib/ files should do, not the bin/ files
cnm has joined #ruby
<shevy>
huh... who added the Gem.bin_path thing
skade has quit [Quit: Computer has gone to sleep.]
<broconne>
gem install I am pretty sure does
<broconne>
that is why you specify your bin files in the gemspec
ta has joined #ruby
<shevy>
I am pretty sure it does not
jackjackdripper has quit [Client Quit]
bodgix has quit [Ping timeout: 252 seconds]
<shevy>
yes, in the .gemspec file you specify what is to be part of your .gem
jackjackdripper has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
but the bin/* files are or should just be commandline invocation variants
jenrzzz has joined #ruby
code_ has quit [Ping timeout: 260 seconds]
<broconne>
ok.. so I lied.. I have a shebang in mine.. I do #!/usr/bin/env ruby
<broconne>
then some requires
Macaveli has quit [Ping timeout: 268 seconds]
aldodelgado has quit [Quit: aldodelgado]
<broconne>
then I start (it uses thor)
<broconne>
but
<broconne>
the one that gets installed on the ssytem
<broconne>
in the path.. is purely generated by rubygems and just references mine.
<shevy>
what does it actually "reference" and how?
<shevy>
"When I use your library, deploy your app, or run your tests I may not want to use rubygems."
<shevy>
"When you require 'rubygems' in your code, you remove my ability to make that decision."
<shevy>
"I cannot unrequire rubygems, but you can not require it in the first place."
<shevy>
:D
stryek has joined #ruby
nateberkopec has joined #ruby
wharr__ has joined #ruby
petricore has quit [Ping timeout: 268 seconds]
<wharr__>
have yall used the ruby debugger on sublime with vagrant before?
dionysus69 has quit [Ping timeout: 260 seconds]
JDiPierro has joined #ruby
<apeiros>
shevy: well, you still don't require 'rubygems' in your code :-p
arian0n has joined #ruby
symm- has quit [Ping timeout: 250 seconds]
<broconne>
shevy: Wasn't suggesting that the content in the blog was good advice.. was just posting to an example of the executable that ruby gems generates.
hobodave has joined #ruby
karapetyan has quit [Ping timeout: 250 seconds]
<shevy>
apeiros I can!!!
<apeiros>
sure. but you shouldn't
<shevy>
I don't :-)
msb_ has joined #ruby
<shevy>
I am always trying to get rid of lines
renderful has joined #ruby
scoot has joined #ruby
codecop has quit [Remote host closed the connection]
drawesome has quit [Disconnected by services]
meatherly has quit [Ping timeout: 240 seconds]
matthew_ has joined #ruby
yqt has joined #ruby
matthew_ is now known as Guest98513
Guest98513 has quit [Remote host closed the connection]
<shevy>
Not sure whether he did manage to resolve it
shinnya has quit [Ping timeout: 265 seconds]
startupality has joined #ruby
sship_ has joined #ruby
krz has quit [Quit: WeeChat 1.2]
parduse has joined #ruby
kirun has joined #ruby
<sship_>
I'm on Ubuntu. When installing gems, should I use 'gem install xyz' or 'sudo gem install xyz'? I have Ruby installed system-wide. I am not using RVM or anything.
iamvery has joined #ruby
<tubbo>
sship_: does `gem install xyz` work?
SumoBoy has joined #ruby
<zenspider>
if you're installing the gem to be used system-wide, use sudo. If not, flip a coin
<havenwood>
sship_: The default setup with the Ubuntu package manager Ruby is system-wide gems, so sudo.
<sship_>
tubbo: I didn't try it in case something goes wrong. Wanted to ask here first.
petricore has joined #ruby
<dfockler>
Is there a way to call a specific method in a ruby script from the command line?
<adaedra>
ruby -e ?
<dfockler>
oh yeah adaedra thanks
fantazo has joined #ruby
<sship_>
When I install a gem to be used system-wide...will it conflict with other gems if I decide to use RVM in the future?
<adaedra>
sship_: rvm will have its own gem directory.
<havenwood>
sship_: Whether you use RVM or chruby or whatnot they don't care about your system Ruby.
MTGeni has joined #ruby
mary5030 has quit [Remote host closed the connection]
giuseppesolinas has quit [Quit: This computer has gone to sleep]
<sship_>
So I could have a gem system-wide and I could have the same gem in rvm's gem directory with no confliction, correct?
mary5030 has joined #ruby
hobodave has joined #ruby
<havenwood>
sship_: With your system Ruby you can also install gems in the user home directory instead of the system GEM_HOME like `gem install example --user-install` or more set it permanently for the user in a gemrc file.
<havenwood>
sship_: Yeah, sure, that's no problem.
scoot has quit []
bmurt has quit []
momomomomo_ has joined #ruby
karapetyan has joined #ruby
<sship_>
havenwood: Alright. Thanks!
v0n has quit [Ping timeout: 240 seconds]
last_staff has quit [Quit: last_staff]
symm- has quit [Ping timeout: 252 seconds]
momomomomo has quit [Ping timeout: 265 seconds]
momomomomo_ is now known as momomomomo
wallerdev has joined #ruby
mary5030 has quit [Ping timeout: 265 seconds]
Mattick has joined #ruby
jgt1 has quit [Ping timeout: 240 seconds]
sship_ has quit [Quit: Page closed]
SylarRuby has quit []
chipotle has quit [Read error: Connection reset by peer]
hal_9000_ has quit [Ping timeout: 240 seconds]
hal_9000__ has joined #ruby
chipotle has joined #ruby
tkuchiki has joined #ruby
<zenspider>
drbrain: oi. my gem cert expired? does that mean I need to re-publish everything ever published with it? or?
troyready has quit [Quit: Leaving]
znz_jp has quit [Ping timeout: 246 seconds]
<drbrain>
this is the shitty unimplemented part of gem certs, "yes"
Igorshp has joined #ruby
<drbrain>
but you can't because rubygems doesn't allow re-upload
pen has joined #ruby
<drbrain>
alternate solution, make your cert lifetime something ridiculous like 10 years
Soda has quit [Remote host closed the connection]
<drbrain>
or make a CA cert that has a ridiculous lifetime, then a child cert with a short lifetime you use for signing
<drbrain>
then publish the CA cert
v0n has joined #ruby
ruurd has quit [Quit: ZZZzzz…]
parduse has quit []
freerobby has quit [Quit: Leaving.]
syath has quit [Quit: WeeChat 1.2]
freerobby has joined #ruby
evanjs has joined #ruby
<zenspider>
mmmm... you think I understand that shit. :P
wharr__ has quit [Read error: Connection reset by peer]
<drbrain>
nobody does
tkuchiki has quit [Ping timeout: 264 seconds]
<drbrain>
Igorshp has quit [Ping timeout: 246 seconds]
<zenspider>
well fuck. republishing 90+ gems because of certs pretty much means: stop signing gems
<zenspider>
because that isn't worth it
Mattick has quit []
einarj has joined #ruby
<drbrain>
convince people that want signed gems to pick up the TUF work since that's secure over the transport instead of inside the gem
Mattick has joined #ruby
<zenspider>
gem cert --help doesn't mention anything about expiry
<dfockler>
write a gem to help publish the gems
momomomomo has quit [Quit: momomomomo]
Pupeno has joined #ruby
Mattick has quit [Remote host closed the connection]
<zenspider>
already did that. still have to do 90 revs
<zenspider>
for nothing
allomov has quit [Remote host closed the connection]
<drbrain>
if you don't use the strictest install setting rubygems won't check timestamps
agent_meerkat has quit [Ping timeout: 246 seconds]
benlieb has joined #ruby
s2013 has joined #ruby
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
hamilto-nyan has joined #ruby
x-light has joined #ruby
<zenspider>
how do I test a cert file?
zapata has quit [Ping timeout: 240 seconds]
ht__ has quit [Remote host closed the connection]
<zenspider>
looks like it moved the expired one to the side and generated a new one
troyready has joined #ruby
<zenspider>
also looks like I dealt with cert shit in june. this is getting stupid
frmendes has joined #ruby
voltalio_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blackmes1 has joined #ruby
wallerdev has quit [Quit: wallerdev]
bruno- has quit [Ping timeout: 264 seconds]
rehat has quit [Remote host closed the connection]
VeryBewitching has joined #ruby
wallerdev has joined #ruby
<dfockler>
to be fair, most of us don't have 90+ gems :P
bruno- has joined #ruby
momomomomo has joined #ruby
einarj has quit [Remote host closed the connection]
duggiefresh has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 240 seconds]
startupality has quit [Quit: startupality]
x-light has quit [Remote host closed the connection]
<zenspider>
dfockler: and? what's your point?
<dfockler>
I don't know
parduse has joined #ruby
platzhirsch has left #ruby [#ruby]
pen has quit [Remote host closed the connection]
wallerdev has quit [Client Quit]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<zenspider>
dfockler: then... good job contributing to the signal
pen has joined #ruby
<dfockler>
:| sorry
skade has joined #ruby
startupality has joined #ruby
workmad3 has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
gustav_ has joined #ruby
* baweaver
counts his gems
<baweaver>
20, need more gems...
<shevy>
push it, push it real good
allomov has joined #ruby
<gustav_>
Does anyone know of a place on the web to discuss and get input on implementation tactics?
swgillespie has joined #ruby
<gustav_>
For more open-ended questions than stack overflow allows..
fantazo has quit [Quit: Verlassend]
devoldmx has joined #ruby
s2013 has quit [Read error: Connection reset by peer]
momomomomo has quit [Quit: momomomomo]
naftilos76 has joined #ruby
zapata has joined #ruby
krisquigley has joined #ruby
naftilos76 has quit [Client Quit]
havenwood has quit [Ping timeout: 250 seconds]
jdawgaz has joined #ruby
havenwood has joined #ruby
duggiefresh has joined #ruby
hobodave has quit [Quit: Computer has gone to sleep.]
<dfockler>
So what's the point of a self-signed cert?
bazbing80 has quit [Ping timeout: 272 seconds]
Jackneill has quit [Ping timeout: 265 seconds]
nettoweb has joined #ruby
<shevy>
see, I have not even reached that point, I don't even know why I need a cert
andyrs has quit [Quit: I'm leaving now, bye.]
<baweaver>
You'd be fine getting a band-aid from a random person claiming medical experience, but probably not with surgery without a validated doctor.
cmisenas has joined #ruby
TomyLobo has quit [Ping timeout: 264 seconds]
<shevy>
I don't trust any doctors anyway!
<baweaver>
in some more important cases (Devise, CanCanCan, Pundit) you want to verify the integrity of the gem to a stricter level than you would with basic functionality helpers
einarj has joined #ruby
skade has quit [Read error: Connection reset by peer]
einarj has quit [Remote host closed the connection]
<dfockler>
It just says the gem code was written by the who the cert says it was written by
Torrieri has quit [Quit: Be back later ...]
<dfockler>
s/the who/the person who
<dfockler>
or who ever the private key belongs to
Torrieri has joined #ruby
Torrieri has quit [Read error: Connection reset by peer]
hobodave has quit [Quit: Computer has gone to sleep.]
Torrieri has joined #ruby
Torrieri has quit [Changing host]
Torrieri has joined #ruby
nzst has quit [Ping timeout: 260 seconds]
Torrieri has quit [Client Quit]
centrx has quit [Quit: "You cannot fix a machine by just power-cycling it with no understanding of what is going wrong."]
renderful has quit [Remote host closed the connection]
Torrieri has joined #ruby
baweaver has quit [Remote host closed the connection]
bigmac has quit [Ping timeout: 244 seconds]
Voker57 has quit [Read error: Connection reset by peer]
jimster has joined #ruby
<jimster>
will --disable-install-rdoc omit the rdoc gem from rubycore?
n_blownapart has joined #ruby
<zenspider>
mmm... don't think so, but not actually sure what you're referring to
<jimster>
it's a configure option when building ruby
bazbing80 has joined #ruby
mary5030 has joined #ruby
<adaedra>
jimster: apparently not
<jimster>
the description reads like it results in skipping rdoc creation, and rdoc gem is included. but I hoped to confirm here.
proq has quit [Remote host closed the connection]
Torrieri has quit [Ping timeout: 250 seconds]
michaeldeol has joined #ruby
<zenspider>
jimster: "do not install neither rdoc indexes nor C API documents during install"
baweaver has joined #ruby
siaw has quit [Quit: siaw]
<zenspider>
I'm guessing it has no effect on the installation of the gem
<jimster>
yea, that's what I was thinking as well
<zenspider>
I'll go a step further... I don't think rdoc IS installed as a gem
HAL2328 has quit [Quit: Leaving]
<zenspider>
not a real one, at least
<adaedra>
jimster: my ruby is installed with that option, and I have rdoc.
<jimster>
that makes sense. I can't remove it
axl_ has left #ruby [#ruby]
drewvanstone has joined #ruby
hobodave has joined #ruby
bigmac has joined #ruby
<jimster>
thanks guys
patientj has quit [Quit: WeeChat 1.0.1]
otacon- has joined #ruby
workmad3 has joined #ruby
michael_mbp has quit [Excess Flood]
CrazyEddy has quit [Ping timeout: 252 seconds]
skade has joined #ruby
vjdhama has quit [Remote host closed the connection]
benlovell has joined #ruby
jobewan has joined #ruby
wallerdev has quit [Quit: wallerdev]
workmad3 has quit [Ping timeout: 256 seconds]
arup_r has quit [Quit: Leaving]
nofxx has joined #ruby
skade has quit [Read error: Connection reset by peer]
michael_mbp has joined #ruby
momomomomo has joined #ruby
<nofxx>
Some change in load path or something in gem 2.4.8? Can't find my engines anymore...
<nofxx>
don't even remeber updating rubygems =/
wallerdev has joined #ruby
allomov has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
benlovell has quit [Ping timeout: 250 seconds]
momomomomo has quit [Client Quit]
wallerdev has quit [Client Quit]
zenguy_pc has quit [Read error: Connection reset by peer]
allomov has joined #ruby
elperdut has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
meatherly has joined #ruby
wallerdev has joined #ruby
allomov has quit [Remote host closed the connection]
freerobby has quit [Quit: Leaving.]
michael_mbp has quit [Excess Flood]
jordanm has quit [Remote host closed the connection]
jacksonmills has joined #ruby
jordanm has joined #ruby
pusewicz has joined #ruby
Xeago has joined #ruby
<havenwood>
nofxx: If you update your Ruby you get the RubyGems it ships with.
JDiPierro has quit [Remote host closed the connection]
<mwlang>
I just want to know how I can detect I called foo with |foobar|
<zenspider>
thanks
drewvanstone has quit [Ping timeout: 252 seconds]
<mwlang>
vs. just calling “foo”
<apeiros>
mwlang: block_given? tells you whether a block was supplied
<apeiros>
number of params the block takes would be block.arity. but using that is brittle at best.
<apeiros>
(and block.arity of course assumes &block in your method def)
<mwlang>
apeiros: hmmm…what makes that brittle?
<zenspider>
I'm... not sure what mwlang is asking still
<apeiros>
mwlang: thousand and one way you'll go wrong with it
ndrei has quit [Ping timeout: 265 seconds]
but3k4 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
but3k4 has joined #ruby
<shevy>
mwlang think of {} blocks are extra argument; you can use instance_eval and class_eval to do fancy stuff until you no longer understand what is going on (add method_missing for the extra-win... ok you already are not sure what is going on there :D)
<apeiros>
mwlang: also such kind of behavior is rather unexpected and will almost certainly confuse people using your code.
michael_mbp has quit [Excess Flood]
j4cknewt has quit [Remote host closed the connection]
<shevy>
Ruby tries to lure you with its wicked good looks but the cake is a lie.
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
<zenspider>
mwlang: do you understand what |foobar| is in your code sample?
<mwlang>
heh…I confess I’m just trying to understand AA’s DSL better and how the heck they implemented it.
gurix has quit [Quit: gurix]
iamvery has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<zenspider>
I'm still not sure these ppl are answering your actual problem
<mwlang>
zenspider: that’s precisely what I’m trying to understand.
<zenspider>
mwlang: you're not asking good questions. do you understand the exception that was raised?
<zenspider>
bring up irb/pry and try: nil.blah
<mwlang>
zenspider: I understand why, yes.
n008f4g_ has quit [Ping timeout: 240 seconds]
michael_mbp has joined #ruby
<zenspider>
I'm asking more what, then why, at this point
<zenspider>
you got a NoMethodError
nettoweb has joined #ruby
<zenspider>
that's important to pay attention to
<mwlang>
zenspider: hold on. Let me come back with better questions.
<mwlang>
googling block and arity is getting me documentation I was seeking.
but3k4 has quit [Ping timeout: 250 seconds]
<zenspider>
I'm not sure it is what you should be looking at at this point
nhhagen has joined #ruby
<mwlang>
zenspider: here’s what I’m trying to understand: Active Admin lets you define a column three ways:
<mwlang>
column :foo
<mwlang>
column :foo do |obj|; obj.do_something; end
<mwlang>
column do |obj|; obj.do_something; end
<zenspider>
ie don't try to tune an engine until you understand wheels and know how to inflate them
<mwlang>
all I want to understand is how that DSL was implemented.
<mwlang>
zenspider: ie. take an engine apart in order to understand how it works.
<mwlang>
:-)
broconne has quit [Quit: Leaving.]
cmisenas has quit [Ping timeout: 246 seconds]
<zenspider>
my point: understand the basics before you get to advanced shit.
<shevy>
the method must exist
<zenspider>
I don't think you understand the absolute basics of blocks yet
benlieb has quit [Quit: benlieb]
ekinoxx has joined #ruby
jgt1 has joined #ruby
Aswebb__ has quit []
prestorium has quit [Quit: Leaving]
iamvery has joined #ruby
polysics has joined #ruby
baweaver has joined #ruby
<apeiros>
mwlang: that one involves zero magic and even less so block arity checking.
dorei has quit []
radgeRayden has joined #ruby
kobain has joined #ruby
nhhagen has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Xiti has joined #ruby
freerobby has joined #ruby
zenguy_pc has quit [Read error: Connection reset by peer]
pusewicz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nzst has quit [Ping timeout: 264 seconds]
baweaver has quit [Ping timeout: 255 seconds]
lulzmachine has quit [Quit: Connection closed for inactivity]
dcalan has joined #ruby
duggiefresh has quit []
havenn is now known as havenwood
minimalism has joined #ruby
JDiPierro has joined #ruby
polly_wog has quit [Remote host closed the connection]
bigmac has quit [Ping timeout: 272 seconds]
Jardayn has quit [Read error: Connection reset by peer]
wallerdev has quit [Quit: wallerdev]
spider-mario has quit [Remote host closed the connection]
EmeraldExplorer has quit [Quit: Connection closed for inactivity]
gusTester has left #ruby [#ruby]
DoubleMalt has joined #ruby
karapetyan has quit [Remote host closed the connection]
opensource_ninja has quit [Ping timeout: 240 seconds]
<mwlang>
sorry my gist took everyone down the wrong track and confusing everyone.
<apeiros>
I don't think that's what your AA example does. at all.
<mwlang>
the block.arity comment was all I needed to know about.
djbkd has joined #ruby
<mwlang>
apeiros: AA is using defaults when they’re not supplied.
tenseiten has quit [Read error: Connection reset by peer]
<mwlang>
I just wondered, how the heck?
<apeiros>
your example doesn't show anything defaulty
<zenspider>
yeah. I suspect you're missing the point
Xeago has joined #ruby
<apeiros>
it shows a method yielding a value to a block.
jgt2 has joined #ruby
<zenspider>
your code sample is confused how you're dealing with arity
<apeiros>
that AA thingy seems to be mostly just: `def column(name=nil); yield(noideawhat) if block_given?; end`
mondayrain has joined #ruby
<apeiros>
that is: it allows a first arg to be passed or omitted (arg with default value)
seitensei has joined #ruby
<zenspider>
def column name = :default; yield some_obj if block_given?; end
<apeiros>
and it allows a block to be passed or omitted (yield if block_given?)
<zenspider>
that's all
dcalan has quit [Ping timeout: 250 seconds]
<mwlang>
but it also allows variables to be passed into the block to be used.
bigmac has joined #ruby
yfeldblum has quit [Ping timeout: 246 seconds]
<mwlang>
and that’s optionally supplied.
ducklobster has quit [Ping timeout: 250 seconds]
<apeiros>
then your example missed the point of exemplifying your point
Technodrome has quit [Quit: Technodrome]
jenrzzz_ has joined #ruby
gix has quit [Ping timeout: 240 seconds]
KervyN has quit [Ping timeout: 240 seconds]
ishahnaz has joined #ruby
<mwlang>
apeiros: yes, I realize that in hindsight
ishahnaz has quit [Client Quit]
jgt1 has quit [Ping timeout: 250 seconds]
<apeiros>
your AA example
<apeiros>
not your code
xMopxShell has quit [Ping timeout: 240 seconds]
lupine has left #ruby [#ruby]
lolmaus has quit [Ping timeout: 240 seconds]
<apeiros>
and I'm still not convinced block arity is what you want or need.
ekinoxx has quit [Ping timeout: 268 seconds]
lolmaus has joined #ruby
<apeiros>
and *even if*, it's horrible code. don't do that. seriously.
workmad3 has quit [Ping timeout: 256 seconds]
yfeldblum has joined #ruby
<mwlang>
apeiros: point taken
KervyN has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
xMopxShell has joined #ruby
<zenspider>
mwlang: it passes args in both cases, regardless of arity
yfeldblum has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby
<mwlang>
for me, this was a thought experiment. My goal was to see if I could make both the arguments and the block arguments (or whatever you call the X and Y of “foo X do |Y|”) optional.
<mwlang>
it’s not really something I want to put into production code, but it was a good learning exercise, at least for me.
gix has joined #ruby
aldodelgado has quit [Quit: aldodelgado]
Xeago has quit [Ping timeout: 246 seconds]
<mwlang>
zenspider: I see now what you’re saying! d-oh
devoldmx has joined #ruby
dasher00 has quit [Ping timeout: 250 seconds]
siaw has joined #ruby
blackmes1 has quit [Quit: WeeChat 1.3]
bkulbida has quit [Ping timeout: 256 seconds]
jdawgaz has quit [Max SendQ exceeded]
kies^ has quit [Ping timeout: 260 seconds]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
baweaver has joined #ruby
znz_jp has joined #ruby
devoldmx has quit [Ping timeout: 264 seconds]
benlieb has joined #ruby
tkuchiki has joined #ruby
polysics has quit []
<zenspider>
Are there any 1.8 folks left? Like, with actual numbers?
<zenspider>
drbrain: ^^ ?
ekinoxx has joined #ruby
ekinoxx has quit [Max SendQ exceeded]
benlieb has quit [Client Quit]
mary5030 has quit [Remote host closed the connection]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hashrocket has quit [Quit: Connection closed for inactivity]
m8 has quit [Quit: Sto andando via]
<darix>
zenspider: many of the enterprise distros still support 1.8
<darix>
and actually will have to for a few more years
allcentury has joined #ruby
<darix>
that reminds me i have to writeup the bug report for rubygems and stdlib
scoot has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
benlovell has joined #ruby
spcmastertim has quit [Remote host closed the connection]
<shevy>
the land of the evil
willywos has quit [Ping timeout: 252 seconds]
<drbrain>
zenspider: I stopped bugging Evan for numbers
<miah>
enterprise distros are stuck with backporting those fixes to ruby sadly. they made their bed, now they have to sleep in it.
banjara1 has joined #ruby
<darix>
miah: we would happily upgrade if any newer ruby would have been a drop in replacement :)
<darix>
trust me
siaw has left #ruby [#ruby]
allcentury has quit [Ping timeout: 246 seconds]
<miah>
upgrade the distro =)
<darix>
miah: sure done that.
dasher00 has joined #ruby
<darix>
but you know ... rhel/sles have like 10+year lifecycle now
<miah>
ya, but the versions with 1.8 are almost EOL
GnuYawk has quit [Remote host closed the connection]
<darix>
yeah
<darix>
in 4-5years they are ;)
<miah>
redhats fault
banjara has quit [Ping timeout: 240 seconds]
<darix>
miah: for sles12 we set up the packaging to easily allow multiple ruby versions
<miah>
we've just stopped using the system ruby entirely
<miah>
cool
benlovell has quit [Ping timeout: 252 seconds]
<darix>
miah: if you keep maintaining the non system ruby it is all fine.
<miah>
during our packer/ami build we put chruby and our compiled rubies in place. now we're stuck supporting the versions of ruby on our systems, but at least we're not stuck with 1.8.7.
<miah>
infrastructure as code to the rescue =)
params has joined #ruby
<params>
hello everyone :)
<miah>
hi
<params>
can you help me with a quick question?
bronson has quit [Remote host closed the connection]
<miah>
ask the question
<params>
I have a method like: .permit(:city, :country, :zip_code, :apt_number)
<params>
I want to pass the args as an array
<params>
what's the best way to do that?
<shevy>
no you don't have a method like this
<darix>
params: why?
<params>
i.e. I want something like args = %i(city country zip_code apt_number)
<params>
and be able to call .permit(args)
<shevy>
use *
<darix>
.permit(*args)
<params>
ah, does that unzip the array?
<params>
that's perfect
<params>
that's a lot!
<params>
;D
<params>
thanks a lot*
mleung has joined #ruby
jenrzzz has joined #ruby
siaw_ has joined #ruby
scoot has quit [Remote host closed the connection]
tmtwd has joined #ruby
SCHAAP137 has quit [Quit: Leaving]
<zenspider>
darix: I can always say that linux distros stuck on ruby 1.8 are stuck with older versions of minitest (or whatever). they stuck themselves. They don't get to stop upgrading some things and upgrade all the gems and expect it to work forever
<zenspider>
*%w[thanks a lot]
<darix>
zenspider: latest minitest doesnt work on 1.8 anymore?:p
<zenspider>
it does
<zenspider>
but I have a PR I like that'll require me to drop 1.8
<shevy>
\o/
<darix>
all that discrimination against 1.8!
jenrzzz_ has quit [Ping timeout: 265 seconds]
<darix>
zenspider: if it makes you feel better many projects broke compat before you :)
<shevy>
1.8 was cool but it is on life support!
MeMoc has quit [Quit: Connection closed for inactivity]
<miah>
1.8.7 has been EOL for more than a year at this point, its suprising anything still works with it
<havenwood>
shevy: Life support is for the living.
<havenwood>
darix: Ah, I hadn't seen that. Thanks for the link.
VeryBewitching has quit [Quit: Konversation terminated!]
platzhirsch has left #ruby [#ruby]
<chrisseaton>
in my humble opinion they are making the same mistake as every other implementation of Ruby - they are optimising control flow and basic operations like ivars, instead of the core library where Ruby programs really spend their time
nofxx has joined #ruby
<dfockler>
what kinds of things make ruby 'slow'?
<darix>
chrisseaton: but if you optimize the basics everything will be faster!
<darix>
i liked Aaron's talks on optimizing rails, rubygems and bundler^^
drewvanstone has joined #ruby
chrisja has quit [Quit: leaving]
rodfersou has quit [Ping timeout: 246 seconds]
<dfockler>
but it doesn't make things that much faster
<dfockler>
I'd imagine speeding up object allocation would be more important than 'if' branching or something
kirun has quit [Quit: Client exiting]
snockerton has joined #ruby
firstdayonthejob has quit [Ping timeout: 240 seconds]
sanjayu has joined #ruby
agent_meerkat has joined #ruby
<chrisseaton>
darix: unfortunately in my experience that just isn't true - it's like Amdahl's law - even if you make method calls, ifs, local variables etc infinitely fast, an MRI based implementation would be slow as their statically compiled C core library implementation is slow
JDiPierro has quit [Remote host closed the connection]
<chrisseaton>
dfockler: *removing* object allocation is what's key
<darix>
chrisseaton: my reply to you was sarcasm. sorry :)
<chrisseaton>
ah sorry :)
devgiant has quit [Quit: Leaving]
<dfockler>
chrisseaton: reading through your article now :)
circ-user-dLt7c has quit [Remote host closed the connection]
<chrisseaton>
mwlang: right, and if the VM can not allocate them for you, even if they look like they're allocated in the source code, that's the silver bullet
ponga has joined #ruby
Pupeno_ has quit [Ping timeout: 240 seconds]
devoldmx has joined #ruby
WillAmes has quit [Remote host closed the connection]
WillAmes has joined #ruby
Asher has joined #ruby
CloCkWeRX has left #ruby [#ruby]
scoot has joined #ruby
bigmac has quit [Ping timeout: 264 seconds]
<mwlang>
chrisseaton: good point. yet another perk of using interpreted languages over compiled ones. You don’t think about garbage collection and you don’t think about heap allocation, either.
devoldmx has quit [Ping timeout: 240 seconds]
meatherly has quit []
nofxx has quit [Ping timeout: 260 seconds]
<pipework>
But it's fun to be able to when it matters!
mattprelude has joined #ruby
<pipework>
Though I haven't really gotten as intimately familiar with chrisseaton's awesome work as I've been trying to.
devgiant has joined #ruby
nofxx has joined #ruby
devgiant has quit [Remote host closed the connection]
petricore has joined #ruby
otacon- has quit [Ping timeout: 250 seconds]
fersur3 has joined #ruby
<fersur3>
Is there a way to set up a "full ruby environment" in $HOME/ ?
maletor has joined #ruby
finisherr has joined #ruby
<shevy>
fersur3 just compile ruby there
<finisherr>
Does anyone know where I can get a list of all of the options for rvmrc off hand?
s00pcan has quit [Quit: Lost terminal]
<pipework>
fersur3: ruby-install
<pipework>
chruby and ruby-install
yfeldblum has quit [Ping timeout: 240 seconds]
<pipework>
finisherr: rvmrc's are just files that are essentially exec'd if they're trusted.
<pipework>
last I used rvm that is
bigmac has joined #ruby
<finisherr>
I know there are some options though
<finisherr>
like rvm_install_on_use_flag=1
<finisherr>
rvm_gemset_create_on_use_flag=1
siaw_ has quit [Ping timeout: 265 seconds]
siaw has joined #ruby
iateadonut has joined #ruby
petricore has quit [Ping timeout: 244 seconds]
arcanez has left #ruby [#ruby]
<finisherr>
I’td be great to know what environment variables are accessible to me
<pipework>
finisherr: #rvm is a thing. Why not just use ruby-install?
<finisherr>
ahh, i guess I could try that channel
michael_mbp has joined #ruby
<pipework>
It's small, does the least amount of work necessary to do the job, and is easy enough to read the whole source in a single sitting.
banjara has joined #ruby
whippythellama has quit [Quit: WeeChat 1.3]
BTRE has quit [Remote host closed the connection]
banjara1 has quit [Ping timeout: 240 seconds]
KnownSyntax_ has joined #ruby
<finisherr>
I think there was a want for gemsets
KnownSyntax has quit [Read error: Connection reset by peer]
<finisherr>
and lots of folks use rvm already, don’t wanna push folks out of their tools
tangentstorm has joined #ruby
mary5030 has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
deol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yfeldblum has joined #ruby
VeryBewitching has joined #ruby
mary5030 has quit [Ping timeout: 240 seconds]
polly_wog has quit [Read error: Connection reset by peer]
araujo_ has joined #ruby
SumoBoy has left #ruby [#ruby]
polly_wog has joined #ruby
araujo has quit [Ping timeout: 265 seconds]
BTRE has joined #ruby
freerobby has quit [Quit: Leaving.]
willywos has joined #ruby
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
startupality has quit [Quit: startupality]
nzst has joined #ruby
petricore has joined #ruby
phutchins has joined #ruby
ebragaparah has joined #ruby
swgillespie has joined #ruby
jobewan has quit [Quit: Leaving]
jgt2 has quit [Ping timeout: 264 seconds]
Liothen- has joined #ruby
casadei has quit [Remote host closed the connection]
bronson has joined #ruby
nzst has quit [Ping timeout: 240 seconds]
Liothen has quit [Quit: The Dogmatic Law of Shadowsong]
Liothen- has quit [Client Quit]
dopie has quit [Quit: This computer has gone to sleep]
Liothen has joined #ruby
weemsledeux has joined #ruby
michaeldeol has joined #ruby
Musashi007 has quit [Quit: Musashi007]
dfockler has quit [Remote host closed the connection]
polly_wog has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 250 seconds]
Bish_ is now known as Bish
workmad3 has joined #ruby
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
quazimodo has joined #ruby
havenwood has quit [Ping timeout: 265 seconds]
Igorshp has joined #ruby
otacon- has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<EasyCo>
Hey team, given the scenario where you have the following: Vehicle::Car.new(some_attrs). But you also have a wrapper/factory method which is part of the advertised public API: Vehicle.car(some_attrs). The latter does nothing special, it just proxies the values to Vehicle::Car.new(). Would you write test coverages for both ways of instantiating a car or just
<EasyCo>
one of them?
rcvalle has quit [Quit: rcvalle]
Igorshp has quit [Ping timeout: 250 seconds]
<beauby>
EasyCo: I'd write a test that ensures the forwarding, and then test the constructor extensively
symbol has joined #ruby
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]