hanami 0.0.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +214 -0
- data/FEATURES.md +156 -0
- data/LICENSE.md +22 -0
- data/README.md +80 -15
- data/bin/hanami +5 -0
- data/hanami.gemspec +27 -12
- data/lib/hanami.rb +78 -2
- data/lib/hanami/action/csrf_protection.rb +167 -0
- data/lib/hanami/action/routing_helpers.rb +40 -0
- data/lib/hanami/application.rb +244 -0
- data/lib/hanami/application_name.rb +101 -0
- data/lib/hanami/cli.rb +119 -0
- data/lib/hanami/cli_sub_commands/assets.rb +29 -0
- data/lib/hanami/cli_sub_commands/db.rb +124 -0
- data/lib/hanami/cli_sub_commands/destroy.rb +102 -0
- data/lib/hanami/cli_sub_commands/generate.rb +127 -0
- data/lib/hanami/commands/assets/precompile.rb +35 -0
- data/lib/hanami/commands/console.rb +90 -0
- data/lib/hanami/commands/db/abstract.rb +19 -0
- data/lib/hanami/commands/db/apply.rb +14 -0
- data/lib/hanami/commands/db/console.rb +50 -0
- data/lib/hanami/commands/db/create.rb +14 -0
- data/lib/hanami/commands/db/drop.rb +14 -0
- data/lib/hanami/commands/db/migrate.rb +19 -0
- data/lib/hanami/commands/db/prepare.rb +14 -0
- data/lib/hanami/commands/db/version.rb +14 -0
- data/lib/hanami/commands/generate/abstract.rb +63 -0
- data/lib/hanami/commands/generate/action.rb +262 -0
- data/lib/hanami/commands/generate/app.rb +116 -0
- data/lib/hanami/commands/generate/mailer.rb +118 -0
- data/lib/hanami/commands/generate/migration.rb +63 -0
- data/lib/hanami/commands/generate/model.rb +96 -0
- data/lib/hanami/commands/new/abstract.rb +128 -0
- data/lib/hanami/commands/new/app.rb +116 -0
- data/lib/hanami/commands/new/container.rb +102 -0
- data/lib/hanami/commands/routes.rb +41 -0
- data/lib/hanami/commands/server.rb +79 -0
- data/lib/hanami/config/configure.rb +17 -0
- data/lib/hanami/config/cookies.rb +68 -0
- data/lib/hanami/config/framework_configuration.rb +42 -0
- data/lib/hanami/config/load_paths.rb +27 -0
- data/lib/hanami/config/mapper.rb +36 -0
- data/lib/hanami/config/mapping.rb +12 -0
- data/lib/hanami/config/routes.rb +16 -0
- data/lib/hanami/config/security.rb +58 -0
- data/lib/hanami/config/sessions.rb +97 -0
- data/lib/hanami/configuration.rb +1728 -0
- data/lib/hanami/container.rb +59 -0
- data/lib/hanami/environment.rb +485 -0
- data/lib/hanami/frameworks.rb +14 -0
- data/lib/hanami/generators/action/action.rb.tt +8 -0
- data/lib/hanami/generators/action/action_spec.minitest.tt +12 -0
- data/lib/hanami/generators/action/action_spec.rspec.tt +11 -0
- data/lib/hanami/generators/action/action_without_view.rb.tt +9 -0
- data/lib/hanami/generators/action/template.tt +0 -0
- data/lib/hanami/generators/action/view.rb.tt +5 -0
- data/lib/hanami/generators/action/view_spec.minitest.tt +13 -0
- data/lib/hanami/generators/action/view_spec.rspec.tt +12 -0
- data/lib/hanami/generators/app/.gitkeep.tt +1 -0
- data/lib/hanami/generators/app/application.rb.tt +273 -0
- data/lib/hanami/generators/app/config/initializers/.gitkeep +0 -0
- data/lib/hanami/generators/app/config/routes.rb.tt +2 -0
- data/lib/hanami/generators/app/favicon.ico +0 -0
- data/lib/hanami/generators/app/templates/application.html.erb.tt +10 -0
- data/lib/hanami/generators/app/views/application_layout.rb.tt +7 -0
- data/lib/hanami/generators/application/app/.env.development.tt +4 -0
- data/lib/hanami/generators/application/app/.env.test.tt +4 -0
- data/lib/hanami/generators/application/app/.env.tt +1 -0
- data/lib/hanami/generators/application/app/.gitignore +0 -0
- data/lib/hanami/generators/application/app/.gitkeep +1 -0
- data/lib/hanami/generators/application/app/Gemfile.tt +37 -0
- data/lib/hanami/generators/application/app/Rakefile.minitest.tt +11 -0
- data/lib/hanami/generators/application/app/Rakefile.rspec.tt +6 -0
- data/lib/hanami/generators/application/app/apps/.gitkeep.tt +1 -0
- data/lib/hanami/generators/application/app/capybara.rb.rspec.tt +8 -0
- data/lib/hanami/generators/application/app/config.ru.tt +3 -0
- data/lib/hanami/generators/application/app/config/application.rb.tt +270 -0
- data/lib/hanami/generators/application/app/config/environment.rb.tt +5 -0
- data/lib/hanami/generators/application/app/config/initializers/.gitkeep +0 -0
- data/lib/hanami/generators/application/app/config/routes.rb.tt +2 -0
- data/lib/hanami/generators/application/app/db/.gitkeep +1 -0
- data/lib/hanami/generators/application/app/favicon.ico +0 -0
- data/lib/hanami/generators/application/app/features_helper.rb.minitest.tt +11 -0
- data/lib/hanami/generators/application/app/features_helper.rb.rspec.tt +12 -0
- data/lib/hanami/generators/application/app/gitignore.tt +2 -0
- data/lib/hanami/generators/application/app/gitignore_with_db.tt +4 -0
- data/lib/hanami/generators/application/app/hanamirc.tt +3 -0
- data/lib/hanami/generators/application/app/lib/app_name.rb.tt +59 -0
- data/lib/hanami/generators/application/app/lib/chirp/entities/.gitkeep +1 -0
- data/lib/hanami/generators/application/app/lib/chirp/repositories/.gitkeep +1 -0
- data/lib/hanami/generators/application/app/lib/config/mapping.rb.tt +7 -0
- data/lib/hanami/generators/application/app/rspec.rspec.tt +2 -0
- data/lib/hanami/generators/application/app/schema.sql.tt +0 -0
- data/lib/hanami/generators/application/app/spec_helper.rb.minitest.tt +7 -0
- data/lib/hanami/generators/application/app/spec_helper.rb.rspec.tt +104 -0
- data/lib/hanami/generators/application/app/templates/application.html.erb.tt +10 -0
- data/lib/hanami/generators/application/app/views/application_layout.rb.tt +7 -0
- data/lib/hanami/generators/application/container/.env.development.tt +3 -0
- data/lib/hanami/generators/application/container/.env.test.tt +3 -0
- data/lib/hanami/generators/application/container/.env.tt +1 -0
- data/lib/hanami/generators/application/container/.gitignore +0 -0
- data/lib/hanami/generators/application/container/.gitkeep +1 -0
- data/lib/hanami/generators/application/container/Gemfile.tt +36 -0
- data/lib/hanami/generators/application/container/Rakefile.minitest.tt +11 -0
- data/lib/hanami/generators/application/container/Rakefile.rspec.tt +6 -0
- data/lib/hanami/generators/application/container/capybara.rb.rspec.tt +8 -0
- data/lib/hanami/generators/application/container/config.ru.tt +3 -0
- data/lib/hanami/generators/application/container/config/environment.rb.tt +7 -0
- data/lib/hanami/generators/application/container/config/initializers/.gitkeep +0 -0
- data/lib/hanami/generators/application/container/db/.gitkeep +1 -0
- data/lib/hanami/generators/application/container/features_helper.rb.minitest.tt +11 -0
- data/lib/hanami/generators/application/container/features_helper.rb.rspec.tt +12 -0
- data/lib/hanami/generators/application/container/gitignore.tt +2 -0
- data/lib/hanami/generators/application/container/gitignore_with_db.tt +4 -0
- data/lib/hanami/generators/application/container/hanamirc.tt +3 -0
- data/lib/hanami/generators/application/container/lib/app_name.rb.tt +60 -0
- data/lib/hanami/generators/application/container/lib/chirp/entities/.gitkeep +1 -0
- data/lib/hanami/generators/application/container/lib/chirp/mailers/.gitkeep +0 -0
- data/lib/hanami/generators/application/container/lib/chirp/mailers/templates/.gitkeep +0 -0
- data/lib/hanami/generators/application/container/lib/chirp/repositories/.gitkeep +1 -0
- data/lib/hanami/generators/application/container/lib/config/mapping.rb.tt +7 -0
- data/lib/hanami/generators/application/container/rspec.rspec.tt +2 -0
- data/lib/hanami/generators/application/container/schema.sql.tt +0 -0
- data/lib/hanami/generators/application/container/spec_helper.rb.minitest.tt +7 -0
- data/lib/hanami/generators/application/container/spec_helper.rb.rspec.tt +104 -0
- data/lib/hanami/generators/database_config.rb +99 -0
- data/lib/hanami/generators/generatable.rb +51 -0
- data/lib/hanami/generators/generator.rb +35 -0
- data/lib/hanami/generators/mailer/mailer.rb.tt +7 -0
- data/lib/hanami/generators/mailer/mailer_spec.rb.tt +7 -0
- data/lib/hanami/generators/mailer/template.html.tt +0 -0
- data/lib/hanami/generators/mailer/template.txt.tt +0 -0
- data/lib/hanami/generators/migration/migration.rb.tt +4 -0
- data/lib/hanami/generators/model/entity.rb.tt +3 -0
- data/lib/hanami/generators/model/entity_spec.minitest.tt +5 -0
- data/lib/hanami/generators/model/entity_spec.rspec.tt +3 -0
- data/lib/hanami/generators/model/repository.rb.tt +3 -0
- data/lib/hanami/generators/model/repository_spec.minitest.tt +5 -0
- data/lib/hanami/generators/model/repository_spec.rspec.tt +3 -0
- data/lib/hanami/generators/test_framework.rb +42 -0
- data/lib/hanami/hanamirc.rb +152 -0
- data/lib/hanami/loader.rb +258 -0
- data/lib/hanami/mailer/glue.rb +68 -0
- data/lib/hanami/middleware.rb +143 -0
- data/lib/hanami/rake_helper.rb +68 -0
- data/lib/hanami/rake_tasks.rb +2 -0
- data/lib/hanami/rendering_policy.rb +77 -0
- data/lib/hanami/repositories/car_repository.rb +3 -0
- data/lib/hanami/repositories/name_repository.rb +3 -0
- data/lib/hanami/root.rb +7 -0
- data/lib/hanami/routes.rb +151 -0
- data/lib/hanami/routing/default.rb +25 -0
- data/lib/hanami/setup.rb +3 -0
- data/lib/hanami/static.rb +77 -0
- data/lib/hanami/templates/default.html.erb +9 -0
- data/lib/hanami/templates/welcome.html.erb +52 -0
- data/lib/hanami/version.rb +4 -1
- data/lib/hanami/views/default.rb +34 -0
- data/lib/hanami/views/default_template_finder.rb +20 -0
- data/lib/hanami/views/null_view.rb +17 -0
- data/lib/hanami/welcome.rb +40 -0
- metadata +357 -16
- data/.gitignore +0 -9
- data/Gemfile +0 -4
- data/Rakefile +0 -2
- data/bin/console +0 -14
- data/bin/setup +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 744c995f7c17f73345a0e1eefe34b988c6d9ea75
|
4
|
+
data.tar.gz: a159b8f7ac8e22531cf5d37ff2ec3652fe6cbb12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7027ad8ca9cb7a80fb5485a6cacf5a2a15e73c5f5e1202c5d594068193d9e0377fcf102de18cf3de85812767fc95177f21c88a8b39c45016b65ec30049a5e1a
|
7
|
+
data.tar.gz: 7a340b00d09af67d7a23957beb974f5a2f103ab4ec45277ba730cc4391a959fde13d262730a70df01ce687674ea4cc1f88b547576eaa95628a7a1395e7fbca5e
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,214 @@
|
|
1
|
+
# Hanami
|
2
|
+
The web, with simplicity.
|
3
|
+
|
4
|
+
## v0.7.0 - 2016-01-22
|
5
|
+
### Changed
|
6
|
+
- [Luca Guidi] Renamed the project
|
7
|
+
|
8
|
+
## v0.6.1 - 2016-01-19
|
9
|
+
### Fixed
|
10
|
+
- [Anton Davydov] Show the current app name in Welcome page (eg. `/admin` shows instructions on how to generate an action for `Admin` app)
|
11
|
+
- [Anton Davydov] Fix project creation when name contains dashes (eg. `"awesome-project" => "AwesomeProject"`)
|
12
|
+
- [Anton Davydov] Ensure to add assets related entries to `.gitignore` when a project is generated with the `--database` flag
|
13
|
+
- [deepj] Avoid blank lines in generated `Gemfile`
|
14
|
+
- [trexnix] Fix for `lotus destroy app`: it doesn't cause a syntax error in `config/application.rb` anymore
|
15
|
+
- [Serg Ikonnikov & Trung Lê] Ensure console to use the bundled engine
|
16
|
+
|
17
|
+
## v0.6.0 - 2016-01-12
|
18
|
+
### Added
|
19
|
+
- [Luca Guidi] Introduced configurable assets compressors
|
20
|
+
- [Luca Guidi] Introduced "CDN mode" in order to serve static assets via Content Distribution Networks
|
21
|
+
- [Luca Guidi] Introduced "Digest mode" in production in order to generate and serve assets with checksum suffix
|
22
|
+
- [Luca Guidi] Introduced `lotus assets precompile` command to precompile, minify and append checksum suffix to static assets
|
23
|
+
- [Luca Guidi] Send `Content-Cache` HTTP header when serving static assets in production mode
|
24
|
+
- [Luca Guidi] Support new env var `SERVE_STATIC_ASSETS="true"` in order to serve static assets for the entire project
|
25
|
+
- [Luca Guidi] Generate new applications by including `Web::Assets::Helpers` in `view.prepare` block
|
26
|
+
- [Luca Guidi] Introduced new Rake tasks `:preload` and `:environment`
|
27
|
+
- [Luca Guidi] Introduced new Rake tasks `db:migrate` and `assets:precompile` for Rails/Heroku compatibility
|
28
|
+
- [Tadeu Valentt & Lucas Allan Amorin] Added `lotus destroy` command for apps, models, actions, migrations and mailers
|
29
|
+
- [Lucas Allan Amorim] Custom initializers (`apps/web/config/initializers`) they are ran when the project is loaded and about to start
|
30
|
+
- [Trung Lê] Generate mailer templates directory for new projects (eg. `lib/bookshelf/mailers/templates`)
|
31
|
+
- [Tadeu Valentt] Alias `--database` as `-d` for `lotus new`
|
32
|
+
- [Tadeu Valentt] Alias `--arch` as `-a` for `lotus new`
|
33
|
+
- [Sean Collins] Let `lotus generate action` to guess HTTP method (`--method` arg) according to RESTful conventions
|
34
|
+
- [Gonzalo Rodríguez-Baltanás Díaz] Generate new applications with default favicon
|
35
|
+
|
36
|
+
### Fixed
|
37
|
+
- [Neil Matatall] Use "secure compare" for CSRF tokens in order to prevent timing attacks
|
38
|
+
- [Bernardo Farah] Fix support for chunked response body (via `Rack::Chunked::Body`)
|
39
|
+
- [Lucas Allan Amorim] Add `bundler` as a runtime dependency
|
40
|
+
- [Lucas Allan Amorim] Ensure to load properly Bundler dependencies when starting the application
|
41
|
+
- [Luca Guidi] Ensure sessions to be always available for other middleware in Rack stack of single applications
|
42
|
+
- [Ken Gullaksen] Ensure to specify `LOTUS_PORT` env var from `.env`
|
43
|
+
- [Andrey Deryabin] Fix `lotus new .` and prevent to generate the project in a subdirectory of current one
|
44
|
+
- [Jason Charnes] Validate entity name for model generator
|
45
|
+
- [Caius Durling] Fixed generator for nested actions (eg. `lotus generate action web domains/certs#index`)
|
46
|
+
- [Tadeu Valentt] Prevent to generate migrations with the same name
|
47
|
+
- [Luca Guidi] Ensure RSpec examples to be generated with `RSpec.describe` instead of only `describe`
|
48
|
+
- [Andrey Deryabin] Avoid `lotus` command to generate unnecessary `.lotusrc` files
|
49
|
+
- [Jason Charnes] Convert camel case application name into snake case when generating actions (eg. `BeautifulBlossoms` to `beautiful_blossoms`)
|
50
|
+
- [Alfonso Uceda Pompa] Convert dasherized names into underscored names when generating projects (eg. `awesome-project` to `awesome_project`)
|
51
|
+
|
52
|
+
### Changed
|
53
|
+
- [Sean Collins] Welcome page shows current year in copyright notes
|
54
|
+
- [Luca Guidi] Add `/public/assets*` to `.gitignore` of new projects
|
55
|
+
- [Luca Guidi] Removed support for `default_format` in favor of `default_request_format`
|
56
|
+
- [Luca Guidi] Removed support for `apps/web/public` in favor of `apps/web/assets` as assets sources for applications
|
57
|
+
- [Luca Guidi] Removed support for `serve_assets` for single applications in order to global static assets server enabled via `SERVE_STATIC_ASSETS` env var
|
58
|
+
- [Luca Guidi] `assets` configuration in `apps/web/application.rb` now accepts a block to configure sources and other settings
|
59
|
+
|
60
|
+
## v0.5.0 - 2015-09-30
|
61
|
+
### Added
|
62
|
+
- [Ines Coelho & Rosa Faria] Introduced mailers support
|
63
|
+
- [Theo Felippe] Added configuration entries: `#default_request_format` and `default_response_format`
|
64
|
+
- [Rodrigo Panachi] Introduced `logger` configuration for applications, to be used like this: `Web::Logger.debug`
|
65
|
+
- [Ben Lovell] Simpler and less verbose RSpec tests
|
66
|
+
- [Pascal Betz] Introduced `--method` CLI argument for action generator as a way to specify the HTTP verb
|
67
|
+
|
68
|
+
### Fixed
|
69
|
+
- [Luca Guidi] Handle conflicts between directories with the same name while serving static assets
|
70
|
+
- [Derk-Jan Karrenbeld] Include default value `font-src: self` for CSP HTTP header
|
71
|
+
- [Cam Huynh] Make CLI arguments immutable for `Lotus::Environment`
|
72
|
+
- [Andrii Ponomarov] Disable welcome page in test environment
|
73
|
+
- [Alfonso Uceda Pompa] Print error message and exit when no name is provided to model generator
|
74
|
+
|
75
|
+
### Changed
|
76
|
+
- [Theo Felippe] Deprecated `#default_format` in favor of: `#default_request_format`
|
77
|
+
|
78
|
+
## v0.4.1 - 2015-07-10
|
79
|
+
### Added
|
80
|
+
- [Trung Lê] Alias `--database` as `--db` for `lotus new`
|
81
|
+
|
82
|
+
### Fixed
|
83
|
+
- [Alfonso Uceda Pompa] Ensure to load correctly apps in `lotus console`
|
84
|
+
- [Alfonso Uceda Pompa] Ensure to not duplicate prefix for Container mounted apps (eg `/admin/admin/dashboard`)
|
85
|
+
- [Alfonso Uceda Pompa] Ensure generator for "application" architecture to generate session secret
|
86
|
+
- [Alfonso Uceda Pompa & Trung Lê & Hiếu Nguyễn] Exit unsuccessfully when `lotus generate model` doesn't receive a mandatory name for model
|
87
|
+
- [Miguel Molina] Exit unsuccessfully when `lotus new --database` receives an unknown value
|
88
|
+
- [Luca Guidi] Ensure to prepend sessions middleware, so other Rack components can have access to HTTP session
|
89
|
+
|
90
|
+
## v0.4.0 - 2015-06-23
|
91
|
+
### Added
|
92
|
+
- [Luca Guidi] Database migrations and new CLI commands for database operations
|
93
|
+
- [Luca Guidi] Cross Site Request Forgery (CSRF) protection
|
94
|
+
- [Hiếu Nguyễn & Luca Guidi] Application Architecture
|
95
|
+
- [Alfonso Uceda Pompa] Force SSL for applications
|
96
|
+
- [Luca Guidi] Introduced `--url` CLI argument for action generator
|
97
|
+
- [Luca Guidi] Added `rendered` "let" variable for new generated tests for views
|
98
|
+
|
99
|
+
### Fixed
|
100
|
+
- [Alfonso Uceda Pompa] Fix generated routes for Container applications mounted on a path different from `/`.
|
101
|
+
- [Luca Guidi] Reading `.lotusrc` pollutes `ENV` with unwanted variables.
|
102
|
+
- [Alfonso Uceda Pompa] Added sqlite extension to SQLite/SQLite3 database URL.
|
103
|
+
|
104
|
+
### Changed
|
105
|
+
- [Luca Guidi] `.env`, `.env.development` and `.env.test` are generated and expected to be placed at the root of the project.
|
106
|
+
- [Luca Guidi] Remove database mapping from generated apps.
|
107
|
+
- [Trung Lê & Luca Guidi] Remove default generated from new apps.
|
108
|
+
- [Luca Guidi] New projects should depend on `lotus-model ~> 0.4`
|
109
|
+
|
110
|
+
## v0.3.2 - 2015-05-22
|
111
|
+
### Added
|
112
|
+
- [Alfonso Uceda Pompa] Automatic secure cookies if the current connection is using HTTPS.
|
113
|
+
- [Alfonso Uceda Pompa] Routing helpers for actions (via `#routes`).
|
114
|
+
- [My Mai] Introduced `Lotus.root`. It returns the top level directory of the project.
|
115
|
+
|
116
|
+
### Fixed
|
117
|
+
- [Ngọc Nguyễn] Model generator should use new RSpec syntax.
|
118
|
+
- [Ngọc Nguyễn] Model generator must respect file name conventions for Ruby.
|
119
|
+
- [Ngọc Nguyễn] Action generator must respect file name conventions for Ruby.
|
120
|
+
- [Alfonso Uceda Pompa] Action generator must raise error if name isn't provided.
|
121
|
+
- [Luca Guidi] Container generator for RSpec let the application to be preloaded (discard `config.before(:suite)`)
|
122
|
+
|
123
|
+
## v0.3.1 - 2015-05-15
|
124
|
+
### Added
|
125
|
+
- [Hiếu Nguyễn] Introduced application generator (eg. `bundle exec lotus generate app admin` creates `apps/admin`).
|
126
|
+
- [Ngọc Nguyễn] Introduced model generator (eg. `bundle exec lotus generate model user` creates entity, repository and test files).
|
127
|
+
- [Ngọc Nguyễn] Introduced `Lotus.env`, `Lotus.env?` for current environment introspection (eg. `Lotus.env?(:test)` or `Lotus.env?(:staging, :production)`)
|
128
|
+
- [Miguel Molina] Skip view creation when an action is generated via `--skip-view` CLI arg.
|
129
|
+
|
130
|
+
### Fixed
|
131
|
+
- [Luca Guidi] Ensure routes to be loaded for unit tests
|
132
|
+
|
133
|
+
## v0.3.0 - 2015-03-23
|
134
|
+
### Added
|
135
|
+
- [Luca Guidi] Introduced action generator. Eg. `bundle exec lotus generate action web dashboard#index`
|
136
|
+
- [Alfonso Uceda Pompa] Allow to specify default coookies options in application configuration. Eg. `cookies true, { domain: 'lotusrb.org' }`
|
137
|
+
- [Tom Kadwill] Include `Lotus::Helpers` in views.
|
138
|
+
- [Linus Pettersson] Allow to specify `--database` CLI option when generate a new project. Eg. `lotus new bookshelf --database=postgresql`
|
139
|
+
- [Linus Pettersson] Initialize a Git repository when generating a new project
|
140
|
+
- [Alfonso Uceda Pompa] Produce `.lotusrc` when generating a new project
|
141
|
+
- [Alfonso Uceda Pompa] Security HTTP headers. `X-Frame-Options` and `Content-Security-Policy` are now enabled by default.
|
142
|
+
- [Linus Pettersson] Database console. Run with `bundle exec lotus db console`
|
143
|
+
- [Luca Guidi] Dynamic finders for relative and absolute routes. It implements method missing: `Web::Routes.home_path` will resolve to `Web::Routes.path(:home)`.
|
144
|
+
|
145
|
+
### Changed
|
146
|
+
– [Alfonso Uceda Pompa] Cookies will send `HttpOnly` by default. This is for security reasons.
|
147
|
+
- [Jan Lelis] Enable `templates` configuration for new generated apps
|
148
|
+
- [Mark Connell] Change SQLite file extension from `.db` to `.sqlite3`
|
149
|
+
|
150
|
+
## v0.2.1 - 2015-02-06
|
151
|
+
### Added
|
152
|
+
- [Huy Đỗ] Introduced `Lotus::Logger`
|
153
|
+
- [Jimmy Zhang] `lotus new` accepts a `--path` argument
|
154
|
+
- [Jimmy Zhang] Project generator for the current directory (`lotus new .`). This is useful to provide a web deliverable for existing Ruby gems.
|
155
|
+
- [Trung Lê] Add example mapping file for project generator: `lib/config/mapping.rb`
|
156
|
+
- [Hiếu Nguyễn] RSpec support for project generator: `--test=rspec` or `--test=minitest` (default)
|
157
|
+
|
158
|
+
### Fixed
|
159
|
+
- [Luca Guidi] `lotus version` to previx `v` (eg `v0.2.1`)
|
160
|
+
- [Rob Yurkowski] Ensure project name doesn't contain special or forbidden characters
|
161
|
+
- [Luca Guidi] Ensure all the applications are loaded in console
|
162
|
+
- [Trung Lê] Container architecture: preload only `lib/<projectname>/**/*.rb`
|
163
|
+
- [Hiếu Nguyễn] Fixed `lotus new` to print usage when project name isn't provided
|
164
|
+
|
165
|
+
## v0.2.0 - 2014-06-23
|
166
|
+
### Added
|
167
|
+
- [Luca Guidi] Introduced `lotus new` as a command to generate projects. It supports "container" architecture for now.
|
168
|
+
- [Luca Guidi] Show a welcome page when one mounted Lotus application doesn't have routes
|
169
|
+
- [Luca Guidi] Introduced `Lotus::Application.preload!` to preload all the Lotus applications in a given Ruby process. (Bulk `Lotus::Application.load!`)
|
170
|
+
- [Trung Lê] Allow browsers to fake non `GET`/`POST` requests via `Rack::MethodOverride`
|
171
|
+
- [Josue Abreu] Allow to define body parses for non `GET` HTTP requests (`body_parsers` configuration)
|
172
|
+
- [Alfonso Uceda Pompa] Allow to toggle static assets serving (`serve_assets` configuration)
|
173
|
+
- [Alfonso Uceda Pompa] Allow to serve assets from multiple sources (`assets` configuration)
|
174
|
+
- [Luca Guidi] Allow to configure `ENV` vars with per environment `.env` files
|
175
|
+
- [Alfonso Uceda Pompa] Introduced `lotus routes` command
|
176
|
+
- [Luca Guidi] Allow to configure low level settings for MVC frameworks (`model`, `view` and `controller` configuration)
|
177
|
+
- [Luca Guidi] Introduced `Lotus::Container`
|
178
|
+
- [Trung Lê] Include `Lotus::Presenter` as part of the duplicated modules
|
179
|
+
- [Trung Lê] Include `Lotus::Entity` and `Lotus::Repository` as part of the duplicated modules
|
180
|
+
- [Luca Guidi] Introduced code reloading for `lotus server`
|
181
|
+
- [Trung Lê] Allow to configure database adapter (`adapter` configuration)
|
182
|
+
- [Luca Guidi & Trung Lê] Allow to configure database mapping (`mapping` configuration)
|
183
|
+
- [Piotr Kurek] Introduced custom templates for non successful responses
|
184
|
+
- [Luca Guidi] Allow to configure exceptions handling (`handle_exceptions` configuration)
|
185
|
+
- [Michal Muskala] Allow to configure sessions (`sessions` configuration)
|
186
|
+
- [Josue Abreu] Allow to configure cookies (`cookies` configuration)
|
187
|
+
- [Piotr Kurek] Allow to yield multiple configurations per application, according to the current environment
|
188
|
+
- [David Celis] Allow to configure Rack middleware stack (`middleware` configuration)
|
189
|
+
- [David Celis] Introduced `lotus console` command. It runs the REPL configured in `Gemfile` (eg. pry or ripl). Defaults to IRb.
|
190
|
+
- [Luca Guidi] Introduced `Lotus::Environment` which holds the informations about the current environment, and CLI arguments
|
191
|
+
- [Luca Guidi] Introduced `Lotus::Application.load!` to load and configure an application without requiring user defined code (controllers, views, etc.)
|
192
|
+
- [Leonard Garvey] Introduced `lotus server` command. It runs the application with the Rack server declared in `Gemfile` (eg. puma, thin, unicorn). It defaults to `WEBRick`.
|
193
|
+
- [Luca Guidi] Official support for MRI 2.1 and 2.2
|
194
|
+
|
195
|
+
### Changed
|
196
|
+
- [Alfonso Uceda Pompa] Changed semantic of `assets` configuration. Now it's only used to set the sources for the assets. Static serving assets has now a new configuration: `serve_assets`.
|
197
|
+
|
198
|
+
### Fixed
|
199
|
+
- [Luca Guidi] Ensure `HEAD` requests return empty body
|
200
|
+
|
201
|
+
## v0.1.0 - 2014-06-23
|
202
|
+
### Added
|
203
|
+
- [Luca Guidi] Allow to run multiple Lotus applications in the same Ruby process (framework duplication)
|
204
|
+
- [Luca Guidi] Introduced `Lotus::Routes` as factory to generate application URLs
|
205
|
+
- [Luca Guidi] Allow to configure scheme, host and port (`scheme`, `host` and `port` configuration)
|
206
|
+
- [Luca Guidi] Allow to configure a layout to use for all the views of an application (`layout` configuration)
|
207
|
+
- [Luca Guidi] Allow to configure routes (`routes` configuration)
|
208
|
+
- [Luca Guidi] Allow to configure several load paths for Ruby source files (`load_paths` configuration)
|
209
|
+
- [Luca Guidi] Allow to serve static files (`assets` configuration)
|
210
|
+
- [Luca Guidi] Render default pages for non successful responses (eg `404` or `500`)
|
211
|
+
- [Luca Guidi] Allow to configure the root of an application (`root` configuration)
|
212
|
+
- [Luca Guidi] Introduced `Lotus::Configuration`
|
213
|
+
- [Luca Guidi] Introduced `Lotus::Application`
|
214
|
+
- [Luca Guidi] Official support for MRI 2.0
|
data/FEATURES.md
ADDED
@@ -0,0 +1,156 @@
|
|
1
|
+
# Hanami
|
2
|
+
### The web, with simplicity.
|
3
|
+
|
4
|
+
## Features
|
5
|
+
|
6
|
+
## v0.7.0 - 2016-01-22
|
7
|
+
|
8
|
+
## v0.6.1 - 2016-01-19
|
9
|
+
|
10
|
+
## v0.6.0 - 2016-01-12
|
11
|
+
|
12
|
+
- Assets preprocessors support (eg. Sass, ES6, Opal, Less, CoffeScript..)
|
13
|
+
- Assets compressors (eg. YUI, UglifyJS2, Google Closure Compiler, Sass..)
|
14
|
+
- Assets helpers:
|
15
|
+
* `javascript`
|
16
|
+
* `stylesheet`
|
17
|
+
* `favicon`
|
18
|
+
* `image`
|
19
|
+
* `video`
|
20
|
+
* `audio`
|
21
|
+
* `asset_path`
|
22
|
+
* `asset_url`
|
23
|
+
- Content Delivery Network (CDN) support for static assets (CDN mode)
|
24
|
+
- Checksum suffix for static assets in production mode (Digest mode)
|
25
|
+
- Support for third party gems as assets distribution channel (eg. `lotus-jquery`)
|
26
|
+
- CLI: `lotus assets` command `precompile`: preprocess, minify and append checksum suffix
|
27
|
+
- CLI: `lotus destroy` destroy apps, models, actions, migrations and mailers
|
28
|
+
- Custom initializers (`apps/web/config/initializers`)
|
29
|
+
- Rake tasks `:preload` and `:environment`
|
30
|
+
|
31
|
+
## v0.5.0 - 2015-09-30
|
32
|
+
|
33
|
+
- Mailers
|
34
|
+
- CLI: `lotus generate mailer`
|
35
|
+
- SQL joins
|
36
|
+
- Custom coercers for data mapper
|
37
|
+
|
38
|
+
## v0.4.1 - 2015-07-10
|
39
|
+
|
40
|
+
## v0.4.0 - 2015-06-23
|
41
|
+
|
42
|
+
- Application architecture
|
43
|
+
- Database migrations
|
44
|
+
- CLI: `lotus db` commands: `create`, `drop`, `prepare`, `migrate`, `version`, `apply`.
|
45
|
+
- HTML5 Form helpers
|
46
|
+
- Cross Site Request Forgery (CSRF) protection
|
47
|
+
- Force SSL
|
48
|
+
- Number formatting helper
|
49
|
+
|
50
|
+
## v0.3.2 - 2015-05-22
|
51
|
+
|
52
|
+
- Automatic secure cookies
|
53
|
+
- Routing helpers for actions
|
54
|
+
- Send files from actions
|
55
|
+
- `Lotus.root` returns top level directory of the project.
|
56
|
+
|
57
|
+
## v0.3.1 - 2015-05-15
|
58
|
+
|
59
|
+
- CLI: `lotus generate app admin` creates a new application (`apps/admin`).
|
60
|
+
- CLI: `lotus generate model user`. It generates entity, repository and related unit test files.
|
61
|
+
- `Lotus.env` and `Lotus.env?` for current environment introspection (eg. `Lotus.env?(:test)` or `Lotus.env?(:staging, :production)`)
|
62
|
+
- Allow repositories to execute raw query/commands against database
|
63
|
+
- Automatic timestamps update for entities
|
64
|
+
– Dirty Tracking for entities (via `Lotus::Entity::DirtyTracking`)
|
65
|
+
- Nested RESTful resource(s)
|
66
|
+
- String pluralization and singularization
|
67
|
+
|
68
|
+
## v0.3.0 - 2015-03-23
|
69
|
+
|
70
|
+
- CLI: `lotus generate action web dashboard#index`. It generates an action, a view, a template, a route and related unit test files.
|
71
|
+
- CLI: `lotus db console`. It starts a database REPL.
|
72
|
+
- Full featured HTML5 markup generator for views (Eg. `html.div { p "Hello World" }`)
|
73
|
+
- Routing helpers in views and templates (Eg. `routes.home_path`).
|
74
|
+
- `lotus new` supports `--database` (Eg. `lotus new bookshelf --database=postgresql`).
|
75
|
+
- Initialize a Git repository when generate a new application
|
76
|
+
- Security: XSS (Cross Site Scripting) protections
|
77
|
+
- Security: Clickhijacking protection
|
78
|
+
- Security: Cookies are set as `HttpOnly` by default.
|
79
|
+
- Security: enable by default `X-Frame-Options` and `Content-Security-Policy` HTTP headers for new generated applications.
|
80
|
+
- Security: auto-escape output of presenters.
|
81
|
+
- Security: auto-escape output of virtual an concrete view methods.
|
82
|
+
- Security: view and template helpers for HTML, HTML attributes and URL escape. It's based on OWASP/ESAPI recommendations.
|
83
|
+
- Access nested action params with a safe API (`params.get('address.city')`).
|
84
|
+
- Interactors (aka Service Objects)
|
85
|
+
- Database transactions
|
86
|
+
|
87
|
+
## v0.2.1 - 2015-02-06
|
88
|
+
|
89
|
+
- Allow entities to include validations.
|
90
|
+
- `lotus new .` to generate a Lotus project for an existing code base (Eg. a gem that needs a web UI).
|
91
|
+
- `lotus new` supports `--path` (for destination directory), `--test` (to generate Minitest or RSpec boilerplate).
|
92
|
+
- Lotus logger
|
93
|
+
|
94
|
+
## v0.2.0 - 2014-12-23
|
95
|
+
|
96
|
+
- Support Minitest as default testing framework (`bundle exec rake` runs the entire test suite of an application).
|
97
|
+
- Support for _Method Override_ technique.
|
98
|
+
- Custom templates for non successful responses (Eg. `404.html.erb`).
|
99
|
+
- Support distinct `.env` files for each Lotus environment.
|
100
|
+
- Allow to configure multiple applications and handle Lotus environments accordingly.
|
101
|
+
- Allow to configure middleware stack, routes, database mapping and adapter for each application.
|
102
|
+
- Show a welcome page with instructions for new generated apps.
|
103
|
+
- CLI: `lotus routes`. It prints all the routes available for all the applications.
|
104
|
+
- CLI: `lotus new`. It generates a new application which can run multiple Lotus applications (_Container_ architecture).
|
105
|
+
- CLI: `lotus console`. It starts a Ruby REPL. It supports IRB (default), Pry and Ripl.
|
106
|
+
- CLI: `lotus server`. It starts a web server that supports code reloading. It supports all the Rack web servers (default: WEBRick).
|
107
|
+
- Database adapters: File system (default for new apps)
|
108
|
+
- Allow to share code for all the views and actions of an application
|
109
|
+
- Reusable validations framework (mixin). It supports: coercions and presence, format, acceptance, size, inclusion, exclusion, confirmation validations.
|
110
|
+
- Default Content-Type and Charset for responses
|
111
|
+
- Whitelist accepted MIME Types
|
112
|
+
- Custom exception handlers for actions
|
113
|
+
- Unique identifier for incoming HTTP requests
|
114
|
+
- Nested action params
|
115
|
+
- Action params _indifferent access_, whitelisting, validations and coercions
|
116
|
+
- HTTP caching (`Cache-Control`, `Last-Modified`, ETAG, Conditional GET, expires)
|
117
|
+
- JSON body parser for non-GET HTTP requests
|
118
|
+
- Routes inspector for CLI
|
119
|
+
|
120
|
+
## v0.1.0 - 2014-06-23
|
121
|
+
|
122
|
+
- Run multiple Lotus applications in the same Ruby process
|
123
|
+
- Serve static files
|
124
|
+
- Render default pages for non successful responses (404, 500, etc.)
|
125
|
+
- Support multiple Lotus environments (development, test and production)
|
126
|
+
- Full stack applications
|
127
|
+
- Data mapper
|
128
|
+
- Database adapters: Memory and SQL
|
129
|
+
- Reusable scopes for repositories
|
130
|
+
- Repositories
|
131
|
+
- Entities
|
132
|
+
- Custom rendering implementation via `#render` override in views
|
133
|
+
- Render partials and templates
|
134
|
+
- Presenters
|
135
|
+
- Layouts
|
136
|
+
- Views are able to handle multiple MIME Types according to the defined templates
|
137
|
+
- Support for all the most common template engines for Ruby. Including ERb, Slim, HAML, etc.
|
138
|
+
- Basic view rendering with templates
|
139
|
+
- Bypass rendering by setting a response body in actions (`self.body = "Hello"`)
|
140
|
+
- Single actions are able to mount Rack middleware
|
141
|
+
- Automatic MIME Type handling for request and responses
|
142
|
+
- HTTP sessions
|
143
|
+
- HTTP cookies
|
144
|
+
- HTTP redirect
|
145
|
+
- Action before/after callbacks
|
146
|
+
- Handle exceptions with HTTP statuses
|
147
|
+
- Action exposures, to expose a payload to pass to the other application layers
|
148
|
+
- Actions compatible with Rack
|
149
|
+
- Mount Rack applications
|
150
|
+
- Nested route namespaces
|
151
|
+
- RESTful resource(s), including collection and member actions
|
152
|
+
- Named routes, routes constraints, variables, catch-all
|
153
|
+
- Compatibility with Lotus::Controller
|
154
|
+
- HTTP redirect from the router
|
155
|
+
- HTTP routing compatible with Rack
|
156
|
+
- Thread safety
|
data/LICENSE.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright © 2014-2016 Luca Guidi
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,36 +1,101 @@
|
|
1
1
|
# Hanami
|
2
2
|
|
3
|
-
|
3
|
+
The web, with simplicity.
|
4
4
|
|
5
|
-
|
5
|
+
## Frameworks
|
6
|
+
|
7
|
+
Hanami combines small yet powerful frameworks:
|
8
|
+
|
9
|
+
* [**Hanami::Utils**](https://github.com/hanami/utils) - Ruby core extensions and class utilities
|
10
|
+
* [**Hanami::Router**](https://github.com/hanami/router) - Rack compatible HTTP router for Ruby
|
11
|
+
* [**Hanami::Validations**](https://github.com/hanami/validations) - Validations mixin for Ruby objects
|
12
|
+
* [**Hanami::Helpers**](https://github.com/hanami/helpers) - View helpers for Ruby applications
|
13
|
+
* [**Hanami::Mailer**](https://github.com/hanami/mailer) - Mail for Ruby applications
|
14
|
+
* [**Hanami::Model**](https://github.com/hanami/model) - Persistence with entities, repositories and data mapper
|
15
|
+
* [**Hanami::Assets**](https://github.com/hanami/assets) - Assets management for Ruby
|
16
|
+
* [**Hanami::View**](https://github.com/hanami/view) - Presentation with a separation between views and templates
|
17
|
+
* [**Hanami::Controller**](https://github.com/hanami/controller) - Full featured, fast and testable actions for Rack
|
18
|
+
|
19
|
+
These components are designed to be used independently or together in a Hanami application.
|
20
|
+
If you aren't familiar with them, please take time to go through their READMEs.
|
21
|
+
|
22
|
+
## Status
|
23
|
+
|
24
|
+
[![Gem Version](https://badge.fury.io/rb/hanami.svg)](http://badge.fury.io/rb/hanami)
|
25
|
+
[![Build Status](https://secure.travis-ci.org/hanami/hanami.svg?branch=master)](http://travis-ci.org/hanami/hanami?branch=master)
|
26
|
+
[![Coverage](https://coveralls.io/repos/hanami/hanami/badge.svg?branch=master)](https://coveralls.io/r/hanami/hanami)
|
27
|
+
[![Code Climate](https://codeclimate.com/github/hanami/hanami.svg)](https://codeclimate.com/github/hanami/hanami)
|
28
|
+
[![Dependencies](https://gemnasium.com/hanami/hanami.svg)](https://gemnasium.com/hanami/hanami)
|
29
|
+
[![Inline docs](http://inch-ci.org/github/hanami/hanami.svg)](http://inch-ci.org/github/hanami/hanami)
|
30
|
+
|
31
|
+
## Contact
|
32
|
+
|
33
|
+
* Home page: http://hanamirb.org
|
34
|
+
* Community: http://hanamirb.org/community
|
35
|
+
* Guides: http://hanamirb.org/guides
|
36
|
+
* Mailing List: http://hanamirb.org/mailing-list
|
37
|
+
* API Doc: http://rdoc.info/gems/hanami
|
38
|
+
* Bugs/Issues: https://github.com/hanami/hanami/issues
|
39
|
+
* Support: http://stackoverflow.com/questions/tagged/hanami
|
40
|
+
* Forum: https://discuss.hanamirb.org
|
41
|
+
* Chat: http://chat.hanamirb.org
|
42
|
+
|
43
|
+
## Rubies
|
44
|
+
|
45
|
+
__Hanami__ supports Ruby (MRI) 2+
|
6
46
|
|
7
47
|
## Installation
|
8
48
|
|
9
|
-
|
49
|
+
```shell
|
50
|
+
% gem install hanami
|
51
|
+
```
|
52
|
+
|
53
|
+
## Usage
|
10
54
|
|
11
|
-
```
|
12
|
-
|
55
|
+
```shell
|
56
|
+
% hanami new bookshelf
|
57
|
+
% cd bookshelf && bundle
|
58
|
+
% bundle exec hanami server # visit http://localhost:2300
|
13
59
|
```
|
14
60
|
|
15
|
-
|
61
|
+
Please follow along with the [Getting Started guide](http://hanamirb.org/guides/getting-started).
|
16
62
|
|
17
|
-
|
63
|
+
## Community
|
18
64
|
|
19
|
-
|
65
|
+
We strive for a Community made of **inclusive, helpful and smart people**.
|
66
|
+
We have a [Code of Conduct](http://hanamirb.org/community/#code-of-conduct) to handle controversial cases.
|
67
|
+
In general, we expect **you** to be **nice** with other people.
|
68
|
+
Our hope is for a great software and a great Community.
|
20
69
|
|
21
|
-
|
70
|
+
### Contributor Code of Conduct
|
22
71
|
|
23
|
-
|
72
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
73
|
+
|
74
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
24
75
|
|
25
|
-
|
76
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
26
77
|
|
27
|
-
|
78
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
28
79
|
|
29
|
-
|
80
|
+
This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
|
30
81
|
|
31
|
-
|
82
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
83
|
+
|
84
|
+
This Code of Conduct is adapted from the Contributor Covenant, version 1.1.0, available from http://contributor-covenant.org/version/1/1/0/
|
32
85
|
|
33
86
|
## Contributing
|
34
87
|
|
35
|
-
|
88
|
+
1. Fork it ( https://github.com/hanami/hanami/fork )
|
89
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
90
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
91
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
92
|
+
5. Create a new Pull Request
|
93
|
+
|
94
|
+
## Versioning
|
95
|
+
|
96
|
+
__Hanami__ uses [Semantic Versioning 2.0.0](http://semver.org)
|
97
|
+
|
98
|
+
## Copyright
|
36
99
|
|
100
|
+
Copyright © 2014-2016 Luca Guidi – Released under MIT License
|
101
|
+
This project was formerly known as Lotus (`lotusrb`).
|