702b8b547ff0defbed36816a9e393bc514552c4e
- Author
- Marc Cornellà <marc.cornella@live.com>
- Committer
- Marc Cornellà <marc.cornella@live.com>
- Date
Message
Merge branch 'iBublik-feature/hanami-plugin'
Close #5268.
Diff
1diff --git a/plugins/hanami/README.md b/plugins/hanami/README.md
2new file mode 100644
3index 0000000000000000000000000000000000000000..ef3451faf0be965757d107402c74f14ffe790c16
4--- /dev/null
5+++ b/plugins/hanami/README.md
6@@ -0,0 +1,32 @@
7+# Hanami Plugin #
8+This plugin adds convenient ways to work with [Hanami](http://hanamirb.org/) via console.
9+It's inspired by Rails plugin, so if you've used it, you'll feel like home.
10+
11+## Usage ##
12+
13+For example, type `hc` into your console when you're within Hanami project directory to run
14+the application console. Have a look at available shortcuts below. You can read more about
15+these commands [on the official website](http://hanamirb.org/guides/command-line/applications/).
16+
17+## Aliases ##
18+
19+| Alias | Command | Description |
20+|-------|---------------------------|---------------------------------------------------------|
21+| HED | HANAMI_ENV=development | Set environment variable HANAMI_ENV to development |
22+| HEP | HANAMI_ENV=production | Set environment variable HANAMI_ENV to production |
23+| HET | HANAMI_ENV=test | Set environment variable HANAMI_ENV to test |
24+| hc | hanami console | Run application console |
25+| hd | hanami destroy | Remove specified hanami resource |
26+| hg | hanami generate | Create specified hanami resource |
27+| hgm | hanami generate migration | Create migration file |
28+| hs | hanami server | Launch server with hanami application |
29+| hsp | hanami server -p | Launch server with specified port |
30+| hr | hanami routes | List application routes |
31+| hdc | hanami db create | Create application database |
32+| hdd | hanami db drop | Delete application database |
33+| hdp | hanami db prepare | Prepare database for the current environment |
34+| hda | hanami db apply | Recreates a fresh schema after migrations (destructive) |
35+| hdv | hanami db version | Print current database version |
36+| hdrs | hdd && hdp | Drop and recreate application database |
37+| hdtp | HET hdp | Actualize test environment database |
38+| hrg | hr | grep | Grep hanami routes with specified pattern |
39diff --git a/plugins/hanami/hanami.plugin.zsh b/plugins/hanami/hanami.plugin.zsh
40new file mode 100644
41index 0000000000000000000000000000000000000000..349c42cae847b0b04ff306c3fd526811210a9d36
42--- /dev/null
43+++ b/plugins/hanami/hanami.plugin.zsh
44@@ -0,0 +1,19 @@
45+alias -g HED='HANAMI_ENV=development'
46+alias -g HEP='HANAMI_ENV=production'
47+alias -g HET='HANAMI_ENV=test'
48+
49+alias hc='hanami console'
50+alias hd='hanami destroy'
51+alias hg='hanami generate'
52+alias hgm='hanami generate migration'
53+alias hs='hanami server'
54+alias hsp='hanami server -p'
55+alias hr='hanami routes'
56+alias hdc='hanami db create'
57+alias hdd='hanami db drop'
58+alias hdp='hanami db prepare'
59+alias hda='hanami db apply'
60+alias hdv='hanami db version'
61+alias hdrs='hdd && hdp'
62+alias hdtp='HET hdp'
63+alias hrg='hr | grep'