ehbrs-tools 0.16.4 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ehbrs/cooking_book.rb +9 -0
  3. data/lib/ehbrs/cooking_book/build.rb +45 -0
  4. data/lib/ehbrs/cooking_book/build/base_page.rb +43 -0
  5. data/lib/ehbrs/cooking_book/build/index_page.rb +26 -0
  6. data/lib/ehbrs/cooking_book/build/recipe_page.rb +27 -0
  7. data/lib/ehbrs/cooking_book/project.rb +31 -0
  8. data/lib/ehbrs/cooking_book/recipe.rb +37 -0
  9. data/lib/ehbrs/cooking_book/recipe/ingredient.rb +21 -0
  10. data/lib/ehbrs/cooking_book/recipe/measure.rb +60 -0
  11. data/lib/ehbrs/cooking_book/recipe/part.rb +32 -0
  12. data/lib/ehbrs/music.rb +9 -0
  13. data/lib/ehbrs/music/album.rb +42 -0
  14. data/lib/ehbrs/observers/base.rb +1 -1
  15. data/lib/ehbrs/observers/with_persistence.rb +1 -1
  16. data/lib/ehbrs/patches/module/erb_template.rb +11 -0
  17. data/lib/ehbrs/patches/object/erb_template.rb +9 -0
  18. data/lib/ehbrs/patches/object/template.rb +7 -0
  19. data/lib/ehbrs/runner.rb +6 -13
  20. data/lib/ehbrs/runner/cooking_book.rb +30 -0
  21. data/lib/ehbrs/runner/cooking_book/build.rb +32 -0
  22. data/lib/ehbrs/runner/music.rb +16 -0
  23. data/lib/ehbrs/runner/music/selected.rb +63 -0
  24. data/lib/ehbrs/runner/telegram.rb +26 -0
  25. data/lib/ehbrs/runner/telegram/send_message.rb +29 -0
  26. data/lib/ehbrs/runner/videos/unsupported.rb +1 -1
  27. data/lib/ehbrs/runner/web_utils/videos/upload.rb +1 -1
  28. data/lib/ehbrs/telegram.rb +9 -0
  29. data/lib/ehbrs/telegram/message_sending.rb +32 -0
  30. data/lib/ehbrs/tools/application.rb +13 -0
  31. data/lib/ehbrs/tools/instance.rb +16 -0
  32. data/lib/ehbrs/tools/version.rb +1 -1
  33. data/lib/ehbrs/videos/track.rb +1 -19
  34. data/lib/ehbrs/videos/unsupported/check_support.rb +1 -1
  35. data/lib/ehbrs/videos/unsupported/checks/codec_extra_unlisted.rb +1 -1
  36. data/lib/ehbrs/videos/unsupported/checks/codec_extra_unsupported.rb +1 -1
  37. data/lib/ehbrs/videos/unsupported/checks/codec_unlisted.rb +2 -2
  38. data/lib/ehbrs/videos/unsupported/checks/codec_unsupported.rb +1 -1
  39. data/lib/ehbrs/videos/unsupported/fix_profile.rb +0 -13
  40. data/lib/ehbrs/videos/unsupported/fixes/supported_codec.rb +10 -10
  41. data/lib/ehbrs/videos/unsupported/profiles/aoc.rb +27 -0
  42. data/template/ehbrs/cooking_book/build/base_page/layout.html.erb +20 -0
  43. data/template/ehbrs/cooking_book/build/index_page/inner.html.erb +6 -0
  44. data/template/ehbrs/cooking_book/build/recipe_page/inner.html.erb +6 -0
  45. data/template/ehbrs/cooking_book/build/recipe_page/part.html.erb +27 -0
  46. data/vendor/eac_cli/lib/eac_cli/core_ext.rb +2 -0
  47. data/vendor/eac_cli/lib/eac_cli/definition/alternative.rb +4 -7
  48. data/vendor/eac_cli/lib/eac_cli/definition/argument_option.rb +8 -0
  49. data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +21 -9
  50. data/vendor/eac_cli/lib/eac_cli/definition/base_option/initialize_args_parser.rb +47 -0
  51. data/vendor/eac_cli/lib/eac_cli/definition/boolean_option.rb +8 -0
  52. data/vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb +12 -0
  53. data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +15 -1
  54. data/vendor/eac_cli/lib/eac_cli/docopt/runner_context_replacement.rb +15 -0
  55. data/vendor/eac_cli/lib/eac_cli/docopt/runner_extension.rb +5 -0
  56. data/vendor/eac_cli/lib/eac_cli/parser/alternative.rb +4 -4
  57. data/vendor/eac_cli/lib/eac_cli/parser/alternative/long_options.rb +37 -0
  58. data/vendor/eac_cli/lib/eac_cli/parser/alternative/option_argument.rb +29 -0
  59. data/vendor/eac_cli/lib/eac_cli/parser/alternative/options.rb +7 -36
  60. data/vendor/eac_cli/lib/eac_cli/parser/alternative/short_options.rb +45 -0
  61. data/vendor/eac_cli/lib/eac_cli/parser/collector.rb +3 -17
  62. data/vendor/eac_cli/lib/eac_cli/patches/object/runner_with.rb +2 -1
  63. data/vendor/eac_cli/lib/eac_cli/runner.rb +0 -48
  64. data/vendor/eac_cli/lib/eac_cli/runner/after_class_methods.rb +29 -0
  65. data/vendor/eac_cli/lib/eac_cli/runner/instance_methods.rb +31 -0
  66. data/vendor/eac_cli/lib/eac_cli/runner_with/subcommands.rb +15 -3
  67. data/vendor/eac_cli/lib/eac_cli/runner_with_set.rb +50 -0
  68. data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
  69. data/vendor/eac_cli/spec/lib/eac_cli/definition/alternative_spec.rb +4 -0
  70. data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +43 -4
  71. data/vendor/eac_ruby_base0/Gemfile +5 -0
  72. data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +20 -0
  73. data/vendor/eac_ruby_base0/lib/eac_ruby_base0.rb +7 -0
  74. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/application.rb +69 -0
  75. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/jobs_runner.rb +31 -0
  76. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches.rb +4 -0
  77. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/class.rb +4 -0
  78. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/class/jobs_runner.rb +10 -0
  79. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/object.rb +5 -0
  80. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/object/runner_with.rb +5 -0
  81. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +54 -0
  82. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner/test_all.rb +22 -0
  83. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with.rb +9 -0
  84. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/confirmable.rb +21 -0
  85. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/filesystem_traverser.rb +52 -0
  86. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +5 -0
  87. data/vendor/eac_ruby_base0/spec/rubocop_spec.rb +7 -0
  88. data/vendor/eac_ruby_base0/spec/spec_helper.rb +100 -0
  89. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern/module_setup.rb +16 -6
  90. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor.rb +2 -99
  91. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb +29 -0
  92. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/instance_initialize.rb +53 -0
  93. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/super_args.rb +54 -0
  94. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_subcommands.rb +10 -1
  95. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs/traverser.rb +0 -2
  96. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +4 -1
  97. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/local_time_zone.rb +48 -0
  98. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/class/settings_provider.rb +10 -0
  99. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel.rb +4 -0
  100. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel/nyi.rb +8 -0
  101. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/template.rb +10 -0
  102. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_nil.rb +17 -0
  103. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/template.rb +1 -8
  104. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb +2 -2
  105. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/required_zone.rb +11 -0
  106. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  107. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/yaml.rb +8 -0
  108. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb +14 -4
  109. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_constructor_spec.rb +30 -0
  110. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/inflector_spec.rb +2 -1
  111. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/local_time_zone_spec.rb +17 -0
  112. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/version.rb +1 -1
  113. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/stream.rb +1 -1
  114. metadata +87 -8
  115. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/default_time_zone_set.rb +0 -5
  116. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/local_time_zone.rb +0 -25
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7341652d89d152c04706843882ca18b17663fe66c31907623edc2fea512388e7
4
- data.tar.gz: f2276a0506108cc0883e9c2e84399207df0da20b944f625d46a6040351707c89
3
+ metadata.gz: 9197f68f8849f5b939a2209bd1b5659aa2aa9544286e80b5290a06620f680628
4
+ data.tar.gz: 75f0b60d3f0971aa33913374932630dfa101378698f0210f28619f59f0a63aaa
5
5
  SHA512:
6
- metadata.gz: d72eaddb648e816b85f2a5bad606a3834f64086bb0f5e434e181b20e3dd33212409ea001000f8ee612cd3c528d234e361d64b83feb9f3fdc5da13ea6f6f86f3d
7
- data.tar.gz: 92ca59564d7bc9f61f5842c66da7f3d204d9f58321bae0bd92afe16bab511e8ad22c84fe2633e9d2fbaf12e808a829642ad86725030fde63f6a84be97d4a2c1b
6
+ metadata.gz: 6e675d639a57fc2f6d4d14ab8733cdb9cc96be6818d18252443e575eb3b21c2f1d25139a1c237720c1473b6b369f7c47c5fe1ba547ad49319d9cd1411fdc70f7
7
+ data.tar.gz: 25b77dab28684229355feb9295073fadaf42ed78c4ef27d347e907cf959fa5ff2c822ba96f99a955a6b2adc561b138d241fc9ce3f31026b9b3fdfb398d4c1d36
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Ehbrs
6
+ module CookingBook
7
+ require_sub __FILE__
8
+ end
9
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'eac_ruby_utils/fs/clearable_directory'
5
+
6
+ module Ehbrs
7
+ module CookingBook
8
+ class Build
9
+ require_sub __FILE__
10
+ enable_simple_cache
11
+ enable_listable
12
+ lists.add_symbol :option, :target_dir
13
+
14
+ common_constructor :project, :options, default: [{}] do
15
+ self.options = self.class.lists.option.hash_keys_validate!(options.symbolize_keys)
16
+ end
17
+
18
+ def run
19
+ target_dir.clear
20
+ index_page.build
21
+ recipes_pages.each(&:build)
22
+ end
23
+
24
+ private
25
+
26
+ def index_page_uncached
27
+ ::Ehbrs::CookingBook::Build::IndexPage.new(self)
28
+ end
29
+
30
+ def recipes_pages_uncached
31
+ project.recipes.map do |recipe|
32
+ ::Ehbrs::CookingBook::Build::RecipePage.new(self, recipe)
33
+ end
34
+ end
35
+
36
+ def target_dir_uncached
37
+ ::EacRubyUtils::Fs::ClearableDirectory.new(options[OPTION_TARGET_DIR] || default_target_dir)
38
+ end
39
+
40
+ def default_target_dir
41
+ project.root.join('dist')
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'ehbrs/patches/object/erb_template'
5
+
6
+ module Ehbrs
7
+ module CookingBook
8
+ class Build
9
+ class BasePage < SimpleDelegator
10
+ attr_reader :parent
11
+
12
+ def initialize(parent, source_object)
13
+ super(source_object)
14
+ @parent = parent
15
+ end
16
+
17
+ def build
18
+ target_path.write(target_content)
19
+ end
20
+
21
+ def href
22
+ "#{target_basename}.html"
23
+ end
24
+
25
+ def target_path
26
+ parent.target_dir.join(href)
27
+ end
28
+
29
+ def target_content
30
+ erb_result('layout', ::Ehbrs::CookingBook::Build::BasePage)
31
+ end
32
+
33
+ def inner_content
34
+ erb_result('inner', self.class)
35
+ end
36
+
37
+ def erb_result(template_basename, template_source = self)
38
+ template_source.erb_template("#{template_basename}.html.erb", self)
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'ehbrs/cooking_book/build/base_page'
5
+
6
+ module Ehbrs
7
+ module CookingBook
8
+ class Build
9
+ class IndexPage < ::Ehbrs::CookingBook::Build::BasePage
10
+ TITLE = 'Início'
11
+
12
+ def initialize(parent)
13
+ super(parent, nil)
14
+ end
15
+
16
+ def target_basename
17
+ 'index'
18
+ end
19
+
20
+ def title
21
+ TITLE
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'ehbrs/cooking_book/build/base_page'
5
+ require 'ehbrs/patches/object/erb_template'
6
+
7
+ module Ehbrs
8
+ module CookingBook
9
+ class Build
10
+ class RecipePage < ::Ehbrs::CookingBook::Build::BasePage
11
+ def target_basename
12
+ title.variableize
13
+ end
14
+
15
+ def parts
16
+ @parts ||= super.map { |e| Part.new(e) }
17
+ end
18
+
19
+ class Part < SimpleDelegator
20
+ def content
21
+ ::Ehbrs::CookingBook::Build::RecipePage.erb_template('part.html.erb', self)
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'ehbrs/cooking_book/recipe'
5
+
6
+ module Ehbrs
7
+ module CookingBook
8
+ class Project
9
+ RECIPES_ROOT_SUBPATH = 'recipes'
10
+
11
+ enable_simple_cache
12
+ common_constructor :root do
13
+ self.root = root.to_pathname
14
+ end
15
+
16
+ delegate :to_s, to: :root
17
+
18
+ private
19
+
20
+ def recipes_root_uncached
21
+ root.join(RECIPES_ROOT_SUBPATH)
22
+ end
23
+
24
+ def recipes_uncached
25
+ ::Dir.glob(File.join('**', '*.{yml,yaml}'), base: recipes_root.to_path).map do |subpath|
26
+ ::Ehbrs::CookingBook::Recipe.from_file(recipes_root.join(subpath))
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'eac_ruby_utils/yaml'
5
+
6
+ module Ehbrs
7
+ module CookingBook
8
+ class Recipe
9
+ enable_simple_cache
10
+ require_sub __FILE__
11
+
12
+ class << self
13
+ def from_file(path)
14
+ new(::EacRubyUtils::Yaml.load_file(path))
15
+ end
16
+ end
17
+
18
+ common_constructor :source_data do
19
+ self.source_data = source_data.deep_symbolize_keys
20
+ end
21
+
22
+ def title
23
+ source_data.fetch(:title)
24
+ end
25
+
26
+ def notes
27
+ source_data[:notes]
28
+ end
29
+
30
+ def parts
31
+ @parts ||= source_data.fetch(:parts).map do |k, v|
32
+ ::Ehbrs::CookingBook::Recipe::Part.new(k, v)
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'ehbrs/cooking_book/recipe/measure'
5
+
6
+ module Ehbrs
7
+ module CookingBook
8
+ class Recipe
9
+ class Ingredient
10
+ class << self
11
+ def build(label, value)
12
+ new(label, ::Ehbrs::CookingBook::Recipe::Measure.build(value))
13
+ end
14
+ end
15
+
16
+ enable_simple_cache
17
+ common_constructor :name, :measure
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'eac_ruby_utils/yaml'
5
+ require 'ehbrs/cooking_book/recipe/ingredient'
6
+
7
+ module Ehbrs
8
+ module CookingBook
9
+ class Recipe
10
+ class Measure
11
+ FLOAT_PATTERN = /\d+(?:\.\d+)?/.freeze
12
+ FRACTION_PATTERN = %r{(#{FLOAT_PATTERN})(?:\s*/\s*(#{FLOAT_PATTERN}))?}.freeze
13
+ QUANTITY_UNIT_PATTERN = /\A#{FRACTION_PATTERN}(?:\s*(\S+))?\z/.freeze
14
+ VARIABLE_PATTERN = /\A\~\z/.freeze
15
+ VARIABLE_TEXT = 'a gosto'
16
+
17
+ class << self
18
+ def build(value)
19
+ value = value.to_s.strip
20
+ build_from_variable(value) || build_from_pattern(value) || build_unknown(value)
21
+ end
22
+
23
+ private
24
+
25
+ def build_from_variable(value)
26
+ VARIABLE_PATTERN.if_match(value, false) do
27
+ new(nil, nil, nil)
28
+ end
29
+ end
30
+
31
+ def build_from_pattern(value)
32
+ QUANTITY_UNIT_PATTERN.if_match(value, false) do |m|
33
+ new(m[1].if_present(&:to_f), m[2].if_present(&:to_f), m[3])
34
+ end
35
+ end
36
+
37
+ def build_unknown(value)
38
+ new(nil, nil, "unknown format: |#{value}|")
39
+ end
40
+ end
41
+
42
+ common_constructor :numerator, :denominator, :unit
43
+
44
+ def to_s
45
+ return VARIABLE_TEXT if variable?
46
+
47
+ "#{quantity_to_s} #{unit}"
48
+ end
49
+
50
+ def quantity_to_s
51
+ numerator.to_s + (denominator.if_present('') { |v| "/ #{v}" })
52
+ end
53
+
54
+ def variable?
55
+ numerator.blank?
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'eac_ruby_utils/yaml'
5
+ require 'ehbrs/cooking_book/recipe/ingredient'
6
+
7
+ module Ehbrs
8
+ module CookingBook
9
+ class Recipe
10
+ class Part
11
+ enable_simple_cache
12
+ common_constructor :title, :source_data
13
+
14
+ def notes
15
+ source_data[:notes]
16
+ end
17
+
18
+ private
19
+
20
+ def ingredients_uncached
21
+ source_data.fetch(:ingredients).map do |label, value|
22
+ ::Ehbrs::CookingBook::Recipe::Ingredient.build(label, value)
23
+ end
24
+ end
25
+
26
+ def steps_uncached
27
+ source_data.fetch(:steps)
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Ehbrs
6
+ module Music
7
+ require_sub __FILE__
8
+ end
9
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Ehbrs
6
+ module Music
7
+ class Album
8
+ include ::Comparable
9
+ common_constructor :path do
10
+ self.path = path.to_pathname.expand_path
11
+ end
12
+
13
+ def <=>(other)
14
+ to_a <=> other.to_a
15
+ end
16
+
17
+ def to_a
18
+ [category, artist, name]
19
+ end
20
+
21
+ def to_label
22
+ (to_a + [id]).map(&:light_white).join(' | '.blue)
23
+ end
24
+
25
+ def id
26
+ [artist, name].join('_').variableize
27
+ end
28
+
29
+ def name
30
+ path.basename.to_s
31
+ end
32
+
33
+ def artist
34
+ path.parent.basename.to_s
35
+ end
36
+
37
+ def category
38
+ path.parent.parent.basename.to_s
39
+ end
40
+ end
41
+ end
42
+ end
@@ -21,7 +21,7 @@ module Ehbrs
21
21
  end
22
22
  end
23
23
 
24
- def check(value, date = ::Time.zone.now)
24
+ def check(value, date = ::Time.required_zone.now)
25
25
  @last_check_time = date
26
26
  send("check_with_blank_value_#{blank_value}", value, date)
27
27
  end
@@ -14,7 +14,7 @@ module Ehbrs
14
14
  load
15
15
  end
16
16
 
17
- def check(value, date = ::Time.zone.now)
17
+ def check(value, date = ::Time.required_zone.now)
18
18
  save if super(value, date)
19
19
  end
20
20
 
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'ehbrs/patches/object/template'
4
+ require 'erb'
5
+
6
+ class Module
7
+ def erb_template(subpath, binding_obj)
8
+ ::ERB.new(template.child(subpath).path.read)
9
+ .result binding_obj.binding
10
+ end
11
+ end