cmdx 0.5.0 → 1.0.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.
- checksums.yaml +4 -4
- data/.DS_Store +0 -0
- data/.cursor/rules/cursor-instructions.mdc +6 -0
- data/.rubocop.yml +19 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +95 -28
- data/README.md +73 -25
- data/docs/ai_prompts.md +319 -0
- data/docs/basics/call.md +234 -14
- data/docs/basics/chain.md +280 -0
- data/docs/basics/context.md +241 -33
- data/docs/basics/setup.md +85 -12
- data/docs/callbacks.md +283 -0
- data/docs/configuration.md +155 -30
- data/docs/getting_started.md +145 -22
- data/docs/internationalization.md +148 -0
- data/docs/interruptions/exceptions.md +198 -11
- data/docs/interruptions/faults.md +196 -44
- data/docs/interruptions/halt.md +188 -35
- data/docs/logging.md +204 -53
- data/docs/middlewares.md +745 -0
- data/docs/outcomes/result.md +305 -10
- data/docs/outcomes/states.md +212 -31
- data/docs/outcomes/statuses.md +284 -30
- data/docs/parameters/coercions.md +411 -29
- data/docs/parameters/defaults.md +258 -25
- data/docs/parameters/definitions.md +247 -72
- data/docs/parameters/namespacing.md +259 -27
- data/docs/parameters/validations.md +173 -168
- data/docs/testing.md +560 -0
- data/docs/tips_and_tricks.md +103 -42
- data/docs/workflows.md +329 -0
- data/lib/cmdx/.DS_Store +0 -0
- data/lib/cmdx/callback.rb +69 -0
- data/lib/cmdx/callback_registry.rb +106 -0
- data/lib/cmdx/chain.rb +190 -0
- data/lib/cmdx/chain_inspector.rb +149 -0
- data/lib/cmdx/chain_serializer.rb +175 -0
- data/lib/cmdx/coercions/array.rb +37 -0
- data/lib/cmdx/coercions/big_decimal.rb +33 -0
- data/lib/cmdx/coercions/boolean.rb +41 -1
- data/lib/cmdx/coercions/complex.rb +31 -0
- data/lib/cmdx/coercions/date.rb +39 -0
- data/lib/cmdx/coercions/date_time.rb +39 -0
- data/lib/cmdx/coercions/float.rb +31 -0
- data/lib/cmdx/coercions/hash.rb +42 -0
- data/lib/cmdx/coercions/integer.rb +32 -0
- data/lib/cmdx/coercions/rational.rb +31 -0
- data/lib/cmdx/coercions/string.rb +31 -0
- data/lib/cmdx/coercions/time.rb +39 -0
- data/lib/cmdx/coercions/virtual.rb +31 -0
- data/lib/cmdx/configuration.rb +217 -9
- data/lib/cmdx/context.rb +173 -2
- data/lib/cmdx/core_ext/hash.rb +72 -0
- data/lib/cmdx/core_ext/module.rb +94 -0
- data/lib/cmdx/core_ext/object.rb +105 -0
- data/lib/cmdx/correlator.rb +217 -0
- data/lib/cmdx/error.rb +210 -8
- data/lib/cmdx/errors.rb +256 -1
- data/lib/cmdx/fault.rb +177 -2
- data/lib/cmdx/faults.rb +158 -2
- data/lib/cmdx/immutator.rb +121 -2
- data/lib/cmdx/lazy_struct.rb +261 -18
- data/lib/cmdx/log_formatters/json.rb +46 -0
- data/lib/cmdx/log_formatters/key_value.rb +46 -0
- data/lib/cmdx/log_formatters/line.rb +54 -0
- data/lib/cmdx/log_formatters/logstash.rb +64 -0
- data/lib/cmdx/log_formatters/pretty_json.rb +57 -0
- data/lib/cmdx/log_formatters/pretty_key_value.rb +51 -0
- data/lib/cmdx/log_formatters/pretty_line.rb +60 -0
- data/lib/cmdx/log_formatters/raw.rb +54 -0
- data/lib/cmdx/logger.rb +85 -0
- data/lib/cmdx/logger_ansi.rb +93 -7
- data/lib/cmdx/logger_serializer.rb +116 -0
- data/lib/cmdx/middleware.rb +74 -0
- data/lib/cmdx/middleware_registry.rb +106 -0
- data/lib/cmdx/middlewares/correlate.rb +266 -0
- data/lib/cmdx/middlewares/timeout.rb +232 -0
- data/lib/cmdx/parameter.rb +228 -1
- data/lib/cmdx/parameter_inspector.rb +61 -0
- data/lib/cmdx/parameter_registry.rb +125 -0
- data/lib/cmdx/parameter_serializer.rb +83 -0
- data/lib/cmdx/parameter_validator.rb +62 -0
- data/lib/cmdx/parameter_value.rb +109 -1
- data/lib/cmdx/parameters_inspector.rb +59 -0
- data/lib/cmdx/parameters_serializer.rb +102 -0
- data/lib/cmdx/railtie.rb +123 -3
- data/lib/cmdx/result.rb +367 -25
- data/lib/cmdx/result_ansi.rb +105 -9
- data/lib/cmdx/result_inspector.rb +76 -0
- data/lib/cmdx/result_logger.rb +90 -3
- data/lib/cmdx/result_serializer.rb +137 -0
- data/lib/cmdx/rspec/result_matchers.rb +917 -0
- data/lib/cmdx/rspec/task_matchers.rb +570 -0
- data/lib/cmdx/task.rb +405 -37
- data/lib/cmdx/task_serializer.rb +74 -2
- data/lib/cmdx/utils/ansi_color.rb +95 -0
- data/lib/cmdx/utils/log_timestamp.rb +48 -0
- data/lib/cmdx/utils/monotonic_runtime.rb +71 -4
- data/lib/cmdx/utils/name_affix.rb +78 -0
- data/lib/cmdx/validators/custom.rb +82 -0
- data/lib/cmdx/validators/exclusion.rb +94 -0
- data/lib/cmdx/validators/format.rb +102 -8
- data/lib/cmdx/validators/inclusion.rb +104 -0
- data/lib/cmdx/validators/length.rb +128 -0
- data/lib/cmdx/validators/numeric.rb +128 -0
- data/lib/cmdx/validators/presence.rb +93 -7
- data/lib/cmdx/version.rb +7 -1
- data/lib/cmdx/workflow.rb +394 -0
- data/lib/cmdx.rb +25 -64
- data/lib/generators/cmdx/install_generator.rb +37 -1
- data/lib/generators/cmdx/task_generator.rb +69 -1
- data/lib/generators/cmdx/templates/install.rb +43 -15
- data/lib/generators/cmdx/workflow_generator.rb +109 -0
- data/lib/locales/ar.yml +36 -0
- data/lib/locales/cs.yml +36 -0
- data/lib/locales/da.yml +36 -0
- data/lib/locales/de.yml +36 -0
- data/lib/locales/el.yml +36 -0
- data/lib/locales/en.yml +20 -20
- data/lib/locales/es.yml +20 -20
- data/lib/locales/fi.yml +36 -0
- data/lib/locales/fr.yml +36 -0
- data/lib/locales/he.yml +36 -0
- data/lib/locales/hi.yml +36 -0
- data/lib/locales/it.yml +36 -0
- data/lib/locales/ja.yml +36 -0
- data/lib/locales/ko.yml +36 -0
- data/lib/locales/nl.yml +36 -0
- data/lib/locales/no.yml +36 -0
- data/lib/locales/pl.yml +36 -0
- data/lib/locales/pt.yml +36 -0
- data/lib/locales/ru.yml +36 -0
- data/lib/locales/sv.yml +36 -0
- data/lib/locales/th.yml +36 -0
- data/lib/locales/tr.yml +36 -0
- data/lib/locales/vi.yml +36 -0
- data/lib/locales/zh.yml +36 -0
- metadata +77 -15
- data/docs/basics/run.md +0 -34
- data/docs/batch.md +0 -53
- data/docs/example.md +0 -82
- data/docs/hooks.md +0 -62
- data/lib/cmdx/batch.rb +0 -43
- data/lib/cmdx/parameters.rb +0 -35
- data/lib/cmdx/run.rb +0 -39
- data/lib/cmdx/run_inspector.rb +0 -26
- data/lib/cmdx/run_serializer.rb +0 -20
- data/lib/cmdx/task_hook.rb +0 -18
- data/lib/generators/cmdx/batch_generator.rb +0 -30
- /data/lib/generators/cmdx/templates/{batch.rb.tt → workflow.rb.tt} +0 -0
@@ -1,13 +1,54 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Cmdx
|
4
|
+
##
|
5
|
+
# Rails generator for creating CMDx task classes.
|
6
|
+
#
|
7
|
+
# This generator creates individual task files that encapsulate specific
|
8
|
+
# business logic operations. Tasks inherit from CMDx::Task and provide
|
9
|
+
# parameter validation, callbacks, result tracking, and error handling
|
10
|
+
# capabilities for focused business operations.
|
11
|
+
#
|
12
|
+
# The generator handles name normalization, ensuring "Task" suffix
|
13
|
+
# and proper file naming conventions. Generated tasks inherit from
|
14
|
+
# ApplicationTask when available, falling back to CMDx::Task.
|
15
|
+
#
|
16
|
+
# @example Generate a task
|
17
|
+
# rails generate cmdx:task SendEmail
|
18
|
+
# rails generate cmdx:task ProcessPayment
|
19
|
+
# rails generate cmdx:task ProcessPaymentTask # "Task" suffix preserved
|
20
|
+
#
|
21
|
+
# @example Generated file location
|
22
|
+
# app/cmds/send_email_task.rb
|
23
|
+
# app/cmds/process_payment_task.rb
|
24
|
+
#
|
25
|
+
# @since 1.0.0
|
4
26
|
class TaskGenerator < Rails::Generators::NamedBase
|
5
27
|
|
6
28
|
source_root File.expand_path("templates", __dir__)
|
7
29
|
check_class_collision suffix: "Task"
|
8
30
|
|
9
|
-
desc "
|
31
|
+
desc "Creates a task with the given NAME"
|
10
32
|
|
33
|
+
##
|
34
|
+
# Copies the task template to the application commands directory.
|
35
|
+
#
|
36
|
+
# Creates a new task file in `app/cmds/` with the normalized name.
|
37
|
+
# The generator automatically handles:
|
38
|
+
# - Removing "Task" suffix from file naming
|
39
|
+
# - Converting to snake_case for file naming
|
40
|
+
# - Adding "_task" suffix to the filename
|
41
|
+
# - Setting up proper class inheritance
|
42
|
+
#
|
43
|
+
# @return [void]
|
44
|
+
# @raise [Thor::Error] if the destination file cannot be created
|
45
|
+
#
|
46
|
+
# @example Generated task structure
|
47
|
+
# class SendEmailTask < ApplicationTask
|
48
|
+
# def call
|
49
|
+
# # Task business logic
|
50
|
+
# end
|
51
|
+
# end
|
11
52
|
def copy_files
|
12
53
|
name = file_name.sub(/_?task$/i, "")
|
13
54
|
path = File.join("app/cmds", class_path, "#{name}_task.rb")
|
@@ -16,10 +57,37 @@ module Cmdx
|
|
16
57
|
|
17
58
|
private
|
18
59
|
|
60
|
+
##
|
61
|
+
# Normalizes the class name by ensuring "Task" suffix.
|
62
|
+
#
|
63
|
+
# Ensures consistent class naming by adding "Task" suffix if not
|
64
|
+
# already present, allowing users to specify either "SendEmail"
|
65
|
+
# or "SendEmailTask".
|
66
|
+
#
|
67
|
+
# @return [String] the normalized class name with "Task" suffix
|
68
|
+
#
|
69
|
+
# @example Class name normalization
|
70
|
+
# # Input: "SendEmail"
|
71
|
+
# # Output: "SendEmailTask"
|
72
|
+
#
|
73
|
+
# # Input: "SendEmailTask"
|
74
|
+
# # Output: "SendEmailTask"
|
19
75
|
def class_name
|
20
76
|
@class_name ||= super.end_with?("Task") ? super : "#{super}Task"
|
21
77
|
end
|
22
78
|
|
79
|
+
##
|
80
|
+
# Determines the parent class for the generated task.
|
81
|
+
#
|
82
|
+
# Attempts to use ApplicationTask as the parent class if available,
|
83
|
+
# falling back to CMDx::Task if ApplicationTask is not defined.
|
84
|
+
# This allows applications to define custom base task behavior.
|
85
|
+
#
|
86
|
+
# @return [String] the parent class name to inherit from
|
87
|
+
#
|
88
|
+
# @example Parent class resolution
|
89
|
+
# # If ApplicationTask exists: "ApplicationTask"
|
90
|
+
# # If ApplicationTask missing: "CMDx::Task"
|
23
91
|
def parent_class_name
|
24
92
|
ApplicationTask
|
25
93
|
rescue StandardError
|
@@ -1,23 +1,51 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
CMDx.configure do |config|
|
4
|
-
#
|
5
|
-
#
|
6
|
-
|
4
|
+
# Task halt configuration - controls when call! raises faults
|
5
|
+
# See https://github.com/drexed/cmdx/blob/main/docs/outcomes/statuses.md for more details
|
6
|
+
#
|
7
|
+
# Available statuses: "success", "skipped", "failed"
|
8
|
+
# If set to an empty array, task will never halt
|
9
|
+
config.task_halt = %w[failed]
|
7
10
|
|
8
|
-
#
|
9
|
-
|
11
|
+
# Workflow halt configuration - controls when workflows stop execution
|
12
|
+
# When a task returns these statuses, subsequent workflow tasks won't execute
|
13
|
+
# See https://github.com/drexed/cmdx/blob/main/docs/workflow.md for more details
|
14
|
+
#
|
15
|
+
# Available statuses: "success", "skipped", "failed"
|
16
|
+
# If set to an empty array, workflow will never halt
|
17
|
+
config.workflow_halt = %w[failed]
|
10
18
|
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
|
19
|
+
# Logger configuration - choose from multiple formatters
|
20
|
+
# See https://github.com/drexed/cmdx/blob/main/docs/logging.md for more details
|
21
|
+
#
|
22
|
+
# Available formatters:
|
23
|
+
# - CMDx::LogFormatters::Line
|
24
|
+
# - CMDx::LogFormatters::PrettyLine
|
25
|
+
# - CMDx::LogFormatters::Json
|
26
|
+
# - CMDx::LogFormatters::PrettyJson
|
27
|
+
# - CMDx::LogFormatters::KeyValue
|
28
|
+
# - CMDx::LogFormatters::PrettyKeyValue
|
29
|
+
# - CMDx::LogFormatters::Logstash
|
30
|
+
# - CMDx::LogFormatters::Raw
|
31
|
+
config.logger = Logger.new($stdout, formatter: CMDx::LogFormatters::Line.new)
|
15
32
|
|
16
|
-
#
|
17
|
-
#
|
18
|
-
|
33
|
+
# Global middlewares - automatically applied to all tasks
|
34
|
+
# See https://github.com/drexed/cmdx/blob/main/docs/middlewares.md for more details
|
35
|
+
#
|
36
|
+
# config.middlewares.use CMDx::Middlewares::Timeout, seconds: 30
|
37
|
+
# config.middlewares.use CMDx::Middlewares::Correlate
|
38
|
+
# config.middlewares.use CustomAuthMiddleware, role: "admin"
|
39
|
+
# config.middlewares.use PerformanceMiddleware.new(threshold: 5.0)
|
19
40
|
|
20
|
-
#
|
21
|
-
# https://github.com/drexed/cmdx/
|
22
|
-
|
41
|
+
# Global callbacks - automatically applied to all tasks
|
42
|
+
# See https://github.com/drexed/cmdx/blob/main/docs/callbacks.md for more details
|
43
|
+
#
|
44
|
+
# config.callbacks.register :before_execution, :log_task_start
|
45
|
+
# config.callbacks.register :after_execution, :log_task_end
|
46
|
+
# config.callbacks.register :on_success, NotificationCallback.new([:email])
|
47
|
+
# config.callbacks.register :on_failure, :alert_support, if: :critical?
|
48
|
+
# config.callbacks.register :on_complete, proc { |task, callback_type|
|
49
|
+
# Metrics.increment("task.#{task.class.name.underscore}.completed")
|
50
|
+
# }
|
23
51
|
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cmdx
|
4
|
+
##
|
5
|
+
# Rails generator for creating CMDx workflow task classes.
|
6
|
+
#
|
7
|
+
# This generator creates workflow task files that coordinate multiple
|
8
|
+
# individual tasks in a structured workflow. Workflow tasks inherit
|
9
|
+
# from CMDx::Workflow and provide orchestration capabilities for
|
10
|
+
# complex business processes.
|
11
|
+
#
|
12
|
+
# The generator handles name normalization, ensuring proper file naming
|
13
|
+
# conventions and class names. Generated workflow tasks inherit from
|
14
|
+
# ApplicationWorkflow when available, falling back to CMDx::Workflow.
|
15
|
+
#
|
16
|
+
# @example Generate a workflow task
|
17
|
+
# rails generate cmdx:workflow OrderProcessing
|
18
|
+
# rails generate cmdx:workflow PaymentWorkflow # "Workflow" suffix preserved
|
19
|
+
#
|
20
|
+
# @example Generated file location
|
21
|
+
# app/cmds/order_processing_workflow.rb
|
22
|
+
# app/cmds/payment_workflow.rb
|
23
|
+
#
|
24
|
+
# @example Generated class structure
|
25
|
+
# class OrderProcessingWorkflow < ApplicationWorkflow
|
26
|
+
# def call
|
27
|
+
# # Workflow orchestration logic
|
28
|
+
# end
|
29
|
+
# end
|
30
|
+
#
|
31
|
+
# @see CMDx::Workflow Base workflow class
|
32
|
+
# @see Rails::Generators::NamedBase Rails generator base class
|
33
|
+
# @since 1.0.0
|
34
|
+
class WorkflowGenerator < Rails::Generators::NamedBase
|
35
|
+
|
36
|
+
source_root File.expand_path("templates", __dir__)
|
37
|
+
check_class_collision suffix: "Workflow"
|
38
|
+
|
39
|
+
desc "Creates a workflow with the given NAME"
|
40
|
+
|
41
|
+
##
|
42
|
+
# Copies the workflow task template to the application commands directory.
|
43
|
+
#
|
44
|
+
# Creates a new workflow task file in `app/cmds/` with the normalized
|
45
|
+
# name. The generator automatically handles:
|
46
|
+
# - Removing "workflow" suffix from the provided name for filename
|
47
|
+
# - Converting to snake_case for file naming
|
48
|
+
# - Adding "_workflow" suffix to the filename
|
49
|
+
# - Setting up proper class inheritance
|
50
|
+
# - Ensuring class names end with "Workflow"
|
51
|
+
#
|
52
|
+
# @return [void]
|
53
|
+
# @raise [Thor::Error] if the destination file cannot be created
|
54
|
+
#
|
55
|
+
# @example File generation
|
56
|
+
# # Input: rails generate cmdx:workflow OrderProcessing
|
57
|
+
# # Creates: app/cmds/order_processing_workflow.rb
|
58
|
+
# # Class: OrderProcessingWorkflow
|
59
|
+
#
|
60
|
+
# # Input: rails generate cmdx:workflow PaymentWorkflow
|
61
|
+
# # Creates: app/cmds/payment_workflow.rb
|
62
|
+
# # Class: PaymentWorkflow
|
63
|
+
def copy_files
|
64
|
+
name = file_name.sub(/_?workflow$/i, "")
|
65
|
+
path = File.join("app/cmds", class_path, "#{name}_workflow.rb")
|
66
|
+
template("workflow.rb.tt", path)
|
67
|
+
end
|
68
|
+
|
69
|
+
private
|
70
|
+
|
71
|
+
##
|
72
|
+
# Normalizes the class name by ensuring it ends with "Workflow".
|
73
|
+
#
|
74
|
+
# Ensures consistent class naming by appending "Workflow" suffix
|
75
|
+
# to the provided generator name if it doesn't already end with it,
|
76
|
+
# allowing users to specify either "OrderProcessing" or "OrderProcessingWorkflow".
|
77
|
+
#
|
78
|
+
# @return [String] the normalized class name with "Workflow" suffix
|
79
|
+
#
|
80
|
+
# @example Class name normalization
|
81
|
+
# # Input: "OrderProcessing"
|
82
|
+
# # Output: "OrderProcessingWorkflow"
|
83
|
+
#
|
84
|
+
# # Input: "PaymentWorkflow"
|
85
|
+
# # Output: "PaymentWorkflow"
|
86
|
+
def class_name
|
87
|
+
@class_name ||= super.end_with?("Workflow") ? super : "#{super}Workflow"
|
88
|
+
end
|
89
|
+
|
90
|
+
##
|
91
|
+
# Determines the parent class for the generated workflow task.
|
92
|
+
#
|
93
|
+
# Attempts to use ApplicationWorkflow as the parent class if available,
|
94
|
+
# falling back to CMDx::Workflow if ApplicationWorkflow is not defined.
|
95
|
+
# This allows applications to define custom base workflow behavior.
|
96
|
+
#
|
97
|
+
# @return [String] the parent class name to inherit from
|
98
|
+
#
|
99
|
+
# @example Parent class resolution
|
100
|
+
# # If ApplicationWorkflow exists: "ApplicationWorkflow"
|
101
|
+
# # If ApplicationWorkflow missing: "CMDx::Workflow"
|
102
|
+
def parent_class_name
|
103
|
+
ApplicationWorkflow
|
104
|
+
rescue StandardError
|
105
|
+
CMDx::Workflow
|
106
|
+
end
|
107
|
+
|
108
|
+
end
|
109
|
+
end
|
data/lib/locales/ar.yml
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
ar:
|
2
|
+
cmdx:
|
3
|
+
coercions:
|
4
|
+
into_a: "لا يمكن تحويل إلى %{type}"
|
5
|
+
into_an: "لا يمكن تحويل إلى %{type}"
|
6
|
+
into_any: "لا يمكن تحويل إلى أي من: %{values}"
|
7
|
+
unknown: "نوع التحويل %{type} غير معروف"
|
8
|
+
faults:
|
9
|
+
unspecified: "لم يتم تحديد سبب"
|
10
|
+
parameters:
|
11
|
+
required: "معامل مطلوب"
|
12
|
+
undefined: "يفوض لطريقة غير معرفة %{source}"
|
13
|
+
validators:
|
14
|
+
custom: "غير صالح"
|
15
|
+
exclusion:
|
16
|
+
of: "يجب ألا يكون أحد: %{values}"
|
17
|
+
within: "يجب ألا يكون بين %{min} و %{max}"
|
18
|
+
format: "له تنسيق غير صالح"
|
19
|
+
inclusion:
|
20
|
+
of: "يجب أن يكون أحد: %{values}"
|
21
|
+
within: "يجب أن يكون بين %{min} و %{max}"
|
22
|
+
length:
|
23
|
+
is: "يجب أن يكون الطول %{is}"
|
24
|
+
is_not: "يجب ألا يكون الطول %{is_not}"
|
25
|
+
min: "يجب أن يكون الطول على الأقل %{min}"
|
26
|
+
max: "يجب أن يكون الطول على الأكثر %{max}"
|
27
|
+
not_within: "يجب ألا يكون الطول بين %{min} و %{max}"
|
28
|
+
within: "يجب أن يكون الطول بين %{min} و %{max}"
|
29
|
+
numeric:
|
30
|
+
is: "يجب أن يكون %{is}"
|
31
|
+
is_not: "يجب ألا يكون %{is_not}"
|
32
|
+
min: "يجب أن يكون على الأقل %{min}"
|
33
|
+
max: "يجب أن يكون على الأكثر %{max}"
|
34
|
+
not_within: "يجب ألا يكون بين %{min} و %{max}"
|
35
|
+
within: "يجب أن يكون بين %{min} و %{max}"
|
36
|
+
presence: "لا يمكن أن يكون فارغاً"
|
data/lib/locales/cs.yml
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
cs:
|
2
|
+
cmdx:
|
3
|
+
coercions:
|
4
|
+
into_a: "nelze převést na %{type}"
|
5
|
+
into_an: "nelze převést na %{type}"
|
6
|
+
into_any: "nelze převést na jeden z: %{values}"
|
7
|
+
unknown: "neznámý typ převodu %{type}"
|
8
|
+
faults:
|
9
|
+
unspecified: "nebyl uveden důvod"
|
10
|
+
parameters:
|
11
|
+
required: "je povinný parametr"
|
12
|
+
undefined: "deleguje na nedefinovanou metodu %{source}"
|
13
|
+
validators:
|
14
|
+
custom: "není platný"
|
15
|
+
exclusion:
|
16
|
+
of: "nesmí být jeden z: %{values}"
|
17
|
+
within: "nesmí být mezi %{min} a %{max}"
|
18
|
+
format: "má neplatný formát"
|
19
|
+
inclusion:
|
20
|
+
of: "musí být jeden z: %{values}"
|
21
|
+
within: "musí být mezi %{min} a %{max}"
|
22
|
+
length:
|
23
|
+
is: "délka musí být %{is}"
|
24
|
+
is_not: "délka nesmí být %{is_not}"
|
25
|
+
min: "délka musí být alespoň %{min}"
|
26
|
+
max: "délka může být nejvýše %{max}"
|
27
|
+
not_within: "délka nesmí být mezi %{min} a %{max}"
|
28
|
+
within: "délka musí být mezi %{min} a %{max}"
|
29
|
+
numeric:
|
30
|
+
is: "musí být %{is}"
|
31
|
+
is_not: "nesmí být %{is_not}"
|
32
|
+
min: "musí být alespoň %{min}"
|
33
|
+
max: "může být nejvýše %{max}"
|
34
|
+
not_within: "nesmí být mezi %{min} a %{max}"
|
35
|
+
within: "musí být mezi %{min} a %{max}"
|
36
|
+
presence: "nemůže být prázdný"
|
data/lib/locales/da.yml
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
da:
|
2
|
+
cmdx:
|
3
|
+
coercions:
|
4
|
+
into_a: "kunne ikke konvertere til en %{type}"
|
5
|
+
into_an: "kunne ikke konvertere til en %{type}"
|
6
|
+
into_any: "kunne ikke konvertere til en af: %{values}"
|
7
|
+
unknown: "ukendt %{type} konverteringstype"
|
8
|
+
faults:
|
9
|
+
unspecified: "ingen grund angivet"
|
10
|
+
parameters:
|
11
|
+
required: "er en påkrævet parameter"
|
12
|
+
undefined: "delegerer til udefineret metode %{source}"
|
13
|
+
validators:
|
14
|
+
custom: "er ikke gyldig"
|
15
|
+
exclusion:
|
16
|
+
of: "må ikke være en af: %{values}"
|
17
|
+
within: "må ikke være mellem %{min} og %{max}"
|
18
|
+
format: "har et ugyldigt format"
|
19
|
+
inclusion:
|
20
|
+
of: "skal være en af: %{values}"
|
21
|
+
within: "skal være mellem %{min} og %{max}"
|
22
|
+
length:
|
23
|
+
is: "længde skal være %{is}"
|
24
|
+
is_not: "længde må ikke være %{is_not}"
|
25
|
+
min: "længde skal være mindst %{min}"
|
26
|
+
max: "længde må være højst %{max}"
|
27
|
+
not_within: "længde må ikke være mellem %{min} og %{max}"
|
28
|
+
within: "længde skal være mellem %{min} og %{max}"
|
29
|
+
numeric:
|
30
|
+
is: "skal være %{is}"
|
31
|
+
is_not: "må ikke være %{is_not}"
|
32
|
+
min: "skal være mindst %{min}"
|
33
|
+
max: "må være højst %{max}"
|
34
|
+
not_within: "må ikke være mellem %{min} og %{max}"
|
35
|
+
within: "skal være mellem %{min} og %{max}"
|
36
|
+
presence: "kan ikke være tom"
|
data/lib/locales/de.yml
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
de:
|
2
|
+
cmdx:
|
3
|
+
coercions:
|
4
|
+
into_a: "konnte nicht in einen %{type} konvertiert werden"
|
5
|
+
into_an: "konnte nicht in einen %{type} konvertiert werden"
|
6
|
+
into_any: "konnte nicht in einen von: %{values} konvertiert werden"
|
7
|
+
unknown: "unbekannter %{type} Konvertierungstyp"
|
8
|
+
faults:
|
9
|
+
unspecified: "kein Grund angegeben"
|
10
|
+
parameters:
|
11
|
+
required: "ist ein erforderlicher Parameter"
|
12
|
+
undefined: "delegiert an undefinierte Methode %{source}"
|
13
|
+
validators:
|
14
|
+
custom: "ist nicht gültig"
|
15
|
+
exclusion:
|
16
|
+
of: "darf nicht einer von: %{values} sein"
|
17
|
+
within: "darf nicht zwischen %{min} und %{max} liegen"
|
18
|
+
format: "hat ein ungültiges Format"
|
19
|
+
inclusion:
|
20
|
+
of: "muss einer von: %{values} sein"
|
21
|
+
within: "muss zwischen %{min} und %{max} liegen"
|
22
|
+
length:
|
23
|
+
is: "Länge muss %{is} sein"
|
24
|
+
is_not: "Länge darf nicht %{is_not} sein"
|
25
|
+
min: "Länge muss mindestens %{min} sein"
|
26
|
+
max: "Länge darf höchstens %{max} sein"
|
27
|
+
not_within: "Länge darf nicht zwischen %{min} und %{max} liegen"
|
28
|
+
within: "Länge muss zwischen %{min} und %{max} liegen"
|
29
|
+
numeric:
|
30
|
+
is: "muss %{is} sein"
|
31
|
+
is_not: "darf nicht %{is_not} sein"
|
32
|
+
min: "muss mindestens %{min} sein"
|
33
|
+
max: "darf höchstens %{max} sein"
|
34
|
+
not_within: "darf nicht zwischen %{min} und %{max} liegen"
|
35
|
+
within: "muss zwischen %{min} und %{max} liegen"
|
36
|
+
presence: "kann nicht leer sein"
|
data/lib/locales/el.yml
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
el:
|
2
|
+
cmdx:
|
3
|
+
coercions:
|
4
|
+
into_a: "δεν ήταν δυνατή η μετατροπή σε %{type}"
|
5
|
+
into_an: "δεν ήταν δυνατή η μετατροπή σε %{type}"
|
6
|
+
into_any: "δεν ήταν δυνατή η μετατροπή σε κανένα από: %{values}"
|
7
|
+
unknown: "άγνωστος τύπος μετατροπής %{type}"
|
8
|
+
faults:
|
9
|
+
unspecified: "δεν δόθηκε λόγος"
|
10
|
+
parameters:
|
11
|
+
required: "είναι υποχρεωτική παράμετρος"
|
12
|
+
undefined: "αναθέτει σε μη ορισμένη μέθοδο %{source}"
|
13
|
+
validators:
|
14
|
+
custom: "δεν είναι έγκυρο"
|
15
|
+
exclusion:
|
16
|
+
of: "δεν πρέπει να είναι ένα από: %{values}"
|
17
|
+
within: "δεν πρέπει να είναι μεταξύ %{min} και %{max}"
|
18
|
+
format: "έχει μη έγκυρη μορφή"
|
19
|
+
inclusion:
|
20
|
+
of: "πρέπει να είναι ένα από: %{values}"
|
21
|
+
within: "πρέπει να είναι μεταξύ %{min} και %{max}"
|
22
|
+
length:
|
23
|
+
is: "το μήκος πρέπει να είναι %{is}"
|
24
|
+
is_not: "το μήκος δεν πρέπει να είναι %{is_not}"
|
25
|
+
min: "το μήκος πρέπει να είναι τουλάχιστον %{min}"
|
26
|
+
max: "το μήκος πρέπει να είναι το πολύ %{max}"
|
27
|
+
not_within: "το μήκος δεν πρέπει να είναι μεταξύ %{min} και %{max}"
|
28
|
+
within: "το μήκος πρέπει να είναι μεταξύ %{min} και %{max}"
|
29
|
+
numeric:
|
30
|
+
is: "πρέπει να είναι %{is}"
|
31
|
+
is_not: "δεν πρέπει να είναι %{is_not}"
|
32
|
+
min: "πρέπει να είναι τουλάχιστον %{min}"
|
33
|
+
max: "πρέπει να είναι το πολύ %{max}"
|
34
|
+
not_within: "δεν πρέπει να είναι μεταξύ %{min} και %{max}"
|
35
|
+
within: "πρέπει να είναι μεταξύ %{min} και %{max}"
|
36
|
+
presence: "δεν μπορεί να είναι κενό"
|
data/lib/locales/en.yml
CHANGED
@@ -6,31 +6,31 @@ en:
|
|
6
6
|
into_any: "could not coerce into one of: %{values}"
|
7
7
|
unknown: "unknown %{type} coercion type"
|
8
8
|
faults:
|
9
|
-
unspecified: no reason given
|
9
|
+
unspecified: "no reason given"
|
10
10
|
parameters:
|
11
|
-
required: is a required parameter
|
12
|
-
undefined: delegates to undefined method %{source}
|
11
|
+
required: "is a required parameter"
|
12
|
+
undefined: "delegates to undefined method %{source}"
|
13
13
|
validators:
|
14
|
-
custom: is not valid
|
14
|
+
custom: "is not valid"
|
15
15
|
exclusion:
|
16
16
|
of: "must not be one of: %{values}"
|
17
|
-
within: must not be within %{min} and %{max}
|
18
|
-
format: is an invalid format
|
17
|
+
within: "must not be within %{min} and %{max}"
|
18
|
+
format: "is an invalid format"
|
19
19
|
inclusion:
|
20
20
|
of: "must be one of: %{values}"
|
21
|
-
within: must be within %{min} and %{max}
|
21
|
+
within: "must be within %{min} and %{max}"
|
22
22
|
length:
|
23
|
-
is: length must be %{is}
|
24
|
-
is_not: length must not be %{is_not}
|
25
|
-
min: length must be at least %{min}
|
26
|
-
max: length must be at most %{max}
|
27
|
-
not_within: length must not be within %{min} and %{max}
|
28
|
-
within: length must be within %{min} and %{max}
|
23
|
+
is: "length must be %{is}"
|
24
|
+
is_not: "length must not be %{is_not}"
|
25
|
+
min: "length must be at least %{min}"
|
26
|
+
max: "length must be at most %{max}"
|
27
|
+
not_within: "length must not be within %{min} and %{max}"
|
28
|
+
within: "length must be within %{min} and %{max}"
|
29
29
|
numeric:
|
30
|
-
is: must be %{is}
|
31
|
-
is_not: must not be %{is_not}
|
32
|
-
min: must be at least %{min}
|
33
|
-
max: must be at most %{max}
|
34
|
-
not_within: must not be within %{min} and %{max}
|
35
|
-
within: must be within %{min} and %{max}
|
36
|
-
presence: cannot be empty
|
30
|
+
is: "must be %{is}"
|
31
|
+
is_not: "must not be %{is_not}"
|
32
|
+
min: "must be at least %{min}"
|
33
|
+
max: "must be at most %{max}"
|
34
|
+
not_within: "must not be within %{min} and %{max}"
|
35
|
+
within: "must be within %{min} and %{max}"
|
36
|
+
presence: "cannot be empty"
|
data/lib/locales/es.yml
CHANGED
@@ -6,31 +6,31 @@ es:
|
|
6
6
|
into_any: "no podía coacciona el valor a un: %{values}"
|
7
7
|
unknown: "%{type} tipo de coacciona desconocido"
|
8
8
|
faults:
|
9
|
-
unspecified: ninguna razón dada
|
9
|
+
unspecified: "ninguna razón dada"
|
10
10
|
parameters:
|
11
|
-
required: es un parámetro requerido
|
12
|
-
undefined: delegado al método indefinido %{source}
|
11
|
+
required: "es un parámetro requerido"
|
12
|
+
undefined: "delegado al método indefinido %{source}"
|
13
13
|
validators:
|
14
|
-
custom: no es válida
|
14
|
+
custom: "no es válida"
|
15
15
|
exclusion:
|
16
16
|
of: "no debe ser uno de: %{values}"
|
17
|
-
within: no debe estar dentro %{min} y %{max}
|
18
|
-
format: es un formato inválido
|
17
|
+
within: "no debe estar dentro %{min} y %{max}"
|
18
|
+
format: "es un formato inválido"
|
19
19
|
inclusion:
|
20
20
|
of: "debe ser uno de: %{values}"
|
21
|
-
within: debe estar dentro %{min} y %{max}
|
21
|
+
within: "debe estar dentro %{min} y %{max}"
|
22
22
|
length:
|
23
|
-
is: tiene una longitud que debe ser %{is}
|
24
|
-
is_not: tiene una longitud no debe ser %{is}
|
25
|
-
min: tiene una longitud que debe ser menos de %{min}
|
26
|
-
max: tiene una longitud que debe ser mas de %{max}
|
27
|
-
not_within: tiene una longitud que no debe estar dentro %{min} y %{max}
|
28
|
-
within: tiene una longitud que debe estar dentro %{min} y %{max}
|
23
|
+
is: "tiene una longitud que debe ser %{is}"
|
24
|
+
is_not: "tiene una longitud no debe ser %{is}"
|
25
|
+
min: "tiene una longitud que debe ser menos de %{min}"
|
26
|
+
max: "tiene una longitud que debe ser mas de %{max}"
|
27
|
+
not_within: "tiene una longitud que no debe estar dentro %{min} y %{max}"
|
28
|
+
within: "tiene una longitud que debe estar dentro %{min} y %{max}"
|
29
29
|
numeric:
|
30
|
-
is: debe ser %{is}
|
31
|
-
is_not: no debe ser %{is}
|
32
|
-
min: debe ser %{min} como minimo
|
33
|
-
max: debe ser %{max} como máximo
|
34
|
-
not_within: no debe estar dentro %{min} y %{max}
|
35
|
-
within: debe estar dentro %{min} y %{max}
|
36
|
-
presence: no puede estar vacío
|
30
|
+
is: "debe ser %{is}"
|
31
|
+
is_not: "no debe ser %{is}"
|
32
|
+
min: "debe ser %{min} como minimo"
|
33
|
+
max: "debe ser %{max} como máximo"
|
34
|
+
not_within: "no debe estar dentro %{min} y %{max}"
|
35
|
+
within: "debe estar dentro %{min} y %{max}"
|
36
|
+
presence: "no puede estar vacío"
|
data/lib/locales/fi.yml
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
fi:
|
2
|
+
cmdx:
|
3
|
+
coercions:
|
4
|
+
into_a: "ei voitu muuntaa tyypiksi %{type}"
|
5
|
+
into_an: "ei voitu muuntaa tyypiksi %{type}"
|
6
|
+
into_any: "ei voitu muuntaa yhteenkään seuraavista: %{values}"
|
7
|
+
unknown: "tuntematon %{type} muunnostyyppi"
|
8
|
+
faults:
|
9
|
+
unspecified: "syytä ei annettu"
|
10
|
+
parameters:
|
11
|
+
required: "on pakollinen parametri"
|
12
|
+
undefined: "delegoi määrittelemättömään metodiin %{source}"
|
13
|
+
validators:
|
14
|
+
custom: "ei ole kelvollinen"
|
15
|
+
exclusion:
|
16
|
+
of: "ei saa olla mikään seuraavista: %{values}"
|
17
|
+
within: "ei saa olla välillä %{min} ja %{max}"
|
18
|
+
format: "on virheellisessä muodossa"
|
19
|
+
inclusion:
|
20
|
+
of: "on oltava jokin seuraavista: %{values}"
|
21
|
+
within: "on oltava välillä %{min} ja %{max}"
|
22
|
+
length:
|
23
|
+
is: "pituuden on oltava %{is}"
|
24
|
+
is_not: "pituus ei saa olla %{is_not}"
|
25
|
+
min: "pituuden on oltava vähintään %{min}"
|
26
|
+
max: "pituus saa olla enintään %{max}"
|
27
|
+
not_within: "pituus ei saa olla välillä %{min} ja %{max}"
|
28
|
+
within: "pituuden on oltava välillä %{min} ja %{max}"
|
29
|
+
numeric:
|
30
|
+
is: "on oltava %{is}"
|
31
|
+
is_not: "ei saa olla %{is_not}"
|
32
|
+
min: "on oltava vähintään %{min}"
|
33
|
+
max: "saa olla enintään %{max}"
|
34
|
+
not_within: "ei saa olla välillä %{min} ja %{max}"
|
35
|
+
within: "on oltava välillä %{min} ja %{max}"
|
36
|
+
presence: "ei voi olla tyhjä"
|
data/lib/locales/fr.yml
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
fr:
|
2
|
+
cmdx:
|
3
|
+
coercions:
|
4
|
+
into_a: "impossible de convertir en un %{type}"
|
5
|
+
into_an: "impossible de convertir en un %{type}"
|
6
|
+
into_any: "impossible de convertir en un de: %{values}"
|
7
|
+
unknown: "type de conversion %{type} inconnu"
|
8
|
+
faults:
|
9
|
+
unspecified: "aucune raison donnée"
|
10
|
+
parameters:
|
11
|
+
required: "est un paramètre obligatoire"
|
12
|
+
undefined: "délègue à une méthode indéfinie %{source}"
|
13
|
+
validators:
|
14
|
+
custom: "n'est pas valide"
|
15
|
+
exclusion:
|
16
|
+
of: "ne doit pas être un de: %{values}"
|
17
|
+
within: "ne doit pas être entre %{min} et %{max}"
|
18
|
+
format: "a un format invalide"
|
19
|
+
inclusion:
|
20
|
+
of: "doit être un de: %{values}"
|
21
|
+
within: "doit être entre %{min} et %{max}"
|
22
|
+
length:
|
23
|
+
is: "la longueur doit être %{is}"
|
24
|
+
is_not: "la longueur ne doit pas être %{is_not}"
|
25
|
+
min: "la longueur doit être au moins %{min}"
|
26
|
+
max: "la longueur doit être au maximum %{max}"
|
27
|
+
not_within: "la longueur ne doit pas être entre %{min} et %{max}"
|
28
|
+
within: "la longueur doit être entre %{min} et %{max}"
|
29
|
+
numeric:
|
30
|
+
is: "doit être %{is}"
|
31
|
+
is_not: "ne doit pas être %{is_not}"
|
32
|
+
min: "doit être au moins %{min}"
|
33
|
+
max: "doit être au maximum %{max}"
|
34
|
+
not_within: "ne doit pas être entre %{min} et %{max}"
|
35
|
+
within: "doit être entre %{min} et %{max}"
|
36
|
+
presence: "ne peut pas être vide"
|