moto 0.7.0 → 0.7.1

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: 5c6fc26ad79a37b98a47def96713f98aeb645d7a
4
- data.tar.gz: 319b20fd048182b400a165c5f947eca5da265850
3
+ metadata.gz: 4c72891d116e48d0ff3999c21d91c6522ac0b1bc
4
+ data.tar.gz: 9dcb05b25cc17e74dc7e52007bf68b4cae2f61a9
5
5
  SHA512:
6
- metadata.gz: b7094905897ffa05fd13dcc0e170d3f9a9faf54b76a27aaff5776f353d664c035f786bab3fe9b8585ce594584a3c03c88f1d852e35e991787eb5eece832134dc
7
- data.tar.gz: 8fb71b7424b346314b29cd76f232207db2fc3f19214adfbbbd3e2f9239896e8610b568ca3e192759e2ed87bb649b2971059a7f9098db31cb2f82cc9cdb885b92
6
+ metadata.gz: 18653e61b99561362a55b000258b37e0b63c1e429dfd368662dcef12497366be63580488a33e9370b6ce8852a63160741fcaaadbd4616ddc697223db7eae577f
7
+ data.tar.gz: 36412b9a3a27c4e76546937aa0d21916370774ef283cb9d7617601e48b857b6e54c4f0bf332b48dee796f036fba061f72c1d9798061a1abde9aeebf08fd7e04d
@@ -1,51 +1,51 @@
1
- module Moto
2
- module Lib
3
- module Clients
4
- class ClientsManager
5
-
6
- attr_reader :clients
7
-
8
- def initialize
9
- @clients = {}
10
- end
11
-
12
- def client(name)
13
- return @clients[name] if @clients.key? name
14
-
15
- name_app = 'MotoApp::Lib::Clients::' + name
16
- name_moto = 'Moto::Clients::' + name
17
-
18
- client = try_client(name_app, "#{MotoApp::DIR}/")
19
- if client
20
- @clients[name] = client
21
- return client
22
- end
23
-
24
- client = try_client(name_moto, "#{Moto::DIR}/lib/")
25
- if client
26
- @clients[name] = client
27
- return client
28
- end
29
-
30
- raise "Could not find client class for name: #{name}"
31
- end
32
-
33
- def try_client(name, dir)
34
- client_path = name.underscore.split('/')[1..-1].join('/')
35
-
36
- if File.file?(dir + client_path + '.rb')
37
- require dir + client_path
38
- client_const = name.constantize
39
- instance = client_const.new
40
- instance.start_run
41
- instance
42
- else
43
- nil
44
- end
45
- end
46
- private :try_client
47
-
48
- end
49
- end
50
- end
1
+ module Moto
2
+ module Lib
3
+ module Clients
4
+ class ClientsManager
5
+
6
+ attr_reader :clients
7
+
8
+ def initialize
9
+ @clients = {}
10
+ end
11
+
12
+ def client(name)
13
+ return @clients[name] if @clients.key? name
14
+
15
+ name_app = 'MotoApp::Lib::Clients::' + name
16
+ name_moto = 'Moto::Clients::' + name
17
+
18
+ client = try_client(name_app, "#{MotoApp::DIR}/")
19
+ if client
20
+ @clients[name] = client
21
+ return client
22
+ end
23
+
24
+ client = try_client(name_moto, "#{Moto::DIR}/lib/")
25
+ if client
26
+ @clients[name] = client
27
+ return client
28
+ end
29
+
30
+ raise "Could not find client class for name: #{name}"
31
+ end
32
+
33
+ def try_client(name, dir)
34
+ client_path = name.underscore.split('/')[1..-1].join('/')
35
+
36
+ if File.file?(dir + client_path + '.rb')
37
+ require dir + client_path
38
+ client_const = name.constantize
39
+ instance = client_const.new
40
+ instance.start_run
41
+ instance
42
+ else
43
+ nil
44
+ end
45
+ end
46
+ private :try_client
47
+
48
+ end
49
+ end
50
+ end
51
51
  end
@@ -51,8 +51,8 @@ module Moto
51
51
  Thread.current['logger'].info("Result: #{@test.status.results.last.code}")
52
52
 
53
53
  # test should have another attempt in case of an error / failure / none at all
54
- if (@test.status.results.last.code == Moto::Test::Result::ERROR && !Moto::Lib::Config.moto[:test_reattempt_on_error]) ||
55
- (@test.status.results.last.code == Moto::Test::Result::FAILURE && !Moto::Lib::Config.moto[:test_reattempt_on_fail] )
54
+ if !(@test.status.results.last.code == Moto::Test::Result::ERROR && config[:test_reattempt_on_error]) &&
55
+ !(@test.status.results.last.code == Moto::Test::Result::FAILURE && config[:test_reattempt_on_fail] )
56
56
  break
57
57
  end
58
58
 
@@ -1,26 +1,26 @@
1
- module Moto
2
- module RunnerLogging
3
-
4
- # TODO: merge it somehow with TestLogging. Parametrize logger object?
5
- def self.included(cls)
6
- def cls.method_added(name)
7
- excluded_methods = Moto::EmptyListener.instance_methods(false)
8
- excluded_methods << :new
9
- excluded_methods << :initialize
10
- # TODO: configure more excluded classes/methods
11
- return if @added
12
- @added = true # protect from recursion
13
- original_method = "original_#{name}"
14
- alias_method original_method, name
15
- define_method(name) do |*args|
16
- Thread.current['logger'].debug("#{self.class.name}::#{__callee__} ENTER >>> #{args}") unless excluded_methods.include? name
17
- result = send original_method, *args
18
- Thread.current['logger'].debug("#{self.class.name}::#{__callee__} LEAVE <<< #{result} ") unless excluded_methods.include? name
19
- result
20
- end
21
- @added = false
22
- end
23
-
24
- end
25
- end
1
+ module Moto
2
+ module RunnerLogging
3
+
4
+ # TODO: merge it somehow with TestLogging. Parametrize logger object?
5
+ def self.included(cls)
6
+ def cls.method_added(name)
7
+ excluded_methods = Moto::EmptyListener.instance_methods(false)
8
+ excluded_methods << :new
9
+ excluded_methods << :initialize
10
+ # TODO: configure more excluded classes/methods
11
+ return if @added
12
+ @added = true # protect from recursion
13
+ original_method = "original_#{name}"
14
+ alias_method original_method, name
15
+ define_method(name) do |*args|
16
+ Thread.current['logger'].debug("#{self.class.name}::#{__callee__} ENTER >>> #{args}") unless excluded_methods.include? name
17
+ result = send original_method, *args
18
+ Thread.current['logger'].debug("#{self.class.name}::#{__callee__} LEAVE <<< #{result} ") unless excluded_methods.include? name
19
+ result
20
+ end
21
+ @added = false
22
+ end
23
+
24
+ end
25
+ end
26
26
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Moto
2
- VERSION = '0.7.0'
2
+ VERSION = '0.7.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bartek Wilczek
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-05-26 00:00:00.000000000 Z
14
+ date: 2016-05-31 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport