zeta 0.12.5 → 0.13.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: 4ea90e121ab37c8d02908fdcd3c06eac3d7ee5a0
4
- data.tar.gz: 4bb83a910c38bfb6312df4fb1a68e28073971fc0
3
+ metadata.gz: 0155ad2d59bf9bd09b7929fe2bca4a9b00875d98
4
+ data.tar.gz: a19961bfc8f992ccabaf43cf63874afca151cf83
5
5
  SHA512:
6
- metadata.gz: 1c6d0ad7aba11a403b52fe46bb546e3066d99d5c03cccf378b9265b385936ae463df679e3d307421d1b0540b234d6f310389a4613cf00c9cae1d43fefa9b5902
7
- data.tar.gz: cee31302b5d4efae3f04f77a82ba96a37a4a3d9ecdad8b1b027044a5b140ac952957220d0e404b10c799baf0b0e01356e0fb1f6e3abad3c21a9a2d57cb7c3e6d
6
+ metadata.gz: 8f72ba4f9b57ca0b4bc15f59aafd7a4206b560d4450cc1ee093b3b43df16d1832bd7676fafa34c30c148100ee8dce4cb76dbd6bedcd2b061eb8916c9c04f7d2d
7
+ data.tar.gz: 00aee49999fc568aab89471b74a59f58d61a0d1c3880eed645fdb8b19cd2e416e18ea69583f96086f01deda26caac5f0a86fdf0c968afaadc2356ceea15fd87c
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.13.0
2
+ - Add explicit Zeta.create_instance initializer with support to pass in options
3
+
1
4
  # 0.12.5
2
5
  - More conservative locking
3
6
 
data/lib/zeta/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Zeta
2
- VERSION = "0.12.5"
2
+ VERSION = "0.13.0"
3
3
  end
data/lib/zeta.rb CHANGED
@@ -4,26 +4,32 @@ require 'zeta/instance'
4
4
 
5
5
  class Zeta
6
6
  include Zeta::Instance
7
- MUTEX = Mutex.new
7
+ LOCK = Monitor.new
8
8
 
9
9
  def self.instance
10
- MUTEX.synchronize do
11
- return @instance if @instance
12
- unless @instance
13
- # Create a Zeta instance
14
- @instance = new(verbose: true)
10
+ LOCK.synchronize do
11
+ if @instance.nil?
12
+ create_instance
13
+ end
14
+ @instance
15
+ end
16
+ end
15
17
 
16
- # Copy the current service's specifications to cache dir
17
- @instance.update_own_contracts
18
+ def self.create_instance(options = {verbose: true})
19
+ LOCK.synchronize do
20
+ # Create a Zeta instance
21
+ @instance = new(verbose: true)
18
22
 
19
- # Convert current service's specifications so published and
20
- # consumed objects of this service can be validated at
21
- # runtime
22
- @instance.convert_all!
23
+ # Copy the current service's specifications to cache dir
24
+ @instance.update_own_contracts
23
25
 
24
- end
26
+ # Convert current service's specifications so published and
27
+ # consumed objects of this service can be validated at
28
+ # runtime
29
+ @instance.convert_all!
30
+
31
+ @instance
25
32
  end
26
- @instance
27
33
  end
28
34
 
29
35
  # Not using the SingleForwardable module here so that, when
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zeta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.5
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jannis Hermanns
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-29 00:00:00.000000000 Z
11
+ date: 2016-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake