lucarecord 0.7.0 → 0.7.2

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: acbbdd5bec6e0582ecfae94fa619d0da6bb2f8de44a278ecb007837262e714bc
4
- data.tar.gz: ac27f73dace69080863366d1d9dc65f0452df6ee83a9e2041db53afdd08ab6f4
3
+ metadata.gz: 48c2bb561dd877e5400caf8944563350b26d013164692fdccdb61d128a45312e
4
+ data.tar.gz: 6b5a1e71c3a1b4f337ddfe967050e6443f05c246d07c51d360e0c6ea10955984
5
5
  SHA512:
6
- metadata.gz: 6ce8638946c47268506f2f3877097011afb924fe7c9a744dee23aa893afbfd3b2d683456bb3f3460c330ab005cd62e37d05cfbd94e9b5e80027cb9588466f9c4
7
- data.tar.gz: 6669c9151391f60e52361d8ed3d680c7f6aca7ec5639256ce3717ac283daefad2b9f49e018cbd8322cf0fac2e964b889dc7e5d4690cf44036e93ba17adad55da
6
+ metadata.gz: 112755952657fbbf7463b8af6e942ae7598c0a905033f38bd99d07b5e5dfba124177f5a9c9f82aee6c0f4fdd920ea46637c4d8d7453d80b1fc852d93548ad4af
7
+ data.tar.gz: 2598d1e49de40e1bd58abc5436c77291683a3a9704348ec8ba9764c6f8435148ee01b9f237297bc145e0459c16b19127f8e463fc352dfebd36af1e00e4039cec
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## LucaRecord 0.7.2
2
+
3
+ * `LucaCmd.check_dir()` accepts optional `ext_conf:` keyword.
4
+
5
+ ## LucaRecord 0.7.1
6
+
7
+ * `LucaRecord::IO.load_project()` supports optional `ext_conf:` keyword for an extra config file.
8
+
1
9
  ## LucaRecord 0.7.0
2
10
 
3
11
  Reworked global constants to be singleton Class instance:
data/lib/luca_cmd.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  require 'luca_record'
3
3
 
4
4
  class LucaCmd
5
- def self.check_dir(target)
5
+ def self.check_dir(target, ext_conf: nil)
6
6
  unless Dir.exist?('data')
7
7
  Dir.glob('*').reject { |f| File.symlink?(f) }
8
8
  .find { |f| File.directory?("#{f}/data/#{target}") }.tap do |d|
@@ -11,7 +11,7 @@ class LucaCmd
11
11
  Dir.chdir(d)
12
12
  end
13
13
  end
14
- LucaRecord::Base.load_project(Dir.pwd)
14
+ LucaRecord::Base.load_project(Dir.pwd, ext_conf: ext_conf)
15
15
  LucaRecord::Base.valid_project?
16
16
  yield
17
17
  end
@@ -292,16 +292,25 @@ module LucaRecord # :nodoc:
292
292
  end
293
293
  end
294
294
 
295
- def load_project(path)
295
+ def load_project(path, ext_conf: nil)
296
296
  CONST.set_pjdir(path)
297
297
  begin
298
298
  config = {
299
299
  'decimal_separator' => '.',
300
300
  'thousands_separator' => ','
301
- }.merge(YAML.safe_load(File.read(Pathname(CONST.pjdir) / 'config.yml'), permitted_classes: [Date]))
301
+ }.merge(YAML.safe_load(
302
+ File.read(Pathname(CONST.pjdir) / 'config.yml'),
303
+ permitted_classes: [Date]
304
+ ))
305
+ config['decimal_num'] ||= config['country'] == 'jp' ? 0 : 2
306
+ if ext_conf
307
+ config.merge(YAML.safe_load(
308
+ File.read(Pathname(CONST.pjdir) / ext_conf),
309
+ permitted_classes: [Date]
310
+ ))
311
+ end
312
+ CONST.set_config(config)
302
313
  end
303
- config['decimal_num'] ||= config['country'] == 'jp' ? 0 : 2
304
- CONST.set_config(config)
305
314
  end
306
315
 
307
316
  # test if having required dirs/files under exec path
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LucaRecord
4
- VERSION = '0.7.0'
4
+ VERSION = '0.7.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lucarecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chuma Takahiro
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-10 00:00:00.000000000 Z
11
+ date: 2024-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler