ykxutils 0.1.1 → 0.1.2

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: ddf3c5fa397b219789d9a523e25486d82b73dc127945d7bb14c8d592e72e6b68
4
- data.tar.gz: 420ac344caa0ab3bb82197c3f5363d43e021a9fab04cb230703fd5d45f9c17a2
3
+ metadata.gz: 5c80eb9e85b3441203320049d784663253c665d2a1220d88e0b7fddb26e24190
4
+ data.tar.gz: dbef95c791e50759a57e7815147e5cbb9784598737532de9597bc7a9e80732c4
5
5
  SHA512:
6
- metadata.gz: e376ca36543555e1be83c80b3e9a3fd2e6a64807a5e54000e8fc4bb0cf7d80663edd8ffb021ece43eea7fb25e21b4ba2685385deaf04f9d7f296641aeadf5916
7
- data.tar.gz: e8b077df8f2b5f5bf98391f2a6eaf399591caa0a4aeac57baaceadb13f03fe5593f5d4c79ad40646731d41a38ca9f4304eec4ec2750ed75e44eb5726511993cc
6
+ metadata.gz: 7b475bcd7df940e53ab43f5db69f2185c97f9dbb10c3b0db79a26c219e3ce8e1e41db7fc3f6d54f8d5c0621a8d0ef0279e5e6bb9c4313c49c086f225f75d6b40
7
+ data.tar.gz: d1fc83418f134d299beae4801746cc86f8068a890403a728e3e006bafcb2ac9b1308d569681448ebaaf4252bd2dbc834f8a5201379649d6a9c590d73db9765f8
data/.rubocop.yml CHANGED
@@ -1,28 +1,28 @@
1
- require:
2
- - rubocop-rake
3
- - rubocop-rspec
4
-
5
- inherit_from: .rubocop_todo.yml
6
-
7
- AllCops:
8
- TargetRubyVersion: 2.6
9
-
10
- Style/StringLiterals:
11
- Enabled: true
12
- EnforcedStyle: double_quotes
13
-
14
- Style/StringLiteralsInInterpolation:
15
- Enabled: true
16
- EnforcedStyle: double_quotes
17
-
18
- Style/FrozenStringLiteralComment:
19
- Enabled: false
20
-
21
- Style/RedundantBegin:
22
- Enabled: false
23
-
24
- Layout/LineLength:
25
- Max: 120
26
-
27
- Style/Documentation:
28
- Enabled: false
1
+ require:
2
+ - rubocop-rake
3
+ - rubocop-rspec
4
+
5
+ inherit_from: .rubocop_todo.yml
6
+
7
+ AllCops:
8
+ TargetRubyVersion: 2.6
9
+
10
+ Style/StringLiterals:
11
+ Enabled: true
12
+ EnforcedStyle: double_quotes
13
+
14
+ Style/StringLiteralsInInterpolation:
15
+ Enabled: true
16
+ EnforcedStyle: double_quotes
17
+
18
+ Style/FrozenStringLiteralComment:
19
+ Enabled: false
20
+
21
+ Style/RedundantBegin:
22
+ Enabled: false
23
+
24
+ Layout/LineLength:
25
+ Max: 120
26
+
27
+ Style/Documentation:
28
+ Enabled: false
data/.rubocop_todo.yml CHANGED
@@ -1,67 +1,74 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2022-08-16 06:21:29 UTC using RuboCop version 1.35.0.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 8
10
- # Configuration parameters: EnforcedStyle.
11
- # SupportedStyles: native, lf, crlf
12
- Layout/EndOfLine:
13
- Exclude:
14
- #- 'Gemfile'
15
- #- 'Rakefile'
16
- #- 'bin/console'
17
- #- 'lib/ykxutils.rb'
18
- #- 'lib/ykxutils/version.rb'
19
- #- 'spec/spec_helper.rb'
20
- #- 'spec/ykxutils_spec.rb'
21
- #- 'ykxutils.gemspec'
22
-
23
- # Offense count: 3
24
- # This cop supports safe autocorrection (--autocorrect).
25
- # Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
26
- Layout/LeadingCommentSpace:
27
- Exclude:
28
- #- 'lib/ykxutils/yamlx.rb'
29
- #- 'ykxutils.gemspec'
30
-
31
- # Offense count: 1
32
- # This cop supports safe autocorrection (--autocorrect).
33
- # Configuration parameters: EnforcedStyle.
34
- # SupportedStyles: final_newline, final_blank_line
35
- Layout/TrailingEmptyLines:
36
- Exclude:
37
- #- 'Gemfile'
38
-
39
- # Offense count: 1
40
- # Configuration parameters: AllowedConstants.
41
- Style/Documentation:
42
- Exclude:
43
- #- 'spec/**/*'
44
- #- 'test/**/*'
45
- #- 'lib/ykxutils/yamlx.rb'
46
-
47
- # Offense count: 1
48
- # This cop supports unsafe autocorrection (--autocorrect-all).
49
- # Configuration parameters: EnforcedStyle.
50
- # SupportedStyles: always, always_true, never
51
- Style/FrozenStringLiteralComment:
52
- Exclude:
53
- #- 'lib/ykxutils/yamlx.rb'
54
-
55
- # Offense count: 1
56
- # This cop supports safe autocorrection (--autocorrect).
57
- Style/RedundantBegin:
58
- Exclude:
59
- #- 'lib/ykxutils/yamlx.rb'
60
-
61
- # Offense count: 1
62
- # This cop supports safe autocorrection (--autocorrect).
63
- # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
64
- # SupportedStyles: single_quotes, double_quotes
65
- Style/StringLiterals:
66
- Exclude:
67
- #- 'lib/ykxutils/yamlx.rb'
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2022-09-07 10:21:48 UTC using RuboCop version 1.35.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Configuration parameters: Include.
11
+ # Include: **/*.gemspec
12
+ Gemspec/RequiredRubyVersion:
13
+ Exclude:
14
+ - 'ykxutils.gemspec'
15
+
16
+ # Offense count: 3
17
+ # This cop supports safe autocorrection (--autocorrect).
18
+ # Configuration parameters: EnforcedStyle.
19
+ # SupportedStyles: normal, indented_internal_methods
20
+ Layout/IndentationConsistency:
21
+ Exclude:
22
+ - 'lib/ykxutils/yamlx.rb'
23
+
24
+ # Offense count: 2
25
+ # This cop supports safe autocorrection (--autocorrect).
26
+ # Configuration parameters: IndentationWidth, EnforcedStyle.
27
+ # SupportedStyles: spaces, tabs
28
+ Layout/IndentationStyle:
29
+ Exclude:
30
+ - 'lib/ykxutils/yamlx.rb'
31
+
32
+ # Offense count: 1
33
+ # This cop supports safe autocorrection (--autocorrect).
34
+ # Configuration parameters: Width, AllowedPatterns, IgnoredPatterns.
35
+ Layout/IndentationWidth:
36
+ Exclude:
37
+ - 'lib/ykxutils/yamlx.rb'
38
+
39
+ # Offense count: 21
40
+ # This cop supports safe autocorrection (--autocorrect).
41
+ # Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
42
+ Layout/LeadingCommentSpace:
43
+ Exclude:
44
+ - 'lib/ykxutils/yamlx.rb'
45
+
46
+ # Offense count: 1
47
+ # This cop supports safe autocorrection (--autocorrect).
48
+ # Configuration parameters: AllowInHeredoc.
49
+ Layout/TrailingWhitespace:
50
+ Exclude:
51
+ - 'lib/ykxutils/yamlx.rb'
52
+
53
+ # Offense count: 1
54
+ # This cop supports safe autocorrection (--autocorrect).
55
+ Lint/ScriptPermission:
56
+ Exclude:
57
+ - 'bin/console'
58
+
59
+ # Offense count: 4
60
+ Lint/UselessAssignment:
61
+ Exclude:
62
+ - 'lib/ykxutils/yamlx.rb'
63
+
64
+ # Offense count: 1
65
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
66
+ Metrics/MethodLength:
67
+ Max: 17
68
+
69
+ # Offense count: 3
70
+ # This cop supports safe autocorrection (--autocorrect).
71
+ # Configuration parameters: PreferredName.
72
+ Naming/RescuedExceptionsVariableName:
73
+ Exclude:
74
+ - 'lib/ykxutils/yamlx.rb'
data/Gemfile CHANGED
@@ -1,15 +1,18 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- # Specify your gem's dependencies in ykxutils.gemspec
6
- gemspec
7
-
8
- gem "rake", "~> 13.0"
9
-
10
- gem "rspec", "~> 3.0"
11
-
12
- gem "rubocop", "~> 1.7"
13
- gem "rubocop-rake", require: false
14
- gem "rubocop-rspec", require: false
15
- gem "yard"
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in ykxutils.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.7"
13
+ gem "rubocop-rake", require: false
14
+ gem "rubocop-rspec", require: false
15
+
16
+ group :development do
17
+ gem "yard"
18
+ end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ykxutils (0.1.1)
4
+ ykxutils (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -53,6 +53,7 @@ GEM
53
53
 
54
54
  PLATFORMS
55
55
  x64-mingw32
56
+ x86_64-linux
56
57
 
57
58
  DEPENDENCIES
58
59
  rake (~> 13.0)
data/Rakefile CHANGED
@@ -1,12 +1,12 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- require "rubocop/rake_task"
9
-
10
- RuboCop::RakeTask.new
11
-
12
- task default: %i[spec rubocop]
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/bin/console CHANGED
@@ -1,15 +1,15 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require "bundler/setup"
5
- require "ykxutils"
6
-
7
- # You can add fixtures and/or initialization code here to make experimenting
8
- # with your gem easier. You can also use a different console, if you like.
9
-
10
- # (If you use this, don't forget to add pry to your Gemfile!)
11
- # require "pry"
12
- # Pry.start
13
-
14
- require "irb"
15
- IRB.start(__FILE__)
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "ykxutils"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
-
3
- module Ykxutils
4
- VERSION = "0.1.1"
5
- end
1
+ # frozen_string_literal: true
2
+
3
+ module Ykxutils
4
+ VERSION = "0.1.2"
5
+ end
@@ -1,14 +1,48 @@
1
- require "yaml"
2
-
3
- module Ykxutils
4
- module_function
5
-
6
- def yaml_load_file_compati(yaml_file_path)
7
- begin
8
- setting = YAML.load_file(yaml_file_path, aliases: true)
9
- rescue ArgumentError
10
- setting = YAML.load_file(yaml_file_path)
11
- end
12
- setting
13
- end
14
- end
1
+ require "yaml"
2
+
3
+ module Ykxutils
4
+ module_function
5
+
6
+ def yaml_load_file_compati(yaml_file_path)
7
+ setting = {}
8
+ valid = false
9
+ begin
10
+ setting = YAML.load_file(yaml_file_path, aliases: true)
11
+ valid = true
12
+ rescue ArgumentError => ex
13
+ #p "yaml_load_file_compat 1"
14
+ #p ex.class
15
+ #p ex.inspect
16
+ #p ex.message
17
+ #p ex.backtrace
18
+ #exit#
19
+ rescue StandardError => ex
20
+ #p "yaml_load_file_compat 1-2"
21
+ #p ex.class
22
+ #p ex.inspect
23
+ #p ex.message
24
+ #p ex.backtrace
25
+ end
26
+
27
+ if valid != true
28
+ begin
29
+ setting = YAML.load_file(yaml_file_path)
30
+ valid = true
31
+ rescue ArgumentError
32
+ #p "yaml_load_file_compat 2"
33
+ #p ex.class
34
+ #p ex.inspect
35
+ #p ex.message
36
+ #p ex.backtrace
37
+ #
38
+ rescue StandardError => ex
39
+ #p "yaml_load_file_compat 2-2"
40
+ #p ex.class
41
+ #p ex.inspect
42
+ #p ex.message
43
+ #p ex.backtrace
44
+ end
45
+ end
46
+ setting
47
+ end
48
+ end
data/lib/ykxutils.rb CHANGED
@@ -1,9 +1,9 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "ykxutils/version"
4
- require_relative "ykxutils/yamlx"
5
-
6
- module Ykxutils
7
- class Error < StandardError; end
8
- # Your code goes here...
9
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "ykxutils/version"
4
+ require_relative "ykxutils/yamlx"
5
+
6
+ module Ykxutils
7
+ class Error < StandardError; end
8
+ # Your code goes here...
9
+ end
data/test_data/test.yaml CHANGED
@@ -1,26 +1,26 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
3
- #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
6
- #
7
- default: &default
8
- adapter: sqlite3
9
- pool: 5
10
- timeout: 5000
11
- database: db/sqlite3.db
12
-
13
- development:
14
- <<: *default
15
- database: db/development.sqlite3
16
-
17
- # Warning: The database defined as "test" will be erased and
18
- # re-generated from your development database when you run "rake".
19
- # Do not set this db to the same as development or production.
20
- test:
21
- <<: *default
22
- database: db/test.sqlite3
23
-
24
- production:
25
- <<: *default
26
- database: db/production.sqlite3
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+ database: db/sqlite3.db
12
+
13
+ development:
14
+ <<: *default
15
+ database: db/development.sqlite3
16
+
17
+ # Warning: The database defined as "test" will be erased and
18
+ # re-generated from your development database when you run "rake".
19
+ # Do not set this db to the same as development or production.
20
+ test:
21
+ <<: *default
22
+ database: db/test.sqlite3
23
+
24
+ production:
25
+ <<: *default
26
+ database: db/production.sqlite3
data/ykxutils.gemspec CHANGED
@@ -1,37 +1,37 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/ykxutils/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "ykxutils"
7
- spec.version = Ykxutils::VERSION
8
- spec.authors = ["ykominami"]
9
- spec.email = ["ykominami@gmail.com"]
10
-
11
- spec.summary = "New version of utilty function created by yk."
12
- spec.description = "New version of utilty function created by yk."
13
- spec.homepage = "https://ykominami.github.io/ykxutils"
14
- spec.license = "MIT"
15
- spec.required_ruby_version = Gem::Requirement.new(">= 2.5.8")
16
-
17
- # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
18
-
19
- spec.metadata["homepage_uri"] = spec.homepage
20
- spec.metadata["source_code_uri"] = "https://github.com/ykominami/ykxutils"
21
- # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
22
-
23
- # Specify which files should be added to the gem when it is released.
24
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
26
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
27
- end
28
- spec.bindir = "exe"
29
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
30
- spec.require_paths = ["lib"]
31
-
32
- # Uncomment to register a new dependency of your gem
33
- # spec.add_dependency "example-gem", "~> 1.0"
34
-
35
- # For more information and examples about making a new gem, checkout our
36
- # guide at: https://bundler.io/guides/creating_gem.html
37
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/ykxutils/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "ykxutils"
7
+ spec.version = Ykxutils::VERSION
8
+ spec.authors = ["ykominami"]
9
+ spec.email = ["ykominami@gmail.com"]
10
+
11
+ spec.summary = "New version of utilty function created by yk."
12
+ spec.description = "New version of utilty function created by yk."
13
+ spec.homepage = "https://ykominami.github.io/ykxutils"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.5.8")
16
+
17
+ # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
18
+
19
+ spec.metadata["homepage_uri"] = spec.homepage
20
+ spec.metadata["source_code_uri"] = "https://github.com/ykominami/ykxutils"
21
+ # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
22
+
23
+ # Specify which files should be added to the gem when it is released.
24
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
26
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
27
+ end
28
+ spec.bindir = "exe"
29
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ["lib"]
31
+
32
+ # Uncomment to register a new dependency of your gem
33
+ # spec.add_dependency "example-gem", "~> 1.0"
34
+
35
+ # For more information and examples about making a new gem, checkout our
36
+ # guide at: https://bundler.io/guides/creating_gem.html
37
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ykxutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ykominami
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-04 00:00:00.000000000 Z
11
+ date: 2022-09-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: New version of utilty function created by yk.
14
14
  email:
@@ -57,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
57
57
  - !ruby/object:Gem::Version
58
58
  version: '0'
59
59
  requirements: []
60
- rubygems_version: 3.0.3.1
60
+ rubygems_version: 3.3.7
61
61
  signing_key:
62
62
  specification_version: 4
63
63
  summary: New version of utilty function created by yk.