rexer 0.4.0 → 0.5.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 +4 -4
- data/README.md +5 -7
- data/lib/rexer/commands/install.rb +7 -7
- data/lib/rexer/definition/data.rb +2 -3
- data/lib/rexer/definition/dsl.rb +1 -6
- data/lib/rexer/definition/lock.rb +1 -1
- data/lib/rexer/definition.rb +0 -11
- data/lib/rexer/extension/plugin.rb +3 -4
- data/lib/rexer/version.rb +1 -1
- data/lib/rexer.rb +15 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bb969edc94e8ed8a471a4de3b393768e471b75f4b200637235cc05d247e15f5
|
4
|
+
data.tar.gz: 93655f0b69f0f02f91920f9f09f56339f71caefe68e8be78eb276e9cbeaaebba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e69305a1d92ba1445eada1931379b590b6186cc09dffa12e3598d4a3b8a94c862f868828e21b7e19910280bef08dd13a5f42c74d28a4134d109fd64a3178c931
|
7
|
+
data.tar.gz: 8508080c6d1a030b8ca1de6d2bb16cf547014dbe9a777b4b838cb6e7d40e8d773977519462f8fb5f547cf354d0d912f8b93cab8571552f3edd5423ad1250a4ce
|
data/README.md
CHANGED
@@ -120,17 +120,15 @@ plugin :redmica_s3, github: { repo: "redmica/redmica_s3" } do
|
|
120
120
|
end
|
121
121
|
```
|
122
122
|
|
123
|
-
|
123
|
+
### Configuring the command prefix
|
124
124
|
|
125
|
-
You can
|
125
|
+
You can set a prefix for the commands such as `bundle install` that Rexer executes with the `REXER_COMMAND_PREFIX` environment variable.
|
126
126
|
|
127
|
-
```
|
128
|
-
|
129
|
-
|
130
|
-
plugin :some_plugin_with_db_migration, github: { repo: "some_plugin" }
|
127
|
+
```
|
128
|
+
export REXER_COMMAND_PREFIX="docker compose exec -T app"
|
131
129
|
```
|
132
130
|
|
133
|
-
In the above
|
131
|
+
In the above case, the `bin/rails redmine:plugins:migrate` command is executed as `docker compose exec -T app bin/rails redmine:plugins:migrate`.
|
134
132
|
|
135
133
|
## Developing
|
136
134
|
|
@@ -17,7 +17,7 @@ module Rexer
|
|
17
17
|
private
|
18
18
|
|
19
19
|
def install_initially(definition)
|
20
|
-
install(definition.themes, definition.plugins
|
20
|
+
install(definition.themes, definition.plugins)
|
21
21
|
|
22
22
|
create_lock_file(definition.env)
|
23
23
|
print_state
|
@@ -26,8 +26,8 @@ module Rexer
|
|
26
26
|
def apply_diff(lock_definition, definition)
|
27
27
|
diff = lock_definition.diff(definition)
|
28
28
|
|
29
|
-
install(diff.added_themes, diff.added_plugins
|
30
|
-
uninstall(diff.deleted_themes, diff.deleted_plugins
|
29
|
+
install(diff.added_themes, diff.added_plugins)
|
30
|
+
uninstall(diff.deleted_themes, diff.deleted_plugins)
|
31
31
|
reload_source(diff.source_changed_themes, diff.source_changed_plugins)
|
32
32
|
|
33
33
|
create_lock_file(definition.env)
|
@@ -44,23 +44,23 @@ module Rexer
|
|
44
44
|
Definition::Lock.load_data if Definition::Lock.file.exist?
|
45
45
|
end
|
46
46
|
|
47
|
-
def install(themes, plugins
|
47
|
+
def install(themes, plugins)
|
48
48
|
themes.each do
|
49
49
|
Extension::Theme::Installer.new(_1).install
|
50
50
|
end
|
51
51
|
|
52
52
|
plugins.each do
|
53
|
-
Extension::Plugin::Installer.new(_1
|
53
|
+
Extension::Plugin::Installer.new(_1).install
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
def uninstall(themes, plugins
|
57
|
+
def uninstall(themes, plugins)
|
58
58
|
themes.each do
|
59
59
|
Extension::Theme::Uninstaller.new(_1).uninstall
|
60
60
|
end
|
61
61
|
|
62
62
|
plugins.each do
|
63
|
-
Extension::Plugin::Uninstaller.new(_1
|
63
|
+
Extension::Plugin::Uninstaller.new(_1).uninstall
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
@@ -2,12 +2,11 @@ module Rexer
|
|
2
2
|
module Definition
|
3
3
|
class Data
|
4
4
|
attr_accessor :env
|
5
|
-
attr_reader :
|
5
|
+
attr_reader :version
|
6
6
|
|
7
|
-
def initialize(plugins, themes,
|
7
|
+
def initialize(plugins, themes, env: nil, version: nil)
|
8
8
|
@plugins = plugins
|
9
9
|
@themes = themes
|
10
|
-
@config = config
|
11
10
|
@env = env
|
12
11
|
@version = version
|
13
12
|
end
|
data/lib/rexer/definition/dsl.rb
CHANGED
@@ -5,7 +5,6 @@ module Rexer
|
|
5
5
|
@plugins = []
|
6
6
|
@themes = []
|
7
7
|
@env = env
|
8
|
-
@config = nil
|
9
8
|
end
|
10
9
|
|
11
10
|
def plugin(name, **opts, &hooks)
|
@@ -33,12 +32,8 @@ module Rexer
|
|
33
32
|
@themes += data.themes
|
34
33
|
end
|
35
34
|
|
36
|
-
def config(command_prefix: nil)
|
37
|
-
@config = Definition::Config.new(command_prefix)
|
38
|
-
end
|
39
|
-
|
40
35
|
def to_data
|
41
|
-
Definition::Data.new(@plugins, @themes
|
36
|
+
Definition::Data.new(@plugins, @themes)
|
42
37
|
end
|
43
38
|
|
44
39
|
private
|
data/lib/rexer/definition.rb
CHANGED
@@ -10,17 +10,6 @@ module Rexer
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
Config = ::Data.define(
|
14
|
-
# The prefix of the command such as bundle install and bin/rails redmine:plugins:migrate.
|
15
|
-
#
|
16
|
-
# For example, if the command_prefix is set "docker compose exec -T app",
|
17
|
-
# then bundle install will be executed as follows:
|
18
|
-
#
|
19
|
-
# docker compose exec -T app bundle install
|
20
|
-
#
|
21
|
-
:command_prefix
|
22
|
-
)
|
23
|
-
|
24
13
|
Source = ::Data.define(:type, :options)
|
25
14
|
|
26
15
|
Plugin = ::Data.define(:name, :source, :hooks, :env) do
|
@@ -8,16 +8,15 @@ module Rexer
|
|
8
8
|
end
|
9
9
|
|
10
10
|
class Base
|
11
|
-
def initialize(definition
|
11
|
+
def initialize(definition)
|
12
12
|
@definition = definition
|
13
13
|
@name = definition.name
|
14
14
|
@hooks = definition.hooks || {}
|
15
|
-
@config = config
|
16
15
|
end
|
17
16
|
|
18
17
|
private
|
19
18
|
|
20
|
-
attr_reader :name, :hooks, :definition
|
19
|
+
attr_reader :name, :hooks, :definition
|
21
20
|
|
22
21
|
def plugin_dir
|
23
22
|
@plugin_dir ||= Plugin.dir.join(name.to_s)
|
@@ -47,7 +46,7 @@ module Rexer
|
|
47
46
|
end
|
48
47
|
|
49
48
|
def cmd_with_prefix(command)
|
50
|
-
[config
|
49
|
+
[Rexer.config.command_prefix, command].compact.join(" ")
|
51
50
|
end
|
52
51
|
end
|
53
52
|
|
data/lib/rexer/version.rb
CHANGED
data/lib/rexer.rb
CHANGED
@@ -6,6 +6,21 @@ module Rexer
|
|
6
6
|
def self.definition_lock_file
|
7
7
|
".extensions.lock"
|
8
8
|
end
|
9
|
+
|
10
|
+
Config = Data.define(
|
11
|
+
# The prefix of the command such as bundle install and bin/rails redmine:plugins:migrate.
|
12
|
+
#
|
13
|
+
# For example, if the command_prefix is set "docker compose exec -T app",
|
14
|
+
# then bundle install will be executed as follows:
|
15
|
+
#
|
16
|
+
# docker compose exec -T app bundle install
|
17
|
+
#
|
18
|
+
:command_prefix
|
19
|
+
)
|
20
|
+
|
21
|
+
def self.config
|
22
|
+
@config ||= Config.new(command_prefix: ENV["REXER_COMMAND_PREFIX"])
|
23
|
+
end
|
9
24
|
end
|
10
25
|
|
11
26
|
require "pathname"
|