prospector 0.4.3 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/prospector.rb +6 -1
- data/lib/prospector/client.rb +4 -3
- data/lib/prospector/ruby_version.rb +21 -0
- data/lib/prospector/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcea86688c4d802bd630b67670505910424687cc
|
4
|
+
data.tar.gz: 2aa8cfb64cbcd3f8dc60703a50d6bda297328297
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6859a0143fb4d7b268d9be1981e758a41f7919111b0841bf2f4cae44287920a78d71fd75bde645abda97766c086f76f76edc985cf8bedc27c5c98292d343d2c4
|
7
|
+
data.tar.gz: b79cbddc3ddcf11e1adfd2d830773b367eccc14714ed83ab22461761430548acc836178a5fbe20e83f764beab5448ffd1cc08aa03ceb70a3c00f0a4c68ba0e68
|
data/CHANGELOG.md
CHANGED
data/lib/prospector.rb
CHANGED
@@ -4,6 +4,7 @@ require "net/http"
|
|
4
4
|
|
5
5
|
require "prospector/version"
|
6
6
|
|
7
|
+
require "prospector/ruby_version"
|
7
8
|
require "prospector/client"
|
8
9
|
require "prospector/configuration"
|
9
10
|
require "prospector/error"
|
@@ -37,6 +38,10 @@ module Prospector
|
|
37
38
|
configuration.enabled?
|
38
39
|
end
|
39
40
|
|
41
|
+
def ruby_version
|
42
|
+
@ruby_version ||= RubyVersion.new
|
43
|
+
end
|
44
|
+
|
40
45
|
def notify!
|
41
46
|
raise NotEnabledError unless enabled?
|
42
47
|
|
@@ -44,7 +49,7 @@ module Prospector
|
|
44
49
|
|
45
50
|
specifications = Bundler.environment.specs
|
46
51
|
|
47
|
-
Client.deliver(specifications)
|
52
|
+
Client.deliver(specifications, ruby_version)
|
48
53
|
end
|
49
54
|
end
|
50
55
|
|
data/lib/prospector/client.rb
CHANGED
@@ -14,8 +14,8 @@ module Prospector
|
|
14
14
|
@client_secret = client_secret
|
15
15
|
end
|
16
16
|
|
17
|
-
def deliver(specifications)
|
18
|
-
set_request_body(specifications)
|
17
|
+
def deliver(specifications, ruby_version)
|
18
|
+
set_request_body(specifications, ruby_version)
|
19
19
|
|
20
20
|
case response.code
|
21
21
|
when "401" then raise AuthenticationError
|
@@ -56,8 +56,9 @@ module Prospector
|
|
56
56
|
request
|
57
57
|
end
|
58
58
|
|
59
|
-
def set_request_body(specifications)
|
59
|
+
def set_request_body(specifications, ruby_version)
|
60
60
|
request.body = {
|
61
|
+
ruby_version: ruby_version.to_json,
|
61
62
|
specifications: hash_from_specifications(specifications)
|
62
63
|
}.to_json
|
63
64
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Prospector
|
2
|
+
class RubyVersion
|
3
|
+
extend Forwardable
|
4
|
+
|
5
|
+
def_delegators :@ruby_version, :version, :patchlevel, :engine, :engine_version, :to_s
|
6
|
+
alias_method :patch_level, :patchlevel
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@ruby_version = Bundler.ruby_version
|
10
|
+
end
|
11
|
+
|
12
|
+
def to_json
|
13
|
+
{
|
14
|
+
engine: engine,
|
15
|
+
engine_version: engine_version,
|
16
|
+
version: version,
|
17
|
+
patch_level: patch_level
|
18
|
+
}
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/prospector/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prospector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Millsaps-Brewer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -124,6 +124,7 @@ files:
|
|
124
124
|
- lib/prospector/error.rb
|
125
125
|
- lib/prospector/motion/config.rb
|
126
126
|
- lib/prospector/railtie.rb
|
127
|
+
- lib/prospector/ruby_version.rb
|
127
128
|
- lib/prospector/tasks.rb
|
128
129
|
- lib/prospector/version.rb
|
129
130
|
- lib/tasks/prospector.rake
|