zeta 0.5.0 → 0.6.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: 688a5287b3424e9c923bbd1f9e118ae6b61c9546
4
- data.tar.gz: c9e220790340b1abd33bd3fd1fa913bc9e9eef46
3
+ metadata.gz: 33dba0f87028556b8a40c997928f7ce62cce45c5
4
+ data.tar.gz: 2bb3a4a2d42cf896dece1440843da8639269a329
5
5
  SHA512:
6
- metadata.gz: ce397967dbcee851e5b438d88e360de94f5718adbb34b11efe8dac2c6fe98ade363a8751642cdf32ae3cbd2cdf86287171b712af45bb44ce4857877e0d9a49f0
7
- data.tar.gz: ae3cbf5c2e485478ddb9c591ee223a36dd7cda9b291c8d9d7e179002f68897595af98fa2fa6a1bb1899a41a9ab1b983ae7b18ac09bf6afdf2731dcfa2679ebf5
6
+ metadata.gz: 61878194f934accfad3689ff54aa20a67d909a057b9eb269eebe7b031007c2f781e15218cfc58fee99876fd2d553dc7e0b248eae30e3b5fd29e43092eda805b6
7
+ data.tar.gz: 88fc2e2f54523dbf7290b4111eec5e7de128d24f6c5f4314f87df67a753eff6ac3e279d8da616334b2f67376061e0bd60cb58a77eacbf9a5a591d9a12e9affe8
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.6.0 (03-Nov-15)
2
+ - make reporter configurable for contracts_fulfilled?
3
+ - add rspec integration
4
+ - add Zeta.verbose= setter
5
+
1
6
  # 0.5.0 (02-Nov-15)
2
7
  - update lacerda
3
8
  - use lacerda stdout reporter by default
data/lib/zeta/instance.rb CHANGED
@@ -13,12 +13,12 @@ class Zeta
13
13
  def initialize(options = {})
14
14
  @mutex = Mutex.new
15
15
  @options = options
16
- puts "Using config file #{config_file}" if verbose?
17
16
  end
18
17
 
19
18
  def update_contracts
20
19
  i = infrastructure
21
20
  @mutex.synchronize do
21
+ clear_cache
22
22
  puts "Updating #{cache_dir}" if verbose?
23
23
  update_other_contracts
24
24
  update_own_contracts
@@ -41,8 +41,8 @@ class Zeta
41
41
  infrastructure.errors
42
42
  end
43
43
 
44
- def contracts_fulfilled?
45
- reporter = Lacerda::Reporters::Stdout.new(verbose: verbose?)
44
+ def contracts_fulfilled?(reporter = nil)
45
+ reporter ||= Lacerda::Reporters::Stdout.new(verbose: verbose?)
46
46
  infrastructure.contracts_fulfilled?(reporter)
47
47
  end
48
48
 
@@ -77,6 +77,17 @@ class Zeta
77
77
  @cache_dir = full_path
78
78
  end
79
79
 
80
+ def clear_cache
81
+ # I'm afraid of FileUtils.rm_rf so I'll just delete all relevant files
82
+ # and then rmdir all empty directories.
83
+ Dir[File.join(cache_dir, "/support/**/*.mson")].each{|f| FileUtils.rm(f) }
84
+ Dir[File.join(cache_dir, "/support/**/*.json")].each{|f| FileUtils.rm(f) }
85
+ Dir[File.join(cache_dir, '*')].each do |d|
86
+ next unless File.directory?(d)
87
+ FileUtils.rmdir(d) rescue nil
88
+ end
89
+ end
90
+
80
91
  def config
81
92
  return @config if @config
82
93
  full_config = YAML.load_file(config_file).with_indifferent_access
@@ -116,6 +127,10 @@ class Zeta
116
127
  @current_service ||= infrastructure.services[config[:service_name]]
117
128
  end
118
129
 
130
+ def verbose=(val)
131
+ @options[:verbose] = !!val
132
+ end
133
+
119
134
  private
120
135
 
121
136
  def verbose?
data/lib/zeta/rspec.rb ADDED
@@ -0,0 +1,24 @@
1
+ require 'lacerda/reporters/rspec'
2
+
3
+ # Include this file in your spec/spec_helper.rb
4
+ class Zeta
5
+ def self.run_specs
6
+ Zeta.verbose = false
7
+ unless File.directory?(Zeta.cache_dir)
8
+ RSpec.describe "Update Zeta infrastructure once" do
9
+ it "download infrastructure" do
10
+ expect{
11
+ Zeta.config
12
+ }.to_not raise_error
13
+ end
14
+
15
+ it "download specifications" do
16
+ expect{
17
+ Zeta.update_contracts
18
+ }.to_not raise_error
19
+ end
20
+ end
21
+ end
22
+ Zeta.contracts_fulfilled?(Lacerda::Reporters::RSpec.new)
23
+ end
24
+ end
data/lib/zeta/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Zeta
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
data/zeta.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_runtime_dependency 'rake', '~> 10.2'
22
- spec.add_runtime_dependency 'lacerda', '~> 0.8'
22
+ spec.add_runtime_dependency 'lacerda', '~> 0.9'
23
23
  spec.add_runtime_dependency 'activesupport'
24
24
  spec.add_runtime_dependency 'httparty', '~> 0.13'
25
25
  spec.add_runtime_dependency 'colorize'
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.5.0
4
+ version: 0.6.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: 2015-11-02 00:00:00.000000000 Z
11
+ date: 2015-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.8'
33
+ version: '0.9'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.8'
40
+ version: '0.9'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activesupport
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -171,6 +171,7 @@ files:
171
171
  - lib/zeta.rb
172
172
  - lib/zeta/instance.rb
173
173
  - lib/zeta/local_or_remote_file.rb
174
+ - lib/zeta/rspec.rb
174
175
  - lib/zeta/runner.rb
175
176
  - lib/zeta/version.rb
176
177
  - zeta.gemspec