-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Swift 1.2 #213
Support Swift 1.2 #213
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,25 @@ | ||
## 0.2.0 | ||
|
||
##### Breaking | ||
|
||
* Jazzy now only supports projects using Swift 1.2. | ||
[JP Simard](https://github.com/jpsim) | ||
[#170](https://github.com/realm/jazzy/issues/170) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. newline |
||
* Increase default minimum ACL to public. | ||
[JP Simard](https://github.com/jpsim) | ||
[#186](https://github.com/realm/jazzy/issues/186) | ||
|
||
##### Enhancements | ||
|
||
* Use key.accessibility to determine ACL. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. either surround |
||
[JP Simard](https://github.com/jpsim) | ||
[#185](https://github.com/realm/jazzy/issues/185) | ||
|
||
##### Bug Fixes | ||
|
||
* None. | ||
|
||
|
||
## 0.1.6 | ||
|
||
##### Breaking | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Versions/Current/Resources |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Versions/Current/SWXMLHash |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>BuildMachineOSBuild</key> | ||
<string>14D136</string> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>en</string> | ||
<key>CFBundleExecutable</key> | ||
<string>SWXMLHash</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>drmohundro.SWXMLHash</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>SWXMLHash</string> | ||
<key>CFBundlePackageType</key> | ||
<string>FMWK</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
<key>DTCompiler</key> | ||
<string>com.apple.compilers.llvm.clang.1_0</string> | ||
<key>DTPlatformBuild</key> | ||
<string>6D1002</string> | ||
<key>DTPlatformVersion</key> | ||
<string>GM</string> | ||
<key>DTSDKBuild</key> | ||
<string>14D125</string> | ||
<key>DTSDKName</key> | ||
<string>macosx10.10</string> | ||
<key>DTXcode</key> | ||
<string>0631</string> | ||
<key>DTXcodeBuild</key> | ||
<string>6D1002</string> | ||
<key>UIDeviceFamily</key> | ||
<array> | ||
<integer>1</integer> | ||
<integer>2</integer> | ||
</array> | ||
</dict> | ||
</plist> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
A |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,26 +5,52 @@ class AccessControlLevel | |
|
||
attr_reader :level | ||
|
||
def initialize(declaration_string) | ||
if declaration_string =~ /private\ / | ||
ACCESSIBILITY_PRIVATE = 'source.lang.swift.accessibility.private' | ||
ACCESSIBILITY_INTERNAL = 'source.lang.swift.accessibility.internal' | ||
ACCESSIBILITY_PUBLIC = 'source.lang.swift.accessibility.public' | ||
|
||
def initialize(accessibility) | ||
if accessibility == ACCESSIBILITY_PRIVATE | ||
@level = :private | ||
elsif declaration_string =~ /public\ / | ||
@level = :public | ||
else | ||
elsif accessibility == ACCESSIBILITY_INTERNAL | ||
@level = :internal | ||
elsif accessibility == ACCESSIBILITY_PUBLIC | ||
@level = :public | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should probably throw an exception if its something unexpected? |
||
end | ||
|
||
def self.from_doc(doc) | ||
accessibility = doc['key.accessibility'] | ||
if accessibility | ||
acl = new(accessibility) | ||
if acl | ||
return acl | ||
end | ||
end | ||
acl = from_explicit_declaration(doc['key.parsed_declaration']) | ||
acl || AccessControlLevel.public # fallback on public ACL | ||
end | ||
|
||
def self.from_explicit_declaration(declaration_string) | ||
if declaration_string =~ /private\ / | ||
return AccessControlLevel.private | ||
elsif declaration_string =~ /public\ / | ||
return AccessControlLevel.public | ||
elsif declaration_string =~ /internal\ / | ||
return AccessControlLevel.internal | ||
end | ||
end | ||
|
||
def self.private | ||
AccessControlLevel.new('private ') | ||
new(ACCESSIBILITY_PRIVATE) | ||
end | ||
|
||
def self.internal | ||
AccessControlLevel.new('internal ') | ||
new(ACCESSIBILITY_INTERNAL) | ||
end | ||
|
||
def self.public | ||
AccessControlLevel.new('public ') | ||
new(ACCESSIBILITY_PUBLIC) | ||
end | ||
|
||
LEVELS = { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are two spaces.