prospectus 0.5.6 → 0.5.7

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
  SHA256:
3
- metadata.gz: e9c6ef15776d165461e33b50214b244591f7df056c685ea992ec98190ffc3fbd
4
- data.tar.gz: 37be9591edcf394b0f2f025fb9f4dbdefb41c06d63553998939d0d97bff32c5c
3
+ metadata.gz: b435368c70188dc3058cec7f0c0d4b31de13f8dba61296301db8985a0411533c
4
+ data.tar.gz: d9a075e4868e3119bc857a88b2df63b35440fe5e7833de0a409bb1a49e530f57
5
5
  SHA512:
6
- metadata.gz: dfa59805da588b4e9c21143814856e40d74b350bb6574bd6f5fc92d5651310c0fc159f48c9cd2018887bfcb99581b06abcd069c40b6248fa839a59b2608d43e3
7
- data.tar.gz: bd2c2166824dfa441c7a5158e0bff0d0479a83a332f79b90e77b0da8095b3c414383658e941856cc5e7ee97eb3fe50de4554fedd5c809fa83c0b14fd284e4af6
6
+ metadata.gz: 5230bb8f87a19cc6b8c036c0e9d7a8670ac0893d1287b2e71ddfd836a84d4880a4f16a963fa6596d80ee8ac74eaf966e541ee9dc1cdc10b4a8f41f0686721cf8
7
+ data.tar.gz: 4e2ec5c7de78b600f94c46b3dab47fcce95ae6a913bf584371ef99bf87636f829605dc09e044e4fdbe74ad17f297bfd120af8d5ef12007478912a113ee244852
data/.circle-ruby CHANGED
@@ -1,4 +1,4 @@
1
- 2.5.0
2
- 2.4.3
3
- 2.3.6
4
- 2.2.9
1
+ 2.5.1
2
+ 2.4.4
3
+ 2.3.7
4
+ 2.2.10
data/.prospectus CHANGED
@@ -1,25 +1,11 @@
1
- Prospectus.extra_dep('file', 'prospectus_circleci')
2
-
3
1
  my_slug = 'akerl/prospectus'
4
2
 
3
+ Prospectus.extra_dep('file', 'prospectus_circleci')
4
+ Prospectus.extra_dep('file', 'prospectus_gems')
5
+
5
6
  item do
6
7
  noop
7
8
 
8
- deps do
9
- item do
10
- name 'gems'
11
-
12
- expected do
13
- static
14
- set 'green'
15
- end
16
-
17
- actual do
18
- gemnasium
19
- slug my_slug
20
- end
21
- end
22
- end
23
-
9
+ extend ProspectusGems::Gemspec.new
24
10
  extend ProspectusCircleci::Build.new(my_slug)
25
11
  end
data/README.md CHANGED
@@ -202,29 +202,9 @@ expected do
202
202
  end
203
203
  ```
204
204
 
205
- ### gemnasium
206
-
207
- Parses the dep status on Gemnasium for a project. Will return the worst color from their dashboard (red, yellow, or green). Requires the netrc gem.
208
-
209
- Due to the nature of the response, this is best used with a `static` expected block, like this:
210
-
211
- ```
212
- item do
213
- expected do
214
- static
215
- set 'green'
216
- end
217
-
218
- actual do
219
- gemnasium
220
- slug 'amylum/server'
221
- end
222
- end
223
- ```
224
-
225
205
  ### static
226
206
 
227
- Basic module for staticly defining a value. Useful for testing, and also for comparisons against a known state (like with the gemnasium module).
207
+ Basic module for staticly defining a value. Useful for testing, and also for comparisons against a known state.
228
208
 
229
209
  ```
230
210
  item do
@@ -8,7 +8,7 @@ module LogCabin
8
8
  module GitlabApi
9
9
  def gitlab_api
10
10
  @gitlab_api ||= Gitlab.client(
11
- endpoint: gitlab_endpoint + '/api/v3',
11
+ endpoint: gitlab_endpoint + '/api/v4',
12
12
  private_token: gitlab_token
13
13
  )
14
14
  end
@@ -19,8 +19,9 @@ module LogCabin
19
19
  private
20
20
 
21
21
  def parse_page
22
- page = Nokogiri::HTML(open(@url)) { |config| config.strict.nonet }
23
- page.xpath(@xpath).text.strip
22
+ page = open(@url) # rubocop:disable Security/Open
23
+ html = Nokogiri::HTML(page) { |config| config.strict.nonet }
24
+ html.xpath(@xpath).text.strip
24
25
  end
