Misplaced Pages

Merb

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

Merb is a discontinued model–view–controller web framework in Ruby , notable as a precursor to Rails 3. It brought increased focus on speed and modularity to Rails 3. The name Merb is a contraction of " Mongrel " and " Erb ".

#692307

61-502: Merb began as a "clean-room" implementation of the Rails controller stack but grew to incorporate several ideas that deviated from Rails's spirit and methodology at the time, most notably component modularity , extensible API design, and vertical scalability . It was developed by Ezra Zygmuntowicz and Yehuda Katz. Most of these capabilities were added to Rails during the Rails 3/Merb merger. Merb

122-500: A Java virtual machine (JVM). Scala can also be transpiled to JavaScript to run in a browser, or compiled directly to a native executable. When running on the JVM, Scala provides language interoperability with Java so that libraries written in either language may be referenced directly in Scala or Java code. Like Java, Scala is object-oriented , and uses a syntax termed curly-brace which

183-451: A model in the Ruby on Rails framework maps to a table in a database and to a Ruby file. For example, a model class User will usually be defined in the file 'user.rb' in the app/models directory, and linked to the table 'users' in the database. While developers are free to ignore this convention and choose differing names for their models, files, and database table, this is not common practice and

244-542: A $ 3 million investment in 2011 from Greylock Partners . Scala runs on the Java platform ( Java virtual machine ) and is compatible with existing Java programs. As Android applications are typically written in Java and translated from Java bytecode into Dalvik bytecode (which may be further translated to native machine code during installation) when packaged, Scala's Java compatibility makes it well-suited to Android development,

305-455: A basic website . Also included are WEBrick , a simple Ruby web server that is distributed with Ruby, and Rake , a build system, distributed as a gem . Together with Ruby on Rails, these tools provide a basic development environment. Ruby on Rails is most commonly not connected to the Internet directly, but through some front-end web server . Mongrel was generally preferred over WEBrick in

366-403: A controller implementing a flight-search function would need to query a model representing individual flights to find flights matching the search, and might also need to query models representing airports and airlines to find related secondary data. The controller might then pass some subset of the flight data to the corresponding view, which would contain a mixture of static HTML and logic that use

427-441: A default online rich-text editor , parallel testing, multiple database support, mailer routing and a new autoloader. Rails 6.1 was released on 9 December 2020, adding per-database connection switching, horizontal database sharding , eager loading of all associations, Delegated Types as an alternative to single-table inheritance, asynchronous deletion of associations, error objects, and other improvements and bug fixes. Rails 7.0

488-443: A map returns a set of key-value tuples , and pattern-matching allows the tuples to easily be destructured into separate variables for the key and value. Similarly, the result of the comprehension also returns key-value tuples, which are automatically built back up into a map because the source object (from the variable mentions ) is a map. Note that if mentions instead held a list, set, array or other collection of tuples, exactly

549-686: A more powerful version of Java's checked exceptions . The name Scala is a portmanteau of scalable and language , signifying that it is designed to grow with the demands of its users. The design of Scala started in 2001 at the École Polytechnique Fédérale de Lausanne (EPFL) (in Lausanne , Switzerland ) by Martin Odersky . It followed on from work on Funnel, a programming language combining ideas from functional programming and Petri nets . Odersky formerly worked on Generic Java , and javac , Sun's Java compiler. After an internal release in late 2003, Scala

610-409: A new collection to be generated by iterating over an existing one, returning a new collection of the same type. They are translated by the compiler into a series of map , flatMap and filter calls. Where yield is not used, the code approximates to an imperative-style loop, by translating to foreach . A simple example is: The result of running it is the following vector: (Note that

671-404: A polite protest in the Ruby on Rails community. In response to this criticism, Hansson replied: I only grant promotional use [of the Rails logo] for products I'm directly involved with. Such as books that I've been part of the development process for or conferences where I have a say in the execution. I would most definitely seek to enforce all the trademarks of Rails. The trademark of the logo

SECTION 10

#1732884296693

732-574: A value, are in Scala considered to return the type Unit , which is a singleton type , with only one object of that type. Functions and operators that never return at all (e.g. the throw operator or a function that always exits non-locally using an exception) logically have return type Nothing , a special type containing no objects; that is, a bottom type , i.e. a subclass of every possible type. (This in turn makes type Nothing compatible with every type, allowing type inference to function correctly.) Similarly, an if-then-else "statement"

793-499: Is actually an expression, which produces a value, i.e. the result of evaluating one of the two branches. This means that such a block of code can be inserted wherever an expression is desired, obviating the need for a ternary operator in Scala: For similar reasons, return statements are unnecessary in Scala, and in fact are discouraged. As in Lisp , the last expression in a block of code

854-461: Is completely transparent to the user. Scala 2.10 allows for new value types to be defined by the user. Instead of the Java " foreach " loops for looping through an iterator, Scala has for -expressions, which are similar to list comprehensions in languages such as Haskell , or a combination of list comprehensions and generator expressions in Python . For-expressions using the yield keyword allow

915-453: Is intended to emphasize Convention over Configuration (CoC), and the Don't Repeat Yourself (DRY) principle. The Rails Doctrine is an enduring enabler that guides the philosophy, design, and implementation of the Ruby on Rails framework. "Convention over Configuration" means a developer only needs to specify unconventional aspects of the application. For example, if there is a class Sale in

976-513: Is less than 2. It is equivalent to the Lisp form (lambda (x) (< x 2)) . Note that neither the type of x nor the return type need be explicitly specified, and can generally be inferred by type inference ; but they can be explicitly specified, e.g. as (x: Int) => x < 2 or even (x: Int) => (x < 2): Boolean . Anonymous functions behave as true closures in that they automatically capture any variables that are lexically available in

1037-494: Is nearly identical to that generated by the Java compiler. In fact, Scala code can be decompiled to readable Java code, with the exception of certain constructor operations. To the Java virtual machine (JVM), Scala code and Java code are indistinguishable. The only difference is one extra runtime library, scala-library.jar . Scala adds a large number of features compared with Java, and has some fundamental differences in its underlying model of expressions and types, which make

1098-412: Is no class declaration and nothing is declared to be static. When the program is stored in file HelloWorld.scala , the user compiles it with the command: and runs it with This is analogous to the process for compiling and running Java code. Indeed, Scala's compiling and executing model is identical to that of Java, making it compatible with Java build tools such as Apache Ant . A shorter version of

1159-491: Is often installed using RubyGems , a package manager which is included with current versions of Ruby. Many free Unix-like systems also support installation of Ruby on Rails and its dependencies through their native package management system . Ruby on Rails is typically deployed with a database server such as MySQL or PostgreSQL , and a web server such as Apache running the Phusion Passenger module. Ruby on Rails

1220-806: Is similar to the language C . Since Scala 3, there is also an option to use the off-side rule (indenting) to structure blocks , and its use is advised. Martin Odersky has said that this turned out to be the most productive change introduced in Scala 3. Unlike Java, Scala has many features of functional programming languages (like Scheme , Standard ML , and Haskell ), including currying , immutability , lazy evaluation , and pattern matching . It also has an advanced type system supporting algebraic data types , covariance and contravariance , higher-order types (but not higher-rank types ), anonymous types , operator overloading , optional parameters , named parameters , raw strings , and an experimental exception-only version of algebraic effects that can be seen as

1281-438: Is that certain types still need to be declared (most notably, function parameters, and the return types of recursive functions ), e.g. or (with a return type declared for a recursive function) In Scala, functions are objects, and a convenient syntax exists for specifying anonymous functions . An example is the expression x => x < 2 , which specifies a function with one parameter, that compares its argument to see if it

SECTION 20

#1732884296693

1342-499: Is the facility for RESTful web services. Rails 3.1 introduced Sass as standard CSS templating. By default, the server uses Embedded Ruby in the HTML views, with files having an html.erb extension. Rails supports swapping-in alternative templating languages, such as HAML and Mustache . Ruby on Rails 3.0 has been designed to work with Ruby 1.8.7, Ruby 1.9.2, and JRuby 1.5.2+; earlier versions are not supported. Ruby on Rails 3.2

1403-656: Is the last series of releases that support Ruby 1.8.7. Ruby on Rails is separated into various packages, namely ActiveRecord (an object-relational mapping system for database access), Action Pack, Active Support and Action Mailer. Prior to version 2.0, Ruby on Rails also included the Action Web Service package that is now replaced by Active Resource. Apart from standard packages, developers can make plugins to extend existing packages. Earlier Rails supported plugins within their own custom framework; version 3.2 deprecates these in favor of standard Ruby "gems". Ruby on Rails

1464-454: Is the value of that block of code, and if the block of code is the body of a function, it will be returned by the function. To make it clear that all functions are expressions, even methods that return Unit are written with an equals sign or equivalently (with type inference, and omitting the unnecessary newline): Due to type inference , the type of variables, function return values, and many other expressions can typically be omitted, as

1525-413: Is usually discouraged in accordance with the " convention-over-configuration " philosophy. A controller is a server-side component of Rails that responds to external requests from the web server to the application, by determining which view file to render. The controller may also have to query one or more models for information and pass these on to the view. For example, in an airline reservation system,

1586-540: The ActiveRecord module of Rails, the developer does not need to specify database column names in class definitions. Instead, Ruby on Rails can retrieve this information from the database based on the class name. "Fat models, skinny controllers" means that most of the application logic should be placed within the model while leaving the controller as light as possible. HTML Over The Wire (Hotwire), Conceptual compression, and robust security mark Rails 7.0's approach to

1647-581: The JavaScript libraries Prototype and Script.aculo.us for scripting Ajax actions. Ruby on Rails 3.0 separates the markup of the page (which defines the structure of the page) from scripting (which determines functionality or logic of the page). As of version 7.0, new Ruby on Rails applications come with the Hotwire family of JavaScript libraries installed by default. Since version 2.0, Ruby on Rails offers both HTML and XML as standard output formats. The latter

1708-535: The "Hello World" Scala program is: Scala includes an interactive shell and scripting support. Saved in a file named HelloWorld2.scala , this can be run as a script using the command: Commands can also be entered directly into the Scala interpreter, using the option -e : Expressions can be entered interactively in the REPL : The following example shows the differences between Java and Scala syntax. The function mathFunction takes an integer, squares it, and then adds

1769-464: The JVM by eliminating the initial runtime compilation of code and also providing the ability to call native routines directly. A reference Scala compiler targeting the .NET Framework and its Common Language Runtime was released in June 2004, but was officially dropped in 2012. The Hello World program written in Scala 3 has this form: Unlike the stand-alone Hello World application for Java , there

1830-565: The One person framework. In March 2007, David Heinemeier Hansson applied to register three Ruby on Rails-related trademarks with the USPTO . These applications concern the phrase "RUBY ON RAILS", the word "RAILS", and the official Rails logo. In the summer of 2007, Hansson denied the publisher Apress permission to use the Ruby on Rails logo on the cover of a new Ruby on Rails book written by some authoritative community members. The episode gave rise to

1891-510: The Rails 3 / Merb merge, Rails gained a defined public API with a test suite, giving users and plugin developers a clearer, more stable API to build against, reducing plugin breakage from release to release. Some early versions of Rails received bad publicity for lack of performance, frequently due to developer confusion about ActiveRecord queries. David Heinemeier Hansson , the creator of Rails, stated that Merb re-wrote many core Rails pieces to be faster, and incorporated those changes from Merb in

Merb - Misplaced Pages Continue

1952-590: The Rails 3 merge, promising users that "Rails 3 will get all the performance attention that the Merb guys are known for". Ruby on Rails Ruby on Rails (simplified as Rails ) is a server-side web application framework written in Ruby under the MIT License . Rails is a model–view–controller (MVC) framework, providing default structures for a database , a web service , and web pages . It encourages and facilitates

2013-467: The compiler can deduce it. Examples are val x = "foo" (for an immutable constant or immutable object ) or var x = 1.5 (for a variable whose value can later be changed). Type inference in Scala is essentially local, in contrast to the more global Hindley-Milner algorithm used in Haskell, ML and other more purely functional languages. This is done to facilitate object-oriented programming. The result

2074-451: The cube root of that number to the natural log of that number, returning the result (i.e., n 2 / 3 + ln ⁡ ( n 2 ) {\displaystyle n^{2/3}+\ln(n^{2})} ): Some syntactic differences in this code are: These syntactic relaxations are designed to allow support for domain-specific languages . Some other basic syntactic differences: The following example contrasts

2135-410: The definition of classes in Java and Scala. The code above shows some of the conceptual differences between Java and Scala's handling of classes: Scala has the same compiling model as Java and C# , namely separate compiling and dynamic class loading , so that Scala code can call Java libraries. Scala's operational characteristics are the same as Java's. The Scala compiler generates byte code that

2196-404: The early days, but it can also run on Lighttpd , Apache , Cherokee , Hiawatha , Nginx (either as a module – Phusion Passenger for example – or via CGI , FastCGI or mod ruby ), and many others. From 2008 onward, Passenger replaced Mongrel as the most-used web server for Ruby on Rails. Ruby is also supported natively on IBM i . Ruby on Rails is also noteworthy for its extensive use of

2257-422: The expression 1 to 25 is not special syntax. The method to is rather defined in the standard Scala library as an extension method on integers, using a technique known as implicit conversions that allows new methods to be added to existing types.) A more complex example of iterating over a map is: Expression (mention, times) <- mentions is an example of pattern matching (see below). Iterating over

2318-615: The flight data to create an HTML document containing a table with one row per flight. A controller may provide one or more actions. In Ruby on Rails, an action is typically a basic unit that describes how to respond to a specific external web-browser request. Also, note that the controller/action will be accessible for external web requests only if a corresponding route is mapped to it. Rails encourages developers to use RESTful routes, which include actions such as create, new, edit, update, destroy, show, and index. These mappings of incoming requests/routes to controller actions can be easily set up in

2379-534: The form_tag/form_for helpers. Rails 5.2 was released on 9 April 2018, introducing new features that include ActiveStorage, built-in Redis Cache Store, updated Rails Credentials and a new DSL that allows for configuring a Content Security Policy for an application. Rails 5.2.2 was released on 4 December 2018, introducing numerous bug fixes and several logic improvements. Rails 6.0 was released on 16 August 2019, making Webpack default, adding mailbox routing,

2440-454: The inheritance scheme, deriving from java.lang.Object . In Scala, all types inherit from a top-level class Any , whose immediate children are AnyVal (value types, such as Int and Boolean ) and AnyRef (reference types, as in Java). This means that the Java distinction between primitive types and boxed types (e.g. int vs. Integer ) is not present in Scala; boxing and unboxing

2501-460: The language theoretically cleaner and eliminate several corner cases in Java. From the Scala perspective, this is practically important because several added features in Scala are also available in C#. As mentioned above, Scala has a good deal of syntactic flexibility, compared with Java. The following are some examples: By themselves, these may seem like questionable choices, but collectively they serve

Merb - Misplaced Pages Continue

2562-422: The model, the corresponding table in the database is called sales by default. It is only if one deviates from this convention, such as calling the table "products sold", that the developer needs to write code regarding these names. Generally, Ruby on Rails conventions lead to less code and less repetition. "Don't repeat yourself" means that information is located in a single, unambiguous place. For example, using

2623-487: The more so when a functional approach is preferred. The reference Scala software distribution, including compiler and libraries, is released under the Apache license . Scala.js is a Scala compiler that compiles to JavaScript, making it possible to write Scala programs that can run in web browsers or Node.js . The compiler, in development since 2013, was announced as no longer experimental in 2015 (v0.6). Version v1.0.0-M1

2684-508: The project management tool Basecamp at the web application company 37signals . Hansson first released Rails as open source in July 2004, but did not share commit rights to the project until February 2005. In August 2006, the framework reached a milestone when Apple announced that it would ship Ruby on Rails with Mac OS X v10.5 "Leopard" , which was released in October 2007. Rails version 2.3

2745-458: The purpose of allowing domain-specific languages to be defined in Scala without needing to extend the compiler. For example, Erlang 's special syntax for sending a message to an actor, i.e. actor ! message can be (and is) implemented in a Scala library without needing language extensions. Java makes a sharp distinction between primitive types (e.g. int and boolean ) and reference types (any class ). Only reference types are part of

2806-411: The routes.rb configuration file. A view in the default configuration of Rails is an erb file, which is evaluated and converted to HTML at run-time. Alternatively, many other templating systems can be used for views. Ruby on Rails includes tools that make common development tasks easier "out-of-the-box", such as scaffolding that can automatically construct some of the models and views needed for

2867-815: The same code above would yield a new collection of the same type. While supporting all of the object-oriented features available in Java (and in fact, augmenting them in various ways), Scala also provides a large number of capabilities that are normally found only in functional programming languages. Together, these features allow Scala programs to be written in an almost completely functional style and also allow functional and object-oriented styles to be mixed. Examples are: Unlike C or Java , but similar to languages such as Lisp , Scala makes no distinction between statements and expressions . All statements are in fact expressions that evaluate to some value. Functions that would be declared as returning void in C or Java, and statements like while that logically do not return

2928-507: The stack. Rails 3.2 was released on 20 January 2012 with a faster development mode and routing engine (also known as Journey engine), Automatic Query Explain and Tagged Logging. Rails 3.2.x is the last version that supports Ruby 1.8.7. Rails 3.2.12 supports Ruby 2.0. Rails 4.0 was released on 25 June 2013, introducing Russian Doll Caching, Turbolinks , Live Streaming as well as making Active Resource, Active Record Observer and other components optional by splitting them as gems. Rails 4.1

2989-1381: The use of web standards such as JSON or XML for data transfer and HTML , CSS and JavaScript for user interfacing. In addition to MVC, Rails emphasizes the use of other well-known software engineering patterns and paradigms, including convention over configuration (CoC), don't repeat yourself (DRY), and the active record pattern . Ruby on Rails' emergence in 2005 greatly influenced web app development, through innovative features such as seamless database table creations, migrations , and scaffolding of views to enable rapid application development. Ruby on Rails' influence on other web frameworks remains apparent today, with many frameworks in other languages borrowing its ideas, including Django in Python ; Catalyst in Perl ; Laravel , CakePHP and Yii in PHP ; Grails in Groovy ; Phoenix in Elixir ; Play in Scala ; and Sails.js in Node.js . Well-known sites that use Ruby on Rails include Airbnb , Crunchbase , Dribbble , GitHub , Twitch and Shopify . David Heinemeier Hansson extracted Ruby on Rails from his work on

3050-435: The web server interface, the model layer, the view layer, and controller extensions and add-ons. Merb's default application stack incorporated Datamapper for models, ERB for views, and Rack and Mongrel as the web server layer. Before the Merb / Rails 3 merge, Rails lacked a well-defined, documented, public API for extensions and plug-ins, leading to issues when Rails changes broke monkey-patches performed by plug-ins. With

3111-466: Was cancelled on 25 October 2019. Scala (programming language) Scala ( / ˈ s k ɑː l ɑː / SKAH -lah ) is a strong statically typed high-level general-purpose programming language that supports both object-oriented programming and functional programming . Designed to be concise, many of Scala's design decisions are intended to address criticisms of Java . Scala source code can be compiled to Java bytecode and run on

