Class: Danger::DangerXcodeproj
- Inherits:
-
Plugin
- Object
- Plugin
- Danger::DangerXcodeproj
- Defined in:
- lib/xcodeproj/plugin.rb
Overview
This is your plugin class. Any attributes or methods you expose here will be available from within your Dangerfile.
To be published on the Danger plugins site, you will need to have the public interface documented. Danger uses [YARD](yardoc.org/) for generating documentation from your plugin source, and you can verify by running ‘danger plugins lint` or `bundle exec rake spec`.
You should replace these comments with a public description of your library.
Instance Attribute Summary collapse
-
#project ⇒ Project
Xcode project object.
Instance Method Summary collapse
-
#open(path = nil) ⇒ void
Opens Xcode project file using the given path.
-
#target_attributes ⇒ Array<TargetAttributes>
Targets Attributes in Xcode Project file.
-
#targets ⇒ Array<Target>
Targets in Xcode Project file.
Instance Attribute Details
#project ⇒ Project
Xcode project object
27 28 29 |
# File 'lib/xcodeproj/plugin.rb', line 27 def project @project end |
Instance Method Details
#open(path = nil) ⇒ void
This method returns an undefined value.
Opens Xcode project file using the given path
33 34 35 36 37 38 |
# File 'lib/xcodeproj/plugin.rb', line 33 def open(path=nil) # Fails if Xcode project file path is not provided raise "Xcode project file path in not set!" unless !path.nil? @project = Xcodeproj::Project.open(path) end |
#target_attributes ⇒ Array<TargetAttributes>
Targets Attributes in Xcode Project file
54 55 56 57 58 |
# File 'lib/xcodeproj/plugin.rb', line 54 def target_attributes raise "Xcode project is not opened!" if project.nil? @project.root_object.attributes["TargetAttributes"] end |
#targets ⇒ Array<Target>
Targets in Xcode Project file
44 45 46 47 48 |
# File 'lib/xcodeproj/plugin.rb', line 44 def targets raise "Xcode project is not opened!" if @project.nil? @project.targets end |