jazzy 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -0
  3. data/CHANGELOG.md +30 -1
  4. data/Gemfile +0 -0
  5. data/Gemfile.lock +2 -2
  6. data/LICENSE +0 -0
  7. data/README.md +4 -0
  8. data/Rakefile +0 -0
  9. data/jazzy.gemspec +0 -0
  10. data/lib/jazzy.rb +0 -0
  11. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/SourceKittenFramework +0 -0
  12. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Commandant.framework/Commandant +0 -0
  13. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Commandant.framework/Versions/A/Commandant +0 -0
  14. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Commandant.framework/Versions/A/Resources/Info.plist +5 -5
  15. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Result.framework/Result +0 -0
  16. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Result.framework/Versions/A/Resources/Info.plist +4 -4
  17. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Result.framework/Versions/A/Result +0 -0
  18. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/SWXMLHash.framework/SWXMLHash +0 -0
  19. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/SWXMLHash.framework/Versions/A/Resources/Info.plist +4 -4
  20. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/SWXMLHash.framework/Versions/A/SWXMLHash +0 -0
  21. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftCore.dylib +0 -0
  22. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftCoreGraphics.dylib +0 -0
  23. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftDarwin.dylib +0 -0
  24. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftDispatch.dylib +0 -0
  25. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftFoundation.dylib +0 -0
  26. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftIOKit.dylib +0 -0
  27. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftObjectiveC.dylib +0 -0
  28. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Resources/Info.plist +5 -5
  29. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/SourceKittenFramework +0 -0
  30. data/lib/jazzy/SourceKitten/bin/sourcekitten +0 -0
  31. data/lib/jazzy/config.rb +1 -1
  32. data/lib/jazzy/doc.rb +0 -0
  33. data/lib/jazzy/doc_builder.rb +14 -13
  34. data/lib/jazzy/gem_version.rb +1 -1
  35. data/lib/jazzy/jazzy_markdown.rb +3 -3
  36. data/lib/jazzy/source_declaration.rb +1 -0
  37. data/lib/jazzy/source_declaration/type.rb +4 -0
  38. data/lib/jazzy/sourcekitten.rb +17 -4
  39. data/lib/jazzy/themes/apple/templates/task.mustache +6 -0
  40. data/lib/jazzy/themes/fullwidth/templates/task.mustache +6 -0
  41. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ba1de18fa3f65a96e4194a16af54548702703a3
4
- data.tar.gz: b672b6be8ae8d3dd5e7fb01b3b38e8193f64e2f3
3
+ metadata.gz: 8d85303f765a7df28885d3fcdd9d7d8d89d502c8
4
+ data.tar.gz: b03826e493810d8d6fa62f1bb6c3877852d1cdf7
5
5
  SHA512:
