tanga_services 0.0.1 → 0.0.2

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: 4a07f5571455234d047d68fd2288a164ecb4b3e3
4
- data.tar.gz: 1f6e4188634384a0c464c9165bc0e0ccef629c95
3
+ metadata.gz: 9e0336d7c56c23350e64ad7260023ec345a4763d
4
+ data.tar.gz: a253bd98d18ae366de8b88c2d1f21246a6a07068
5
5
  SHA512:
6
- metadata.gz: ee26fe6fb13b59593de03b923117554958dff20006fa6c1d1aed4f3298fbd48fa6de382ee2973025ca549b733c4e5ac223f50907fc9ae1898ca75c1fc0207291
7
- data.tar.gz: 101c55529fa99df2c46548fed21ef99b4e12635863d68e561b31a768299fe0d47aff6d4c5f21689bb585d5d61bd15e600b640068187c62a43bc4b6c43ef613ef
6
+ metadata.gz: e352812754331503464793d104670af037164d8a1d65af3b476611c471c9fb06edf8decaebeac45c70543cb55ffe229f98767ca41c77c0833cd8a1f3b318f7de
7
+ data.tar.gz: f4e191896a10273d68ce2f7b7243a1dd96b1e5fb94212578203a5a8426d30d370e6cdfbc13907dc11a990ea52bfdba922b6b22f07eb3d9d05b88f8d67e96d11d
@@ -10,7 +10,8 @@ module TangaServices
10
10
  # TangaServices.logger.error({message: "i crashed"})
11
11
  class Logger < Syslog::Logger
12
12
  def self.application_name=(application_name)
13
- @logger ||= Syslog::Logger.new(application_name, Syslog::LOG_LOCAL7)
13
+ fail "application name already set" if @logger
14
+ @logger = Syslog::Logger.new(application_name, Syslog::LOG_LOCAL7)
14
15
  end
15
16
 
16
17
  def self.debug(hash)
@@ -1,3 +1,3 @@
1
1
  module TangaServices
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/spec/logger_spec.rb CHANGED
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe TangaServices do
4
4
  before do
5
- # Clears the logging variable.
5
+ # Clears the logging variable, needed cuz mocks and class vars suck..
6
6
  TangaServices::Logger.instance_variable_set(:@logger, nil)
7
7
  end
8
8
 
@@ -12,6 +12,11 @@ describe TangaServices do
12
12
  expect(Syslog::Logger).to receive(:new).with('my_app', Syslog::LOG_LOCAL7).and_return(logger)
13
13
  TangaServices.logger.application_name = 'my_app'
14
14
  end
15
+
16
+ it "shouldn't let you set the name twice" do
17
+ TangaServices.logger.application_name = 'app'
18
+ expect { TangaServices.logger.application_name = 'app' }.to raise_error
19
+ end
15
20
  end
16
21
 
17
22
  context '.log' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tanga_services
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Van Dyk