SECTION 50

#1732884296693

3172-477: Was first released at the 2008 RubyConf and development has since stopped; Rails 3, therefore, serves as both the successor to Rails 2 and the successor to Merb. Merb's design attempted to address several criticisms of Rails 2: Merb itself encompassed only the controller layer in MVC architecture, and used a suite of complementary, optional plugins together to assemble applications. The primary integration points were

3233-412: Was instituted in October 2024. Ruby on Rails evolves radically from release to release exploring the use of new technologies and adopting new standards on the Internet. Some features are very stable in Ruby on Rails while some are replaced in favour of new techniques. The model–view–controller (MVC) pattern is the fundamental structure to organize application programming. In a default configuration,

3294-457: Was launched, and Ruby on Rails announced it would work with the Merb project to bring "the best ideas of Merb" into Rails 3, ending the "unnecessary duplication" across both communities. Merb was merged with Rails as part of the Rails 3.0 release. Rails 3.1 was released on 31 August 2011, featuring Reversible Database Migrations, Asset Pipeline, Streaming, jQuery as default JavaScript library and newly introduced CoffeeScript and Sass into

3355-595: Was released in June 2018 and version 1.1.1 in September 2020. Scala Native is a Scala compiler that targets the LLVM compiler infrastructure to create executable code that uses a lightweight managed runtime, which uses the Boehm garbage collector . The project is led by Denys Shabalin and had its first release, 0.1, on 14 March 2017. Development of Scala Native began in 2015 with a goal of being faster than just-in-time compilation for

3416-493: Was released on 15 December 2021, replacing Node.js and Webpack with import maps for JavaScript management by default, replacing Turbolinks with a combination of Turbo and Stimulus, adding at-work encryption into Active Record, using Zeitwerk exclusively for code loading, and more. Rails 7.1 was released on 5 October 2023, Dockerfiles support using Kamal in order to deploy your application, authentication improvements, and now including support for bun . Ruby on Rails 8.0.0

3477-514: Was released on 15 March 2009, with major new developments in templates, engines, Rack and nested model forms. Templates enable the developer to generate a skeleton application with custom gems and configurations. Engines give developers the ability to reuse application pieces complete with routes, view paths and models. The Rack web server interface and Metal allow one to write optimized pieces of code that route around Action Controller. On 23 December 2008, Merb , another web application framework,

3538-415: Was released on 27 April 2017, introducing JavaScript integration changes (management of JavaScript dependencies from NPM via Yarn, optional compilation of JavaScript using Webpack , and a rewrite of Rails UJS to use vanilla JavaScript instead of depending on jQuery), system tests using Capybara , encrypted secrets, parameterized mailers, direct & resolved routes, and a unified form_with helper replacing

3599-488: Was released on 8 April 2014, introducing Spring, Variants, Enums, Mailer previews, and secrets.yml. Rails 4.2 was released on 19 December 2014, introducing Active Job, asynchronous emails, Adequate Record, Web Console, and foreign keys . Rails 5.0 was released on 30 June 2016, introducing Action Cable, API mode, and Turbolinks 5. Rails 5.0.0.1 was released on 10 August 2016, with Exclusive use of rails CLI over Rake and support for Ruby version 2.2.2 and above. Rails 5.1

3660-402: Was released on 8 November 2024. This major release introduces fundamental shifts in Rails development, enabling individual developers to host and manage their applications independently without the need for a Platform-as-a-service . The update focuses on empowering single developers to handle all aspects of application deployment and management seamlessly. A revised maintenance policy

3721-547: Was released publicly in early 2004 on the Java platform , A second version (v2.0) followed in March 2006. On 17 January 2011, the Scala team won a five-year research grant of over €2.3 million from the European Research Council . On 12 May 2011, Odersky and collaborators launched Typesafe Inc. (later renamed Lightbend Inc. ), a company to provide commercial support, training, and services for Scala. Typesafe received

SECTION 60

#1732884296693
#692307