hoodoo 2.2.2 → 2.2.3

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
  SHA256:
3
- metadata.gz: d3cfd418d564c82821044bc2a95cb8d1e194a134027bc9fac61a56f823157b61
4
- data.tar.gz: abd1ca2e208d34fbd00146989234daac40611f24e32869fd56debb0b1d0e62a6
3
+ metadata.gz: b44ab5eb415262a966b85b5745d7babae95bcea72ad1f82dc17d9ba1b0e8aee6
4
+ data.tar.gz: 7894b8277a7061f9ec1e83ab15fb6f25d92797cf3ad59e2a2d03968ac098b636
5
5
  SHA512:
6
- metadata.gz: c887163252c009e44267179282e725bcfc4a49ce20e48270ab688f446dd5a03bf29bdaeab692ae4411b0f38dca2a202edd3b7025336963e29f68cd612f12ce3f
7
- data.tar.gz: fa52f3e1fdb454022cd24fbdf56cdf25b3355ee0fe3cced729ae2cb73437b14c3d137f1e2958fb7d2d636222b0cf301fa4d356a7226125b31a75a0b797ffafd9
6
+ metadata.gz: c691cdaf17d8964a04edc102358485047a6b361147f5a14cc8d555772b4709f9dc903ae2d319c5392506330c0686c5cd09ed026bfc0470f923d39bc3d74a1e04
7
+ data.tar.gz: d2325636825a764be468a6411efec5a9e6bfec2e6d6f5d06f2b404d16a0411b95a23e9499e578600649baadfe65f3069cbdce146367c1acfbbceadef255c2195
@@ -12,11 +12,11 @@ module Hoodoo
12
12
  # The Hoodoo gem version. If this changes, be sure to re-run
13
13
  # <tt>bundle install</tt> or <tt>bundle update</tt>.
14
14
  #
15
- VERSION = '2.2.2'
15
+ VERSION = '2.2.3'
16
16
 
17
17
  # The Hoodoo gem date. If this changes, be sure to re-run
18
18
  # <tt>bundle install</tt> or <tt>bundle update</tt>.
19
19
  #
20
- DATE = '2017-11-16'
20
+ DATE = '2018-02-19'
21
21
 
22
22
  end
@@ -4,8 +4,7 @@ require 'tempfile'
4
4
  describe Hoodoo::Logger::FileWriter do
5
5
 
6
6
  before :all do
7
- temp_name = Dir::Tmpname.make_tmpname( 'hoodoo_rspec_', nil )
8
- @temp_path = File.join( Dir::Tmpname.tmpdir, temp_name )
7
+ @temp_path = spec_helper_tmpfile_path()
9
8
  end
10
9
 
11
10
  after :all do
@@ -3,8 +3,7 @@ require 'time'
3
3
 
4
4
  describe Hoodoo::Logger::StreamWriter do
5
5
  before :all do
6
- temp_name = Dir::Tmpname.make_tmpname( 'hoodoo_rspec_', nil )
7
- @temp_path = File.join( Dir::Tmpname.tmpdir, temp_name )
6
+ @temp_path = spec_helper_tmpfile_path()
8
7
  @stream = File.open( @temp_path, 'ab' )
9
8
  end
10
9
 
@@ -19,16 +19,14 @@ end
19
19
 
20
20
  require 'byebug'
21
21
 
22
- # Stubbing Net::HTTP with WebMock - disabled by default; only enable for
23
- # tests where you need it, as real Net::HTTP connections are used in many
24
- # other tests and must not be mocked.
22
+ # Stubbing Net::HTTP with WebMock - disabled by default via "before :suite"
23
+ # later; only enable for tests where needed, as real Net::HTTP connections
24
+ # are used in many other tests and must not be mocked.
25
25
  #
26
26
  # https://github.com/bblimke/webmock
27
27
 
28
28
  require 'webmock/rspec'
29
29
 
30
- WebMock.disable!
31
-
32
30
  # The ActiveRecord extensions need testing in the context of a database. I
33
31
  # did consider NullDB - https://github.com/nulldb/nulldb - but this was too
34
32
  # far from 'the real thing' for my liking. Instead, we use SQLite in memory
@@ -90,6 +88,8 @@ RSpec.configure do | config |
90
88
 
91
89
  config.before( :suite ) do
92
90
 
91
+ WebMock.disable!
92
+
93
93
  # Redirect $stderr before each test so a test log gets written without
94
94
  # disturbing the RSpec terminal output; make sure the session system is
95
95
  # in "test mode"; make sure we get a unique DRb daemon instance for the
@@ -379,3 +379,23 @@ def spec_helper_count_database_calls_in( &block )
379
379
  ActiveSupport::Notifications.subscribed( cb, 'sql.active_record', &block )
380
380
  return count
381
381
  end
382
+
383
+ # In Ruby 2.5.0 the Ruby team removed <tt>Dir::Tmpname.make_tmpname</tt>:
384
+ #
385
+ # https://github.com/ruby/ruby/commit/25d56ea7b7b52dc81af30c92a9a0e2d2dab6ff27
386
+ #
387
+ # Instead we must make our best attempt in plain Ruby ourselves, e.g.:
388
+ #
389
+ # https://github.com/rails/rails/issues/31458
390
+ # https://github.com/rails/rails/pull/31462/files
391
+ #
392
+ # Since the above solution uses the process number via "$$" it should be safe
393
+ # for just this test suite, so we use the same approach here. This method
394
+ # returns the full file path for the temporary file, not just a leafname.
395
+ #
396
+ def spec_helper_tmpfile_path
397
+ time = Time.now.strftime( "%Y%m%d" )
398
+ name = "hoodoo-tests-#{ time }-#{ $$ }-#{ rand( 0x100000000 ).to_s( 36 ) }-fd"
399
+
400
+ File.join( Dir::Tmpname.tmpdir, name )
401
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoodoo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loyalty New Zealand
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-16 00:00:00.000000000 Z
11
+ date: 2018-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dalli
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '3.1'
131
+ version: '3.3'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '3.1'
138
+ version: '3.3'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: activerecord
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -554,7 +554,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
554
554
  version: '0'
555
555
  requirements: []
556
556
  rubyforge_project:
557
- rubygems_version: 2.7.2
557
+ rubygems_version: 2.7.6
558
558
  signing_key:
559
559
  specification_version: 4
560
560
  summary: Opinionated APIs