lowkey 0.1.0 → 0.2.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/lowkey.rb +13 -2
  3. data/lib/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c9ed7172b4b3902649abd82140869b7d97bb285f12a81283548f2c38c1b15ce
4
- data.tar.gz: 1d85f8da175513ebea0bc9ba487654f4b1b7275068ac5f1e1d4ae768c196849c
3
+ metadata.gz: 7a9a4fe0baffd60656da5b3ccd8047b72b9c655a9e789797e01bdaf8950cd7a2
4
+ data.tar.gz: 24f2f98ec543e28105e0494605f550e37d2437829fe1c29018f7b659c55128f2
5
5
  SHA512:
6
- metadata.gz: 2192b79de007545b2f01e66967f171fb0aa19fcf1aa3253eb79505169d802c3f8bad2e122b7e393ee2829250dc1992482b5593434d4b20d899ea641bbeeb6705
7
- data.tar.gz: 0c8e064e9a70f7b6580e3f94058a77371df69cbc744a871207fc466911cd607c9fc48f34f1bedab048a250da6ad1dc4228f553c4832a52edc27bdb5c3ae5a5af
6
+ metadata.gz: 9949841c337d4f2bbe88f0bfaabadac171d1fb1db5a34a0ee1d8a090ac295c6f91ad87fcb8819c035e4be2bdd2d14d5eb296fb44bd5b24cf3396e0f21dcadbdd
7
+ data.tar.gz: 4e96b53e4a83a9f53055e9d8041b54942453506b87a5cad97b494f1a091aa4b64fa8fef4d768fe5d8429199a98e04155ed6e09f6b2cdab31840f891a825d7a55
data/lib/lowkey.rb CHANGED
@@ -23,8 +23,10 @@ module Lowkey
23
23
  visitor = Visitor.new(file_proxy:, parent_map:)
24
24
  root_node.accept(visitor)
25
25
 
26
- map_file_path(file_proxy:)
27
- map_definitions(file_proxy:)
26
+ if Lowkey.config.cache
27
+ map_file_path(file_proxy:)
28
+ map_definitions(file_proxy:)
29
+ end
28
30
 
29
31
  file_proxy
30
32
  end
@@ -33,6 +35,15 @@ module Lowkey
33
35
  keys.clear
34
36
  end
35
37
 
38
+ def config
39
+ config = Struct.new(:cache)
40
+ @config ||= config.new(false)
41
+ end
42
+
43
+ def configure
44
+ yield(config)
45
+ end
46
+
36
47
  private
37
48
 
38
49
  def map_file_path(file_proxy:)
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lowkey
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lowkey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - maedi