eac_ruby_utils 0.56.2 → 0.57.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: 0b3d020bb7af10057a1e59b06dab3c2373b2b08f41d5bfd5b04ef8447c5aae61
4
- data.tar.gz: 8125f0827f51e15f174df22b8a55e56646a322e013749fca184025ada77233e5
3
+ metadata.gz: 65af57191dbd9317c68eb8e171e53e4c39877f88d7ce212e0701703b6ff83d11
4
+ data.tar.gz: c6caa9d9461c8055f1977cfb9ea4446bc2cef0fd2c1c0e919fcde296512aff30
5
5
  SHA512:
6
- metadata.gz: c084da333de3de3542c1a0d7ed961d22ecc10d21d98b5d3941f0bbbf6a867232a5384da17b8387b2095698932ce141d4614787d2f5181b4653f3b11f387e45a3
7
- data.tar.gz: 63eb2bdfb9f522195acb9ac712d1fefb6dfdc1c84f0da6c2b4dcf3eaef10a4aa41f4d6ff426ba019552d021b2ee762cef940c1d839cd1a61a55328aa54f6e7ed
6
+ metadata.gz: e1e8ed1d73a37aff540712171468c9f03107cf956a1d52ef0b66a4518e679bc0f156ba06027afd0a450a94995445f6806432f2295f774d81442f76467b34180e
7
+ data.tar.gz: cbd75d3662cc207ac95750b3248d1904c96886c62b55494dedfbd1de22238359801cc8d49c01e51c075a376a95da445022def8546e3672401dc41796d136e3cd
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_support/core_ext/string/inflections'
4
+ require 'eac_ruby_utils/templates/searcher'
5
+
6
+ class Module
7
+ def template
8
+ @template ||= ::EacRubyUtils::Templates::Searcher.default.template(name.underscore)
9
+ end
10
+ end
@@ -1,15 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_support/core_ext/string/inflections'
4
- require 'eac_ruby_utils/templates/searcher'
3
+ require 'eac_ruby_utils/patches/module/template'
5
4
 
6
5
  class Object
7
- class << self
8
- def template
9
- @template ||= ::EacRubyUtils::Templates::Searcher.default.template(name.underscore)
10
- end
11
- end
12
-
13
6
  def template
14
7
  self.class.template
15
8
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyUtils
4
- VERSION = '0.56.2'
4
+ VERSION = '0.57.0'
5
5
  end
@@ -14,10 +14,18 @@ module EacRubyUtils
14
14
  ::YAML.dump(sanitize(object))
15
15
  end
16
16
 
17
+ def dump_file(path, object)
18
+ ::File.write(path.to_s, dump(object))
19
+ end
20
+
17
21
  def load(string)
18
22
  ::YAML.safe_load(string, permitted_classes)
19
23
  end
20
24
 
25
+ def load_file(path)
26
+ load(::File.read(path.to_s))
27
+ end
28
+
21
29
  def permitted_classes
22
30
  DEFAULT_PERMITTED_CLASSES
23
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_ruby_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.56.2
4
+ version: 0.57.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-28 00:00:00.000000000 Z
11
+ date: 2021-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -209,6 +209,7 @@ files:
209
209
  - lib/eac_ruby_utils/patches/module/patch.rb
210
210
  - lib/eac_ruby_utils/patches/module/require_sub.rb
211
211
  - lib/eac_ruby_utils/patches/module/simple_cache.rb
212
+ - lib/eac_ruby_utils/patches/module/template.rb
212
213
  - lib/eac_ruby_utils/patches/object.rb
213
214
  - lib/eac_ruby_utils/patches/object/asserts.rb
214
215
  - lib/eac_ruby_utils/patches/object/debug.rb