<jtdoncas>
b0nn: good to hear. are you getting twitter data properly flowing?
eb0t has quit [Quit: WeeChat 1.4]
eb0t has joined #ruby
rdavila has quit [Read error: Connection reset by peer]
ruid has joined #ruby
<b0nn>
yes and no
<montanonic>
So, it's often a good idea to hide stateful components from the users of your API via private methods. But, of course, in Ruby you can still access these variables with things like instance_eval; I believe this to be a good thing. That said, JavaScript style, it seems like we can create truly private vars
<b0nn>
I made the mistake of having a single connection for each search
<montanonic>
x = proc { y = 0; proc { y += 1 } }
<montanonic>
z = x.()
rdavila has joined #ruby
<b0nn>
I have to reeningeer it such that only one connection is used, and I sort the searches out serverside
<montanonic>
And now `z` is a counter, but we can't access its state. My question is: is there any way (without going into C/low-level) to look at the `y` variable within `z`?
<montanonic>
Otherwise, it's interesting to me that there's a way within Ruby to force actually private data, via nested closures.
tectonic has quit []
<lupine>
eval ?
<montanonic>
how would I use it? I haven't really used `eval` in Ruby, nor learned much about it (fairly new to the language)
<lupine>
montanonic: x.().binding.eval("y")
<lupine>
sorry :D
<montanonic>
lupine: Ahhh! Perfect. Glad to know that's possible
<montanonic>
thank you!
<lupine>
one option if you're paranoid is process isolatio
<lupine>
you really can't trust ruby to do things here
<montanonic>
yeah I'm not actually using any of this, just exploring the bounds of the language
x0f has joined #ruby
<montanonic>
thanks for your help
eb0t has quit [Quit: WeeChat 1.4]
ruid has quit [Quit: Leaving]
allcentury has joined #ruby
<al2o3-cr>
montanonic: you can also access it using z.binding.local_variable_get 'y'
<montanonic>
al2o3-cr: great! thank you too
eb0t has joined #ruby
eb0t has quit [Changing host]
eb0t has joined #ruby
scorphus has joined #ruby
ascarter has joined #ruby
charliesome has joined #ruby
jnj has joined #ruby
Sammichmaker has quit [Quit: Leaving]
<jnj>
Could anyone help me with a regular expression? I want to split the string "0 I 4 <7, 8> <4, 5>" by spaces, but ignore the spaces within brackets, so I want the output to be: ["0", "I", "4", "<7, 8>", "<4, 5>"]
<apeiros>
jnj: .scan(/<[^>]*>|\S/)
<domgetter>
jnj can bracketed items have bracketed items inside them?
j416 has quit [Ping timeout: 260 seconds]
<jnj>
domgetter: Nah, but lines will always be looking like number, letter, number, then pairs of numbers in brackets
AnoHito has quit [Quit: Leaving]
<jnj>
apeiros: Thanks! What changes would I need to make to prevent a number from being split, so in another example "0 I 4325 <7, 8> <4, 5>" it'd be [0, I, 4325, <7, 8>, <4, 5>]
<apeiros>
oh, the \S misses a + after it
<jnj>
apeiros: that was exactly it!
<jnj>
Thank you so much
paradisaeidae has quit [Quit: ChatZilla 0.9.93 [Firefox 50.0.2/20161129173726]]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
konsolebox has quit [Quit: Leaving]
blaxter has joined #ruby
blaxter has quit [Client Quit]
Channel6 has joined #ruby
x77686d has quit [Quit: x77686d]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ruby-lang815>
i cant seem to update or change anything as i cant connect i understand it was discontinued support for sslv3 due to poodle etc but still cant get a connection to rubygems
<nfsnobody->
hey all, I've built a systemd definition for a ruby script I wrote but it seems like it's failing to find a required gem... /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- active_record (LoadError)
<nfsnobody->
in the definition file I specify a username/group of a user who has RVM and the relevant gems installed
zukin has joined #ruby
<nfsnobody->
I also threw a ENVIRONMENT into the systemd file to see if it'd help, no help unfortunately :( - Environment="GEM_HOME=//usr/local/rvm/gems/ruby-2.2.4:/usr/local/rvm/gems/ruby-2.2.4@global"
<nfsnobody->
I feel like it's some sort of an environment issue, given if I run the script as the user directly under bash, it loads without issue
<ropeney>
b0nn, it works for me
<b0nn>
Ropeney: thanks, it must be something else in the code
raul782 has quit [Read error: Connection reset by peer]
raul782 has quit [Remote host closed the connection]
edwardly has joined #ruby
edwardly has quit [Max SendQ exceeded]
nankyokusei has joined #ruby
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
LoneHermit has quit [Ping timeout: 260 seconds]
tdump has joined #ruby
<tdump>
I was wondering what is preferable or conventional way to approach a problem. If I want to make a change to an array should I use map and a method, or each and a !method?
nankyokusei has quit [Ping timeout: 258 seconds]
<tdump>
nobody?
<tdump>
..Bueller........Bueller....
<adam12>
Likely map
<adam12>
(imho)
<tdump>
adam12: is that because the expectation is that map modifies in place? what's your reasoning? Thanks by the way.
<adam12>
tdump: I'd rather not start mutating data in place. IIRC there is possible issues with thread safety.
<adam12>
But I don't remember for sure now, tbh.
<tdump>
oh. maybe i misunderstood map. i thought it did modify in place. i'll take another look at it. i guess it could just return the new array instead of the source array. thanks again
<adam12>
It returns a new array.
raldu has quit [Ping timeout: 240 seconds]
<adam12>
I don't believe it modifies in place...
raldu has joined #ruby
jgnagy has joined #ruby
<tdump>
adam12: you are correct. I just looked it up.
raul782 has joined #ruby
jgnagy has quit [Ping timeout: 250 seconds]
SuperLag has quit [Quit: leaving]
SuperLag has joined #ruby
Kilo`byte has quit [Ping timeout: 248 seconds]
SpiffTR has joined #ruby
Mr_Pancake has quit [Ping timeout: 248 seconds]
Mr_Pancake has joined #ruby
Kilo`byte has joined #ruby
<al2o3-cr>
tdump: .map! does
<tdump>
al2o3-cr: You are also correct. The stack overflow post I looked up made that distinction as well. Thank you for trying to clarify.
raul782 has quit [Remote host closed the connection]
djbkd_ has joined #ruby
SpiffTR has quit [Ping timeout: 265 seconds]
<al2o3-cr>
tdump: preferably, read the docs :)
<tdump>
al2o3-cr: i might give that a shot ;-)
jeyraof has quit [Quit: This computer has gone to sleep]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
xberg has joined #ruby
<baweaver>
TIL you can space delimit those queries. Handy. Danke al2o3-cr
<al2o3-cr>
baweaver: upto 3 i think
<baweaver>
In any case, handy.
blackbom1 has quit [Ping timeout: 268 seconds]
warrshrike has joined #ruby
charliesome has joined #ruby
<warrshrike>
How can I parse the following string with a regular expression to get: node id, java type and name, EnclClass, EnclMethod, sFlowType, kind, vertID, calls array, fields array. the last three may or may not be present in the string
<warrshrike>
[Node Id: 25322], [Java Type & Name: java.lang.String @$r1], [EnclClass: com.umeng.common.a], [EnclMethod: void c(java.lang.String,java.lang.String)], [SflowType: @Readonly, @Safe], [Kind: local]\n---- Vertex id: 25322 \n---- The calls array: 24480 \n---- The fields array: \n---- The edge info: local\n"
<warrshrike>
and the edge info too*. I need that too. it may or may not be present.
<warrshrike>
I'snt scan for multiple matches? wouldnt match be better?
<djellemah>
domgetter: no
<domgetter>
djellemah Are there any resources I can read that would bring me to the same conclusion?
<djellemah>
warrshrike: you could write a regex for match, but my guess is it'd be big and hard to debug
<warrshrike>
djellemah: so whats your recommendation? old fashioned stuff with int indexes?
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
cibs has quit [Ping timeout: 268 seconds]
cibs has joined #ruby
threh has quit [Quit: 'Til next time]
Tempesta has quit [Read error: Connection reset by peer]
Tempesta has joined #ruby
Tempesta has quit [Changing host]
Tempesta has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
zotherstupidguy has joined #ruby
Keltia_ has joined #ruby
greenhat- has joined #ruby
matp has quit [Read error: Connection reset by peer]
arthurnn_ has joined #ruby
ta_ has quit [Remote host closed the connection]
matp_ has joined #ruby
<zotherstupidguy>
is there a hook method for const_set?
marens_ has joined #ruby
Rutix`away has joined #ruby
Rutix`away has joined #ruby
Rutix`away has quit [Changing host]
<djellemah>
domgetter: the most concise answer I can think of is that eval takes a string, not an ast representation. But you could also look at things like https://github.com/whitequark/parser
silverdu1t has joined #ruby
grug_ has joined #ruby
WhiteKIB- has joined #ruby
tsou has quit [Ping timeout: 268 seconds]
vadviktor_ has joined #ruby
chrisarc1nd has joined #ruby
bgray_ has joined #ruby
Alina-malina_ has joined #ruby
Toledo has joined #ruby
spidermario has joined #ruby
jeyraof_ has joined #ruby
<djellemah>
warrshrike: instantiate a scanner and call it repeatedly with patterns that should match. Then switch when you get a nil return. ¯\_(ツ)_/¯ it's not a clean problem.
guardian` has joined #ruby
Keltia has quit [Read error: Connection reset by peer]
grug has quit [Ping timeout: 260 seconds]
silverdust has quit [Ping timeout: 260 seconds]
hightower2 has quit [Ping timeout: 260 seconds]
xcesariox has joined #ruby
matp_ is now known as matp
<warrshrike>
this gives me the first match but not the second. how do I ignore all intermediate characters?
<warrshrike>
i tried this but it bring lots of extra stuff at the end str.scan(/\----(.+?)\s*:\s*(.+?)\ \n----/).to_h
terens has joined #ruby
<nchambers>
If I have an array of members, and I'm traversing over them in a for loop, is there a way to get 3 members at a time? so for example if the array was [1,2,3,4,5,6,7,8,9], the first iteration I would get 1,2,3.
<al2o3-cr>
nchambers: each_slice
vikaton has quit [Quit: Connection closed for inactivity]
xcesariox has quit [Ping timeout: 258 seconds]
<nchambers>
al2o3-cr, thanks thats perfect
SpiffTR has quit [Ping timeout: 250 seconds]
<al2o3-cr>
happy days :)
CloCkWeRX has quit [Ping timeout: 240 seconds]
symm- has quit [Ping timeout: 250 seconds]
fenre has joined #ruby
djellemah has quit [Ping timeout: 240 seconds]
djellemah_ has quit [Ping timeout: 260 seconds]
<manveru>
warrshrike: i guess the question is what you want the value of the fields array to be :)
<warrshrike>
it worked now :). i had to do \\n instead of \n
<manveru>
if you use string literals like '\n' then it won't be a newline
<manveru>
so you need \\n to match a literal \n
Dimik has quit [Ping timeout: 250 seconds]
postmodern has quit [Quit: Leaving]
CloCkWeRX has joined #ruby
<tdump>
regex is dope
last_staff has joined #ruby
drorp24[m] has joined #ruby
riotgsmport[m] has joined #ruby
Donalmartin[m] has joined #ruby
philidor[m] has joined #ruby
Michael5[m] has joined #ruby
serah[m] has joined #ruby
Luca[m] has joined #ruby
vondruch has quit [Ping timeout: 256 seconds]
n[m] has joined #ruby
h42r62[m] has joined #ruby
davix[matrix] has joined #ruby
fladson[m] has joined #ruby
claudiuinberlin has joined #ruby
omphe has joined #ruby
Luna_Moonfang has quit [Quit: WeeChat 1.6]
pawnbox has quit [Remote host closed the connection]
Luna_Moonfang has joined #ruby
nowhereman has joined #ruby
SesMan has joined #ruby
Snickers has joined #ruby
Luca[m] has quit [Ping timeout: 240 seconds]
n[m] has quit [Ping timeout: 245 seconds]
Synthead has quit [Ping timeout: 256 seconds]
h42r62[m] has quit [Ping timeout: 246 seconds]
philidor[m] has quit [Ping timeout: 246 seconds]
Donalmartin[m] has quit [Ping timeout: 250 seconds]
Michael5[m] has quit [Ping timeout: 250 seconds]
serah[m] has quit [Ping timeout: 260 seconds]
davix[matrix] has quit [Ping timeout: 260 seconds]
riotgsmport[m] has quit [Ping timeout: 260 seconds]
fladson[m] has quit [Ping timeout: 258 seconds]
drorp24[m] has quit [Ping timeout: 258 seconds]
mim1k|work has joined #ruby
biberu has joined #ruby
jtdoncas has quit [Ping timeout: 244 seconds]
niranjan has joined #ruby
djellemah has joined #ruby
djellemah_ has joined #ruby
<niranjan>
Hi there, I am very new to Ruby programming ,and i tried to use File.Join("ABC","DEF") to create a dir structure ABC/DEF. It doesnt give me error or it works.
<niranjan>
what could be wrong there, Btw i am using Ruby 2.3.3 on Ubuntu
SpiffTR has joined #ruby
cgfbee has quit [Excess Flood]
etehtsea has quit [Ping timeout: 260 seconds]
Morrolan has quit [Ping timeout: 244 seconds]
Morrolan has joined #ruby
optiz0r has joined #ruby
<herwin>
use join with a lowercase "j"
Synthead has joined #ruby
<niranjan>
sorry, i used with lowercase only,but typed it wrong here herwin
beilabs has joined #ruby
postmodern has joined #ruby
<djellemah_>
niranjan: that just creates the string for the file name. Look at Dir.mkdir
postmodern has quit [Client Quit]
LoneHerm_ has joined #ruby
alexherbo2 has quit [Quit: WeeChat 1.6]
cgfbee has joined #ruby
postmodern has joined #ruby
djbkd_ has quit []
<niranjan>
ohh, join just creates string but not dir?
<niranjan>
i used require utilis for mkdir ,that worked
SpiffTR has quit [Ping timeout: 265 seconds]
antoniobeyah has quit [Quit: antoniobeyah]
<dminuoso>
niranjan: Correct. Refer to the documentation
astrobunny has quit [Remote host closed the connection]
LoneHermit has quit [Ping timeout: 250 seconds]
postmodern has quit [Quit: Leaving]
postmodern has joined #ruby
minimalism has quit [Ping timeout: 244 seconds]
<nchambers>
is there a ruby equivalent to pythons: for count, item in enumerate(some_list): ...
drorp24[m] has joined #ruby
<al2o3-cr>
nchambers: each_with_index
<nchambers>
thanks again!
<al2o3-cr>
np
giraffe has joined #ruby
NeverTired has quit [Quit: Connection closed for inactivity]
nankyokusei has quit [Ping timeout: 258 seconds]
tpendragon has joined #ruby
<dminuoso>
al2o3-cr: each.with_index
tomphp has joined #ruby
<dminuoso>
(It's the slightly more elegant solution, since it's univerally applicable to any Enumerator)
<dminuoso>
^- nchambers
<al2o3-cr>
dminuoso: i only use that way when i want my indices to start at something different then 0
djellemah_ has quit [Ping timeout: 250 seconds]
<al2o3-cr>
so like each.with_index(1)
ferr1 has joined #ruby
<dminuoso>
al2o3-cr: I meant it's universally useful even when you do each_slice.with_index or maybe map.with_index
warrshrike has quit [Ping timeout: 260 seconds]
<al2o3-cr>
dminuoso: oh, yeah sure!
<dminuoso>
al2o3-cr: You don't have a "special method" to do the job and need to remember "each_with_index". So I would use each.with_index for consistencies sake. :)
sebatbg has quit [Quit: ChatZilla 0.9.93 [SeaMonkey 2.40/20160118183504]]
LoneHerm_ has joined #ruby
nankyokusei has joined #ruby
eb0t has quit [Quit: WeeChat 1.4]
LoneHerm_ has quit [Ping timeout: 258 seconds]
eb0t has joined #ruby
yeticry has quit [Ping timeout: 245 seconds]
bturker has quit [Ping timeout: 256 seconds]
nankyokusei has quit [Ping timeout: 260 seconds]
pawnbox has joined #ruby
yeticry has joined #ruby
eb0t has quit [Client Quit]
f4 has joined #ruby
koooge has quit [Quit: Leaving...]
lizard2010 has joined #ruby
zotherstupidguy has quit [Ping timeout: 246 seconds]
lizard2010 has quit [Client Quit]
zotherstupidguy has joined #ruby
GodFather has joined #ruby
xall has joined #ruby
eb0t has joined #ruby
jaguarmagenta has joined #ruby
axisys has quit [Quit: leaving]
axisys has joined #ruby
xall has quit [Ping timeout: 265 seconds]
eb0t has quit [Client Quit]
jaguarmagenta has quit [Ping timeout: 265 seconds]
SpiffTR has joined #ruby
eb0t has joined #ruby
eb0t has quit [Client Quit]
ruby309 has joined #ruby
<ruby309>
cowboy: hellou
ldnunes has quit [Ping timeout: 245 seconds]
eb0t has joined #ruby
nowhereman has joined #ruby
sparch_ has joined #ruby
sparch_ has quit [Changing host]
sparch_ has joined #ruby
william3 has joined #ruby
r3vDev has quit [Ping timeout: 268 seconds]
lizard2010 has joined #ruby
lizard2010 has quit [Read error: Connection reset by peer]
nadir has joined #ruby
govg has quit [Ping timeout: 260 seconds]
dcluna has joined #ruby
eb0t has quit [Quit: WeeChat 1.4]
skweek has quit [Ping timeout: 245 seconds]
william3 has quit [Remote host closed the connection]
ropeney has joined #ruby
bturker has joined #ruby
lee-jon has joined #ruby
montanonic has joined #ruby
lenwood has quit [Ping timeout: 246 seconds]
ldnunes has joined #ruby
braincrash has joined #ruby
c355e3b has joined #ruby
aryaching has quit [Ping timeout: 265 seconds]
aryaching has joined #ruby
niranjan has quit [Ping timeout: 260 seconds]
f4 has quit [Remote host closed the connection]
ferr1 has quit [Quit: WeeChat 1.6]
ascarter has joined #ruby
tectonic has joined #ruby
lenwood has joined #ruby
SpiffTR has quit [Ping timeout: 248 seconds]
Alina-malina_ is now known as Alina-malina
raul782 has joined #ruby
al2o3-cr has quit [Ping timeout: 256 seconds]
raul782 has quit [Remote host closed the connection]
rapha has quit [Quit: WeeChat 1.6]
raul782 has joined #ruby
LoneHermit has joined #ruby
beawesomeinstead has quit []
tk__ has joined #ruby
jz has joined #ruby
jz is now known as Guest896
beawesomeinstead has joined #ruby
Guest896 has quit [Max SendQ exceeded]
johnzorn- has joined #ruby
johnzorn- has quit [Max SendQ exceeded]
LoneHermit has quit [Ping timeout: 246 seconds]
johnzorn- has joined #ruby
tectonic has quit []
brendan- has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 256 seconds]
nettoweb has joined #ruby
johnzorn- has quit [Max SendQ exceeded]
johnzorn has quit [Ping timeout: 250 seconds]
nowhereman has quit [Remote host closed the connection]
nowhereman has joined #ruby
chouhoulis has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Bish>
is there something cooler than gserver if i want to write tcp server from scratch?
<Bish>
and no eventmachine please
fmcgeough has joined #ruby
johnzorn has joined #ruby
sdothum has joined #ruby
johnzorn has quit [Max SendQ exceeded]
johnzorn has joined #ruby
johnzorn has quit [Max SendQ exceeded]
SpiffTR has joined #ruby
braincrash has quit [Ping timeout: 250 seconds]
rwb has quit [Ping timeout: 268 seconds]
johnzorn has joined #ruby
x77686d has joined #ruby
johnzorn has quit [Max SendQ exceeded]
AlbertTing has joined #ruby
johnzorn has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
braincrash has joined #ruby
johnzorn has quit [Max SendQ exceeded]
fergal has joined #ruby
<fergal>
hi guys, is it possible for a class definition to contain an instance of itself?
destructure has joined #ruby
destructure has quit [Changing host]
destructure has joined #ruby
aryaching has quit [Ping timeout: 268 seconds]
xrlk has joined #ruby
h1fuelce_ has quit [Remote host closed the connection]
emilkarl has quit [Read error: Connection reset by peer]
lee-jon has quit [Quit: lee-jon]
emilkarl has joined #ruby
synthroid has joined #ruby
<toretore>
fergal: elaborate
<matthewd>
Bish: nio4r is handy if you want an evented IO model without EM.. but it's a layer below what gserver does; I don't know of any direct equivalent
<Bish>
matthewd: looking into it
<Bish>
right now i found my way back to celluloid
<Bish>
but i am unsure if i want that
tvw has joined #ruby
<fergal>
toretore: so i have a class thats basically a hash for storing configuration key/values. i want to have another hash that mimicks the same structure as the options hash, with the same keys, but the values will be the source of the configuration value. so say my config hash looks like { “log” => “debug” }, the source hash will look like { “log” => “command line parameter” } - in my application, config values can be set in a bunch of different ways
<fergal>
env vars, config files, command line flags etc, so i want to keep track of where each config parameter comes from
pawnbox has quit [Remote host closed the connection]
psychicist__ has quit [Ping timeout: 240 seconds]
<Bish>
what about cool.io is that fancy?
<fergal>
it seems to me that the nicest way to do this is for my config hash to contain an instance of the same class, called source hash, and when the config hash gets updated, i can update the source hash at the same time
allcentury has joined #ruby
<toretore>
cool.io is deprecated
<toretore>
fergal: do you have any code to gist?
<fergal>
the other approach would be to instantiate the source hash at the same level as the config hash, and update the source hash as and when i update the config hash
<emilkarl>
it is possible to do (1..10).each but is it possible to do the other way around (10..1).each?
johnmilton has joined #ruby
<herwin>
10.downto(1).each
<emilkarl>
Ty!
<emilkarl>
herwin
william3 has joined #ruby
<kke>
can you think of some nice way to safely eval / perform calculations? such as: val = "(5+7)/2"; val = eval(val) .. perhaps a regex that validates the string is just plain simple math? :)
lxsameer has quit [Quit: WeeChat 1.6]
william3 has quit [Remote host closed the connection]
william3 has joined #ruby
<kke>
coming to think of it i just want +,-,*,/ and ().. so i can do something like "if var =~ /\A[+-*\0-9]+\z/"
<kke>
i doubt anyone's going to hack that.
ruby309 has quit [Ping timeout: 260 seconds]
tyang has joined #ruby
<Bish>
hm i am not getting forward with my decision
<Bish_>
but i could use scoping with this approach
anuxivm has joined #ruby
<manveru>
well, except with send you at least get nice backtraces
h1fuelcell has joined #ruby
jaguarmagenta has quit [Ping timeout: 256 seconds]
eggshke has quit []
r3vDev has joined #ruby
<manveru>
not sure why you think you can't do scoping with methods :)
<matthewd>
I really think you're overestimating the difficulty of configuring Postfix, and wildly underestimating the difficulty of writing a mail server :/
xall has quit [Read error: Connection reset by peer]
<Bish_>
i've done all that before, so trust me on that one ;) but thanks for the advice
<Bish_>
i know this is hell
<toretore>
Bish_: instead of being so specific, just say: give me an object that responds to x and returns y
<toretore>
which also describes "responds to [symbol], then call" i guess, but it's simpler
<Bish_>
i know this is hell
<Bish_>
whopsie, sorry.
<manveru>
well, i'd just write the proxy using the builtin sockets and a bit of IO.select and see how it goes :)
_ZerGabriel_ has joined #ruby
SpiffTR has joined #ruby
<Bish_>
well it's not really a proxy, this thing is supposed to receive a mail and look what it can do with it
xall has joined #ruby
claudiuinberlin has joined #ruby
<Bish_>
is it possible to manipulate pre-defined locals for a method?
h1fuelcell has quit [Ping timeout: 265 seconds]
<Bish_>
tl;dr can i manipulate local variables programmaticially?
<toretore>
that is not a question you should be asking
<Bish_>
just interested
<manveru>
>> class X; name = "someone"; define_method(:shout){ puts "hi i'm #{name}" }; end; X.new.shout
<Bish_>
i can't really put it into words, but i don't feel EM uses the capabilities ruby offers
<Bish_>
just looks like wrapped C-code
<manveru>
well... it _is_ wrapped C code
skweek has joined #ruby
<manveru>
but so is IO
<Bish_>
yeah and ruby is strong when you barely program and just configure stuff with weird DSLs
<Bish_>
that's basicially my goal
<toretore>
Bish_: then you should be asking about that instead of how to manipulate local variables
ta_ has quit [Remote host closed the connection]
<manveru>
ah, i see where our viewpoints diverge now :)
<Bish_>
toretore: metaprogramming is also the strength of ruby
<Bish_>
so if ruby can do that it's good to know :)
<Bish_>
but it really looks ugly, after looking into few threads of stackoverflow
lee-jon has joined #ruby
<toretore>
metaprogramming is a code smell
josealobato has joined #ruby
<Bish_>
then why do you like ruby?
hightower2 has quit [Ping timeout: 250 seconds]
<herwin>
there is more to ruby than just metaprogramming
hightower2 has joined #ruby
<toretore>
the way you're asking questions suggests to me that you are just lacking knowledge, so my suggestion is that you read up on the various things you're trying to work with
cdg has joined #ruby
<Bish_>
well, but i think the poor ruby speed is because of features like that
oivoodoo has quit [Ping timeout: 265 seconds]
<Bish_>
toretore: i've done enough to know what i am doing thanks
<Bish_>
so i think ruby is a poor choice if you don't use it's main features
rfoust has joined #ruby
SpiffTR has quit [Ping timeout: 244 seconds]
tuxaddicted has joined #ruby
cdg has quit [Read error: Connection reset by peer]
tehcraig has joined #ruby
montanonic has quit [Ping timeout: 256 seconds]
cdg has joined #ruby
x77686d has quit [Quit: x77686d]
aryaching has quit [Ping timeout: 248 seconds]
rfoust has quit [Ping timeout: 240 seconds]
chouhoulis has quit [Remote host closed the connection]
Saladus has joined #ruby
ramortegui has joined #ruby
emilkarl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
LoneHerm_ has joined #ruby
zapata has quit [Ping timeout: 260 seconds]
Madplatypus has quit [Quit: Connection closed for inactivity]
mikeiniowa has joined #ruby
bmurt has joined #ruby
<Bish_>
>> proc { test = 3; proc { puts test }.call}.call
Bish_ is now known as Bish
<Bish>
>> proc { test = 3; proc { puts test }.call}.call
<dminuoso>
josealobato: Looks like it was removed. I can't recall the details.
<dminuoso>
josealobato: The flowchart lists all up-to-date methods. If you have trouble with any of these, please give us a) the code you have, b) what behavior you expect and c) what behavior you got instead.
GodFather has quit [Ping timeout: 240 seconds]
<josealobato>
but the funny thing is that in irb it works
dviola has joined #ruby
<dminuoso>
josealobato: use method(:sh).owner and tell me what you get
william3 has quit [Remote host closed the connection]
Emmanuel_Chanel has joined #ruby
yardenbar has quit [Remote host closed the connection]
Saladus has quit [Remote host closed the connection]
<toretore>
failshell: it's because you're using initialize_http_header
<toretore>
use request[key] = value
skweek has quit [Ping timeout: 240 seconds]
jaguarmagenta has quit [Remote host closed the connection]
Saladus has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
buglessdr has quit [Ping timeout: 268 seconds]
bmurt has joined #ruby
<failshell>
toretore: wow ok that fixed it. what does it do differently?
<toretore>
you're not supposed to use initialize_http_header
x77686d has joined #ruby
<toretore>
as its name suggests, it's for initializing the header values, meaning it will reset anything that was there before
<failshell>
i thought it initialized only that given header
<failshell>
ok well, thanks :)
SpiffTR has joined #ruby
jrafanie has joined #ruby
<toretore>
i don't know why it isn't private, maybe there is a use case i can't think of
h1fuelcell has joined #ruby
patarr has joined #ruby
fmcgeough has joined #ruby
hahuang65 has quit [Ping timeout: 245 seconds]
oivoodoo has joined #ruby
SpiffTR has quit [Ping timeout: 258 seconds]
rwb has quit [Ping timeout: 250 seconds]
h1fuelcell has quit [Ping timeout: 244 seconds]
william3 has joined #ruby
nocco has quit [Remote host closed the connection]
User458764 has joined #ruby
h1fuelcell has joined #ruby
terens has joined #ruby
oivoodoo has quit [Ping timeout: 260 seconds]
terens has quit [Remote host closed the connection]
tvw has quit []
babblebre has joined #ruby
nocco has joined #ruby
polishdub has joined #ruby
johnzorn has joined #ruby
ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dionysus69 has quit [Ping timeout: 260 seconds]
beilabs_ has quit [Remote host closed the connection]
hahuang65 has joined #ruby
beilabs has joined #ruby
rippa has joined #ruby
johnzorn has quit [Max SendQ exceeded]
marr has joined #ruby
johnzorn has joined #ruby
andikr has quit [Remote host closed the connection]
<emilkarl>
Is it possible to extend Numeric and be able to set self? I would like clamp! to set foo to max when doing foo.clamp!(5,10) instead of returning it
nowhereman has quit [Remote host closed the connection]
lee-jon has quit [Quit: lee-jon]
nowhereman has joined #ruby
antoniobeyah has joined #ruby
lee-jon has joined #ruby
Devalo has joined #ruby
vuoto has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
Madplatypus has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
byte512 has joined #ruby
raul782 has quit [Remote host closed the connection]
brent__ has joined #ruby
flashpoint9 has quit [Ping timeout: 240 seconds]
rikkipit_ has joined #ruby
[Butch] has joined #ruby
Cyrus has joined #ruby
blackwind_123 has joined #ruby
andikr has joined #ruby
conta has quit [Ping timeout: 256 seconds]
fergal has quit [Quit: fergal]
rikkipitt has quit [Ping timeout: 260 seconds]
<zotherstupidguy>
why (1...10) === 5
<zotherstupidguy>
equals `true`
<zotherstupidguy>
?
<elomatreb>
`===` does loose (case) equality, and since 5 is in the range 1...10, it returns true
<elomatreb>
You probably want `==`
<zotherstupidguy>
okay
antoniobeyah has quit [Quit: antoniobeyah]
<zotherstupidguy>
thnx
<adaedra>
you should not have to use === ever
Devalo has quit [Remote host closed the connection]
antoniobeyah has joined #ruby
<byte512>
adaedra: why? it's just an `.include?` no?
<adaedra>
it depends on the type on the left
<elomatreb>
=== does scary amounts of magic, depending on what is being compared
m1911 has joined #ruby
<adaedra>
=== is the “magic” between case, and in most cases there's a named method which does it too and is much clearer
<byte512>
ha, interesting, didn't know case was using ===
<adaedra>
elomatreb: there's no real magic behind ===, it's a method like any other
<elomatreb>
And doesn't silently do something different if your types mismatch, === will happily accept nil too
<elomatreb>
adaedra: I know how it works, but doing so dramatically different things depending on type counts as magic in my opinion
<byte512>
hum, ok
<adaedra>
you should see a lot of magic then.
enterprisey has joined #ruby
emilkarl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<elomatreb>
adaedra: What would you call this behaviour then?
LoneHermit has joined #ruby
<adaedra>
object-oriented programming
m1911 has quit [Client Quit]
m1911 has joined #ruby
xall has quit [Read error: Connection reset by peer]
<elomatreb>
adaedra: I am not talking about the implementation here, what I would call magic is the concept of an operator that "does what you mean, not what you say"
vuoto has quit [Remote host closed the connection]
lenwood has joined #ruby
tdy has quit [Read error: Connection reset by peer]
codfection has joined #ruby
m1911 has quit [Remote host closed the connection]
LoneHermit has quit [Ping timeout: 260 seconds]
_ZerGabriel_ has quit []
shinnya has joined #ruby
blackjid has quit [Ping timeout: 258 seconds]
SpiffTR has joined #ruby
xall has joined #ruby
tpendragon has quit [Ping timeout: 258 seconds]
roger_rabbit has quit [Changing host]
roger_rabbit has joined #ruby
Macrobiotic has joined #ruby
flashpoint9 has joined #ruby
<baweaver>
I use === fairly frequently in library functions.
<brent__>
so i did get the basic functionality set up, and I can display PDFs inside an <embed> tag in my react frontend, however it's a bit ugly, and am trying to treat it more like images with an <a> wrapping to to the actual pdf link. I was looking at a couple react-components on NPM and when I try to use them, i get a CORS error, that doesn't happen when just
<strass_>
I seem to be able to install using sudo gem install but I odnt think you're supposed tod o that
<DacHoliday>
should never do sudo, but make sure your gem path 'gem env' is included in your bashrc PATH=
Macrobiotic has quit [Quit: Connection closed for inactivity]
<strass_>
I think it's an open SSL error?
<strass_>
/home/strass/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- openssl (LoadError)
<strass_>
I have openSSL installed...
firstdayonthejob has quit [Ping timeout: 250 seconds]
raul782 has quit [Ping timeout: 268 seconds]
_crdpink has joined #ruby
LoneHermit has quit [Ping timeout: 248 seconds]
SpiffTR has joined #ruby
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
_crdpink is now known as crdprink
firstdayonthejob has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tyang has joined #ruby
crdprink has quit [Client Quit]
ascarter has joined #ruby
ascarter has quit [Client Quit]
rfoust has joined #ruby
vikaton has joined #ruby
SpiffTR has quit [Ping timeout: 260 seconds]
yeticry has quit [Ping timeout: 248 seconds]
ascarter has joined #ruby
firstdayonthejob has quit [Ping timeout: 260 seconds]
_crdpink has joined #ruby
_crdpink has left #ruby [#ruby]
TomyLobo has quit [Ping timeout: 250 seconds]
yeticry has joined #ruby
nankyokusei has joined #ruby
ascarter has quit [Client Quit]
ascarter has joined #ruby
tdy has quit [Ping timeout: 256 seconds]
ascarter has quit [Client Quit]
<brent__>
antoniobeyah: just finishing up this project, and just wanted to clarify if I was understanding somethign correctly
<DacHoliday>
/quit
nankyokusei has quit [Ping timeout: 250 seconds]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
DacHoliday has left #ruby [#ruby]
<brent__>
i'm storing the 'public_url' in my db, if I wanted to delete it the file from my db, as well as s3, do i just us an ajax call to that public_url w/ a delete method?
marxarelli is now known as marxarelli|afk
Gadgetoid has quit [Ping timeout: 250 seconds]
ascarter has joined #ruby
rwb has joined #ruby
<baweaver>
I'd do it on the backend in the controller action if I were you
marxarelli|afk is now known as marxarelli
<baweaver>
the frontend shouldn't have direct access to delete from S3
<baweaver>
otherwise users can do some very mean things
ascarter has quit [Client Quit]
mochiyoda has joined #ruby
ascarter has joined #ruby
cschneid_ has quit [Remote host closed the connection]