jazzy 0.8.4 → 0.9.0

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: 521ac7a49708dd60f61fd8a5be45a0cabeadab01
4
- data.tar.gz: d92a5318703bcdc5b70a30b02147c1b6318a5207
3
+ metadata.gz: 4d4de6485c397bd0feb5b8e6612644d5d9ab1e65
4
+ data.tar.gz: c5a15531eda99f16aa99db7b5f7d19159de53d8c
5
5
  SHA512:
6
- metadata.gz: 4fbcffeba3be993af19ca581792fc18c2cef463df918ab0f0f7f5f76b04a09494d7dd7066c1b4a3a3125102178660cc4278f985d2becf2c9974eb32340c14004
7
- data.tar.gz: 54f4db86a1b320ec74f98992c26757a4dc5fdd25e350942678d51bc0b15ab6910e6b0d2e3a8f5bd2d2f2eb172244039233ecbdf255c5bfecf0e1bd0ba6aa64f7
6
+ metadata.gz: 4a7ff1e6c421c32e8fd4ab654fa345f526bc9e812911063f9930964f1a86bee904397193e73e9c4a84170c9b4a49a466f6f31f7b8720adb9821e0069d2cb51bb
7
+ data.tar.gz: c4091c6b736b1030eb9b2a445e1bd2d141cf67efed5142ea5ececc48256529662f443c6fc4b5d8526cac3a14d8d5d8ec84530cbc175ec706b7caba41af8ba795
@@ -1,3 +1,35 @@
1
+ ## 0.9.0
2
+
3
+ ##### Breaking
4
+
5
+ * Generate documentation coverage badge locally. Since this avoids the failable
6
+ HTTP request to shields.io previously used to obtain the badge, we've removed
7
+ the `--[no-]download-badge` flag and the corresponding `download_badge`
8
+ YAML configuration key.
9
+ [Samuel Giddins](https://github.com/segiddins)
10
+
11
+ ##### Enhancements
12
+
13
+ * None.
14
+
15
+ ##### Bug Fixes
16
+
17
+ * Fixed issue that prevented Jazzy from running on case sensitive file systems.
18
+ [Jeremy David Giesbrecht](https://github.com/SDGGiesbrecht)
19
+ [#891](https://github.com/realm/jazzy/issues/891)
20
+
21
+ * Fixed issue preventing `--podspec` from working with `test_spec`s.
22
+ [John Fairhurst](https://github.com/johnfairh)
23
+ [#894](https://github.com/realm/jazzy/issues/894)
24
+
25
+ * Always display correct declaration for undocumented symbols.
26
+ [John Fairhurst](https://github.com/johnfairh)
27
+ [#864](https://github.com/realm/jazzy/issues/864)
28
+
29
+ * Trim common indentation in multiline declarations.
30
+ [John Fairhurst](https://github.com/johnfairh)
31
+ [#836](https://github.com/realm/jazzy/issues/836)
32
+
1
33
  ## 0.8.4
2
34
 
3
35
  ##### Breaking
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ gemspec
4
4
 
5
5
  group :development do
6
6
  # Code style
7
- gem 'rubocop'
7
+ gem 'rubocop', '0.49.0'
8
8
 
9
9
  # Tests
10
10
  gem 'bacon'
@@ -14,9 +14,9 @@ group :development do
14
14
  gem 'webmock'
15
15
 
16
16
  # Integration tests
17
- gem 'diffy'
18
17
  gem 'clintegracon', '0.7.0'
19
-
18
+ gem 'diffy'
19
+
20
20
  # Code Review
21
21
  gem 'danger'
22
22
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jazzy (0.8.4)
4
+ jazzy (0.9.0)
5
5
  cocoapods (~> 1.0)
6
6
  mustache (~> 0.99)
7
7
  open4
@@ -15,16 +15,16 @@ GEM
15
15
  remote: https://rubygems.org/
16
16
  specs:
17
17
  CFPropertyList (2.3.5)
18
- activesupport (4.2.9)
18
+ activesupport (4.2.10)
19
19
  i18n (~> 0.7)
20
20
  minitest (~> 5.1)
21
21
  thread_safe (~> 0.3, >= 0.3.4)
22
22
  tzinfo (~> 1.1)
23
- addressable (2.5.1)
24
- public_suffix (~> 2.0, >= 2.0.2)
23
+ addressable (2.5.2)
24
+ public_suffix (>= 2.0.2, < 4.0)
25
25
  ast (2.3.0)
26
26
  bacon (1.2.0)
27
- claide (1.0.1)
27
+ claide (1.0.2)
28
28
  claide-plugins (0.9.2)
29
29
  cork
30
30
  nap
@@ -32,10 +32,10 @@ GEM
32
32
  clintegracon (0.7.0)
33
33
  colored (~> 1.2)
34
34
  diffy
35
- cocoapods (1.2.1)
35
+ cocoapods (1.3.1)
36
36
  activesupport (>= 4.0.2, < 5)
37
- claide (>= 1.0.1, < 2.0)
38
- cocoapods-core (= 1.2.1)
37
+ claide (>= 1.0.2, < 2.0)
38
+ cocoapods-core (= 1.3.1)
39
39
  cocoapods-deintegrate (>= 1.0.1, < 2.0)
40
40
  cocoapods-downloader (>= 1.1.3, < 2.0)
41
41
  cocoapods-plugins (>= 1.0.0, < 2.0)
@@ -50,9 +50,9 @@ GEM
50
50
  molinillo (~> 0.5.7)
51
51
  nap (~> 1.0)
52
52
  ruby-macho (~> 1.1)
53
- xcodeproj (>= 1.4.4, < 2.0)
54
- cocoapods-core (1.2.1)
55
- activesupport (>= 4.0.2, < 5)
53
+ xcodeproj (>= 1.5.1, < 2.0)
54
+ cocoapods-core (1.3.1)
55
+ activesupport (>= 4.0.2, < 6)
56
56
  fuzzy_match (~> 2.0.4)
57
57
  nap (~> 1.0)
58
58
  cocoapods-deintegrate (1.0.1)
@@ -61,17 +61,18 @@ GEM
61
61
  nap
62
62
  cocoapods-search (1.0.0)
63
63
  cocoapods-stats (1.0.0)
64
- cocoapods-trunk (1.2.0)
64
+ cocoapods-trunk (1.3.0)
65
65
  nap (>= 0.8, < 2.0)
66
- netrc (= 0.7.8)
66
+ netrc (~> 0.11)
67
67
  cocoapods-try (1.1.0)
68
68
  colored (1.2)
69
69
  colored2 (3.1.2)
70
+ concurrent-ruby (1.0.5)
70
71
  cork (0.3.0)
71
72
  colored2 (~> 3.1)
72
73
  crack (0.4.3)
73
74
  safe_yaml (~> 1.0.0)
74
- danger (5.2.2)
75
+ danger (5.5.3)
75
76
  claide (~> 1.0)
76
77
  claide-plugins (>= 0.9.2)
77
78
  colored2 (~> 3.1)
@@ -80,11 +81,12 @@ GEM
80
81
  faraday-http-cache (~> 1.0)
81
82
  git (~> 1)
82
83
  kramdown (~> 1.5)
83
- octokit (~> 4.2)
84
+ no_proxy_fix
85
+ octokit (~> 4.7)
84
86
  terminal-table (~> 1)
85
87
  diffy (3.2.0)
86
88
  escape (0.0.4)
87
- faraday (0.12.1)
89
+ faraday (0.13.1)
88
90
  multipart-post (>= 1.2, < 3)
89
91
  faraday-http-cache (1.3.1)
90
92
  faraday (~> 0.8)
@@ -93,13 +95,14 @@ GEM
93
95
  fuzzy_match (2.0.4)
94
96
  gh_inspector (1.0.3)
95
97
  git (1.3.0)
96
- hashdiff (0.3.4)
97
- i18n (0.8.6)
98
- kramdown (1.13.2)
98
+ hashdiff (0.3.7)
99
+ i18n (0.9.0)
100
+ concurrent-ruby (~> 1.0)
101
+ kramdown (1.15.0)
99
102
  liferaft (0.0.6)
100
103
  metaclass (0.0.4)
101
104
  minitest (5.10.3)
102
- mocha (1.2.1)
105
+ mocha (1.3.0)
103
106
  metaclass (~> 0.0.1)
104
107
  mocha-on-bacon (0.2.3)
105
108
  mocha (>= 0.13.0)
@@ -108,16 +111,18 @@ GEM
108
111
  mustache (0.99.8)
109
112
  nanaimo (0.2.3)
110
113
  nap (1.1.0)
111
- netrc (0.7.8)
114
+ netrc (0.11.0)
115
+ no_proxy_fix (0.1.2)
112
116
  octokit (4.7.0)
113
117
  sawyer (~> 0.8.0, >= 0.5.3)
114
118
  open4 (1.3.4)
119
+ parallel (1.12.0)
115
120
  parser (2.4.0.0)
116
121
  ast (~> 2.2)
117
122
  powerpack (0.1.1)
118
123
  prettybacon (0.0.2)
119
124
  bacon (~> 1.2)
120
- public_suffix (2.0.5)
125
+ public_suffix (3.0.0)
121
126
  rainbow (2.2.2)
122
127
  rake
123
128
  rake (10.5.0)
@@ -126,16 +131,17 @@ GEM
126
131
  ffi (>= 0.5.0, < 2)
127
132
  redcarpet (3.4.0)
128
133
  rouge (1.11.1)
129
- rubocop (0.48.1)
134
+ rubocop (0.49.0)
135
+ parallel (~> 1.10)
130
136
  parser (>= 2.3.3.1, < 3.0)
131
137
  powerpack (~> 0.1)
132
138
  rainbow (>= 1.99.1, < 3.0)
133
139
  ruby-progressbar (~> 1.7)
134
140
  unicode-display_width (~> 1.0, >= 1.0.1)
135
141
  ruby-macho (1.1.0)
136
- ruby-progressbar (1.8.1)
142
+ ruby-progressbar (1.9.0)
137
143
  safe_yaml (1.0.4)
138
- sass (3.5.1)
144
+ sass (3.5.3)
139
145
  sass-listen (~> 4.0.0)
140
146
  sass-listen (4.0.0)
141
147
  rb-fsevent (~> 0.9, >= 0.9.4)
@@ -147,18 +153,18 @@ GEM
147
153
  terminal-table (1.8.0)
148
154
  unicode-display_width (~> 1.1, >= 1.1.1)
149
155
  thread_safe (0.3.6)
150
- tzinfo (1.2.3)
156
+ tzinfo (1.2.4)
151
157
  thread_safe (~> 0.1)
152
- unicode-display_width (1.2.1)
153
- webmock (3.0.1)
158
+ unicode-display_width (1.3.0)
159
+ webmock (3.1.0)
154
160
  addressable (>= 2.3.6)
155
161
  crack (>= 0.3.2)
156
162
  hashdiff
157
163
  xcinvoke (0.3.0)
158
164
  liferaft (~> 0.0.6)
159
- xcodeproj (1.4.4)
165
+ xcodeproj (1.5.3)
160
166
  CFPropertyList (~> 2.3.3)
161
- claide (>= 1.0.1, < 2.0)
167
+ claide (>= 1.0.2, < 2.0)
162
168
  colored2 (~> 3.1)
163
169
  nanaimo (~> 0.2.3)
164
170
 
@@ -176,7 +182,7 @@ DEPENDENCIES
176
182
  mocha-on-bacon
177
183
  prettybacon
178
184
  rake (~> 10.3)
179
- rubocop
185
+ rubocop (= 0.49.0)
180
186
  webmock
181
187
 
182
188
  BUNDLED WITH
Binary file
@@ -211,6 +211,8 @@ module Jazzy
211
211
 
212
212
  config_attr :podspec,
213
213
  command_line: '--podspec FILEPATH',
214
+ description: 'A CocoaPods Podspec that describes the Swift library to '\
215
+ 'document',
214
216
  parse: ->(ps) { PodspecDocumenter.create_podspec(Pathname(ps)) if ps },
215
217
  default: Dir['*.podspec{,.json}'].first
216
218
 
@@ -297,7 +299,7 @@ module Jazzy
297
299
  'other assets for a custom theme.',
298
300
  default: 'apple',
299
301
  parse: ->(t) do
300
- if t == 'apple' || t == 'fullwidth'
302
+ if %w[apple fullwidth].include?(t)
301
303
  Pathname(__FILE__).parent + 'themes' + t
302
304
  else
303
305
  expand_path(t)
@@ -326,11 +328,6 @@ module Jazzy
326
328
  raise '--assets-directory is deprecated: use --theme instead.'
327
329
  end
328
330
 
329
- config_attr :download_badge,
330
- command_line: '--[no-]download-badge',
331
- description: 'Download documentation coverage badge from shields.io.',
332
- default: true
333
-
334
331
  # rubocop:enable Style/AlignParameters
335
332
 
336
333
  def initialize
@@ -1,7 +1,5 @@
1
1
  require 'fileutils'
2
2
  require 'mustache'
3
- require 'uri'
4
- require 'net/http'
5
3
  require 'pathname'
6
4
  require 'sass'
7
5
 
@@ -131,7 +129,7 @@ module Jazzy
131
129
 
132
130
  DocsetBuilder.new(output_dir, source_module).build!
133
131
 
134
- download_badge(source_module.doc_coverage, options)
132
+ generate_badge(source_module.doc_coverage, options)
135
133
 
136
134
  friendly_path = relative_path_if_inside(output_dir, Pathname.pwd)
137
135
  puts "jam out ♪♫ to your fresh new docs in `#{friendly_path}`"
@@ -244,38 +242,68 @@ module Jazzy
244
242
  # @param [Number] coverage The documentation coverage percentage
245
243
  def self.color_for_coverage(coverage)
246
244
  if coverage < 10
247
- 'red'
245
+ 'e05d44' # red
248
246
  elsif coverage < 30
249
- 'orange'
247
+ 'fe7d37' # orange
250
248
  elsif coverage < 60
251
- 'yellow'
249
+ 'dfb317' # yellow
252
250
  elsif coverage < 85
253
- 'yellowgreen'
251
+ 'a4a61d' # yellowgreen
254
252
  elsif coverage < 90
255
- 'green'
253
+ '97CA00' # green
256
254
  else
257
- 'brightgreen'
255
+ '4c1' # brightgreen
258
256
  end
259
257
  end
260
258
 
261
- # Downloads an SVG from shields.io displaying the documentation percentage
259
+ # rubocop:disable Metrics/MethodLength
260
+
261
+ # Generates an SVG similar to those from shields.io displaying the
262
+ # documentation percentage
262
263
  # @param [Number] coverage The documentation coverage percentage
263
264
  # @param [Config] options Build options
264
- def self.download_badge(coverage, options)
265
- return if options.hide_documentation_coverage || !options.download_badge
265
+ def self.generate_badge(coverage, options)
266
+ return if options.hide_documentation_coverage
267
+
268
+ coverage_length = coverage.to_s.size.succ
269
+ percent_string_length = coverage_length * 80 + 10
270
+ percent_string_offset = coverage_length * 40 + 975
271
+ width = coverage_length * 8 + 104
272
+ svg = <<-SVG.gsub(/^ {8}/, '')
273
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="#{width}" height="20">
274
+ <linearGradient id="b" x2="0" y2="100%">
275
+ <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
276
+ <stop offset="1" stop-opacity=".1"/>
277
+ </linearGradient>
278
+ <clipPath id="a">
279
+ <rect width="#{width}" height="20" rx="3" fill="#fff"/>
280
+ </clipPath>
281
+ <g clip-path="url(#a)">
282
+ <path fill="#555" d="M0 0h93v20H0z"/>
283
+ <path fill="##{color_for_coverage(coverage)}" d="M93 0h#{percent_string_length / 10 + 10}v20H93z"/>
284
+ <path fill="url(#b)" d="M0 0h#{width}v20H0z"/>
285
+ </g>
286
+ <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110">
287
+ <text x="475" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="830">
288
+ documentation
289
+ </text>
290
+ <text x="475" y="140" transform="scale(.1)" textLength="830">
291
+ documentation
292
+ </text>
293
+ <text x="#{percent_string_offset}" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="#{percent_string_length}">
294
+ #{coverage}%
295
+ </text>
296
+ <text x="#{percent_string_offset}" y="140" transform="scale(.1)" textLength="#{percent_string_length}">
297
+ #{coverage}%
298
+ </text>
299
+ </g>
300
+ </svg>
301
+ SVG
266
302
 
267
- warn 'downloading coverage badge'
268
- badge_url = 'https://img.shields.io/badge/documentation-' \
269
- "#{coverage}%25-#{color_for_coverage(coverage)}.svg"
270
303
  badge_output = options.output + 'badge.svg'
271
- system('curl', '-s', badge_url, '-o', badge_output.to_s)
272
- unless $?.success?
273
- warn 'Downloading documentation coverage badge failed.'
274
- warn 'Please try again when connected to the Internet, or skip the ' \
275
- 'download by passing the `--no-download-badge` command flag.'
276
- exit $?.exitstatus || 1
277
- end
304
+ File.open(badge_output, 'w') { |f| f << svg }
278
305
  end
306
+ # rubocop:enable Metrics/MethodLength
279
307
 
280
308
  def self.should_link_to_github(file)
281
309
  return unless file
@@ -307,7 +335,7 @@ module Jazzy
307
335
  def self.render_item(item, source_module)
308
336
  # Combine abstract and discussion into abstract
309
337
  abstract = (item.abstract || '') + (item.discussion || '')
310
- item_render = {
338
+ {
311
339
  name: item.name,
312
340
  abstract: abstract,
313
341
  declaration: item.declaration,
@@ -323,7 +351,6 @@ module Jazzy
323
351
  start_line: item.start_line,
324
352
  end_line: item.end_line,
325
353
  }
326
- item_render.reject { |_, v| v.nil? }
327
354
  end
328
355
 
329
356
  def self.make_task(mark, uid, items)
@@ -1,3 +1,3 @@
1
1
  module Jazzy
2
- VERSION = '0.8.4'.freeze unless defined? Jazzy::VERSION
2
+ VERSION = '0.9.0'.freeze unless defined? Jazzy::VERSION
3
3
  end
@@ -116,6 +116,9 @@ module Jazzy
116
116
  deterministic_uuids: false
117
117
 
118
118
  [podspec, *podspec.recursive_subspecs].each do |ss|
119
+ # test_specification exists from CocoaPods 1.3.0
120
+ next if ss.respond_to?('test_specification') && ss.test_specification
121
+
119
122
  ss.available_platforms.each do |p|
120
123
  # Travis builds take too long when building docs for all available
121
124
  # platforms for the Moya integration spec, so we just document OSX.
@@ -2,7 +2,7 @@ require 'json'
2
2
  require 'pathname'
3
3
  require 'shellwords'
4
4
  require 'xcinvoke'
5
- require 'CGI'
5
+ require 'cgi'
6
6
 
7
7
  require 'jazzy/config'
8
8
  require 'jazzy/executable'
@@ -306,10 +306,6 @@ module Jazzy
306
306
  def self.make_doc_info(doc, declaration)
307
307
  return unless should_document?(doc)
308
308
 
309
- unless doc['key.doc.full_as_xml']
310
- return process_undocumented_token(doc, declaration)
311
- end
312
-
313
309
  declaration.declaration = Highlighter.highlight(
314
310
  doc['key.parsed_declaration'] || doc['key.doc.declaration'],
315
311
  Config.instance.objc_mode ? 'objc' : 'swift',
@@ -320,6 +316,10 @@ module Jazzy
320
316
  )
321
317
  end
322
318
 
319
+ unless doc['key.doc.full_as_xml']
320
+ return process_undocumented_token(doc, declaration)
321
+ end
322
+
323
323
  declaration.abstract = Markdown.render(doc['key.doc.comment'] || '')
324
324
  declaration.discussion = ''
325
325
  declaration.return = Markdown.rendered_returns
@@ -472,7 +472,7 @@ module Jazzy
472
472
  warn 'Found conflicting type declarations with the same name, which ' \
473
473
  'may indicate a build issue or a bug in Jazzy: ' +
474
474
  typedecls.map { |t| "#{t.type.name.downcase} #{t.name}" }
475
- .join(', ')
475
+ .join(', ')
476
476
  end
477
477
  typedecl = typedecls.first
478
478
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jazzy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JP Simard
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-09-28 00:00:00.000000000 Z
13
+ date: 2017-10-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: cocoapods