co_aspects 0.1.1 → 0.2.0

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: 598a83a69193fcd60f7b8716017a04b0c15bd785
4
- data.tar.gz: 2e5c486b609a2edd61b04e1d329455c5cff4fd29
3
+ metadata.gz: a6bb76c1733ed9e04c038330902a41c5988ee64a
4
+ data.tar.gz: 823a7f324eaf090a1d4e51946514dde9eb9c8dfa
5
5
  SHA512:
6
- metadata.gz: bdf1105ff7713b6c3abe056564b458f50f578d147782cd482f563b1de2b65138cf16e914525fb5ed7a36025867220b3799c8e8e3904138990552f81168195007
7
- data.tar.gz: a736894d558c63689ecfa504bade8143ab7ac5c8bc1dd6cc9111de192f025987ac147c56f3841e7bf070872feb2dd33a2593e797dba86ad722cb0f7a2c0eaf4a
6
+ metadata.gz: 1ea0d9be92f14f244926dd9e9a3358f6ecd9a5c80e8d7c1dc50d319fab0ca244aa483c65ce475c578b7cf3e09b8689464931a19d71cfd383212ffdb6767931e1
7
+ data.tar.gz: 4c34bdb2542ec172c769b9d1a5cebbd964ab69c9bb81b583a1ef5a91b04d16028474bc27e2476fcc05a46a1daf66a44122540d126faa8bbb7ddcbf37094a53aa
@@ -11,6 +11,10 @@ module CoAspects
11
11
  # added at the end using a block that receives the same arguments as the
12
12
  # method.
13
13
  #
14
+ # Note: The default key is used if both `as` and block are missing. If
15
+ # either is present, the default is not used and if both are present, then
16
+ # they are simply concatenated.
17
+ #
14
18
  # Examples
15
19
  #
16
20
  # module MyModule
@@ -12,6 +12,10 @@ module CoAspects
12
12
  # added at the end using a block that receives the same arguments as the
13
13
  # method.
14
14
  #
15
+ # Note: The default key is used if both `as` and block are missing. If
16
+ # either is present, the default is not used and if both are present, then
17
+ # they are simply concatenated.
18
+ #
15
19
  # Examples
16
20
  #
17
21
  # module MyModule
@@ -8,9 +8,13 @@ module CoAspects
8
8
  end
9
9
 
10
10
  def key(klass, method_name, method_args, statsd_prefix, statsd_block)
11
- key = statsd_prefix || default_prefix(klass, method_name)
12
- key += ".#{statsd_block.call(*method_args)}" if statsd_block
13
- key.downcase
11
+ if statsd_prefix || statsd_block
12
+ key = statsd_prefix.to_s
13
+ key += statsd_block.call(*method_args) if statsd_block
14
+ key.downcase
15
+ else
16
+ default_prefix(klass, method_name)
17
+ end
14
18
  end
15
19
  end
16
20
  end
@@ -1,3 +1,3 @@
1
1
  module CoAspects
2
- VERSION = '0.1.1'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: co_aspects
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gaston Jorquera
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-18 00:00:00.000000000 Z
11
+ date: 2016-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport