bonchi 0.5.0.rc6 → 0.5.0.rc7

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: 43e0ee29ac018d61705ad655b24d425b4594a7306dd8bb921987e006616e8a3a
4
- data.tar.gz: 4495c19d5335e73c905fba9ef1873342c5473172c9834d14dfb4f507f4f77950
3
+ metadata.gz: d095902c42f31ef83470417065b4016cf50cd5109f48e605119fb77669f35676
4
+ data.tar.gz: ff3307b825f96a3755b8da936f47b062e4592c735fd974e3c5d287829e989b6d
5
5
  SHA512:
6
- metadata.gz: 2de5f2788b3164cf9197405bd6afd6c7acac3c002622f25377d3119c4315a6ffdc0d71846074da559e122b82055c3ceb60474deca451692a4b0db4bb7b322fbd
7
- data.tar.gz: fab7104744f3490cdd2b4aa6cdce9d6d7365f7ed406678d63c6839e003f112d25d544bdae421adf68e767a025a220d5844a42f8676d946206887d5d7f7767a4d
6
+ metadata.gz: 7b626b0c45f1dfe326a18a889973d3c4821f3dbad63c33693381bf0377e518ba8716b33318a3896763d1b06aad048a2a4576a3f1b3bf2044bd47be50b0e7acf5
7
+ data.tar.gz: bc0b6692d0ccc82162312c422e9e6362c7741e83722ead6e3dc27675f00205788edddbdb5004336366803754bd0f7c43e232f63c8ed7153c2d6bd9fcb85dee5f
data/lib/bonchi/cli.rb CHANGED
@@ -189,6 +189,9 @@ module Bonchi
189
189
  # Worktree configuration for bonchi.
190
190
  # See https://github.com/eval/bonchi
191
191
 
192
+ # Minimum bonchi version required.
193
+ # min_version: #{VERSION}
194
+
192
195
  # Files to copy from the main worktree before setup.
193
196
  # copy:
194
197
  # - .env.local
data/lib/bonchi/config.rb CHANGED
@@ -4,7 +4,7 @@ module Bonchi
4
4
  class Config
5
5
  include Colors
6
6
 
7
- KNOWN_KEYS = %w[copy link ports replace pre_setup setup].freeze
7
+ KNOWN_KEYS = %w[min_version copy link ports replace pre_setup setup].freeze
8
8
 
9
9
  attr_reader :copy, :link, :ports, :replace, :pre_setup, :setup
10
10
 
@@ -14,6 +14,8 @@ module Bonchi
14
14
  unknown = data.keys - KNOWN_KEYS
15
15
  unknown.each { |k| warn "#{color(:yellow)}Warning:#{reset} unknown key '#{k}' in .worktree.yml, ignoring" }
16
16
 
17
+ check_min_version!(data["min_version"]) if data["min_version"]
18
+
17
19
  @copy = Array(data["copy"])
18
20
  @link = Array(data["link"])
19
21
  @ports = Array(data["ports"])
@@ -37,6 +39,14 @@ module Bonchi
37
39
 
38
40
  private
39
41
 
42
+ def check_min_version!(min_version)
43
+ required = Gem::Version.new(min_version.to_s)
44
+ current = Gem::Version.new(VERSION)
45
+ return if current >= required
46
+
47
+ abort "#{color(:red)}Error:#{reset} .worktree.yml requires bonchi >= #{required}, but you have #{current}. Run `gem install bonchi` to upgrade."
48
+ end
49
+
40
50
  def validate!
41
51
  unless @replace.is_a?(Hash)
42
52
  abort "#{color(:red)}Error:#{reset} 'replace' must be a mapping of filename to list of replacements"
@@ -1,3 +1,3 @@
1
1
  module Bonchi
2
- VERSION = "0.5.0.rc6"
2
+ VERSION = "0.5.0.rc7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bonchi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0.rc6
4
+ version: 0.5.0.rc7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gert Goet