encx 0.1.0 → 0.1.4

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
- SHA1:
3
- metadata.gz: 60a2d135714ab1d0a163c43476b5ffa1b1d7b5cc
4
- data.tar.gz: d079cfde83d0747bedd31ae0ad602a5bc765c840
2
+ SHA256:
3
+ metadata.gz: 1ab369ab6fc30c8887a505e528b83310c744df423bf6cb7f1e6e43d708085575
4
+ data.tar.gz: 35f19a331fa99c4d4c0fe7ced1876109330bf894f93cf18caa2816efe33665c0
5
5
  SHA512:
6
- metadata.gz: 009f2455d59a1de25ba37f2ee19e092145c2446a511380baadbfb394e8bcd87864d29be93a9c254e8a762d00fa60b6d86e56d4089e20f7572f7eed0608600a33
7
- data.tar.gz: 32b5486a3ab5abd9542a4d8637f3deaa0b1730d1bb4d3a69f88daecf48db690d51d10b6649a3882674e1c19035932ff1074704c00c15714f19ce33b5c95bef47
6
+ metadata.gz: fe7bb73df7092c90229b7ee7165c346c637860e846ed8e5a38d1ec067dd2c90da652e984310c216525d9da61798b5269a7d0eb9221e6bfa91dd4ce4e04acdb85
7
+ data.tar.gz: ee28ac633464bf63cd257d201e10d3a6900a0470a66e4719c76cf1a1c3d400d48da74369edddfcca9516955531e6aa7ab2e8c182361c96f5a0f08c731398bc7a
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
1
  --format documentation
2
2
  --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2022-09-25
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at ykominami@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile CHANGED
@@ -1,4 +1,13 @@
1
- source 'https://rubygems.org'
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
2
4
 
3
5
  # Specify your gem's dependencies in encx.gemspec
4
6
  gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.21"
13
+
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 ykominami
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -6,17 +6,11 @@ TODO: Delete this and the text above, and describe your gem
6
6
 
7
7
  ## Installation
8
8
 
9
- Add this line to your application's Gemfile:
9
+ Install the gem and add to the application's Gemfile by executing:
10
10
 
11
- ```ruby
12
- gem 'encx'
13
- ```
11
+ $ bundle add encx
14
12
 
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
13
+ If bundler is not being used to manage dependencies, install the gem by executing:
20
14
 
21
15
  $ gem install encx
22
16
 
@@ -26,14 +20,18 @@ TODO: Write usage instructions here
26
20
 
27
21
  ## Development
28
22
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment. Run `bundle exec encx` to use the code located in this directory, ignoring other installed copies of this gem.
23
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
24
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
25
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
26
 
33
27
  ## Contributing
34
28
 
35
- 1. Fork it ( https://github.com/[my-github-username]/encx/fork )
36
- 2. Create your feature branch (`git checkout -b my-new-feature`)
37
- 3. Commit your changes (`git commit -am 'Add some feature'`)
38
- 4. Push to the branch (`git push origin my-new-feature`)
39
- 5. Create a new Pull Request
29
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ykominami/encx. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/ykominami/encx/blob/main/CODE_OF_CONDUCT.md).
30
+
31
+ ## License
32
+
33
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
34
+
35
+ ## Code of Conduct
36
+
37
+ Everyone interacting in the Encx project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/ykominami/encx/blob/main/CODE_OF_CONDUCT.md).
data/SECURITY.md ADDED
@@ -0,0 +1,21 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ Use this section to tell people about which versions of your project are
6
+ currently being supported with security updates.
7
+
8
+ | Version | Supported |
9
+ | ------- | ------------------ |
10
+ | 5.1.x | :white_check_mark: |
11
+ | 5.0.x | :x: |
12
+ | 4.0.x | :white_check_mark: |
13
+ | < 4.0 | :x: |
14
+
15
+ ## Reporting a Vulnerability
16
+
17
+ Use this section to tell people how to report a vulnerability.
18
+
19
+ Tell them where to go, how often they can expect to get an update on a
20
+ reported vulnerability, what to expect if the vulnerability is accepted or
21
+ declined, etc.
data/encx.gemspec CHANGED
@@ -1,30 +1,45 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'encx/version'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/encx/version"
5
4
 
6
5
  Gem::Specification.new do |spec|
7
- spec.name = "encx"
8
- spec.version = Encx::VERSION
9
- spec.licenses = ['MIT']
10
- spec.authors = ["yasuo kominami"]
11
- spec.email = ["ykominami@gmail.com"]
12
-
13
- spec.summary = %q{Encoding utility.}
14
- spec.description = %q{Encoding utility.}
15
- spec.homepage = ""
16
-
17
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
- spec.bindir = "exe"
19
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
- spec.require_paths = ["lib"]
21
- spec.required_ruby_version = '>= 1.9'
6
+ spec.name = "encx"
7
+ spec.version = Encx::VERSION
8
+ spec.authors = ["ykominami"]
9
+ spec.email = ["ykominami@gmail.com"]
10
+
11
+ spec.summary = "Encoding utility."
12
+ spec.description = "Encoding utility."
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 2.7.6"
16
+
17
+ # spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
18
+
19
+ # spec.metadata["homepage_uri"] = spec.homepage
20
+ spec.metadata["source_code_uri"] = "https://github.com/ykominami/encx"
21
+ # spec.metadata["changelog_uri"] = ""
22
22
 
23
- if spec.respond_to?(:metadata)
24
- # spec.metadata['allowed_push_host'] = "http://mygemserver.com"
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(__dir__) do
26
+ `git ls-files -z`.split("\x0").reject do |f|
27
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
28
+ end
25
29
  end
30
+ spec.bindir = "exe"
31
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32
+ spec.require_paths = ["lib"]
33
+
34
+
35
+ spec.add_development_dependency "bundler" , ">= 2.1.4"
36
+ spec.add_development_dependency "rake", ">= 13.0.6"
37
+ spec.add_development_dependency "rspec", ">= 3.0"
38
+ spec.add_development_dependency "rubocop", ">= 1.21"
39
+
40
+ # Uncomment to register a new dependency of your gem
41
+ # spec.add_dependency "example-gem", "~> 1.0"
26
42
 
27
- spec.add_development_dependency "bundler", "~> 1.9"
28
- spec.add_development_dependency "rake", "~> 10.0"
29
- spec.add_development_dependency "rspec"
43
+ # For more information and examples about making a new gem, check out our
44
+ # guide at: https://bundler.io/guides/creating_gem.html
30
45
  end
data/lib/encx/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Encx
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.4"
3
3
  end
data/lib/encx.rb CHANGED
@@ -46,6 +46,7 @@ module Encx
46
46
  end
47
47
 
48
48
  def compare(l , hs)
49
+ # puts "# Call compare"
49
50
  ret2 = @encoding_ary.find{ |x|
50
51
  begin
51
52
  ret = hs[x].match(l)
@@ -68,12 +69,12 @@ module Encx
68
69
 
69
70
  ret2 != nil
70
71
  end
71
-
72
+
72
73
  def convert( d , enc = nil )
73
74
  if enc
74
- d.encode( enc , {:undef=>:replace, :invalid=>:replace, :replace => ""})
75
+ d.encode( enc , **{:undef=>:replace, :invalid=>:replace, :replace => ""})
75
76
  else
76
- d.encode( @encoding , {:undef=>:replace, :invalid=>:replace, :replace => ""})
77
+ d.encode( @encoding , **{:undef=>:replace, :invalid=>:replace, :replace => ""})
77
78
  end
78
79
  end
79
80
 
@@ -99,22 +100,21 @@ module Encx
99
100
  else
100
101
  ret2 = @encoding_ary.find{ |enc|
101
102
  ret , val = conv_env_sub( d , enc )
102
-
103
103
  ret
104
104
  }
105
105
  end
106
106
  val
107
107
  end
108
-
108
+
109
109
  def register_error( target , item )
110
110
  @error_target_item_hs[target] ||= []
111
111
  @error_target_item_hs[target] << item
112
112
  end
113
-
113
+
114
114
  def print_error_register_item
115
115
  @error_target_item_hs.each do |k,v|
116
116
  puts "##{k}"
117
- v.each do |item|
117
+ v.each do |item|
118
118
  puts "==#{item}"
119
119
  end
120
120
  end
data/sig/encx.rbs ADDED
@@ -0,0 +1,4 @@
1
+ module Encx
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata CHANGED
@@ -1,57 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: encx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
- - yasuo kominami
7
+ - ykominami
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-29 00:00:00.000000000 Z
11
+ date: 2022-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.9'
19
+ version: 2.1.4
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.9'
26
+ version: 2.1.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: 13.0.6
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: 13.0.6
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '3.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '1.21'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '1.21'
55
69
  description: Encoding utility.
56
70
  email:
57
71
  - ykominami@gmail.com
@@ -60,39 +74,41 @@ executables:
60
74
  extensions: []
61
75
  extra_rdoc_files: []
62
76
  files:
63
- - .gitignore
64
- - .rspec
65
- - .travis.yml
77
+ - ".rspec"
78
+ - ".rubocop.yml"
79
+ - CHANGELOG.md
80
+ - CODE_OF_CONDUCT.md
66
81
  - Gemfile
82
+ - LICENSE.txt
67
83
  - README.md
68
84
  - Rakefile
69
- - bin/console
70
- - bin/setup
85
+ - SECURITY.md
71
86
  - encx.gemspec
72
87
  - exe/encx
73
88
  - lib/encx.rb
74
89
  - lib/encx/version.rb
90
+ - sig/encx.rbs
75
91
  homepage: ''
76
92
  licenses:
77
93
  - MIT
78
- metadata: {}
94
+ metadata:
95
+ source_code_uri: https://github.com/ykominami/encx
79
96
  post_install_message:
80
97
  rdoc_options: []
81
98
  require_paths:
82
99
  - lib
83
100
  required_ruby_version: !ruby/object:Gem::Requirement
84
101
  requirements:
85
- - - '>='
102
+ - - ">="
86
103
  - !ruby/object:Gem::Version
87
- version: '1.9'
104
+ version: 2.7.6
88
105
  required_rubygems_version: !ruby/object:Gem::Requirement
89
106
  requirements:
90
- - - '>='
107
+ - - ">="
91
108
  - !ruby/object:Gem::Version
92
109
  version: '0'
93
110
  requirements: []
94
- rubyforge_project:
95
- rubygems_version: 2.4.1
111
+ rubygems_version: 3.1.6
96
112
  signing_key:
97
113
  specification_version: 4
98
114
  summary: Encoding utility.
data/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
data/.travis.yml DELETED
@@ -1,3 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.0.0
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "encx"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
data/bin/setup DELETED
@@ -1,7 +0,0 @@
1
- #!/bin/bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
-
5
- bundle install
6
-
7
- # Do any other automated setup that you need to do here