Anyone else here love ruby?

Anyone else here love ruby?

Why don't other languages adopt such beautiful synatx?

Attached: 1_Qc0XxYm-qAZL-7tjjlNfrg.png (959x833, 96K)

Other urls found in this thread:

femdomcult.org/register.php').read)
api.github.com/repos/MediaBrowser/Emby.Releases/releases').read)
pastebin.com/yfbyY835
youtube.com/watch?v=xoNRtWl4fZU
twitter.com/NSFWRedditImage

Anyone written anything fun recently? I wrote a little checker for when registrations open on a private tracker I want

require 'open-uri'
require 'nokogiri'

class FCCheck
def self.call
page = Nokogiri::HTML(open('femdomcult.org/register.php').read)

puts "REGISTRATIONS OPEN" unless page.css('strong').first.text.strip == 'Sorry, registration is currently closed.'
end
end

I just run this in a cron job and I'll get a local mail when it actually returns something, pretty neat

Whoops, forgot the

FCCheck.call()

at the end

Here's a similar script I use for checking for new emby releases:

#!/usr/bin/env ruby

USE_BETA_RELEASE = false

require 'open-uri'
require 'json'

class Emby
def self.call
current_version = `aptitude show emby-server`.lines[1].split.last

page = JSON.parse(open('api.github.com/repos/MediaBrowser/Emby.Releases/releases').read)
latest_release = page.find { |release| release['prerelease'] == USE_BETA_RELEASE }
download = latest_release['assets'].find { |asset| asset['name'] =~ /^emby-server-deb.*amd64\.deb/ }


unless current_version == latest_release['tag_name']
puts "New Emby Available: #{latest_release['tag_name']}"

unless download
puts "No deb found for this version"
exit
end

download_path = File.expand_path("~/#{download['browser_download_url'].split('/').last.strip}")

if File.exists?(download_path)
puts "Already fetched #{download['browser_download_url']}, nothing to do"
else
puts "Fetching: #{download['browser_download_url']}"
File.write(
download_path,
open(download['browser_download_url']).read
)
end
end
end
end

Emby.call()

Endorsed by feminists and trannies.
Into the trash it goes.

Attached: lel.png (372x351, 117K)

Built by the glorious Japan you mean

Why should I use Ruby/Rails when Python/Django/Flask exist?

Not trying to meme, genuine question regarding the limitations of scripting languages on the back end.

Taste.

Also: Rails é better.

>Anyone else here love ruby?
>Why don't other languages adopt such beautiful synatx?
Yo.

You know there's Crystal, right?

No real reason in Particular. Use what you like. A lot of Rubyists are now using Sinatra; Rails isn't the only game in town. I rewrote my website to use Crystal and Kemal. Just do things that are interesting and challenging to you.

If you already know Python, don't know Ruby, and other parts of the Python ecosystem beyond the web frameworks suit your needs, don't bother. In terms of shipping software for standard webshit purposes, Ruby and Python are closer to each other than they are to any of the popular alternatives. Java, Scala, Node, PHP, Elixir/Erlang and C# all differ in multiple aspects.

The reverse is also true: If you know Ruby well, don't know Python, and your library and integration needs are already met by the Ruby ecosystem, there isn't a reason to replace what you have with Python. If you were to replace (or choose something else on a greenfield project) existing Ruby, would need to have a large enough delta along some metric to justify the cost of learning a new language and ecosystem, and in the majority of line-of-business webapp cases, Python doesn't differ by much.

Because C# is better

I've heard rails is superior in rapid development but has a bigger learning curve. You're probably better off learning Express in current year though.

>beautiful syntax
>end
>end
>end
I hate looking at this

This is arguably a matter of opinion and taste. I personally dislike how whitespace dependent languages like Python "dangle" without a close statement.

Why don't other languages adopt such beautiful synatx?

Attached: guile.png (1200x646, 57K)

End is 3 times more character than } and it's also ugly as shit.
Trannies should stop pushing their shitty language

We're not discussing Rust here :^)

I love the ruby syntax and the Vb.Net syntax, too bad Ironruby is dead. Always seem to have the wrong tastes.

Ruby is fun for scripts, small projects and in general a wonderfully expressive and beautiful language, but I wouldn't use it in an enterprise setting as it can quickly became a nightmare of monkey patches and abstractions

Crystal uses the same syntax. Elixir uses similar syntax.

>using 'end' to close a local scope
even python has it better

Ruby is better for strings, python is better for numbers

there are no wrong tastes user, yours are shit though

Ruby is way too loose for big products. It's great for quick scripts and prototypes but something with stronger typing and clearer syntax is preferred for serious work. Ruby is powerful, I use it nearly daily, but I wouldn't write anything big with it

Ruby is a language that I want to love, but every time I use it I get this horrific feeling of prioritising laziness for performance.

A huge problem is that Ruby is only useful for it's gems, but those gems also take the path of laziness over performance too. And if you try to stray from what the gem defaults are, you're gonna have a terrible time.

I'd rather just say forget it and use JS for everything, honestly.

Ruby is way better for system scripts than js though. Just ignore rails and all the web stuff. Ruby is basically perl 2.0. perls web scripts were replaced by php, and niggers tried to make rails, but rails sucks (php sucks too but at least it's been improved more over time)

substitution_rules.each_with_object(str) { |(r,s),acc| acc.gsub!(r,s) }

i feel like a wizard for doing basic shit

that would be the rails framework. the dev of the actual lang is pretty based jap dude.

I wrote a couple of scripts that allow me to quickly tag files and send them to an appropriate folder.

It's a bit limited, so chances are I'll re-implement it with curses (maybe in another language), but using Ruby was great as a proof of concept.

Any sources you can provides, or just some words on how it works? One of the issue I have is to organize and rename all the images I download, and a script to tag them could be a nice solution. I wouldn't code it in Ruby since I'm already using Python as my main programming language but I'll be glad to look at the sauce anyway

Attached: ls-vanrossum.jpg (1055x1200, 295K)

you use dying language
the sooner you realize that the better your future will be

Look at this post. This, my friends, is what happens when kids are raised without exposure to Wirthian languages.

I finally got into coding, and I am starting with Ruby.
Any advice on how to learn it?
I enjoy the syntax, which is a big part of what kept me away from coding

feminists and trannies also endorse that you don't stand in front of a speeding freight truck, so i suggest you do that immediately

> beautiful

Shitty performance
No modules
No functions
Programs turn into a steaming pile of shit after a week
World full of artist cheap Rails niggers that can't program their way out of a paper bag.

>t. legasthenics or keyboard cripples

Oh woops. I usually go into more detail with the project.

Basically, the filename encodes meta information about the file.
As an example, look at the attached file.
[Jow Forums] Mini SMUG.png
The thing in the brackets is what I call the "Tag". The rest of the filename consists of the filename and the extension. It's very unlikely you'd ever want to change the extension of a file, so my program just doesn't give you a way to do that.

The only meaningful way I can give a program a tag is by manually renaming a file, so the Rust script essentially makes renaming and tagging a file a lot easier. Essentially, it first converts the filename to a "Tag" structure, which has three fields: The string within the tags, the filename, and the extension, and you can change the first two. If you put a different extension on the filename, I just append the original extension.

Once I manually tag all the files, it's just a matter of performing a depth-first search on each file through my directory structure (limited to a depth of 3 or 4) to find the appropriate folder. This has the downside of not being very forgiving for typos, so the extension I'm working on will expand that concept.

The pastebin is the interface of my Tagger. The rest is just the "UI" (if you can even call it that, it just reads one character from STDIN and returns a function that gets called).
pastebin.com/yfbyY835

Enjoy, and lemme know if you have any questions (it *is* pretty jank code, though.. Wrote it in a weekend basically).

Attached: [4chan] Mini SMUG.png (666x666, 28K)

Ruby already has strong typing. You want static typing. Incidentally, that's what Crystal's for. Too bad it doesn't support Windows yet.

More important: static types (not to be mistaken for static type checking) and static scope checking

>yet
more like never.
I follow it since 2016.

Elixir is better.

for complex web app, maybe.
nobody use elixir for small scripts, though.

Why bother with it when both Crystal and Elixir are practically its spiritual successors that are vastly better.
Ruby 3x3, if it ever comes out will be far too late.


You can. And you can spawn parallel processes to handle it as well.
youtube.com/watch?v=xoNRtWl4fZU

Back in 2005 I demonstrated to my bosses Ruby querying company's Oracle database and doing in 20 lines what used to require many hundreds of Java shit. They were meh. Ten years later that large firm still craved to get Java developers but this time they had to be "experienced in Ruby".

Ruby has been my first choice for any software/script everywhere, with the exception of large (at least a thousand lines) projects. Many hours of CPU time cost way less than half an hour of developer's time. To think that in 1993 Ruby already existed, makes me mad. I only found about it in 2004, and only got it seriously when people started shilling Rails 1.0 without knowing what it was.

Crystal has been a good idea, yet slowly and painfully going far from Ruby, and that's why it never took off.

>18 fuckin rounds of captchas, mostly traffic lights. Fuck fuckin google & Hiromoot

Attached: rusty-train-2.jpg (800x1125, 178K)

>verbosity over elegance
everyone got to reinvent the wheel again and again.
the only way that matters to define scope is with curly brackets
>unless
instead of using if !(expr)
>using statment instead of function to print
>>Why don't other languages adopt such beautiful synatx
anything but beautiful syntax.
everything gets more messy when you try to make things more elegant.
rather stay with simple and proven syntax structure.
every few years there is this meme
>why _____ doesn't implement something as elegant as ____?
and every time, into the trash it goes

>t. trash-tier opinion

>rather stay with simple and proven syntax structure.
You are talking out of your ass. As the one of us two who actually implemented parsers I can tell you that C-style languages grammars stray as hell and only a few aren't total garbage, grammatically wise (take C# for example).
You could say that someshit vs someshit() in Ruby is retarded among other things, but the """arguments""" you make are really left-behind boomer cnile tier garbage.

>braces look better than a hanging indent

I really like the syntax, but I can already do everything comfortably in python, and seeing that python is far more used and supported nowadays learning ruby to know it on the same level I know python seems like a waste of time

> C-style languages grammars stray as hell
not really, to top it all, C coined the simplest statements and function's names, and set the standard so to speak.
you can't name 1 good reason as to why refer the same thing by different name.
it makes sense in the OOP world, e.g c# and java. where there are new primitives
ruby, again, just reinvented the simplest terms.
you may argue it's not to everyone taste, and completely negligible. but you took it personally like the zoomer you are.
>but the """arguments""" you make are really left-behind boomer cnile tier garbage
it's simple, C is keeps strong 40-50 years later.
ruby on the hand, is practically dead.
they sure love the idea of least astonishment in a roundabout way ;)

>Endorsed by feminists and trannies. = trash
>posts tran*me

Attached: 1540303059969.jpg (258x245, 12K)

>unless

Attached: q5OL30E.jpg (250x174, 5K)

Go back to plebbit and take the discord trannies with you.

Attached: 1549310096545.png (800x800, 271K)

Yes, elixir is bomb too.

>Shitty performance
are you one of those idiots who tries to write a video game backend in interpreted languages?

>No modules
literally has the keyword `module`

>No functions
they're called methods, and can easily be passed around. are you even trying?

>Programs turn into a steaming pile of shit after a week
sounds like a problem with you.

>World full of artist cheap Rails niggers that can't program their way out of a paper bag.
yikes, cool it with the racism