kuroko2 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee6f951f3ef7d0813243f6d35f114c95080a76fd
4
- data.tar.gz: ebd90290d5c23208cdac92e33ac2180f27713690
3
+ metadata.gz: 051e564e4aaa5ec04697344bfe05aec09352b497
4
+ data.tar.gz: b0564f4086668ce4d6d200fd8d9bca0feb4c2282
5
5
  SHA512:
6
- metadata.gz: dbb2ee2e3fc299cc4991940f18f0170ee8f1eacdb4a2383f5edc30698debe4340213257970882f6bb348be9688ca1818b0a6d80bc3ef60b88dde537cd00e4300
7
- data.tar.gz: a6d0e22eab15a1c8b859511ab919ecebc37a397b4419deded95e1821dc25b34f5fa40f14b14ae514084102c91ceecd8c7fd7137619ff800d7a688d011084ae18
6
+ metadata.gz: '0446977e4059b15f880a905e0a2fde9949b4c676d791984f29ea2ec15cbd4e855fa9e4e73543b79fbf57b65031f13ca84b4017525de03bbdf7d810d46eb50ea7'
7
+ data.tar.gz: df867061f7bc67b6486959ef33f2a2555b817b88c53e7029d0997dc4173515b0eb07f698b89171464d214f6e6092ae66b9cbe279b74ae213267374981e7d82d9
data/README.md CHANGED
@@ -32,6 +32,8 @@ Documentation is available at [docs/index.md](docs/index.md).
32
32
  - hogelog
33
33
  - gfx
34
34
  - kaorimatz
35
+ - makimoto
36
+ - shigemk2
35
37
 
36
38
  ## License
37
39
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -67,10 +67,12 @@ class Kuroko2::JobDefinition < Kuroko2::ApplicationRecord
67
67
  validate :script_syntax
68
68
  validate :validate_number_of_admins
69
69
  validates :hipchat_additional_text, length: { maximum: 180 }
70
- validates :slack_channel, length: { maximum: 21 }, format: {
71
- with: /\A#[^\.\s]+\z/, allow_blank: true,
72
- message: ' must start with # and must not include any dots or spaces'
73
- }
70
+ validates :slack_channel,
71
+ length: { maximum: 22, too_long: ' is too long (maximum is 21 characters without `#` symbol at the head)' },
72
+ format: {
73
+ with: /\A#[^\.\s]+\z/, allow_blank: true,
74
+ message: ' must start with # and must not include any dots or spaces'
75
+ }
74
76
  validates :webhook_url, format: { with: /\A#{URI::regexp(%w(http https))}\z/, allow_blank: true }
75
77
 
76
78
  def proceed_multi_instance?
@@ -2,7 +2,7 @@ module Kuroko2
2
2
  module Workflow
3
3
  class Node
4
4
  PATH_REGEXP = %r(\A(?:/|(?:/\d+-[a-z0-9_]+)+)\z)
5
- TASK_REGISTORY = {
5
+ TASK_REGISTRY = {
6
6
  root: Task::Sequence,
7
7
  noop: Task::Noop,
8
8
  sequence: Task::Sequence,
@@ -28,20 +28,20 @@ module Kuroko2
28
28
  def self.register(key: nil, klass:)
29
29
  key ||= klass.to_s.demodulize.underscore.to_sym
30
30
 
31
- unless TASK_REGISTORY.has_key?(key)
32
- TASK_REGISTORY.store(key, klass)
31
+ unless TASK_REGISTRY.has_key?(key)
32
+ TASK_REGISTRY.store(key, klass)
33
33
  else
34
- Kuroko2.logger.warn("Unable to add '#{klass}' to task registory. '#{TASK_REGISTORY[key]}' is already registered.")
34
+ Kuroko2.logger.warn("Unable to add '#{klass}' to task registry. '#{TASK_REGISTRY[key]}' is already registered.")
35
35
  end
36
36
  end
37
37
 
38
38
  def self.deregister(key)
39
- TASK_REGISTORY.delete(key)
39
+ TASK_REGISTRY.delete(key)
40
40
  end
41
41
 
42
42
  def initialize(type, option = nil)
43
43
  @type = type.to_sym
44
- @task_klass = TASK_REGISTORY.fetch(@type, nil)
44
+ @task_klass = TASK_REGISTRY.fetch(@type, nil)
45
45
  @option = option.try(:strip)
46
46
  @parent = nil
47
47
  @children = []
@@ -31,7 +31,7 @@ module Kuroko2
31
31
 
32
32
  if Kuroko2.config.custom_tasks
33
33
  Kuroko2.config.custom_tasks.each do |key, klass|
34
- unless Workflow::Node::TASK_REGISTORY.has_key?(key)
34
+ unless Workflow::Node::TASK_REGISTRY.has_key?(key)
35
35
  Workflow::Node.register(
36
36
  key: key.to_sym,
37
37
  klass: Workflow::Task.const_get(klass, false)
@@ -1,3 +1,3 @@
1
1
  module Kuroko2
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
@@ -3,7 +3,7 @@ require 'rails_helper'
3
3
  module Kuroko2
4
4
  describe 'Check if settings is loaded' do
5
5
  it 'loads custom tasks' do
6
- expect(Workflow::Node::TASK_REGISTORY).to have_key(:custom_task1)
6
+ expect(Workflow::Node::TASK_REGISTRY).to have_key(:custom_task1)
7
7
  expect(Workflow::ScriptParser.new('custom_task1:').parse).to be_a(Workflow::Node)
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuroko2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naoto Takai
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-05-09 00:00:00.000000000 Z
12
+ date: 2017-05-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails