fe_core_ext 0.8.2 → 0.10.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
  SHA256:
3
- metadata.gz: 3e1a5facc406a08527214e276f40d288ccd1e576cd55eb4907aa1fd97229405a
4
- data.tar.gz: adbd11b7a341b5a4471755da1d21c0cb9ec16c8dd6a9f820276328bada67624a
3
+ metadata.gz: 40b519ce325b9711586cd33f7324e4e068d949dd93ef2c40e0a8ec04615713d4
4
+ data.tar.gz: c16597805695e7be2e1fad3cdadf6a0ae2f30f037ee5cf2ae62c1bd1ba4ff93d
5
5
  SHA512:
6
- metadata.gz: e5225358914e0effc1e8dbcd35fc03bc24dd2632f527eb162e19198ac5beebad83c147933cd5a2e645371e4eacad9f9b99439fb211ff25c9fe33cb2e11f3b388
7
- data.tar.gz: ddd248161a3c67fe2d1e821eb20af0b1bb6944a43b3f3756540c75259ef4ff42dc90748a2df3c420d986fb8754e0d3054ba0fcc0ec5edf4bc435a7846b71cec3
6
+ metadata.gz: 0db3ebb133683b04cd4db4094fe3492e2b0683e181ff91a773f0264c77463cfcea42b84015015d7c26a37d1348d45252f9d405aa997ae16f2b93893c4d8377e3
7
+ data.tar.gz: 969c9fa85db24c907d96dec57072a11bd37ba8e65134703be7e4f32d0012dfa486ca49edd85885419a71a5fe59fe5adb96532d36cb4ab82f474fe5720b6d206f
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
3
-
4
- RSpec::Core::RakeTask.new(:spec)
2
+ # require 'rspec/core/rake_task'
3
+ #
4
+ # RSpec::Core::RakeTask.new(:spec)
5
5
 
6
6
  task :default => :spec
@@ -20,8 +20,8 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ['lib']
21
21
 
22
22
  spec.add_runtime_dependency 'activesupport'
23
- spec.add_development_dependency 'bundler', '~> 1.10'
24
- spec.add_development_dependency 'rake', '~> 10.0'
23
+ spec.add_development_dependency 'bundler', '~> 2.1'
24
+ spec.add_development_dependency 'rake', '~> 12.3'
25
25
  spec.add_development_dependency 'rspec', '~> 0'
26
26
  spec.add_development_dependency 'selenium-webdriver', '~> 0'
27
27
  end
@@ -1,5 +1,14 @@
1
1
  require 'fe_core_ext/version'
2
- Dir.glob("#{Dir.pwd}/lib/fe_core_ext/core_ext/*.rb").each{|file| require file }
2
+ require 'fe_core_ext/core_ext/array'
3
+ require 'fe_core_ext/core_ext/csv'
4
+ require 'fe_core_ext/core_ext/date'
5
+ require 'fe_core_ext/core_ext/hash'
6
+ require 'fe_core_ext/core_ext/integer'
7
+ require 'fe_core_ext/core_ext/numeric'
8
+ require 'fe_core_ext/core_ext/pathname'
9
+ require 'fe_core_ext/core_ext/string'
10
+ require 'fe_core_ext/core_ext/time'
11
+ require 'fe_core_ext/core_ext/uri'
3
12
 
4
13
  module FeCoreExt
5
14
  end
@@ -19,6 +19,15 @@ module FeCoreExt::CoreExt::Date
19
19
  end
20
20
 
21
21
  module FeCoreExt::CoreExt::DateClassMethods
22
+ def parsable?(string)
23
+ begin
24
+ parse(string)
25
+ true
26
+ rescue ArgumentError
27
+ false
28
+ end
29
+ end
30
+
22
31
  def parse_as_future(string)
23
32
  date = parse(string)
24
33
  date > current ? date : date + 1.year
@@ -29,6 +38,18 @@ module FeCoreExt::CoreExt::DateClassMethods
29
38
  Date.new($1.to_i + 1988, $2.to_i, $3.to_i)
30
39
  }
31
40
  end
41
+
42
+ def parse_reiwa(string)
43
+ string.match('令和(\S+)年(\d+)月(\d+)日') {
44
+ year = 1 if $1 == '元'
45
+ year ||= $1.to_i
46
+ Date.new(year + 2018, $2.to_i, $3.to_i)
47
+ }
48
+ end
49
+
50
+ def parse_gengo(string)
51
+ parse_heisei(string) || parse_reiwa(string)
52
+ end
32
53
  end
33
54
 
34
55
  class Date
@@ -22,6 +22,6 @@ end
22
22
 
23
23
  class URI::Generic
24
24
  def basename
25
- File.basename(path)
25
+ ::File.basename(path)
26
26
  end
27
27
  end
@@ -1,3 +1,3 @@
1
1
  module FeCoreExt
2
- VERSION = '0.8.2'
3
- end
2
+ VERSION = '0.10.0'
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.8.2
4
+ version: 0.10.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-09-11 00:00:00.000000000 Z
11
+ date: 2020-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.10'
33
+ version: '2.1'
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: '1.10'
40
+ version: '2.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '12.3'
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: '10.0'
54
+ version: '12.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  version: '0'
132
132
  requirements: []
133
133
  rubyforge_project:
134
- rubygems_version: 2.7.6
134
+ rubygems_version: 2.7.6.2
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: Core class extensions