openbox 0.2.0 → 0.3.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: 905c948832fb826dd639688aafec9e39fc2527ed047bb35ee1a8871a198acc31
4
- data.tar.gz: b3568ee2c518336993a421abbd24c841c1ce776792a98e62c124123e57d37de9
3
+ metadata.gz: 9b7208531d38a833b1fa220eb2efe9f50b12f2e45287e2556db3f85fbb8028b1
4
+ data.tar.gz: 8a2f7c98ae40aa2367627d91d1065018dd02af76e7befbe0881fac9f0a131ddc
5
5
  SHA512:
6
- metadata.gz: 372e2b1efd3dcd11e33798d5c094be2348c7e1553a5f304d571178a77370d63360b089f0051dc69b3745fead40093a0d32175893b7f41fc64a6f6e379a5831ce
7
- data.tar.gz: 60156481a01491f8ba3aaa3612cb4c573f643dd4e13c8922e5d9b8c9639c7331061582aead5071fd762d6c9fa7f627dd3a137bde626ffb5b942b0c569f51d313
6
+ metadata.gz: d32b9ce88a4f3f1b6047291e91274561c17fed72be4f20e8fae01ce0cc7015b0ea77ddd528b877e48c0a99a3b87e3ecf71f155983ff41e080ebf015832e2bce5
7
+ data.tar.gz: c1431901ca2163695024dba1bf7f6e2e7ea310e07c422b4ab8e5a93873bbb7e75431d46cf665d1cbf49fa4004c0c87f3a4f0d6308a8bcea6b54d1619209c566c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- openbox (0.2.0)
4
+ openbox (0.3.0)
5
5
  thor (~> 1.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Openbox
2
2
 
3
+ ![main branch](https://github.com/elct9620/openbox/actions/workflows/main.yml/badge.svg?branch=main)
4
+
3
5
  The zero-configuration Ruby container entry-point.
4
6
 
5
7
  ## Installation
@@ -29,12 +31,44 @@ ENTRYPOINT ["bin/openbox"]
29
31
  CMD ["server"]
30
32
  ```
31
33
 
34
+ ### Commands
35
+
36
+ The commands are pre-defined for the Rack and Rails applications.
37
+
38
+ | Name | Enabled Condition | Description |
39
+ |-----------|-------------------|--------------------------|
40
+ | `server` | `rails` or `rack` | Start application server |
41
+ | `rake` | `rails` or `rake` | Run rake tasks |
42
+ | `console` | `rails` | Start rails console |
43
+ | `migrate` | `rails` | Run database migration |
44
+ | `seed` | `rails` | Run database seed |
45
+ | `sidekiq` | `sidekiq` | Run sidekiq server |
46
+
47
+ ### Environments
48
+
49
+ | Name | Description |
50
+ |------------------|--------------------------------------------------------------------------------------|
51
+ | `AUTO_MIGRATION` | When present, the `migrate` will run before `server` started |
52
+ | `DATABASE_URL` | When `pg` or `mysql2` gem present, Openbox will use it to ensure database connection |
53
+
32
54
  ## Roadmap
33
55
 
34
56
  * [ ] `config/openbox.rb` config
35
57
  * [ ] Customize command
36
- * [ ] Rake Task support
37
- * [ ] Rails capability
58
+ * [x] Database connection check
59
+ * [x] PostgreSQL support
60
+ * [x] MySQL support
61
+ * [x] Run Web Server
62
+ * [x] `rails server`
63
+ * [x] `rackup -o 0.0.0.0`
64
+ * [x] Rake Task support
65
+ * [x] Sidekiq support
66
+ * [x] Rails capability
67
+ * [x] `openbox console` to `rails console`
68
+ * [x] `openbox migrate` to `rails db:migrate`
69
+ * [x] `openbox seed` to `rails db:seed`
70
+ * [x] Use `AUTO_MIGRATION` to run migration before server started
71
+
38
72
 
39
73
  ## Development
40
74
 
@@ -12,7 +12,7 @@ module Openbox
12
12
  # @since 0.1.0
13
13
  def execute
14
14
  Openbox.database.ensure_connection!
15
- exec('bundle exec rails db:migrate')
15
+ system('bundle exec rails db:migrate')
16
16
  end
17
17
  end
18
18
 
@@ -12,7 +12,7 @@ module Openbox
12
12
  # @since 0.1.0
13
13
  def execute
14
14
  Openbox.database.ensure_connection!
15
- exec("bundle exec rake #{args}")
15
+ exec("bundle exec rake #{args.join(' ')}")
16
16
  end
17
17
  end
18
18
 
@@ -12,7 +12,7 @@ module Openbox
12
12
  # @since 0.1.0
13
13
  def execute
14
14
  Openbox.database.ensure_connection!
15
- exec('bundle exec rails db:seed')
15
+ system('bundle exec rails db:seed')
16
16
  end
17
17
  end
18
18
 
@@ -12,6 +12,7 @@ module Openbox
12
12
  # @since 0.1.0
13
13
  def execute
14
14
  Openbox.database.ensure_connection!
15
+ invoke Migrate unless ENV['AUTO_MIGRATION'].nil?
15
16
  return exec('bundle exec rails server') if Openbox.runtime.rails?
16
17
 
17
18
  exec('bundle exec rackup -o 0.0.0.0')
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Openbox
4
- VERSION = '0.2.0'
4
+ VERSION = '0.3.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.2.0
4
+ version: 0.3.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-01 00:00:00.000000000 Z
11
+ date: 2021-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor