wss_agent 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/wss_agent/cli.rb +4 -4
- data/lib/wss_agent/configure.rb +13 -4
- data/lib/wss_agent/project.rb +2 -3
- data/lib/wss_agent/specifications.rb +4 -2
- data/lib/wss_agent/version.rb +1 -1
- data/lib/wss_agent.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4aa441c8a0cc500e8e0ead1f0c09dbc01624581c
|
4
|
+
data.tar.gz: c2fe89302d7c099c0961ebd36969fe4da4cd8e9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf27a14d2bd2c649e3986277fdf9d2310ae82a059c3f931da196cebb9a30852606b8598800c47340ddf26c152f4a58af7e2c6763a2dd3195cbc61ce7561a0d6d
|
7
|
+
data.tar.gz: 47c3fbe7778fd1335f705a9c490d33610c022ec43d33023ab49192920ad747fa99c5780bfac82232022de554f1ac07624ceb186f809ef64a7d5bcaa193101e8c
|
data/lib/wss_agent/cli.rb
CHANGED
@@ -17,10 +17,10 @@ module WssAgent
|
|
17
17
|
results = Specifications.list(options)
|
18
18
|
ap results
|
19
19
|
rescue Bundler::GemfileNotFound => ex
|
20
|
-
ap ex.message
|
20
|
+
ap ex.message, color: { string: :red }
|
21
21
|
rescue Bundler::GemNotFound => ex
|
22
|
-
ap ex.message
|
23
|
-
ap "Could you execute 'bundle install' before"
|
22
|
+
ap ex.message, color: { string: :red }
|
23
|
+
ap "Could you execute 'bundle install' before", color: { string: :red }
|
24
24
|
end
|
25
25
|
|
26
26
|
desc 'update', 'update open source inventory'
|
@@ -31,7 +31,7 @@ module WssAgent
|
|
31
31
|
WssAgent.enable_debug! if options['verbose']
|
32
32
|
Specifications.update(options)
|
33
33
|
rescue => ex
|
34
|
-
ap ex.message
|
34
|
+
ap ex.message, color: { string: :red }
|
35
35
|
end
|
36
36
|
|
37
37
|
desc 'check_policies', 'checking dependencies that they conforms with company policy.'
|
data/lib/wss_agent/configure.rb
CHANGED
@@ -32,11 +32,17 @@ module WssAgent
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def current
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
35
|
+
unless File.exist?(current_path)
|
36
|
+
return raise NotFoundConfigFile, "Config file isn't exist. Could you please run 'wss_agent config' before."
|
37
|
+
end
|
38
|
+
|
39
|
+
@current_config = YAML.load(File.read(current_path))
|
40
|
+
|
41
|
+
unless !!@current_config
|
42
|
+
return raise InvalidConfigFile, "Problem reading wss_agent.yml, please check the file is a valid YAML"
|
39
43
|
end
|
44
|
+
|
45
|
+
default.merge(@current_config)
|
40
46
|
end
|
41
47
|
|
42
48
|
def uri
|
@@ -45,6 +51,9 @@ module WssAgent
|
|
45
51
|
raise ApiUrlNotFound, "Can't find the url, please add your Whitesource url destination in the wss_agent.yml file."
|
46
52
|
end
|
47
53
|
URI(@url)
|
54
|
+
|
55
|
+
rescue URI::Error
|
56
|
+
raise ApiUrlInvalid, "Api url is invalid. Could you please check url in wss_agent.yml"
|
48
57
|
end
|
49
58
|
|
50
59
|
def port
|
data/lib/wss_agent/project.rb
CHANGED
@@ -49,7 +49,8 @@ module WssAgent
|
|
49
49
|
WssAgent.logger.debug result.data
|
50
50
|
puts result.message
|
51
51
|
else
|
52
|
-
|
52
|
+
WssAgent.logger.debug "synchronization errors occur: status: #{result.status}, message: #{result.message}, data: #{result.data}"
|
53
|
+
ap "error: #{result.status}/#{result.data}", color: {string: :red }
|
53
54
|
end
|
54
55
|
|
55
56
|
result.success?
|
@@ -65,7 +66,8 @@ module WssAgent
|
|
65
66
|
WssAgent.logger.debug result.data
|
66
67
|
puts result.message
|
67
68
|
else
|
68
|
-
|
69
|
+
WssAgent.logger.debug "check policies errors occur: #{result.status}, message: #{result.message}, data: #{result.data}"
|
70
|
+
ap "error: #{result.status}/#{result.data}", color: {string: :red }
|
69
71
|
end
|
70
72
|
end
|
71
73
|
|
data/lib/wss_agent/version.rb
CHANGED
data/lib/wss_agent.rb
CHANGED
@@ -27,8 +27,11 @@ module WssAgent
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
+
class NotFoundConfigFile < WssAgentError; status_code(8) ; end
|
31
|
+
class InvalidConfigFile < WssAgentError; status_code(9) ; end
|
30
32
|
class TokenNotFound < WssAgentError; status_code(10) ; end
|
31
33
|
class ApiUrlNotFound < WssAgentError; status_code(11) ; end
|
34
|
+
class ApiUrlInvalid < WssAgentError; status_code(12) ; end
|
32
35
|
|
33
36
|
def self.logger
|
34
37
|
@logger ||= Yell.new STDOUT, level: [:info]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wss_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxim Pechnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|