rexer 0.13.0 → 0.14.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 13397d6c2ce415899b6435654c7bfabdf78c6c85aa2988a7879b64b630550dba
4
- data.tar.gz: c1edbd2a8faa415b4796218176367c5f3b97cb9c5ce755c060029c1b1e4290af
3
+ metadata.gz: 9226515e3b9599a9915d140c03d8153f1e562409b5c2d8d3f28501d547511ffc
4
+ data.tar.gz: 8aa2e357ea18131f0fdef8a00276a891f8dec119ad0c9171524384ac4a6119f7
5
5
  SHA512:
6
- metadata.gz: 267698125ab41b6886d7a0f01bb4db14e0c2703de47dc8099d4f6ebe59bf18410785ddb2a11815c3cc6dbe3aa47e3c35abacc32bdefed265f003bb066ee2c4e4
7
- data.tar.gz: eb76a0f49f4c13e47855e4b3eb2443e413aa25a87d66e854eccc820d21e55a3940480af9acdb0bc729efb0b1959891245bf43ba6f41964d6a7b31f8cb9c79478
6
+ metadata.gz: 002633010dcb32959079688a3510edda19e93784145b47b5ca60cf48749348d36f63691c94df30568b8a1fbc3acf63940a832ffa9afc80b0325a430398e9b122
7
+ data.tar.gz: 236685fa7ad6d2760831d2a416b81a1e2e23efb588399e83134e81dbcf06fa3a6b83351f383eae4f59adf3e8aae7c772ed70b6fbe3066004fa92664fca88ecc3
data/README.md CHANGED
@@ -28,7 +28,7 @@ gem install rexer
28
28
 
29
29
  ## Supported Redmine
30
30
 
31
- Rexer is tested with Redmine v5.1 and trunk.
31
+ Rexer is tested with Redmine v6.0 and trunk.
32
32
 
33
33
  ## Usage
34
34
 
data/lib/rexer/cli.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require "thor"
2
2
  require "dotenv"
3
3
  require "erb"
4
+ require "active_support/core_ext/object/blank"
4
5
 
5
6
  module Rexer
6
7
  class Cli < Thor
@@ -34,7 +35,7 @@ module Rexer
34
35
  Commands::Switch.new.call(env&.to_sym)
35
36
  end
36
37
 
37
- desc "update", "Update extensions for the currently installed environment to the latest version"
38
+ desc "update", "Update extensions for the currently installed environment to the latest version if extensions are updateable"
38
39
  def update
39
40
  Commands::Update.new.call
40
41
  end
@@ -1,4 +1,5 @@
1
1
  require "git"
2
+ require "uri"
2
3
 
3
4
  module Rexer
4
5
  module Source
@@ -8,6 +9,7 @@ module Rexer
8
9
  @branch = branch
9
10
  @tag = tag
10
11
  @ref = ref
12
+ @reference = branch || tag || ref
11
13
  end
12
14
 
13
15
  def load(path)
@@ -20,19 +22,30 @@ module Rexer
20
22
  end
21
23
 
22
24
  def updatable?
23
- !branch.nil?
25
+ branch || reference.nil?
24
26
  end
25
27
 
26
28
  def info
27
- branch || tag || ref || "master"
29
+ URI.parse(url).then do |uri|
30
+ "#{uri.host}#{uri.path}@#{reference_name}"
31
+ end
28
32
  end
29
33
 
30
34
  private
31
35
 
32
- attr_reader :url, :branch, :tag, :ref
36
+ attr_reader :url, :reference, :branch, :tag, :ref
33
37
 
34
38
  def checkout(git)
35
- (branch || tag || ref)&.then { git.checkout(_1) }
39
+ reference&.then { git.checkout(_1) }
40
+ end
41
+
42
+ def reference_name
43
+ branch || tag || ref || "main"
44
+ end
45
+
46
+ def short_ref
47
+ return unless ref
48
+ ref.match?(/^[a-z0-9]+$/) ? ref.slice(0, 7) : ref
36
49
  end
37
50
  end
38
51
  end
@@ -2,8 +2,13 @@ module Rexer
2
2
  module Source
3
3
  class Github < Git
4
4
  def initialize(repo:, branch: nil, tag: nil, ref: nil)
5
+ @repo = repo
5
6
  super(url: "https://github.com/#{repo}", branch: branch, tag: tag, ref: ref)
6
7
  end
8
+
9
+ def info
10
+ "#{@repo}@#{reference_name}"
11
+ end
7
12
  end
8
13
  end
9
14
  end
data/lib/rexer/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rexer
2
- VERSION = "0.13.0"
2
+ VERSION = "0.14.0"
3
3
  end
data/lib/rexer.rb CHANGED
@@ -27,6 +27,7 @@ module Rexer
27
27
  end
28
28
  end
29
29
 
30
+ require "active_support"
30
31
  require "pathname"
31
32
  require "zeitwerk"
32
33
 
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.13.0
4
+ version: 0.14.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-10-20 00:00:00.000000000 Z
11
+ date: 2024-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '3.1'
97
+ - !ruby/object:Gem::Dependency
98
+ name: activesupport
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '7.0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '7.0'
97
111
  description: Rexer is a command-line tool for managing Redmine Extension (Plugin and
98
112
  Themes). It allows you to define extensions in a Ruby DSL and install, uninstall,
99
113
  update, and switch between different sets of the extensions.