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 +4 -4
- data/CHANGELOG.markdown +5 -0
- data/lib/zeta/instance.rb +18 -3
- data/lib/zeta/rspec.rb +24 -0
- data/lib/zeta/version.rb +1 -1
- data/zeta.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33dba0f87028556b8a40c997928f7ce62cce45c5
|
4
|
+
data.tar.gz: 2bb3a4a2d42cf896dece1440843da8639269a329
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61878194f934accfad3689ff54aa20a67d909a057b9eb269eebe7b031007c2f781e15218cfc58fee99876fd2d553dc7e0b248eae30e3b5fd29e43092eda805b6
|
7
|
+
data.tar.gz: 88fc2e2f54523dbf7290b4111eec5e7de128d24f6c5f4314f87df67a753eff6ac3e279d8da616334b2f67376061e0bd60cb58a77eacbf9a5a591d9a12e9affe8
|
data/CHANGELOG.markdown
CHANGED
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
|
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
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.
|
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.
|
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-
|
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.
|
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.
|
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
|