fe_core_ext 0.4.0 → 0.5.0

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
  SHA1:
3
- metadata.gz: cbdd99d35e8879e67efbc4e31066b90187aec5dd
4
- data.tar.gz: 24df0dca0397317fd34245f3fff49b536c041a6f
3
+ metadata.gz: ef2304ca0cbb3407bcc2de0c91a1fddeaec8c98a
4
+ data.tar.gz: e36f361c9d3f0d6ca595ddb6e30e94fe71207933
5
5
  SHA512:
6
- metadata.gz: 60ae307665479c5ddfd4e9661e0c0cb8e542f28afa50036caf3b23986ce32121f517e257006201c967ed12ebdaf5d6204fc163b9a749dce366fb19bd9f6ef27c
7
- data.tar.gz: 6316c91012abd621526598f06d22a069929e85f8fc2ccf97b59b0021b21e50d4e88c8381f1d234c94711bc617a5baac92a96bc43d4140eb0bff00798c6e8fd16
6
+ metadata.gz: 6a56d397b8461e92d8ad154870b6bfc418ffc4790e8fead648a3cbf64e2b46ed9f98d53a72bf92db4ce9affc7af0ee8c4339bdbce9bbb75b1e359902df565255
7
+ data.tar.gz: e6a0c2773e5cae5ded3027573802f8e6355db64bf2c4adf0cb14be85504a5cd6df49cf2a8e01ac3dd8826f3bb3d15f4adaf91b31797a523938acc1f3f2ddea65
@@ -38,7 +38,7 @@ module FeCoreExt::CoreExt::String
38
38
  end
39
39
 
40
40
  def kana_upcase
41
- tr('ァィゥェォヵヶッャュョヮ','アイウエオカケツヤユヨワ')
41
+ tr('ァィゥェォヵヶッャュョヮ', 'アイウエオカケツヤユヨワ')
42
42
  end
43
43
 
44
44
  def to_han_kana
@@ -48,17 +48,27 @@ module FeCoreExt::CoreExt::String
48
48
 
49
49
  def to_zen_kana
50
50
  return if self.nil?
51
- NKF.nkf('-wX',self)
51
+ NKF.nkf('-wX', self)
52
52
  end
53
53
 
54
54
  def to_date_in_ja
55
- match(/(\d{4})年(\d{1,2})月(\d{1,2})日/){ Date.new($1.to_i, $2.to_i, $3.to_i) }
55
+ match(/(\d{4})年(\d{1,2})月(\d{1,2})日/) {Date.new($1.to_i, $2.to_i, $3.to_i)}
56
56
  end
57
57
 
58
58
  # remove also no break space and other space like characters.
59
59
  def strong_strip
60
60
  reverse.gsub(/^\p{Zs}+|^\p{Cf}+/, '').reverse.gsub(/^\p{Zs}+|^\p{Cf}+/, '')
61
61
  end
62
+
63
+ def sjis_encodable
64
+ tr("\u301C\u2212\u00A2\u00A3\u00AC\u2014\u2016",
65
+ "\uFF5E\uFF0D\uFFE0\uFFE1\uFFE2\u2015\u2225")
66
+ end
67
+
68
+ def eucjp_encodable
69
+ tr("\uFF5E\uFF0D\uFFE0\uFFE1\uFFE2\u2015\u2225",
70
+ "\u301C\u2212\u00A2\u00A3\u00AC\u2014\u2016")
71
+ end
62
72
  end
63
73
 
64
74
  class String
@@ -1,3 +1,3 @@
1
1
  module FeCoreExt
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fe_core_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tetsu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-01 00:00:00.000000000 Z
11
+ date: 2018-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport