rexer 0.4.0 → 0.4.1

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: 4086f1f1bc3ef9be9579087c03f189f311e98276cadb9295acb2d33ae319e28e
4
- data.tar.gz: 23b848de6c3e635b312ef127e5d7f6e616ee8d1a64d5e21dc4d90dc5196b48a2
3
+ metadata.gz: 8deb1f0e6b437141c6bc838cf954ee5520cbc44d9aca368060c99a4e7ce17bf2
4
+ data.tar.gz: cf110fb2a483dda81792c355e5fb8e83388bcf2b1a5ff177e764a16e423fb3ad
5
5
  SHA512:
6
- metadata.gz: 1b0067a5d35d0ef2646f9e0a46da872be4b58bcce261be2a23cb9f57b314a612879af881628244dffa0dab11b4a2afc947317de2f0265e41807a62fd29cb85e1
7
- data.tar.gz: 45fde51fb5bdf467cb0a8b00ef20d9498f7a06ebf39b555da6fa0435a0aef9a82ca2baa77ee9b8143e5200ab93ca36f516629b62c07f9c611a2320fae1ea1aef
6
+ metadata.gz: 0e82d4c4bcda8901a8a44b1f9e3db8d4401f2e45781763f072fa6aea8eb75532cb3223d31b051fabee4f5afe4e53def13baa2df8d2c731aa7dee740c6548ac19
7
+ data.tar.gz: 0cdd7fa7759a3e94376b2539bef039c8ee5525b7c0358e8f19ab1409f5ff7946adf692f432c9bd862cb917ff7ab5b1661f0605d98b25f32a1ef4df75ddaf86a9
data/README.md CHANGED
@@ -120,18 +120,6 @@ plugin :redmica_s3, github: { repo: "redmica/redmica_s3" } do
120
120
  end
121
121
  ```
122
122
 
123
- ## Configuring the command prefix
124
-
125
- You can configure the command prefix for the commands that Rexer runs such as `bundle install` and `bin/rails redmine:plugins:migrate`.
126
-
127
- ```ruby
128
- config command_prefix: "docker compose exec -T app"
129
-
130
- plugin :some_plugin_with_db_migration, github: { repo: "some_plugin" }
131
- ```
132
-
133
- In the above example, the `bin/rails redmine:plugins:migrate` command is executed as `docker compose exec -T app bin/rails redmine:plugins:migrate`.
134
-
135
123
  ## Developing
136
124
 
137
125
  ### Running tests
@@ -17,7 +17,7 @@ module Rexer
17
17
  private
18
18
 
19
19
  def install_initially(definition)
20
- install(definition.themes, definition.plugins, definition.config)
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, definition.config)
30
- uninstall(diff.deleted_themes, diff.deleted_plugins, definition.config)
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, config)
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, config).install
53
+ Extension::Plugin::Installer.new(_1).install
54
54
  end
55
55
  end
56
56
 
57
- def uninstall(themes, plugins, config)
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, config).uninstall
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 :config, :version
5
+ attr_reader :version
6
6
 
7
- def initialize(plugins, themes, config, env: nil, version: nil)
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
@@ -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, @config)
36
+ Definition::Data.new(@plugins, @themes)
42
37
  end
43
38
 
44
39
  private
@@ -27,7 +27,7 @@ module Rexer
27
27
  end
28
28
 
29
29
  def to_data
30
- Definition::Data.new(@plugins, @themes, @config, **lock_state)
30
+ Definition::Data.new(@plugins, @themes, **lock_state)
31
31
  end
32
32
 
33
33
  private
@@ -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, config = nil)
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, :config
19
+ attr_reader :name, :hooks, :definition
21
20
 
22
21
  def plugin_dir
23
22
  @plugin_dir ||= Plugin.dir.join(name.to_s)
@@ -37,7 +36,7 @@ module Rexer
37
36
  return unless needs_db_migration?
38
37
 
39
38
  envs = {"NAME" => name.to_s}.merge(extra_envs)
40
- _, error, status = Open3.capture3(envs, cmd_with_prefix("bin/rails redmine:plugins:migrate"))
39
+ _, error, status = Open3.capture3(envs, "bin/rails redmine:plugins:migrate")
41
40
 
42
41
  raise error unless status.success?
43
42
  end
@@ -45,10 +44,6 @@ module Rexer
45
44
  def source
46
45
  @source ||= Source.from_definition(definition.source)
47
46
  end
48
-
49
- def cmd_with_prefix(command)
50
- [config&.command_prefix, command].compact.join(" ")
51
- end
52
47
  end
53
48
 
54
49
  class Installer < Base
@@ -70,7 +65,7 @@ module Rexer
70
65
  def run_bundle_install
71
66
  return unless plugin_dir.join("Gemfile").exist?
72
67
 
73
- _, error, status = Open3.capture3(cmd_with_prefix("bundle install"))
68
+ _, error, status = Open3.capture3("bundle install")
74
69
  raise error unless status.success?
75
70
  end
76
71
  end
data/lib/rexer/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rexer
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rexer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katsuya Hidaka