25
26
 
26
27
  def url(value)
@@ -3,5 +3,5 @@
3
3
  ##
4
4
  # Declare package version
5
5
  module Prospectus
6
- VERSION = '0.5.6'.freeze
6
+ VERSION = '0.5.7'.freeze
7
7
  end
data/prospectus.gemspec CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'English'
2
- $LOAD_PATH.unshift File.expand_path('../lib/', __FILE__)
2
+ $LOAD_PATH.unshift File.expand_path('lib', __dir__)
3
3
  require 'prospectus/version'
4
4
 
5
5
  Gem::Specification.new do |s|
@@ -23,8 +23,8 @@ Gem::Specification.new do |s|
23
23
 
24
24
  s.add_development_dependency 'codecov', '~> 0.1.1'
25
25
  s.add_development_dependency 'fuubar', '~> 2.3.0'
26
- s.add_development_dependency 'goodcop', '~> 0.2.0'
26
+ s.add_development_dependency 'goodcop', '~> 0.5.0'
27
27
  s.add_development_dependency 'rake', '~> 12.3.0'
28
28
  s.add_development_dependency 'rspec', '~> 3.7.0'
29
- s.add_development_dependency 'rubocop', '~> 0.52.0'
29
+ s.add_development_dependency 'rubocop', '~> 0.56.0'
30
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prospectus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les Aker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-07 00:00:00.000000000 Z
11
+ date: 2018-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logcabin
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.2.0
75
+ version: 0.5.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.2.0
82
+ version: 0.5.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 0.52.0
117
+ version: 0.56.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 0.52.0
124
+ version: 0.56.0
125
125
  description: Tool and DSL for checking expected vs actual state
126
126
  email: me@lesaker.org
127
127
  executables:
@@ -149,7 +149,6 @@ files:
149
149
  - lib/prospectus/item.rb
150
150
  - lib/prospectus/list.rb
151
151
  - lib/prospectus/loader.rb
152
- - lib/prospectus/modules/gemnasium.rb
153
152
  - lib/prospectus/modules/git_hash.rb
154
153
  - lib/prospectus/modules/git_tag.rb
155
154
  - lib/prospectus/modules/github_hash.rb
@@ -186,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
185
  version: '0'
187
186
  requirements: []
188
187
  rubyforge_project:
189
- rubygems_version: 2.7.3
188
+ rubygems_version: 2.7.6
190
189
  signing_key:
191
190
  specification_version: 4
192
191
  summary: Tool and DSL for checking expected vs actual state
@@ -1,73 +0,0 @@
1
- Prospectus.extra_dep('gemnasium', 'netrc')
2
- require 'net/http'
3
- require 'json'
4
-
5
- module LogCabin
6
- module Modules
7
- ##
8
- # Pull state from Gemnasium
9
- module Gemnasium
10
- def load!
11
- raise('No slug provided') unless @slug
12
- @state.value = parse_api
13
- end
14
-
15
- private
16
-
17
- def parse_api
18
- %w[red yellow].each do |color|
19
- return color if colors.include? color
20
- end
21
- 'green'
22
- end
23
-
24
- def colors
25
- @colors ||= api_data.map { |x| x['first_level'] && x['color'] }
26
- end
27
-
28
- def api_data
29
- return @api_data if @api_data
30
- resp = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
31
- request = Net::HTTP::Get.new uri.request_uri
32
- request.basic_auth(*creds)
33
- response = http.request(request)
34
- JSON.parse(response.body)
35
- end
36
- @api_data = validate_response(resp)
37
- end
38
-
39
- def validate_response(resp)
40
- return resp if resp.is_a? Array
41
- raise("API lookup on gemnasium failed: #{resp['message']}")
42
- end
43
-
44
- def creds
45
- netrc[site] || prompt_for_creds
46
- end
47
-
48
- def prompt_for_creds
49
- puts 'Please enter your API key from https://gemnasium.com/settings >> '
50
- resp = gets.chomp
51
- netrc[site] = 'X', resp
52
- netrc.save
53
- netrc[site]
54
- end
55
-
56
- def netrc
57
- @netrc ||= Netrc.read
58
- end
59
-
60
- def uri
61
- @uri ||= URI("https://api.gemnasium.com/projects/#{@slug}/dependencies")
62
- end
63
-
64
- def site
65
- 'gemnasium.com'
66
- end
67
-
68
- def slug(value)
69
- @slug = value
70
- end
71
- end
72
- end
73
- end