vault-tools 0.5.2 → 0.5.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.
@@ -90,7 +90,7 @@ module Vault
90
90
  #
91
91
  # @return [String] The name of the app
92
92
  def self.app_name
93
- env!("APP_NAME")
93
+ env("APP_NAME")
94
94
  end
95
95
 
96
96
  # The `APP_DEPLOY` env var is used to identify which deploy of the codebase is
@@ -99,7 +99,7 @@ module Vault
99
99
  #
100
100
  # @return [String] The deploy/environment of the app
101
101
  def self.app_deploy
102
- env!("APP_DEPLOY")
102
+ env("APP_DEPLOY")
103
103
  end
104
104
 
105
105
  # The port to listen on for web requests.
@@ -58,6 +58,7 @@ module Vault
58
58
  # the log message.
59
59
  def self.log(data, &block)
60
60
  data['source'] ||= Config.app_deploy if Config.app_deploy
61
+ data['app'] ||= Config.app_name if Config.app_name
61
62
  Scrolls.log(data, &block)
62
63
  end
63
64
  end
@@ -1,5 +1,5 @@
1
1
  module Vault
2
2
  module Tools
3
- VERSION = '0.5.2'
3
+ VERSION = '0.5.3'
4
4
  end
5
5
  end
@@ -44,20 +44,4 @@ class DefaultsTest < Vault::TestCase
44
44
  assert_equal('1,2', Config[:array])
45
45
  assert_equal(['1','2'], Config.array(:array))
46
46
  end
47
-
48
- def test_default_with_app_deploy
49
- assert_raises RuntimeError do
50
- Config.app_deploy
51
- end
52
- Config.default(:app_deploy, 'test')
53
- assert_equal('test', Config.app_deploy)
54
- end
55
-
56
- def test_default_with_app_name
57
- assert_raises RuntimeError do
58
- Config.app_name
59
- end
60
- Config.default(:app_name, 'vault-rulez')
61
- assert_equal('vault-rulez', Config.app_name)
62
- end
63
47
  end
data/test/log_test.rb CHANGED
@@ -89,6 +89,12 @@ class LogTest < Vault::TestCase
89
89
  assert_equal('', Scrolls.stream.string)
90
90
  end
91
91
 
92
+ # Vault::Log.log logs app name in app key by default.
93
+ def test_log_app_name_by_default
94
+ Vault::Log.log(integer: 123)
95
+ assert_equal 'test-app', logged_data['app']
96
+ end
97
+
92
98
  # Vault::Log.log emits a set of key/value metrics using data from the
93
99
  # specified hash.
94
100
  def test_log
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vault-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-02-19 00:00:00.000000000 Z
13
+ date: 2014-03-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: scrolls
@@ -239,7 +239,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
239
239
  version: '0'
240
240
  segments:
241
241
  - 0
242
- hash: 170878534525497939
242
+ hash: 438461498838975157
243
243
  required_rubygems_version: !ruby/object:Gem::Requirement
244
244
  none: false
245
245
  requirements:
@@ -248,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
248
248
  version: '0'
249
249
  segments:
250
250
  - 0
251
- hash: 170878534525497939
251
+ hash: 438461498838975157
252
252
  requirements: []
253
253
  rubyforge_project:
254
254
  rubygems_version: 1.8.23