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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/service_skeleton.rb +10 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbe1a8c148886ef21aa7d756963de8a700b5442d6bb45d239371d07df757a849
4
- data.tar.gz: 13cdc1c611442d02a29ea83799f343e28fa39482bfc9b91da6e4411979bd9b47
3
+ metadata.gz: 9fe5415554536e557f6666ea6fde587d417a3f98878194949f48037c13b876e1
4
+ data.tar.gz: 9606acf330ed46324bbe1f39066844463e82f34ee2ec6b979ccd04fc54dcd8c7
5
5
  SHA512:
6
- metadata.gz: 2de121637dfd9610f781792c4e039b032c19e72e00b0b77fd91924cebd9b27347b432bd6ccd734690335300cb71781e7b9c76b61371c28005cbb7c9bb8c09171
7
- data.tar.gz: 3c8c260868e32c802d69e75672a6ebdfaa896e5be0119692f8b5cb3622728f5865c63f4ae1d88265746e53e99734bf707ee82aa08cd135249b3685969633a78c
6
+ metadata.gz: 72494f036549c13931e2d8ad6d3928e2bf8db14b10da2e9007ce3d10ebb8d54d84c316cc3fbbde4de26e234ecc5fbb0a894d73ebab54cabbd28626b3f43e1333
7
+ data.tar.gz: acde5210642f771083ffa5406066b53c8ff5eddc06281567fd45cb45a4b0b85c2add07101c5ed5727ee7959563b07538ad97e8fac1f2db27791e2dd3a0a6b1df
@@ -23,12 +23,7 @@ class ServiceSkeleton
23
23
  end
24
24
 
25
25
  def self.service_name
26
- self.to_s
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: service_skeleton
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0.15.g53952e3
4
+ version: 0.0.0.16.g99ff4d7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Palmer