Skip to content
Permalink
Browse files

Removed all the Lotus occurences, where possible

  • Loading branch information...
jodosha committed Jan 15, 2016
1 parent 45b9e32 commit d1b2897b217deb218efb62e50ab5a4eeec65874a
Showing with 468 additions and 17,712 deletions.
  1. +4 −4 config.rb
  2. +1 −1 source/CNAME
  3. +1 −1 source/_footer.erb
  4. +0 −24 source/_header.erb
  5. +9 −9 source/atom.xml.erb
  6. +1 −1 source/blog.html.erb
  7. +5 −5 source/community.html.erb
  8. +4 −4 source/guides/actions/basic-usage.md
  9. +2 −2 source/guides/actions/control-flow.md
  10. +4 −4 source/guides/actions/cookies.md
  11. +2 −2 source/guides/actions/exception-handling.md
  12. +2 −2 source/guides/actions/exposures.md
  13. +2 −2 source/guides/actions/http-caching.md
  14. +6 −6 source/guides/actions/mime-types.md
  15. +8 −8 source/guides/actions/overview.md
  16. +6 −6 source/guides/actions/parameters.md
  17. +4 −4 source/guides/actions/rack-integration.md
  18. +1 −1 source/guides/actions/request-and-response.md
  19. +4 −4 source/guides/actions/sessions.md
  20. +2 −2 source/guides/actions/share-code.md
  21. +8 −8 source/guides/actions/testing.md
  22. +2 −2 source/guides/applications/initializers.md
  23. +4 −4 source/guides/applications/rake.md
  24. +7 −7 source/guides/architectures/application.md
  25. +9 −9 source/guides/architectures/container.md
  26. +5 −5 source/guides/architectures/overview.md
  27. +3 −3 source/guides/assets/compressors.md
  28. +3 −3 source/guides/assets/content-delivery-network.md
  29. +24 −24 source/guides/assets/overview.md
  30. +4 −4 source/guides/assets/preprocessors.md
  31. +5 −5 source/guides/command-line/applications.md
  32. +5 −5 source/guides/command-line/assets.md
  33. +9 −9 source/guides/command-line/database.md
  34. +10 −10 source/guides/command-line/destroy.md
  35. +12 −12 source/guides/command-line/generators.md
  36. +2 −2 source/guides/command-line/routes.md
  37. +4 −4 source/guides/command-line/version.md.erb
  38. +66 −66 source/guides/getting-started.md
  39. +2 −2 source/guides/helpers/assets.md
  40. +4 −4 source/guides/helpers/custom-helpers.md
  41. +2 −2 source/guides/helpers/escape.md
  42. +6 −6 source/guides/helpers/forms.md
  43. +2 −2 source/guides/helpers/html5.md
  44. +1 −1 source/guides/helpers/links.md
  45. +2 −2 source/guides/helpers/numbers.md
  46. +10 −10 source/guides/helpers/overview.md
  47. +1 −1 source/guides/helpers/routing.md
  48. +17 −17 source/guides/index.md
  49. +4 −4 source/guides/mailers/basic-usage.md
  50. +6 −6 source/guides/mailers/delivery.md
  51. +4 −4 source/guides/mailers/overview.md
  52. +3 −3 source/guides/mailers/share-code.md
  53. +7 −7 source/guides/mailers/templates.md
  54. +4 −4 source/guides/mailers/testing.md
  55. +3 −3 source/guides/migrations/alter-table.md
  56. +1 −1 source/guides/migrations/create-table.md
  57. +7 −7 source/guides/migrations/overview.md
  58. +10 −10 source/guides/models/entities.md
  59. +12 −12 source/guides/models/overview.md
  60. +7 −7 source/guides/models/repositories.md
  61. +4 −4 source/guides/routing/basic-usage.md
  62. +10 −10 source/guides/routing/overview.md
  63. +2 −2 source/guides/routing/restful-resources.md
  64. +4 −4 source/guides/upgrade-notes/v060.md
  65. +2 −2 source/guides/views/basic-usage.md
  66. +2 −2 source/guides/views/custom-error-pages.md
  67. +4 −4 source/guides/views/layouts.md
  68. +3 −3 source/guides/views/mime-types.md
  69. +7 −7 source/guides/views/overview.md
  70. +2 −2 source/guides/views/share-code.md
  71. +4 −4 source/guides/views/templates.md
  72. +2 −2 source/guides/views/testing.md
  73. +4 −4 source/hackday.html.erb
  74. +2 −2 source/layouts/guides.erb
  75. +3 −3 source/layouts/home.erb
  76. +45 −20 source/layouts/layout.erb
  77. +3 −3 source/mailing-list.html.erb
  78. +0 −708 source/sass/_bootstrap-variables-not-in-use.scss
  79. +0 −63 source/sass/_bootstrap-variables.scss
  80. +0 −137 source/sass/_prism.scss
  81. +0 −54 source/sass/layouts/_emailsignup.scss
  82. +0 −81 source/sass/layouts/_footer.scss
  83. +0 −54 source/sass/layouts/_header.scss
  84. +0 −91 source/sass/layouts/_navigation.scss
  85. +0 −67 source/sass/layouts/_terminal.scss
  86. +0 −3,150 source/sass/modules/_animate.scss
  87. +0 −16 source/sass/modules/_buttons.scss
  88. +0 −3 source/sass/modules/_colors.scss
  89. +0 −60 source/sass/modules/_typography.scss
  90. +0 −4 source/sass/modules/_variables.scss
  91. +0 −19 source/sass/pages/_blog.scss
  92. +0 −50 source/sass/pages/_docs.scss
  93. +0 −190 source/sass/pages/_index.scss
  94. +0 −42 source/sass/pages/_shared-ui.scss
  95. +0 −59 source/sass/styles.css
  96. +0 −42 source/sass/styles.scss
  97. +0 −12,355 source/stylesheets/styles.css
