yiffspace 0.0.23 → 0.0.25
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 +4 -4
- data/lib/tasks/{yiff_space_tasks.rake → yiffspace_tasks.rake} +1 -1
- data/lib/yiffspace/concerns/active_record_extensions.rb +3 -3
- data/lib/yiffspace/core_ext/all.rb +1 -0
- data/lib/yiffspace/core_ext/object/all.rb +4 -0
- data/lib/yiffspace/core_ext/object/to_b.rb +7 -0
- data/lib/yiffspace/core_ext/object/truthy_falsy.rb +7 -0
- data/lib/yiffspace/core_ext/string/all.rb +0 -2
- data/lib/yiffspace/extensions/active_record/where_chain.rb +25 -25
- data/lib/yiffspace/extensions/object/to_b.rb +22 -0
- data/lib/yiffspace/extensions/object/truthy_falsy.rb +35 -0
- data/lib/yiffspace/include/active_record_extensions.rb +5 -0
- data/lib/yiffspace/include/all.rb +12 -0
- data/lib/yiffspace/include/api_methods.rb +5 -0
- data/lib/yiffspace/include/attribute_matchers.rb +5 -0
- data/lib/yiffspace/include/attribute_methods.rb +5 -0
- data/lib/yiffspace/include/concurrency_methods.rb +5 -0
- data/lib/yiffspace/include/conditional_includes.rb +5 -0
- data/lib/yiffspace/include/current_methods.rb +5 -0
- data/lib/yiffspace/include/has_bit_flags.rb +5 -0
- data/lib/yiffspace/include/user_class_methods.rb +5 -0
- data/lib/yiffspace/include/user_methods.rb +5 -0
- data/lib/yiffspace/include/user_name_methods.rb +5 -0
- data/lib/yiffspace/include/user_resolvable_methods.rb +5 -0
- data/lib/yiffspace/version.rb +1 -1
- metadata +20 -7
- data/lib/yiffspace/core_ext/string/to_b.rb +0 -7
- data/lib/yiffspace/core_ext/string/truthy_falsy.rb +0 -7
- data/lib/yiffspace/extensions/string/to_b.rb +0 -13
- data/lib/yiffspace/extensions/string/truthy_falsy.rb +0 -17
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d25c09cc2215ae215fedbcac2a2f7df9cb90bcffe077b9ce65e19cc7a87cdcc2
|
|
4
|
+
data.tar.gz: d1e559638ed2c624a88df12fb99c95e6f72af323d1acea7745240bd2f44e8b36
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '068f7913582ba815958d342421467c0af7a88ca7ec98643e2d3503c1c5cf36a74d284928f8e4df4a100e874170ca3eed13d2e6ff1c4c448ebbc3fea05e19b5fe'
|
|
7
|
+
data.tar.gz: 9991d33a718322c301de8fff0a705f209d1853fb5d60bb1dc00a6f0d39e16fb5c9c85ef1af0a1e772c56d7e894f43461d994ebe66dd1ac15b7a24df65026b2e8
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
namespace(:
|
|
3
|
+
namespace(:yiffspace) do
|
|
4
4
|
desc("Report and interactively remove duplicate/orphaned Logto users left behind by " \
|
|
5
5
|
"get_or_create_user races. Prompts for confirmation before deleting each one. " \
|
|
6
6
|
"Pass AUTH_CLIENT=name to use a registered auth client other than :default " \
|
|
@@ -30,13 +30,13 @@ module YiffSpace
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
# CrossJoinLateral, LeftJoinLateral, nil
|
|
33
|
-
def unnest(column, name: column.singularize, type: Arel::Nodes::LeftJoinLateral)
|
|
34
|
-
function = Arel::Nodes::NamedFunction.new("unnest", [arel(column)], name)
|
|
33
|
+
def unnest(column, name: column.singularize, type: ::Arel::Nodes::LeftJoinLateral)
|
|
34
|
+
function = ::Arel::Nodes::NamedFunction.new("unnest", [arel(column)], name)
|
|
35
35
|
return function if type.nil?
|
|
36
36
|
|
|
37
37
|
joins(type.new(
|
|
38
38
|
function,
|
|
39
|
-
Arel::Nodes::On.new(Arel.sql("TRUE")),
|
|
39
|
+
::Arel::Nodes::On.new(Arel.sql("TRUE")),
|
|
40
40
|
))
|
|
41
41
|
end
|
|
42
42
|
end
|
|
@@ -38,31 +38,31 @@ module YiffSpace
|
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
METHODS = {
|
|
41
|
-
lt: ->(table_name, column, value) { Arel::Table.new(table_name)[column].lt(value) },
|
|
42
|
-
lteq: ->(table_name, column, value) { Arel::Table.new(table_name)[column].lteq(value) },
|
|
43
|
-
gt: ->(table_name, column, value) { Arel::Table.new(table_name)[column].gt(value) },
|
|
44
|
-
gteq: ->(table_name, column, value) { Arel::Table.new(table_name)[column].gteq(value) },
|
|
45
|
-
between: ->(table_name, column, value) { Arel::Table.new(table_name)[column].between(value) },
|
|
46
|
-
not_between: ->(table_name, column, value) { Arel::Table.new(table_name)[column].not_between(value) },
|
|
47
|
-
in: ->(table_name, column, value) { Arel::Table.new(table_name)[column].in(value) },
|
|
48
|
-
not_in: ->(table_name, column, value) { Arel::Table.new(table_name)[column].not_in(value) },
|
|
49
|
-
like: ->(table_name, column, value) { Arel::Table.new(table_name)[column].matches(value.to_escaped_for_sql_like, Arel.sql("E'\\\\'"), true) },
|
|
50
|
-
ilike: ->(table_name, column, value) { Arel::Table.new(table_name)[column].matches(value.to_escaped_for_sql_like, Arel.sql("E'\\\\'"), false) },
|
|
51
|
-
not_like: ->(table_name, column, value) { Arel::Table.new(table_name)[column].does_not_match(value.to_escaped_for_sql_like, Arel.sql("E'\\\\'"), true) },
|
|
52
|
-
not_ilike: ->(table_name, column, value) { Arel::Table.new(table_name)[column].does_not_match(value.to_escaped_for_sql_like, Arel.sql("E'\\\\'"), false) },
|
|
53
|
-
like_all: ->(table_name, column, value) { Arel::Table.new(table_name)[column].matches_all(value.map(&:to_escaped_for_sql_like), Arel.sql("E'\\\\'"), true) },
|
|
54
|
-
ilike_all: ->(table_name, column, value) { Arel::Table.new(table_name)[column].matches_all(value.map(&:to_escaped_for_sql_like), Arel.sql("E'\\\\'"), false) },
|
|
55
|
-
not_like_all: ->(table_name, column, value) { Arel::Table.new(table_name)[column].does_not_match_all(value.map(&:to_escaped_for_sql_like), Arel.sql("E'\\\\'"), true) },
|
|
56
|
-
not_ilike_all: ->(table_name, column, value) { Arel::Table.new(table_name)[column].does_not_match_all(value.map(&:to_escaped_for_sql_like), Arel.sql("E'\\\\'"), false) },
|
|
57
|
-
like_any: ->(table_name, column, value) { Arel::Table.new(table_name)[column].matches_any(value.map(&:to_escaped_for_sql_like), Arel.sql("E'\\\\'"), true) },
|
|
58
|
-
ilike_any: ->(table_name, column, value) { Arel::Table.new(table_name)[column].matches_any(value.map(&:to_escaped_for_sql_like), Arel.sql("E'\\\\'"), false) },
|
|
59
|
-
not_like_any: ->(table_name, column, value) { Arel::Table.new(table_name)[column].does_not_match_any(value.map(&:to_escaped_for_sql_like), Arel.sql("E'\\\\'"), true) },
|
|
60
|
-
not_ilike_any: ->(table_name, column, value) { Arel::Table.new(table_name)[column].does_not_match_any(value.map(&:to_escaped_for_sql_like), Arel.sql("E'\\\\'"), false) },
|
|
61
|
-
regex: ->(table_name, column, value, flags) { Arel::Table.new(table_name)[column].matches_regexp("(?#{flags})#{value.is_a?(Regexp) ? value.source : value}") },
|
|
62
|
-
not_regex: ->(table_name, column, value, flags) { Arel::Table.new(table_name)[column].does_not_match_regexp("(?#{flags})#{value.is_a?(Regexp) ? value.source : value}") },
|
|
63
|
-
tsquery: ->(table_name, column, value, ts_config) { Arel.sql("to_tsvector(:ts_config, :table) @@ plainto_tsquery(:ts_config, :value)", ts_config: ts_config, value: value, table: Arel.sql("#{table_name}.#{column}")) },
|
|
64
|
-
has_bits: ->(table_name, column, value) { Arel.sql("(#{table_name}.#{column} & #{Arel::Nodes.build_quoted(value).to_sql}) = #{Arel::Nodes.build_quoted(value).to_sql}") },
|
|
65
|
-
not_has_bits: ->(table_name, column, value) { Arel.sql("(#{table_name}.#{column} & #{Arel::Nodes.build_quoted(value).to_sql}) != #{Arel::Nodes.build_quoted(value).to_sql}") },
|
|
41
|
+
lt: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].lt(value) },
|
|
42
|
+
lteq: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].lteq(value) },
|
|
43
|
+
gt: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].gt(value) },
|
|
44
|
+
gteq: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].gteq(value) },
|
|
45
|
+
between: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].between(value) },
|
|
46
|
+
not_between: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].not_between(value) },
|
|
47
|
+
in: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].in(value) },
|
|
48
|
+
not_in: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].not_in(value) },
|
|
49
|
+
like: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].matches(value.to_escaped_for_sql_like, ::Arel.sql("E'\\\\'"), true) },
|
|
50
|
+
ilike: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].matches(value.to_escaped_for_sql_like, ::Arel.sql("E'\\\\'"), false) },
|
|
51
|
+
not_like: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].does_not_match(value.to_escaped_for_sql_like, ::Arel.sql("E'\\\\'"), true) },
|
|
52
|
+
not_ilike: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].does_not_match(value.to_escaped_for_sql_like, ::Arel.sql("E'\\\\'"), false) },
|
|
53
|
+
like_all: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].matches_all(value.map(&:to_escaped_for_sql_like), ::Arel.sql("E'\\\\'"), true) },
|
|
54
|
+
ilike_all: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].matches_all(value.map(&:to_escaped_for_sql_like), ::Arel.sql("E'\\\\'"), false) },
|
|
55
|
+
not_like_all: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].does_not_match_all(value.map(&:to_escaped_for_sql_like), ::Arel.sql("E'\\\\'"), true) },
|
|
56
|
+
not_ilike_all: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].does_not_match_all(value.map(&:to_escaped_for_sql_like), ::Arel.sql("E'\\\\'"), false) },
|
|
57
|
+
like_any: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].matches_any(value.map(&:to_escaped_for_sql_like), ::Arel.sql("E'\\\\'"), true) },
|
|
58
|
+
ilike_any: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].matches_any(value.map(&:to_escaped_for_sql_like), ::Arel.sql("E'\\\\'"), false) },
|
|
59
|
+
not_like_any: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].does_not_match_any(value.map(&:to_escaped_for_sql_like), ::Arel.sql("E'\\\\'"), true) },
|
|
60
|
+
not_ilike_any: ->(table_name, column, value) { ::Arel::Table.new(table_name)[column].does_not_match_any(value.map(&:to_escaped_for_sql_like), ::Arel.sql("E'\\\\'"), false) },
|
|
61
|
+
regex: ->(table_name, column, value, flags) { ::Arel::Table.new(table_name)[column].matches_regexp("(?#{flags})#{value.is_a?(Regexp) ? value.source : value}") },
|
|
62
|
+
not_regex: ->(table_name, column, value, flags) { ::Arel::Table.new(table_name)[column].does_not_match_regexp("(?#{flags})#{value.is_a?(Regexp) ? value.source : value}") },
|
|
63
|
+
tsquery: ->(table_name, column, value, ts_config) { ::Arel.sql("to_tsvector(:ts_config, :table) @@ plainto_tsquery(:ts_config, :value)", ts_config: ts_config, value: value, table: ::Arel.sql("#{table_name}.#{column}")) },
|
|
64
|
+
has_bits: ->(table_name, column, value) { ::Arel.sql("(#{table_name}.#{column} & #{::Arel::Nodes.build_quoted(value).to_sql}) = #{::Arel::Nodes.build_quoted(value).to_sql}") },
|
|
65
|
+
not_has_bits: ->(table_name, column, value) { ::Arel.sql("(#{table_name}.#{column} & #{::Arel::Nodes.build_quoted(value).to_sql}) != #{::Arel::Nodes.build_quoted(value).to_sql}") },
|
|
66
66
|
}.freeze
|
|
67
67
|
|
|
68
68
|
private
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module YiffSpace
|
|
4
|
+
module Extensions
|
|
5
|
+
module Object
|
|
6
|
+
module ToB
|
|
7
|
+
def to_b
|
|
8
|
+
case self
|
|
9
|
+
when ::String
|
|
10
|
+
!match?(/\A(false|f|no|n|off|0)\z/i)
|
|
11
|
+
when ::TrueClass
|
|
12
|
+
true
|
|
13
|
+
when ::FalseClass
|
|
14
|
+
false
|
|
15
|
+
else
|
|
16
|
+
to_s.to_b
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module YiffSpace
|
|
4
|
+
module Extensions
|
|
5
|
+
module Object
|
|
6
|
+
module TruthyFalsy
|
|
7
|
+
def truthy?
|
|
8
|
+
case self
|
|
9
|
+
when ::String
|
|
10
|
+
match?(/\A(true|t|yes|y|on|1)\z/i)
|
|
11
|
+
when ::TrueClass
|
|
12
|
+
true
|
|
13
|
+
when ::FalseClass
|
|
14
|
+
false
|
|
15
|
+
else
|
|
16
|
+
to_s.truthy?
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def falsy?
|
|
21
|
+
case self
|
|
22
|
+
when ::String
|
|
23
|
+
match?(/\A(false|f|no|n|off|0)\z/i)
|
|
24
|
+
when ::TrueClass
|
|
25
|
+
false
|
|
26
|
+
when ::FalseClass
|
|
27
|
+
true
|
|
28
|
+
else
|
|
29
|
+
to_s.falsy?
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require_relative("active_record_extensions")
|
|
4
|
+
require_relative("api_methods")
|
|
5
|
+
require_relative("attribute_matchers")
|
|
6
|
+
require_relative("attribute_methods")
|
|
3
7
|
require_relative("cache")
|
|
8
|
+
require_relative("concurrency_methods")
|
|
9
|
+
require_relative("conditional_includes")
|
|
4
10
|
require_relative("current")
|
|
11
|
+
require_relative("current_methods")
|
|
5
12
|
require_relative("duration_parser")
|
|
13
|
+
require_relative("has_bit_flags")
|
|
6
14
|
require_relative("helpers")
|
|
7
15
|
require_relative("open_hash")
|
|
8
16
|
require_relative("parameter_builder")
|
|
@@ -15,5 +23,9 @@ require_relative("table_builder")
|
|
|
15
23
|
require_relative("trace_logger")
|
|
16
24
|
require_relative("u2id")
|
|
17
25
|
require_relative("user_attribute")
|
|
26
|
+
require_relative("user_class_methods")
|
|
18
27
|
require_relative("user_like")
|
|
28
|
+
require_relative("user_methods")
|
|
29
|
+
require_relative("user_name_methods")
|
|
19
30
|
require_relative("user_resolvable")
|
|
31
|
+
require_relative("user_resolvable_methods")
|
data/lib/yiffspace/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yiffspace
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.25
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Donovan_DMC
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-07-
|
|
10
|
+
date: 2026-07-14 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: abbrev
|
|
@@ -117,7 +117,7 @@ files:
|
|
|
117
117
|
- engines/auth/app/controllers/yiff_space/auth/webhook_controller.rb
|
|
118
118
|
- engines/auth/app/views/yiff_space/auth/root/permissions.html.erb
|
|
119
119
|
- engines/auth/config/routes.rb
|
|
120
|
-
- lib/tasks/
|
|
120
|
+
- lib/tasks/yiffspace_tasks.rake
|
|
121
121
|
- lib/yiffspace.rb
|
|
122
122
|
- lib/yiffspace/auth.rb
|
|
123
123
|
- lib/yiffspace/auth/api_user.rb
|
|
@@ -159,10 +159,11 @@ files:
|
|
|
159
159
|
- lib/yiffspace/core_ext/hash/all.rb
|
|
160
160
|
- lib/yiffspace/core_ext/hash/to_open_hash.rb
|
|
161
161
|
- lib/yiffspace/core_ext/logto/named_session_storage.rb
|
|
162
|
+
- lib/yiffspace/core_ext/object/all.rb
|
|
163
|
+
- lib/yiffspace/core_ext/object/to_b.rb
|
|
164
|
+
- lib/yiffspace/core_ext/object/truthy_falsy.rb
|
|
162
165
|
- lib/yiffspace/core_ext/string/all.rb
|
|
163
166
|
- lib/yiffspace/core_ext/string/sql.rb
|
|
164
|
-
- lib/yiffspace/core_ext/string/to_b.rb
|
|
165
|
-
- lib/yiffspace/core_ext/string/truthy_falsy.rb
|
|
166
167
|
- lib/yiffspace/extensions/action_dispatch/set_auth_client.rb
|
|
167
168
|
- lib/yiffspace/extensions/action_dispatch/set_auth_client/scoped.rb
|
|
168
169
|
- lib/yiffspace/extensions/active_record/where_chain.rb
|
|
@@ -175,9 +176,9 @@ files:
|
|
|
175
176
|
- lib/yiffspace/extensions/enumerable/parallel.rb
|
|
176
177
|
- lib/yiffspace/extensions/hash/to_open_hash.rb
|
|
177
178
|
- lib/yiffspace/extensions/logto/named_session_storage.rb
|
|
179
|
+
- lib/yiffspace/extensions/object/to_b.rb
|
|
180
|
+
- lib/yiffspace/extensions/object/truthy_falsy.rb
|
|
178
181
|
- lib/yiffspace/extensions/string/sql.rb
|
|
179
|
-
- lib/yiffspace/extensions/string/to_b.rb
|
|
180
|
-
- lib/yiffspace/extensions/string/truthy_falsy.rb
|
|
181
182
|
- lib/yiffspace/images.rb
|
|
182
183
|
- lib/yiffspace/images/avatar.rb
|
|
183
184
|
- lib/yiffspace/images/avatar/base.rb
|
|
@@ -186,10 +187,18 @@ files:
|
|
|
186
187
|
- lib/yiffspace/images/banner.rb
|
|
187
188
|
- lib/yiffspace/images/banner/base.rb
|
|
188
189
|
- lib/yiffspace/images/banner/discord.rb
|
|
190
|
+
- lib/yiffspace/include/active_record_extensions.rb
|
|
189
191
|
- lib/yiffspace/include/all.rb
|
|
192
|
+
- lib/yiffspace/include/api_methods.rb
|
|
193
|
+
- lib/yiffspace/include/attribute_matchers.rb
|
|
194
|
+
- lib/yiffspace/include/attribute_methods.rb
|
|
190
195
|
- lib/yiffspace/include/cache.rb
|
|
196
|
+
- lib/yiffspace/include/concurrency_methods.rb
|
|
197
|
+
- lib/yiffspace/include/conditional_includes.rb
|
|
191
198
|
- lib/yiffspace/include/current.rb
|
|
199
|
+
- lib/yiffspace/include/current_methods.rb
|
|
192
200
|
- lib/yiffspace/include/duration_parser.rb
|
|
201
|
+
- lib/yiffspace/include/has_bit_flags.rb
|
|
193
202
|
- lib/yiffspace/include/helpers.rb
|
|
194
203
|
- lib/yiffspace/include/open_hash.rb
|
|
195
204
|
- lib/yiffspace/include/parameter_builder.rb
|
|
@@ -202,8 +211,12 @@ files:
|
|
|
202
211
|
- lib/yiffspace/include/trace_logger.rb
|
|
203
212
|
- lib/yiffspace/include/u2id.rb
|
|
204
213
|
- lib/yiffspace/include/user_attribute.rb
|
|
214
|
+
- lib/yiffspace/include/user_class_methods.rb
|
|
205
215
|
- lib/yiffspace/include/user_like.rb
|
|
216
|
+
- lib/yiffspace/include/user_methods.rb
|
|
217
|
+
- lib/yiffspace/include/user_name_methods.rb
|
|
206
218
|
- lib/yiffspace/include/user_resolvable.rb
|
|
219
|
+
- lib/yiffspace/include/user_resolvable_methods.rb
|
|
207
220
|
- lib/yiffspace/logto_management_client.rb
|
|
208
221
|
- lib/yiffspace/railtie.rb
|
|
209
222
|
- lib/yiffspace/search/query_builder.rb
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module YiffSpace
|
|
4
|
-
module Extensions
|
|
5
|
-
module String
|
|
6
|
-
module TruthyFalsy
|
|
7
|
-
def truthy?
|
|
8
|
-
match?(/\A(true|t|yes|y|on|1)\z/i)
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def falsy?
|
|
12
|
-
match?(/\A(false|f|no|n|off|0)\z/i)
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|