baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.4.0, 2.3.3 & 2.2.6: https://www.ruby-lang.org || Paste >3 lines of text to: https://gist.github.com || Rails questions? Ask in: #RubyOnRails || Logs: https://irclog.whitequark.org/ruby || Books: https://goo.gl/wpGhoQ
devgiant has quit [Quit: Leaving]
gsilva has quit [Remote host closed the connection]
Irishluck83 has joined #ruby
Fridtjof has quit [Ping timeout: 255 seconds]
Jackneill_ has quit [Remote host closed the connection]
Fridtjof has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
benlieb has joined #ruby
pedropt has joined #ruby
<pedropt> hello everyone
mim1k has joined #ruby
<Radar> hi
cschneid_ has joined #ruby
<pedropt> heys guys , i have my head melted in a ruby script
<pedropt> i need some help here
<pedropt> i am trying to open a file with a ruby script and set a variable based on the readed data
cschnei__ has joined #ruby
<pedropt> but i get an error , and i cant get rid of it
<pedropt> anyone here for the challenge ?
<elomatreb> We can't help you without the code
Kero has quit [Ping timeout: 240 seconds]
<pedropt> i need to read the first line of a file
<pedropt> i used this code because in the specific file there is only what i need to read
<Papierkorb> pedropt: Post the whole script, including all errors you're getting (the whole thing) to https://gist.github.com/
<pedropt> File.open("output/path.temp","r"){|out1|
<pedropt> and then
<pedropt> data=File.read(out1)
<pedropt> but i get an error
mim1k has quit [Ping timeout: 240 seconds]
aryaching has joined #ruby
cschneid_ has quit [Ping timeout: 264 seconds]
<pedropt> on line 137
hutch34 has joined #ruby
<pedropt> and then i want to use that data on line 209
<pedropt> this script already exists , i am just adjusting it to my config
<Disavowed> Anyone have a recommendation for a library to mock API endpoints?
<pedropt> the file path.temp only have the output to where command on line 209 should compile the file
<toretore> pedropt: what is the error?
<pedropt> :213: syntax error, unexpected end-of-input, expecting '}'
sepp2k has quit [Read error: Connection reset by peer]
millerti has joined #ruby
<toretore> pedropt: ok, now look on line 137 again
<pedropt> ok
<pedropt> ok i think it misses an }
aryaching has quit [Ping timeout: 260 seconds]
<pedropt> i try File.open("output/path.temp","r"){|out1|}
<pedropt> and now i get another error
<pedropt> 138:in `<main>': undefined local variable or method `out1' for main:Object (NameError)
Puffball_ has quit [Read error: Connection reset by peer]
<baweaver> Disavowed: VCR
<baweaver> pedropt: data = File.read("path/to/file")
<baweaver> Line 137 is unnecessary, you're doing the same thing.
<baweaver> you're also mixing a lot of indentation styles
Puffball has joined #ruby
<pedropt> ok let me test here
toretore has quit [Ping timeout: 255 seconds]
<Radar> hm where are the tests for this code
* Radar runs
<baweaver> Also it's exceptionally rare that someone uses for ... in in Ruby.
<baweaver> Metasploit module
<pedropt> yup
<baweaver> they have some context on their end to run it in that'd be a pain to get here.
<pedropt> i removed the metasploit generation of code
<pedropt> the metasploit payload will be done externally
<baweaver> Y'might want to read over a Ruby book as well like Eloquent Ruby.
<Disavowed> baweaver: This looks amazing! Thank you!
tristanp has joined #ruby
<baweaver> Not a problem
<pedropt> and then the script will merge both , the payload already generated and the original file
<baweaver> I mention it because you have some of the gist of Ruby but you're doing it in a really odd style that'll hurt later.
jtdoncas has joined #ruby
agent_white has quit [Read error: Connection reset by peer]
jellymann has joined #ruby
ddffg has quit [Quit: Leaving]
go|dfish has quit [Quit: SIGQUIT]
Kero has joined #ruby
<baweaver> there's a lot that's going to break in this script.
tristanp has quit [Ping timeout: 264 seconds]
go|dfish has joined #ruby
<pedropt> what do you mean
<baweaver> First function
<baweaver> is it supposed to break out and return only one value?
<baweaver> The return there will break out of the function with the first match against android.intent.category.LAUNCHER or android.intent.action.MAIN
jellymann has quit [Ping timeout: 260 seconds]
<baweaver> Reading through it there's just a lot of broken code paths
cdg has quit [Remote host closed the connection]
<pedropt> if you want to give an help on it then fell free to participate in one othe the projects i am collaborating in github that will use this script
<baweaver> Not enough knowledge of Metasploit or Android.
<matthewd> I'm not seeing a lot of broken stuff
<matthewd> Awful, definitely.. but not broken
agent_white has joined #ruby
<pedropt> the original script is at this git https://github.com/xc0d3rz/metasploit-apk-embed-payload
<pedropt> but i had to make some simple changes to adapt it to one of the projects i am collaborating
<pedropt> basically i removed some parts of the code where the script made a call to msfvenom to create a payload
<pedropt> this way when scripts start to run , it is already expecting the payload in its directory
<pedropt> and that payload was created before script start to run over a bash script
montanonic has quit [Ping timeout: 240 seconds]
benlieb has quit [Quit: benlieb]
DaniG2k has joined #ruby
hutch34 has quit [Ping timeout: 260 seconds]
<Radar> [11:28:19] <baweaver>Also it's exceptionally rare that someone uses for ... in in Ruby.
<Radar> This used to be standard (at least in Rails apps)
<baweaver> Radar: something something Rails and standards
<Radar> ;) ;) ;)
<baweaver> Truthy
<DaniG2k> hello all
* Radar triggered
<matthewd> I do not recall this :/
<Radar> matthewd: You really don't recall the "truthy" vs "true/false" discussion?
<Radar> or the for in ?
<matthewd> for in
<Radar> matthewd: I think it'd be in DHH's original blog in 15 mins blog post *goes to find*
<Radar> heh, in this video he creates db + table manually. I didn't remember that part.
<Radar> oh bugger, he uses scaffold. Well then.
charliesome has quit [Ping timeout: 240 seconds]
<baweaver> Radar: easy there, or you'll go into trigger overdrive
<Radar> matthewd: here's a piece of history for you: https://git.io/vyIeV
<Radar> I think this was the standard until ~2010/2011.
<baweaver> TIL
<matthewd> Wow, I stand corrected
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<matthewd> I didn't realise I was so rogue :P
<Radar> ;)
<Radar> DaniG2k: greetings
tildes has joined #ruby
nettoweb has joined #ruby
[ohjn] has joined #ruby
<DaniG2k> anyone here takig the Udacity course on AI besides me? '-
tildes has quit [Ping timeout: 260 seconds]
cschnei__ has quit [Remote host closed the connection]
aryaching has joined #ruby
[ohjn] has quit [Remote host closed the connection]
<DaniG2k> guess that's a no
<jtdoncas> no, why? :D
jellymann has joined #ruby
ResidentBiscuit has joined #ruby
<DaniG2k> just looking for others who are taking the course to discuss :)
jellymann has quit [Ping timeout: 255 seconds]
EckT has quit [Ping timeout: 260 seconds]
hutch34 has joined #ruby
ResidentBiscuit has quit [Ping timeout: 260 seconds]
bruce_lee has quit [Read error: Connection reset by peer]
jtdoncas has quit [Ping timeout: 240 seconds]
EckT has joined #ruby
pedropt has quit [Quit: Leaving]
milardovich has joined #ruby
milardovich has quit [Remote host closed the connection]
akkad has quit [Excess Flood]
akkad has joined #ruby
jgnagy has joined #ruby
marr has quit [Ping timeout: 260 seconds]
jgnagy has quit [Ping timeout: 268 seconds]
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
JeanCarloMachado has joined #ruby
rakm has joined #ruby
jellymann has joined #ruby
DaniG2k has quit [Read error: Connection reset by peer]
aryaching has quit [Ping timeout: 255 seconds]
CloCkWeRX has quit [Ping timeout: 240 seconds]
blackmesa has quit [Ping timeout: 252 seconds]
jellymann has quit [Ping timeout: 260 seconds]
DaniG2k has joined #ruby
blackmesa has joined #ruby
EV3RYDAYPR0GRESS has quit [Read error: Connection reset by peer]
<Radar> DaniG2k: Probably a topic better suited to #ruby-offtopic
charliesome has joined #ruby
enterprisey has quit [Remote host closed the connection]
EV3RYDAYPR0GRESS has joined #ruby
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
herbmillerjr has quit [Quit: Konversation terminated!]
aryaching has joined #ruby
CloCkWeRX has joined #ruby
mim1k has joined #ruby
agent_white has quit [Quit: leaving]
Azure|dc has quit [Quit: Oops.]
pawnbox has joined #ruby
brent__ has joined #ruby
zxvcd has joined #ruby
green_hat has joined #ruby
agent_white has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
tristanp has joined #ruby
pawnbox has quit [Ping timeout: 240 seconds]
astrobunny has joined #ruby
jphase has quit [Read error: No route to host]
tristanp has quit [Ping timeout: 260 seconds]
jphase has joined #ruby
brent__ has quit [Remote host closed the connection]
Mahpoul22 has joined #ruby
cschneid_ has joined #ruby
triangles has quit [Quit: Leaving]
pilne has quit [Quit: Quitting!]
d^sh has quit [Ping timeout: 268 seconds]
d^sh has joined #ruby
Cohedrin has joined #ruby
DaniG2k has quit [Quit: leaving]
Irishluck83 has quit [Quit: WeeChat 1.4]
Asher has quit [Quit: Leaving.]
chenli has joined #ruby
EckT has quit [Quit: -a- IRC for Android 2.1.32]
ResidentBiscuit has joined #ruby
Asher has joined #ruby
jellymann has joined #ruby
hutch34 has quit [Ping timeout: 268 seconds]
jellymann has quit [Ping timeout: 260 seconds]
Azure has joined #ruby
sspreitz has quit [Ping timeout: 255 seconds]
CloCkWeRX has quit [Ping timeout: 260 seconds]
jameser has joined #ruby
akkad has quit [Excess Flood]
govg has quit [Ping timeout: 260 seconds]
sspreitz has joined #ruby
hutch34 has joined #ruby
akkad has joined #ruby
mayfield has joined #ruby
gheegh has quit [Ping timeout: 255 seconds]
akkad has quit [Excess Flood]
akkad has joined #ruby
JeanCarloMachado has quit [Ping timeout: 255 seconds]
blackmesa has quit [Ping timeout: 260 seconds]
JoshS has joined #ruby
CloCkWeRX has joined #ruby
toretore has joined #ruby
KicStart has joined #ruby
__Yiota has joined #ruby
green_hat has quit [Remote host closed the connection]
cschneid_ has quit [Remote host closed the connection]
aupadhye has joined #ruby
DaniG2k has joined #ruby
enterprisey has joined #ruby
howdoi has joined #ruby
DaniG2k has quit [Ping timeout: 240 seconds]
DaniG2k has joined #ruby
hutch34 has quit [Ping timeout: 240 seconds]
t-recx has quit [Quit: t-recx]
ResidentBiscuit has quit [Remote host closed the connection]
ResidentBiscuit has joined #ruby
cschneid_ has joined #ruby
Mahpoul22 has quit [Quit: Leaving]
ResidentBiscuit has quit [Ping timeout: 260 seconds]
pawnbox has joined #ruby
cschneid_ has quit [Ping timeout: 240 seconds]
nothingnew has joined #ruby
govg has joined #ruby
Zequal has joined #ruby
pawnbox has quit [Ping timeout: 260 seconds]
EV3RYDAYPR0GRESS has quit [Ping timeout: 240 seconds]
<Zequal> Hey guys, I am looking at a ruby project and I am seeing a lot of terms used as directory names. spec, factories - I see these two mentioned a lot, what is it conveying?
<anekant> overengineering
<Zequal> Besides that, do you know the underlying purpose these terms are suppose to convey?
<anekant> spec is testing i think
<Zequal> Hmm, confusing - I see spec and test in the same project. That's frusterating.
<anekant> better not rely on me though
* anekant shuts up :)
<Zequal> It looks like factories are just an abstraction - an object that is used in other objects.
<matthewd> spec and test likely both contain tests, written using different tools (minitest and rspec)
<matthewd> Yes, factories are ~ template object instances, generally used by tests
<matthewd> Everything's just an abstraction ;)
<Zequal> Thanks matthewd!
dviola has quit [Quit: WeeChat 1.7]
akkad has quit [Excess Flood]
akkad has joined #ruby
green_hat has joined #ruby
ineb has quit [Ping timeout: 260 seconds]
arescorpio has joined #ruby
Axy has joined #ruby
Axy has joined #ruby
Axy has quit [Changing host]
<Radar> Zequal: If it's within the context of a Rails project, here's a book which uses both specs + factories: https://www.manning.com/books/rails-4-in-action
saneax-_-|AFK is now known as saneax
ins64 has quit [Ping timeout: 240 seconds]
Mia has quit [Ping timeout: 268 seconds]
mim1k has joined #ruby
ins64 has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
tristanp has joined #ruby
<Zequal> Radar: Thanks!
tristanp has quit [Ping timeout: 268 seconds]
nothingnew has quit [Read error: Connection reset by peer]
Channel6 has quit [Quit: Leaving]
gix has quit [Ping timeout: 240 seconds]
djbkd has joined #ruby
vikas027 has joined #ruby
gix has joined #ruby
arescorpio has quit [Quit: Leaving.]
<vikas027> Hey All, I have an eval line in a bash script to capture output from a terraform code. Please help me out to capture the same output in ruby as well. https://dpaste.de/8J8i I will be able to play around if I can capture the variables passed by terraform
hahuang65 has joined #ruby
jshjsh has joined #ruby
JoshS has quit [Ping timeout: 260 seconds]
braincrash has joined #ruby
last_staff has joined #ruby
jgnagy has joined #ruby
zxvcd has quit [Quit: Konversation terminated!]
raspado has joined #ruby
anisha has joined #ruby
anisha has quit [Client Quit]
ngpestelos has quit [Ping timeout: 252 seconds]
anisha has joined #ruby
montanonic has joined #ruby
KicStart has quit [Quit: Leaving.]
jenrzzz has joined #ruby
username_ has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
username_ has quit [Ping timeout: 255 seconds]
pwnd_nsfw has joined #ruby
pwnd_nsfw` has quit [Ping timeout: 260 seconds]
naprimer_3 has joined #ruby
CloCkWeRX has quit [Ping timeout: 252 seconds]
Dimik has joined #ruby
naprimer_2 has quit [Read error: Connection reset by peer]
marcdel has quit [Ping timeout: 240 seconds]
<vikas027> hey guys... what is the ruby equivalent of exec &> >(tee -a "$log_file") in a bash script ?
Runix has joined #ruby
ledestin has joined #ruby
green_hat has quit [Remote host closed the connection]
green_hat has joined #ruby
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
renchan has joined #ruby
CloCkWeRX has joined #ruby
heckler has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
djellemah has joined #ruby
rakm has joined #ruby
CloCkWeRX has quit [Ping timeout: 264 seconds]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
raspado has quit [Quit: Leaving...]
squ has joined #ruby
vikas027 has quit [Quit: Page closed]
jameser has quit [Ping timeout: 260 seconds]
astrobunny has quit [Remote host closed the connection]
FastJack has quit [Ping timeout: 260 seconds]
jameser has joined #ruby
fnord_ has quit [Ping timeout: 260 seconds]
Zequal has quit [Quit: Lost terminal]
montanonic has quit [Ping timeout: 240 seconds]
green_hat has quit []
astrobunny has joined #ruby
astrobunny has quit [Remote host closed the connection]
astrobunny has joined #ruby
CloCkWeRX has joined #ruby
FastJack has joined #ruby
fnord_ has joined #ruby
pawnbox has joined #ruby
nowhereman has joined #ruby
montanonic has joined #ruby
<chenli> hi, any one here can help me ? I want to install sensu from source code. So I download the code from github, Then I run: gem build sensu.gemspec, I get error: Invalid gemspec in [sensu.gemspec]: can't modify frozen String
mim1k has joined #ruby
<chenli> I just git cloned the code from https://github.com/sensu/sensu.git ... Did zero change.
<chenli> Am I using the command wrong ?
<chenli> I just want to build sensu from the source code.
<allisio> chenli: That's really weird. I can't reproduce the error here, and there's no in-place string modification in that gemspec. Would you mind posting the full error output?
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<allisio> Use `gem build -V` for maximum spew, but don't paste it directly into the channel. :)
mim1k has quit [Ping timeout: 264 seconds]
tristanp has joined #ruby
<chenli> Then I re-run "gem build sensu.gemspec", it looks passed: https://gist.github.com/lichen2013/942a019adc76315f30a059ffba1c64cd
<chenli> allisio: the issue before I do any change: https://gist.github.com/lichen2013/b62022d65103dd24c179071e14de7d28
User458764 has joined #ruby
<allisio> chenli: Sure, I see that they're defining Sensu::VERSION and freezing it in lib/sensu/constants.rb; I just don't see where the attempt to modify it is being made.
<allisio> It's certainly not happening in the gemspec itself.
jtdoncas has joined #ruby
ta_ has quit [Remote host closed the connection]
<allisio> chenli: You'll need the ruby-dev package.
<chenli> allisio: o! thanks! let me install it and re-try!
jtdoncas has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 255 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
skweek has quit [Remote host closed the connection]
<dminuoso> Bah. I hate Ruby.
<allisio> What's the worst part?
cibs has quit [Ping timeout: 268 seconds]
<dminuoso> Shit like this giving you useless stack traces if both code and more_code throw.
<dminuoso> It's a poor imitation of scope-based resource management.
mattmatt has joined #ruby
jellymann has joined #ruby
<chenli> :( Still get other issue : https://gist.github.com/lichen2013/de058f33b97492340fc14bf23f215021 - allisio
<dminuoso> chenli: Your native extension (oj) is not Ruby 2.4 compatible
<dminuoso> This internal struct was removed in 2.4 when Fixnum and Bignum were united under Integer.
<dminuoso> chenli: It's relatively easy to fix yourself if you want, or just file a bug report with the maintainer.
<chenli> dminuoso: a ? How I know which ruby version I should use ?
<dminuoso> chenli: Well to be sure you should check with the maintainer, but I reckon 2.3.3 should be fine.
mattmatt has left #ruby [#ruby]
mattmatt has joined #ruby
<dminuoso> chenli: Be sure to file a bug report nevertheless, so it can be made 2.4 compatible.
DaniG2k has quit [Quit: leaving]
<chenli> dminuoso: file a bug to where ?
<dminuoso> chenli: Oh I just checked. oj was made Ruby 2.4 compatible already.
<dminuoso> Upgrade your Gemfile/gemspec to allow for 2.18 or newer.
cibs has joined #ruby
<dminuoso> chenli: Almost all Ruby gems are maintained on github. You can usually find a link in your gem description. There you can create so-called "issues" for the maintainer to see and fix.
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso> But in this case an upgrade of your oj gem will suffice.
last_staff has quit [Quit: last_staff]
last_staff has joined #ruby
<chenli> dminuoso: o! I just download code https://github.com/sensu/sensu, and try to run it from source code... I know very little about ruby. :(
<chenli> dminuoso: I guess "gem install oj" should be enough to upgrade oj, right ?
ins64 has quit [Read error: Connection reset by peer]
<dminuoso> chenli: No.
xall has joined #ruby
<dminuoso> chenli: The issue lies with sensu actually, they need to either constrain their project to ruby 2.3 or update the oj dependency. You can do two things: a) file a simple bug with the sensu gem and b) downgrade your Ruby version to 2.3.3 while they fix it.
aupadhye has quit [Ping timeout: 240 seconds]
<chenli> dminuoso: so I upgrade the system oj do not work ?
<dminuoso> chenli: That's correct, and incidentally that is a good thing.
<chenli> dminuoso: I guess bug should be report here: https://github.com/sensu/sensu/issues/, right ?
<dminuoso> chenli: Yup. :)
User458764 has joined #ruby
ins64 has joined #ruby
mattmatt has quit [Quit: mattmatt]
jgnagy has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
jellymann has quit []
mattmatt has joined #ruby
pawnbox has joined #ruby
al2o3-cr has quit [Ping timeout: 260 seconds]
mattmatt has quit [Client Quit]
aupadhye has joined #ruby
<chenli> dminuoso: done for both, and now "gem install ./sensu-0.28.0.gem" passed.
<dminuoso> :)
<chenli> I get another question... how I start sensu with the complied code ?
ins64 has quit [Ping timeout: 240 seconds]
<dminuoso> chenli: Have you checked with their online documentation at https://sensuapp.org/docs/latest/overview ?
kies has quit [Ping timeout: 260 seconds]
pawnbox_ has joined #ruby
aupadhye has quit [Client Quit]
xall has quit [Quit: WeeChat 1.7]
itarato has joined #ruby
<chenli> dminuoso: yes, all I can get from the doc is install from deb package... But eventually I want to do some changes in the code. So, not enough from doc... :(
xall has joined #ruby
pawnbox has quit [Remote host closed the connection]
<dminuoso> chenli: Well I can't help you beyond this point other than recommending a good book.
charliesome has joined #ruby
certainty has joined #ruby
<chenli> Actually, if installed sensu from deb package, the start script is: /opt/sensu/bin/sensu-server: https://gist.github.com/lichen2013/b5ca9c00f1903b628cba99ed00d3b617
<dminuoso> chenli: Though the online documentation seems quite extensively.
<chenli> It has a line : load Gem.activate_bin_path('sensu', 'sensu-server', version) => now i have run : gem install ./sensu-0.28.0.gem
<chenli> would that cause my changed code run ?
ins64 has joined #ruby
djbkd has quit [Remote host closed the connection]
xall has quit [Quit: WeeChat 1.7]
xall has joined #ruby
djbkd has joined #ruby
aufi has joined #ruby
mim1k has joined #ruby
tildes has joined #ruby
aupadhye has joined #ruby
ins64 has quit [Ping timeout: 260 seconds]
mim1k has quit [Ping timeout: 260 seconds]
pawnbox_ has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawnbox has joined #ruby
charliesome has joined #ruby
govg has quit [Ping timeout: 260 seconds]
ins64 has joined #ruby
aryaching has quit [Read error: Connection reset by peer]
kies has joined #ruby
pawnbox has quit [Ping timeout: 260 seconds]
govg has joined #ruby
conta has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pwnd_nsfw` has joined #ruby
ins64 has quit [Ping timeout: 260 seconds]
jameser has joined #ruby
pwnd_nsfw has quit [Ping timeout: 252 seconds]
Robtop__ has joined #ruby
ins64 has joined #ruby
pwnd_nsfw` has quit [Ping timeout: 260 seconds]
CloCkWeRX has quit [Ping timeout: 255 seconds]
DaniG2k has joined #ruby
ins64 has quit [Ping timeout: 252 seconds]
pawnbox has joined #ruby
electrostat has quit [Quit: uwotm8]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
aganov has joined #ruby
vondruch has quit [Ping timeout: 260 seconds]
ta_ has joined #ruby
ins64 has joined #ruby
Silthias has joined #ruby
djbkd has quit [Quit: My people need me...]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Silthias1 has quit [Ping timeout: 240 seconds]
electrostat has joined #ruby
tomphp has joined #ruby
govg has quit [Ping timeout: 268 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
User458764 has joined #ruby
skolman_ has quit [Remote host closed the connection]
Pumukel has joined #ruby
skolman has joined #ruby
d0nn1e has quit [Ping timeout: 240 seconds]
CloCkWeRX has joined #ruby
aupadhye has quit [Ping timeout: 240 seconds]
d0nn1e has joined #ruby
antgel_ has joined #ruby
Xiti has quit [Ping timeout: 255 seconds]
_sfiguser has joined #ruby
skolman has quit [Ping timeout: 268 seconds]
tildes has quit [Ping timeout: 268 seconds]
pwnd_nsfw has joined #ruby
Robtop__ has quit [Ping timeout: 260 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
quiqua has joined #ruby
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
doublemalt_ has joined #ruby
vondruch has joined #ruby
last_staff has quit [Ping timeout: 260 seconds]
last_staff has joined #ruby
mark_66 has joined #ruby
pawnbox has quit [Ping timeout: 260 seconds]
anisha has quit [Quit: This computer has gone to sleep]
aupadhye has joined #ruby
govg has joined #ruby
saggittarius has joined #ruby
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
__Yiota has joined #ruby
polyzium has joined #ruby
<polyzium> hey there peeps
<dminuoso> polyzium: NameError: undefined local variable or method `peeps' for main:Object
<polyzium> what?
<dminuoso> :|
<polyzium> yeah uhh so i am new to ruby... i used js with nodejs before. i decided to check out ruby since js wasnt designed to be standalone
<polyzium> when ruby i think it was
<allisio> Do you know what you mean?
<polyzium> is there a native windows gui framework
<dminuoso> polyzium: Nothing useful worth mentioning.
<dminuoso> There's a few libraries like Shoes that are fine for really rudimentary and simplistic things though.
<dminuoso> Don't look at the qt bindings, they are grossly outdated.
DaniG2k has quit [Quit: leaving]
<allisio> polyzium: WebKit.
<dminuoso> Wut?
<dminuoso> I dont think you meant that, allisio..
<allisio> I did, though.
<allisio> JS is much more "standalone" than Ruby now that I have polyzium's definition.
<dminuoso> How exactly does webkit equate to a native windows gui framework?
saggittarius has quit [Quit: Page closed]
<dminuoso> Because you know, it's not.
ejnryu has joined #ruby
charliesome has joined #ruby
pawnbox has joined #ruby
<allisio> I confess that I was being somewhat facetious, but the point remains: if you're gonna stand on the shoulders of giants, might as well choose the tallest in the room.
<dminuoso> Except it's as much as a gui framework as libjpeg.
<dminuoso> Sure it's somehow got to do with producing images, but it still is not a GUI framework.
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
<allisio> "WebKit" was just my way of saying "HTML + CSS + JS" without so many initialisms and hard-to-type symbols.
igniting has joined #ruby
naprimer_3 has quit [Remote host closed the connection]
<dminuoso> polyzium: The 3 ways to get something like a graphical interface is a) a web interface like allisio mentioned, b) embed Ruby (MRuby) into an existing application using say Qt, or c) decouple it and use some broker (0mq, rabbitmq, corba, whatever) to connect the components.
djellemah has quit [Disconnected by services]
djellemah_ is now known as djellemah
ins64 has quit [Read error: Connection reset by peer]
ins64 has joined #ruby
naprimer has joined #ruby
djellemah_ has joined #ruby
pawnbox has quit [Ping timeout: 260 seconds]
hutch34 has joined #ruby
TomyWork has joined #ruby
esObe has joined #ruby
ejnryu has quit [Remote host closed the connection]
chenli has quit [Quit: ChatZilla 0.9.93 [Firefox 45.7.0/20170118123525]]
senayar has joined #ruby
senayar has joined #ruby
senayar has quit [Changing host]
hutch34 has quit [Ping timeout: 268 seconds]
montanonic has quit [Ping timeout: 268 seconds]
Dimik has quit [Ping timeout: 260 seconds]
CloCkWeRX has quit [Ping timeout: 252 seconds]
antgel_ has quit [Ping timeout: 260 seconds]
teclator has joined #ruby
mikecmpbll has joined #ruby
unshadow has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
astrobunny has quit [Remote host closed the connection]
jgnagy has joined #ruby
astrobunny has joined #ruby
certainty has quit [Ping timeout: 240 seconds]
astrobunny has quit [Remote host closed the connection]
biberu has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
sysvalve has joined #ruby
xen0fon has quit [Quit: xen0fon]
aglorei has quit [Ping timeout: 240 seconds]
Prira has quit [Ping timeout: 240 seconds]
jgnagy has quit [Ping timeout: 240 seconds]
certainty has joined #ruby
quiqua has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
quiqua has joined #ruby
CloCkWeRX has joined #ruby
enterprisey has quit [Remote host closed the connection]
uranellus has quit [Quit: ZNC 1.6.1 - http://znc.in]
<djellemah> dminuoso: I somewhat disagree with what you said about qtbindings. Yes, it's old. But it works (I have a personal app that I use on linux, ruby-2.4), there's no good alternative for windows afaik, and a decent OS will allow qt-4.8 libs and qt-5.6 libs to coexist. That said, getting it working on windows was tricky when I last tried it several years ago.
skolman_ has joined #ruby
<polyzium> allisio oh rly? i dont want JS to take up RAM filled up with webpages using electron and stuff like that. also the gui is laggy as fuck.
<polyzium> so i shud use native windows user interface apu.
<polyzium> *api
<dminuoso> djellemah: Oh it works absolutely. The fact that Qt 5 has been released 5 years ago just does not speak for the bindings library though.
antgel_ has joined #ruby
mim1k has joined #ruby
<polyzium> qt is not free dminuoso
elaptics has joined #ruby
<dminuoso> polyzium: Qt has a dual license model, giving you either a commercial or an open source license.
stoffus has joined #ruby
<polyzium> but... kde.
<polyzium> it made me think that qt is nonfree
uranellus has joined #ruby
uranellus has joined #ruby
uranellus has quit [Changing host]
<polyzium> anyways i think theres no need to use qt with ruby at all
aglorei has joined #ruby
mtkd has quit [Ping timeout: 255 seconds]
mtkd has joined #ruby
doublemalt_ has quit [Read error: No route to host]
DoubleMalt has joined #ruby
__Yiota has joined #ruby
Snickers has joined #ruby
Beams has joined #ruby
leitz has joined #ruby
senayar has quit []
pawnbox has joined #ruby
udiudi7 has joined #ruby
govg has quit [Quit: leaving]
nettoweb has joined #ruby
ineb has joined #ruby
<manveru> there's always tk :)
leitz has left #ruby ["Nappy Time"]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
habitullence has joined #ruby
<djellemah> dminuoso: last commit was November last year. So 4.8 is up to date. I'm guessing the work required to update for 5.x is more than the maintainer is willing to take on.
<habitullence> Hi, how would I search an array of hashes for a hash with a specific key value pair?
jenrzzz has joined #ruby
<dminuoso> djellemah: Precisely my point.
jamesaxl has joined #ruby
<dminuoso> &ri Enumerable#find habitullence
mim1k has quit [Ping timeout: 260 seconds]
ohcibi has quit [Remote host closed the connection]
<habitullence> Thanks :)
habitullence has quit [Quit: habitullence]
Guest39374 is now known as alamar
mim1k has joined #ruby
__Yiota has joined #ruby
tvw has joined #ruby
haxrbyte has quit [Remote host closed the connection]
haxrbyte has joined #ruby
blackmesa has joined #ruby
blackwind_123 has quit [Ping timeout: 268 seconds]
quiqua has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
quiqua has joined #ruby
uranellus has quit [Quit: ZNC 1.6.1 - http://znc.in]
uranellus has joined #ruby
uranellus has joined #ruby
uranellus has quit [Changing host]
blackwind_123 has joined #ruby
ohcibi has joined #ruby
lenwood has joined #ruby
binaryplease has joined #ruby
<djellemah> dminuoso: Well, I'm glad I could help clarify then ;-)
ledestin has quit [Quit: Textual IRC Client: www.textualapp.com]
ferr1 has joined #ruby
CloCkWeRX has left #ruby [#ruby]
marr has joined #ruby
boqplw has joined #ruby
jaruga has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaruga has left #ruby [#ruby]
lenwood has quit [Ping timeout: 268 seconds]
jaruga has joined #ruby
jaruga______ has joined #ruby
skolman_ has quit [Remote host closed the connection]
skolman_ has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
jaruga has quit [Ping timeout: 240 seconds]
jaruga______ has quit [Quit: jaruga______]
conta has quit [Ping timeout: 260 seconds]
skolman_ has quit [Ping timeout: 260 seconds]
jaruga______ has joined #ruby
workmad3 has joined #ruby
Runix has quit [Quit: Page closed]
senayar has joined #ruby
senayar has joined #ruby
senayar has quit [Changing host]
dionysus69 has joined #ruby
polyzium has quit [Quit: -a- Connection Timed Out]
polyzium has joined #ruby
jenrzzz has quit [Quit: Lost terminal]
User458764 has joined #ruby
binaryplease has quit [Quit: binaryplease]
nettoweb1 has joined #ruby
jtdoncas has joined #ruby
nettoweb has quit [Ping timeout: 260 seconds]
udiudi7 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
polyzium has quit [Changing host]
polyzium has joined #ruby
modlin has joined #ruby
jtdoncas has quit [Ping timeout: 260 seconds]
hutch34 has joined #ruby
hutch34 has quit [Ping timeout: 240 seconds]
arooni has quit [Excess Flood]
arooni has joined #ruby
minimalism has quit [Quit: minimalism]
teclator has quit [Ping timeout: 268 seconds]
binaryplease has joined #ruby
psychicist__ has joined #ruby
psychici1t__ has joined #ruby
ferr1 has quit [Quit: WeeChat 1.6]
ferr1 has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
psychicist__ has quit [Ping timeout: 260 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
A124 has joined #ruby
jameser has quit [Ping timeout: 260 seconds]
User458764 has joined #ruby
psychici1t__ has quit [Quit: Reconnecting]
psychicist__ has joined #ruby
djellemah_ has quit [Ping timeout: 240 seconds]
tildes has joined #ruby
blackmesa has joined #ruby
charliesome has joined #ruby
conta has joined #ruby
<FMan> hey
Burgestrand has joined #ruby
_sfiguser has quit [Ping timeout: 260 seconds]
tildes has quit [Ping timeout: 260 seconds]
teclator has joined #ruby
koooge has joined #ruby
<FMan> I have programmed in C, so how should I get acquainted with Ruby now?
udiudi7 has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
KicStart has joined #ruby
braincrash has quit [Ping timeout: 255 seconds]
charliesome has joined #ruby
CloCkWeRX has joined #ruby
_sfiguser has joined #ruby
hutch34 has joined #ruby
vicks has joined #ruby
<dminuoso> FMan: That depends, are you an idiot?
<dminuoso> FMan: Jokes aside, Well Grounded Rubying ist probably your best pick.
<dminuoso> *Well Grounded Rubyist
harfangk has joined #ruby
<dminuoso> It starts with a rough introduction into Ruby assuming that syntax is not your main problem.
<dminuoso> It's suited to newcomers that have previous experience.
<dminuoso> And is probably one of the two most recommended books in here.
<vicks> Hi Guys, I've got a question. I'm writing a ruby extension in C, and one of my methods sets the time on a bit of proprietary hw. Fairly simple stuff, but when I pass it Unix time, the value is doubled by the time it makes it to the C. Anyone got a clue as to why it's doing this? I'll post an example just to give an idea:
<dminuoso> vicks: Yes.
blackmesa has quit [Ping timeout: 255 seconds]
<FMan> dminuoso: thank you, I'll check that out
<vicks> what's happening?
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
<vicks> Pry dump: [11] pry(main)> time = Time.now.to_i => 1488195059 [12] pry(main)> igc.show_datetime Unix time value 1488195064 Time is currently Mon Feb 27 11:31:04 2017 => 1488195064 [13] pry(main)> igc.set_datetime(time) Unix time value 2976390119 Time is currently Sat Apr 26 00:01:59 2064 => 0 [14] pry(main)>
<dminuoso> vicks: You need to wrap and unwrap using the INT2FIX and FIX2INT macros
<vicks> aha, thanks
<dminuoso> That is because the whole thing gets bitshifted to make room for "stuff"
<dminuoso> Which is where the doubling (multiplication by two is the same thing as a leftshift)
<dminuoso> comes from
<vicks> Oh, that makes perfect sense. Thanks a lot, and thank you for the link to the docs there!
loveable_ has joined #ruby
loveable_ has quit [Client Quit]
loveablelobster has joined #ruby
<dminuoso> herwin, vicks: This seems to be out-of-date though.
djellemah has quit [Ping timeout: 240 seconds]
koooge has quit [Ping timeout: 260 seconds]
<dminuoso> Do these macros still exist in 2.4?
<dminuoso> I mean it still refers to Fixnum/Bignum classes which don't exist anymore.
koooge has joined #ruby
<herwin> there are more than enough references to INT2FIX in the source of ruby 2.4.0
<herwin> including the core code
blackwind_123 has quit [Ping timeout: 260 seconds]
<herwin> so I guess that still works
djellemah has joined #ruby
brent__ has joined #ruby
madper_phantom is now known as Madper
loveablelobster has left #ruby [#ruby]
lele has quit [Ping timeout: 255 seconds]
brent__ has quit [Ping timeout: 268 seconds]
lele has joined #ruby
<dminuoso> I feel like it should be an INT2INT and INT2INT for the back conversion!
<dminuoso> Clearlz.
binaryplease has quit [Quit: binaryplease]
jshjsh has quit [Ping timeout: 240 seconds]
emilford has joined #ruby
KicStart has quit [Quit: Leaving.]
djellemah_ has joined #ruby
djellemah_ has quit [Remote host closed the connection]
modlin has quit [Ping timeout: 240 seconds]
psychicist__ has quit [Ping timeout: 240 seconds]
djellemah_ has joined #ruby
psychicist__ has joined #ruby
aupadhye has quit [Remote host closed the connection]
emilford has quit [Ping timeout: 260 seconds]
jaruga______ has quit [Quit: jaruga______]
jaruga______ has joined #ruby
cibs has quit [Ping timeout: 240 seconds]
cibs has joined #ruby
skweek has joined #ruby
alirezabashiri has joined #ruby
blackmesa has joined #ruby
<alirezabashiri> how can I make this more robust?
<alirezabashiri> def generate_random_hex(n=1, predicate=nil)
<alirezabashiri> hex = SecureRandom.hex(n)
<alirezabashiri> while predicate.call(hex)
<alirezabashiri> hex = SecureRandom.hex(n)
<alirezabashiri> end
<alirezabashiri> return hex
<alirezabashiri> end
Xentil has joined #ruby
__Yiota has joined #ruby
jtdoncas has joined #ruby
ins64 has quit [Ping timeout: 240 seconds]
Semtex-h has joined #ruby
jtdoncas has quit [Ping timeout: 260 seconds]
<SpComb> begin hex = SecureRandom.hex(8) end until predicate.call(hex)
kylo__ has quit [Quit: Leaving]
xall has quit [Ping timeout: 268 seconds]
swills has joined #ruby
alex`` has quit [Ping timeout: 260 seconds]
saneax is now known as saneax-_-|AFK
Ishido has joined #ruby
alirezabashiri has quit [Quit: WeeChat 1.4]
ins64 has joined #ruby
xall has joined #ruby
skweek has quit [Ping timeout: 260 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bkxd has quit [Ping timeout: 240 seconds]
Disavowed has quit [Ping timeout: 240 seconds]
vadviktor has quit [Quit: No Ping reply in 180 seconds.]
reaVer_ has quit [Ping timeout: 256 seconds]
Gadgetoid has quit [Ping timeout: 240 seconds]
vadviktor has joined #ruby
reaVer has joined #ruby
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
Ishido has joined #ruby
igniting has quit [Ping timeout: 240 seconds]
Gadgetoid has joined #ruby
npepinpe has joined #ruby
fedruantine has quit [Ping timeout: 240 seconds]
Disavowed has joined #ruby
evie_hammond has joined #ruby
npepinpe has quit [Client Quit]
npepinpe has joined #ruby
fedruantine has joined #ruby
JeanCarloMachado has joined #ruby
t-recx has joined #ruby
pawnbox has quit [Remote host closed the connection]
emilford has joined #ruby
pawnbox has joined #ruby
scootaloo has joined #ruby
igniting has joined #ruby
scootaloo has quit [Client Quit]
pawnbox has quit [Ping timeout: 240 seconds]
CloCkWeRX has quit [Quit: Leaving.]
Ishido has quit [Remote host closed the connection]
ResidentBiscuit has joined #ruby
tyang has joined #ruby
polyzium_ has joined #ruby
Ishido has joined #ruby
ResidentBiscuit has quit [Ping timeout: 255 seconds]
rwb has quit [Ping timeout: 240 seconds]
blackwind_123 has joined #ruby
xall has quit [Ping timeout: 260 seconds]
polyzium has quit [Ping timeout: 240 seconds]
Pumukel has quit [Ping timeout: 240 seconds]
Qchmqs has joined #ruby
Pumukel has joined #ruby
jameser has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
esObe has quit [Remote host closed the connection]
esObe has joined #ruby
djellemah_ has quit [Ping timeout: 240 seconds]
jameser has quit [Client Quit]
JeanCarloMachado has quit [Ping timeout: 268 seconds]
xall has joined #ruby
emilford has quit [Ping timeout: 240 seconds]
jameser has joined #ruby
modlin has joined #ruby
emilford has joined #ruby
polyzium_ is now known as polyzium
polyzium has quit [Changing host]
polyzium has joined #ruby
jgnagy has joined #ruby
alex`` has joined #ruby
kristofferR has joined #ruby
chouhoulis has joined #ruby
chouhoulis has quit [Remote host closed the connection]
howdoi has quit [Quit: Connection closed for inactivity]
chouhoulis has joined #ruby
supsup has joined #ruby
pawnbox has joined #ruby
npepinpe has quit []
matthewd has quit [Ping timeout: 240 seconds]
jgnagy has quit [Ping timeout: 260 seconds]
udiudi7 has quit [Quit: Textual IRC Client: www.textualapp.com]
jameser has quit [Ping timeout: 240 seconds]
jameser has joined #ruby
blackwind_123 has quit [Ping timeout: 260 seconds]
sspreitz has quit [Ping timeout: 240 seconds]
blackwind_123 has joined #ruby
hurricanehrndz has quit [Remote host closed the connection]
cisco has joined #ruby
<supsup> anyone know how to make a function that would interpolate objects key/value pairs referencing itself? http://pastebin.com/N7mEWWK7
<ruby[bot]> supsup: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/e4bdff55941b2d759b6174ee8d24489a
<ruby[bot]> supsup: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
hurricanehrndz has joined #ruby
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
Ishido has joined #ruby
sspreitz has joined #ruby
rwb has joined #ruby
kassav_ has joined #ruby
kassav_ has quit [Client Quit]
kassav__ has joined #ruby
kassav__ is now known as kassav_
kassav_ is now known as kassav__
byte512 has joined #ruby
dlitvak has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
jaruga______ has quit [Quit: jaruga______]
matthewd has joined #ruby
cibs has quit [Ping timeout: 268 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cibs has joined #ruby
last_staff has quit [Quit: last_staff]
squ has quit [Remote host closed the connection]
Bish has quit [Ping timeout: 240 seconds]
Bish has joined #ruby
brent__ has joined #ruby
gnufied has joined #ruby
catbusters has joined #ruby
brent__ has quit [Ping timeout: 260 seconds]
malconis has joined #ruby
mim1k has joined #ruby
<herwin> supsup: why the assumption about multiple passes and ordering? it works just as well if it would replace "%{author}" with "%{authorFirst} %{authorLast}" instead of having to change author first
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jameser has joined #ruby
kies has quit [Ping timeout: 252 seconds]
cibs has quit [Ping timeout: 255 seconds]
jameser has quit [Client Quit]
cibs has joined #ruby
nowhereman has quit [Ping timeout: 260 seconds]
braincrash has joined #ruby
jameser has joined #ruby
ferr1 has quit [Quit: WeeChat 1.6]
shinnya has joined #ruby
bmurt has joined #ruby
bkxd has joined #ruby
kies has joined #ruby
jaruga______ has joined #ruby
Lord_of_Life has quit [Excess Flood]
troter__________ has quit [Ping timeout: 240 seconds]
aurelien has quit [Remote host closed the connection]
kristofferR has quit [Quit: Textual IRC Client: www.textualapp.com]
aurelien has joined #ruby
colegatron has joined #ruby
Lord_of_Life has joined #ruby
mtkd has quit [Ping timeout: 240 seconds]
kristofferR has joined #ruby
Snickers has quit [Ping timeout: 240 seconds]
mtkd has joined #ruby
unshadow has quit [Quit: leaving]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
pawnbox has quit [Ping timeout: 268 seconds]
kristofferR has quit [Quit: Textual IRC Client: www.textualapp.com]
boqplw has quit [Remote host closed the connection]
blaxter has joined #ruby
<supsup> herwin: until a value is just a pure string with zero %{values} it cannot be used
<supsup> i assume anyway
<supsup> i've written a little bit so far, working on it
h1fuelcell has joined #ruby
brent__ has joined #ruby
DLSteve_ has joined #ruby
kristofferR has joined #ruby
jgnagy has joined #ruby
griffindy has joined #ruby
ins64 has quit [Ping timeout: 268 seconds]
brent__ has quit [Ping timeout: 255 seconds]
jdm_ has joined #ruby
nowhereman has joined #ruby
ins64 has joined #ruby
jdm has quit [Ping timeout: 240 seconds]
<herwin> the implementation is a bit naive
<herwin> but it shows the progress if you just loop through all keys
<herwin> instead of worrying about the ordering
<herwin> (requires ruby 2.4, Hash#transform_values)
jrafanie has joined #ruby
ins64 has quit [Ping timeout: 264 seconds]
KicStart has joined #ruby
modlin has quit [Ping timeout: 240 seconds]
nowhereman has quit [Ping timeout: 240 seconds]
kristofferR has quit [Quit: Textual IRC Client: www.textualapp.com]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ins64 has joined #ruby
jameser has joined #ruby
DaveTaboola has joined #ruby
fuzzyhorns has joined #ruby
fuzzyhorns has quit [Read error: Connection reset by peer]
<supsup> taking a look herwin....looks a lot easier than the monster function I was trying to make
kristofferR has joined #ruby
dideler has joined #ruby
cdg has joined #ruby
rippa has joined #ruby
<supsup> hurm i get : undefined method `transform_values!' f
<supsup> is my version of ruby too old?
Guest16987 has quit [Changing host]
Guest16987 has joined #ruby
Guest16987 is now known as Nicmavr
pawnbox has joined #ruby
pawnbox has joined #ruby
JoshS has joined #ruby
braincrash has quit [Ping timeout: 252 seconds]
DarthGandalf has quit [Remote host closed the connection]
DarthGandalf has joined #ruby
<scrooloose> what does `ruby -v` say? note above herwin said you gotta have ruby 2.4
dionysus70 has joined #ruby
cschneid_ has joined #ruby
<supsup> using 2.2 locally doh
<supsup> i'll see if i can upgrade
dionysus69 has quit [Ping timeout: 240 seconds]
dionysus70 is now known as dionysus69
polishdub has joined #ruby
Silthias1 has joined #ruby
joao has joined #ruby
joao has quit [Client Quit]
Silthias has quit [Ping timeout: 255 seconds]
nitrix_ is now known as nitrix
Pumukel has quit [Remote host closed the connection]
Pumukel has joined #ruby
<supsup> does not appear to be any ruby 2.4 for windows. maybe i can copy the method as a helper
Madper is now known as Madper|AFK
maloik has quit [Remote host closed the connection]
maloik has joined #ruby
AlexRussia has quit [Ping timeout: 240 seconds]
Pumukel has quit [Ping timeout: 240 seconds]
igniting has quit [Ping timeout: 268 seconds]
<scrooloose> supsup: well, you could always do something like this --> https://gist.github.com/scrooloose/b4ac76ba453de9bf6bfa872481aabf8b
<scrooloose> that mutates the has in place though, so might want to clone first or similar
nettoweb1 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
modlin has joined #ruby
<scrooloose> s/has/hash
xall has quit [Ping timeout: 264 seconds]
Silthias1 has quit [Ping timeout: 240 seconds]
<supsup> scrooloose i don't think sub is in 2.2 either
colegatron has left #ruby ["Leaving"]
dideler has quit [Remote host closed the connection]
<Burgestrand> fun!
<Burgestrand> here's another one: https://eval.in/744096
nettoweb has joined #ruby
<supsup> i think that works Burgestrand but assumes you use the values in order. If you try to access something that has not been translated yet it fails. Investigating more
<Burgestrand> supsup it shouldn't
<Burgestrand> supsup it's recursive, the first time you look a key up it will look up all other referenced keys… and so on
chouhoul_ has joined #ruby
<supsup> hurm ok looking at the error log
elaptics has quit [Ping timeout: 260 seconds]
<supsup> will try to make an example on that site you linked...cool site
chouhoulis has quit [Ping timeout: 260 seconds]
_aeris_ has quit [Remote host closed the connection]
heckler has left #ruby ["WeeChat 1.4"]
AlexRussia has joined #ruby
<mikecmpbll> silly ruby question of the day: is there a better way to count the number of equal elements in two arrays `a` and `b` than: `a.map.with_index{ |x, i| x == b[i] }.count(&:itself)`
<mikecmpbll> equal at the same index, i should say
Silthias has joined #ruby
__Yiota has joined #ruby
<supsup> must be something with my version, i get this error: key{author} not found...i used your exact code block
<scrooloose> Burgestrand: dayumn son! Didnt know about that %{} interpolation thing. Gotta file that away
dionysus69 has quit [Ping timeout: 260 seconds]
<Burgestrand> mikecmpbll have a look at reduce
<Burgestrand> mikecmpbll same thing as what you did, but allows you to keep a value along the looping
_aeris_ has joined #ruby
<supsup> does not work with 2.2 though...i might be able to go to 2.3 tho there is a version of that for windows
<mikecmpbll> Burgestrand : so this I guess: a.each.with_index.reduce(0){ |m, (x, i)| x == b[i] ? m + 1 : m }
patarr has joined #ruby
chouhoul_ has quit [Remote host closed the connection]
chouhoulis has joined #ruby
<mikecmpbll> seems that's slightly faster on large arrays.
<mikecmpbll> ack, nvm. a.each.with_index.count{ } .. is fastest
mitt3ns has joined #ruby
ResidentBiscuit has joined #ruby
mark_66 has quit [Remote host closed the connection]
Burgestrand has quit [Quit: Closing time!]
aganov has quit [Remote host closed the connection]
modlin has quit [Quit: Konversation terminated!]
<mitt3ns> Mornin' folks
ta_ has quit [Remote host closed the connection]
agent_white has quit [Disconnected by services]
mitt3ns is now known as agent_white
antoniobeyah has joined #ruby
gregf_ has joined #ruby
Pumukel has joined #ruby
mitt3ns has joined #ruby
ResidentBiscuit has quit [Ping timeout: 240 seconds]
Qchmqs has quit [Ping timeout: 260 seconds]
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AlexRussia has quit [Ping timeout: 240 seconds]
RohitPaul has joined #ruby
<RohitPaul> join #testingalksjdlkasjd
<RohitPaul> #join testinslkdfjsldfj
AlexRussia has joined #ruby
<adaedra> try with a /
<gregf_> haha
<RohitPaul> :D
<RohitPaul> Getting used to a terminal client
<gregf_> *chuckles*
* adaedra does /join with a GUI client too
<supsup> Burgestrand, anyway to protect against mistypes?
cdg has quit [Ping timeout: 240 seconds]
cdg has joined #ruby
blackmesa has joined #ruby
RohitPaul is now known as rohitpualk
rohitpualk is now known as rohitpaul
rohitpaul is now known as rohitpaulk
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
braincrash has joined #ruby
igniting has joined #ruby
loechel has joined #ruby
sepp2k has joined #ruby
marcdel has joined #ruby
Pumukel has quit [Ping timeout: 255 seconds]
add^_ has joined #ruby
nettoweb has joined #ruby
<gregf_> supsup: the value k is nil?
existensil has quit [Quit: WeeChat 0.4.2]
tildes has joined #ruby
existensil has joined #ruby
<gregf_> oh, its interpolating :|
dionysus69 has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blackmesa has quit [Ping timeout: 268 seconds]
jtdoncas has joined #ruby
rubyfizz_ has quit [Remote host closed the connection]
tildes has quit [Ping timeout: 260 seconds]
polishdub has quit [Quit: Leaving]
tildes has joined #ruby
cevett has joined #ruby
Dimik has joined #ruby
marcdel has quit [Ping timeout: 240 seconds]
theRoUS has quit [Changing host]
theRoUS has joined #ruby
jdm_ has quit [Remote host closed the connection]
rohitpaulk has quit [Quit: leaving]
troter__________ has joined #ruby
<supsup> gregf yeah. or does not exist
shinnya has quit [Ping timeout: 268 seconds]
dgarstang has joined #ruby
kassav__ has quit [Ping timeout: 268 seconds]
<dgarstang> How do I pass an AWS profile to Aws::EC2::Client.new ?
<dgarstang> All the docs say is you can pass a profile "From an instance profile when running on EC2" ... but it doesn't say HOW
tvw has quit [Ping timeout: 255 seconds]
jameser has joined #ruby
jameser has quit [Client Quit]
eprasad has joined #ruby
<baweaver> That being said, anything beyond that is outside my knowledge range of EC2 profiles and it'd likely be faster to ask on their gitter channel: https://gitter.im/aws/aws-sdk-ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
jaruga______ has left #ruby [#ruby]
egis has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
<egis> Hello. Anyone using FreeBSD + jails? I'm having problems doing `gem install` inside jail. Getting 'Protocol not supported - socket(2) - udp' error.
milardovich has joined #ruby
<baweaver> probably just need to get a newer version of rubygems on it
tildes has quit [Ping timeout: 260 seconds]
<baweaver> I'm betting that FreeBSD defaults to an older version of Ruby, which may cause it.
brent__ has joined #ruby
<egis> baweaver, thanks!
<egis> I've built ruby with rbenv. It's v2.3.3
<egis> Is there a newer version?
* baweaver looks at topic
<baweaver> not unless it was super recent
<baweaver> odd
<baweaver> Near as I can tell it's an issue with rubygems itself
<adaedra> `which rbenv` and `which gem` both give your rbenv-provided ruby?
mim1k_ has joined #ruby
* baweaver still prefers scootaloo
<adaedra> >_>
mim1k has quit [Ping timeout: 240 seconds]
<adaedra> I remember getting ruby working under jails just fine
<adaedra> But that was some time ago
<egis> `which gem` -> /home/jailedwebsite/.rbenv/shims/gem
Semtex-h has quit []
<egis> that's the one built with rbenv
<baweaver> there's been some oddity with rubygems in the past few months on versions, hence the mention
GinoManWorks has joined #ruby
<egis> strange thing is that `gem -v` shows it's 2.5.2
<baweaver> though those were primarily SSL shenanigans.
<baweaver> rubygems version != ruby version
<adaedra> egis: that's more recent that the one I have on my computer :o
<egis> while in other jail (which is not working too, same error) that has freebsd provided ruby and ruby-gems - `gem -v` shows 2.6.8
<matthewd> `gem env` for more detail
DroidBurgundy has joined #ruby
TomyWork has quit [Ping timeout: 240 seconds]
<ruby[bot]> https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<baweaver> ?gist
<baweaver> also use gist for >= 3 lines
polyzium has quit [Quit: -a- Connection Timed Out]
<egis> matthewd, http://pastebin.com/e1QZetkF (rbenv one)
<ruby[bot]> egis: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/f5c2ee697f2f1e06215bdfb45b225da5
<ruby[bot]> egis: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
jdm has joined #ruby
<egis> thanks, bot!
polyzium has joined #ruby
DaveTaboola has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
brent__ has quit [Ping timeout: 260 seconds]
tlr has joined #ruby
User458764 has joined #ruby
brent__ has joined #ruby
amclain has joined #ruby
<matthewd> So, AIUI, jails allow you to restrict what the process can do. And it kinda sounds like it's just not allowed to open a UDP socket.
polyzium has quit [Remote host closed the connection]
<egis> matthewd, I did `nc -vzu 8.8.8.8 53`, got output 'Connection to 8.8.8.8 53 port [udp/domain] succeeded!', but I'm not entirely sure that proves anything.
<baweaver> that looks promising
<egis> baweaver, that was the first thing I've read :)
<baweaver> drat
marxarelli has joined #ruby
<matthewd> So you've tried that?
<egis> Yes
<egis> Ok, I think it's working now
<egis> Well, it was the ruby bug that baweaver linked 20 minutes ago :)
<egis> removed ipv6 entries from resolv.conf - `gem install worked`
<egis> sorry, read it just now (too many tabs opened)
<baweaver> Eh, happens
jaruga______ has joined #ruby
<baweaver> you're not really debugging until Chrome kills itself from memory consumption
<eam> sounds like ipv6 was disabled, but your resolver was attempting to use v6 addresses?
<egis> thanks baweaver!
<baweaver> np
EV3RYDAYPR0GRESS has joined #ruby
<baweaver> ipv6 is all types of fun
<egis> eam, yes. I think it's not a ruby/gems bug, but issue with server configuration. Gonna look into this.
koooge has quit [Quit: Leaving...]
aryaching has joined #ruby
tlr has quit [Quit: Textual IRC Client: www.textualapp.com]
chouhoulis has quit [Remote host closed the connection]
JeanCarloMachado has joined #ruby
DroidBurgundy has quit [Remote host closed the connection]
braincrash has quit [Ping timeout: 260 seconds]
senayar has quit []
itarato has quit [Ping timeout: 260 seconds]
AckZ has quit []
TomyLobo has joined #ruby
gusrub has joined #ruby
milardovich has quit [Remote host closed the connection]
sepp2k has quit [Quit: Leaving.]
sepp2k has joined #ruby
sneakerhax has quit [Ping timeout: 240 seconds]
catbusters has quit [Quit: Connection closed for inactivity]
yottanami has joined #ruby
DroidBurgundy has joined #ruby
itarato has joined #ruby
skolman_ has joined #ruby
<yottanami> I have this array `special_params = [:prm2, :prm2]` how can I use it as method parameter like this `my_method(prm1: params[:prm1], prm2: params[:prm2])`
<dminuoso> yottanami: First, let's make that hash.
<dminuoso> To do this, you will need this thing:
govg has joined #ruby
<dminuoso> &ri Hash.[] yottanami
jtdoncas has quit [Ping timeout: 255 seconds]
<allisio> Or this:
<allisio> &ri reduce
<yottanami> dminuoso, Do you mean I should convert my array to a hash?
antgel_ has quit [Ping timeout: 260 seconds]
<dminuoso> yottanami: Right. Either using my method, or using allisio's method.
<allisio> yottanami: If some method expects keys named `prm1` and `prm2`, you can just pass along a Hash containing values at those keys.
<allisio> *expects keyword arguments
<baweaver> special_params.map { |v| [v, params[v] }.to_h
<baweaver> ....close array
<dminuoso> baweaver: shush you spoonfeed.
* dminuoso spanks baweaver
planigan has joined #ruby
szulak_ has joined #ruby
<dminuoso> allisio: Note that Array#to_h is essentially the same as Array.[]
<dminuoso> Err, Hash.[] :)
<allisio> Sure.
<dminuoso> And I meant yottanami. :S
* baweaver chuckles
<dminuoso> baweaver.
<baweaver> Monday hits hard
<dminuoso> I need an opinion
<dminuoso> begin; code_that_throws; ensure; more_code_that_throws; end
<dminuoso> Would you want code_that_throws in the backtrace?
<dminuoso> Because honestly fuck Ruby for not calling exit() on this.
[Butch] has joined #ruby
<baweaver> I'd want whatever in that backtrace that'd help me isolate what just happened.
<dminuoso> What do you need in that case?
<dminuoso> Maybe a big fat warning in STDERR?
<baweaver> any code that caused the error, yeah
tfitts has joined #ruby
ins64 has quit [Ping timeout: 260 seconds]
elementaru has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
polishdub has joined #ruby
anotherpi has joined #ruby
<yottanami> dminuoso, I created my hash like this `x = Hash[filter_params.map{|key| [key, params[key]]}]` now how should I send it as method argument should I write my_method(**x) ?
raspado has joined #ruby
quiqua has quit [Quit: Textual IRC Client: www.textualapp.com]
quiqua has joined #ruby
ins64 has joined #ruby
<dminuoso> yottanami: You probably should use #to_h instead, looks nicer unless you use an intermediate variable.
<dminuoso> yottanami: Just one asterisk will suffice
<allisio> Or none.
mikecmpbll has quit [Ping timeout: 268 seconds]
Beams has quit [Quit: .]
xall has joined #ruby
<yottanami> dminuoso, what is the # before to_h is it name of method?
<anotherpi> #method is for instance methods
<anotherpi> when .method is for singleton methods
AncientAmateur has joined #ruby
<dminuoso> It's a convention in the Ruby community based on how ri behaves.
cajone has quit [Remote host closed the connection]
<yottanami> dminuoso, nice
<dminuoso> &ri Array#to_H
<`derpy> No results
pawnbox has quit [Remote host closed the connection]
<dminuoso> &ri Hash.[]
<dminuoso> &ri Array#to_h
pawnbox has joined #ruby
<dminuoso> You can also do this with your system ri.
mim1k_ has quit [Ping timeout: 255 seconds]
blackmesa has joined #ruby
<yottanami> dminuoso, Do you mean I should write something like this `filter_params.to_h` but how should I set the value of each key?
jtdoncas has joined #ruby
quiqua has quit [Quit: Textual IRC Client: www.textualapp.com]
<dminuoso> yottanami: Hash[arr] and arr.to_h are the same thing
<dminuoso> Personally I prefer the former for some reasons I don't want to get into, which is why I recommended it first.
rakm has joined #ruby
akkad has quit [Excess Flood]
cajone has joined #ruby
conta has quit [Ping timeout: 260 seconds]
akkad has joined #ruby
<yottanami> dminuoso, Sorry, I did not get your recommendation. could you mention it plz?
szulak_ has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
<dminuoso> 18:44 < dminuoso> Personally I prefer the former
<yottanami> dminuoso, former?
<dminuoso> "the former, the latter"
<allisio> &ri Hash#former
<`derpy> No results
tomphp has joined #ruby
<dminuoso> >> class Hash; def former; !latter; end; def latter; !former; end; { a: 1 }.former
<ruby[bot]> dminuoso: # => /tmp/execpad-c31cccda5df6/source-c31cccda5df6:7: syntax error, unexpected end-of-input, expecting ke ...check link for more (https://eval.in/744118)
<dminuoso> Liar.
<dminuoso> >> class Hash; def former; !latter; end; def latter; !former; end; end; { a: 1 }.former
<ruby[bot]> dminuoso: # => stack level too deep (SystemStackError) ...check link for more (https://eval.in/744119)
mtkd has quit [Ping timeout: 260 seconds]
<dminuoso> ruby[bot]: You sir are not turing complete, clearly.
blaxter has quit [Quit: foo]
<dminuoso> apeiros: Stop being cheap and give ruby[bot] infinite memory already.
akkad has quit [Excess Flood]
xen0fon has joined #ruby
jtdoncas has quit [Ping timeout: 255 seconds]
tildes has joined #ruby
mtkd has joined #ruby
tristanp has quit []
polishdub has quit [Quit: Leaving]
akkad has joined #ruby
mikecmpbll has joined #ruby
xen0fon has quit [Client Quit]
Rodya_ has joined #ruby
aufi has quit [Quit: Leaving]
last_staff has joined #ruby
tildes has quit [Ping timeout: 240 seconds]
bastilian has quit []
tildes has joined #ruby
polishdub has joined #ruby
gusrub has quit [Remote host closed the connection]
gusrub has joined #ruby
eprasad has quit [Ping timeout: 240 seconds]
Cohedrin has joined #ruby
itarato has quit [Quit: WeeChat 1.4]
dionysus69 has quit [Ping timeout: 240 seconds]
bastilian has joined #ruby
patarr has quit [Ping timeout: 260 seconds]
babblebre has joined #ruby
mim1k has joined #ruby
loechel has quit [Ping timeout: 240 seconds]
braincrash has joined #ruby
gusrub has quit [Ping timeout: 260 seconds]
pilne has joined #ruby
agent_white has quit [Quit: brb]
patarr has joined #ruby
szulak_ has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
blackmesa has joined #ruby
duderonomy has quit [Ping timeout: 240 seconds]
renchan has quit [Quit: Leaving...]
mim1k has quit [Ping timeout: 260 seconds]
chouhoulis has joined #ruby
djbkd has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
montanonic has joined #ruby
dionysus69 has joined #ruby
patarr has quit [Ping timeout: 260 seconds]
gusrub has joined #ruby
szulak_ has quit [Ping timeout: 255 seconds]
whathappens has joined #ruby
whathappens is now known as Guest80035
User458764 has joined #ruby
dopamean_ has joined #ruby
agent_white has joined #ruby
kristofferR has quit [Read error: Connection reset by peer]
hahuang65 has quit [Quit: WeeChat 1.7]
Rodya_ has quit [Remote host closed the connection]
AncientAmateur has quit []
milardovich has joined #ruby
patarr has joined #ruby
scottschecter has joined #ruby
Rodya_ has joined #ruby
dviola has joined #ruby
mim1k has joined #ruby
DroidBurgundy has quit []
AlexRussia has quit [Quit: WeeChat 1.7]
kristofferR has joined #ruby
hahuang65 has joined #ruby
cdg has quit [Ping timeout: 260 seconds]
erhu has joined #ruby
erhu has quit [Killed (Sigyn (Spam is off topic on freenode.))]
yottanami has quit [Quit: Leaving]
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
AlexRussia has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
patarr has joined #ruby
renchan has joined #ruby
Xentil has quit [Ping timeout: 240 seconds]
elifoster has joined #ruby
duderonomy has joined #ruby
Xentil has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
tildes_ has joined #ruby
tildes has quit [Ping timeout: 240 seconds]
mim1k has joined #ruby
montanonic has quit [Ping timeout: 260 seconds]
milardovich has quit [Remote host closed the connection]
SeepingN has joined #ruby
[Butch] has quit [Quit: I'm out . . .]
tildes_ has quit [Ping timeout: 260 seconds]
xen0fon has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
nofxx has joined #ruby
milardovich has joined #ruby
Volsus has joined #ruby
admin1 is now known as roger_rabbit
elementaru has quit [Ping timeout: 258 seconds]
roger_rabbit has quit [Changing host]
roger_rabbit has joined #ruby
Volsus has quit [Client Quit]
Volsus has joined #ruby
chouhoulis has quit [Remote host closed the connection]
milardovich has quit [Remote host closed the connection]
lsousa has joined #ruby
milardovich has joined #ruby
alex`` has quit [Quit: WeeChat 1.6]
montanonic has joined #ruby
Volsus has quit [Remote host closed the connection]
chouhoulis has joined #ruby
Volsus has joined #ruby
case_ has joined #ruby
Snickers has joined #ruby
braincrash has quit [Ping timeout: 240 seconds]
egis has quit [Quit: Leaving]
planigan has quit [Remote host closed the connection]
Volsus has quit [Ping timeout: 252 seconds]
tomphp has joined #ruby
ta_ has joined #ruby
Someone_Else has joined #ruby
d10n-work has joined #ruby
thoolihan_ is now known as thoolihan
blackmesa has quit [Ping timeout: 240 seconds]
sonOfRa has quit [Quit: Bye!]
Guest86071 has joined #ruby
mim1k has joined #ruby
sonOfRa has joined #ruby
_sfiguser has quit [Ping timeout: 255 seconds]
Irishluck83 has joined #ruby
<Someone_Else> According to Ruby I made two syntax errors, but I can't exactly spot them. http://pastebin.com/tdJZWDbX
<ruby[bot]> Someone_Else: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/4de40b3ad4c4d2f96f644b915fb9c93f
<ruby[bot]> Someone_Else: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
centrx has joined #ruby
Xiti has joined #ruby
planigan has joined #ruby
* Someone_Else finds it frustrating that GitHub gists have no option to make them expire...
* SeepingN shrugs. PB is fast here
workmad3 has quit [Ping timeout: 240 seconds]
<allisio> Someone_Else: You need an `end` after Line 160.
samdvr has joined #ruby
<Zarthus> yeah, gist is unfortunately rather neglected
<baweaver> also mixing tabs and spaces which'll make it a pain to read later.
gusrub has quit [Remote host closed the connection]
mim1k has quit [Ping timeout: 255 seconds]
skolman_ has quit [Remote host closed the connection]
JeanCarloMachado has quit [Ping timeout: 268 seconds]
skolman_ has joined #ruby
gusrub has joined #ruby
doublemalt_ has joined #ruby
bocaneri has quit [Read error: Connection reset by peer]
mikecmpbll has quit [Quit: inabit. zz.]
DoubleMalt has quit [Ping timeout: 240 seconds]
sysvalve has quit [Quit: Leaving]
skolman_ has quit [Ping timeout: 260 seconds]
_sfiguser has joined #ruby
patarr has quit [Ping timeout: 260 seconds]
Rodya_ has quit [Remote host closed the connection]
tau has joined #ruby
[Butch] has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
samdvr has quit [Quit: samdvr]
electrostat has quit [Quit: uwotm8]
<manveru> the way to expire a gist is to only make it private and delete it afterward... everything you put on pastebins gets archived somewhere
electrostat has joined #ruby
<A124> Hey. Is there any memory efficient hash compatible thing for ruby?
<centrx> define "memory efficient hash compatible thing"
Voker57 has quit [Remote host closed the connection]
<A124> Records that support at least un-nested objects that can have multiple key-value pairs.
<A124> That does not eat tons of memory and one is able to lookup and get that record. Database kind of thing sort of, but easy to use and in memory.
<A124> I might have missed something in my code but recently memory doubled and starting to have problems, you know.
Someone_Else has left #ruby ["Textual IRC Client: www.textualapp.com"]
dionysus69 has quit [Remote host closed the connection]
bonhoeffer has joined #ruby
<bonhoeffer> is there a lightweight ruby app that can upload a file over https?
<bonhoeffer> just a site with a simple upload form?
last_staff has quit [Ping timeout: 260 seconds]
Bish has quit [Ping timeout: 240 seconds]
<bonhoeffer> i was looking at webftp
Guest80035 has quit [Remote host closed the connection]
whathappens has joined #ruby
whathappens is now known as Guest11548
<nofxx> A124, use redis
<nofxx> bonhoeffer, use sinatra or padrino and carrierwave
<bonhoeffer> yeah -- i was going to use sinatra + carrierwave
<bonhoeffer> know if that is already bundled with an upload form?
<A124> nofxx But that would require me to serialize and deserialize, no? Or is there any Lua or similar for lookups on parts of the data?
teclator has quit [Remote host closed the connection]
<nofxx> A124, you mean you need a key val with full text search?
<nofxx> try mongo, riak or maybe rethinkdb
pwnd_nsfw` has joined #ruby
kristofferR has quit [Ping timeout: 260 seconds]
<nofxx> bonhoeffer, it's pretty easy you'll see.. just regular form and carriewave does it all
<bonhoeffer> got it --
Guest11548 has quit [Ping timeout: 260 seconds]
Irishluck83 has quit [Quit: WeeChat 1.4]
dionysus69 has joined #ruby
tomphp has joined #ruby
kristofferR has joined #ruby
pwnd_nsfw has quit [Ping timeout: 268 seconds]
last_staff has joined #ruby
gloscombe_ has joined #ruby
jtdoncas has joined #ruby
bonhoeffer has quit [Quit: Page closed]
ruby663 has joined #ruby
<ruby663> Hello Guys
<ruby663> I need a bit help
<ruby663> it "should set winner to zero" do winner = 0 @game.clearwinner @game.winner.should eql 0 end
<ruby663> what kind of Method should I write here?
<ruby663> I tried with : def clearwinner
<ruby663> winner == 0
<ruby663> end
tau has quit [Remote host closed the connection]
<allisio> ruby663: Frankly, there's probably no good reason for that method to exist.
braincrash has joined #ruby
hahuang65 has quit [Quit: WeeChat 1.7]
gusrub has quit [Remote host closed the connection]
t-recx has quit [Read error: Connection reset by peer]
<ruby663> I just want to make the test in rspec, the test is already written
<ruby663> and I want to pass it with writing the methods
tau has joined #ruby
<ruby663> I wrote: def clearwinner
<ruby663> winner = 0 end
<ruby663> but this is not the whole solution
<ruby663> any ideas?
t-recx has joined #ruby
<havenwood> ruby663: Separate words in barewords with spaces, like `clear_winner` -- snake_case.
jtdoncas has quit [Ping timeout: 268 seconds]
<havenwood> ruby663: Are you wanting to set `winner` to `0`?
<ruby663> yes
supsup has quit [Quit: Page closed]
<ruby663> I want to set winner to 0
<havenwood> ruby663: Set the local variable winner? Or do you have a #winner= method?
<ruby663> but with " winner = 0" said we are waiting 0 and we got nil
<allisio> ruby663: You missed your learning material's treatise on instance variables.
<havenwood> ruby663: Is `winner` a local variable? Or is #winner= a method?
<havenwood> ruby663: `@winner =` is not the same as `winner =`
<ruby663> it is instance variable inside of method
tau has left #ruby [#ruby]
<ruby663> there is no point to make it @ variable because I will call the result via the name of the method
<havenwood> ruby663: `winner =` sets a local variable. You can't access your local variable outside the method in which its defined.
<havenwood> it's*
<ruby663> Ok thanks it works now
<allisio> What worked?
<ruby663> I am new in rspec and I do not know it I just started
<ruby663> thanks a lot
<ruby663> yeah with @ it works
<havenwood> ruby663: Happy coding!
<ruby663> 10x
<allisio> Instance variables aren't RSpec-specific. You really ought to go back and ensure you've absorbed the material, or you're just going to wind up further and further into the weeds.
skolman_ has joined #ruby
montanonic has quit [Ping timeout: 252 seconds]
<A124> nofxx Well I meant column like search.
jaruga______ has quit [Quit: jaruga______]
tildes has joined #ruby
ins64 has quit [Ping timeout: 240 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
tau has joined #ruby
<ruby663> If I have this rspec code:
<ruby663> it "should valiate secret contains four accepted uppercase characters" do @game.secret = "XXXX" secret = "RRRR" valid1 = @game.checksecret(secret) valid2 = check_valid(secret) valid1.should == valid2 && @game.secret.should == secret && valid1.should == 0 end
<ruby663> what kind of method should I write?
xall has quit [Ping timeout: 268 seconds]
al2o3-cr has joined #ruby
blackmes1 has joined #ruby
ins64 has joined #ruby
cpruitt has joined #ruby
montanonic has joined #ruby
<cpruitt> I’m working in a gem that is similar to the rails asset pipeline (uses sprockets but not via rack request). If I bundle binstub my gem in a test gemfile, and try to run the executable, I get “`block in replace_bin_path': can't find executable cyder (Gem::Exception)” but only every other time I try bin/cyder (e.g works / error / works / error / works / error).
jaruga______ has joined #ruby
<cpruitt> I’ve also narrowed it down to only happening when I include uglify as a dependency in my gemspec.
<cpruitt> Anyone have any advice on how to troubleshoot? I’m a little stuck.
<cpruitt> (Happy to provide more info but not sure what’s relevant)
Disavowed has left #ruby [#ruby]
voker57_ has joined #ruby
jaruga______ has quit [Remote host closed the connection]
enterprisey has joined #ruby
jaruga______ has joined #ruby
patarr has joined #ruby
<A124> How does one ruby to return unused memory back to system?
mim1k has joined #ruby
<SeepingN> exit
<SeepingN> like that ;)
<Papierkorb> A124: the garbage collector will do it when it feels like doing so
<allisio> You can say `GC.start` if you really want to force a collection.
jaruga______ has quit [Quit: jaruga______]
<A124> Thanks. Then I got a leak.
ddffg has joined #ruby
Rodya_ has joined #ruby
yusrideb has joined #ruby
<ruby663> it "should valiate secret contains four accepted uppercase characters" do @game.secret = "XXXX" secret = "RRRR" valid1 = @game.checksecret(secret) valid2 = check_valid(secret) valid1.should == valid2 && @game.secret.should == secret && valid1.should == 0 end
babblebre has quit [Quit: Connection closed for inactivity]
futilegames has joined #ruby
<ruby663> this is my answer
<ruby663> def secret @secret = "XXXX" secret = "RRRR" valid1 = @checksecret(secret) valid2 = @check_valid(secret) valid1 == valid2 && @secret == secret && valid1 == 0 end
bkxd has quit [Ping timeout: 240 seconds]
<ruby663> of the test
<ruby663> why it does not work
Rodya_ has quit [Remote host closed the connection]
whathappens has joined #ruby
<havenwood> ruby663: Please paste more than three lines of code to a Gist: https://gist.github.com
whathappens is now known as Guest5943
elifoster has quit [Quit: class]
futilegames has quit [Ping timeout: 240 seconds]
izaac_ has quit [Ping timeout: 276 seconds]
michaeltsmith has joined #ruby
<ruby663> ok
<ruby663> 1 moment
Guest5943 has quit [Ping timeout: 240 seconds]
tildes has quit [Ping timeout: 255 seconds]
ins642 has joined #ruby
tau has quit [Remote host closed the connection]
izaac_ has joined #ruby
milardovich has quit [Remote host closed the connection]
ins64 has quit [Ping timeout: 240 seconds]
izaac_ has quit [Read error: Connection reset by peer]
Volsus has joined #ruby
marxarelli is now known as marxarelli|afk
Suslov has joined #ruby
Guest72384 is now known as ruurd
milardovich has joined #ruby
djbkd has quit [Remote host closed the connection]
milardovich has quit [Remote host closed the connection]
jaruga______ has joined #ruby
djbkd has joined #ruby
montanonic has quit [Ping timeout: 252 seconds]
elifoster has joined #ruby
Volsus_ has joined #ruby
<dminuoso> ruby663: Fix your indention.
<dminuoso> It's horrible.
zotherstupidguy has joined #ruby
jaequery has joined #ruby
Volsus__ has joined #ruby
zotherstupidguy has quit [Client Quit]
<dminuoso> And boy.
Volsus has quit [Ping timeout: 240 seconds]
<ruby663> what do u mean I do not understand?
tau has joined #ruby
montanonic has joined #ruby
<ruby663> indention?
mtkd has quit [Ping timeout: 240 seconds]
ins642 has quit [Ping timeout: 268 seconds]
<dminuoso> ruby663: you overuse your tab way too hard.
Suslov has quit [Ping timeout: 240 seconds]
<dminuoso> ruby663: Do you want an honest opinion?
izaac_ has joined #ruby
<apeiros> that's usually when you should say "no" :-p
<ruby663> yes
djbkd has quit [Ping timeout: 255 seconds]
<dminuoso> ruby663: Keep your fingers from rspec until you have a rudimentary Ruby understanding. While I admire your desire to start with testing this early, and I ask you to keep this attitude up, I think you would be better suited doing your first steps.
Rodya_ has joined #ruby
marxarelli|afk is now known as marxarelli
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
<ruby663> Ok but I have assignment.... man and it is not my choice.. it is mandatory to do this in University
<ruby663> this system is shit.. I know we pass very fast to the material
<ruby663> and we do not have time to learn very good the things...
<ruby663> I started 1 month ago studying RUby...
Volsus_ has quit [Ping timeout: 240 seconds]
<dminuoso> ruby663: Let me guess, the course is test-driven development?
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<ruby663> no it is Ruby...
jtdoncas has joined #ruby
<dminuoso> ruby663: Have you done any kind of unit testing in other languages beore?
<ruby663> we did 1 web site with sinatra and now we have to make one game and also test for it
<ruby663> No I have not
ins64 has joined #ruby
<ruby663> I did Advanced in JS but... did not try to do many tests...
tildes has joined #ruby
<ruby663> the test is done here...
<ruby663> I need to pass it with method
<ruby663> can u help me to get the logic of this things
<dminuoso> Is this some ancient rspec syntax that I dont know about?
<dminuoso> ruby663: When is your assignment due?
<apeiros> dminuoso: I passionately dislike rspec, so I'm the wrong person to ask that :)
<dminuoso> I now passionately dislike you.
<apeiros> one reason I dislike is precisely it's syntax changes
<dminuoso> RSpec is like Cuba Libre.
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
<dminuoso> Heh
<apeiros> hey, don't insult my cuba libre!
<ruby663> 10 days but I have to do a lot of stuff to integrate the game to create other code in it.... for ex: this code the test is given from the lecturer
<dminuoso> apeiros: That was the highest praise in my book.
<ruby663> we do have something to help us but not everything
<dminuoso> ruby663: Shoot your lecturer for giving you what seems like grossly outdated and horrible rspec code.
jaruga______ has left #ruby [#ruby]
<dminuoso> And then congratulate him for making you do TDD.
<havenwood> Minitest \o/
<dminuoso> Then shoot him again for not explaining how this works.
<dminuoso> ruby663: But fear not, I can help you.
<dminuoso> Let me show you
<dminuoso> havenwood: help ruby663 please.
<dminuoso> bye
<ruby663> Ok I am waiting for help
<dminuoso> Heh.
<havenwood> ruby663: Want to use Minitest or is RSpec a requirement? ;-)
ins64 has quit [Read error: Connection reset by peer]
<ruby663> it is given from the lecturer
<ruby663> ok
<ruby663> I cannot change it
<dminuoso> ruby663: Please gist the full rspec, and your full code.
<dminuoso> ruby663: Use separate files but using the same gist.
<ruby663> I will give all the code
tildes has quit [Ping timeout: 240 seconds]
<ruby663> ok
<dminuoso> And also put file extensions into the filenames
<ruby663> 1 sec
<dminuoso> to enable syntax highlighting
<dminuoso> ?gist
<ruby[bot]> https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
cdg has joined #ruby
mtkd has joined #ruby
<ruby663> is that OK?
<havenwood> ruby663: You have to do the extension for each part of the gist.
<ruby663> what is that extension wait I will try to find it
<ruby663> havenwood: what do u mean by extension?
<havenwood> ruby663: .rb
<ruby663> aaaaaaaaaaaaaaaa ok u want to files with the formats ok
<ruby663> but then this will be not gist.. OK
tolerablyjake has joined #ruby
tolerablyjake has quit [Client Quit]
tolerablyjake has joined #ruby
tildes_ has joined #ruby
tildes_ has quit [Excess Flood]
<ruby663> hope this look better?
nettoweb1 has joined #ruby
<dminuoso> ruby663: Also know that you can update gists without deleting them.
<dminuoso> Saves yourself time and other headaches
<ruby663> Ok, thank u for the information, I have not used gist a lot.
<havenwood> ruby663: Rubyists use two-space, soft tabs instead of hard tabs.
<havenwood> ?tabs ruby663
<ruby[bot]> ruby663: Ruby community standards recommend using 2 spaces as indentation (see https://github.com/bbatsov/ruby-style-guide#spaces-indentation and https://ukupat.github.io/tabs-or-spaces/).
<dminuoso> That being said, since your professor seems to be a big fan of the tab key, you should probably stick to it.
ins64 has joined #ruby
<havenwood> ruby663: `attr_accessor` is like `attr_reader` and `attr_writer` combined: https://gist.github.com/Hard-system/469a880675a0e2a5a44edd1f75f392d6#file-genmethods-rb-L10-L11
<havenwood> ruby663: Use snake_case for method names, separating words with an underscore, like `get_guess` here: https://gist.github.com/Hard-system/469a880675a0e2a5a44edd1f75f392d6#file-genmethods-rb-L18
<havenwood> this line is setting a local variable that goes "poof" as soon as the method ends: https://gist.github.com/Hard-system/469a880675a0e2a5a44edd1f75f392d6#file-genmethods-rb-L49
djbkd has joined #ruby
nettoweb has quit [Ping timeout: 240 seconds]
<ruby663> how to fix it?
<ruby663> def setturnsleft(goes) @turnsleft = 12 goes = @turnsleft end
<ruby663> this
<havenwood> ruby663: No underscores in CamelCase.
JohnnyR030T has joined #ruby
<havenwood> ruby663: What does that last line do?
<ruby663> it pass the test
<havenwood> ruby663: goes = @turnsleft
<havenwood> ruby663: ^ that line
dionysus69 has quit [Ping timeout: 255 seconds]
nettoweb1 has quit [Ping timeout: 252 seconds]
ins64 has quit [Read error: Connection reset by peer]
<havenwood> ruby663: Where is the `goes` local variable subsequently used?
<ruby663> I tried other ways and only this way pass the test and I left it like this
<ruby663> about goes
<ruby663> see the Rspec test
<havenwood> ruby663: Try removing the line.
<ruby663> ok
<ruby663> goes = @turnsleft
<ruby663> this line?
<havenwood> yes
<ruby663> to run the code without it?
<ruby663> ok
nettoweb has joined #ruby
rgs_ is now known as rgs
<havenwood> ruby663: Assigning a local variable on the last line of a method is a code smell. You're not using that local variable. No reason to assign your return value to a local variable.
<ruby663> yeah it works good
<ruby663> should I remove this line too : turn = @turn
<ruby663> ?
<havenwood> yes
<ruby663> Yeah it works
<ruby663> Sorry man, maybe I look very stupid but I started just 3 hours ago to try to understand
<ruby663> how this code works..
<ruby663> and the lecturer is not really good and the code sometimes confuse me...
<ruby663> What do u think about the last one DEF which does not work
<baweaver> http://collabedit.com/ - that may help havenwood
tildes has joined #ruby
ins64 has joined #ruby
<havenwood> baweaver: haven't used that one - i'll take a look
* havenwood is distracted by a reuben sammich
mim1k has quit [Ping timeout: 260 seconds]
tyang has quit [Ping timeout: 268 seconds]
last_staff has quit [Quit: last_staff]
<ruby663> havenwood: I put attr_accessor as u said for attr_reader :table, :input, :output, :turn, :turnsleft, :winner, :secret, :score, :resulta, :resultb, :guess attr_writer :table, :input, :output, :turn, :turnsleft, :winner, :secret, :score, :resulta, :resultb, :guess
<ruby663> and it works perfect
tildes has quit [Ping timeout: 240 seconds]
mim1k has joined #ruby
Snickers has quit [Quit: Snickers]
<dminuoso> "[...] and what is a class invariant now?"
ins64 has quit [Read error: Connection reset by peer]
shinnya has joined #ruby
tildes has joined #ruby
tolerablyjake has quit [Read error: Connection reset by peer]
<ruby663> dminuoso: is that question for me?
<dminuoso> Oh no. It has absolutely nothing to do with you, of course. :-)
<ruby663> ok :)
<anotherpi> do someone have arguments for implicit returns?
blackmes1 has quit [Ping timeout: 240 seconds]
<dminuoso> anotherpi: Yes.
<ruby663> please can you help me with the last method I want to understand how is correct, in order to do the other becuase they are similar
<dminuoso> anotherpi: nil.
[Butch] has quit [Quit: I'm out . . .]
<dminuoso> anotherpi: Ruby programmers are lazy fucks, that's why.
<anotherpi> my brain is lazy (implicit is more brain expensive), not my fingers
<dminuoso> anotherpi: In the end it does not really matter as long as your code base remains consistent. However contributors might be pissed off somewhat because implicit returns have become the standard way to do it.
<ruby663> havenwood: I do not want to push you, but did u see the last method that I was asking for help?
rwb has quit [Ping timeout: 260 seconds]
<anotherpi> dminuoso: that's why i wanna be conviced :(
whathappens has joined #ruby
<dminuoso> anotherpi: I have started refactoring a while ago to have explicit returns *everywhere* in my production cde.
whathappens is now known as Guest93277
<dminuoso> Well, except inside blocks of course. :-)
tildes has quit [Ping timeout: 240 seconds]
<anotherpi> LOL
<anotherpi> damn me
ins64 has joined #ruby
<anotherpi> *`return` is an ruby def internal DSL*, but not for blocks
<havenwood> anotherpi: Implicit returns are the norm.
<anotherpi> yep, i know, but i'm not so conviced yet
TomyLobo has quit [Ping timeout: 255 seconds]
<anotherpi> and i want to follow the community guidelines
<ruby663> dminuoso: please help me with this method it will take u 1 min https://gist.github.com/Hard-system/469a880675a0e2a5a44edd1f75f392d6#file-genmethods-rb-L10-L11 line 57 on the first file
ins64 has quit [Read error: Connection reset by peer]
<havenwood> ruby663: Is that the wrong link?
cisco has quit [Quit: Leaving.]
<ruby663> no this is the right one
bkxd has joined #ruby
<ruby663> the problem is on 57 line on the first file
<havenwood> ruby663: Oh, that link is to specific lines.
tildes has joined #ruby
<ruby663> YES
renchan has quit [Remote host closed the connection]
<anotherpi> syntax error? lol
<ruby663> this code is related to the code from 89 line on the last file the 3
workmad3 has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
<anotherpi> about implicit returns, how do you know if the returned value is wanted by the programmer without documentation?
<dminuoso> anotherpi: Oh oh I know. Static typing will ensure at compile time that you don't put the wrong thing back.
babblebre has joined #ruby
tildes has quit [Ping timeout: 260 seconds]
ins64 has joined #ruby
<anotherpi> dminuoso: huh?
hahuang65 has joined #ruby
<anotherpi> it's about understanding not about computers problems :P
<anotherpi> code understanding*
<dminuoso> anotherpi: I was just making fun of ruby again.
<dminuoso> anotherpi: People will argue: write unit tests to be sure.
<dminuoso> I argue: static typing would catch 80% of those bugs already.
* baweaver continues eating popcorn
<dminuoso> People then argue: but duck typing
<dminuoso> I argue: multiple inheritance does the same thing
<dminuoso> And after a while baweaver is out of popcorn.
<dminuoso> It's a hard life.
<anotherpi> running gag?
<allisio> It's limping these days.
<ruby663> havenwood: did u think u can help with that method?
<baweaver> Tell me when you're done painting that bike shed
workmad3 has quit [Ping timeout: 240 seconds]
<dminuoso> baweaver: It will be perfect though.
<baweaver> better be red
<dminuoso> But while Im bike shedding I got lost figuring out the best color patterns for the wall..
tildes has joined #ruby
<dminuoso> baweaver: Jokes aside, Crystal would be awesome. :)
mim1k has joined #ruby
<anotherpi> you heared about the Ruby code consistence checker comming with Ruby 3 of course?
<dminuoso> But as long as its officially still in Alpha I won't have it in production.
<baweaver> ruby663: give you a hint, comments start with #
pifon has quit [Quit: Connection closed for inactivity]
nobody72 has joined #ruby
<dminuoso> anotherpi: you mean the "rint" kind of thing?
nobody72 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
* anotherpi google translate rint and then come back
t-recx has quit [Quit: t-recx]
<anotherpi> oh lol, ok
<ruby663> baweaver: I know but I think for gist does not matter with # or without #
<dminuoso> :|
<anotherpi> yes kinda :p
<baweaver> have fun with that then
<dminuoso> anotherpi: Though the fact that I made you google made this wordplay worth it.
jamesaxl has quit [Quit: Leaving]
<ruby663> beweaver: I put the comment for the gist I do not use it in my editor, if u cannot help me with the method please...
tildes has quit [Ping timeout: 260 seconds]
hahuang65 has quit [Quit: WeeChat 1.7]
<baweaver> read the errors you get
lsousa has quit [Quit: lsousa]
<baweaver> most of the issue is that the methods don't exist, you need to write theml
<anotherpi> ruby663: may we can help about Ruby, but not about a full program
<ruby663> anotherpi: see line 57
<anotherpi> ruby663: with all its context :p
ngpestelos has joined #ruby
tildes has joined #ruby
<baweaver> still at work so don't really have time to debug a full program
<baweaver> run the code
<baweaver> but seriously, read the errors
<baweaver> the methods are not defined
<baweaver> attr_* doesn't fix that
<ruby663> baweaver: I need only help for the method that does not work... nothing else
<baweaver> no
<baweaver> you need a lot more than that
<baweaver> you just don't realize it yet.
<allisio> And likely won't.
<baweaver> run the code
<baweaver> look at the errors
<baweaver> they will tell you exactly what's wrong in that area.
<ruby663> yeah I saw be I cannot fix it u know what I mean? I started RUby coding 1 month ago...
<ruby663> I cannot get it so fast
<ruby663> if u can do that method to pass the test
<baweaver> What's the error?
<ruby663> that is everything I want
<ruby663> it just does not pass the rspec test
<ruby663> I have to create def.... end
<allisio> What an unpleasant individual.
<baweaver> you can say that until you're blue in the face and I'll repeat the same thing
<anotherpi> it's look like homework, so may use the documentation (ri is nice) and read the error
<baweaver> you need to tell us what the actual error is
Guest86071 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<baweaver> the test not passing is a symptom, not the error itself
<anotherpi> if you have questions about Ruby itself, may we can help
<ruby663> ok
<baweaver> >> does_not_exist(nil)
<ruby[bot]> baweaver: # => undefined method `does_not_exist' for main:Object (NoMethodError) ...check link for more (https://eval.in/744230)
<baweaver> _that_ is an error
tildes has quit [Ping timeout: 240 seconds]
<baweaver> and that's what you'd likely see when you run the code
ap4y has joined #ruby
<ruby663> baweaver: I wrote the error in comment in the very above: https://gist.github.com/Hard-system/469a880675a0e2a5a44edd1f75f392d6#file-genmethods-rb-L10-L11
tildes has joined #ruby
blackwind_123 has quit [Ping timeout: 268 seconds]
<baweaver> what does it say
<baweaver> I can read it by the way, but I want you to tell me what exactly it says
<ruby663> there is arrow to valid1
<ruby663> that is the first error
jdm has quit [Remote host closed the connection]
<ruby663> maybe something is wrong there
Rodya_ has quit [Remote host closed the connection]
<ruby663> but I do not know what
<baweaver> what is @checksecret?
blackwind_123 has joined #ruby
<baweaver> and why would it be mad about the parens there?
kobain has joined #ruby
hahuang65 has joined #ruby
<baweaver> the arrow is not the error
<baweaver> the bit about line 66 and ) is
skolman_ has quit [Remote host closed the connection]
emilford has quit [Ping timeout: 268 seconds]
tildes has quit [Ping timeout: 240 seconds]
skolman_ has joined #ruby
<baweaver> where is @checksecret defined, what is it, and why is calling it like a method going to break?
* anotherpi can't read 8 spaces width code
<ruby663> baweaver: I do not know man, I just try somehow to fix it and then to see the logic
<baweaver> ?ts=2
Xentil has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<baweaver> ruby663: you're going to have to figure it out
<ruby663> if I fix it then I will understand the other one how works..
<baweaver> we're not going to give you the answer, we're going to get you to figure it out
ngpestelos has quit [Ping timeout: 260 seconds]
Rodya_ has joined #ruby
<ruby663> Ok then give me some hint
<baweaver> I did
<baweaver> multiple hints
<ruby663> ?ts = 2?
<baweaver> no
<baweaver> where is @checksecret defined, what is it, and why is calling it like a method going to break?
<baweaver> that was for anotherpi to fix 8 space tabs in gist
<ruby663> maybe @checksecret = secret?
<ruby663> and not in brackets
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
<ruby663> ?
<baweaver> parenthesis, not brackets
<ruby663> aha ok
<ruby663> but I am right
<baweaver> no
<baweaver> valid1 = @checksecret(secret)
<baweaver> What is wrong with that line
skolman_ has quit [Ping timeout: 260 seconds]
<SeepingN> I see no checksecret()
<SeepingN> nor @checksecret()
<SeepingN> yall makin' stuff up!
<allisio> `@checksecret()` can't be a thing.
<baweaver> that as well
<baweaver> not to mention that @secret and secret will never be equal
<anotherpi> ruby663: you are calling `@checksecret` like it was a method, but it's not
<SeepingN> I don't even know wtf this is: valid1 == valid2 && @secret == secret && valid1 == 0
<ruby663> so I have to create method checksecret?
<SeepingN> well...why wouldn[t you?
<anotherpi> this name seems to be a method, not an object
<ruby663> SeepingN: I am seeing my rspect test given from my lecturer and I am trying do make to pass the test.. man
<SeepingN> is that perhaps coming from other code?
<ruby663> see the last file it is rspec test
ins64 has quit [Quit: See ya]
<ruby663> line 89
enterprisey has quit [Remote host closed the connection]
<anotherpi> oh, i now understand why you wrote that code in you secret method…
<anotherpi> the specs show you how it should works, not how to implement it
<SeepingN> "@secret == secret" always false every time as it is written
cschneid_ has quit [Remote host closed the connection]
<anotherpi> ruby663: when you have to finish this exercice?
<ruby663> I do not undestand the code very well, guys hope u understand me, I am new in RUby and I have project to finish very soon at University
psychicist__ has quit [Read error: Connection reset by peer]
cschneid_ has joined #ruby
<ruby663> As soon as possible because after that I have to make the game to work properly it is MasterMind with colors
<ruby663> after that I have to integrate it in the browser via Sinatra....
<ruby663> I have 10 days and I do not know what I am doing...
existensil has quit [Quit: WeeChat 0.4.2]
<ruby663> that is why I am in a hurry
<allisio> We appreciate your honesty.
<ruby663> hope there is someone here who can help me a little bit with these methods
<ruby663> allisio: is that sarcasm :D
<allisio> No?
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ruby663> then will someone help me? or I just have to struggle alone?
<havenwood> ruby663: Have you made all the suggested changes so far and updated the gist?
montanonic has quit [Ping timeout: 240 seconds]
<havenwood> ruby663: Do that first.
<ruby663> ok
<ruby663> 1 moment
ishahnaz has joined #ruby
cschneid_ has quit [Ping timeout: 260 seconds]
<anotherpi> ruby663: read the test and implements undefined methods, you can start with empty methods
<anotherpi> for example, you have not defined Game#checksecret
<anotherpi> Game#checksecret means the checksecret instance method of the Game class
pawnbox has quit [Remote host closed the connection]
<anotherpi> moreover, this method seems to already have an implementation in the rspec file
minimalism has joined #ruby
dgarstang has quit [Ping timeout: 240 seconds]
rwb has joined #ruby
<anotherpi> ruby663: why did you define a Game#secret method?
<anotherpi> if you can't answer the question, may removed it
dopamean_ has quit [Ping timeout: 260 seconds]
<ruby663> I can answer
<SeepingN> def checksecret { nil }
centrx has quit []
<SeepingN> and def setsecret too
<ruby663> because of this
<SeepingN> unexpected "(" because you're calling a method that doesn't exist
<anotherpi> it's not a Game#secret method call, it's Game#secret=, and it's already defined
enterprisey has joined #ruby
<ruby663> but is the right way to do it with that method?
<anotherpi> with `attr_accessor :secret`
<ruby663> I mean is the method that I wrote correct?
<ruby663> ok I will add secret to attr_accessor
<anotherpi> you don't need to define secret method
Rodya_ has quit [Remote host closed the connection]
gusrub has joined #ruby
<anotherpi> ruby663: it's already done
<ruby663> a yeah I saw it
<anotherpi> so you don't have to :)
<ruby663> yeah
<ruby663> it is done
<ruby663> but then in your opinion
<anotherpi> but you need to define Game#checksecret
<SeepingN> but where is checksecret
<ruby663> I have not create
<anotherpi> and you can explain what the method do
<ruby663> I have to create method checksecret?
<SeepingN> if you're going to call it, yes
jdm has joined #ruby
mim1k has quit [Ping timeout: 255 seconds]
<anotherpi> because its name is kinda explicite, and the specs explain it
<ruby663> But I am not sure if the code of the method secret is correct as a whole because I wrote it
<anotherpi> do you have notions of object oriented programming?
<ruby663> I am still learning about that
<ruby663> I will have 30 min internet and then the router will stop working..
<SeepingN> well secret takes no input, for one thing. and then it tests to see if different values are the same, which can never be true, so it alwasy returns false
<brent__> How could i change a rails 5 api app to serve up the assets folder?
<anotherpi> the secret method is a kinda copy paste of the spec, soooo… you can delete it
nowhereman has joined #ruby
<anotherpi> brent: /join #rails, or may be /join #rubyonrails, dunno
nicoulaj has quit [Read error: Connection reset by peer]
montanonic has joined #ruby
<anotherpi> ruby663: do a Ruby tutorial, we can see that you do not understand it very well for the moment
Rodya_ has joined #ruby
nicoulaj has joined #ruby
<anotherpi> talk about all of that with your mates at school
d0nn1e has quit [Ping timeout: 264 seconds]
<anotherpi> have to go
<anotherpi> good night, it's late for me
<ruby663> anotherpi: can u give me the code that will work
<ruby663> to understand it
d0nn1e has joined #ruby
<anotherpi> ruby663: i don't have it
ruby663 has quit [Quit: Page closed]
<anotherpi> we are not wizards on #ruby
ruby895 has joined #ruby
<anotherpi> have to go, good luck!
Rodya_ has quit [Remote host closed the connection]
<havenwood> we can neither confirm nor deny that we are wizards on #ruby
Rodya_ has joined #ruby
ruby706 has joined #ruby
Xiti has quit [Quit: Xiti]
jshjsh has joined #ruby
griffindy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
anotherpi has quit [Ping timeout: 252 seconds]
modlin has joined #ruby
polishdub has quit [Quit: Leaving]
vikas027 has joined #ruby
bkxd has quit [Ping timeout: 268 seconds]
JoshS has quit [Ping timeout: 268 seconds]
elifoster has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
NightMonkey has quit [Ping timeout: 260 seconds]
ruby895 has quit [Ping timeout: 260 seconds]
psychicist__ has joined #ruby
sepp2k has quit [Ping timeout: 255 seconds]
ruby706 has quit [Ping timeout: 260 seconds]
NightMonkey has joined #ruby
modlin has quit [Quit: Konversation terminated!]
JoshS has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dopamean_ has joined #ruby
dopamean_ has quit [Client Quit]
jshjsh has quit [Ping timeout: 268 seconds]
jshjsh has joined #ruby
am55 has quit [Quit: Textual IRC Client: www.textualapp.com]
milardovich has joined #ruby
nowhere_man has joined #ruby
nowhereman has quit [Ping timeout: 268 seconds]
JoshS has quit [Ping timeout: 268 seconds]
<dminuoso> 23:40 < havenwood> we can neither confirm nor deny that we are wizards on #ruby
<dminuoso> That's only because Ruby is far too easy to read.
<dminuoso> Go to #haskell, freaking wizards everywhere.
<dminuoso> And they seem to be tripping on acid.
ishahnaz has quit []
<SeepingN> you'd have to
milardovich has quit [Ping timeout: 268 seconds]
montanonic has quit [Ping timeout: 255 seconds]
jdm has quit [Remote host closed the connection]
cschneid_ has joined #ruby
Ruby has joined #ruby
<Ruby> Hello
emilford has joined #ruby
<Ruby> Can anyone help me with some problems
<baweaver> ask
<Ruby> # Define a method that returns the longest word in its argument. def longest_word(str) words = str.split longest_word = "" words.each do |word| if word.length > longest_word.length longest_word = word end end longest_word end
cschneid_ has quit [Remote host closed the connection]
cschneid_ has joined #ruby
<baweaver> ?gist
<ruby[bot]> https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<baweaver> that'll help for next time
<baweaver> what's wrong with it?
patarr has quit [Ping timeout: 255 seconds]
<Ruby> Sorry I was trying to send another question, let me use that github link to paste it
<baweaver> On that one: str.split.max(&:size)
<Ruby> Write a method named crazy_sum(numbers) that takes an array of numbers. crazy_sum should multiply each number in the array by its position in the array, and return the sum. crazy_sum([2]) == 0 # (2*0) crazy_sum([2, 3]) == 3 # (2*0) + (3*1) crazy_sum([2, 3, 5]) == 13 # (2*0) + (3*1) + (5*2) crazy_sum([2, 3, 5, 2]) == 19 # (2*0) + (3*1) + (5*2) + (2*3) Make sure your code works for arrays with repeats of the same number (like [2, 3, 5, 2])
<baweaver> shorter
<Ruby> This is my question
<Ruby> Oh youre right
charliesome has joined #ruby
cschneid_ has quit [Read error: Connection reset by peer]
<baweaver> &ri Enumerable#reduce
marxarelli is now known as marxarelli|afk
<baweaver> &ri Enumerator#with_index
sepp2k has joined #ruby
cschneid_ has joined #ruby
<baweaver> (1..3).reduce(0).with_index { |a, (x, i)| p a, x, i }
<baweaver> >> (1..3).reduce(0).with_index { |a, (x, i)| p a, x, i }
<ruby[bot]> baweaver: # => 0 is not a symbol nor a string (TypeError) ...check link for more (https://eval.in/744244)
<baweaver> one sec, fiddle with this
<add^_> Hm
emilford has quit [Ping timeout: 260 seconds]
<add^_> Wrong window, sorry
<Ruby> okay thank you
<baweaver> >> (1..3).each_with_index.reduce(0) { |a, (x, i)| p a, x, i }
<ruby[bot]> baweaver: # => 0 ...check link for more (https://eval.in/744245)
<baweaver> click that link
<baweaver> now given that try and figure out how to implement the rest
<baweaver> x is the number, i is the index
<baweaver> a is the accumulator which starts at 0
milardovich has joined #ruby
<baweaver> >> (1..3).reduce(0) { |a, x| a + x }
<ruby[bot]> baweaver: # => 6 (https://eval.in/744246)
<baweaver> and for each item in the list the next accumulator (memo) is the result of the last run
<Ruby> is there any way to do it without regex?
<baweaver> that's not regex
<Ruby> and defining the method of crazy_sum
<baweaver> that part you'll have to figure out
<Ruby> is there a way to start it like this
<Ruby> def crazy_sum(arr) arr.each_index do |idx|
<baweaver> &ri Enumerable#each_with_index
<baweaver> there is
<baweaver> reduce makes more sense for it though.
aryaching has quit [Ping timeout: 264 seconds]
<Ruby> can you help me use the each with index way?
<Ruby> thats the chapter im on
<baweaver> (1..3).each_with_index.reduce(0) { |a, (x, i)| p a, x, i }
<baweaver> Let's look at that again
<baweaver> (1..3).reduce(0) { |a, x| a + x }
<baweaver> and this for reduce
<baweaver> now you need to get a sum
mtkd has quit [Ping timeout: 240 seconds]
DLSteve_ has quit [Quit: All rise, the honorable DLSteve has left the channel.]
<baweaver> that's the result of an accumulator (a) plus the item multiplied by its index
<baweaver> how would you change the code with a, x, i to accommodate that?
<baweaver> and if that's confusing, mention what part loses you
milardovich has quit [Ping timeout: 260 seconds]
<Ruby> What about something like this def crazy_sum(arr) crazy_array = [] arr.each_index do |idx| crazy_array << (idx * idx) end crazy_array end
<baweaver> think about that
montanonic has joined #ruby
<baweaver> what is that method doing exactly?
<baweaver> walk me through it step by step
<Ruby> I'm very new to ruby
<Ruby> # crazy_sum([2]) == 0 # (2*0) # crazy_sum([2, 3]) == 3 # (2*0) + (3*1) # crazy_sum([2, 3, 5]) == 13 # (2*0) + (3*1) + (5*2) # crazy_sum([2, 3, 5, 2]) == 19 # (2*0) + (3*1) + (5*2) + (2
<Ruby> these are the examples
saneax-_-|AFK is now known as saneax
CloCkWeRX has joined #ruby
<baweaver> they are, but what is your method doing
<baweaver> tell me from the start what it does
mtkd has joined #ruby
hutch34 has quit [Ping timeout: 240 seconds]
<Ruby> I only have 5 minutes to finish this
<Ruby> Im on a timer for my assignment
<vikas027> Hey All, I have a JSON file https://dpaste.de/tAH8 which I have converted into a hash which has 'AWS' in it https://dpaste.de/MsV2. How can I modify (say replace ${account_id} with some value) and push it back to hash.
<baweaver> (1..3).each_with_index.reduce(0) { |a, (x, i)| p a, x, i }
<baweaver> then understanding that fast is your best bet
<baweaver> but I won't give you a straight answer on it. That'd be cheating and you wouldn't learn much
<baweaver> If you replace that range with your array and use the accumulator, item, and index you have in that block you can get it.
tau has quit [Remote host closed the connection]
KicStart has left #ruby [#ruby]
<Ruby> Okay im stumped
jdm has joined #ruby
<baweaver> >> [1,2,3].reduce(0) { |a, x| puts "Accumulator: #{a}\nValue: #{x}"; a + x }
<ruby[bot]> baweaver: # => Accumulator: 0 ...check link for more (https://eval.in/744248)
<baweaver> click that evalin link
Lord_of_Life has quit [Excess Flood]
Taoki has joined #ruby
<baweaver> and then that one
<ruby[bot]> baweaver: # => Accumulator: 0 ...check link for more (https://eval.in/744249)
<baweaver> >> [1,2,3].each_with_index.reduce(0) { |a, (x, i)| puts "Accumulator: #{a}\nValue: #{x}\nIndex: #{i}"; a + x }
<Taoki> Hello.
Rodya_ has quit [Quit: Leaving...]
<baweaver> the rest is up to you, but it's a danged bad idea to get 5m left on the clock and then ask questions
<Taoki> I installed a ruby gem using "gem install mygem". It installed successfully, but how do I run it? It is supposed to work by me typing the name of the gem in bash
blackmes1 has joined #ruby
<baweaver> vikas027: regex. hash['AWS'].each { |v| v.sub(...fill this in...) }
<baweaver> Taoki: actual name of the gem?
<Taoki> rvpacker
<baweaver> unless it has an executable component it won't
<Taoki> That's how the instructions say it should work
<vikas027> bawaever: Thanks, trying it out.
haylon has joined #ruby
<baweaver> &ri String#sub
<baweaver> vikas027: ^ read that too for reference
<Taoki> baweaver: Should that one work, like its instruction suggest?
<baweaver> give me a sec.
pawnbox has joined #ruby
marxarelli|afk has quit [Quit: Textual IRC Client: www.textualapp.com]
<Taoki> Sure.
<baweaver> are you on Windows or Linux/Mac?
<Taoki> It does have a bin directory btw, with a script in it
<Taoki> Linux
<baweaver> run: gem list rvpacker
<baweaver> see if it was installed
marxarelli has joined #ruby
<Ruby> What about this crazy_nums Write a method crazy_nums that takes a number, max, and returns an array of the integers that ARE less than max AND ARE divisible by either three or five BUT ARE NOT divisible by _both_ three and five You should return the result in increasing order. You may wish to use the modulo operation: 5 % 2 returns the remainder when dividing 5 by 2: 1. If num is divisible by i, then num % i == 0. crazy_nums(3) == []
<baweaver> then try: rvpacker --help
Lord_of_Life has joined #ruby
<Taoki> Local gems: rvpacker (1.2.0)
<baweaver> Ruby: ....are you just asking us to help you solve quiz problems?
<baweaver> you really need to learn how to do this yourself and it's rather unethical to have us solve things like that.
<Ruby> and yea
<Ruby> timed hw
<Ruby> ill pay you
<baweaver> write the questions down and hope you get a retry on it.
<Ruby> Im really desperate
<baweaver> No
jdm has quit [Remote host closed the connection]
<baweaver> and I would suggest against asking that in channel. You need to be able to pass your classes on your own skills
skweek has joined #ruby
<baweaver> We can help you learn Ruby but we will not outright solve homework for you.
jdm has joined #ruby
* Taoki would help, but probably doesn't know
<baweaver> Taoki: rvpacker --help
<Taoki> baweaver: Any more thoughts on what to try next?
<Radar> ?homework
<ruby[bot]> Radar: I don't know anything about homework
<baweaver> does that run?
<Taoki> ok
<Radar> ruby[bot]: lies
<Taoki> 1 sec
<Radar> Ruby: My rate is $200/answer.
chouhoulis has quit [Ping timeout: 240 seconds]
<Radar> Ruby: SUD
<Radar> USD*
<Radar> Paypal is radarlistener@gmail.com
<Taoki> baweaver: rvpacker: command not found
<Radar> Send half now then half after you get the answer.
<Ruby> Okay deal
gloscombe_ has quit [Quit: gloscombe_]
pawnbox has quit [Ping timeout: 240 seconds]
<Radar> Ruby: let me know when it's sent and I'll log in and check.
Ruby has quit [Quit: Page closed]
* baweaver sighs
<Radar> baweaver: ir
<Radar> baweaver: ikr
<baweaver> I'd bet money they scam on that
<baweaver> and I have more than half a mind to ban them
<baweaver> Taoki: hrm.
<Radar> baweaver: wow cynical
jenrzzz_ has joined #ruby
<baweaver> Radar: tis my middle name
<Taoki> baweaver: I have the file /usr/lib64/ruby/gems/2.2.0/gems/rvpacker-1.2.0/bin/rvpacker
<baweaver> ah, paths
psychicist__ has quit [Ping timeout: 260 seconds]
<Taoki> What would I try next?
<baweaver> Give that a shot
<Radar> ^ seconded
d10n-work has quit [Quit: Connection closed for inactivity]
<baweaver> you don't need to get through to the Rails section though
<Taoki> That page is about a whole lot of things...
<Taoki> I already installed it
<Taoki> Should I change a path variable?
nowhereman has joined #ruby
<baweaver> that gets it set up to where path will know about it too
jenrzzz has quit [Ping timeout: 260 seconds]
* baweaver didn't know RMMV worked on *nix
<Taoki> Can I attempt changing the path via variable?
nowhere_man has quit [Ping timeout: 240 seconds]
<baweaver> Ubuntu?
<Radar> Oh no Ruby left :(
<Taoki> openSUSE. Also: I can run the file as "ruby ./rvpacker" I get some error though
<Taoki> - /usr/lib64/ruby/gems/2.2.0/gems/rvpacker-1.2.0/lib/RGSS/serialize.rb:294:in `exist?': no implicit conversion of nil into String (TypeError)
<baweaver> that has some stuff there
<baweaver> Might be that your code in there is borked too
<Taoki> It's not my code, just installed it from someone else
<baweaver> Might also look at the RPG Maker forums as they know the serialized format better than we would.
<vikas027> baweaver: https://dpaste.de/B0G7 Am I doing something silly ?
<Taoki> That's a tool to serialize it, I don't know of any other. Looked but found nothing
aryaching has joined #ruby
<baweaver> vikas027: probably
<baweaver> oh
<baweaver> I should probably look at the code, eh?
<Taoki> baweaver: 'gem require' does't seem to be a valid command, not sure how I do that from bash
<baweaver> vikas027: line 5
<baweaver> what type is abcd?
<vikas027> baweaver: Array
<baweaver> >> [1,2,3]['string']
<ruby[bot]> baweaver: # => no implicit conversion of String into Integer (TypeError) ...check link for more (https://eval.in/744250)
<Taoki> Not a programmer myself, so don't know what would cause that
mattwc has joined #ruby
<baweaver> Taoki (sorry, trying to juggle a few questions)
<Taoki> It's ok
matcouto has joined #ruby
<baweaver> Longterm this will be easier for you: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you
<baweaver> Radar wrote it to get a solid Ruby install down that developers tend to use. The prepackaged / system versions tend to be old or do odd things
bkxd has joined #ruby
michaeltsmith has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<baweaver> Anything in the Rails section and below you can ignore safely
mikecmpbll has joined #ruby
<allisio> 18>> [0,1,2,3,4][?//12]
<allisio> Fine, then.
<baweaver> allisio: you auth'd?
<baweaver> 18>> [0,1,2,3,4][?//12]
<ruby[bot]> baweaver: # => 3 (https://eval.in/744252)
<allisio> Oh, right.
<baweaver> bot ignores people that aren't
<allisio> Makes sense.
ahrs has joined #ruby
modlin has joined #ruby
skweek has quit [Ping timeout: 255 seconds]
Dimik has quit [Ping timeout: 255 seconds]
Guest93277 is now known as whathappens
anekant has quit [Ping timeout: 260 seconds]
emilford has joined #ruby
Taoki has left #ruby ["KVIrc KVIrc Aria 4.9.1, revision: 7547b97, sources date: 20160102, built on: 2016-11-10 23:05:53 UTC http://www.kvirc.net/"]
cibs has quit [Ping timeout: 240 seconds]
agent_white has quit [Quit: leaving]
biberu has quit []
cibs has joined #ruby