prick 0.32.0 → 0.33.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: fed99dbfdf6e89642b4e8fdddf976efa58b1c8b75d9169fa460bd8190805cc63
4
- data.tar.gz: 97fec32bbd130043b2c782f133ab5af30e9bcc5c42d4c83a26311f486786d671
3
+ metadata.gz: c38cab1d940acbbaf8c36dadfddd5ce8a003e45fd881c0af033ee16b9b1bcb9b
4
+ data.tar.gz: c9c67dd1b746adf191a2193c536a7c2a97a962f5a7b70c371ecf42bb60621cec
5
5
  SHA512:
6
- metadata.gz: 35859b1f387d1bf8ccb04a37a853d509e8038102f9521a7b4b35884db5d2682e5a06bd3dda9f4aff704a105603d9df17a43d2d1bbfa66f39ba751584b73b7cb9
7
- data.tar.gz: cc7dfb26f5c10b1489d82f5be5c824e7d7d118de29d9ceae6b424e26506701650da57ed800107ce8ad10ea0bda3e1d29934000170702b285ae3d7a3a8123426f
6
+ metadata.gz: 7f81c8872d37f1b2f772c013c3fd1dad4f5936552aa8a6fa32b1b594d6da5ed20e06725590fd2a5317a8c9cda41b591845c6a68ec7ab4c2b82842b3fd2599c9c
7
+ data.tar.gz: 17c08c190070820e63facc09a7411c8f90b43f7994a8a5eefc04baa2c7f0a9647ec562ce000d0677289d922f56c5eae410f68d0b323e8f177df122c1167b9fec
@@ -75,8 +75,8 @@ module Prick
75
75
 
76
76
  forward_to :effective_variables, :key?, :[], :[]=, :to_h, :empty?, :size, :each, :map
77
77
 
78
- def bash() = "build_#{name}"
79
- def super_bash() = (has_super? ? "build_#{name}_super" : nil)
78
+ def bash() = "build_#{name}" # FIXME build has been out-commented
79
+ def super_bash() = (has_super? ? "build_#{name}_super" : nil) # FIXME same
80
80
  def bash_environment
81
81
  effective_variables.map { |ident, value|
82
82
  ["PRICK_ENVIRONMENT_#{ident.upcase}", value]
@@ -89,9 +89,9 @@ module Prick
89
89
  puts "#{name}:"
90
90
  indent {
91
91
  self.each { |ident,val|
92
- if ident == :build
93
- puts "super: #{super_environment&.name || 'false'}"
94
- end
92
+ # if ident == :build
93
+ # puts "super: #{super_environment&.name || 'false'}"
94
+ # end
95
95
  assigner = assigners[ident]&.name || name
96
96
  assigner_str = (assigner != name ? " (#{assigner})" : "")
97
97
  if types[ident] == "TEXT"
@@ -146,7 +146,9 @@ module Prick
146
146
 
147
147
  end
148
148
 
149
+ # FIXME build has been out-commented
149
150
  def bash_command(environment = nil)
151
+ raise "Not available right now"
150
152
  constrain environment, String, nil
151
153
  if environment
152
154
  env = self[environment] or raise "Unknown environment: '#{environment}'"
@@ -247,7 +249,7 @@ module Prick
247
249
  when "STRING"
248
250
  ; # nop
249
251
  when "LIST"
250
- value = value.split
252
+ value = value&.split || []
251
253
  when "TEXT"
252
254
  value = value.chomp
253
255
  when nil
@@ -321,7 +323,8 @@ module Prick
321
323
 
322
324
  # Ignore if variable is assigned in the current environment and not the
323
325
  # special :build attribute
324
- next if env.assignments.key?(ident) && ident != :build
326
+ # next if env.assignments.key?(ident) && ident != :build
327
+ next if env.assignments.key?(ident)
325
328
 
326
329
  # Pool of ancestors. When an environment assigns a value, all ancestors
327
330
  # of the environment are removed from the pool. If any remaining environment
@@ -340,9 +343,9 @@ module Prick
340
343
  if ancestor.assignments.key?(ident)
341
344
  # Remove all ancestors that are inherited by the assigning environment
342
345
  pool -= ancestor.ancestors
343
- if ident == :build
344
- env.super_environment = ancestor #if ident == :build
345
- end
346
+ # if ident == :build
347
+ # env.super_environment = ancestor #if ident == :build
348
+ # end
346
349
  break
347
350
  end
348
351
  end
@@ -353,11 +356,11 @@ module Prick
353
356
  while ancestor = queue.shift
354
357
  next if !pool.include?(ancestor)
355
358
  if ancestor.assign?(ident)
356
- if ident == :build && env.assign?(:build)
357
- env.super_environment = nil
358
- else
359
+ # if ident == :build && env.assign?(:build)
360
+ # env.super_environment = nil
361
+ # else
359
362
  raise ArgumentError, "Ambigious definition of '#{ident}' in #{ancestor.name} environment"
360
- end
363
+ # end
361
364
  end
362
365
  end
363
366
  end
@@ -83,7 +83,7 @@ module Fmt
83
83
  lines << line.join(" ")
84
84
  end
85
85
  print lines.first
86
- for line in lines[1..]
86
+ for line in lines[1..] || []
87
87
  puts
88
88
  print "#{' ' * index}#{line}"
89
89
  end
data/lib/prick/state.rb CHANGED
@@ -195,8 +195,8 @@ module Prick
195
195
  "PRICK_ENVIRONMENT" => Prick.state.environment&.to_s, # may be the empty string
196
196
  })
197
197
 
198
- # PRICK_ENVIRONMENT_* variables
199
- if !Prick.state.environment.nil?
198
+ # PRICK_ENVIRONMENT_* variables. Only defined if the environment is known
199
+ if !Prick.state.environment.nil? && environments.key?(environment)
200
200
  hash.merge! environments[environment].bash_environment
201
201
  end
202
202
  end
data/lib/prick/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Prick
4
- VERSION = "0.32.0"
4
+ VERSION = "0.33.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prick
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.32.0
4
+ version: 0.33.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claus Rasmussen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-21 00:00:00.000000000 Z
11
+ date: 2024-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: semantic