rabarber 5.0.0 → 5.1.1

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.
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Rabarber
4
- module Input
5
- class Role < Rabarber::Input::Base
6
- REGEX = /\A[a-z0-9_]+\z/
7
-
8
- def valid?
9
- Rabarber::Input::Types::Symbol.new(value).valid? && value.to_s.match?(REGEX)
10
- end
11
-
12
- private
13
-
14
- def processed_value
15
- value.to_sym
16
- end
17
-
18
- def default_error_message
19
- "Role name must be a Symbol or a String and may only contain lowercase letters, numbers, and underscores"
20
- end
21
- end
22
- end
23
- end
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Rabarber
4
- module Input
5
- class Roles < Rabarber::Input::Base
6
- def value
7
- Array(super)
8
- end
9
-
10
- def valid?
11
- value.all? { |role_name| Rabarber::Input::Role.new(role_name).valid? }
12
- end
13
-
14
- private
15
-
16
- def processed_value
17
- value.map(&:to_sym)
18
- end
19
-
20
- def default_error_message
21
- "Role names must be Symbols or Strings and may only contain lowercase letters, numbers, and underscores"
22
- end
23
- end
24
- end
25
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Rabarber
4
- module Input
5
- module Types
6
- class Boolean < Rabarber::Input::Base
7
- def valid?
8
- [true, false].include?(value)
9
- end
10
-
11
- private
12
-
13
- def processed_value
14
- value
15
- end
16
-
17
- def default_error_message
18
- "Value must be a Boolean"
19
- end
20
- end
21
- end
22
- end
23
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Rabarber
4
- module Input
5
- module Types
6
- class Proc < Rabarber::Input::Base
7
- def valid?
8
- value.is_a?(::Proc)
9
- end
10
-
11
- private
12
-
13
- def processed_value
14
- value
15
- end
16
-
17
- def default_error_message
18
- "Value must be a Proc"
19
- end
20
- end
21
- end
22
- end
23
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Rabarber
4
- module Input
5
- module Types
6
- class Symbol < Rabarber::Input::Base
7
- def valid?
8
- (value.is_a?(::Symbol) || value.is_a?(String)) && value.present?
9
- end
10
-
11
- private
12
-
13
- def processed_value
14
- value.to_sym
15
- end
16
-
17
- def default_error_message
18
- "Value must be a Symbol or a String"
19
- end
20
- end
21
- end
22
- end
23
- end