@@ -57,7 +57,7 @@
deploy.branch = 'master'
end

set :url_root, 'http://lotusrb.org'
set :url_root, 'http://hanami.io'
activate :search_engine_sitemap

# Methods defined in the helpers block are available in templates
@@ -108,7 +108,7 @@ def article_image_url(article)
#

GUIDES_ROOT = 'source/guides'.freeze
GUIDES_EDIT_URL = 'https://github.com/lotus/lotus.github.io/edit/build/'.freeze
GUIDES_EDIT_URL = 'https://github.com/hanami/hanami.github.io/edit/build/'.freeze

def guides_navigation
result = ''
@@ -160,14 +160,14 @@ def absolute_url(page)
page
end

"http://lotusrb.org#{ url }"
"http://hanami.io#{ url }"
end

def encode_text(text)
::Rack::Utils.escape(text)
end

def lotus_version
def hanami_version
'0.6.0'
end
end
@@ -1 +1 @@
lotusrb.org
hanami.io
@@ -21,7 +21,7 @@
</div>
<div class="col-sm-2 m-b">
<ul class="list-unstyled list-spaced">
<a href="http://dnsimple.link/resolving-lotus" target="_blank">
<a href="http://dnsimple.link/resolving-hanami" target="_blank">
<span>Resolving with<br/></span>
<img src="https://cdn.dnsimple.com/assets/resolving-with-us/logo-dark.png" alt="DNSimple" style="display:block;margin:0;padding:0;width:100px;"/>
</a>

This file was deleted.

@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Lotus</title>
<subtitle>Lotus framework blog</subtitle>
<link href="http://lotusrb.org/atom.xml" rel="self"/>
<link href="http://lotusrb.org/blog"/>
<title>Hanami</title>
<subtitle>Hanami web framework blog</subtitle>
<link href="http://hanami.io/atom.xml" rel="self"/>
<link href="http://hanami.io/blog"/>
<updated><%= blog.articles.first.date.to_time.iso8601 %></updated>
<id>http://lotusrb.org/blog</id>
<id>http://hanami.io/blog</id>
<author>
<name>Lotus</name>
<email>admin@lotusrb.org</email>
<name>Hanami</name>
<email>admin@hanami.io</email>
</author>

<% articles(10).each do |article| %>
<entry>
<title><%= article_title(article) %></title>
<id>http://lotusrb.org<%= article.url %></id>
<link rel="alternate" href="http://lotusrb.org<%= article.url %>"/>
<id>http://hanami.io<%= article.url %></id>
<link rel="alternate" href="http://hanami.io<%= article.url %>"/>
<updated><%= article.date.to_time.iso8601 %></updated>
<author>
<name><%= article_author(article) %></name>
@@ -1,5 +1,5 @@
---
title: Lotus - Blog
title: Hanami | Blog
---
<section class="blog wrapper animated fadeIn">
<div class="container-fluid">
@@ -1,8 +1,8 @@
---
title: Lotus - Community
title: Hanami | Community
---

<h1 class="page-header">Lotus Community</h1>
<h1 class="page-header">Hanami Community</h1>
<p class="lead">We strive for a Community made of <strong>inclusive, helpful and smart people</strong>. We have a <a href="#code-of-conduct">Code of Conduct</a> to handle controversial cases. In general, we expect <strong>you</strong> to <strong>be nice</strong> with other people.<br>Our hope is for a great software and a great Community.</p>

<a name="code-of-conduct"></a>
@@ -21,10 +21,10 @@ when an individual is representing the project or its community.</p>


<h2>Support</h2>
<p>If you need support for Lotus, please don't hesitate to ask, we're really happy to help. We have a <a href="http://chat.lotusrb.org" target="_blank">chat</a>, a <a href="https://discuss.lotusrb.org" target="_blank">forum</a> and a <a href="http://stackoverflow.com/questions/tagged/lotus-ruby" target="_blank">StackOverflow tag</a>.</p>
<p>If you need support for Hanami, please don't hesitate to ask, we're really happy to help. We have a <a href="http://chat.hanami.io" target="_blank">chat</a>, a <a href="https://discuss.hanami.io" target="_blank">forum</a> and a <a href="http://stackoverflow.com/questions/tagged/hanami" target="_blank">StackOverflow tag</a>.</p>

<h2>Twitter</h2>
<p>We have an official account <a href="https://twitter.com/lotus_rb" target="_blank">(@lotus_rb)</a> and a hashtag: <a href="https://twitter.com/search?q=lotusrb" target="_blank">#lotusrb</a>.
<p>We have an official account <a href="https://twitter.com/hanamirb" target="_blank">(@hanamirb)</a> and a hashtag: <a href="https://twitter.com/search?q=hanamirb" target="_blank">#hanamirb</a>.

<h2>Mailing List</h2>
<p>To stay updated with the latest releases, to receive code examples, implementation details and announcements, please consider to subscribe to the <a href="/mailing-list">Lotus mailing list</a>.</p>
<p>To stay updated with the latest releases, to receive code examples, implementation details and announcements, please consider to subscribe to the <a href="/mailing-list">Hanami mailing list</a>.</p>
@@ -1,5 +1,5 @@
---
title: Lotus - Guides - Actions Basic Usage
title: Hanami | Guides - Actions Basic Usage
---

# Basic Usage
@@ -24,7 +24,7 @@ Then we edit the corresponding template:
<h1>Dashboard</h1>
```

Here is how Lotus handles an incoming request:
Here is how Hanami handles an incoming request:

1. The router creates a new instance of `Web::Controllers::Dashboard::Index` and invokes `#call`.
2. The application creates a new instance of `Web::Views::Dashboard::Index` and invokes `#render`.
@@ -60,7 +60,7 @@ module Web::Controllers::Dashboard
end
```

Here how Lotus handles an incoming request in this case:
Here how Hanami handles an incoming request in this case:

1. The router creates a new instance of `Web::Controllers::Dashboard::Index` and invokes `#call`.
2. The application detects that a body is already set and doesn't instantiate the view.
@@ -76,7 +76,7 @@ With direct body assignment, **we can safely delete the corresponding view and t

## Initialization

Actions are instantiated for us by Lotus at the runtime: for each incoming request, we'll automatically get a new instance.
Actions are instantiated for us by Hanami at the runtime: for each incoming request, we'll automatically get a new instance.
Because actions are objects, **we can take control on their initialization** and eventually [_inject_ our dependencies](http://en.wikipedia.org/wiki/Dependency_injection).
This is a really useful technique for unit testing our actions.

@@ -1,5 +1,5 @@
---
title: Lotus - Guides - Action Control Flow
title: Hanami | Guides - Action Control Flow
---

# Control Flow
@@ -104,7 +104,7 @@ This is an antipattern that causes a lot of problems for code maintenance, testa
Using exceptions for control flow is expensive for the Ruby VM.
There is a lightweight alternative that our language supports: **signals** (see `throw` and `catch`).

Lotus takes advantage of this mechanism to provide **faster control flow** in our actions via `#halt`.
Hanami takes advantage of this mechanism to provide **faster control flow** in our actions via `#halt`.

```ruby
# apps/web/controllers/dashboard/index.rb
@@ -1,20 +1,20 @@
---
title: Lotus - Guides - Action Cookies
title: Hanami | Guides - Action Cookies
---

# Cookies

## Enable Cookies

Lotus applies _"batteries included, but not installed"_ philosophy.
Hanami applies _"batteries included, but not installed"_ philosophy.
Cookies are a feature that is present but needs to be activated.

In our application settings there is a line to uncomment.

```ruby
# apps/web/application.rb
module Web
class Application < Lotus::Application
class Application < Hanami::Application
configure do
# ...
cookies true
@@ -62,7 +62,7 @@ General settings are applied automatically but these options can be used to over
```ruby
# apps/web/application.rb
module Web
class Application < Lotus::Application
class Application < Hanami::Application
configure do
# ...
cookies max_age: 300 # 5 minutes
@@ -1,11 +1,11 @@
---
title: Lotus - Guides - Action Exception Handling
title: Hanami | Guides - Action Exception Handling
---

# Exception Handling

Actions have an elegant API for exception handling.
The behavior changes according to the current Lotus environment and the custom settings in our configuration.
The behavior changes according to the current Hanami environment and the custom settings in our configuration.

## Default Behavior

@@ -1,11 +1,11 @@
---
title: Lotus - Guides - Action Exposures
title: Hanami - Guides - Action Exposures
---

# Exposures

For complex use cases we may want to pass data to views in order to present it to our users.
Lotus puts emphasis on explicitness: data isn't shared between the controller action and the view unless we tell it to do so.
Hanami puts emphasis on explicitness: data isn't shared between the controller action and the view unless we tell it to do so.

We use a simple and powerful mechanism to achieve our goal: _**exposures**_.
Exposures create a _getter_ on the action for the given name(s) and only the whitelisted instance variables are made available to the corresponding view.
@@ -1,5 +1,5 @@
---
title: Lotus - Guides - Action HTTP Caching
title: Hanami | Guides - Action HTTP Caching
---

# HTTP Caching
@@ -33,7 +33,7 @@ end
Another HTTP caching special header is `Expires`.
It can be used for retrocompatibility with old browsers which don't understand `Cache-Control`.

Lotus' solution for _expire_ combines support for all the browsers by sending both the headers.
Hanami's solution for _expire_ combines support for all the browsers by sending both the headers.

```ruby
# apps/web/controllers/dashboard/index.rb
@@ -1,5 +1,5 @@
---
title: Lotus - Guides - Action MIME Types
title: Hanami | Guides - Action MIME Types
---

# MIME Types
@@ -43,7 +43,7 @@ This is a setting that allows us to safely handle cases like our example; the de
# apps/web/application.rb
module Web
class Application < Lotus::Application
class Application < Hanami::Application
configure do
# ...
default_request_format :json
@@ -61,7 +61,7 @@ The default value is `:html`.
# apps/web/application.rb
module Web
class Application < Lotus::Application
class Application < Hanami::Application
configure do
# ...
default_response_format :json
@@ -79,7 +79,7 @@ The standard value is `utf-8`, but we can change it in our settings.
# apps/web/application.rb
module Web
class Application < Lotus::Application
class Application < Hanami::Application
configure do
# ...
default_charset 'koi8-r'
@@ -132,7 +132,7 @@ end

## Register MIME Types

Lotus knows about more than 100 of the most common MIME types.
Hanami knows about more than 100 of the most common MIME types.
However, we may want to add custom types in order to use them with `#format=` or `.accept`.

In our application settings we can use `controller.format`, which accepts a Hash where the key is the format symbol (`:custom`) and the value is a string expressed in the MIME type standard (`application/custom`).
@@ -141,7 +141,7 @@ In our application settings we can use `controller.format`, which accepts a Hash
# apps/web/application.rb
module Web
class Application < Lotus::Application
class Application < Hanami::Application
configure do
# ...
controller.format custom: 'application/custom'
@@ -1,21 +1,21 @@
---
title: Lotus - Guides - Actions Overview
title: Hanami | Guides - Actions Overview
---

# Overview

An action is an endpoint that handles incoming HTTP requests for a specific [route](/guides/routing/overview).
In a Lotus application, an **action is an object**, while a **controller is a Ruby module** that groups them.
In a Hanami application, an **action is an object**, while a **controller is a Ruby module** that groups them.

This design provides self contained actions that don't share their context accidentally with other actions. It also prevents gigantic controllers.
It has several advantages in terms of testability and control of an action.

## A Simple Action

Lotus ships with a generator for actions. Let's create a new one:
Hanami ships with a generator for actions. Let's create a new one:

```shell
lotus generate action web dashboard#index
hanami generate action web dashboard#index
```

Let's examine the action:
@@ -37,7 +37,7 @@ end
That file begins with a module declaration.

The first token is the name of our application: `Web`.
Lotus can run multiple applications within the same Ruby process.
Hanami can run multiple applications within the same Ruby process.
They are located under `apps/`.
Their name is used as a **top-level module to contain inner components** like actions and views, in order to **avoid naming collisions**.
If we have another action `Home::Index` under an application `Admin`, the two of them can coexist inside the same codebase.
@@ -56,10 +56,10 @@ The whole action name is `Web::Controllers::Dashboard::Index`.

### Action Module

Lotus philosophy emphasizes _composition over inheritance_ and avoids the [framework superclass antipattern](http://michaelfeathers.typepad.com/michael_feathers_blog/2013/01/the-framework-superclass-anti-pattern.html).
Hanami philosophy emphasizes _composition over inheritance_ and avoids the [framework superclass antipattern](http://michaelfeathers.typepad.com/michael_feathers_blog/2013/01/the-framework-superclass-anti-pattern.html).
For this reason, all the components are provided as **modules to include** instead of base classes to inherit from.

Like we said before, Lotus can run multiple apps within the same Ruby process.
Like we said before, Hanami can run multiple apps within the same Ruby process.
Each of them has its own configuration.
To keep separated actions from an application named `Web` and an application named `Admin`, we include `Web::Action` and `Admin::Action` respectively.

@@ -72,7 +72,7 @@ That means our action will behave according to the configuration of the `Web` ap

### Interface

When we include `Web::Action`, we made our object compliant with [Lotus::Controller](https://github.com/lotus/controller)'s actions.
When we include `Web::Action`, we made our object compliant with [Hanami::Controller](https://github.com/hanami/controller)'s actions.
We need to implement `#call`, which is a method that accepts only one argument: `params`.
That is the object that carries the payload that comes from incoming HTTP requests from the [router](/guides/routing/basic-usage).

0 comments on commit d1b2897

Please sign in to comment.
You can’t perform that action at this time.