michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<texasmade>
I'm missing something minor here and it's bugging me. I'm getting two numbers and storing them each in a variable (x, y), but when i sum = x+y and puts #{sum} it gives me the number mashed together
<gheegh>
basically.. i want to change the items that are in the "metrics" and dimensions.. without defining an additional class.. say, for example, i want to change the dimentions from "goal_previous_step_1" to "goal_previous_step_2".. if this is static, i have to define a new model.. i have to believe there's a way i can "ocnfigure" thte class to avoid it.
<xcyclist>
irb is not available.
kies^ has joined #ruby
senayar has quit [Remote host closed the connection]
<Ox0dea>
xcyclist: Windows + Ruby is painful, and I've only heard of RubyInstaller easing that pain to any considerable degree.
garbgargh has quit [Client Quit]
baweaver has joined #ruby
<Ox0dea>
gheegh: #metrics and #dimensions are just methods here.
<Ox0dea>
You should be able to invoke them dynamically with #send.
<gheegh>
ok.. interesting.. i'll try it.
<gheegh>
didn't think of that. .thought it would be harder than that.
rcvalle has quit [Quit: rcvalle]
Asher has joined #ruby
<xcyclist>
Ok. I'll just not use Ruby then.
michaeldeol has joined #ruby
Yzguy has joined #ruby
benlovell has joined #ruby
charliesome has joined #ruby
<sevenseacat>
cygwin causes nothing but grief.
<Ox0dea>
s/cyg//
CloCkWeRX has joined #ruby
CloCkWeRX has left #ruby [#ruby]
_djbkd has quit [Quit: My people need me...]
<sevenseacat>
like, I used to think I was awesome, using it for all my uni assignments so I didn't have to learn unix, but then all the code I wrote completely broke when run there
baweaver has quit [Remote host closed the connection]
<sevenseacat>
soooo much fun
jeramyRR has joined #ruby
Alayde has quit [Ping timeout: 246 seconds]
benlovell has quit [Ping timeout: 240 seconds]
chipotle has joined #ruby
senayar has joined #ruby
s00pcan has joined #ruby
blaines has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
iwaffles has joined #ruby
juanpablo____ has joined #ruby
iateadonut has joined #ruby
bruno- has quit [Ping timeout: 246 seconds]
allcentury has joined #ruby
<shevy>
tis be not a unix cat!
shock_one has joined #ruby
bayed has quit [Quit: Connection closed for inactivity]
yaw has joined #ruby
tabakhase__ is now known as tabakhase
tabakhase has joined #ruby
tabakhase has quit [Changing host]
yaw has left #ruby [#ruby]
Gadgetoid has quit [Ping timeout: 252 seconds]
dbussink has quit [Ping timeout: 252 seconds]
sankaber has joined #ruby
dented42 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rmoriz has quit [Ping timeout: 252 seconds]
nobitanobi has quit [Remote host closed the connection]
user1138 has quit [Ping timeout: 255 seconds]
nobitanobi has joined #ruby
juanpablo____ has quit [Ping timeout: 244 seconds]
dented42 has joined #ruby
dbussink has joined #ruby
keen__________32 has quit [Ping timeout: 240 seconds]
rmoriz has joined #ruby
nobitanobi has quit [Remote host closed the connection]
sankaber has quit [Client Quit]
Gadgetoid has joined #ruby
nklv has joined #ruby
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
$ cat $(cat)
shock_one has quit [Ping timeout: 265 seconds]
keen__________32 has joined #ruby
laurentide has joined #ruby
minmax has joined #ruby
Azure has quit [Ping timeout: 244 seconds]
NeverDie has joined #ruby
Papierkorb has quit [Ping timeout: 244 seconds]
Papierkorb_ has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Jester13 has joined #ruby
Musashi007 has quit [Quit: Musashi007]
radgeRayden has joined #ruby
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
texasmade has quit [Ping timeout: 264 seconds]
pkrueger has quit [Quit: Leaving]
xcyclist has quit [Ping timeout: 246 seconds]
Azure has joined #ruby
ramfjord has quit [Ping timeout: 244 seconds]
jenrzzz_ has quit [Ping timeout: 240 seconds]
rcvalle has joined #ruby
neoseeker has quit [Remote host closed the connection]
neoseeker has joined #ruby
Yzguy has quit [Quit: Zzz...]
webopsx has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
The_Phoenix has joined #ruby
crdpink2 has joined #ruby
crdpink has quit [Ping timeout: 244 seconds]
eminencehc has joined #ruby
tuxtgz has quit [Ping timeout: 255 seconds]
_blizzy_ has quit [Ping timeout: 244 seconds]
Vile` has quit [Remote host closed the connection]
<aaeron>
Hi Ox0dea: I used multipart post to upload a file. I am not sure how to do a regular set_form_data post using this. Hence I decided to use RestClient. My concern is that how does it upload the file. Does it put everything in memory or does it do a streaming post
<aaeron>
There documentation does not provide enough information
neoseeker has quit [Remote host closed the connection]
<tabakhase>
when installing my gem as --dev it correctly gets bundler and rake - but fails on installing spec
<Coraline>
aaeron: is this for a Rails app?
<tabakhase>
"rspec requires rspec-core (~> 3.3.0)" and fails like that ignoring whatever stack of versions i specify
werelivinginthef has quit [Ping timeout: 244 seconds]
<aaeron>
Coraline: nope
kenndel has joined #ruby
RobertBirnie has joined #ruby
<Coraline>
tabakhase: how are you specifying rpsec in your gem spec?
Yzguy has quit [Client Quit]
<Coraline>
aaeron: sorry, I'm not familiar enough with RestClient to answer that.
<Coraline>
aaeron: you could browse the source?
<aaeron>
Oh. np Coraline
<aaeron>
Okay I can try that
<tabakhase>
Coraline first i had a "spec.add_development_dependency 'rspec'" - but that gave me a 0.9.2 at some point :D - so im struggeling to say "+3" i think
<tabakhase>
'~> 3.3.0' would seem legit, but fails with sayd error
<Ox0dea>
That seems to indicate that it's at least capable of streaming.
<Coraline>
tabakhase: try specifying the gem version
<tabakhase>
funFact now, when i run the install of my bundler in my repo it can install rspec correctly (using rspec-core 3.3.2)
rcvalle has quit [Quit: rcvalle]
<aaeron>
Ox0dea. thanks.
<Ox0dea>
Sure thing.
Papierkorb_ has quit [Quit: ArchLinux completes an endless loop faster than any other distro!]
<aaeron>
But I am not sure if that is the default use
<Ox0dea>
How do you mean?
<Ox0dea>
You're doing a POST, no?
<aaeron>
Yes
<tabakhase>
EOL is "spec.add_development_dependency "rspec", "~> 3.0"" works fine with bundler, but fails with checking spec-core using "gem instal --dev"
<aaeron>
Oh I was thinking if we are suppose to specify stream somewhere
arescorpio has quit [Read error: Connection reset by peer]
<aaeron>
Like in this
<aaeron>
RestClient.post( url,
<aaeron>
{
<aaeron>
:transfer => {
<aaeron>
:path => '/foo/bar',
<aaeron>
:owner => 'that_guy',
<aaeron>
:group => 'those_guys'
<aaeron>
},
<aaeron>
:upload => {
<aaeron>
:file => File.new(path, 'rb')
<aaeron>
}
<aaeron>
})
<Ox0dea>
This guy.
auzty has quit [Ping timeout: 264 seconds]
<aaeron>
They hav e this
<aaeron>
•manually handle the response (e.g. to operate on it as a stream rather than reading it all into memory)
<aaeron>
In their readme
<Ox0dea>
Right, you'll need to set up a block to handle the streamed response if that's what you intend to do.
<aaeron>
Okay
kies^ has joined #ruby
<Ox0dea>
aaeron: RestClient.post eventually calls #net_http_do_request, to clarify.
jeramyRR has quit [Quit: Peace out!]
<aaeron>
that helps
<aaeron>
Thanks Ox0dea
<Radar>
aaeron: no spam plzkthx
<Coraline>
tabakhase do you mean bundle install?
joneshf-laptop has quit [Remote host closed the connection]
<tabakhase>
Coraline jep
<aaeron>
Radar: I meant no spam
<Radar>
gg
<Emmanuel_Chanel>
Hello! Someone knows some good file uploader CGI software in open source or so?
braincrash has joined #ruby
<Ox0dea>
> 2015 cgi
<Coraline>
tabakhase: take a look inside your Gemfile.lock and see if rspec-core is there
joneshf-laptop has joined #ruby
dorei has quit [Ping timeout: 244 seconds]
workmad3 has joined #ruby
tkuchiki has joined #ruby
<tabakhase>
Coraline in the .gem tar that i try to install Gemfile.lock is not present -- in my repo (what is a exact clone of this VM) i have rspec-core (3.3.2) -- "bundle install" also sucessfully installs 3.3.2 on the test machine
<tabakhase>
just the "gem install --dev" method does not find it
bendiken has joined #ruby
braincras has quit [Ping timeout: 246 seconds]
chills42 has joined #ruby
davedev24 has quit []
<tabakhase>
i also tryed listing all the dependencies for the rspec package, no success ether
swgillespie has joined #ruby
markholmes has joined #ruby
sarkyniin has quit [Quit: Quit]
workmad3 has quit [Ping timeout: 240 seconds]
kenndel has quit [Quit: Leaving]
towski_ has quit [Remote host closed the connection]
auzty has joined #ruby
chills42 has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
<sevenseacat>
til.
<Ox0dea>
craysiii: Kernel.Integer raises an ArgumentError on non-numeric input.
duder has quit [Client Quit]
mary5030 has joined #ruby
<Ox0dea>
sevenseacat: It's done this way to faciliate using bang methods in conditionals.
<craysiii>
>> Integer(:a)
<ruboto>
craysiii # => can't convert Symbol into Integer (TypeError) ...check link for more (https://eval.in/407087)
<Ox0dea>
>> Integer('foo') rescue $!
<ruboto>
Ox0dea # => #<ArgumentError: invalid value for Integer(): "foo"> (https://eval.in/407088)
<craysiii>
what does $! mean
<Ox0dea>
For what it's worth, #chomp is superfluous for both Integer() and #to_i.
<Ox0dea>
craysiii: It contains the most recent Exception.
<craysiii>
thanks
juanpablo____ has quit [Ping timeout: 265 seconds]
<Ox0dea>
Sure thing.
t_ has joined #ruby
destructure has quit [Quit: Lost terminal]
<Ox0dea>
texasmade: Ruby's === is not like JavaScript's.
mary5030 has quit [Ping timeout: 246 seconds]
<texasmade>
it all starts to make more sense the more I practice. I think a large part of it is that I still have other languages fresh in my mind since I've been cramming the past few weeks and just started to focus soley on ruby as of two days ago
scripore has quit [Quit: This computer has gone to sleep]
<craysiii>
texas what wwere you studying before
<texasmade>
I started with Python and Javascript.
<craysiii>
ah. i love python, but im starting to love ruby more
willywos has quit [Quit: leaving]
<texasmade>
I've decided to stick with Ruby until i get fairly decent and then try my hand at Java
<sevenseacat>
loljava
<Aeyrix>
Java's okay.
<sevenseacat>
why would you subject yourself to that
<texasmade>
I like Ruby the most so far.
<Aeyrix>
I wrote Java for Bukkit / Minecraft stuff a few years back.
<craysiii>
java bad. scala good
<texasmade>
just for the experience
krz has joined #ruby
<texasmade>
a friend said if i was going to move from ruby to another language then Java would be a good choice before going to C/C++
<sevenseacat>
I tend to avoid experiences that I know will make me want to not program anymore
<Aeyrix>
Why do you want to learn C / C++ though?
<Aeyrix>
sevenseacat: tbh I enjoyed Java.
<Aeyrix>
Granted the APIs I was working with were really quite nice, very well documented, and logically named.
<texasmade>
I like having experience in multiple areas in case the need to know arises
gwendall has quit [Remote host closed the connection]
Fezzler has quit [Quit: Leaving]
Fezzler has joined #ruby
michas has joined #ruby
Sypheren has joined #ruby
astrobun_ has joined #ruby
lee_ has joined #ruby
j4cknewt has quit [Remote host closed the connection]
qiukun has quit [Quit: qiukun]
Fezzler has quit [Client Quit]
leesharma has quit [Ping timeout: 244 seconds]
<michas>
hi, is it possible to define assignment to an attribute like `def foo=(arg1,arg2)`? how do you assign afterwards? for example `object.foo=(1,2)` does not work.
sevenseacat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<craysiii>
you could assign values to a hash and pass that to your method.
<Ox0dea>
michas: You'll have to use #send. :(
jbw has quit [Ping timeout: 244 seconds]
lxsameer has joined #ruby
<Ox0dea>
Alternatively, consider not inflicting upon yourself so complex a setter. :P
lxsameer has quit [Changing host]
lxsameer has joined #ruby
<craysiii>
hm interesting, that send method is.
Saloaty has joined #ruby
<michas>
Ox0dea, ok, so simply assigning will always call the method with a single argument and this kind of definition therefore does not make sense at all?
astrobunny has quit [Ping timeout: 272 seconds]
GriffinHeart has joined #ruby
deepu has joined #ruby
jbw has joined #ruby
Saloaty has left #ruby [#ruby]
keen__________32 has quit [Read error: Connection reset by peer]
oo_ has joined #ruby
marsjaninzmarsa has quit [Quit: ZNC - http://znc.in]
marsjaninzmarsa has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
keen__________32 has joined #ruby
Sypheren has quit [Ping timeout: 244 seconds]
<Ox0dea>
michas: foo=(1, 2) could be a call to method `foo=` with two arguments, or it could be assigning the result of the expression `(1, 2)` to the local variable `foo`; alas, the language does not disambiguate as you might wish in this case.
oo_ has quit [Ping timeout: 244 seconds]
<michas>
ok, makes sense. thx
<Ox0dea>
Sure thing.
Rickmasta has joined #ruby
<Ox0dea>
Note well that you can still invoke the method with #send if you simply must.
yfeldblu_ has joined #ruby
lannonbr has quit [Quit: WeeChat 1.2]
oo_ has joined #ruby
icebourg has quit []
{756d6f} has joined #ruby
yfeldblum has quit [Ping timeout: 260 seconds]
havenwood has joined #ruby
DJSpies has quit [Ping timeout: 260 seconds]
nklv has quit [Quit: nklv]
kies^ has quit [Ping timeout: 260 seconds]
dented42 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
aphprentice has quit [Read error: Connection timed out]
Axy has joined #ruby
Axy has joined #ruby
astrobun_ has quit [Remote host closed the connection]
tsujp has quit [Quit: tsujp is snoozing]
Mia has quit [Ping timeout: 265 seconds]
sphex has quit [Read error: Connection reset by peer]
krz has quit [Ping timeout: 244 seconds]
triangles has quit [Read error: Connection reset by peer]
triangles has joined #ruby
s1kx_ has joined #ruby
freerobby1 has quit [Quit: Leaving.]
sphex has joined #ruby
s1kx has quit [Read error: Connection reset by peer]
brainslug has quit [Ping timeout: 244 seconds]
PlasmaStar has quit [Ping timeout: 244 seconds]
woodruffw has quit [Remote host closed the connection]
valetudo has joined #ruby
brainslug has joined #ruby
woodruffw has joined #ruby
PlasmaStar has joined #ruby
schaerli has quit [Remote host closed the connection]
Mendenhall has joined #ruby
vale_tudo has quit [Ping timeout: 255 seconds]
jackjackdripper has joined #ruby
riotjones has joined #ruby
iwaffles has joined #ruby
iwaffles has quit [Client Quit]
riotjones has quit [Read error: Connection reset by peer]
riotjones has joined #ruby
MatthewsFace has quit [Remote host closed the connection]
Dopagod has quit [Remote host closed the connection]
lkba_ has joined #ruby
n_blownapart has joined #ruby
astrobunny has joined #ruby
sdwrage has quit [Quit: This computer has gone to sleep]
lkba has quit [Ping timeout: 240 seconds]
GriffinHeart has quit [Ping timeout: 256 seconds]
j4cknewt has joined #ruby
riotjones has quit [Ping timeout: 244 seconds]
Guest32 has joined #ruby
qiukun has joined #ruby
ips|malc has joined #ruby
GriffinHeart has joined #ruby
davedev24 has quit [Read error: Connection reset by peer]
davedev2_ has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
hahuang65 has joined #ruby
SOLDIERz has joined #ruby
sevenseacat has joined #ruby
eggoez has quit [Ping timeout: 256 seconds]
yardenbar has joined #ruby
GriffinHeart has joined #ruby
workmad3 has joined #ruby
hahuang65 has quit [Ping timeout: 246 seconds]
eggoez has joined #ruby
konsolebox has joined #ruby
blueOxigen has joined #ruby
havenwood has quit [Ping timeout: 252 seconds]
theery has quit [Remote host closed the connection]
theery has joined #ruby
aaeron has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
bluOxigen has quit [Ping timeout: 255 seconds]
Ox0dea has quit [Quit: WeeChat 1.2]
Ox0dea has joined #ruby
mollymorphic has quit [Remote host closed the connection]
platosha has quit [Read error: Connection reset by peer]
arup_r has joined #ruby
platosha has joined #ruby
Musashi007 has joined #ruby
devdazed has joined #ruby
Musashi007 has quit [Client Quit]
aganov has joined #ruby
Musashi007 has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
dented42 has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Mendenhall has quit [Ping timeout: 265 seconds]
<arup_r>
I have set of packages.. Now when a user select start and end date, I would like to show the user the minimum price by doing all combination of packages. No package can be taken as a half package. Any idea how to approach it? I was trying something, but not seems a way to solve it. https://gist.github.com/aruprakshit/d3833e654ca04da8340d
webopsx has quit [Ping timeout: 252 seconds]
Contigi has joined #ruby
devdazed has quit [Quit: Computer has gone to sleep.]
tubuliferous_ has quit [Ping timeout: 244 seconds]
user1138 has joined #ruby
omegamike has joined #ruby
lee_ has quit [Ping timeout: 240 seconds]
MasterPiece has joined #ruby
ips|malc has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mbeasley_ has quit [Ping timeout: 240 seconds]
leesharma has joined #ruby
Alayde has quit [Ping timeout: 265 seconds]
omegamike has quit [Ping timeout: 246 seconds]
_blizzy_ has joined #ruby
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
_blizzy_ has quit [Max SendQ exceeded]
jackjackdripper has joined #ruby
jackjackdripper has quit [Client Quit]
_blizzy_ has joined #ruby
shock_one has joined #ruby
tagrudev has joined #ruby
_blizzy_ has quit [Read error: Connection reset by peer]
bmcginty has quit [Ping timeout: 244 seconds]
mary5030 has joined #ruby
Averna has joined #ruby
_blizzy_ has joined #ruby
juanpablo____ has joined #ruby
psy_ has joined #ruby
andikr has joined #ruby
_cake has joined #ruby
mary5030 has quit [Remote host closed the connection]
_cake_ has joined #ruby
mary5030 has joined #ruby
juanpablo____ has quit [Ping timeout: 255 seconds]
_cake_ has left #ruby [#ruby]
RobertBirnie has joined #ruby
qiukun has quit [Quit: qiukun]
_cake has quit [Ping timeout: 246 seconds]
RobertBi_ has joined #ruby
<Ox0dea>
shock_one: I've been thinking of how best to add Uberscore.no_conflict(:it).
{756d6f} has quit [Ping timeout: 264 seconds]
mary5030 has quit [Ping timeout: 260 seconds]
ferr has joined #ruby
<Ox0dea>
The magic would have to happen right before the first _ is needed, which is tricky.
tkuchiki has quit [Remote host closed the connection]
atmosx has joined #ruby
atmosx has quit [Client Quit]
<shock_one>
Ox0dea: should it undefine itself after usage or how is it no conflict?
havenwood has joined #ruby
atmosx has joined #ruby
<Ox0dea>
shock_one: Ideally, Kernel._ shouldn't come into existence until it's actually used the first time.
bruno- has joined #ruby
timonv has joined #ruby
mercwithamouth has joined #ruby
RobertBirnie has quit [Ping timeout: 265 seconds]
<Ox0dea>
Anything else is open to potential conflict.
ohaibbq has joined #ruby
Sypheren has joined #ruby
<Ox0dea>
It'd be easy enough to just call it something else if either of the IRB or Pry constants exist, but that's not very general.
<shock_one>
Ox0dea: what if we allowed to choose the name?
<Ox0dea>
shock_one: Aye, I think Uberscore.no_conflict should take an argument that defaults to :it, but _ should just automagically work if and where appropriate.
code_[BNC] has quit [Ping timeout: 246 seconds]
sepp2k has joined #ruby
<shock_one>
I don't get why there should be two names: it and _.
Musashi007 has quit [Quit: Musashi007]
<Ox0dea>
Only one or the other should exist, depending on the environment.
<shock_one>
brb
<Ox0dea>
Non-_ in REPLs where _ already has a more useful definition, and non-_ if no_conflict has been explicitly requested.
mbeasley_ has joined #ruby
bruno- has quit [Ping timeout: 255 seconds]
Sypheren has quit [Ping timeout: 246 seconds]
_ht has joined #ruby
casadei_ has quit [Remote host closed the connection]
Sypheren has joined #ruby
riotjones has joined #ruby
Stratege has joined #ruby
craysiii has left #ruby [#ruby]
sargas has joined #ruby
riffraff has joined #ruby
acke has joined #ruby
Sypheren has quit [Ping timeout: 265 seconds]
allomov has joined #ruby
laurentide has quit [Quit: Leaving]
MasterPiece has quit [Remote host closed the connection]
<michas>
I currently have a hash mapping one number to another and I want to persist it between different executions of the application. I probably want some very simple key-valu store. Any recomendation for that?
<Aeyrix>
Hardcode it?
<michas>
Aeyrix, no it will change during the run.
<Aeyrix>
json
<Aeyrix>
yaml
<Aeyrix>
daybreak
{756d6f} has joined #ruby
tkuchiki has joined #ruby
j4cknewt has quit [Remote host closed the connection]
Sypheren has joined #ruby
j4cknewt has joined #ruby
ndrei has quit [Ping timeout: 246 seconds]
<michas>
Aeyrix, daybreak looks good. did not know about this yet. thx.
<Aeyrix>
No prob.
sinkensabe has joined #ruby
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sargas has quit [Quit: This computer has gone to sleep]
timonv has quit [Ping timeout: 260 seconds]
fedexo has joined #ruby
j4cknewt has quit [Ping timeout: 246 seconds]
Sypheren has quit [Ping timeout: 246 seconds]
theery has quit [Remote host closed the connection]
astrobunny has quit [Remote host closed the connection]
Musashi007 has joined #ruby
sdwrage has quit [Client Quit]
astrobunny has joined #ruby
<shock_one>
I like another import more. If the user chooses to import the second file, we don't create the method automatically, but she has to call the no_conflict method by herself.
robbyoconnor has quit [Remote host closed the connection]
<arup_r>
That's a actual problem
<arup_r>
craysiii, { 0=>11, 3 => 11, 7 => 11}
<bnagy>
arup_r: then my dumb solution above "works"
<arup_r>
I have an intention of finding this out..
<arup_r>
bnagy, no it wouldn't when the input date range will be too long..
j4cknewt has quit [Ping timeout: 246 seconds]
<zenspider>
suuure looks like some sort of interview question
qiukun has joined #ruby
<arup_r>
there can be many sundays.. and
livathinos has joined #ruby
<abdulrehman>
morning
<arup_r>
zenspider, no it is not.. It is my application problem.. I am trying to solve it
<arup_r>
Better way
RobertBi_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<zenspider>
poorly defined either way
Iskarlar has joined #ruby
<arup_r>
may be
Musashi007 has joined #ruby
roolo has quit [Remote host closed the connection]
<bnagy>
this looks like some kind of knapsack problem
<bnagy>
although I don't really get your description
<zenspider>
neither do I
fabrice31_ has joined #ruby
<bnagy>
knapsack is np hard, although that's not a big deal if your domain is small
fabrice31_ has quit [Remote host closed the connection]
fabrice31_ has joined #ruby
<bnagy>
if a heuristic is allowed I would probably just do some kind of greedy approach
<bnagy>
but it won't always produce the best solution
allomov has quit [Remote host closed the connection]
<arup_r>
thing is I have some predefined packages.. if user selects any predefined package then price is ready. If they choose their custom dates.. I'll try to find out the minimum price by doing all combination of packages and give them the minimum price
robbyoconnor has joined #ruby
<arup_r>
Don't know if it makes sense or not
<craysiii>
def distance(arr, num)
<craysiii>
arr.each_with_index.to_a.map(&:reverse).to_h.select { |k,v| v == num }
<craysiii>
end
<craysiii>
dont know why my client sent that as three messages.
fabrice31 has quit [Ping timeout: 256 seconds]
serivich has joined #ruby
schaerli has joined #ruby
<craysiii>
anyway arup_r that works as intended. thanks to bnagy
<arup_r>
Ok.. I am writing it.. then I'll show you people.. if it can be improved
schaerli has quit [Remote host closed the connection]
<Ox0dea>
It's not the same thing, but you should get a relevant vibe. :)
mikecmpbll has joined #ruby
<sevenseacat>
For example, {x, y} is equivalent to: {x: x, y: y} <--- waaaaat
<craysiii>
ya i dont know why i'd want that
* sevenseacat
is over here nononononononononoing at that issue
<Ox0dea>
I don't know why you'd *want* to have to type @foo = far, @bar = bar either, to be honest.
<Ox0dea>
sevenseacat: Note well matz's outright rejection of the thing.
<sevenseacat>
and sanity prevails.
<Ox0dea>
> foo = far
ecksit has joined #ruby
Musashi007 has quit [Quit: Musashi007]
<adaedra>
That doesn't really tell why `def initialize(@a, @b)` whould be bad.
bmcginty has joined #ruby
<Ox0dea>
(It's because parse.y is scary.)
<sevenseacat>
`initialize` is not some sacred method, so you cant define special notation like that for it
<craysiii>
what if you're given malformed input or want to validate before assignment
schaerli has joined #ruby
<sevenseacat>
and if you want to apply it to all methods, you just want to blindly reassign instance variable methods?
<sevenseacat>
-methods
texasmade has joined #ruby
<adaedra>
craysiii: then you use the old style
<Ox0dea>
Sanity 2 | 0 Madness
<abdulrehman>
guys any idea how to formate/convert scientific exponential to float
<Ox0dea>
DefV: Struct too heavy?
<zenspider>
old-style hash in <=1.8 is my reason to reject that. ... also... horrible idea
<zenspider>
gah. we need LESS syntax, not more.
<Ox0dea>
abdulrehman: Kernel.Float or String#to_f should do.
<Ox0dea>
?guys abdulrehman
<ruboto>
abdulrehman, You probably don't mean to exclude, but not everyone relates to being "one of the guys". Maybe consider using "folk", "y'all" or "everyone" instead?
<bnagy>
zenspider: that ship has sailed
<DefV>
Ox0dea: not always possible to inherit from Struct
<sevenseacat>
to be fair I still do not like ruby 1.9 hash syntax, i believe it should be consistent no matter what the key type.
<Ox0dea>
unshadow: #gets is a method on instances of IO, not IO itself.
dtcristo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
CustosLimen has joined #ruby
riffraff has joined #ruby
thiagovsk has quit [Quit: Connection closed for inactivity]
GriffinHeart has joined #ruby
shock_one has quit [Read error: No route to host]
shock_one has joined #ruby
<Ox0dea>
unshadow: Consider what would happen if a malicious entity just started firing data at your thing, careful to never include a line terminator.
bumbar_ has joined #ruby
bumbar_ has joined #ruby
<Ox0dea>
In such a case, #gets would just keep reading and reading.
Hounddog has joined #ruby
dtcristo has joined #ruby
<Ox0dea>
Giving it an argument (4096, in this case) tells #gets to stop after that many bytes have been read.
<unshadow>
Ox0dea: I know, gets alone, will read untill it sees "\n", using gets("bla"), will make it read untill it reads the word "bla", looking at the documents, if I'll use a gets("\n", 4096) that means it will read "\n" or untill it sees 4096 ?
<Ox0dea>
Yes, that's right.
Siyfion has joined #ruby
<unshadow>
So here is my wierd issue, when using this, gets("\r\n". 4096) I get this error: comparison of Fixnum with nil failed
axl_ has joined #ruby
<Ox0dea>
Is that period a typo?
<sevenseacat>
thats a . there?
<unshadow>
typo
<unshadow>
it shoud be a ,
marr has joined #ruby
<Ox0dea>
unshadow: Are you able to post code?
hanmac1 has joined #ruby
<Ox0dea>
That call to #gets is certainly not the thing introducing the unexpected nil.
<Ox0dea>
Well, shit, I suppose it could be if there's no data left to be read.
<Ox0dea>
craysiii: Method and UnboundMethod, more or less.
* ljarvis
doesn't hate parenthesis
<Ox0dea>
ljarvis: Left or right?
<ljarvis>
Ox0dea: I love them all
zeroDivisible has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<craysiii>
oh Proc.
<craysiii>
can be assigned to variable
lkba_ has quit [Ping timeout: 244 seconds]
<Ox0dea>
As can be Methods and UnboundMethods, for what that's worth.
<ljarvis>
any method can be assigned to a variable
<ljarvis>
methods are objects too
<craysiii>
a block can't be assigned though, because it's not an object :)
<ljarvis>
what?
<craysiii>
that's what ive read
<ljarvis>
what do you mean by "a block"?
<craysiii>
{ }
<craysiii>
do .. end
<ljarvis>
that's a hash
fabrice31_ has quit [Ping timeout: 244 seconds]
<ljarvis>
and of course a method block can be assigned
<Ox0dea>
But then it's a Proc.
<craysiii>
yes.
<ljarvis>
so that means it's not assigned?
<Ox0dea>
No, it means it's not a block.
timonv has quit [Ping timeout: 264 seconds]
<ljarvis>
well that's pedantic
<Ox0dea>
Then why do we have two names?
<ljarvis>
this is Ruby, there's five names for everything
mikecmpbll has quit [Ping timeout: 244 seconds]
mikecmpb_ has joined #ruby
<ljarvis>
sure semantics are different, but i wouldn't say you're not assigning that block to a variable, just because it's now a proc, it still works as expected from a logical sense
<Ox0dea>
ljarvis: You sort of started that debate by and with yourself.
michael_mbp has quit [Excess Flood]
<ljarvis>
"a block can't be assigned though" is what I debated
tennis has joined #ruby
<Ox0dea>
In that case, I believe you must admit defeat.
ruurd has quit [Quit: ZZZzzz…]
<Ox0dea>
It is indeed the case that a Ruby variable cannot contain a Ruby block.
mikecmpb_ has quit [Read error: Connection reset by peer]
ruurd has joined #ruby
<Ox0dea>
Block != Proc, since we can pass n Procs to a method, but only at most one block.
<Ox0dea>
They are simply (slightly) different things.
oo_ has quit [Ping timeout: 265 seconds]
<zenspider>
ljarvis: this whole block vs proc are not equivalent debate? imho, you can ignore Ox0dea on this one
<Ox0dea>
Get 'im, tiger.
mikecmpbll has joined #ruby
michael_mbp has joined #ruby
<yorickpeterse>
Blocks and procs are identical
<yorickpeterse>
blocks is just the name for the syntax of `foo do ... end`
Sypheren has joined #ruby
<yorickpeterse>
and technically there's nothing stopping you from passing multiple Procs to a method
ruurd has quit [Client Quit]
<yorickpeterse>
It's the syntax that doesn't allow multiple ones
<adaedra>
That's what Ox0dea said?
schaerli has joined #ruby
<yorickpeterse>
Ox0dea | Block != Proc, since we can pass n Procs to a method, but only at most one block.
vdamewood has quit [Remote host closed the connection]
oo_ has joined #ruby
ruurd has joined #ruby
gwendall has joined #ruby
<craysiii>
can a block be passed as an argument or only yielded to?
<yorickpeterse>
`foo do ... end` is nothing more than `foo(proc { ... })`
<zenspider>
you can use the &syntax to reify the block to a var: def a_method(&block),
lkba has joined #ruby
<zenspider>
then you can either block.call, block[], or iirc, still yield
<Ox0dea>
Why are you people using #puts on ruboto?!
tjbiddle has quit [Quit: tjbiddle]
<craysiii>
meh
bronson has joined #ruby
* craysiii
scurries to bed
<adaedra>
because it works
<zenspider>
meh * 2
RegulationD has quit [Ping timeout: 240 seconds]
<Ox0dea>
It's the "check link for more" bit that does it; we shouldn't force the machines to lie to us.
<craysiii>
but theres a whole \n were missing
<craysiii>
think of the children.
senayar has quit [Remote host closed the connection]
Kilo`byte has quit [Ping timeout: 256 seconds]
schaerli has quit [Remote host closed the connection]
senayar has joined #ruby
<shevy>
one day the world may run out of \n
juanpablo____ has quit [Ping timeout: 265 seconds]
<yorickpeterse>
Then we'll need \nv6
Musashi007 has quit [Quit: Musashi007]
dtcristo has joined #ruby
bronson has quit [Ping timeout: 264 seconds]
tvw has quit []
rikkipitt has joined #ruby
ramfjord has quit [Ping timeout: 246 seconds]
mdih has joined #ruby
Vile` has quit [Ping timeout: 246 seconds]
platzhirsch has joined #ruby
<mdih>
hello, i understand that this is kinda off topic..but since openproject is based on ruby, ill just ask here hehe...do you guys know whats its irc channel? cant find it :(
<abdulrehman>
welcome back adaedra
<adaedra>
back? I'm always here.
codecop has quit [Remote host closed the connection]
<abdulrehman>
yorickpeterse: thanks, and done!! I knew of it, I was just using it wrong
<abdulrehman>
adaedra: thanks, and I won't dress you any more buddy!! I'll dress ruboto :-p
Rickmasta has joined #ruby
<Ox0dea>
abdulrehman: Please let people choose their own outfits.
<adaedra>
o k
tsujp has quit [Quit: tsujp is snoozing]
<workmad3>
adaedra: aww, you just lost your personal fashion assistant :(
<adaedra>
:'(
khebbie has quit [Ping timeout: 240 seconds]
Zai00 has quit [Client Quit]
<Ox0dea>
Fella's over there puttin' clothes on machines now.
<adaedra>
I'll code a plugin to `derpy to do that.
<abdulrehman>
hey, obama didn't give you guys care health options, why should I give you fashion options!!!
<Ox0dea>
?ot abdulrehman
<ruboto>
abdulrehman, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<adaedra>
we're not all guys, and not all americans.
schaerli has joined #ruby
Sypheren has joined #ruby
Zai00 has joined #ruby
<abdulrehman>
ruboto: sorry, yah no more off topics, adaedra also yes I know, I was just kidding....
<adaedra>
workmad3 is american, ask him.
tvw has quit [Remote host closed the connection]
<arup_r>
abdulrehman, ruboto has no sense of humour,, don't call :)
tvw has joined #ruby
Zai00 has quit [Client Quit]
<workmad3>
adaedra: I'm trying not to take offence at that...
felixr has quit [Quit: Konversation terminated!]
<adaedra>
what
<workmad3>
adaedra: calling me ... american... *shudder*
felixr has joined #ruby
<workmad3>
:P
<adaedra>
british, american, all the same
<adaedra>
:P
dionysus69 has quit [Ping timeout: 255 seconds]
mathie has quit [Quit: Quitting...]
Trynemjoel has quit [Ping timeout: 256 seconds]
mathie has joined #ruby
<shevy>
le french
<adaedra>
le autrichien
<yorickpeterse>
baguette
Trynemjoel has joined #ruby
Sypheren has quit [Ping timeout: 240 seconds]
fabrice31 has quit [Remote host closed the connection]
rdark has quit [Ping timeout: 272 seconds]
<ljarvis>
baguette fromage
<adaedra>
I could also do a list of all French words I know
stamina has joined #ruby
<unshadow>
Ox0dea: So, it seems the non-ssl version (the one without the Regexp support) wont return fixnum error
frem has quit [Quit: Connection closed for inactivity]
marius has quit [Read error: Connection reset by peer]
marius has joined #ruby
zeeraw has joined #ruby
anisha has quit [Ping timeout: 246 seconds]
<abdulrehman>
arup_r: well, he works with ruby, I am sure he has some sense of humour hahaha
acke has quit [Read error: Connection reset by peer]
acke has joined #ruby
<adaedra>
?botsnack
<ruboto>
nomnomnomnom
quimrstorres has quit [Remote host closed the connection]
<arup_r>
bnagy, you there ?
quimrstorres has joined #ruby
fabrice31 has joined #ruby
fabrice31 has quit [Remote host closed the connection]
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
rdark has joined #ruby
fabrice31 has joined #ruby
tvw has quit [Remote host closed the connection]
<bnagy>
yes
tvw has joined #ruby
tvw has quit [Client Quit]
Trynemjoel has quit [Ping timeout: 256 seconds]
<arup_r>
I wrote it for simple scenario.. Now not able to decide how to approach when I have a input date ranges where more than 1 same or different packge will exist...
<DaniG2k>
jhass: check the self.configure method :D
<DaniG2k>
also, pay special attention to the self.❨╯°□°❩╯︵┻━┻ method
<jhass>
shamelessly stolen from sidekiq
<jhass>
but yeah, like that
<DaniG2k>
hahaha
<DaniG2k>
yesssssss
ynroot has quit [Client Quit]
Sypheren has joined #ruby
<jhass>
and then have Configuration have good defaults or raise on missing values
dgutierrez1287 has joined #ruby
<DaniG2k>
ok so, excuse the ignorance but if someone were to define the index file like that, I'd need to have some logic to create that file. I'm thinking that it might actually be best to just create the index file without prompting the user at all :S
<DaniG2k>
Configuration should probably just have it by default
bruno- has quit [Ping timeout: 256 seconds]
TvL2386 has joined #ruby
<jhass>
so you're actually asking what a good default location for the index file would be?
Muhannad has quit [Ping timeout: 240 seconds]
auzty has quit [Quit: Leaving]
<DaniG2k>
basically all I want is for the index file to be found if it's already there or be created anew if it's not. I don't think prompting the user is actually a good idea now that I think of it
j4cknewt has joined #ruby
<DaniG2k>
jhass: that was my initial idea yes. Probably just /config would be ok
<jhass>
well, I'm not sure what your index file does but depending on how persistent it needs to be, in the context of a rails app I'd go for tmp/ or vendor/
Igorshp has quit [Ping timeout: 264 seconds]
<jhass>
or even db/
<DaniG2k>
jhass: good point
<jhass>
(which is where eg sqlite DBs live iirc)
<DaniG2k>
db/ is probably a good starting point
<DaniG2k>
yeah
<DaniG2k>
jhass: if I create a db directory....does it appear in the Rails app's same db directory? how would that work?
<DaniG2k>
i mean, if I create a db directory within my gem.
<jhass>
Rails.root should be available in a rails engine
strixd has joined #ruby
<DaniG2k>
I'm making a gem not an Engine :\ not sure if that makes a difference.
<jhass>
you blabbered something about a railtie, sounds quite a bit like an engine to me
<DaniG2k>
so if all one needs to make an engine is class Railtie < Rails::Railtie then yes, my gem's an engine :)
<workmad3>
DaniG2k: you're about 99% of the way to making that into a gem that mounts as an engine if rails is present
anisha has quit [Ping timeout: 250 seconds]
<workmad3>
DaniG2k: you'd just need to change Rails::Railtie to Rails::Engine
<DaniG2k>
awesome
Sypheren has quit [Ping timeout: 256 seconds]
ldnunes has joined #ruby
<DaniG2k>
wow
<DaniG2k>
didn't know that
<DaniG2k>
thanks
<workmad3>
DaniG2k: you probably don't need that though... the configuration, generator setup, rake tasks & initializer hooks are all accessed through Railtie (which Engine inherits)
y0da has joined #ruby
but3k4 has quit [Read error: Connection reset by peer]
<DaniG2k>
if I need the engine I'll use the rails plugin command :D
devyn has joined #ruby
Zai00 has joined #ruby
<workmad3>
DaniG2k: looking @ what you're trying btw, I'd personally suggest that you pass in a path to an index file when creating an Index, and the Index will create the file if it doesn't exist... you can then use your Railtie to set up a default path based on Rails.root that allows users to override it, and then use a Rails initializer to create an index on rails app bootup
tkuchiki has quit [Remote host closed the connection]
pyo_ has joined #ruby
ips|malc has joined #ruby
Sypheren has joined #ruby
<DaniG2k>
workmad3: I'd love to do that. Unfortunately I don't think I know how to :(
allomov has quit [Remote host closed the connection]
<jhass>
also this starts to get very Rails specific, maybe head over to #RubyOnRails ;)
<DaniG2k>
hahah yea
<jhass>
DaniG2k: I don't think you tried yet, you can make that claim in half an hour
<workmad3>
^^ maybe an hour... you need to find and read the guide on rails initializers too ;)
<DaniG2k>
jhass: I'm stuck on point #0: I created a db directory but git isn't picking it up
<DaniG2k>
hahah
jimms has quit [Remote host closed the connection]
<DaniG2k>
probably the gemspec file
bruno- has joined #ruby
<jhass>
git doesn't commit empty directories since it only tracks files
<DaniG2k>
ah that must be why
<jhass>
and the db/ directory should be the one of your app
<jhass>
not inside the gem
<jhass>
where you probably can't even write to when installed
iloverubynoob has joined #ruby
<DaniG2k>
ah that's the problem I've been having then
<DaniG2k>
I created a file but it was looking within the installed gem
_blizzy_ has joined #ruby
senayar has quit [Remote host closed the connection]
senayar has joined #ruby
shortCircuit__ has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<TheBrayn>
workmad3: thanks, that works great
<shortCircuit__>
A closure can be made with lambda and proc .. But is there any way to use only methods and maybe blocks and make a closure
schaerli has quit [Remote host closed the connection]
<jhass>
shortCircuit__: yes, blocks closure too
<jhass>
methods don't
tubuliferous_ has joined #ruby
<jhass>
but hint: you pass a block to define_method
fabrice31_ has quit [Remote host closed the connection]
<[k->
DaniG2k: we usually name the file .keep
anisha has joined #ruby
ips|malc has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shortCircuit__>
I actually tried , def foo(a,&b); b.call(a); end .. ;D bt that's not closure .
chipotle has joined #ruby
<shortCircuit__>
Ok checking
Sypheren has quit [Ping timeout: 264 seconds]
_blizzy_ has quit [Read error: Connection reset by peer]
stamina has quit [Quit: WeeChat 1.2]
<DaniG2k>
[k-: yea?
schaerli has joined #ruby
<[k->
yeah.
_blizzy_ has joined #ruby
cornerma1 has joined #ruby
<jhass>
shortCircuit__: just curious or have some real problem to solve?
tubuliferous_ has quit [Ping timeout: 244 seconds]
Feyn has quit [Ping timeout: 244 seconds]
<shortCircuit__>
Curious
s00pcan has joined #ruby
<shortCircuit__>
And also curious if lambda and proc are there then why would one do that :P
Papierkorb has quit [Read error: Connection reset by peer]
Papierkorb has joined #ruby
<jhass>
hard to argue in the general
<jhass>
each have their usecases
<yorickpeterse>
a lambda is nothing but a proc with required arguments and having its own "return" context
<yorickpeterse>
a proc is a closure, or as close as you can get
omegamike has joined #ruby
cornerman has quit [Ping timeout: 250 seconds]
cornerma1 is now known as cornerman
dimasg has joined #ruby
Silox| has quit [Quit: Connection closed for inactivity]
<jhass>
[k-: I've seen .gitkeep to be more common
devyn has quit [Ping timeout: 244 seconds]
aevitas_ has joined #ruby
<livcd>
yorickpeterse: what can you do with proc ? you can save a block with it and pass it around
<livcd>
anything else ?
yfeldblu_ has quit [Ping timeout: 246 seconds]
<shortCircuit__>
define_method(:foobar); do |block|; block.call(some_variable); end ?
<jhass>
^ don't ever do prod code depending on such behavior though
<shortCircuit__>
Yeah, in JavaScript terms if an inner method has a reference to a free variable in its parent scope , then it creates a closure .. So if we call the parent method, until and unless the child is called the context retains all env props of its parent ..
<shortCircuit__>
Something like that!!
j4cknewt has quit [Ping timeout: 244 seconds]
<[k->
time to use this for throwing people off!
shpoont has joined #ruby
<shortCircuit__>
Free variable meaning one that isn't in the parameter list or a local variable
<yorickpeterse>
livcd: blocks _are_ procs
[k-_ has joined #ruby
<jhass>
shortCircuit__: not sure why you try to receive and pass parameters then :/
j4cknewt has joined #ruby
<shortCircuit__>
Have to use yield?
mikecmpb_ has joined #ruby
j4cknewt has quit [Read error: Connection reset by peer]
sinkensabe has quit [Remote host closed the connection]
j4cknewt has joined #ruby
<shortCircuit__>
Ok
mikecmpbll has quit [Ping timeout: 240 seconds]
chills42 has quit [Remote host closed the connection]
<workmad3>
shortCircuit__: that passes an argument into the provided block
<shortCircuit__>
Now foo{|a| a+5}
<shortCircuit__>
Oh
<workmad3>
shortCircuit__: a closure is more like; `def foo; bar = yield; puts bar; end; a = 20; foo { a }` <-- (take a guess as to what that will do before running it)
devyn has joined #ruby
aevitas_ has quit [Ping timeout: 250 seconds]
oo_ has quit [Remote host closed the connection]
juanpablo____ has quit [Ping timeout: 260 seconds]
Rickmasta has joined #ruby
shortCircuit__ has quit [Ping timeout: 250 seconds]
sinkensabe has joined #ruby
rideh has joined #ruby
ferr has quit [Quit: WeeChat 1.2]
Violentr has quit [Ping timeout: 260 seconds]
yardenbar has joined #ruby
dimasg has quit [Ping timeout: 240 seconds]
bronson has joined #ruby
j4cknewt has quit [Ping timeout: 244 seconds]
mercwithamouth has quit [Ping timeout: 255 seconds]
vdamewood has quit [Ping timeout: 250 seconds]
shortCircuit__ has joined #ruby
felixr has quit [Quit: Konversation terminated!]
felixr has joined #ruby
TheHodge has quit [Quit: Connection closed for inactivity]
joneshf-laptop has quit [Ping timeout: 252 seconds]
Xiti has joined #ruby
bronson has quit [Ping timeout: 260 seconds]
<Fraeon>
I'm surprised nobody has come up with the idea of a malware that turns your computer part of a cloud that runs RoR apps
j4cknewt has joined #ruby
skyrocker has joined #ruby
skyrocker has left #ruby [#ruby]
dumdedum has quit [Quit: foo]
yardenbar has quit [Ping timeout: 252 seconds]
zeeraw has joined #ruby
centrx has joined #ruby
<centrx>
Hi shevys
joneshf-laptop has joined #ruby
<shortCircuit__>
workmad3 it should be 20 .. It's a closure because it can remember the value of bar when executed from outside like foo{a}
unshadow_ has joined #ruby
ruurd has quit [Quit: ZZZzzz…]
bruno- has quit [Ping timeout: 255 seconds]
<workmad3>
shortCircuit__: right answer, wrong explanation
dimasg has joined #ruby
<shortCircuit__>
:(
ruurd has joined #ruby
zeeraw has quit []
astrobunny has quit [Remote host closed the connection]
iateadonut has quit [Quit: Leaving.]
centrx has quit [Remote host closed the connection]
unshadow has quit [Ping timeout: 240 seconds]
but3k4 has joined #ruby
centrx has joined #ruby
zeeraw has joined #ruby
sdwrage has joined #ruby
y0da has quit [Read error: Connection reset by peer]
acovrig has joined #ruby
iateadonut has joined #ruby
j4cknewt has quit [Read error: Connection reset by peer]
unshadow_ has quit [Ping timeout: 244 seconds]
TheHodge has joined #ruby
unshadow has joined #ruby
manila90 has joined #ruby
sdwrage has quit [Client Quit]
Sypheren has joined #ruby
zeeraw has quit [Client Quit]
omegamike has joined #ruby
ruby-lang600 has joined #ruby
c0m0 has quit [Ping timeout: 260 seconds]
syath has joined #ruby
<manila90>
hi, i am curious if anyone knows a clean way to save the second IP of a subnet to a string, I am now using the ipaddress gem, where I save the subnet 10.1.1.0/24 into a IPAddress
chinmay_dd has quit [Read error: Connection reset by peer]
yeticry has quit [Ping timeout: 240 seconds]
aryaching has quit [Read error: Connection reset by peer]
snockerton has joined #ruby
schaerli has joined #ruby
yeticry has joined #ruby
sha89 has quit []
Sypheren has joined #ruby
vyorkin has joined #ruby
DaniG2k has joined #ruby
<alex88>
hi guys, with an hash resulting of a group_by so an hash of arrays of hashes, what's the shorter way to set the group_by hash values to the sum of a property of the hashes in the array?
charliesome has quit [Quit: zzz]
<adaedra>
?guys
<ruboto>
You probably don't mean to exclude, but not everyone relates to being "one of the guys". Maybe consider using "folk", "y'all" or "everyone" instead?
nveselinov has quit [Quit: Connection closed for inactivity]
<adaedra>
also, do you have an example of what you want?
symbol has joined #ruby
<alex88>
shouldn't be "folks" instead of folk?
<alex88>
anyway, let me gist
juanpablo____ has joined #ruby
<adaedra>
jhass, apeiros: ^
aryaching has joined #ruby
<ljarvis>
!fact ed guys You probably don't mean to exclude, but not everyone relates to being "one of the guys". Maybe consider using "folks", "y'all" or "everyone" instead?
<ruboto>
ljarvis, I stand corrected that guys is You probably don't mean to exclude, but not everyone relates to being "one of the guys". Maybe consider using "folks", "y'all" or "everyone" instead?
shevy has joined #ruby
tubuliferous_ has quit [Ping timeout: 250 seconds]
Sypheren has quit [Ping timeout: 240 seconds]
Igorshp has quit [Remote host closed the connection]
<alex88>
basically group by date and set the hash value of the corresponding date the sum of the `value` key of the hashes in the array corresponding to that date
<alex88>
so a group_by date and sum the values
<adaedra>
just the sum of values element as value in your root hash then?
krz has joined #ruby
<alex88>
yeah
<ljarvis>
values.inject(0) { |total, hash| total + hash[:value] }
n008f4g_ has joined #ruby
juanpablo____ has quit [Ping timeout: 272 seconds]
y0da has joined #ruby
but3k4 has quit [Read error: Connection reset by peer]
<alex88>
so it will be an hash of values which are the sum of the value key in the array
khebbie_ has quit [Remote host closed the connection]
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
podman has joined #ruby
<TheBrayn>
updated it with the error message
paulcsmith has joined #ruby
dtzitz has joined #ruby
NeverDie has joined #ruby
<ljarvis>
TheBrayn: you said "but I still get an undefined method exception for pg_array"
<ljarvis>
but that's not the error?
<TheBrayn>
right: configmanager_converter.rb:37:in `block (2 levels) in update_tables': undefined method `pg_array' for Sequel:Module (NoMethodError)
<ljarvis>
... that's not in the gist
<TheBrayn>
yeah I copied the wrong line
momomomomo has quit [Ping timeout: 252 seconds]
<ljarvis>
I'd ask in #sequel
kb3ien has joined #ruby
sinkensabe has quit [Remote host closed the connection]
senayar has quit [Remote host closed the connection]
kokoleavia has quit [Ping timeout: 246 seconds]
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
<abdulrehman>
guys/gals is there a way to embed ruby logic in a sql? so instead of using case statement use some if statement or unless statement to select one coloumn over the otehr i some conditions are met? or I am dead down to use sql?
<kb3ien>
trying to change a string '{"foo" => "bar"}' into something safe for an html string. I tried to use tmp.gsub(/\"/,'%22'); or tmp.gsub(/"/,'%22'); but nothing changed
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ljarvis>
?code abdulrehman
<ruboto>
abdulrehman, We can't help you without your code, please post it to https://gist.github.com
Violentr has quit [Ping timeout: 265 seconds]
<abdulrehman>
cool one minuite
scripore has joined #ruby
Sypheren has joined #ruby
momomomomo has joined #ruby
chills42 has joined #ruby
safeforge has joined #ruby
<ljarvis>
kb3ien: CGI.escapeHTML
rikkipitt has quit [Quit: Leaving...]
SOLDIERz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
CustosLimen has joined #ruby
christiandsg has quit [Read error: Connection reset by peer]
prefixed has quit [Remote host closed the connection]
<ljarvis>
abdulrehman: right, no; you need to use sql
<abdulrehman>
the reason behing this, is that the statement is gonna be very long and I'd rather customise it using ruby but I think it wont be possible this might be sql cause it needs to be done on the server side
<ljarvis>
abdulrehman: SQL is extremely powerful, you should embrace it in your toolset
codecop has joined #ruby
UukGoblin has joined #ruby
UukGoblin has left #ruby [#ruby]
<abdulrehman>
ljarvis: I guess you are right, I try to avoid doing just because it looks ugly in the ruby code, I wish I can kinda sperate them in different places where the sql is in different place and the call (logic) of calling the sql is in the main function
rideh has joined #ruby
<abdulrehman>
I guess I can use prepared statements and simply require them from different files
<ljarvis>
abdulrehman: well you should use something like sequel to build your query so you don't have to hand write it
<ljarvis>
which means you get to write more ruby-esque code
tjbiddle has quit [Client Quit]
<ljarvis>
but I'm of the opinion that having SQL strings in your code is absolutely fine, though I am probably not in the majority
<abdulrehman>
ljarvis: the problem is in the project I am working with I am using three different database, orcale sybase and sql server.
christiandsg has quit [Read error: Connection reset by peer]
<ljarvis>
:|
<darix>
ljarvis: it is much better to obfuscate them with some DSL which will probably be a ton of lines longer
<abdulrehman>
ljarvis: I guess you are right
<darix>
^^
<ljarvis>
darix: :)
bruno- has joined #ruby
DaniG2k_ has joined #ruby
<abdulrehman>
koolio, thanks folks
charliesome has joined #ruby
danman has joined #ruby
sinkensabe has joined #ruby
tjbiddle has joined #ruby
Sypheren has quit [Ping timeout: 256 seconds]
lannonbr has joined #ruby
senayar has quit [Remote host closed the connection]
senayar has joined #ruby
DaniG2k has quit [Ping timeout: 246 seconds]
scripore has quit [Quit: This computer has gone to sleep]
tjbiddle has quit [Client Quit]
nzst has joined #ruby
lolmaus has joined #ruby
<nzst>
Hello, How can I assert that variable is valid iso8601?
jobewan has joined #ruby
riotjones has quit [Remote host closed the connection]
<nzst>
*contains
jobewan has quit [Read error: Connection reset by peer]
<ljarvis>
?context nzst
<ruboto>
nzst, Please add more context to your question, what are you doing, why are you doing it, which libraries are involved. Post some code to gist if it clarifies your question.
kb3ien has left #ruby [#ruby]
christiandsg has joined #ruby
<nzst>
I have an api with dates that have iso8601 formatting, I want to verify that this remains true in a functional test
Sypheren_ has joined #ruby
<ljarvis>
a functional test which hits the API every time?
<nzst>
yes
<ljarvis>
that's a bad test
<nzst>
it's my api
<ljarvis>
this test is part of the api or part of something which consumes the api?
<ljarvis>
i.e are you making a http request?
pauly_oc has quit [Ping timeout: 244 seconds]
bruno- has quit [Read error: Connection reset by peer]
scripore has joined #ruby
tennis has joined #ruby
<nzst>
that's besides the point, how do I use ruby's built in minitest to validate iso8601 formatting?
fabrice31 has quit [Remote host closed the connection]
sinkensabe has quit [Remote host closed the connection]
tennis has quit [Remote host closed the connection]
Sypheren has joined #ruby
tennis has joined #ruby
Ropeney has joined #ruby
acovrig has quit [Quit: acovrig]
scripore has quit [Client Quit]
tennis has quit [Remote host closed the connection]
tennis has joined #ruby
theery has quit [Read error: Connection reset by peer]
DaniG2k_ has quit [Read error: Connection reset by peer]
Ropeney has quit [Client Quit]
theery has joined #ruby
DaniG2k has joined #ruby
tjbiddle has joined #ruby
araujo has quit [Quit: Leaving]
RegulationD has joined #ruby
Sypheren has quit [Ping timeout: 265 seconds]
nisstyre has quit [Remote host closed the connection]
theery has quit [Remote host closed the connection]
decoponio has joined #ruby
dabradley has joined #ruby
tjbiddle has quit [Ping timeout: 244 seconds]
ninin has joined #ruby
leesharma has joined #ruby
JohnBat26 has joined #ruby
ninin has left #ruby [#ruby]
JoshL has quit []
symbol has quit [Ping timeout: 246 seconds]
Lucky___ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
DaniG2k has quit [Quit: leaving]
JoshL has joined #ruby
theery has joined #ruby
paulcsmith has quit [Quit: Be back later ...]
rippa has joined #ruby
<ljarvis>
when you grep for a method call but some metaprogramming adds a million layers and you can't find it SIGH
shpoont has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
programmerq has joined #ruby
shpoont has joined #ruby
lolmaus_ has joined #ruby
paulcsmith has joined #ruby
michael_mbp has quit [Excess Flood]
zeeraw has quit []
michael_mbp has joined #ruby
<adaedra>
metaprogramming is your friend
bruno- has quit [Read error: Connection reset by peer]
Sypheren has joined #ruby
<adaedra>
a psycopath friend
sevenseacat has left #ruby ["Me dun like you no more."]
Rollabunna has joined #ruby
yardenbar has quit [Ping timeout: 252 seconds]
gheegh has quit [Ping timeout: 244 seconds]
<shevy>
like adaedra :)
lolmaus has quit [Ping timeout: 244 seconds]
j4cknewt has joined #ruby
rideh has quit [Quit: zap]
<adaedra>
hush you
<shevy>
I once went crazy with method_missing and dynamically creating methods that were not existing, passing things up and down to different classes
<shevy>
since that day I have become a sceptic!
Vile` has quit [Ping timeout: 244 seconds]
conta has quit [Quit: Leaving]
ta has joined #ruby
lapide_viridi has quit [Quit: Leaving]
<ccooke>
shevy: there are definite ways in which that can go wrong
casadei_ has joined #ruby
Sypheren has quit [Ping timeout: 246 seconds]
acke has quit [Remote host closed the connection]
Vile` has joined #ruby
rideh has joined #ruby
<workmad3>
shevy: I think anyone who's used metaprogramming in anger is skeptical of a lot of possible uses afterwards :) it's most definitely a double-edged sword
solars has quit [Ping timeout: 240 seconds]
shpoont has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
* ccooke
uses a fair bit of metaprogramming, but mostly for purely personal code
sinkensabe has quit [Remote host closed the connection]
zeeraw has joined #ruby
paulcsmith has quit [Quit: Be back later ...]
christiandsg has quit [Ping timeout: 265 seconds]
bruno- has joined #ruby
<workmad3>
ccooke: I'll use it... but not generally as a first stage in coding, I'll get something working without metaprogramming and then use it if a metaprogramming solution looks simple, neat and readable
tkuchiki has quit [Remote host closed the connection]
<ccooke>
*nod*
zeeraw has quit [Client Quit]
fabrice31_ has joined #ruby
j4cknewt has quit [Read error: Connection reset by peer]
dgutierrez1287 has joined #ruby
<ccooke>
I probably reach for it a little early - it's something that I look at when I write code for work, to avoid using it too much
fabrice31_ has quit [Remote host closed the connection]
pyo_ has quit []
rideh has quit [Client Quit]
<ccooke>
but on the other hand, I love the ability to write useful DSLs in Ruby
paulcsmith has joined #ruby
<ccooke>
(Although the system that uses a DSL define a config DSL is... probably pushing it)
j4cknewt has joined #ruby
fabrice31 has quit [Ping timeout: 244 seconds]
baroquebobcat has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
Lucky___ has joined #ruby
safeforge has quit [Remote host closed the connection]
bruno- has joined #ruby
Rollabun_ has joined #ruby
Sypheren has joined #ruby
dgutierrez1287 has quit [Ping timeout: 240 seconds]
jessu has quit [Quit: WeeChat 0.4.2]
milesforrest has quit [Ping timeout: 255 seconds]
shpoont has joined #ruby
tkuchiki has joined #ruby
zeeraw has joined #ruby
tuxtgz has joined #ruby
theery has quit [Remote host closed the connection]
Rollabunna has quit [Ping timeout: 246 seconds]
dtzitz has quit [Disconnected by services]
arturmartins has quit [Quit: Leaving...]
tuxtgz has quit [Client Quit]
zeeraw has quit [Client Quit]
Sypheren has quit [Ping timeout: 244 seconds]
ips|malc has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chills42 has quit [Remote host closed the connection]
crazydiamond has quit [Remote host closed the connection]
wpp has quit [Quit: ZZZzzz…]
khebbie has joined #ruby
Sypheren has joined #ruby
polly_wog has joined #ruby
polly_wog has quit [Client Quit]
fenjamin has joined #ruby
arturmartins has joined #ruby
allomov has joined #ruby
mollymorphic has joined #ruby
khebbie has quit [Ping timeout: 250 seconds]
shortCircuit__ has quit [Ping timeout: 265 seconds]
shevy has quit [Ping timeout: 252 seconds]
Sypheren has quit [Ping timeout: 265 seconds]
shpoont has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ReK2 has quit [Remote host closed the connection]
bruno- has quit [Read error: Connection reset by peer]
bruno-_ has joined #ruby
tubuliferous has joined #ruby
BeatzKilla has quit [Remote host closed the connection]
bruno-_ has quit [Read error: Connection reset by peer]
senayar has quit [Read error: Connection reset by peer]
senayar has joined #ruby
shpoont has joined #ruby
zeeraw has joined #ruby
j4cknewt has quit [Read error: Connection reset by peer]
gion has joined #ruby
chills42 has joined #ruby
j4cknewt has joined #ruby
tubuliferous has quit [Ping timeout: 252 seconds]
hinbody has quit [Ping timeout: 244 seconds]
_blizzy_ has joined #ruby
danman has quit [Quit: danman]
bruno- has joined #ruby
eminencehc has joined #ruby
michaeldeol has joined #ruby
blue_deref has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
icebourg has joined #ruby
danman has joined #ruby
<fenjamin>
hi, i am destructively modifying an array with the array, min_value, and value passed a parameters
<fenjamin>
def pad!(array, min_value, value = nil)
yaroslav has quit [Quit: yaroslav]
CustosLimen has quit [Ping timeout: 244 seconds]
_blizzy_ has quit [Read error: Connection reset by peer]
<fenjamin>
placing blocks and objects in the body of the method, what is the object?
bruno- has joined #ruby
araujo has joined #ruby
araujo has joined #ruby
<ljarvis>
fenjamin: I'm sorry, what?
<gion>
I have an issue with escaping some command line parameters when using Open3
<ruboto>
pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
araujo has quit [Max SendQ exceeded]
shevy has joined #ruby
<fenjamin>
there is an rspec however I'm unsure if i call the array in the body or outside the body
krz has quit [Ping timeout: 256 seconds]
fenjamin_ has joined #ruby
araujo has joined #ruby
<ljarvis>
?code fenjamin
<ruboto>
fenjamin, We can't help you without your code, please post it to https://gist.github.com
<ljarvis>
gion: did you try adding quotes into the concat string?
araujo has quit [Max SendQ exceeded]
<fenjamin>
write two methods `pad` and `pad!`. Each method accepts an array, a minimum size (non-negative integer) for the array, and an optional argument of what the array should be "padded" with (see the example with "apple" below).
<fenjamin>
If the array's length is less than the minimum size, `pad` should return a new array padded with the pad value up to the minimum size.
<gion>
yes, no avail, it escapes them, they appear as \"
ruurd has joined #ruby
_blizzy_ has joined #ruby
<fenjamin>
one moment
j4cknewt has quit [Read error: Connection reset by peer]
<ljarvis>
fenjamin: yes, so what do you need help with?
<ljarvis>
nobody is writing the code for you
riotjones has joined #ruby
<ljarvis>
gion: sorry I'm not sure, hopefully someone else can help
<apeiros>
indeed, I'm not writing code for them
j4cknewt has joined #ruby
<fenjamin_>
my question is using blocks and objects inside the method body
<ljarvis>
what about it?
araujo has quit [Max SendQ exceeded]
bronson has joined #ruby
theery has joined #ruby
araujo has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
<fenjamin_>
how does the block or object in the method body pass additional elements into the array?
<gion>
ljarvis: thank you anyway - might go on `` approach and I escape manually
dgutierrez1287 has joined #ruby
mdavid613 has joined #ruby
<ljarvis>
fenjamin: you should look at the documentation for Array.new and Array#push
darithorn has joined #ruby
xxneolithicxx has joined #ruby
xxneolithicxx has quit [Max SendQ exceeded]
davedev24 has joined #ruby
<ljarvis>
maybe show us what you've tried too
<alex88>
gion: how you know command has \"?
hinbody has joined #ruby
Cache_Money has joined #ruby
riotjones has quit [Ping timeout: 272 seconds]
xxneolithicxx has joined #ruby
xxneolithicxx has quit [Max SendQ exceeded]
<gion>
alex88: I do not understand your question
<fenjamin_>
this appears to be non-destructive - '
rehat has joined #ruby
bronson has quit [Ping timeout: 256 seconds]
<alex88>
gion: if you set -i to "\"concat:#{@input.join('|')}\"", does it work?
<alex88>
the issue you have is to have quotes around the -i value
xxneolithicxx has joined #ruby
xxneolithicxx has quit [Max SendQ exceeded]
fenjamin_ has quit [Remote host closed the connection]
fenjamin has quit [Quit: 离开]
rcvalle has joined #ruby
weemsledeux has joined #ruby
dfockler has joined #ruby
<gion>
alex88: does not work, already answered to ljarvis
ips|malc has joined #ruby
<alex88>
gion: how you know it doesn't work?
<gion>
alex88: ffmpeg receives a string that has escaped quotes in it
Sypheren has joined #ruby
<alex88>
tried Open3.capture3(command.join(' '))?
<gion>
alex88: instead of receiving " in ffmpeg I get \"
christiandsg has joined #ruby
xxneolithicxx has joined #ruby
xxneolithicxx has quit [Max SendQ exceeded]
christiandsg has quit [Remote host closed the connection]
bakednotfried has quit [Ping timeout: 260 seconds]
CustosLimen has joined #ruby
gambl0re has joined #ruby
tsvenson has quit [Ping timeout: 265 seconds]
<shevy>
it is possible to use ffmpeg concat from ruby fine, I do this in some script
khebbie has joined #ruby
khebbie_ has joined #ruby
<gion>
alex88: now I am even more confused -> this is the command ffmpeg -y -f mpegts -i "concat:chunks\1.ts|chunks\2.ts|chunks\3.ts" -c copy -bsf:a aac_adtstoasc -bsf:v h264_mp4toannexb path.mp4
<gion>
alex88: and it works, but something happens when it meets the pipe charc
<gion>
alex88: which is not a pipe, just a separator
<alex88>
try to use '-i', '"concat:' + @input.join('|') + '"'
<shevy>
that chunks\1.ts part
mlangenberg has joined #ruby
<shevy>
I am often lazy and try to have simple filenames before working on files
paulcsmith_ has joined #ruby
aevitas has joined #ruby
ruurd has joined #ruby
paulcsmith has quit [Read error: Connection reset by peer]
<adaedra>
that's a good thing to do, have simple file names
JoshL has quit []
iwaffles has joined #ruby
<shevy>
yay! adaedra is on my side
mercwithamouth has joined #ruby
<abdulrehman>
good night peeps, thanks for the help again..... see you tomorrow ( adaedra if they don't block the channel by then hahaha)
zeeraw has quit []
JoshL has joined #ruby
zeeraw has joined #ruby
<adaedra>
two hls?
<adaedra>
this day is intense
mdih has quit [Ping timeout: 256 seconds]
<gion>
alex88: just before calling capture3 I join and print the command: ffmpeg -y -f mpegts -i "concat:chunks\1.ts|chunks\2.ts|chunks\3.ts" -c copy -bsf:a aac_adtstoasc -bsf:v h264_mp4toannexb
snockerton has quit [Quit: Leaving.]
manila90 has quit [Remote host closed the connection]
<alex88>
gion: the issue seems to be in chunks filename, you expect themt o be chunks\\1 not chunks\1
Sypheren has quit [Ping timeout: 264 seconds]
<gion>
alex88: i think you are right, this is bloody windows
xxneolithicxx has joined #ruby
xxneolithicxx has quit [Max SendQ exceeded]
<alex88>
it's just maybe string escaping since you're joining inside ""
allomov has quit [Remote host closed the connection]
<alex88>
that's why I told you to try to use single quotes and concat with +
christiandsg has joined #ruby
snockerton has joined #ruby
Sypheren has joined #ruby
<gion>
alex88: nope, it is not this, changed to fwd slashes and same behavior
lolmaus has joined #ruby
<gion>
alex88: if i copy the command that puts outputs, and run it manually in the shell, all works, only when it goes through capture3 it fails
<ruboto>
shevy, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
despai has quit [Quit: This computer has gone to sleep]
<hanmac>
shevy did you see the trailer / poster for the new Fantastic Four Movie? HumanTorch is black now ... oO
polysics has quit [Remote host closed the connection]
paulcsmith_ has quit [Ping timeout: 244 seconds]
<shevy>
not really, I kinda stopped following movie-things for some years now :(
<workmad3>
hanmac: that trailer is really underwhelming, IMO
zeeraw has quit []
<gion>
shev: fwd slash no, the pipe i don't know, the pipe is inside a string, so it shouldn't be touched
sarkyniin has quit [Read error: No route to host]
zeeraw has joined #ruby
sarkyniin has joined #ruby
<hanmac>
workmad3: i only did see the poster yet, i am still confused how the brother of the blond chick is black now ... was he to long in the sun? maybe he did burnt himself and now is crispy like a roasted chicken ...
<workmad3>
hanmac: they're no longer a family
hoelzro_ is now known as hoelzro
bruno- has quit [Read error: Connection reset by peer]
bricker has joined #ruby
bruno- has joined #ruby
benlieb has joined #ruby
senayar has quit []
j4cknewt has joined #ruby
<hanmac>
workmad3: hm what do you say to the new (Peter)Pan movie? imo it looks interesting
pengin has joined #ruby
<workmad3>
not seen much for that yet
ips|malc has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zeeraw has quit [Client Quit]
_blizzy_ has joined #ruby
MatthewsFace has joined #ruby
sanguisdex has quit [Remote host closed the connection]
gion has quit [Quit: Page closed]
paulcsmith_ has joined #ruby
Alina-malina has quit [Ping timeout: 246 seconds]
<banister>
hanmac hollywood is just on a major "remake everything" buzz for the last 3-4 years, it's annoying
pengin_ has joined #ruby
<banister>
they already remade spiderman about 5 times in the last few years
[Butch] has joined #ruby
<pipework>
They're going for more fantastic four and stuff too.
christiandsg has quit [Remote host closed the connection]
<hanmac>
banister: yeah ... i want to see some new heroes ... while Ant-man movie does look good, its not so new ... hmm for sample the BlueBeetle looks funny
<adaedra>
more than four isn't four.
<pipework>
I'd rather remake good superhero movies than make antman-like movies.
sanguisdex has joined #ruby
wprice has joined #ruby
tvw has quit [Ping timeout: 240 seconds]
nobitanobi has joined #ruby
<workmad3>
hanmac: ant-man is pretty good... and marvel is doing a dr strange film either next year or the year after in the MCU... all the reboots are with the non-marvel studios that bought up marvel superheros :(
lannonbr has joined #ruby
chipotle has quit [Quit: cheerio]
Sypheren has joined #ruby
drew0 has joined #ruby
<workmad3>
spiderman films are done by sony, iirc, and I think f4 is 20th century fox or universal...
<hanmac>
workmad3: i lolled so hard recently that in the Spiderman series, Spiderman got the powers of Dr Strange for the episode ;P he did call himself the "highest spider" or something like that ;P
<adaedra>
It's the writers that were really high
sarkyniin has quit [Read error: No route to host]
pengin has joined #ruby
neanderslob has quit [Ping timeout: 244 seconds]
mercwithamouth has joined #ruby
aaeron has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
bruno- has joined #ruby
wprice has quit [Quit: wprice]
bruno- has quit [Read error: Connection reset by peer]
nzst has quit [Ping timeout: 240 seconds]
anisha has quit [Quit: Leaving]
pengin_ has quit [Ping timeout: 256 seconds]
[k- has quit [Ping timeout: 246 seconds]
Philipp__ has quit [Read error: Connection reset by peer]
Ilyas has joined #ruby
mikecmpb_ has quit [Ping timeout: 246 seconds]
paulcsmith_ has joined #ruby
neanderslob has joined #ruby
allomov has quit [Remote host closed the connection]
aphprentice has joined #ruby
bruno- has joined #ruby
c0m0 has quit [Ping timeout: 252 seconds]
<kapowaz>
hey there. I'm trying to diagnose an issue with rbenv. Is this a decent place to ask, or is there a dedicated rbenv channel?
sarkyniin has joined #ruby
lolmaus_ has joined #ruby
<kapowaz>
I'll ask anyway. Basically I'm getting the standard error: “You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.” whilst trying to `gem install` something, in spite of having rbenv installed.
iloverubynoob has quit [Ping timeout: 256 seconds]
IrishGringo has quit [Ping timeout: 246 seconds]
acke has joined #ruby
fractalis has joined #ruby
Lucky___ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
GnuYawk has joined #ruby
GnuYawk has joined #ruby
sepp2k has joined #ruby
Muhannad has joined #ruby
Alina-malina has joined #ruby
wallerdev has joined #ruby
<AckZ>
dfockler: nm, i can make it work correctly from a simple script, but under rails it just doesn't do anything for some reason.. i'll see if I can come up with a rails example
shadoi has joined #ruby
yardenbar has joined #ruby
<dfockler>
AckZ: ok
zeroDivisible has quit [Ping timeout: 244 seconds]
wallerdev has quit [Client Quit]
<craysiii>
AckZ have you tried asking #rubyonrails
<shevy>
Narzew not sure any such exists, after all ruby is interpreted not compiled
banister has joined #ruby
<shevy>
there should be some one click installers
<pipework>
shevy: That's not quite true.
<craysiii>
from what ive read you can use something called rubinius
<shevy>
you know of an .exe creator for ruby files then pipework?
<pipework>
shevy: No, I meant the "after all ruby is interpreted not compiled" part.
sshuff|gone is now known as sshuff
bumbar_ has quit [Ping timeout: 244 seconds]
wallerdev has quit [Quit: wallerdev]
leafybasil has quit [Remote host closed the connection]
scripore has joined #ruby
Hounddog has quit [Remote host closed the connection]
<Narzew>
hmm "shoes script.rb" works, but generated "script.shy" have errors with file options
<Narzew>
and ocra ? Is the way to use it on Linux to compile program for win ?
quimrstorres has joined #ruby
_blizzy_ has quit [Read error: Connection reset by peer]
<shevy>
Narzew people can just download a .gem even on windows
towski_ has joined #ruby
treehug88 has joined #ruby
tsvenson has joined #ruby
<craysiii>
also check out traveling-ruby. though I guess you can't build with native extensions on windows.
Musashi007 has joined #ruby
Mon_Ouie has quit [Ping timeout: 244 seconds]
<Ox0dea>
shevy: OCRA creates .exes.
<Narzew>
if I use sudo gem install x is that gem installed only to root (and not to current user) ?
frem has joined #ruby
nkts has quit [Read error: Connection reset by peer]
_blizzy_ has joined #ruby
nkts has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
<shevy>
Ox0dea do you use OCRA?
Mon_Ouie has joined #ruby
j4cknewt has quit [Read error: Connection reset by peer]
j4cknewt_ has joined #ruby
A_ron has joined #ruby
CorySimmons has quit [Quit: Bye!]
Mendenhall has joined #ruby
anisha has joined #ruby
axl_ has quit [Ping timeout: 245 seconds]
Rollabunna has joined #ruby
Rollabunna has quit [Remote host closed the connection]
Rollabunna has joined #ruby
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lolmaus has joined #ruby
ramfjord has quit [Read error: Connection reset by peer]
Saloaty has left #ruby [#ruby]
sysanthrope has joined #ruby
Rollabun_ has quit [Ping timeout: 244 seconds]
ramfjord has joined #ruby
platosha has quit [Read error: Connection reset by peer]
<Ox0dea>
shevy: I last used it in 2011 or so to put a (very thin) graphical layer over some scripts I'd written to automate some things.
<shevy>
\o/
lolmaus_ has quit [Ping timeout: 244 seconds]
<shevy>
Narzew finally someone who knows windows :)
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Zai00 has joined #ruby
<Ox0dea>
The target audience weren't particularly tech-unsavvy, but they were all Windows users. :/
eminencehc has quit [Remote host closed the connection]
polysics has joined #ruby
platosha has joined #ruby
quimrstorres has quit [Remote host closed the connection]
iloverubynoob has joined #ruby
HoppingMadMan has joined #ruby
iateadonut has left #ruby [#ruby]
banister has joined #ruby
radgeRayden has joined #ruby
banister has quit [Client Quit]
Igorshp has joined #ruby
<mlangenberg>
I am comparing ways to generate unique 64bit integers (long type). Would there be any difference between SecureRandom.random_number(2**63) and SecureRandom.random_bytes(16).unpack('q')[0].abs ?
{756d6f} has joined #ruby
<Ox0dea>
mlangenberg: The latter is needlessly involved.
rideh has joined #ruby
beef-wellington has joined #ruby
weemsledeux has joined #ruby
<aaeron>
Hey. I am using multipart-post to post a file. I am also posting only parameters to another API. multipart-post is not working for normal http post
polpak has quit [Quit: Lost terminal]
<mlangenberg>
Ox0dea: lol okay, will go for the first one.
lwu has quit [Ping timeout: 252 seconds]
krz has joined #ruby
Nuru has joined #ruby
konsolebox has quit [Remote host closed the connection]
jackjackdripper has quit [Quit: Leaving.]
gizmore has joined #ruby
polysics has quit []
lwu has joined #ruby
dented42 has quit [Remote host closed the connection]
jackjackdripper has joined #ruby
dfockler has quit [Remote host closed the connection]
Trynemjoel has quit [Ping timeout: 256 seconds]
_blizzy_ has quit [Read error: Connection reset by peer]
mercwithamouth has quit [Ping timeout: 256 seconds]
<Ox0dea>
aaeron: Just use Net::HTTP::Post for non-multipart requests?
jackjackdripper has quit [Client Quit]
iloverubynoob has quit [Quit: Leaving...]
jackjackdripper has joined #ruby
rideh has quit [Quit: zap]
Trynemjoel has joined #ruby
<aaeron>
I was wondering if there one library I could use for doing both
<Ox0dea>
Well, Net::HTTP::Post is in the standard library, so it's not like you'd need to bring in another dependency.
_blizzy_ has joined #ruby
banister has joined #ruby
Skelz0r has quit [Ping timeout: 252 seconds]
dented42 has joined #ruby
<shevy>
who is actually deciding when a new ruby release will happen? does matz do so or the core team together?
einarj has joined #ruby
<Ox0dea>
matz assigns a release manager.
selva has left #ruby [#ruby]
kristian_on_linu has joined #ruby
<aaeron>
Ox0dea: doing it
<aaeron>
going with ur advice
<Ox0dea>
Yay!
Muhannad has quit [Ping timeout: 256 seconds]
<havenwood>
aaeron: Maybe take a look at Curb, Faraday and HTTPClient's multipart post support.
<havenwood>
aaeron: Or yeah, do it manually with net/http
whiteline has quit [Remote host closed the connection]
<Ox0dea>
aaeron: I'd imagine multipart-post doesn't violate LSP too badly, so switching between Post and Post::Multipart shouldn't be too painful.
<havenwood>
aaeron: Mechanize and RestClient are Net::HTTP wrappers that add better multipart post support as well.
lkba has joined #ruby
_cball has quit [Quit: Leaving]
rideh has joined #ruby
Narzew has quit [Remote host closed the connection]
j4cknewt has joined #ruby
jenrzzz has joined #ruby
bruno- has joined #ruby
<havenwood>
shevy: Ruby 2.3.0 on December 25, 2015.
j4cknewt_ has quit [Read error: Connection reset by peer]
eminencehc has joined #ruby
<shevy>
damn that's still far away
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
HoppingMadMan has quit [Ping timeout: 246 seconds]
einarj has quit [Remote host closed the connection]
s00pcan has joined #ruby
towski_ has quit [Remote host closed the connection]
anisha has quit [Quit: Leaving]
HoppingMadMan has joined #ruby
Skelz0r has joined #ruby
moredhel has joined #ruby
whiteline has joined #ruby
kirun has joined #ruby
davejlong has joined #ruby
IrishGringo has quit [Ping timeout: 244 seconds]
_blizzy_ has quit [Read error: Connection reset by peer]
benlieb has quit [Quit: benlieb]
_blizzy_ has joined #ruby
drewo has quit [Ping timeout: 244 seconds]
polpak has joined #ruby
andikr has quit [Remote host closed the connection]
aevitas_ has quit [Remote host closed the connection]
baweaver has joined #ruby
nobitanobi has quit [Remote host closed the connection]
aevitas has joined #ruby
eregon_ is now known as eregon
towski_ has joined #ruby
Narzew has joined #ruby
Rutix`away has quit []
allomov has quit [Ping timeout: 250 seconds]
yfeldblum has quit [Ping timeout: 244 seconds]
last_staff has quit [Quit: last_staff]
mdavid613 has quit [Quit: Leaving.]
last_staff has joined #ruby
anisha has joined #ruby
benlieb has joined #ruby
xkickflip has quit [Quit: xkickflip]
jrochkind has joined #ruby
MatrixBridge has quit [Ping timeout: 250 seconds]
robbyoconnor has quit [Ping timeout: 255 seconds]
last_staff has quit [Client Quit]
<jrochkind>
I'm wondering if it's save to share a OpenSSL::PKey::RSA obj accross threads, have it concurrently doing encrypt operations. And I'm thinking there's probably no way to know.
<jrochkind>
safe
khebbie has quit [Remote host closed the connection]
khebbie_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
noethics has quit [Remote host closed the connection]
chinmay_dd has quit [Quit: See ya!]
M-_mis has quit [Read error: Connection reset by peer]
Rutix has joined #ruby
Rutix has joined #ruby
Rutix has quit [Changing host]
MatrixBridge has joined #ruby
<Ox0dea>
> Why just 1? Because Ruby itself isn't thread safe, we don't need to care about threads
<Ox0dea>
jrochkind: That's a comment from ossl_bn.c.
baweaver has quit [Remote host closed the connection]
Narzew has quit [Remote host closed the connection]
<jrochkind>
Ox0dea: nice catch. So that's probably an indicator that it _ain't_ thread-safe, although might be accidentally in MRI as per usual. Would you agree?
nobitanobi has joined #ruby
<Ox0dea>
jrochkind: Well, you'll have to make of it what you will. There are plenty of attempts at thread safety in ext/openssl.
<jrochkind>
Of course, the JRuby is probably a different implementation, that also may or may not be threadsafe too. Def seems safest to just avoid sharing an instance between threads, alas.
jackjackdripper has quit [Quit: Leaving.]
allomov has joined #ruby
jackjackdripper has joined #ruby
<jrochkind>
makes the code either a lot more complicated or less efficient, but so it goes. I'm writing an object that may be used across threads. Instead of caching an OpenSSL::PKey::RSA in an iVar, I'll just go ahead and create one every time I need it, oh wells.
noethics has joined #ruby
<Ox0dea>
jrochkind: Better redundant than owned, I reckon.
<jrochkind>
yup
RonRichie has joined #ruby
<jrochkind>
even if not owned, I don't want code that, say, messes up and doesn't produce a value that can be properly decrypted/verified either.
Timba-as has joined #ruby
jackjackdripper1 has joined #ruby
jackjackdripper has quit [Read error: Connection reset by peer]
fantazo has quit [Ping timeout: 256 seconds]
higuys has joined #ruby
gambl0re has quit [Ping timeout: 265 seconds]
<Ox0dea>
There's lots of /* NO NEED TO DUP */ throughout the code, which would seem to indicate that duping does occur where necessary. Still, that OpenSSL::BN isn't thread-safe seems to put the whole thing on shaky foundations.
<Ox0dea>
Alas, thread-safety is generally all-or-nothing.
<jrochkind>
What's OpenSSL::BN, and how do you know it's not threadsafe, was there a widely known issue or something?
<Ox0dea>
It's OpenSSL's implementation of Bignums.
shock_one has quit [Remote host closed the connection]
<Ox0dea>
The code uses a single BN_CTX wherever Bignum operations are required.
Narzew has joined #ruby
Musashi007 has quit [Quit: Musashi007]
j4cknewt_ has joined #ruby
j4cknewt has quit [Read error: Connection reset by peer]
gix has quit [Quit: Client exiting]
f4cl3y has joined #ruby
CustosLimen has quit [Ping timeout: 260 seconds]
mercwithamouth has joined #ruby
lolmaus has quit [Quit: Konversation terminated!]
<redondos>
is it possible to add a bundle config to a Gemfile? (e.g. I want the Gemfile to reflect `bundle config build.nokogiri --use-system-libraries' without having to actually run that command)
<banister>
humblebrag
decoponio has quit [Quit: Leaving...]
<jrochkind>
redondos: hmm, good question.
JoshL has left #ruby [#ruby]
cball has joined #ruby
leafybasil has joined #ruby
<redondos>
I've noticed what the command does is very simple:
<redondos>
but I don't want to have to maintain that file, I'd rather have bundle do that for me if possible
<jrochkind>
redondos: I can't figure out if there is a way to do that. But can you pass the same thing for nokogiri in an ENV variable instead? If so, I wonder if simply setting ENV['whatever'] at the top of the gemfile would work, although it may not.
blaines has joined #ruby
Narzew has quit [Remote host closed the connection]
<redondos>
I'll check
<jrochkind>
redondos: also, not what you asked, but making sure you know you can `bundle config —global`, and it'll save it in your ~/.bundle/config, and use it every time.
<redondos>
this is not for my workstation, but a production server (whether or not it's a good idea to build libraries on the box is a topic for another day)
blaines_ has joined #ruby
<redondos>
i am trying to get my configuration management or deployment script to inject that so bundler does the Right Thing
<jrochkind>
most of us do, with standard capistrano deploys, whether or not it's a good idea. :) There's no reason you _can't_ set a `bundle config —global` for the account that's doing the building on the production server — even have your deployment set it. Or if this one can be triggered in an ENV, which I seem to recall it can be, setting the ENV in an .rc on the proper account on the production server might make a lot of sense.
<redondos>
I can just run the command from the deployment script I suppose... just not neat
leafybasil has quit [Ping timeout: 252 seconds]
<jrochkind>
Looks like NOKOGIRI_USE_SYSTEM_LIBRARIES=1 . How do you feel about setting an ENV variable in the proper account on your production machine?
<redondos>
that'll work!
blaines has quit [Ping timeout: 244 seconds]
<redondos>
testing
<jrochkind>
If that fits into your setup, I think that's actually better than hard-coding it into your Gemfile, as the setting is, after all, more server-specific than project-specific. Some servers have a usable LibXML some don't.
centrx has quit [Quit: 'Get out, you and all the people who follow you!' Then he went out from Pharaoh in hot anger.]
dfockler has joined #ruby
<redondos>
that's very true
<redondos>
thanks for the insight
<jrochkind>
on the ohter hand, if I stuck it in a .bashrc or something, I'd probably forget what i did and never be able to figure out what was going on, ha.
kadoppe has quit [Ping timeout: 244 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<jrochkind>
(fwiw, I saw a nokogiri ticket on trying to make it auto-discover whether to use system libraries or not, maybe some day that'll land)
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sshuff is now known as sshuff|gone
<Ox0dea>
prefixed: As jhass points out, #downcase makes sense as the name of a "message".
<jhass>
(that took < 1 min of peeking into the source)
<Synthead>
Ox0dea: awesome_print happens to print a wall-o-text for this specific object, heh
<Sou|cutter>
using pry to print objects is funny
safeforge has quit [Remote host closed the connection]
scripore has quit [Quit: This computer has gone to sleep]
<Synthead>
Sou|cutter: :)
<Ox0dea>
Synthead: How about pretty_print?
shadoi has joined #ruby
<Ox0dea>
Invoking a REPL for its output format is... well, I'll refrain from saying anything untoward.
<Synthead>
Ox0dea: hahaha, yeah. just being curious
Jarboe has joined #ruby
allomov has quit [Remote host closed the connection]
<Synthead>
jhass: Pry::ColorPrinter.pp() is perfect :)
banister has joined #ruby
deavid has joined #ruby
<Ox0dea>
Synthead: You should totally use Open3 to drive a Pry process.
khebbie_ has quit [Remote host closed the connection]
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
einarj has quit [Read error: Connection reset by peer]
sinkensabe has joined #ruby
einarj has joined #ruby
havenn has joined #ruby
havenwood has quit [Read error: Connection reset by peer]
wprice has joined #ruby
sdwrage has joined #ruby
<jhass>
... using non-alphanumeric coding?
_ht has quit [Quit: Konversation terminated!]
hahuang65 has joined #ruby
aryaching has quit [Ping timeout: 252 seconds]
swgillespie has joined #ruby
Soda has joined #ruby
Igorshp has quit [Remote host closed the connection]
<Ox0dea>
Who would do such a thing?
<jhass>
mirror.png
havenn has quit [Read error: Connection reset by peer]
gambl0re has quit [Remote host closed the connection]
<bustrarm>
that moment when you find out that the last week you struggled to get something working was caused by a bug in a minorly-related piece of code that didn't have a test-case for the error
bustrarm is now known as busterarm
towski_ has joined #ruby
<craysiii>
busterarm why do you always change your name
<busterarm>
hours of work spinning my wheels going nowhere. lol
<busterarm>
nickserv does it
<busterarm>
my client errored and reconnected 7 hours ago and my nick has protection on
<busterarm>
I never bothered to regain
<craysiii>
ah
omegamike has quit [Remote host closed the connection]
<Ox0dea>
vyorkin: Well, it's certainly not the most performant approach.
Rollabunna has quit [Ping timeout: 250 seconds]
<Ox0dea>
You're creating a new Array every single time.
sdwrage2 has joined #ruby
EllisTAA has joined #ruby
whiteline has quit [Remote host closed the connection]
<Ox0dea>
Then again, Ruby uses shared memory for methods like #[], #first, and #take, so it's not terrible.
hahuang65 has quit [Ping timeout: 272 seconds]
<adaedra>
thank god for shared memory
whiteline has joined #ruby
Rollabunna has joined #ruby
Muhannad has quit [Ping timeout: 256 seconds]
<lwu>
anyone here
bruno- has joined #ruby
HoppingMadMan has quit [Max SendQ exceeded]
<adaedra>
?anyone
<ruboto>
Just ask your question, if anyone has or can, they will respond.
GPrime has joined #ruby
eminencehc has joined #ruby
<Ox0dea>
vyorkin: Do you actually want elements pushed onto the front?
quimrstorres has quit [Remote host closed the connection]
whippythellama has quit [Quit: WeeChat 1.2]
<vyorkin>
0x0dea: yes, thats right, I want it to "slide"
bruno- has quit [Ping timeout: 264 seconds]
<craysiii>
sounds like you want a queue
<Ox0dea>
Right, but it can "slide" left or right.
<vyorkin>
actually I'm going to use it to keep recent items
<adaedra>
Meanwhile, I'll slide into my bed
<adaedra>
o/
{756d6f} has quit [Ping timeout: 244 seconds]
<vyorkin>
adaedra: good night :)
WHATDOYOUNEED has joined #ruby
<vyorkin>
0x0dea: I want it to slide right
Contigi has joined #ruby
spider-mario has quit [Remote host closed the connection]
jgpawletko has quit [Quit: jgpawletko]
Igorshp has joined #ruby
quimrstorres has joined #ruby
shock_one has joined #ruby
nawak has joined #ruby
gamename has joined #ruby
<Ox0dea>
vyorkin: Such that most recent items are at the front, then, yes?
hololeap has joined #ruby
<vyorkin>
0x0dea: yeah, correct
Musashi007 has quit [Quit: Musashi007]
robbyoconnor has quit [Max SendQ exceeded]
<Ox0dea>
vyorkin: I tried to get something clever going with the two-argument form of Array#[] and Comparable#<=>, but it ends up being overly intricate.
<Ox0dea>
A #pop in the case of @source.size == @limit and then an #unshift is probably the cleanest approach.
icebourg has quit []
Igorshp has quit [Ping timeout: 256 seconds]
Lucky___ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
WHATDOYOUNEED has quit [Ping timeout: 246 seconds]
<vyorkin>
0x0dea: got it, thanks!
<Ox0dea>
vyorkin: Happy to help.
<Ox0dea>
No need to #dup before #take, for what that's worth.
_blizzy_ has joined #ruby
GPrime has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
shock_one has quit [Ping timeout: 240 seconds]
dimasg has quit [Ping timeout: 240 seconds]
Musashi007 has joined #ruby
nawak has quit [Quit: leaving]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
quimrstorres has quit [Remote host closed the connection]
<vyorkin>
0x0dea: thanks again :)
_nowak_ has joined #ruby
HoppingMadMan has joined #ruby
<shevy>
if I do: module Foo; end, Foo becomes available via a "Object.const_defined? :Foo" query. Who or what registers it there though? I notice that I can do Object::Foo but I am not sure why
<Ox0dea>
shevy: The interpreter does. Are you trying to hook constant definition?
bricker has joined #ruby
guest1241234 has quit [Quit: Connection closed for inactivity]
<shevy>
no, I am trying to understand things. I had to change some queries earlier today, where I used Object.const_defined? towards a NamespaceBla.const_defined?, and I spread them out all over everywhere (it was old code)
<Ox0dea>
Well, constant resolution starts at Object, so it makes sense that a module defined at the top level would be accessible from Object.
n008f4g_ has quit [Ping timeout: 244 seconds]
<Ox0dea>
>> module A; module B end end; Object::B rescue $!
<workmad3>
dfockler: it's one of those annoying things... Symbols are a completely distinct type from strings, so 'immutable string' isn't really correct... they're also not usually implemented as strings in an interpreter... they can be converted to strings, but comparison-wise they're closer to integers... but 'immutable string' gets the idea across nicely as a first-stage approximation to people who've not encounte
<jhass>
hays: any background we can relate to?
<workmad3>
red them before
neoseeker has joined #ruby
eminencehc has quit [Remote host closed the connection]
juanpablo____ has quit [Quit: (null)]
juanpablo____ has joined #ruby
<hays>
is it fair to say that a symbol is an object whose uniqueness is guaranteed?
omegamike has quit [Ping timeout: 252 seconds]
<hays>
maybe thats the first question.. is a symbol an object
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<hays>
so i guess symbols are not just Object.new
<hays>
unless its just syntactic sugar for that
<workmad3>
no, symbols are not Object.new
jaequery has joined #ruby
<hays>
how do I see the methods for :foo
<workmad3>
hays: same as with anything else... call .methods on it ;)
<workmad3>
hays: also take a look at .object_id
<hays>
:foo.methods hah
juanpablo____ has quit [Ping timeout: 250 seconds]
juanpablo_____ has joined #ruby
michaeldeol has quit [Client Quit]
Kyuujitsu has joined #ruby
<workmad3>
hays: if you do that, you should notice that you'll always get the same object_id back for the same symbol
<dfockler>
symbols are more like pointers, right?
<dfockler>
named pointers
<theery>
Any idea why the before filter in the parent class doesn't get executed when a route in the child class is hit? It gets executed if I move it into the child class: https://gist.github.com/macmartine/585fb3d6ab244ce605a7
<workmad3>
dfockler: not really...
jgpawletko has joined #ruby
<theery>
It's in a Sinatra app, fwiw
<dfockler>
theery: you may need to call super
<hays>
workmad3: that would be similar to Object.new
<polpak>
dfockler: they are more like immutable strings
<workmad3>
hays: no, Object.new.object_id will always be a different object
<dfockler>
polpak: haha that's what I said before
Lamarus has joined #ruby
<theery>
dfockler: I shouldn't have to put it in every child, though, theoretically. That's the point of inheritance.
<hays>
workmad3: right, but foo= Object.new would have a unique object_id just like :foo
[H]unt3r has joined #ruby
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<hays>
i suppose every object has a unique object id
mesamoo has joined #ruby
<workmad3>
hays: right, but then you'd need to pass that particular object around in order to get the same object
<dfockler>
theery: well the `before do` is just code in the class, it's not a part of the parent class
<polpak>
hays: what are you trying to do?
<workmad3>
hays: whilst with a symbol, you'd get the same object back if you used the same symbol in different parts of your program... which is part of what makes them useful
<hays>
ahh
<dfockler>
polpak: we were just talking about what symbols are
<Lamarus>
Could someone help out with this issue. I have been trying to do a bundle install, and it keeps yelling about nokogiri and not installing correctly. So I try to install that one using `gem install` and get an error no matter what I do. I need help on this... http://laravel.io/bin/LkEGO
shadoi has quit [Quit: Leaving.]
<polpak>
dfockler: oh. they are instances of the Symbol class
<polpak>
dfockler: the end. ;p
<workmad3>
hays: as you can create a hash with symbols as keys in one part of the app, pass that around and be able to access the hash with symbols everywhere else, with inexpensive lookups
<hays>
polpak: understand symbols
juanpablo_____ has quit [Ping timeout: 240 seconds]
<workmad3>
hays: which is one of the normal first uses for symbols, hash lookup keys :)
<hays>
yeah, I was noticing them being used that way, as keys in a hash
michael_mbp has quit [Excess Flood]
<hays>
any way to go from "foo" to :foo ?
<polpak>
hays: they're an annoying side effect of the fact that ruby chose to implement strings as mutable (rather than immutable)
<hays>
polpak: heh, yeah python has immutable strings
bruno- has joined #ruby
<polpak>
hays: indeed
<hays>
I was noticing that when I was seeing a lot of "foo" + bar + "baz" around in the Ruby world
<workmad3>
polpak: it's more of a smalltalk legacy, tbh... I'd need to dig into a bit more history to dredge up why smalltalk went with symbols and strings though (but I think there was more to it than just "side effect of mutable strings")
Ropeney has joined #ruby
michael_mbp has joined #ruby
<hays>
mutable strings aren't a bad thing though
<polpak>
hays: you see that in python too
<polpak>
hays: and yes they are ;p
<hays>
polpak: yes but you also slap people in that case :)
<hays>
I have to say im not a huge fan of "#{barf}"
jackjackdripper1 has quit [Ping timeout: 246 seconds]
<dfockler>
it's just better to use an immutable string for certain things like enums
Pupeno_ has joined #ruby
<workmad3>
dfockler: sure... if you have immutable strings and no enum or symbol type, you'd likely use them for that sort of situation :)
<workmad3>
hays: more generally, symbols get used a lot as names in ruby... method names are symbols, variable names are symbols, constant names are symbols
<dfockler>
"#{barf}" is better than parsing through "%s hello %s" % (var1, var2)
<hays>
is there a way to see what an object's parent class is?
<workmad3>
hays: if you do 'some_object.methods' you'll notice all the names are symbols ;)
dseitz has joined #ruby
<dfockler>
polpak: like Ox0dea you can do either if you want
<polpak>
dfockler: indeed
<workmad3>
and yeah, ruby also now returns the method name as a symbol from 'def'
triangles has joined #ruby
darithorn has quit [Remote host closed the connection]
<hays>
hmm ok but I don't define them that way.. I still do def foo
<Ox0dea>
workmad3: Module#include/#extend is essentially multiple inheritance, no
<Ox0dea>
+?
<workmad3>
hays: you can also do 'define_method :foo do; <method body>; end'
<Ox0dea>
workmad3: Then again, you could've used a String there.
<workmad3>
Ox0dea: sure... but if you looked at all the symbols with ObjectSpace before and after the define_method, you'd notice a new symbol appear ;)
<polpak>
hays: of course. but you can refer to them by the symbol to call them (via send or similar)
<Ox0dea>
workmad3: Aye, fair enough.
<hays>
what's the deal with do.. sometimes its around and sometimes its not
noethics has quit [Ping timeout: 256 seconds]
RonRichie has joined #ruby
<polpak>
hays: it defines a block (like braces)
<Lamarus>
Could someone help out with this issue. I have been trying to do a bundle install, and it keeps yelling about nokogiri and not installing correctly. So I try to install that one using `gem install` and get an error no matter what I do. I need help on this... http://laravel.io/bin/LkEGO
Ilyas has quit [Read error: Connection reset by peer]
pietr0 has quit [Quit: pietr0]
<workmad3>
Ox0dea: and module include/extend is a sort of a form of multiple inheritance... it's implemented essentially as inheritance, but it doesn't interfere with superclass chains, and it's really closer to inserting a new superclass into the chain
Yzguy has joined #ruby
<Ox0dea>
>> s = Symbol.all_symbols; define_method(:wtf) {}; Symbol.all_symbols - s # workmad3
<workmad3>
hmm... weird, I get ':wtf' out locally for that
<Ox0dea>
I don't.
Lamarus has joined #ruby
<workmad3>
Ox0dea: oh, it's because it's all on one line
<workmad3>
Ox0dea: the parser creates the symbol as soon as it parses the line
sargas has quit [Quit: This computer has gone to sleep]
pietr0 has joined #ruby
<Ox0dea>
Ah, that does make sense.
matp has joined #ruby
jackjackdripper has quit [Read error: Connection reset by peer]
<hays>
i bet symbols come from the fact that with smalltalk you could peek into the interpreter in weird ways
jackjackdripper has joined #ruby
<Ox0dea>
hays: We can peek into Ruby in very weird ways too.
<Ox0dea>
Poke, as well.
<hays>
im pretty sure i remember smalltalk letting you like subclass its own parser
<ivanskie>
is there an inflector to convert every word in a string to capitalized? .capitalize isn't doing it for me. .humanize only capitalizes first word.. (this is for company name, they are stored in db as all uppercase)
<Ox0dea>
ivanskie: Why not just split.map(&:capitalize).join(' ')?
<ivanskie>
ooh
Kyuujitsu has left #ruby [#ruby]
RonRichie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ruurd>
Lamarus why the special libxml2?
<ivanskie>
awe undefined local variable or method `split' for #<#<Class:0x007fd0a0063308>:0x007fd09eb2cc28>
<workmad3>
hays: ruby doesn't allow you quite that level of introspection into itself, but it lets you poke in and change a lot of internals
<ivanskie>
oh nevermind
<Ox0dea>
ivanskie: Well, you'll need to turn $thing into a String first.
<ivanskie>
lol
<Ox0dea>
Heh.
<ivanskie>
< doing it wrong
<Lamarus>
ruurd, I have tried with that and without.... same issue Tried it with based on a suggestion of using homebrew libxml2
benlieb has joined #ruby
wldcordeiro_ has quit [Read error: Connection reset by peer]
wldcordeiro_ has joined #ruby
<ruurd>
did you try bundle config build.nokogiri --use-system-libraries
<ivanskie>
ther we go. thanks Ox0dea
<Lamarus>
yes
topdownjimmy has quit [Ping timeout: 256 seconds]
<ruurd>
as per the comments?
<Lamarus>
same issue
<Ox0dea>
ivanskie: Happy to help. :)
<workmad3>
hays: rubinius gives you a bit more introspective power too, as it implements a lot more of the ruby language inside ruby itself (it still has a C++ bootstrap which is hard to access inside ruby, iirc)
<Ox0dea>
workmad3: Still no RubyVM::InstructionSequence#load, though. :(
<hays>
ruby seems fun. it might be the object oriented language ive been looking for
<Ox0dea>
hays: It is known.
<workmad3>
right, I need to get to bed
<Ox0dea>
Au revoir.
<workmad3>
night all :)
topdownjimmy has joined #ruby
<Ox0dea>
hays: I envy your fresh eyes and mind.
<polpak>
hays: it's interesting, but personally I still prefer python
<Ox0dea>
First getting into Ruby was a blast.
<polpak>
hays: I just have to do this for work ;p
<Lamarus>
ruurd, here is what I get when I do bundle install on my project that lead me to the nokogiri thing http://laravel.io/bin/0eqyM
<ruurd>
Lamarus why stick to 2.2.1?
Kyuujitsu has joined #ruby
<hays>
polpak: different tools for different things though... I do love me some python
<Lamarus>
ruurd, what do you mean?
GPrime has joined #ruby
sargas has joined #ruby
<ruurd>
why not update to ruby-2.2.2 ?
<hays>
im using ruby for work also
mpistone has quit [Remote host closed the connection]
<Lamarus>
i will if that helps
<hays>
trying to hack together some scripts--aparently its the nome de plume of this company
<Lamarus>
i just did `brew install ruby`
<Lamarus>
and it gave me 2.2.1
bruno- has joined #ruby
GPrime has quit [Client Quit]
<hays>
hrm. my ruby is 2.0.0p481
<polpak>
hays: I think you mean lingua franca
Kyuujitsu has quit [Client Quit]
leesharma has quit [Ping timeout: 255 seconds]
<Lamarus>
well, that is odd... `ruby -v` reports 2.2.1p85 but `brew install ruby` shows ruby-2.2.2 already installed
<hays>
polpak: i do
shadoi has quit [Quit: Leaving.]
<Lamarus>
how do I get rid of 2.2.1
<ruurd>
when was the last time you ran brew update && brew upgrade --all
<Ox0dea>
hays: For reference, "nom de plume" essentially translates to "pen name".
shadoi has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
<Ox0dea>
From when we wrote with quills.
<ruurd>
Oh. Ahem.
<hays>
Ox0dea: yeh i felt stupid once i hit enter
mikecmpbll has quit [Quit: i've nodded off.]
theery has quit [Remote host closed the connection]