rexer 0.8.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -8
- data/lib/rexer/commands/envs.rb +2 -4
- data/lib/rexer/definition/dsl.rb +6 -4
- data/lib/rexer/extension/plugin.rb +8 -7
- data/lib/rexer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1db7d4adf66ad78aae372f512810ade8001893feadc4233da362ad2bffaa5f58
|
4
|
+
data.tar.gz: a5b03b4d24061a734c2525b1b6251c8e905c4055b7ab7c7fc42a8c6edb5ad13c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb41f315f2e2881f08a6e8831df01809ac9a36b10734289201d430bdf9bba91d13fe02fc64e7c730e4a268442cadfbe5bba1e1057f0f0967f41e250fb3e5b9d7
|
7
|
+
data.tar.gz: 806b8384297143c5d1e27b44a2a79106203b87133c41233e85c05510da0e590b9bd81b9cd96b6199bab09c2f4a45d1aa28e1174b4894146b7fcbf87afbe3098d
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ Rexer is a command-line tool for managing Redmine Extension (Plugin and Theme).
|
|
16
16
|
|
17
17
|
It is mainly aimed at helping with the development of Redmine and its plugins, allowing you to define extensions in a Ruby DSL and install, uninstall, update, and switch between different sets of the extensions.
|
18
18
|
|
19
|
-
[![
|
19
|
+
[![demo](docs/demo-v0.8.0.gif)](https://asciinema.org/a/672754)
|
20
20
|
|
21
21
|
## What is Redmine Extension?
|
22
22
|
|
@@ -80,14 +80,19 @@ This command uninstalls the extensions and deletes the `.extensions.lock`.
|
|
80
80
|
```
|
81
81
|
$ rex
|
82
82
|
Commands:
|
83
|
-
rex help [COMMAND] # Describe available commands or one specific command
|
84
83
|
rex envs # Show the list of defined environments in .extensions.rb
|
85
|
-
rex
|
84
|
+
rex help [COMMAND] # Describe available commands or one specific command
|
85
|
+
rex init # Create a new .extensions.rb file
|
86
|
+
rex install [ENV] # Install the definitions in .extensions.rb for the specified environment
|
86
87
|
rex state # Show the current state of the installed extensions
|
87
|
-
rex switch [ENV] # Uninstall extensions for the currently installed environment and install
|
88
|
-
rex uninstall # Uninstall extensions for the currently installed environment
|
88
|
+
rex switch [ENV] # Uninstall extensions for the currently installed environment and install ext...
|
89
|
+
rex uninstall # Uninstall extensions for the currently installed environment based on the st...
|
89
90
|
rex update # Update extensions for the currently installed environment to the latest version
|
90
91
|
rex version # Show Rexer version
|
92
|
+
|
93
|
+
Options:
|
94
|
+
-v, [--verbose], [--no-verbose], [--skip-verbose] # Detailed output
|
95
|
+
-q, [--quiet], [--no-quiet], [--skip-quiet] # Minimal output
|
91
96
|
```
|
92
97
|
|
93
98
|
### rex install [ENV]
|
@@ -112,19 +117,21 @@ Loads `.extensions.lock` and updates the currently installed extensions to the l
|
|
112
117
|
You can define an environment and extensions for each environment using the `env ... do - end` block.
|
113
118
|
|
114
119
|
```ruby
|
115
|
-
theme :bleuclair, github: { repo: "farend/redmine_theme_farend_bleuclair" }
|
116
120
|
plugin :redmine_issues_panel, git: { url: "https://github.com/redmica/redmine_issues_panel" }
|
117
121
|
|
118
122
|
env :stable do
|
119
|
-
theme :bleuclair, github: { repo: "farend/redmine_theme_farend_bleuclair", branch: "support-propshaft" }
|
120
123
|
plugin :redmine_issues_panel, git: { url: "https://github.com/redmica/redmine_issues_panel", tag: "v1.0.2" }
|
121
124
|
end
|
125
|
+
|
126
|
+
env :default, :stable do
|
127
|
+
theme :bleuclair, github: { repo: "farend/redmine_theme_farend_bleuclair", branch: "support-propshaft" }
|
128
|
+
end
|
122
129
|
```
|
123
130
|
|
124
131
|
Definitions other than `env ... do - end` are implicitly defined as `env :default do - end`. Therefore, the above is resolved as follows:
|
125
132
|
|
126
133
|
* default env
|
127
|
-
* bleuclair (
|
134
|
+
* bleuclair (support-propshaft)
|
128
135
|
* redmine_issues_panel (master)
|
129
136
|
* stable env
|
130
137
|
* bleuclair (support-propshaft)
|
data/lib/rexer/commands/envs.rb
CHANGED
@@ -6,9 +6,7 @@ module Rexer
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def call
|
9
|
-
defined_envs
|
10
|
-
puts _1
|
11
|
-
end
|
9
|
+
puts(*defined_envs)
|
12
10
|
end
|
13
11
|
|
14
12
|
private
|
@@ -17,7 +15,7 @@ module Rexer
|
|
17
15
|
|
18
16
|
def defined_envs
|
19
17
|
all_envs = definition.plugins.map(&:env) + definition.themes.map(&:env)
|
20
|
-
all_envs.uniq
|
18
|
+
all_envs.uniq.sort
|
21
19
|
end
|
22
20
|
end
|
23
21
|
end
|
data/lib/rexer/definition/dsl.rb
CHANGED
@@ -25,11 +25,13 @@ module Rexer
|
|
25
25
|
)
|
26
26
|
end
|
27
27
|
|
28
|
-
def env(
|
29
|
-
|
28
|
+
def env(*env_names, &dsl)
|
29
|
+
env_names.each do |env_name|
|
30
|
+
data = self.class.new(env_name).tap { _1.instance_eval(&dsl) }.to_data
|
30
31
|
|
31
|
-
|
32
|
-
|
32
|
+
@plugins += data.plugins
|
33
|
+
@themes += data.themes
|
34
|
+
end
|
33
35
|
end
|
34
36
|
|
35
37
|
def to_data
|
@@ -39,14 +39,14 @@ module Rexer
|
|
39
39
|
return unless needs_db_migration?
|
40
40
|
|
41
41
|
envs = {"NAME" => name.to_s}.merge(extra_envs)
|
42
|
-
cmds =
|
42
|
+
cmds = build_cmd("bundle", "exec", "rake", Rexer.verbosity.debug? ? nil : "-q", "redmine:plugins:migrate", envs:)
|
43
43
|
|
44
|
-
broadcast(:processing, "Execute #{cmds}
|
44
|
+
broadcast(:processing, "Execute #{cmds}")
|
45
45
|
|
46
46
|
if Rexer.verbosity.debug?
|
47
|
-
system(
|
47
|
+
system(cmds, exception: true)
|
48
48
|
else
|
49
|
-
_, error, status = Open3.capture3(
|
49
|
+
_, error, status = Open3.capture3(cmds)
|
50
50
|
raise error unless status.success?
|
51
51
|
end
|
52
52
|
end
|
@@ -55,8 +55,9 @@ module Rexer
|
|
55
55
|
@source ||= Source.from_definition(definition.source)
|
56
56
|
end
|
57
57
|
|
58
|
-
def
|
59
|
-
[
|
58
|
+
def build_cmd(*command, envs: {})
|
59
|
+
envs_str = envs.map { [_1, _2].join("=") }
|
60
|
+
[Rexer.config.command_prefix, *command, *envs_str].compact.join(" ")
|
60
61
|
end
|
61
62
|
end
|
62
63
|
|
@@ -86,7 +87,7 @@ module Rexer
|
|
86
87
|
def run_bundle_install
|
87
88
|
return unless plugin_dir.join("Gemfile").exist?
|
88
89
|
|
89
|
-
cmds =
|
90
|
+
cmds = build_cmd("bundle", "install", Rexer.verbosity.debug? ? nil : "--quiet")
|
90
91
|
|
91
92
|
broadcast(:processing, "Execute #{cmds}")
|
92
93
|
|
data/lib/rexer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rexer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katsuya Hidaka
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|