prospector 0.4.3 → 0.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab4dbf796ab0088c54dd980ddf40c3eb108acd6c
4
- data.tar.gz: 182342fb81e197d9aafb7f6c81c9e62b1fdcb109
3
+ metadata.gz: dcea86688c4d802bd630b67670505910424687cc
4
+ data.tar.gz: 2aa8cfb64cbcd3f8dc60703a50d6bda297328297
5
5
  SHA512:
6
- metadata.gz: 669358936c4856acd608b26510c873da5fbf53993709cbf4a35d8f0cb6c39717d3c03481d8d76e09ae70e24f4f67b5674b639f08ef410cdff723f394a87efd37
7
- data.tar.gz: f0af1709246bcb99daf0a1ec51444450c4d6e8a22ee247a5f7e65c4b1addcae7cba9b135a988f09e0a50765b3124ed3cdcfc8b1bf49b307466743a312fd6882c
6
+ metadata.gz: 6859a0143fb4d7b268d9be1981e758a41f7919111b0841bf2f4cae44287920a78d71fd75bde645abda97766c086f76f76edc985cf8bedc27c5c98292d343d2c4
7
+ data.tar.gz: b79cbddc3ddcf11e1adfd2d830773b367eccc14714ed83ab22461761430548acc836178a5fbe20e83f764beab5448ffd1cc08aa03ceb70a3c00f0a4c68ba0e68
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Prospector Changelog
2
2
 
3
+ ## Version 0.5.0
4
+
5
+ * Determine ruby version and deliver to API [PR #11](https://github.com/madebylotus/prospector/pull/11)
6
+
3
7
  ## Version 0.4.3
4
8
 
5
9
  * Properly require the "net/http" library
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
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Prospector
2
- VERSION = "0.4.3"
2
+ VERSION = "0.5.0"
3
3
  end
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.3
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-13 00:00:00.000000000 Z
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