service_skeleton 0.0.0.15.g53952e3 → 0.0.0.16.g99ff4d7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/service_skeleton.rb +10 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fe5415554536e557f6666ea6fde587d417a3f98878194949f48037c13b876e1
|
4
|
+
data.tar.gz: 9606acf330ed46324bbe1f39066844463e82f34ee2ec6b979ccd04fc54dcd8c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72494f036549c13931e2d8ad6d3928e2bf8db14b10da2e9007ce3d10ebb8d54d84c316cc3fbbde4de26e234ecc5fbb0a894d73ebab54cabbd28626b3f43e1333
|
7
|
+
data.tar.gz: acde5210642f771083ffa5406066b53c8ff5eddc06281567fd45cb45a4b0b85c2add07101c5ed5727ee7959563b07538ad97e8fac1f2db27791e2dd3a0a6b1df
|
data/lib/service_skeleton.rb
CHANGED
@@ -23,12 +23,7 @@ class ServiceSkeleton
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def self.service_name
|
26
|
-
self
|
27
|
-
.gsub("::", "_")
|
28
|
-
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
|
29
|
-
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
|
30
|
-
.downcase
|
31
|
-
.gsub(/[^a-zA-Z0-9_]/, "_")
|
26
|
+
service_name_from_class(self)
|
32
27
|
end
|
33
28
|
|
34
29
|
attr_reader :config, :metrics, :logger
|
@@ -100,6 +95,15 @@ class ServiceSkeleton
|
|
100
95
|
|
101
96
|
private
|
102
97
|
|
98
|
+
def self.service_name_from_class(klass)
|
99
|
+
klass.to_s
|
100
|
+
.gsub("::", "_")
|
101
|
+
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
|
102
|
+
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
|
103
|
+
.downcase
|
104
|
+
.gsub(/[^a-zA-Z0-9_]/, "_")
|
105
|
+
end
|
106
|
+
|
103
107
|
def run
|
104
108
|
raise ServiceSkeleton::Error::InheritanceContractError, "ServiceSkeleton#run method not overridden"
|
105
109
|
end
|