fe_core_ext 0.20.0 → 0.23.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbd7f5022a6194ca9872af74bbbacf19bebb63e7f80c27b1d996788d5492a94b
|
4
|
+
data.tar.gz: 9c7eaf275074df65ad8e0b685b9915a4c9423be5d48db993a22de9ef20b2ac76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb55370838547d87b47cabeee9d1503d561fc339dae0761769be512695511431172e77ddb294b7edd72ff9f715e590d3fe8ff997c61c55567d193cb932337374
|
7
|
+
data.tar.gz: fbf118ee0a268f7d06b528bb9df74031f905cfde6f1a055cde06472fc78a0e7ad45a85a7ff101f1305ed54125b1f2f933a6651ec4c28d95457b0ab7bce5f3c60
|
@@ -16,6 +16,13 @@ module FeCoreExt::CoreExt::Date
|
|
16
16
|
def to_time_range
|
17
17
|
Range.new(beginning_of_day, end_of_day)
|
18
18
|
end
|
19
|
+
|
20
|
+
def nth_weekday(nth, weekday)
|
21
|
+
first_day = Date.new(self.year, self.month, 1)
|
22
|
+
weekdays_hash = {sun: 0, mon: 1, tue: 2, wed: 3, thu: 4, fri: 5, sat: 6}
|
23
|
+
weekday_dates = (first_day..first_day.end_of_month).select{|d| d.wday == weekdays_hash[weekday]}
|
24
|
+
weekday_dates[nth - 1]
|
25
|
+
end
|
19
26
|
end
|
20
27
|
|
21
28
|
module FeCoreExt::CoreExt::DateClassMethods
|
@@ -15,6 +15,10 @@ module FeCoreExt::CoreExt::Pathname
|
|
15
15
|
Pathname.glob(join(pattern), &block)
|
16
16
|
end
|
17
17
|
|
18
|
+
def existence
|
19
|
+
self if exist?
|
20
|
+
end
|
21
|
+
|
18
22
|
def touch(options={})
|
19
23
|
FileUtils.touch(@path, options)
|
20
24
|
end
|
@@ -23,16 +27,15 @@ module FeCoreExt::CoreExt::Pathname
|
|
23
27
|
FileUtils.rm(self, options)
|
24
28
|
end
|
25
29
|
|
26
|
-
def existence
|
27
|
-
return self if self.exist?
|
28
|
-
nil
|
29
|
-
end
|
30
|
-
|
31
30
|
def mkdir_p
|
32
31
|
mkpath
|
33
32
|
self
|
34
33
|
end
|
35
34
|
|
35
|
+
def copy(dest)
|
36
|
+
FileUtils.cp(self, dest)
|
37
|
+
end
|
38
|
+
|
36
39
|
def require_relative
|
37
40
|
Kernel.require_relative(self)
|
38
41
|
end
|
data/lib/fe_core_ext/version.rb
CHANGED
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
|
+
version: 0.23.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tetsu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|