rexer 0.15.0 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a65472e424f27d1a96fa1be7093fcb9eac2f59606dd9b93c907dfec412b8309d
4
- data.tar.gz: b56d1515e26fd98f800c772f64511bd241c83e1e0b706f4bbdd6b2cbf734a375
3
+ metadata.gz: 61d1b3b0172a3db2da03ac1f428f447a5296df8430fabaf21f4ce1cb1f96ce41
4
+ data.tar.gz: 8dc2852d1ef7f6052d2c8d09cba035276fd7b039bc109be732d0599142a27059
5
5
  SHA512:
6
- metadata.gz: bdeb0d3f7855f8fef1710f0d7918ce2b24c39004ac2cc0fa3ddd3c1e201eb5bf3afef7c08531caa539842189eb95fa99fd11166bdbcfc8fbef4ea5345541d2c8
7
- data.tar.gz: 160d63e6239cd0d417443d2935c35a826340040cc917c28f29d3827e5e9db53bcacdc28a45c9a665f12e4087a88b436407258fe995dfd1ab08a30a25cd057783
6
+ metadata.gz: 72c9335b6be10bb6a7220d3b632ce2d0c20719165b5e93d17244e5f8c4412ea8fad0b36e805ae1cba51ef652d77afce8dd98676bfe1dcfb0b14e24249cf4fa8d
7
+ data.tar.gz: b708a563d706ba42aad33a1daa40a5d7a7c4365c481be516d423a2a05176f8b4c0f6ef68afae27ca571ba55a99f03b3dbf51e10de497f91f672f781ff87a762a
data/README.md CHANGED
@@ -79,23 +79,23 @@ This command uninstalls the extensions and deletes the `.extensions.lock`.
79
79
  ```
80
80
  $ rex
81
81
  Commands:
82
- rex envs # Show the list of environments and their extensions defined in .extensions.rb
83
- rex help [COMMAND] # Describe available commands or one specific command
84
- rex init # Create a new .extensions.rb file
85
- rex install [ENV] # Install the definitions in .extensions.rb for the specified environment
86
- rex reinstall [PLUGIN or THEME] # Uninstall extensions for the currently installed environment and install them again
87
- rex state # Show the current state of the installed extensions
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
- rex update # Update extensions for the currently installed environment to the latest version if extensions are updateable
91
- rex version # Show Rexer version
82
+ rex envs # Show the list of environments and their extensions defined in .extensions.rb
83
+ rex help [COMMAND] # Describe available commands or one specific command
84
+ rex init # Create a new .extensions.rb file
85
+ rex install [env] # Install the definitions in .extensions.rb for the specified environment
86
+ rex reinstall [extension] # Uninstall extensions for the currently installed environment and install them again
87
+ rex state # Show the current state of the installed extensions
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
+ rex update [extensions...] # Update extensions for the currently installed environment to the latest version if extensions are updateable. If no extensions are specified, all extensions are updated
91
+ rex version # Show Rexer version
92
92
 
93
93
  Options:
94
94
  -v, [--verbose], [--no-verbose], [--skip-verbose] # Detailed output
95
95
  -q, [--quiet], [--no-quiet], [--skip-quiet] # Minimal output
96
96
  ```
97
97
 
98
- ### rex install [ENV]
98
+ ### rex install [env]
99
99
 
100
100
  Installs extensions in the specified ENV environment and makes them available for use. Specifically, it does the following:
101
101
 
@@ -106,7 +106,7 @@ If the specified ENV is currently installed, it compares the current `.extension
106
106
  * Uninstalls deleted extensions (the `uninstalled` hook is executed).
107
107
  * Reload extensions whose source settings has changed (for example, the `branch` or `tag` has changed) and runs the database migration if necessary.
108
108
 
109
- ### rex update
109
+ ### rex update [extensions...]
110
110
 
111
111
  Loads `.extensions.lock` and updates the currently installed extensions to the latest version. `.extensions.rb` is NOT referenced in this command.
112
112
 
data/lib/rexer/cli.rb CHANGED
@@ -15,7 +15,7 @@ module Rexer
15
15
  Commands::Init.new.call
16
16
  end
17
17
 
18
- desc "install [ENV]", "Install the definitions in .extensions.rb for the specified environment"
18
+ desc "install [env]", "Install the definitions in .extensions.rb for the specified environment"
19
19
  def install(env = "default")
20
20
  Commands::Install.new.call(env&.to_sym)
21
21
  end
@@ -25,19 +25,19 @@ module Rexer
25
25
  Commands::Uninstall.new.call
26
26
  end
27
27
 
28
- desc "reinstall [PLUGIN or THEME]", "Uninstall extensions for the currently installed environment and install them again"
28
+ desc "reinstall [extension]", "Uninstall extensions for the currently installed environment and install them again"
29
29
  def reinstall(extension_name)
30
30
  Commands::Reinstall.new.call(extension_name)
31
31
  end
32
32
 
33
- desc "switch [ENV]", "Uninstall extensions for the currently installed environment and install extensions for the specified environment"
33
+ desc "switch [env]", "Uninstall extensions for the currently installed environment and install extensions for the specified environment"
34
34
  def switch(env = "default")
35
35
  Commands::Switch.new.call(env&.to_sym)
36
36
  end
37
37
 
38
- desc "update", "Update extensions for the currently installed environment to the latest version if extensions are updateable"
39
- def update
40
- Commands::Update.new.call
38
+ desc "update [extensions...]", "Update extensions for the currently installed environment to the latest version if extensions are updateable. If no extensions are specified, all extensions are updated"
39
+ def update(*extension_names)
40
+ Commands::Update.new.call(extension_names)
41
41
  end
42
42
 
43
43
  desc "state", "Show the current state of the installed extensions"
@@ -7,29 +7,37 @@ module Rexer
7
7
  @lock_definition = Definition::Lock.load_data
8
8
  end
9
9
 
10
- def call
10
+ def call(extension_names)
11
11
  return if no_lock_file_found
12
12
 
13
- update_themes
14
- update_plugins
13
+ extension_names ||= []
14
+ extension_names.map!(&:to_sym)
15
+
16
+ update_themes(extension_names)
17
+ update_plugins(extension_names)
15
18
  end
16
19
 
17
20
  private
18
21
 
19
22
  attr_reader :lock_definition
20
23
 
21
- def update_plugins
22
- lock_definition.plugins.each do
24
+ def update_plugins(extension_names)
25
+ filter_by_name(lock_definition.plugins, extension_names).each do
23
26
  call_action Extension::Plugin::Update, _1
24
27
  end
25
28
  end
26
29
 
27
- def update_themes
28
- lock_definition.themes.each do
30
+ def update_themes(extension_names)
31
+ filter_by_name(lock_definition.themes, extension_names).each do
29
32
  call_action Extension::Theme::Update, _1
30
33
  end
31
34
  end
32
35
 
36
+ def filter_by_name(extensions, extension_names)
37
+ return extensions unless extension_names.any?
38
+ extensions.select { extension_names.include?(_1.name) }
39
+ end
40
+
33
41
  def no_lock_file_found
34
42
  lock_definition.nil?.tap { |result|
35
43
  puts "No lock file found" if result
data/lib/rexer/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rexer
2
- VERSION = "0.15.0"
2
+ VERSION = "0.16.0"
3
3
  end
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.15.0
4
+ version: 0.16.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-11-27 00:00:00.000000000 Z
11
+ date: 2025-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -168,7 +168,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
168
168
  requirements:
169
169
  - - ">="
170
170
  - !ruby/object:Gem::Version
171
- version: 3.0.0
171
+ version: 3.1.0
172
172
  required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  requirements:
174
174
  - - ">="