flgen 0.20.0 → 0.21.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: 17c6dc413fbc743f3014c128fc304fee0459fbe5ecc3fc9e7f9d12f0d26427d0
4
- data.tar.gz: 262aec83a71a59ca34904e8be6f81787c5075ba5b9ac1726fb9668b3aa4832db
3
+ metadata.gz: fe67e7c60ca35355577e56501c46a5745fec3209091ae08adec482291480bfc2
4
+ data.tar.gz: b1b22bab5e3221f0b065d56cd280f6511430f7180954242e0adfc5e1d5199cb7
5
5
  SHA512:
6
- metadata.gz: d5515a610870d4d9ff29db0cf01f09db1aa19beaa354c85894153e21732894d7f82a5d68ca959060aee97bf4791f6457a0ee61e06aaf4e69ed3a61fdf6051787
7
- data.tar.gz: 5be5528a8aaa6d2ce79fa5fcf91adf9ed95977c5fedbb5a4c70a97164a2647862aa6231d0888dab7c5166495275c2f161bbfbad473b07ea00ad97f29b099e13d
6
+ metadata.gz: a736ba945d947a72ddeccf2c1f09f0f75ed27aa9ec79fc59c81518619bd004094a96dd6911185f861371abeb8c25abc3ebe3b7fae4a1695b40c221e08b47b6c3
7
+ data.tar.gz: b4666bb3afdd53adf29f6a8f6c63d02e660e9c0558b9a5681bf2e33196360eeead5ca6d54a863918915fb3facd4bc57999c6b89c9bdb87d7d3a787c18d5eb4a7
data/README.md CHANGED
@@ -47,6 +47,8 @@ FLGen prives APIs listed below to describe your filelists.
47
47
  * Define a text macro.
48
48
  * `macro?(name)`/`macro_defined?(name)`
49
49
  * Return `true` if the given macro is defined.
50
+ * `macro(name)`
51
+ * Return the value of the given macro.
50
52
  * `env?(name)`
51
53
  * Return `true` if the givne environment variable is defined.
52
54
  * `env(name)`
data/lib/flgen/context.rb CHANGED
@@ -40,7 +40,7 @@ module FLGen
40
40
  end
41
41
 
42
42
  def macros
43
- @macros ||= []
43
+ @macros ||= {}
44
44
  end
45
45
 
46
46
  def add_include_directory(directory)
@@ -106,7 +106,7 @@ module FLGen
106
106
 
107
107
  def add_macro_definition(macro, value, predefined)
108
108
  name = macro.to_sym
109
- macros << name unless macros.include?(name)
109
+ macros[name] = value || true
110
110
  add_macro_argument(name, value) unless predefined
111
111
  end
112
112
 
@@ -50,11 +50,15 @@ module FLGen
50
50
  end
51
51
 
52
52
  def macro?(macro)
53
- @context.macros.include?(macro.to_sym)
53
+ @context.macros.key?(macro.to_sym)
54
54
  end
55
55
 
56
56
  alias_method :macro_defined?, :macro?
57
57
 
58
+ def macro(name)
59
+ @context.macros[name.to_sym]
60
+ end
61
+
58
62
  def env?(name)
59
63
  ENV.key?(name.to_s)
60
64
  end
data/lib/flgen/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FLGen
4
- VERSION = '0.20.0'
4
+ VERSION = '0.21.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flgen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 0.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taichi Ishitani
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-20 00:00:00.000000000 Z
11
+ date: 2024-04-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Filelist generator
14
14
  email:
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0'
67
67
  requirements: []
68
- rubygems_version: 3.5.3
68
+ rubygems_version: 3.5.9
69
69
  signing_key:
70
70
  specification_version: 4
71
71
  summary: Filelist generator