pps_commons 0.1.16 → 0.1.17

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: edad4000a029fe5133ce1501d0558dc6eaf58a7c
4
- data.tar.gz: c04c43515ee663103cb27a25296ef7953d321012
3
+ metadata.gz: 4cfed165960243388887af3b4a6bff9a545281da
4
+ data.tar.gz: f089c531d59bc1293f12f5460955769c8557292d
5
5
  SHA512:
6
- metadata.gz: 8a0a9332454ecd4ab1a97aa5936d4b95f8e6a0105a56df87a6de25538e3ddd99c56c4202420e3f91ff6b83b7d1189fcaca4ce6d3730a165faa77312167be770c
7
- data.tar.gz: 7096449c79337fbddd8a163ce43b494bc183be4404705359f1d5fd4e8dd5bc323eeca9caf5bdd8a1b8759f63546a1299178ef139325ca82d425587ac1c73504b
6
+ metadata.gz: 8a63be093a040233adc08f1fad73fa5df844827dec693ed346d77990169a3a835c662e114b848c497b0d36054dbac2e41a3a21ae2d45b0748b8334576ccb430b
7
+ data.tar.gz: c1f3f0c3b5e6385a6f8d5d1873e1acad17e6850287cd6082994752090468daaf8b9c2b211f1abef477638deb5c36a26b9c9e1ef13c8fa50c7d9eb53569cc5333
data/info ADDED
File without changes
data/lib/pps_commons.rb CHANGED
@@ -18,9 +18,10 @@ module WGU
18
18
  end
19
19
  end
20
20
 
21
- # this tells EventMachine how many threads it can use. There is a lot of Deferrals
22
- # in this project so it helps to run a higher number.
23
- # EM defaults to '20', PPS defaults to '40'
21
+ # this tells EventMachine how many threads it can use. There is a lot of
22
+ # Deferrals in this project so it helps to run a higher number.
23
+ # EM defaults to '20', PPS defaults to '40'. This can be adjusted by
24
+ # adjusting the `PPS_THREAD_COUNT` environment variable
24
25
  def PPSCommons.unleash_the_fury_level
25
26
  found = ENV['PPS_THREAD_COUNT'].to_i
26
27
  found.eql?(0) ? 40 : found.to_i
@@ -28,15 +29,19 @@ module WGU
28
29
 
29
30
  # Common instance methods
30
31
  module InstanceMethods
31
- def logger(file = ENV['PPS_COMMONS_DEFAULT_LOG_LOCATION'])
32
+ def logger(file = ENV['PPS_COMMONS_DEFAULT_LOG_LOCATION'] || STDOUT)
32
33
  if @logger.nil?
33
- log = ::File.expand_path(file)
34
- unless ::File.exist?(log)
35
- log_dir = File.dirname(log)
36
- unless ::Dir.exist?(log_dir)
37
- ::FileUtils.mkdir_p(log_dir)
34
+ log = file.eql?(STDOUT) ? file : nil
35
+
36
+ unless file.eql? STDOUT
37
+ log = ::File.expand_path(file)
38
+ unless ::File.exist?(log)
39
+ log_dir = File.dirname(log)
40
+ unless ::Dir.exist?(log_dir)
41
+ ::FileUtils.mkdir_p(log_dir)
42
+ end
43
+ ::File.new(log, 'a+')
38
44
  end
39
- ::File.new(log, 'a+')
40
45
  end
41
46
 
42
47
  Logger.new(log)
@@ -1,3 +1,3 @@
1
1
  module PPSCommons
2
- VERSION = "0.1.16"
2
+ VERSION = "0.1.17"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pps_commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Phillipps
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-04 00:00:00.000000000 Z
11
+ date: 2018-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -124,6 +124,7 @@ files:
124
124
  - Rakefile
125
125
  - bin/console
126
126
  - bin/setup
127
+ - info
127
128
  - lib/pps_commons.rb
128
129
  - lib/pps_commons/chef_comms.rb
129
130
  - lib/pps_commons/delegation_agent.rb