ruby-rails-extensions 1.1.0 → 1.1.1.pre.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/ruby-rails-extensions/extensions/current_month.rb +2 -2
- data/lib/ruby-rails-extensions/extensions/current_week.rb +2 -2
- data/lib/ruby-rails-extensions/extensions/day_of_week.rb +2 -2
- data/lib/ruby-rails-extensions/extensions/display_user.rb +6 -6
- data/lib/ruby-rails-extensions/extensions/input.rb +8 -8
- data/lib/ruby-rails-extensions/extensions/safe_parse.rb +13 -13
- data/lib/ruby-rails-extensions/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf794ed4a9a72cdc07757df5f1f619803239d62e4b9b01afa7c1d9463e77867f
|
4
|
+
data.tar.gz: d12accd27f98ce0dabde97fb9b66293f8156a01fca6a7b5460c11ac927d5b0c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d9eed2fce25b074518af012158ce4397f694617367a6ea0efa15b6172b3f34c83fc4d66a5509b10094569138fec50e8b99751ba4cf7dc16516df2fad1ac24e6
|
7
|
+
data.tar.gz: 70f9521f9852f0231c825e5903157caec270aa7c23c990cc1bf63c29cbc8ba992037d294905178048777659d86b1dd7732c57ed5c50bd9000536e85b1e61c464
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
Unreleased Changes
|
2
2
|
------------------
|
3
3
|
|
4
|
+
1.1.1 (2024-03-01)
|
5
|
+
------------------
|
6
|
+
|
7
|
+
* Bugs fixed:
|
8
|
+
* Custom methods added to `DateTime`/`Time` were not added correctly if also added to `Date`
|
9
|
+
* Modules affected:
|
10
|
+
* 'current_month'
|
11
|
+
* 'current_week'
|
12
|
+
* 'day_of_week'
|
13
|
+
* 'display_user'
|
14
|
+
* 'input'
|
15
|
+
* 'safe_parse'
|
16
|
+
|
4
17
|
1.1.0 (2023-09-27)
|
5
18
|
------------------
|
6
19
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'date'
|
4
4
|
|
5
|
-
|
5
|
+
DateTime.class_eval do
|
6
6
|
unless method_defined?(:current_month)
|
7
7
|
# :nodoc:
|
8
8
|
def current_month
|
@@ -11,7 +11,7 @@ Date.class_eval do
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
|
14
|
+
Date.class_eval do
|
15
15
|
unless method_defined?(:current_month)
|
16
16
|
# :nodoc:
|
17
17
|
def current_month
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'date'
|
4
4
|
|
5
|
-
|
5
|
+
DateTime.class_eval do
|
6
6
|
unless method_defined?(:current_week)
|
7
7
|
# @return Range<Date>
|
8
8
|
def current_week
|
@@ -11,7 +11,7 @@ Date.class_eval do
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
|
14
|
+
Date.class_eval do
|
15
15
|
unless method_defined?(:current_week)
|
16
16
|
# @return Range<Date>
|
17
17
|
def current_week
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'date'
|
4
4
|
|
5
|
-
|
5
|
+
DateTime.class_eval do
|
6
6
|
unless method_defined?(:day_of_week)
|
7
7
|
# @return [String] - Full day word
|
8
8
|
def day_of_week
|
@@ -11,7 +11,7 @@ Date.class_eval do
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
|
14
|
+
Date.class_eval do
|
15
15
|
unless method_defined?(:day_of_week)
|
16
16
|
# @return [String] - Full day word
|
17
17
|
def day_of_week
|
@@ -2,29 +2,29 @@
|
|
2
2
|
|
3
3
|
require 'date'
|
4
4
|
|
5
|
-
|
5
|
+
DateTime.class_eval do
|
6
6
|
unless method_defined?(:display_user)
|
7
7
|
# @return [String] - mm/dd/yyyy or m/d/yy
|
8
8
|
def display_user(all = false)
|
9
|
-
strftime(all ? '%m/%d/%Y' : '%-m/%-d/%y')
|
9
|
+
strftime(all ? '%m/%d/%Y %r' : '%-m/%-d/%y %r')
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
|
14
|
+
Time.class_eval do
|
15
15
|
unless method_defined?(:display_user)
|
16
16
|
# @return [String] - mm/dd/yyyy or m/d/yy
|
17
17
|
def display_user(all = false)
|
18
|
-
|
18
|
+
to_datetime.display_user(all)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
|
23
|
+
Date.class_eval do
|
24
24
|
unless method_defined?(:display_user)
|
25
25
|
# @return [String] - mm/dd/yyyy or m/d/yy
|
26
26
|
def display_user(all = false)
|
27
|
-
|
27
|
+
strftime(all ? '%m/%d/%Y' : '%-m/%-d/%y')
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
@@ -2,20 +2,20 @@
|
|
2
2
|
|
3
3
|
require 'date'
|
4
4
|
|
5
|
-
|
5
|
+
DateTime.class_eval do
|
6
6
|
unless method_defined?(:input)
|
7
|
-
# @return [String] - yyyy-mm-dd
|
8
|
-
def input(
|
9
|
-
strftime('%F')
|
7
|
+
# @return [String] - yyyy-mm-dd[Thh:mm::ss]
|
8
|
+
def input(all = false)
|
9
|
+
strftime(all ? '%F %T' : '%F')
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
|
14
|
+
Date.class_eval do
|
15
15
|
unless method_defined?(:input)
|
16
|
-
# @return [String] - yyyy-mm-dd
|
17
|
-
def input(
|
18
|
-
strftime(
|
16
|
+
# @return [String] - yyyy-mm-dd
|
17
|
+
def input(_all = false)
|
18
|
+
strftime('%F')
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -1,18 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
Date.class_eval do
|
4
|
-
class << self
|
5
|
-
unless method_defined?(:safe_parse)
|
6
|
-
# Parses the `str` and returns `nil` if invalid
|
7
|
-
def safe_parse(str)
|
8
|
-
parse(str)
|
9
|
-
rescue
|
10
|
-
nil
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
3
|
Time.class_eval do
|
17
4
|
class << self
|
18
5
|
unless method_defined?(:safe_parse)
|
@@ -40,3 +27,16 @@ if defined?(ActiveSupport::TimeZone)
|
|
40
27
|
end
|
41
28
|
end
|
42
29
|
end
|
30
|
+
|
31
|
+
Date.class_eval do
|
32
|
+
class << self
|
33
|
+
unless method_defined?(:safe_parse)
|
34
|
+
# Parses the `str` and returns `nil` if invalid
|
35
|
+
def safe_parse(str)
|
36
|
+
parse(str)
|
37
|
+
rescue
|
38
|
+
nil
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-rails-extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1.pre.rc.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brands Insurance
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop-rubomatic-rails
|
@@ -115,9 +115,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
115
115
|
version: 3.0.1
|
116
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
117
|
requirements:
|
118
|
-
- - "
|
118
|
+
- - ">"
|
119
119
|
- !ruby/object:Gem::Version
|
120
|
-
version:
|
120
|
+
version: 1.3.1
|
121
121
|
requirements: []
|
122
122
|
rubygems_version: 3.2.15
|
123
123
|
signing_key:
|