rexer 0.9.1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -3
- data/lib/rexer/cli.rb +1 -1
- data/lib/rexer/commands/envs.rb +15 -4
- data/lib/rexer/commands/init.rb +2 -0
- data/lib/rexer/commands/install.rb +6 -3
- data/lib/rexer/definition/data.rb +5 -15
- data/lib/rexer/definition/dsl.rb +11 -4
- data/lib/rexer/definition/lock.rb +7 -4
- data/lib/rexer/source/base.rb +0 -4
- data/lib/rexer/source.rb +0 -2
- data/lib/rexer/version.rb +1 -1
- data/lib/rexer.rb +0 -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: 86612492af231c5ed6d00b8fe44c305a62013b2aeb3571bbb70c4d53e8ed6b30
|
4
|
+
data.tar.gz: 1cf5c21eb32b9a30829c1dcc9b823902dd9a560190a44ae9976288f4c340e5f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da47f60be431db339d94dbaa944b4732495cc2f29088413826a3828c03c6e140fa438c967f38ed68881058f89d2caff0c3751adf569c9110579e508c29016135
|
7
|
+
data.tar.gz: 4c48a3ebffb2341d93adde02983cb9019587e00f0be83060f57237967c07fa955a94e2ba34a129392d33be3bc862b557586b931dc02ad4e74135556f17dc239c
|
data/README.md
CHANGED
@@ -80,13 +80,13 @@ This command uninstalls the extensions and deletes the `.extensions.lock`.
|
|
80
80
|
```
|
81
81
|
$ rex
|
82
82
|
Commands:
|
83
|
-
rex envs # Show the list of defined
|
83
|
+
rex envs # Show the list of environments and their extensions defined in .extensions.rb
|
84
84
|
rex help [COMMAND] # Describe available commands or one specific command
|
85
85
|
rex init # Create a new .extensions.rb file
|
86
86
|
rex install [ENV] # Install the definitions in .extensions.rb for the specified environment
|
87
87
|
rex state # Show the current state of the installed extensions
|
88
|
-
rex switch [ENV] # Uninstall extensions for the currently installed environment and install
|
89
|
-
rex uninstall # Uninstall extensions for the currently installed environment based on the
|
88
|
+
rex switch [ENV] # Uninstall extensions for the currently installed environment and install extensions for the specified environment
|
89
|
+
rex uninstall # Uninstall extensions for the currently installed environment based on the state in .extensions.lock and remove the lock file
|
90
90
|
rex update # Update extensions for the currently installed environment to the latest version
|
91
91
|
rex version # Show Rexer version
|
92
92
|
|
@@ -166,7 +166,12 @@ In addition, you can define as many environments as you like, and list the defin
|
|
166
166
|
```
|
167
167
|
$ rex envs
|
168
168
|
default
|
169
|
+
bleuclair (support-propshaft)
|
170
|
+
redmine_issues_panel (master)
|
171
|
+
|
169
172
|
stable
|
173
|
+
bleuclair (support-propshaft)
|
174
|
+
redmine_issues_panel (v1.0.2)
|
170
175
|
```
|
171
176
|
|
172
177
|
### Defining hooks
|
data/lib/rexer/cli.rb
CHANGED
@@ -39,7 +39,7 @@ module Rexer
|
|
39
39
|
Commands::State.new.call
|
40
40
|
end
|
41
41
|
|
42
|
-
desc "envs", "Show the list of defined
|
42
|
+
desc "envs", "Show the list of environments and their extensions defined in .extensions.rb"
|
43
43
|
def envs
|
44
44
|
Commands::Envs.new.call
|
45
45
|
end
|
data/lib/rexer/commands/envs.rb
CHANGED
@@ -6,16 +6,27 @@ module Rexer
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def call
|
9
|
-
|
9
|
+
defined_envs = definition.envs
|
10
|
+
defined_envs.each.with_index do |env, i|
|
11
|
+
puts env
|
12
|
+
|
13
|
+
definition_with(env).then { _1.themes + _1.plugins }.each do
|
14
|
+
puts " #{_1.name} (#{Source.from_definition(_1.source).info})"
|
15
|
+
end
|
16
|
+
|
17
|
+
puts if i < defined_envs.size - 1
|
18
|
+
end
|
10
19
|
end
|
11
20
|
|
12
21
|
private
|
13
22
|
|
14
23
|
attr_reader :definition
|
15
24
|
|
16
|
-
def
|
17
|
-
|
18
|
-
|
25
|
+
def definition_with(env)
|
26
|
+
definition.with(
|
27
|
+
plugins: definition.plugins.select { _1.env == env },
|
28
|
+
themes: definition.themes.select { _1.env == env }
|
29
|
+
)
|
19
30
|
end
|
20
31
|
end
|
21
32
|
end
|
data/lib/rexer/commands/init.rb
CHANGED
@@ -37,9 +37,12 @@ module Rexer
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def load_definition(env)
|
40
|
-
Definition.load_data
|
41
|
-
|
42
|
-
|
40
|
+
data = Definition.load_data
|
41
|
+
data.with(
|
42
|
+
plugins: data.plugins.select { _1.env == env },
|
43
|
+
themes: data.themes.select { _1.env == env },
|
44
|
+
env:
|
45
|
+
)
|
43
46
|
end
|
44
47
|
|
45
48
|
def load_lock_definition
|
@@ -1,22 +1,12 @@
|
|
1
1
|
module Rexer
|
2
2
|
module Definition
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
def initialize(plugins, themes, env: nil, version: nil)
|
8
|
-
@plugins = plugins
|
9
|
-
@themes = themes
|
10
|
-
@env = env
|
11
|
-
@version = version
|
12
|
-
end
|
13
|
-
|
14
|
-
def plugins
|
15
|
-
env ? @plugins.select { _1.env == env } : @plugins
|
3
|
+
Data = ::Data.define(:plugins, :themes, :env, :version) do
|
4
|
+
def initialize(plugins:, themes:, env: nil, version: nil)
|
5
|
+
super
|
16
6
|
end
|
17
7
|
|
18
|
-
def
|
19
|
-
env
|
8
|
+
def envs
|
9
|
+
(plugins.map(&:env) + themes.map(&:env)).uniq.sort
|
20
10
|
end
|
21
11
|
|
22
12
|
def diff(other)
|
data/lib/rexer/definition/dsl.rb
CHANGED
@@ -1,10 +1,17 @@
|
|
1
1
|
module Rexer
|
2
2
|
module Definition
|
3
3
|
class Dsl
|
4
|
-
def initialize
|
4
|
+
def initialize
|
5
5
|
@plugins = []
|
6
6
|
@themes = []
|
7
|
-
@env =
|
7
|
+
@env = :default
|
8
|
+
end
|
9
|
+
|
10
|
+
class EnvDsl < self
|
11
|
+
def initialize(env)
|
12
|
+
super()
|
13
|
+
@env = env
|
14
|
+
end
|
8
15
|
end
|
9
16
|
|
10
17
|
def plugin(name, **opts, &hooks)
|
@@ -27,7 +34,7 @@ module Rexer
|
|
27
34
|
|
28
35
|
def env(*env_names, &dsl)
|
29
36
|
env_names.each do |env_name|
|
30
|
-
data =
|
37
|
+
data = EnvDsl.new(env_name).tap { _1.instance_eval(&dsl) }.to_data
|
31
38
|
|
32
39
|
@plugins += data.plugins
|
33
40
|
@themes += data.themes
|
@@ -56,7 +63,7 @@ module Rexer
|
|
56
63
|
end
|
57
64
|
|
58
65
|
def build_source(opts)
|
59
|
-
type = opts.keys.find { Rexer::Source.
|
66
|
+
type = opts.keys.find { Rexer::Source.const_defined?(_1.capitalize) }
|
60
67
|
Source.new(type, opts[type]) if type
|
61
68
|
end
|
62
69
|
end
|
@@ -23,17 +23,20 @@ module Rexer
|
|
23
23
|
|
24
24
|
class Dsl < Definition::Dsl
|
25
25
|
def lock(env:, version:)
|
26
|
-
|
26
|
+
@lock_env = env
|
27
|
+
@lock_version = version
|
27
28
|
end
|
28
29
|
|
29
30
|
def to_data
|
30
|
-
|
31
|
+
plugins = lock_by_env(@plugins)
|
32
|
+
themes = lock_by_env(@themes)
|
33
|
+
Definition::Data.new(plugins, themes, @lock_env, @lock_version)
|
31
34
|
end
|
32
35
|
|
33
36
|
private
|
34
37
|
|
35
|
-
def
|
36
|
-
@
|
38
|
+
def lock_by_env(plugins_or_themes)
|
39
|
+
plugins_or_themes.select { _1.env == @lock_env }
|
37
40
|
end
|
38
41
|
end
|
39
42
|
end
|
data/lib/rexer/source/base.rb
CHANGED
data/lib/rexer/source.rb
CHANGED
data/lib/rexer/version.rb
CHANGED
data/lib/rexer.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.11.0
|
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-09-
|
11
|
+
date: 2024-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|