6
- metadata.gz: 750b810f71f2b796acfab8b17a0f4b74fc27efd22098086a77d469a035b5a977921bea452e93603c05ede5a14e9e2fcef39286f491e504ac2036b47a0ab24a5f
7
- data.tar.gz: 82dd5f2f81eaac159ce85f4444e72407a09dbb5dbfcc151a4e9c4ff2866ac8e06a6aa5893a61548d4c3ca8168a6176303ee77c8c62f4851a5e9bdab228c55498
6
+ metadata.gz: b6daabf69f85b3a83aa8db1598b4a307718b9056b176b580dd981e15d22e3a27fc0dda6b12582eac8af2067a1916bfbb94963ef0666fe18346b91f5f5f29acad
7
+ data.tar.gz: 060d7221d8c6a827d78bba090c525740febb55c4323fc71aa626af598cb6562836c0103f71819078c123a42913cd95267c2ec90b3715e392a65e360c7d46ed76
data/.gitignore CHANGED
File without changes
data/CHANGELOG.md CHANGED
@@ -1,3 +1,32 @@
1
+ ## 0.6.1
2
+
3
+ ##### Breaking
4
+
5
+ * None.
6
+
7
+ ##### Enhancements
8
+
9
+ * Objective-C documentation now also includes Swift declarations.
10
+ [JP Simard](https://github.com/jpsim)
11
+ [#136](https://github.com/realm/jazzy/issues/136)
12
+ * Default to the Xcode version selected in `xcode-select` if no Swift version is
13
+ specified.
14
+ [Samuel Giddins](https://github.com/segiddins)
15
+ [#427](https://github.com/realm/jazzy/issues/427)
16
+
17
+ ##### Bug Fixes
18
+
19
+ * Uses GitHub-Flavored Markdown syntax for anchors when rendering README pages.
20
+ [Zachary Waldowski](https://github.com/zwaldowski)
21
+ [#524](https://github.com/realm/jazzy/issues/524)
22
+ * Fix crash when using unexposed declarations in Objective-C.
23
+ [JP Simard](https://github.com/jpsim)
24
+ [#543](https://github.com/realm/jazzy/issues/543)
25
+ * No longer document Swift extensions on types with an ACL lower than `min-acl`
26
+ when they contain `MARK`s.
27
+ [JP Simard](https://github.com/jpsim)
28
+ [#544](https://github.com/realm/jazzy/issues/544)
29
+
1
30
  ## 0.6.0
2
31
 
3
32
  ##### Breaking
@@ -204,7 +233,7 @@
204
233
 
205
234
  * Print a more informative error when unable to find an Xcode that has the
206
235
  requested Swift version.
207
- [Samuel Giddins])https://github.com/segiddins
236
+ [Samuel Giddins](https://github.com/segiddins)
208
237
 
209
238
 
210
239
  ## 0.3.1
data/Gemfile CHANGED
File without changes
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jazzy (0.6.0)
4
+ jazzy (0.6.1)
5
5
  cocoapods (~> 0.39)
6
6
  mustache (~> 0.99)
7
7
  open4
@@ -71,7 +71,7 @@ GEM
71
71
  metaclass (~> 0.0.1)
72
72
  mocha-on-bacon (0.2.2)
73
73
  mocha (>= 0.13.0)
74
- molinillo (0.4.4)
74
+ molinillo (0.4.5)
75
75
  mustache (0.99.8)
76
76
  nap (1.1.0)
77
77
  netrc (0.7.8)
data/LICENSE CHANGED
File without changes
data/README.md CHANGED
@@ -34,6 +34,10 @@ you wish to document. It must be installed in a location indexed by Spotlight.
34
34
 
35
35
  Run `jazzy` from your command line. Run `jazzy -h` for a list of additional options.
36
36
 
37
+ If your Swift module is the first thing to build, and it builds fine when running
38
+ `xcodebuild` without any arguments from the root of your project, then just running
39
+ `jazzy` (without any arguments) from the root of your project should succeed too!
40
+
37
41
  You can set options for your project’s documentation in a configuration file,
38
42
  `.jazzy.yaml` by default. For a detailed explanation and an exhaustive list of
39
43
  all available options, run `jazzy --help config`.
data/Rakefile CHANGED
File without changes
data/jazzy.gemspec CHANGED
File without changes
data/lib/jazzy.rb CHANGED
File without changes
@@ -3,7 +3,7 @@
3
3
  <plist version="1.0">
4
4
  <dict>
5
5
  <key>BuildMachineOSBuild</key>
6
- <string>15E65</string>
6
+ <string>15F34</string>
7
7
  <key>CFBundleDevelopmentRegion</key>
8
8
  <string>en</string>
9
9
  <key>CFBundleExecutable</key>
@@ -17,7 +17,7 @@
17
17
  <key>CFBundlePackageType</key>
18
18
  <string>FMWK</string>
19
19
  <key>CFBundleShortVersionString</key>
20
- <string>0.8.2</string>
20
+ <string>0.9.0</string>
21
21
  <key>CFBundleSignature</key>
22
22
  <string>????</string>
23
23
  <key>CFBundleSupportedPlatforms</key>
@@ -29,7 +29,7 @@
29
29
  <key>DTCompiler</key>
30
30
  <string>com.apple.compilers.llvm.clang.1_0</string>
31
31
  <key>DTPlatformBuild</key>
32
- <string>7D175</string>
32
+ <string>7D1014</string>
33
33
  <key>DTPlatformVersion</key>
34
34
  <string>GM</string>
35
35
  <key>DTSDKBuild</key>
@@ -37,9 +37,9 @@
37
37
  <key>DTSDKName</key>
38
38
  <string>macosx10.11</string>
39
39
  <key>DTXcode</key>
40
- <string>0730</string>
40
+ <string>0731</string>
41
41
  <key>DTXcodeBuild</key>
42
- <string>7D175</string>
42
+ <string>7D1014</string>
43
43
  <key>NSHumanReadableCopyright</key>
44
44
  <string>Copyright © 2014 Carthage. All rights reserved.</string>
45
45
  </dict>
@@ -3,7 +3,7 @@
3
3
  <plist version="1.0">
4
4
  <dict>
5
5
  <key>BuildMachineOSBuild</key>
6
- <string>15E65</string>
6
+ <string>15F34</string>
7
7
  <key>CFBundleDevelopmentRegion</key>
8
8
  <string>en</string>
9
9
  <key>CFBundleExecutable</key>
@@ -29,7 +29,7 @@
29
29
  <key>DTCompiler</key>
30
30
  <string>com.apple.compilers.llvm.clang.1_0</string>
31
31
  <key>DTPlatformBuild</key>
32
- <string>7D175</string>
32
+ <string>7D1014</string>
33
33
  <key>DTPlatformVersion</key>
34
34
  <string>GM</string>
35
35
  <key>DTSDKBuild</key>
@@ -37,9 +37,9 @@
37
37
  <key>DTSDKName</key>
38
38
  <string>macosx10.11</string>
39
39
  <key>DTXcode</key>
40
- <string>0730</string>
40
+ <string>0731</string>
41
41
  <key>DTXcodeBuild</key>
42
- <string>7D175</string>
42
+ <string>7D1014</string>
43
43
  <key>NSHumanReadableCopyright</key>
44
44
  <string>Copyright © 2015 Rob Rix. All rights reserved.</string>
45
45
  </dict>
@@ -3,7 +3,7 @@
3
3
  <plist version="1.0">
4
4
  <dict>
5
5
  <key>BuildMachineOSBuild</key>
6
- <string>15E65</string>
6
+ <string>15F34</string>
7
7
  <key>CFBundleDevelopmentRegion</key>
8
8
  <string>en</string>
9
9
  <key>CFBundleExecutable</key>
@@ -29,7 +29,7 @@
29
29
  <key>DTCompiler</key>
30
30
  <string>com.apple.compilers.llvm.clang.1_0</string>
31
31
  <key>DTPlatformBuild</key>
32
- <string>7D175</string>
32
+ <string>7D1014</string>
33
33
  <key>DTPlatformVersion</key>
34
34
  <string>GM</string>
35
35
  <key>DTSDKBuild</key>
@@ -37,9 +37,9 @@
37
37
  <key>DTSDKName</key>
38
38
  <string>macosx10.11</string>
39
39
  <key>DTXcode</key>
40
- <string>0730</string>
40
+ <string>0731</string>
41
41
  <key>DTXcodeBuild</key>
42
- <string>7D175</string>
42
+ <string>7D1014</string>
43
43
  <key>UIDeviceFamily</key>
44
44
  <array>
45
45
  <integer>1</integer>
@@ -3,7 +3,7 @@
3
3
  <plist version="1.0">
4
4
  <dict>
5
5
  <key>BuildMachineOSBuild</key>
6
- <string>15E65</string>
6
+ <string>15F34</string>
7
7
  <key>CFBundleDevelopmentRegion</key>
8
8
  <string>en</string>
9
9
  <key>CFBundleExecutable</key>
@@ -17,7 +17,7 @@
17
17
  <key>CFBundlePackageType</key>
18
18
  <string>FMWK</string>
19
19
  <key>CFBundleShortVersionString</key>
20
- <string>0.12.0</string>
20
+ <string>0.12.2</string>
21
21
  <key>CFBundleSignature</key>
22
22
  <string>????</string>
23
23
  <key>CFBundleSupportedPlatforms</key>
@@ -29,7 +29,7 @@
29
29
  <key>DTCompiler</key>
30
30
  <string>com.apple.compilers.llvm.clang.1_0</string>
31
31
  <key>DTPlatformBuild</key>
32
- <string>7D175</string>
32
+ <string>7D1014</string>
33
33
  <key>DTPlatformVersion</key>
34
34
  <string>GM</string>
35
35
  <key>DTSDKBuild</key>
@@ -37,9 +37,9 @@
37
37
  <key>DTSDKName</key>
38
38
  <string>macosx10.11</string>
39
39
  <key>DTXcode</key>
40
- <string>0730</string>
40
+ <string>0731</string>
41
41
  <key>DTXcodeBuild</key>
42
- <string>7D175</string>
42
+ <string>7D1014</string>
43
43
  <key>NSHumanReadableCopyright</key>
44
44
  <string>Copyright © 2015 SourceKitten. All rights reserved.</string>
45
45
  </dict>
data/lib/jazzy/config.rb CHANGED
@@ -159,7 +159,7 @@ module Jazzy
159
159
 
160
160
  config_attr :swift_version,
161
161
  command_line: '--swift-version VERSION',
162
- default: '2.2',
162
+ default: nil,
163
163
  parse: ->(v) do
164
164
  raise 'jazzy only supports Swift 2.0 or later.' if v.to_f < 2
165
165
  v
data/lib/jazzy/doc.rb CHANGED
File without changes
@@ -284,19 +284,20 @@ module Jazzy
284
284
  # Combine abstract and discussion into abstract
285
285
  abstract = (item.abstract || '') + (item.discussion || '')
286
286
  item_render = {
287
- name: item.name,
288
- abstract: render_markdown(abstract),
289
- declaration: item.declaration,
290
- usr: item.usr,
291
- dash_type: item.type.dash_type,
292
- github_token_url: gh_token_url(item, source_module),
293
- default_impl_abstract: render_markdown(item.default_impl_abstract),
294
- from_protocol_extension: item.from_protocol_extension,
295
- return: render_markdown(item.return),
296
- parameters: (item.parameters if item.parameters.any?),
297
- url: (item.url if item.children.any?),
298
- start_line: item.start_line,
299
- end_line: item.end_line,
287
+ name: item.name,
288
+ abstract: render_markdown(abstract),
289
+ declaration: item.declaration,
290
+ other_language_declaration: item.other_language_declaration,
291
+ usr: item.usr,
292
+ dash_type: item.type.dash_type,
293
+ github_token_url: gh_token_url(item, source_module),
294
+ default_impl_abstract: render_markdown(item.default_impl_abstract),
295
+ from_protocol_extension: item.from_protocol_extension,
296
+ return: render_markdown(item.return),
297
+ parameters: (item.parameters if item.parameters.any?),
298
+ url: (item.url if item.children.any?),
299
+ start_line: item.start_line,
300
+ end_line: item.end_line,
300
301
  }
301
302
  item_render.reject { |_, v| v.nil? }
302
303
  end
@@ -1,3 +1,3 @@
1
1
  module Jazzy
2
- VERSION = '0.6.0'.freeze unless defined? Jazzy::VERSION
2
+ VERSION = '0.6.1'.freeze unless defined? Jazzy::VERSION
3
3
  end
@@ -8,10 +8,10 @@ module Jazzy
8
8
  include Rouge::Plugins::Redcarpet
9
9
 
10
10
  def header(text, header_level)
11
- text_slug = text.gsub(/[^a-zA-Z0-9]+/, '_')
11
+ text_slug = text.gsub(/[^\w]+/, '-')
12
12
  .downcase
13
- .sub(/^_/, '')
14
- .sub(/_$/, '')
13
+ .sub(/^-/, '')
14
+ .sub(/-$/, '')
15
15
 
16
16
  "<a href='##{text_slug}' class='anchor' aria-hidden=true>" \
17
17
  '<span class="header-anchor"></span>' \
@@ -54,6 +54,7 @@ module Jazzy
54
54
  attr_accessor :usr
55
55
  attr_accessor :name
56
56
  attr_accessor :declaration
57
+ attr_accessor :other_language_declaration
57
58
  attr_accessor :abstract
58
59
  attr_accessor :default_impl_abstract
59
60
  attr_accessor :from_protocol_extension
@@ -104,6 +104,10 @@ module Jazzy
104
104
  TYPES = {
105
105
  # Objective-C
106
106
 
107
+ 'sourcekitten.source.lang.objc.decl.unexposed' => {
108
+ jazzy: 'Unexposed',
109
+ dash: 'Unexposed',
110
+ }.freeze,
107
111
  'sourcekitten.source.lang.objc.decl.category' => {
108
112
  jazzy: 'Category',
109
113
  dash: 'Extension',
@@ -134,9 +134,12 @@ module Jazzy
134
134
 
135
135
  # Run sourcekitten with given arguments and return STDOUT
136
136
  def self.run_sourcekitten(arguments)
137
- swift_version = Config.instance.swift_version
138
- unless xcode = XCInvoke::Xcode.find_swift_version(swift_version)
139
- raise "Unable to find an Xcode with swift version #{swift_version}."
137
+ if swift_version = Config.instance.swift_version
138
+ unless xcode = XCInvoke::Xcode.find_swift_version(swift_version)
139
+ raise "Unable to find an Xcode with swift version #{swift_version}."
140
+ end
141
+ else
142
+ xcode = XCInvoke::Xcode.selected
140
143
  end
141
144
  bin_path = Pathname(__FILE__).parent + 'SourceKitten/bin/sourcekitten'
142
145
  output, = Executable.execute_command(bin_path, arguments, true,
@@ -169,7 +172,8 @@ module Jazzy
169
172
  return true if type.swift_enum_element?
170
173
  if type.swift_extension?
171
174
  return Array(doc['key.substructure']).any? do |subdoc|
172
- should_document?(subdoc)
175
+ subtype = SourceDeclaration::Type.new(subdoc['key.kind'])
176
+ !subtype.mark? && should_document?(subdoc)
173
177
  end
174
178
  end
175
179
 
@@ -213,6 +217,8 @@ module Jazzy
213
217
  end
214
218
  end
215
219
 
220
+ # rubocop:disable Metrics/CyclomaticComplexity
221
+ # rubocop:disable Metrics/PerceivedComplexity
216
222
  def self.make_doc_info(doc, declaration)
217
223
  return unless should_document?(doc)
218
224
  unless doc['key.doc.full_as_xml']
@@ -225,6 +231,11 @@ module Jazzy
225
231
  doc['key.parsed_declaration'] || doc['key.doc.declaration'],
226
232
  Config.instance.objc_mode ? 'objc' : 'swift',
227
233
  )
234
+ if Config.instance.objc_mode && doc['key.swift_declaration']
235
+ declaration.other_language_declaration = Highlighter.highlight(
236
+ doc['key.swift_declaration'], 'swift'
237
+ )
238
+ end
228
239
  declaration.abstract = Jazzy.markdown.render(doc['key.doc.comment'] || '')
229
240
  declaration.discussion = ''
230
241
  declaration.return = make_paragraphs(doc, 'key.doc.result_discussion')
@@ -233,6 +244,8 @@ module Jazzy
233
244
 
234
245
  @documented_count += 1
235
246
  end
247
+ # rubocop:enable Metrics/CyclomaticComplexity
248
+ # rubocop:enable Metrics/PerceivedComplexity
236
249
 
237
250
  def self.make_substructure(doc, declaration)
238
251
  if doc['key.substructure']
@@ -53,6 +53,12 @@
53
53
  <p class="aside-title">{{language}}</p>
54
54
  {{{declaration}}}
55
55
  </div>
56
+ {{#other_language_declaration}}
57
+ <div class="language">
58
+ <p class="aside-title">Swift</p>
59
+ {{{other_language_declaration}}}
60
+ </div>
61
+ {{/other_language_declaration}}
56
62
  </div>
57
63
  {{/declaration}}
58
64
  {{#parameters.count}}
@@ -53,6 +53,12 @@
53
53
  <p class="aside-title">{{language}}</p>
54
54
  {{{declaration}}}
55
55
  </div>
56
+ {{#other_language_declaration}}
57
+ <div class="language">
58
+ <p class="aside-title">Swift</p>
59
+ {{{other_language_declaration}}}
60
+ </div>
61
+ {{/other_language_declaration}}
56
62
  </div>
57
63
  {{/declaration}}
58
64
  {{#parameters.count}}
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.6.0
4
+ version: 0.6.1
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: 2016-04-06 00:00:00.000000000 Z
13
+ date: 2016-05-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: cocoapods
@@ -191,6 +191,7 @@ files:
191
191
  - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftDarwin.dylib
192
192
  - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftDispatch.dylib
193
193
  - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftFoundation.dylib
194
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftIOKit.dylib
194
195
  - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftObjectiveC.dylib
195
196
  - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Resources/Info.plist
196
197
  - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/SourceKittenFramework