protoboard 0.2.2 → 0.2.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7b58fd301d115cd79ec04b7fbe18c92587f5e466
4
- data.tar.gz: 02ccf30262a80feec46ac7c75abbb6319ee02ddc
2
+ SHA256:
3
+ metadata.gz: bd3d4c3dec2c8da113f3f5584c0c1c279bfe462366ac392639e06a6833016728
4
+ data.tar.gz: 692bf7f9906f723cc08ec098f41f649424cb812fc5ad4d150f98e555dbb3f26e
5
5
  SHA512:
6
- metadata.gz: 7c21ea2710b568144b18195e24cd5717fb504f062538805ccd631c932d7fad7496efd654f4baf66de467da06cc7df03321b35d257129742f2fc9a39aa13a8b6c
7
- data.tar.gz: 48379e44a5cdddf4abe1419b4a48bf53a46a63acb7eccd5c90c657f0aebfdc8e059847d93ee884b18a746e9dfe1ed1bf264eda27549d5c78c270a61f4702fe9a
6
+ metadata.gz: ca1450fb5fbe1119cd7e23af091ab46211f4a2a7f2d2d7a5b0721b2a78c548c25c1b59fabf8f7a58b9c82da1f75653384b1a9435480ae5fe490004a62415e65e
7
+ data.tar.gz: 4f880a1727a6ae439c80d7f1c45e957d8ba1c84d03f2c521132f8877c512d6012328bc8448bb2c6e5dfa15aa680175b2b6831d2a4e2d55a1fc54cf252c62fa5c
@@ -6,4 +6,10 @@ rvm:
6
6
  - 2.3
7
7
  - 2.4
8
8
  - 2.5
9
- before_install: gem install bundler -v 1.16.2
9
+ before_script:
10
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
11
+ - chmod +x ./cc-test-reporter
12
+ - ./cc-test-reporter before-build
13
+ before_install: gem install bundler -v 1.16.4
14
+ after_script:
15
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- protoboard (0.2.2)
4
+ protoboard (0.2.3)
5
5
  dry-configurable (~> 0.7.0)
6
6
  stoplight (~> 2.1.3)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- concurrent-ruby (1.0.5)
11
+ concurrent-ruby (1.1.5)
12
12
  diff-lcs (1.3)
13
13
  docile (1.3.1)
14
14
  dry-configurable (0.7.0)
@@ -48,4 +48,4 @@ DEPENDENCIES
48
48
  simplecov
49
49
 
50
50
  BUNDLED WITH
51
- 1.16.2
51
+ 1.17.1
data/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # Protoboard
2
2
 
3
3
  [![Build Status](https://travis-ci.org/VAGAScom/protoboard.svg?branch=master)](https://travis-ci.org/VAGAScom/protoboard)
4
-
4
+ [![Maintainability](https://api.codeclimate.com/v1/badges/39e7c6f1f5f57b8555ed/maintainability)](https://codeclimate.com/github/VAGAScom/protoboard/maintainability)
5
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/39e7c6f1f5f57b8555ed/test_coverage)](https://codeclimate.com/github/VAGAScom/protoboard/test_coverage)\
5
6
  Protoboard abstracts the way you use Circuit Breaker allowing you to easily use it with any Ruby Object, under the hood it uses the gem [stoplight](https://github.com/orgsync/stoplight) to create the circuits.
6
7
 
7
8
 
@@ -16,10 +16,6 @@ module Protoboard
16
16
  setting :redis_port
17
17
  end
18
18
 
19
- def initialize
20
- prepare_data_store
21
- end
22
-
23
19
  class << self
24
20
  ##
25
21
  # This methods is used to make it easier to access adapter configurations
@@ -46,7 +46,11 @@ module Protoboard
46
46
  ##
47
47
  # Formats the module name
48
48
  def infer_module_name(class_name, methods)
49
- "#{methods.map(&:to_s).map { |method| method.camelize }.join}#{class_name.split('::').join('')}CircuitProxy"
49
+ methods = methods.map(&:to_s).map do |method|
50
+ method.convert_special_chars_to_ordinals
51
+ end
52
+ methods_joined = methods.map { |method| method.camelize }.join
53
+ "#{methods_joined}#{class_name.split('::').join('')}CircuitProxy"
50
54
  end
51
55
  end
52
56
  end
@@ -6,6 +6,18 @@ module Protoboard
6
6
  string = sub(/^[a-z\d]*/) { $&.capitalize }
7
7
  string.gsub(/(?:_|(\/))([a-z\d]*)/) { "#{$1}#{$2.capitalize}" }.gsub('/', '::')
8
8
  end
9
+
10
+ def convert_special_chars_to_ordinals(prefix = 'ORD')
11
+ special_chars = self.scan(/\W/i)
12
+ return self if special_chars.empty?
13
+
14
+ new_string = self
15
+ special_chars.uniq.each do |special_char|
16
+ new_char = "#{prefix}#{special_char.ord}"
17
+ new_string = new_string.gsub(special_char, new_char)
18
+ end
19
+ new_string
20
+ end
9
21
  end
10
22
  end
11
23
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Protoboard
4
- VERSION = '0.2.2'
4
+ VERSION = '0.2.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protoboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Atkinson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-06-26 00:00:00.000000000 Z
12
+ date: 2019-08-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dry-configurable
@@ -163,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  version: '0'
164
164
  requirements: []
165
165
  rubyforge_project:
166
- rubygems_version: 2.6.8
166
+ rubygems_version: 2.7.6
167
167
  signing_key:
168
168
  specification_version: 4
169
169
  summary: Protoboard abstracts the way you use Circuit Breaker allowing you to easily