Ruby-on-rails BESIDES 导轨使用的红宝石是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1376592/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
what is ruby used for BESIDES rails?
提问by Gordon Gustafson
Ruby on Rails has become a new competitive face in the server programming industry, along with php, asp.net, jsp, python, and a few others. But is ruby used for anything BESIDES rails? Does it owe all of its success to the rails framework? More questions here are tagged ruby-on-rails than ruby. However, I supposed PHP isn't used for that much outside of server stuff,
Ruby on Rails 与 php、asp.net、jsp、python 和其他一些软件一起成为服务器编程行业的新竞争面孔。但是 ruby 是否用于轨道之外的任何东西?它的所有成功都归功于 Rails 框架吗?这里的更多问题被标记为 ruby-on-rails,而不是 ruby。但是,我认为 PHP 在服务器之外的用途并不多,
thoughts?
想法?
回答by Jamie Rumbelow
Firstly, PHP was built to be a server language, first and foremost. That's one of the primary reasons it's not usually used for anything other than web applications - it's not designed for it and therefore can't match up to the requirements of, say, a scripted desktop application.
首先,PHP 被构建为一种服务器语言。这是它通常不用于 Web 应用程序以外的任何其他内容的主要原因之一 - 它不是为它设计的,因此无法满足脚本化桌面应用程序的要求。
Ruby was designed as a general-purpose scripting language, and thus has a wide support for a number of different applications. It has been used across the board for everything from web applications, to web servers themselves, to intelligent graphing libraries, to picture recognition engines, to threaded database servers, to low-level system utilities. It has a wide spectrum of use throughout computing.
Ruby 被设计为一种通用脚本语言,因此广泛支持许多不同的应用程序。它已被广泛用于从 Web 应用程序到 Web 服务器本身、智能图形库、图片识别引擎、线程数据库服务器和低级系统实用程序的所有领域。它在整个计算中具有广泛的用途。
Rails has most certainly boosted the popularity of Ruby by a huge amount, brought it up into the forefront of scripting languages, spawning 40+ books, 18 conferences, distribution with nearly all the major operating systems and 7 different implementations to boot!
Rails 无疑极大地推动了 Ruby 的流行,将其带入了脚本语言的前沿,产生了 40 多本书、18 个会议、几乎所有主要操作系统的分发以及 7 种不同的启动实现!
To begin with, all of Rails' internals are written in Ruby itself, but all of the Rubygems, libraries, snippets or anything else that is used by Rails developers is written in Ruby too, and is most likely built to work outside of the Rails stack.
首先,Rails 的所有内部结构都是用 Ruby 本身编写的,但是 Rails 开发人员使用的所有 Rubygems、库、代码片段或其他任何东西也是用 Ruby 编写的,并且很可能构建为在 Rails 之外工作堆。
Having said that, the popular web framework is not the reason whyRuby is popular. Sure, it has helped bring much-needed attention to the language, but it's not the reason why people use it day to day. It's used for everything from web applications to desktop GUI applications because of it's simple, elegant syntax, it's clean, sensible and complete standard library, it's wide ecosystem of community code, support and toolchains.
话虽如此,流行的Web框架是不是这个原因,为什么Ruby是受欢迎的。当然,它有助于为该语言带来急需的关注,但这并不是人们每天使用它的原因。它用于从 Web 应用程序到桌面 GUI 应用程序的所有应用程序,因为它简单、优雅的语法、干净、合理和完整的标准库,以及广泛的社区代码、支持和工具链生态系统。
Ruby isused because it rocks.
使用 Ruby是因为它很摇滚。
回答by jrhicks
Bio Medicine
生物医学
Jules J. Berman, PhD, MD wrote a 378 page bookon how to use ruby to solve the most common computational tasks in the field of biomedicine. As to my knowledge, this book has no mention of Rails.
医学博士 Jules J. Berman 写了一本378 页的书,介绍如何使用 ruby 解决生物医学领域最常见的计算任务。据我所知,这本书没有提到 Rails。
回答by Mike Woodhouse
But is ruby used for anything BESIDES rails?
但是 ruby 是否用于轨道之外的任何东西?
Oh my gosh yes. Look at RubyForge, which predates Rails and the even older RAAfor examples of non-Rails stuff. At work, besides the inevitable Rails-based intranet apps, I use ActiveRecord standalone for database work, scheduled backups, XML parsing, FTP downloads, CSV parsing, manipulating Excel workbooks and just about any other ad hoc scripting job that turns up. But I'm old - I started playing with Ruby before Rails was an apple in DHH's eye.
哦,天哪,是的。看看RubyForge,它早于 Rails 和更老的RAA,以获取非 Rails 内容的示例。在工作中,除了不可避免的基于 Rails 的 Intranet 应用程序,我使用 ActiveRecord 独立进行数据库工作、计划备份、XML 解析、FTP 下载、CSV 解析、操作 Excel 工作簿以及几乎所有其他出现的临时脚本工作。但我老了——我在 Rails 成为DHH眼中的苹果之前就开始使用 Ruby 。
At home, I've done all kinds of strange things, some successfully, some rather less so. All, however, were fun and very few were related to Rails.
在家里,我做过各种奇怪的事情,有的成功,有的不太成功。然而,所有这些都很有趣,而且很少与 Rails 相关。
Does it owe all of its success to the rails framework?
它的所有成功都归功于 Rails 框架吗?
No. Some, but not all. It's also true to say that Rails owes much of its success to Ruby, without which it would be a different beast.
不,有一些,但不是全部。可以说 Rails 的成功很大程度上归功于 Ruby,如果没有它,它就会是一个不同的野兽。
Rails has undoubtedly increased the acceptance of Ruby, taking it to some sort of critical mass where a large enough proportion of developers - regardless of their opinion - have now heard of the language and have some idea of things for which it can be used.
毫无疑问,Rails 增加了 Ruby 的接受度,使其达到了某种临界质量,其中足够多的开发人员(不管他们的意见如何)现在已经听说过该语言并且对可以使用它的事物有所了解。
And yes, it rocks.
是的,它摇滚。
回答by J Bruno
Ruby was really a boutique language before Rails came out. It fills the same need that Perl and Python do. In the scripting space, Perl reigns supreme with Python gaining a lot of popularity the past 10 years. Ruby was sparingly used or heard of among people writing Perl and Python programs. When Rails came out it was very attractive to people doing web development (typically in PHP) so a lot of web programmers picked up Ruby while others saw no reason to switch from their comfortable Perl and Python environments.
在 Rails 出现之前,Ruby 确实是一种精品语言。它满足了 Perl 和 Python 所做的相同需求。在脚本领域,Perl 占据主导地位,Python 在过去 10 年中获得了广泛的普及。Ruby 在编写 Perl 和 Python 程序的人中很少使用或听说过。当 Rails 出现时,它对从事 Web 开发(通常使用 PHP)的人非常有吸引力,因此许多 Web 程序员选择了 Ruby,而其他人则认为没有理由从他们舒适的 Perl 和 Python 环境中切换。
Most people still use it only for Rails but its increased exposure has lead to more people using it "out in the wild" for non web tasks. Most places already have many programs written in Perl or Python and see no reason to switch. Most Linux distributions ship with Perl and Python preinstalled but not Ruby. Ruby also doesn't have as many third party modules available.
大多数人仍然只将它用于 Rails,但它的曝光率增加导致更多人将其用于非 Web 任务。大多数地方已经有很多用 Perl 或 Python 编写的程序,而且没有理由切换。大多数 Linux 发行版都预装了 Perl 和 Python,但没有预装 Ruby。Ruby 也没有那么多可用的第三方模块。
回答by Tombart
All widely used provisioning (automation) tools like Puppet, Chef, Capistranoare written in Ruby. The choice of the language isn't random, for example Chef is using Ruby also for all configuration statements because the language is expressive, simple and easily readable. Puppet has own DSL (Domain Specific Language) which was designed to be accessible to sysadmins. Ruby makes it easier to interpret such a configuration language.
所有广泛使用的配置(自动化)工具,如Puppet、Chef、Capistrano都是用 Ruby 编写的。语言的选择不是随机的,例如 Chef 也将 Ruby 用于所有配置语句,因为该语言具有表现力、简单且易于阅读。Puppet 有自己的 DSL(域特定语言),旨在供系统管理员访问。Ruby 使解释这种配置语言变得更容易。
Also Vagrant- tool for creating and testing system images is written in Ruby. Bundlerwould be another example of a nice Ruby application for managing gem dependencies.
还有Vagrant- 用于创建和测试系统映像的工具是用 Ruby 编写的。Bundler将是用于管理 gem 依赖项的优秀 Ruby 应用程序的另一个示例。
Metasploit frameworkis used for testing security issues and helps with penetration testing. It has been completlly rewritten in Ruby (previously written in Perl) in 2007.
Metasploit 框架用于测试安全问题并帮助进行渗透测试。它已于 2007 年完全用 Ruby(以前用 Perl 编写)重写。
A packaging tool fpmwhich simplifies process of creating packages (deb, rpm, gem, python modules, node packages, pear, ...) is also written in Ruby.
打包工具fpm也用 Ruby 编写,它简化了创建包(deb、rpm、gem、python 模块、node 包、pear 等)的过程。
Ruby is general scripting language (unlike php) which can be used for writing scripts. You can write simple text file parser with regular expression in very few lines without the need to google everything because the syntax is simple and easy to learn.
Ruby 是通用脚本语言(与 php 不同),可用于编写脚本。您可以在很少的行中使用正则表达式编写简单的文本文件解析器,而无需 google 一切,因为语法简单易学。
Ruby on Rails is definitely most popular and brought a lot attention to Ruby language (which is great) but there are many other applications and new ones will for sure emerge.
Ruby on Rails 绝对是最流行的,并为 Ruby 语言带来了很多关注(这很棒),但还有许多其他应用程序,并且肯定会出现新的应用程序。
回答by Sam DeFabbia-Kane
As others have said, general scripting. The reasonI prefer it for general scripting (over Python) is simple: inline regexes. Python's regex support is unfortunately awkward, and for scripting, regexes are usually pretty important.
正如其他人所说,通用脚本。的原因,我喜欢它一般脚本(Python的以上)很简单:内嵌正则表达式。不幸的是,Python 的正则表达式支持很笨拙,而且对于脚本而言,正则表达式通常非常重要。
I don't even think I have to mention why it beats Perl.
我什至认为我不必提及它为什么击败 Perl。
回答by Samuel Jaeschke
It can also be used for scripting both standalone (with an interpreter) and within many other programs. Google Sketchup(for 3D-modelling) comes to mind...
它也可以用于独立(使用解释器)和许多其他程序中的脚本。想到了Google Sketchup(用于 3D 建模)...
回答by statenjason
Scripting tasks.
脚本任务。
For example, I once used Ruby to scrape an entire website's content (hundreds of pages) into a comma separated file. Did it for migrating someone's static html website to a dynamic, database-driven one. Just bulk inserted the csv. Doing that by hand would've been impossible.
例如,我曾经使用 Ruby 将整个网站的内容(数百页)抓取到一个逗号分隔的文件中。这样做是为了将某人的静态 html 网站迁移到动态的、数据库驱动的网站。只是批量插入了csv。用手做那是不可能的。
回答by Kevin Dente
Shoes is a cross-platform GUI toolkit written in Ruby.
Shoes 是一个用 Ruby 编写的跨平台 GUI 工具包。
回答by stonemetal
It is used as a base for DSLs. It is perfect for this purpose since its grammar is so flexible. For instance there is a make replacement called Rake.
它用作 DSL 的基础。它非常适合此目的,因为它的语法非常灵活。例如,有一个叫做 Rake 的 make 替代品。

