Class: Jazzy::PodspecDocumenter
- Inherits:
-
Object
- Object
- Jazzy::PodspecDocumenter
- Defined in:
- lib/jazzy/podspec_documenter.rb
Instance Attribute Summary collapse
-
#podspec ⇒ Object
readonly
Returns the value of attribute podspec.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(podspec) ⇒ PodspecDocumenter
constructor
A new instance of PodspecDocumenter.
- #sourcekitten_output ⇒ Object
Constructor Details
#initialize(podspec) ⇒ PodspecDocumenter
Returns a new instance of PodspecDocumenter.
8 9 10 |
# File 'lib/jazzy/podspec_documenter.rb', line 8 def initialize(podspec) @podspec = podspec end |
Instance Attribute Details
#podspec ⇒ Object (readonly)
Returns the value of attribute podspec.
6 7 8 |
# File 'lib/jazzy/podspec_documenter.rb', line 6 def podspec @podspec end |
Class Method Details
.configure(config, podspec) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/jazzy/podspec_documenter.rb', line 26 def self.configure(config, podspec) case podspec when Pathname, String require 'cocoapods' podspec = Pod::Specification.from_file(podspec) end return unless podspec config. = (podspec) config.module_name = podspec.module_name config. = podspec.homepage || github_file_prefix(podspec) config.version = podspec.version.to_s config.github_file_prefix = github_file_prefix(podspec) podspec end |
Instance Method Details
#sourcekitten_output ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/jazzy/podspec_documenter.rb', line 12 def sourcekitten_output sandbox = Pod::Sandbox.new(pod_config.sandbox_root) installer = Pod::Installer.new(sandbox, podfile) installer.install! stdout = Dir.chdir(sandbox.root) do pod_targets.map do |t| SourceKitten.run_sourcekitten( %W(doc --module-name #{podspec.module_name} -target #{t}), ) end end stdout.reduce([]) { |a, s| a + JSON.load(s) }.to_json end |