miyabi 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7aa5c7a720c07edaca1106bb0d03fed3c3f2b878ac85d8e15f3caa0c81334e98
4
- data.tar.gz: 49f88b1bf2389574bebe53bcf61daffd85db84b3fc6d52fd06bf11561079335a
3
+ metadata.gz: 1103a78e1af969ad03b878f820fb9a7f0d9363dbe29aff68b7540dc1e7ff3949
4
+ data.tar.gz: 16371b54fef10e351692081b844b5d03c527526acd876f6a9d80afa36d20ba25
5
5
  SHA512:
6
- metadata.gz: 5c41fbd306450e975f89397db4083dac2619aa4530a2e0c8e0f76a5cc048ea8b9f872db3ea0fe5ebe90e6f60f9abfcb47f5de34fe39508a2f3270a0262da80ef
7
- data.tar.gz: 320087ecb218ff8ebfa57d3d45372f5a172d259a557068f63b56d3312e81c40a597a53fa3091e8be51b4b3b6f3ed813f54b17205b97c28db6a2b8124f922e2e1
6
+ metadata.gz: b9141239952ac1a220b140a480c4a600a6ced23568128468384ca6a1be12fbcf02987243ca7b96268925b44588220504a056e4261b1a573dd78a47ee675d2810
7
+ data.tar.gz: db3caac3764db0c5bc5811d667a893f2a529a31c40f1aeef71c996c489f636ea0767d473e20b84df31ffae875df3f0b802e5813e12b4a9f43c5ff241c63a5cae
data/.envrc ADDED
@@ -0,0 +1,2 @@
1
+ watch_file manifest.scm
2
+ use guix
data/.gitignore CHANGED
@@ -10,3 +10,5 @@
10
10
 
11
11
  # rspec failure tracking
12
12
  .rspec_status
13
+
14
+ /sig/miyabi.gen.rbs
data/.rubocop_todo.yml CHANGED
@@ -1,21 +1,21 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2023-05-13 02:36:18 UTC using RuboCop version 1.50.2.
3
+ # on 2024-11-13 10:06:34 UTC using RuboCop version 1.48.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
9
  # Offense count: 5
10
- # Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
11
- # NamePrefix: is_, has_, have_
12
- # ForbiddenPrefixes: is_, has_, have_
13
- # AllowedMethods: is_a?
14
- # MethodDefinitionMacros: define_method, define_singleton_method
15
- Naming/PredicateName:
10
+ # This cop supports safe autocorrection (--autocorrect).
11
+ Layout/EmptyLineAfterGuardClause:
16
12
  Exclude:
17
- - 'spec/**/*'
18
- - 'lib/check.rb'
13
+ - 'lib/miyabi/check_string.rb'
14
+
15
+ # Offense count: 1
16
+ # Configuration parameters: CountComments, CountAsOne.
17
+ Metrics/ModuleLength:
18
+ Max: 145
19
19
 
20
20
  # Offense count: 3
21
21
  # Configuration parameters: AllowedConstants.
@@ -23,6 +23,6 @@ Style/Documentation:
23
23
  Exclude:
24
24
  - 'spec/**/*'
25
25
  - 'test/**/*'
26
- - 'lib/check.rb'
27
- - 'lib/format.rb'
28
26
  - 'lib/miyabi.rb'
27
+ - 'lib/miyabi/check_string.rb'
28
+ - 'lib/miyabi/format_string.rb'
data/CHANGELOG.md CHANGED
@@ -9,6 +9,13 @@ The format is based on [Keep a Changelog][cl], and this project adheres to [Sema
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## 0.3.1
13
+
14
+ This is a maintenance release.
15
+
16
+ * Lint source codes.
17
+ * Add RBS file.
18
+
12
19
  ## [0.3.0]
13
20
 
14
21
  ### Added
data/Rakefile CHANGED
@@ -4,3 +4,7 @@ require 'rspec/core/rake_task'
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
6
  task default: :spec
7
+
8
+ task :gensig do
9
+ sh 'typeprof', '-r', 'nokogiri', '-o', 'sig/miyabi.gen.rbs', 'sig/miyabi.rbs', *Dir['lib/**/*.rb']
10
+ end
data/lib/check.rb CHANGED
@@ -1,4 +1,4 @@
1
- require_relative "miyabi/check_string"
1
+ require_relative 'miyabi/check_string'
2
2
 
3
3
  class String
4
4
  include ::Miyabi::CheckString
data/lib/format.rb CHANGED
@@ -1,4 +1,4 @@
1
- require_relative "miyabi/format_string"
1
+ require_relative 'miyabi/format_string'
2
2
 
3
3
  class String
4
4
  include ::Miyabi::FormatString
@@ -1,40 +1,39 @@
1
1
  module Miyabi
2
2
  module CheckString
3
- def is_hira?
3
+ def hiragana?
4
4
  return true if self =~ /\p{hiragana}/
5
5
  false
6
6
  end
7
7
 
8
- alias hiragana? is_hira?
9
- alias hira? is_hira?
8
+ alias is_hira? hiragana?
9
+ alias hira? hiragana?
10
10
 
11
- def is_japanese?
11
+ def japanese?
12
12
  return true if self =~ /\A(?:\p{Hiragana}|\p{Katakana}|[ー-]|[一-龠々])+\z/
13
13
  false
14
14
  end
15
15
 
16
- alias japanese? is_japanese?
16
+ alias is_japanese? japanese?
17
17
 
18
- def is_kana?
18
+ def katakana?
19
19
  return true if self =~ /\p{katakana}/
20
20
  false
21
21
  end
22
22
 
23
- alias katakana? is_kana?
24
- # alias kana? is_kana?
23
+ alias is_kana? katakana?
25
24
 
26
- def is_kanji?
25
+ def kanji?
27
26
  return true if self =~ /^[一-龥]+$/
28
27
  false
29
28
  end
30
29
 
31
- alias kanji? is_kanji?
30
+ alias is_kanji? kanji?
32
31
 
33
- def is_roman?
32
+ def roman?
34
33
  return true if self =~ /^[a-zA-Z]+$/
35
34
  false
36
35
  end
37
36
 
38
- alias roman? is_roman?
37
+ alias is_roman? roman?
39
38
  end
40
39
  end
@@ -12,13 +12,13 @@ module Miyabi
12
12
  end
13
13
 
14
14
  def to_kana
15
- self.tr('ぁ-ん','ァ-ン')
15
+ tr('ぁ-ん', 'ァ-ン')
16
16
  end
17
17
 
18
18
  alias to_katakana to_kana
19
19
 
20
20
  def to_hira
21
- self.tr('ァ-ン','ぁ-ん')
21
+ tr('ァ-ン', 'ぁ-ん')
22
22
  end
23
23
 
24
24
  alias to_hiragana to_hira
@@ -151,7 +151,7 @@ module Miyabi
151
151
  'ペ' => 'pe',
152
152
  'ポ' => 'po',
153
153
  'ヴ' => 'vu',
154
- 'ー' => '-',
154
+ 'ー' => '-'
155
155
  }
156
156
 
157
157
  private_constant :KATAKANA_TO_ROMAN_MAPPING
@@ -1,3 +1,3 @@
1
1
  module Miyabi
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
data/manifest.scm CHANGED
@@ -8,4 +8,4 @@
8
8
  (cons* #:ruby ruby-3.2
9
9
  (package-arguments ruby-nokogiri)))))
10
10
 
11
- (packages->manifest (list ruby-nokogiri' ruby-rspec ruby-3.2))
11
+ (packages->manifest (list ruby-nokogiri' ruby-rspec ruby-3.2 ruby-rubocop))
data/sig/miyabi.rbs ADDED
@@ -0,0 +1,36 @@
1
+ # TypeProf 0.21.3
2
+
3
+ # Classes
4
+ class String
5
+ include Miyabi::FormatString
6
+ include Miyabi::CheckString
7
+ end
8
+
9
+ module Miyabi
10
+ VERSION: String
11
+
12
+ module CheckString
13
+ def hiragana?: -> bool
14
+ alias is_hira? hiragana?
15
+ alias hira? hiragana?
16
+ def japanese?: -> bool
17
+ alias is_japanese? japanese?
18
+ def katakana?: -> bool
19
+ alias is_kana? katakana?
20
+ def kanji?: -> bool
21
+ alias is_kanji? kanji?
22
+ def roman?: -> bool
23
+ alias is_roman? roman?
24
+ end
25
+
26
+ module FormatString
27
+ KATAKANA_TO_ROMAN_MAPPING: Hash[String, String]
28
+
29
+ def to_kanhira: -> String
30
+ def to_kana: -> String
31
+ alias to_katakana to_kana
32
+ def to_hira: -> String
33
+ alias to_hiragana to_hira
34
+ def to_roman: -> String
35
+ end
36
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miyabi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hironori Akaishi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-26 00:00:00.000000000 Z
11
+ date: 2024-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -45,6 +45,7 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
+ - ".envrc"
48
49
  - ".gitignore"
49
50
  - ".rspec"
50
51
  - ".rubocop.yml"
@@ -66,6 +67,7 @@ files:
66
67
  - lib/miyabi/version.rb
67
68
  - manifest.scm
68
69
  - miyabi.gemspec
70
+ - sig/miyabi.rbs
69
71
  homepage: https://github.com/isy/miyabi
70
72
  licenses:
71
73
  - MIT
@@ -86,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
88
  - !ruby/object:Gem::Version
87
89
  version: '0'
88
90
  requirements: []
89
- rubygems_version: 3.4.10
91
+ rubygems_version: 3.4.19
90
92
  signing_key:
91
93
  specification_version: 4
92
94
  summary: kana,hira,kanji formatter