Skip to content

Commit

Permalink
fix rubocop issues & print xcodebuild command in error type warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsim committed Aug 26, 2015
1 parent 3151e93 commit 6cfe960
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
6 changes: 4 additions & 2 deletions lib/jazzy/source_declaration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

module Jazzy
class SourceDeclaration
attr_accessor :type # kind of declaration (e.g. class, variable, function)
attr_accessor :typename # static type of declared element (e.g. String.Type -> ())
# kind of declaration (e.g. class, variable, function)
attr_accessor :type
# static type of declared element (e.g. String.Type -> ())
attr_accessor :typename
attr_accessor :file
attr_accessor :line
attr_accessor :column
Expand Down
15 changes: 9 additions & 6 deletions lib/jazzy/sourcekitten.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'json'
require 'pathname'
require 'shellwords'
require 'xcinvoke'

require 'jazzy/config'
Expand Down Expand Up @@ -27,6 +28,7 @@ def self.group_docs(docs, type)
docs
end

# rubocop:disable Metrics/MethodLength
# Generate doc URL by prepending its parents URLs
# @return [Hash] input docs with URLs
def self.make_doc_urls(docs, parents)
Expand All @@ -39,12 +41,12 @@ def self.make_doc_urls(docs, parents)
else
# Don't create HTML page for this doc if it doesn't have children
# Instead, make its link a hash-link on its parent's page
if doc.typename == "<<error type>>"
warn "A compile error prevented " +
(parents[1..-1] + [doc]).map(&:name).join('.') +
" from receiving a unique USR. Documentation may be incomplete. " \
"Please check for compile errors by running `xcodebuild` along with "\
"any arguments passed to jazzy's `-x` or `--xcodebuild-arguments`."
if doc.typename == '<<error type>>'
warn 'A compile error prevented ' +
(parents[1..-1] + [doc.name]).join('.') + ' from receiving a ' \
'unique USR. Documentation may be incomplete. Please check for ' \
'compile errors by running `xcodebuild ' \
"#{Config.instance.xcodebuild_arguments.shelljoin}`."
end
id = doc.usr
unless id
Expand All @@ -60,6 +62,7 @@ def self.make_doc_urls(docs, parents)
end
end
end
# rubocop:enable Metrics/MethodLength

# Run sourcekitten with given arguments and return STDOUT
def self.run_sourcekitten(arguments)
Expand Down
2 changes: 1 addition & 1 deletion spec/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
'--root-url https://realm.io/docs/swift/' \
"#{realm_version}/api/ " \
'--xcodebuild-arguments ' \
'"-project,RealmSwift.xcodeproj,-dry-run" '
'-project,RealmSwift.xcodeproj,-dry-run'
end

describe 'Creates docs for a podspec with dependencies and subspecs' do
Expand Down
2 changes: 1 addition & 1 deletion spec/integration_specs

0 comments on commit 6cfe960

Please sign in to comment.