rexer 0.4.1 → 0.5.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: 8deb1f0e6b437141c6bc838cf954ee5520cbc44d9aca368060c99a4e7ce17bf2
4
- data.tar.gz: cf110fb2a483dda81792c355e5fb8e83388bcf2b1a5ff177e764a16e423fb3ad
3
+ metadata.gz: 6bb969edc94e8ed8a471a4de3b393768e471b75f4b200637235cc05d247e15f5
4
+ data.tar.gz: 93655f0b69f0f02f91920f9f09f56339f71caefe68e8be78eb276e9cbeaaebba
5
5
  SHA512:
6
- metadata.gz: 0e82d4c4bcda8901a8a44b1f9e3db8d4401f2e45781763f072fa6aea8eb75532cb3223d31b051fabee4f5afe4e53def13baa2df8d2c731aa7dee740c6548ac19
7
- data.tar.gz: 0cdd7fa7759a3e94376b2539bef039c8ee5525b7c0358e8f19ab1409f5ff7946adf692f432c9bd862cb917ff7ab5b1661f0605d98b25f32a1ef4df75ddaf86a9
6
+ metadata.gz: e69305a1d92ba1445eada1931379b590b6186cc09dffa12e3598d4a3b8a94c862f868828e21b7e19910280bef08dd13a5f42c74d28a4134d109fd64a3178c931
7
+ data.tar.gz: 8508080c6d1a030b8ca1de6d2bb16cf547014dbe9a777b4b838cb6e7d40e8d773977519462f8fb5f547cf354d0d912f8b93cab8571552f3edd5423ad1250a4ce
data/README.md CHANGED
@@ -120,6 +120,16 @@ 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 set a prefix for the commands such as `bundle install` that Rexer executes with the `REXER_COMMAND_PREFIX` environment variable.
126
+
127
+ ```
128
+ export REXER_COMMAND_PREFIX="docker compose exec -T app"
129
+ ```
130
+
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`.
132
+
123
133
  ## Developing
124
134
 
125
135
  ### Running tests
@@ -36,7 +36,7 @@ module Rexer
36
36
  return unless needs_db_migration?
37
37
 
38
38
  envs = {"NAME" => name.to_s}.merge(extra_envs)
39
- _, error, status = Open3.capture3(envs, "bin/rails redmine:plugins:migrate")
39
+ _, error, status = Open3.capture3(envs, cmd_with_prefix("bin/rails redmine:plugins:migrate"))
40
40
 
41
41
  raise error unless status.success?
42
42
  end
@@ -44,6 +44,10 @@ module Rexer
44
44
  def source
45
45
  @source ||= Source.from_definition(definition.source)
46
46
  end
47
+
48
+ def cmd_with_prefix(command)
49
+ [Rexer.config.command_prefix, command].compact.join(" ")
50
+ end
47
51
  end
48
52
 
49
53
  class Installer < Base
@@ -65,7 +69,7 @@ module Rexer
65
69
  def run_bundle_install
66
70
  return unless plugin_dir.join("Gemfile").exist?
67
71
 
68
- _, error, status = Open3.capture3("bundle install")
72
+ _, error, status = Open3.capture3(cmd_with_prefix("bundle install"))
69
73
  raise error unless status.success?
70
74
  end
71
75
  end
data/lib/rexer/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rexer
2
- VERSION = "0.4.1"
2
+ VERSION = "0.5.0"
3
3
  end
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"
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.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katsuya Hidaka