openbox 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f762f3449027a69d3c8767f0a27a9c667b0acc9f0bfe7b155e722d5233e75d9
4
- data.tar.gz: d8b5d859d5064a79c4a9d42f7caa684ae6545b651a1e905fff4cdf162a16459c
3
+ metadata.gz: c3b2286d2b3b83ce60a50ead93f7f3b293612cd7a9386f21309b2078467acf3e
4
+ data.tar.gz: e1b3b12fe3c36503c9cfe1c72ac38163b1c7850eeda7e4395adf79c665abc19e
5
5
  SHA512:
6
- metadata.gz: df324b78ad61005016eb683c4f8f39db97ca6f7bcc46257c955addda99694f6af98448055ebc8a7f4816fedcb2d827df3c5ceee00c6e803b0c2f602f9adb51ee
7
- data.tar.gz: 1ee33165c70fa5a7aeed31247813636597230042b26473292b862ff9e93eba6e8be060c142dada10cf920831db20f83fdeae83cc1dc8eba87c6eead7033a96a0
6
+ metadata.gz: 741418382ee5a71631d3ff8303ea421091527338f72b6a42cfc441c94acdad51b7ede680b44515724bacd3c715e8878e339ed84b80b16186f14750c2c4f3edb9
7
+ data.tar.gz: ba0bfebc3ed03a62a4321e389202992f7bf988cf00a3a99d6651569fedd46d1496839a35d037f7815e5b336c5ca2af54ae5e60cdd46544b2fdb87d28a128d381
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- openbox (0.3.1)
4
+ openbox (0.4.0)
5
5
  thor (~> 1.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -51,10 +51,29 @@ The commands are pre-defined for the Rack and Rails applications.
51
51
  | `AUTO_MIGRATION` | When present, the `migrate` will run before `server` started |
52
52
  | `DATABASE_URL` | When `pg` or `mysql2` gem present, Openbox will use it to ensure database connection |
53
53
 
54
+ ### Customize Commands
55
+
56
+ When `openbox` execute, the `lib/openbox/commands/*/**.rb` will be scanned and require before started.
57
+ We can register new command by adding files to `lib/openbox/commands` directory.
58
+
59
+ ```ruby
60
+ # lib/openbox/commands/daemon.rb
61
+
62
+ class Daemon < Openbox::Command
63
+ def execute
64
+ exec('bundle exec my-daemon')
65
+ end
66
+ end
67
+
68
+ Openbox::Entrypoint.register Daemon, :daemon, :daemon, 'Run a daemon'
69
+ ```
70
+
71
+ > The Rails are not loaded to speed up bootstrap, if you need Rails please load by yourself.
72
+
54
73
  ## Roadmap
55
74
 
56
75
  * [ ] `config/openbox.rb` config
57
- * [ ] Customize command
76
+ * [x] Customize command
58
77
  * [x] Database connection check
59
78
  * [x] PostgreSQL support
60
79
  * [x] MySQL support
data/exe/openbox CHANGED
@@ -4,4 +4,14 @@
4
4
 
5
5
  require 'openbox'
6
6
 
7
+ CUSTOMIZE_COMMAND_ROOT = if defined?(Bundler)
8
+ Bundler.root.join('lib/openbox/commands')
9
+ else
10
+ Pathname.new(Dir.pwd).join('lib/openbox/commands')
11
+ end
12
+
13
+ CUSTOMIZE_COMMAND_ROOT.glob('**/*.rb') do |command|
14
+ require command
15
+ end
16
+
7
17
  Openbox::Entrypoint.start(ARGV)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Openbox
4
- VERSION = '0.3.1'
4
+ VERSION = '0.4.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - 蒼時弦也
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-18 00:00:00.000000000 Z
11
+ date: 2022-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor