protoboard 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +7 -1
- data/Gemfile.lock +3 -3
- data/README.md +2 -1
- data/lib/protoboard/adapters/stoplight_adapter.rb +0 -4
- data/lib/protoboard/circuit_proxy_factory.rb +5 -1
- data/lib/protoboard/refinements/string_extensions.rb +12 -0
- data/lib/protoboard/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bd3d4c3dec2c8da113f3f5584c0c1c279bfe462366ac392639e06a6833016728
|
4
|
+
data.tar.gz: 692bf7f9906f723cc08ec098f41f649424cb812fc5ad4d150f98e555dbb3f26e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca1450fb5fbe1119cd7e23af091ab46211f4a2a7f2d2d7a5b0721b2a78c548c25c1b59fabf8f7a58b9c82da1f75653384b1a9435480ae5fe490004a62415e65e
|
7
|
+
data.tar.gz: 4f880a1727a6ae439c80d7f1c45e957d8ba1c84d03f2c521132f8877c512d6012328bc8448bb2c6e5dfa15aa680175b2b6831d2a4e2d55a1fc54cf252c62fa5c
|
data/.travis.yml
CHANGED
@@ -6,4 +6,10 @@ rvm:
|
|
6
6
|
- 2.3
|
7
7
|
- 2.4
|
8
8
|
- 2.5
|
9
|
-
|
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
|
data/Gemfile.lock
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
protoboard (0.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.
|
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.
|
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
|
|
@@ -46,7 +46,11 @@ module Protoboard
|
|
46
46
|
##
|
47
47
|
# Formats the module name
|
48
48
|
def infer_module_name(class_name, methods)
|
49
|
-
|
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
|
data/lib/protoboard/version.rb
CHANGED
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.
|
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:
|
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
|
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
|