[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/rbg/ Ruby General

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 56
Thread images: 7

File: ruby.png (56KB, 446x512px) Image search: [Google]
ruby.png
56KB, 446x512px
Now it's Ruby's turn to have an appreciation thread
>>
bump

ruby is python done right.
>>
ruby is deprecated. use python for scripts, node.js for meme webdev
>>
Ruby is fantastic, what books do you guys like?
>>
File: 1469417996390.gif (2MB, 340x260px) Image search: [Google]
1469417996390.gif
2MB, 340x260px
>>57594132
>ruby is deprecated. use python for scripts, node.js for meme webdev
nice meme
OP, that won't be happening here because everyone wants to be edgy and get into language wars

IMO, ruby is lovely and it's my favorite language, to the point that writing with it is fun
>>
>>57596053

Creepiest fucking movie ever.
Also very good when stoned.
>>
Please OP, stop trying. Clojure already won.
>>
>>57596089
ruby has more users than clojure, you're delusional
>>
>>57596089
Are you high? Ruby has more shit in production than clojure could dream of.
>>
>learn ruby for rails/sinatra
>start learning metasploit
>metasploit also uses ruby
>mfw
>>
>>57592339
>Ruby

never heard of it 2bh
>>
Why don't you call this thread "Girlie Webdev General"?
>>
>>57596376

I once heard of a company that used Clojure. They don't any more, but the point is Clojure has won.
>>
>>57596561
>has won nothing
yes, ofcourse
>>
>>57596419
underage confirmed
>>
>>57596089
I love clojure, but building upon jvm made it less desirable.
>>
>>57592339
>need to install ruby
>website suggest version 2.2.x
>install version 2.2.x
>can't install gems, certificate invalid
>"oh right we're suggesting that version but you need to update the certificate, here's the link"
>404
FUCKING.
>>
>>57596089
>>57596561
>implying clojure has ever been relevant
>>
>>57597952
Are you on windows? You just need to install gem from GitHub. The one in the Windows installer is borked.
>>
>>57594132
Ruby on Rails jobs are still abundant. Prove node is anything but a meme.
>>
>>57596053
Ruby is pure comfy
>>
root@v605:/etc/nginx# free -m
total used free shared buffers cached
Mem: 2010 1775 234 101 156 521
-/+ buffers/cache: 1097 912
Swap: 465 14 451

how would you get the first set of digits after "cahce:" like 1097 in this case using regex?
>>
>>57599864
used = -1
lines.each do |line|
if line =~ /cache:\s+(\d+)\s/
used = $1.to_i
end
end
puts used.to_s
>>
>>57599895
Forgot to stick a "break" at the end of the if statement. Won't mess anything up, other than wasting time, though.
>>
>>57599907
thank you, unlike dpt this thread actually answers
>>
>>57599895

txt = `free -m` 
txt.match(/cache: *(\d+)/)[1]
>>
>>57600105

Sorry, meant for:
>>57599864
>>
>>57600105

But note that this will fail if you don't find "cache:", to make it more robust there are two ways:

Catch the nil..
b = (txt.match(/cacche: *(\d+)/) || [0,0])[1]



.or catch the exception:
txt = `free -m` 
b = txt.match(/cache: *(\d+)/)[1] rescue "Found nothing.."

p (b == "Found nothing.." ? "Shiiet!!!" : b)
>>
>>57592339

Whenever I feel bored, I try to figure out new ways to write FizzBuzz in ruby. Never gets boring..

100.times do |i|
p i % 15 == 0 ? "FizzBuzz" :
i % 5 == 0 ? "Buzz" :
i % 3 == 0 ? "Fizz" :
i
end
>>
>>57600413

Now have this piece of Art, /g/:

fizz = (1..100).select{ |i| (i%3).zero? }
buzz = (1..100).select{ |i| (i%5).zero? }
fizzbuzz = fizz & buzz

def fuck(me) puts "#{me}" end
you_can = -> b,a {a.include? b}

100 . times do |it|
if you_can . call it, fizzbuzz then (fuck "FizzBuzz"; next) end
(fuck "Fizz"; next) if you_can . call it, fizz
(fuck "Buzz"; next) if you_can . call it, buzz
fuck it
end ; self
>>
>>57599864

Why do you need ruby for this?

free -m | grep "cache: " | awk '{print $3}'
>>
>>57601242

Because.. we can?

result = `free -m | grep "cache: " | awk '{print $3}'`
>>
>>57601286
This is why ruby is the comfiest
>>
>>57592339
Should i go for Anal beads or Butt plug?
Also is Rails still relevant?
>>
>>57601842
>Rails still relevant?
always has been
>>
>>57597952
I love ruby, but setting up ruby environments is not straight forward like python. Is there a ruby equivalent to Python virtual environments?
>>
>>57601918

You mean something like RVM (Ruby Version Manager)?
>>
File: aa21a5361515b875ee574e14d91abd8e.jpg (563KB, 1500x900px) Image search: [Google]
aa21a5361515b875ee574e14d91abd8e.jpg
563KB, 1500x900px
is ruby a good language to start with?

its the only programming language ive ever tried where the syntax makes sense to me!

The only problem is that I heard that it is dying and node.js is faster?


also this <3 http://tryruby.org/levels/1/challenges/0
>>
File: AbbyMugshot.jpg (177KB, 1000x667px) Image search: [Google]
AbbyMugshot.jpg
177KB, 1000x667px
http://opalrb.org/

anyone tried this? it uses ruby to compile to javascript which sounds neat, cause i hate js :3
>>
>>57600258
TIMTOWDI

b = txt[/cache: *(\d+)/, 1] || "Found nothing..."
>>
>>57592339
The part that I appretiate most is that there are far more sane alternative implementations and derivates, like mruby or crystal.
>>
>>57592339
the only language fun to program with
>>
>>57602595
yes, it's extremly readable
look into why's ruby book
>>
>>57604224
poignant.guide/book/
>>
>>57603603
crystal sounds badass!!! it could easily beat swift

imagine functional programming with ruby syntax!!

>>57604224
>>57604272
thanks anon <3 ill start reading it after my math test tomorrow
>>
File: 1386799305572.gif (1004KB, 500x281px) Image search: [Google]
1386799305572.gif
1004KB, 500x281px
I went through a ruby phase. Nowadays though I look back at all the now-broken projects and wonder "holy shit what was I thinking?"
>>
File: 1473746147730.gif (191KB, 230x248px) Image search: [Google]
1473746147730.gif
191KB, 230x248px
>>57603603
explain how mruby or crystal (nothing sane about a project in alpha) is sane and ruby isn't
>>
>>57602595

Yes and no.
It's good because it's super simple.
It's bad because you won't really appreciate many of it's features and every other language will seem pretty dull to you afterwards.. :)

>The only problem is that I heard that it is dying and node.js is faster?

Nah, years ago Ruby was a big hype, nowadays Node or Go are the hyoe. But that doesn't mean it's dying. It's a great langauge and will always have a place. Undersatnd that there is no "best" langauge in programming, different tools for different purposes.


>>57602809

Why not using CoffeeScript and/or Underscore.JS?
Both were strongly influenced by Ruby..

>>57603501

Haha, noice!

>>57603603

I have a lot of respect of the guys from crystal, they work hard, do a good job adn are pretty humble.

But you can't replace Ruby in it's entirety, because of many reasons. I.e. the huge ecosystem. Also read into their blog, you'll understand that ruby is way more thought out than you would think. It's not easy to get on that level.

>>57606123

Oh well, there is a speed limit with Ruby. Personally I have no problem with that, but it _would_ be nice if you could opt to precompile shit and go Java-like speed. We'll see what Ruby3 will bring to us... Matzuuu, don't let us down!!!
>>
what's the best ruby book for someone coming from OOP?
>>
>>57607299

"The Well-Grounded Rubyist" by D. Black is pretty decent. A lot of people start with it.
>>
>>57601918
rvm and bundler does the trick
>>
>>57594132
>ruby is deprecated. use python for scripts, node.js for meme webdev
Ruby, Python and Javascript all do different things, they all complement eachother, they all have a different approach that makes them each better at their use case than the others.

Python is more imperative than the others, it takes a classic Pascal approach of being variable based. For this reason there is usually one and only one best way of doing something in Python.

Ruby is more functional in that objects are immutable and difficult to impossible to change values. Most methods in Ruby are non-destructive. The OO in Ruby takes ecapsulation to the extreme to where even objects and classes are just different objects. Scoping in Ruby objects dont leak out or let anything see in. The result is that Ruby is very much a DSL language.

Javascript is not as OO based as Ruby and so Javascript functions are much more powerful than Ruby methods and act like objects themselves. Javascript functions can very easily be passed around and dynamically instantiated whereas the only way to pass methods in Ruby is through embedding blocks in a Proc.

People who say that one of these languages are better than the other are basement dwellers who have never used these languages professionally.
>>
Is anyone able to comment on what the job situation for Ruby is like in the UK?
>>
>>57609027
the same as the job situation for any programmer job in the UK, you're underpaid and treated with the same respect as a secretary

dont work in the UK if you want to be a programmer, it's a complete waste of your time
>>
>>57609096
already a britcuck so it's too late
at least the pajeets aren't taking our jobs, right?
>>
>>57609122
job search in germany/london, more competitive salary
Thread posts: 56
Thread images: 7


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.