avm-tools 0.85.1 → 0.89.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/eac_rails_base1/runner/log.rb +43 -0
- data/lib/avm/eac_rails_base1/runner_with/bundle.rb +2 -32
- data/lib/avm/eac_rails_base1/runner_with/rails_environment.rb +47 -0
- data/lib/avm/eac_webapp_base0/deploy.rb +16 -4
- data/lib/avm/eac_webapp_base0/deploy/appended_directories.rb +1 -1
- data/lib/avm/eac_webapp_base0/deploy/git_info.rb +1 -1
- data/lib/avm/eac_webapp_base0/instance.rb +2 -0
- data/lib/avm/eac_webapp_base0/runner/deploy.rb +13 -21
- data/lib/avm/git/file_auto_fixup.rb +22 -3
- data/lib/avm/instances/base/auto_values/filesystem.rb +12 -0
- data/lib/avm/instances/runner.rb +3 -5
- data/lib/avm/projects/stereotypes/git/update.rb +42 -0
- data/lib/avm/projects/stereotypes/git/update/subrepo.rb +85 -0
- data/lib/avm/tools/runner.rb +2 -4
- data/lib/avm/tools/runner/eac_rails_base0.rb +1 -1
- data/lib/avm/tools/runner/eac_rails_base0/apache_path.rb +1 -1
- data/lib/avm/tools/runner/eac_redmine_base0.rb +1 -1
- data/lib/avm/tools/runner/eac_redmine_base0/core_update.rb +1 -1
- data/lib/avm/tools/runner/eac_redmine_base0/docker.rb +1 -1
- data/lib/avm/tools/runner/eac_redmine_base0/project_rename.rb +1 -1
- data/lib/avm/tools/runner/eac_webapp_base0.rb +14 -0
- data/lib/avm/tools/runner/eac_wordpress_base0.rb +1 -1
- data/lib/avm/tools/runner/eac_writings_base0.rb +1 -1
- data/lib/avm/tools/runner/eac_writings_base1.rb +1 -1
- data/lib/avm/tools/runner/files.rb +7 -15
- data/lib/avm/tools/runner/files/format.rb +18 -27
- data/lib/avm/tools/runner/files/rotate.rb +11 -21
- data/lib/avm/tools/runner/git.rb +10 -15
- data/lib/avm/tools/runner/git/auto_commit.rb +2 -2
- data/lib/avm/tools/runner/git/auto_fixup.rb +23 -16
- data/lib/avm/tools/runner/git/commit.rb +2 -2
- data/lib/avm/tools/runner/git/deploy.rb +18 -28
- data/lib/avm/tools/runner/git/dirty_files.rb +2 -2
- data/lib/avm/tools/runner/git/issue.rb +2 -2
- data/lib/avm/tools/runner/git/organize.rb +2 -2
- data/lib/avm/tools/runner/git/revisions_test.rb +2 -2
- data/lib/avm/tools/runner/git/subrepo.rb +2 -2
- data/lib/avm/tools/runner/git/subrepo/check.rb +2 -2
- data/lib/avm/tools/runner/git/subrepo/clone.rb +2 -2
- data/lib/avm/tools/runner/git/subrepo/fix.rb +4 -3
- data/lib/avm/tools/runner/instance.rb +4 -7
- data/lib/avm/tools/runner/instance/info.rb +5 -8
- data/lib/avm/tools/runner/launcher.rb +1 -1
- data/lib/avm/tools/runner/launcher/instances.rb +1 -1
- data/lib/avm/tools/runner/launcher/projects.rb +1 -1
- data/lib/avm/tools/runner/launcher/publish.rb +1 -1
- data/lib/avm/tools/runner/local_project.rb +5 -8
- data/lib/avm/tools/runner/local_project/eac_writings_base0.rb +2 -2
- data/lib/avm/tools/runner/local_project/eac_writings_base0/build_chapters.rb +2 -2
- data/lib/avm/tools/runner/local_project/eac_writings_base0/build_single.rb +2 -2
- data/lib/avm/tools/runner/local_project/eac_writings_base0/info.rb +2 -2
- data/lib/avm/tools/runner/local_project/eac_writings_base1.rb +2 -2
- data/lib/avm/tools/runner/local_project/eac_writings_base1/build.rb +2 -2
- data/lib/avm/tools/runner/local_project/info.rb +2 -2
- data/lib/avm/tools/runner/local_project/ruby.rb +2 -2
- data/lib/avm/tools/runner/local_project/ruby/bundler.rb +2 -2
- data/lib/avm/tools/runner/local_project/ruby/bundler/gemfile_lock.rb +2 -2
- data/lib/avm/tools/runner/local_project/test.rb +2 -2
- data/lib/avm/tools/runner/local_project/update.rb +2 -2
- data/lib/avm/tools/runner/local_project/version_bump.rb +10 -13
- data/lib/avm/tools/runner/ruby.rb +1 -1
- data/lib/avm/tools/runner/ruby/gems.rb +1 -1
- data/lib/avm/tools/runner/ruby/gems/generate.rb +1 -1
- data/lib/avm/tools/runner/ruby/rubocop.rb +1 -1
- data/lib/avm/tools/runner/self.rb +1 -1
- data/lib/avm/tools/runner/self/docker.rb +1 -1
- data/lib/avm/tools/version.rb +1 -1
- data/vendor/eac_cli/lib/eac_cli/docopt/runner_context_replacement.rb +15 -0
- data/vendor/eac_cli/lib/eac_cli/docopt/runner_extension.rb +5 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative.rb +4 -4
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/long_options.rb +37 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/option_argument.rb +29 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/options.rb +7 -36
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/short_options.rb +45 -0
- data/vendor/eac_cli/lib/eac_cli/runner.rb +0 -48
- data/vendor/eac_cli/lib/eac_cli/runner/after_class_methods.rb +29 -0
- data/vendor/eac_cli/lib/eac_cli/runner/instance_methods.rb +31 -0
- data/vendor/eac_cli/lib/eac_cli/runner_with/subcommands.rb +15 -3
- data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
- data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +22 -1
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/application.rb +1 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +9 -6
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner/test_all.rb +4 -9
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs/traverser.rb +0 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +4 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/local_time_zone.rb +38 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel.rb +4 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel/nyi.rb +8 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/template.rb +10 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/template.rb +1 -8
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/default_time_zone_set.rb +3 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/yaml.rb +8 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/inflector_spec.rb +2 -1
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/local_time_zone_spec.rb +17 -0
- metadata +18 -3
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/local_time_zone.rb +0 -25
@@ -11,7 +11,7 @@ RSpec.describe ::EacCli::Runner do
|
|
11
11
|
|
12
12
|
runner_definition do
|
13
13
|
arg_opt '-o', '--opt1', 'A arg option.'
|
14
|
-
bool_opt '-
|
14
|
+
bool_opt '-p', '--opt2', 'A boolean option'
|
15
15
|
pos_arg :pos1
|
16
16
|
pos_arg :pos2, repeat: true, optional: true
|
17
17
|
alt do
|
@@ -40,6 +40,27 @@ RSpec.describe ::EacCli::Runner do
|
|
40
40
|
it { expect(instance.parsed.pos2).to eq(%w[ccc ddd]) }
|
41
41
|
end
|
42
42
|
|
43
|
+
context 'with long option and argument in same position' do
|
44
|
+
let(:argv) { %w[--opt1=aaa pos1] }
|
45
|
+
|
46
|
+
it { expect(instance.parsed.opt1).to eq('aaa') }
|
47
|
+
end
|
48
|
+
|
49
|
+
context 'with valid grouped short options' do
|
50
|
+
let(:argv) { %w[-po aaa pos1] }
|
51
|
+
|
52
|
+
it { expect(instance.parsed.opt1).to eq('aaa') }
|
53
|
+
it { expect(instance.parsed.opt2?).to eq(true) }
|
54
|
+
end
|
55
|
+
|
56
|
+
context 'with invalid grouped short options' do
|
57
|
+
let(:argv) { %w[-op aaa pos1] }
|
58
|
+
|
59
|
+
it do
|
60
|
+
expect { instance.parsed }.to raise_error(::EacCli::Parser::Error)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
43
64
|
context 'when only required args are supplied' do
|
44
65
|
let(:argv) { %w[bbb] }
|
45
66
|
let(:parsed_expected) { { opt1: nil, opt2: false, opt3: false, pos1: 'bbb', pos2: [] } }
|
@@ -1,13 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'eac_cli/
|
3
|
+
require 'eac_cli/runner_with/help'
|
4
|
+
require 'eac_cli/runner_with/subcommands'
|
4
5
|
require 'eac_ruby_utils/core_ext'
|
5
6
|
|
6
7
|
module EacRubyBase0
|
7
8
|
module Runner
|
8
9
|
require_sub __FILE__
|
10
|
+
enable_console_speaker
|
9
11
|
common_concern do
|
10
|
-
include ::EacCli::
|
12
|
+
include ::EacCli::RunnerWith::Help
|
13
|
+
include ::EacCli::RunnerWith::Subcommands
|
11
14
|
runner_definition do
|
12
15
|
bool_opt '-q', '--quiet', 'Quiet mode.'
|
13
16
|
bool_opt '-I', '--no-input', 'Fail if a input is requested.'
|
@@ -20,9 +23,9 @@ module EacRubyBase0
|
|
20
23
|
|
21
24
|
def run
|
22
25
|
on_speaker_node do |node|
|
23
|
-
node.stderr = ::StringIO.new if
|
24
|
-
node.stdin = FailIfRequestInput.new if
|
25
|
-
if
|
26
|
+
node.stderr = ::StringIO.new if parsed.quiet?
|
27
|
+
node.stdin = FailIfRequestInput.new if parsed.no_input?
|
28
|
+
if parsed.version?
|
26
29
|
show_version
|
27
30
|
else
|
28
31
|
run_with_subcommand
|
@@ -31,7 +34,7 @@ module EacRubyBase0
|
|
31
34
|
end
|
32
35
|
|
33
36
|
def application_version
|
34
|
-
|
37
|
+
runner_context.call(:application).version.to_s
|
35
38
|
end
|
36
39
|
|
37
40
|
def show_version
|
@@ -1,17 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'eac_cli/
|
4
|
-
require 'eac_ruby_utils/console/docopt_runner'
|
5
|
-
require 'eac_ruby_utils/core_ext'
|
3
|
+
require 'eac_cli/core_ext'
|
6
4
|
require 'eac_ruby_gems_utils/tests/multiple'
|
7
5
|
|
8
6
|
module EacRubyBase0
|
9
7
|
module Runner
|
10
|
-
class TestAll
|
11
|
-
|
12
|
-
include ::EacCli::DefaultRunner
|
13
|
-
|
14
|
-
runner_definition do
|
8
|
+
class TestAll
|
9
|
+
runner_with :help do
|
15
10
|
desc 'Test core and local gems.'
|
16
11
|
end
|
17
12
|
|
@@ -20,7 +15,7 @@ module EacRubyBase0
|
|
20
15
|
end
|
21
16
|
|
22
17
|
def tests_uncached
|
23
|
-
::EacRubyGemsUtils::Tests::Multiple.new(
|
18
|
+
::EacRubyGemsUtils::Tests::Multiple.new(runner_context.call(:application).all_gems)
|
24
19
|
end
|
25
20
|
end
|
26
21
|
end
|
@@ -1,12 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'active_support/inflector'
|
4
|
+
|
3
5
|
module EacRubyUtils
|
4
6
|
class Inflector
|
5
7
|
class << self
|
6
8
|
VARIABLE_NAME_PATTERN = /[_a-z][_a-z0-9]*/i.freeze
|
7
9
|
|
8
10
|
def variableize(string)
|
9
|
-
r = string.gsub(/[^_a-z0-9]/i, '_')
|
11
|
+
r = ::ActiveSupport::Inflector.transliterate(string).gsub(/[^_a-z0-9]/i, '_')
|
12
|
+
.gsub(/_+/, '_').gsub(/_\z/, '').gsub(/\A_/, '').downcase
|
10
13
|
m = VARIABLE_NAME_PATTERN.match(r)
|
11
14
|
return r if m
|
12
15
|
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support/core_ext/object/blank'
|
4
|
+
require 'active_support/values/time_zone'
|
5
|
+
|
6
|
+
module EacRubyUtils
|
7
|
+
module LocalTimeZone
|
8
|
+
DEBIAN_CONFIG_PATH = '/etc/timezone'
|
9
|
+
|
10
|
+
class << self
|
11
|
+
TIMEDATECTL_TIMEZONE_LINE_PATTERN = %r{\s*Time zone:\s*(\S+/\S+)\s}.freeze
|
12
|
+
|
13
|
+
def auto
|
14
|
+
%w[tz_env debian_config offset].lazy.map { |s| send("by_#{s}") }.find(&:present?)
|
15
|
+
end
|
16
|
+
|
17
|
+
def by_debian_config
|
18
|
+
path = ::Pathname.new(DEBIAN_CONFIG_PATH)
|
19
|
+
path.exist? ? path.read.strip.presence : nil
|
20
|
+
end
|
21
|
+
|
22
|
+
def by_offset
|
23
|
+
::ActiveSupport::TimeZone[::Time.now.getlocal.gmt_offset].name
|
24
|
+
end
|
25
|
+
|
26
|
+
def by_timedatectl
|
27
|
+
executable = ::EacRubyUtils::Envs.local.executable('timedatectl', '--version')
|
28
|
+
return nil unless executable.exist?
|
29
|
+
|
30
|
+
TIMEDATECTL_TIMEZONE_LINE_PATTERN.if_match(executable.command.execute!) { |m| m[1] }
|
31
|
+
end
|
32
|
+
|
33
|
+
def by_tz_env
|
34
|
+
ENV['TZ'].presence
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -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 '
|
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,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'active_support/core_ext/time/zones'
|
4
|
+
require 'eac_ruby_utils/local_time_zone'
|
4
5
|
|
5
|
-
::Time.zone = ::
|
6
|
+
::Time.zone = ::EacRubyUtils::LocalTimeZone.auto
|
@@ -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
|
@@ -5,7 +5,8 @@ require 'eac_ruby_utils/inflector'
|
|
5
5
|
RSpec.describe ::EacRubyUtils::Inflector do
|
6
6
|
describe '#variableize' do
|
7
7
|
{
|
8
|
-
'_A_variableName' => 'a_variablename'
|
8
|
+
'_A_variableName' => 'a_variablename',
|
9
|
+
'àéíöũ' => 'aeiou'
|
9
10
|
}.each do |source, expected|
|
10
11
|
context "when source is \"#{source}\"" do
|
11
12
|
it { expect(described_class.variableize(source)).to eq(expected) }
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/local_time_zone'
|
4
|
+
|
5
|
+
RSpec.describe(::EacRubyUtils::LocalTimeZone) do
|
6
|
+
describe '#auto' do
|
7
|
+
context 'when TZ environment variable is set' do
|
8
|
+
let(:expected_time_zone) { 'America/Sao_Paulo' }
|
9
|
+
|
10
|
+
before do
|
11
|
+
ENV['TZ'] = expected_time_zone
|
12
|
+
end
|
13
|
+
|
14
|
+
it { expect(described_class.auto).to eq(expected_time_zone) }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avm-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.89.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aranha-parsers
|
@@ -301,8 +301,10 @@ files:
|
|
301
301
|
- lib/avm/eac_rails_base1/runner.rb
|
302
302
|
- lib/avm/eac_rails_base1/runner/bundle.rb
|
303
303
|
- lib/avm/eac_rails_base1/runner/code_runner.rb
|
304
|
+
- lib/avm/eac_rails_base1/runner/log.rb
|
304
305
|
- lib/avm/eac_rails_base1/runner/rails_server.rb
|
305
306
|
- lib/avm/eac_rails_base1/runner_with/bundle.rb
|
307
|
+
- lib/avm/eac_rails_base1/runner_with/rails_environment.rb
|
306
308
|
- lib/avm/eac_redmine_base0.rb
|
307
309
|
- lib/avm/eac_redmine_base0/apache_host.rb
|
308
310
|
- lib/avm/eac_redmine_base0/core_update.rb
|
@@ -460,6 +462,8 @@ files:
|
|
460
462
|
- lib/avm/projects/stereotypes/git.rb
|
461
463
|
- lib/avm/projects/stereotypes/git/local_project_mixin.rb
|
462
464
|
- lib/avm/projects/stereotypes/git/publish.rb
|
465
|
+
- lib/avm/projects/stereotypes/git/update.rb
|
466
|
+
- lib/avm/projects/stereotypes/git/update/subrepo.rb
|
463
467
|
- lib/avm/projects/stereotypes/git/warp.rb
|
464
468
|
- lib/avm/projects/stereotypes/git_subrepo.rb
|
465
469
|
- lib/avm/projects/stereotypes/git_subrepo/publish.rb
|
@@ -500,6 +504,7 @@ files:
|
|
500
504
|
- lib/avm/tools/runner/eac_redmine_base0/core_update.rb
|
501
505
|
- lib/avm/tools/runner/eac_redmine_base0/docker.rb
|
502
506
|
- lib/avm/tools/runner/eac_redmine_base0/project_rename.rb
|
507
|
+
- lib/avm/tools/runner/eac_webapp_base0.rb
|
503
508
|
- lib/avm/tools/runner/eac_wordpress_base0.rb
|
504
509
|
- lib/avm/tools/runner/eac_writings_base0.rb
|
505
510
|
- lib/avm/tools/runner/eac_writings_base1.rb
|
@@ -620,21 +625,27 @@ files:
|
|
620
625
|
- vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb
|
621
626
|
- vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb
|
622
627
|
- vendor/eac_cli/lib/eac_cli/docopt/doc_builder/alternative.rb
|
628
|
+
- vendor/eac_cli/lib/eac_cli/docopt/runner_context_replacement.rb
|
623
629
|
- vendor/eac_cli/lib/eac_cli/docopt/runner_extension.rb
|
624
630
|
- vendor/eac_cli/lib/eac_cli/parser.rb
|
625
631
|
- vendor/eac_cli/lib/eac_cli/parser/alternative.rb
|
626
632
|
- vendor/eac_cli/lib/eac_cli/parser/alternative/argv.rb
|
627
633
|
- vendor/eac_cli/lib/eac_cli/parser/alternative/double_dash.rb
|
634
|
+
- vendor/eac_cli/lib/eac_cli/parser/alternative/long_options.rb
|
635
|
+
- vendor/eac_cli/lib/eac_cli/parser/alternative/option_argument.rb
|
628
636
|
- vendor/eac_cli/lib/eac_cli/parser/alternative/options.rb
|
629
637
|
- vendor/eac_cli/lib/eac_cli/parser/alternative/positionals.rb
|
638
|
+
- vendor/eac_cli/lib/eac_cli/parser/alternative/short_options.rb
|
630
639
|
- vendor/eac_cli/lib/eac_cli/parser/collector.rb
|
631
640
|
- vendor/eac_cli/lib/eac_cli/parser/error.rb
|
632
641
|
- vendor/eac_cli/lib/eac_cli/patches.rb
|
633
642
|
- vendor/eac_cli/lib/eac_cli/patches/object.rb
|
634
643
|
- vendor/eac_cli/lib/eac_cli/patches/object/runner_with.rb
|
635
644
|
- vendor/eac_cli/lib/eac_cli/runner.rb
|
645
|
+
- vendor/eac_cli/lib/eac_cli/runner/after_class_methods.rb
|
636
646
|
- vendor/eac_cli/lib/eac_cli/runner/context.rb
|
637
647
|
- vendor/eac_cli/lib/eac_cli/runner/exit.rb
|
648
|
+
- vendor/eac_cli/lib/eac_cli/runner/instance_methods.rb
|
638
649
|
- vendor/eac_cli/lib/eac_cli/runner_with.rb
|
639
650
|
- vendor/eac_cli/lib/eac_cli/runner_with/help.rb
|
640
651
|
- vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb
|
@@ -989,6 +1000,7 @@ files:
|
|
989
1000
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/string_list.rb
|
990
1001
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/symbol_list.rb
|
991
1002
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/value.rb
|
1003
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/local_time_zone.rb
|
992
1004
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/on_clean_ruby_environment.rb
|
993
1005
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/options_consumer.rb
|
994
1006
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patch.rb
|
@@ -1003,6 +1015,8 @@ files:
|
|
1003
1015
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/hash.rb
|
1004
1016
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/hash/options_consumer.rb
|
1005
1017
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/hash/sym_keys_hash.rb
|
1018
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel.rb
|
1019
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel/nyi.rb
|
1006
1020
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module.rb
|
1007
1021
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/abstract_methods.rb
|
1008
1022
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/common_concern.rb
|
@@ -1012,6 +1026,7 @@ files:
|
|
1012
1026
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/patch.rb
|
1013
1027
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/require_sub.rb
|
1014
1028
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/simple_cache.rb
|
1029
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/template.rb
|
1015
1030
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object.rb
|
1016
1031
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/asserts.rb
|
1017
1032
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/debug.rb
|
@@ -1027,7 +1042,6 @@ files:
|
|
1027
1042
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/inflector.rb
|
1028
1043
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time.rb
|
1029
1044
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/default_time_zone_set.rb
|
1030
|
-
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/local_time_zone.rb
|
1031
1045
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash.rb
|
1032
1046
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash/entry_key_error.rb
|
1033
1047
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash/node.rb
|
@@ -1072,6 +1086,7 @@ files:
|
|
1072
1086
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp_spec.rb
|
1073
1087
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/inflector_spec.rb
|
1074
1088
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/listable_spec.rb
|
1089
|
+
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/local_time_zone_spec.rb
|
1075
1090
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/options_consumer_spec.rb
|
1076
1091
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerable/boolean_combinations_spec.rb
|
1077
1092
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'active_support/core_ext/time/zones'
|
4
|
-
require 'eac_ruby_utils/envs'
|
5
|
-
|
6
|
-
class Time
|
7
|
-
class << self
|
8
|
-
TIMEDATECTL_TIMEZONE_LINE_PATTERN = %r{\s*Time zone:\s*(\S+/\S+)\s}.freeze
|
9
|
-
|
10
|
-
def local_time_zone
|
11
|
-
local_time_zone_by_timedatectl || local_time_zone_by_offset
|
12
|
-
end
|
13
|
-
|
14
|
-
def local_time_zone_by_timedatectl
|
15
|
-
executable = ::EacRubyUtils::Envs.local.executable('timedatectl', '--version')
|
16
|
-
return nil unless executable.exist?
|
17
|
-
|
18
|
-
TIMEDATECTL_TIMEZONE_LINE_PATTERN.if_match(executable.command.execute!) { |m| m[1] }
|
19
|
-
end
|
20
|
-
|
21
|
-
def local_time_zone_by_offset
|
22
|
-
::ActiveSupport::TimeZone[::Time.now.getlocal.gmt_offset].name
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|