xcunique 0.0.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 +7 -0
  2. data/.gitignore +23 -0
  3. data/Gemfile +4 -0
  4. data/Guardfile +22 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +73 -0
  7. data/Rakefile +11 -0
  8. data/bin/xcunique +5 -0
  9. data/lib/json2plist/json2plist +21 -0
  10. data/lib/xcunique.rb +23 -0
  11. data/lib/xcunique/cli.rb +40 -0
  12. data/lib/xcunique/hash_ext.rb +25 -0
  13. data/lib/xcunique/helpers.rb +26 -0
  14. data/lib/xcunique/options.rb +68 -0
  15. data/lib/xcunique/parser.rb +54 -0
  16. data/lib/xcunique/sorter.rb +51 -0
  17. data/lib/xcunique/uniquifier.rb +36 -0
  18. data/lib/xcunique/version.rb +3 -0
  19. data/spec/fixtures/TestProject.json +548 -0
  20. data/spec/fixtures/TestProject/TestProject.xcodeproj/project.pbxproj +510 -0
  21. data/spec/fixtures/TestProject/TestProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  22. data/spec/fixtures/TestProject/TestProject.xcodeproj/project.xcworkspace/xcuserdata/paul.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  23. data/spec/fixtures/TestProject/TestProject.xcodeproj/xcuserdata/paul.xcuserdatad/xcschemes/TestProject.xcscheme +111 -0
  24. data/spec/fixtures/TestProject/TestProject.xcodeproj/xcuserdata/paul.xcuserdatad/xcschemes/xcschememanagement.plist +47 -0
  25. data/spec/fixtures/TestProject/TestProject/AppDelegate.swift +46 -0
  26. data/spec/fixtures/TestProject/TestProject/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
  27. data/spec/fixtures/TestProject/TestProject/Base.lproj/LaunchScreen.storyboard +27 -0
  28. data/spec/fixtures/TestProject/TestProject/Base.lproj/Main.storyboard +26 -0
  29. data/spec/fixtures/TestProject/TestProject/Info.plist +47 -0
  30. data/spec/fixtures/TestProject/TestProject/ViewController.swift +25 -0
  31. data/spec/fixtures/TestProject/TestProjectTests/Info.plist +24 -0
  32. data/spec/fixtures/TestProject/TestProjectTests/TestProjectTests.swift +36 -0
  33. data/spec/fixtures/TestProject/TestProjectUITests/Info.plist +24 -0
  34. data/spec/fixtures/TestProject/TestProjectUITests/TestProjectUITests.swift +36 -0
  35. data/spec/spec_helper.rb +4 -0
  36. data/spec/xcunique/hash_ext_spec.rb +36 -0
  37. data/spec/xcunique/helpers_spec.rb +58 -0
  38. data/spec/xcunique/parser_spec.rb +214 -0
  39. data/spec/xcunique/sorter_spec.rb +116 -0
  40. data/xcunique.gemspec +26 -0
  41. metadata +178 -0
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ <FileRef
5
+ location = "self:TestProject.xcodeproj">
6
+ </FileRef>
7
+ </Workspace>
@@ -0,0 +1,111 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Scheme
3
+ LastUpgradeVersion = "0710"
4
+ version = "1.3">
5
+ <BuildAction
6
+ parallelizeBuildables = "YES"
7
+ buildImplicitDependencies = "YES">
8
+ <BuildActionEntries>
9
+ <BuildActionEntry
10
+ buildForTesting = "YES"
11
+ buildForRunning = "YES"
12
+ buildForProfiling = "YES"
13
+ buildForArchiving = "YES"
14
+ buildForAnalyzing = "YES">
15
+ <BuildableReference
16
+ BuildableIdentifier = "primary"
17
+ BlueprintIdentifier = "DACE56911C24A14D00E6ABB0"
18
+ BuildableName = "TestProject.app"
19
+ BlueprintName = "TestProject"
20
+ ReferencedContainer = "container:TestProject.xcodeproj">
21
+ </BuildableReference>
22
+ </BuildActionEntry>
23
+ </BuildActionEntries>
24
+ </BuildAction>
25
+ <TestAction
26
+ buildConfiguration = "Debug"
27
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
+ shouldUseLaunchSchemeArgsEnv = "YES">
30
+ <Testables>
31
+ <TestableReference
32
+ skipped = "NO">
33
+ <BuildableReference
34
+ BuildableIdentifier = "primary"
35
+ BlueprintIdentifier = "DACE56A51C24A14D00E6ABB0"
36
+ BuildableName = "TestProjectTests.xctest"
37
+ BlueprintName = "TestProjectTests"
38
+ ReferencedContainer = "container:TestProject.xcodeproj">
39
+ </BuildableReference>
40
+ </TestableReference>
41
+ <TestableReference
42
+ skipped = "NO">
43
+ <BuildableReference
44
+ BuildableIdentifier = "primary"
45
+ BlueprintIdentifier = "DACE56B01C24A14D00E6ABB0"
46
+ BuildableName = "TestProjectUITests.xctest"
47
+ BlueprintName = "TestProjectUITests"
48
+ ReferencedContainer = "container:TestProject.xcodeproj">
49
+ </BuildableReference>
50
+ </TestableReference>
51
+ </Testables>
52
+ <MacroExpansion>
53
+ <BuildableReference
54
+ BuildableIdentifier = "primary"
55
+ BlueprintIdentifier = "DACE56911C24A14D00E6ABB0"
56
+ BuildableName = "TestProject.app"
57
+ BlueprintName = "TestProject"
58
+ ReferencedContainer = "container:TestProject.xcodeproj">
59
+ </BuildableReference>
60
+ </MacroExpansion>
61
+ <AdditionalOptions>
62
+ </AdditionalOptions>
63
+ </TestAction>
64
+ <LaunchAction
65
+ buildConfiguration = "Debug"
66
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
67
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
68
+ launchStyle = "0"
69
+ useCustomWorkingDirectory = "NO"
70
+ ignoresPersistentStateOnLaunch = "NO"
71
+ debugDocumentVersioning = "YES"
72
+ debugServiceExtension = "internal"
73
+ allowLocationSimulation = "YES">
74
+ <BuildableProductRunnable
75
+ runnableDebuggingMode = "0">
76
+ <BuildableReference
77
+ BuildableIdentifier = "primary"
78
+ BlueprintIdentifier = "DACE56911C24A14D00E6ABB0"
79
+ BuildableName = "TestProject.app"
80
+ BlueprintName = "TestProject"
81
+ ReferencedContainer = "container:TestProject.xcodeproj">
82
+ </BuildableReference>
83
+ </BuildableProductRunnable>
84
+ <AdditionalOptions>
85
+ </AdditionalOptions>
86
+ </LaunchAction>
87
+ <ProfileAction
88
+ buildConfiguration = "Release"
89
+ shouldUseLaunchSchemeArgsEnv = "YES"
90
+ savedToolIdentifier = ""
91
+ useCustomWorkingDirectory = "NO"
92
+ debugDocumentVersioning = "YES">
93
+ <BuildableProductRunnable
94
+ runnableDebuggingMode = "0">
95
+ <BuildableReference
96
+ BuildableIdentifier = "primary"
97
+ BlueprintIdentifier = "DACE56911C24A14D00E6ABB0"
98
+ BuildableName = "TestProject.app"
99
+ BlueprintName = "TestProject"
100
+ ReferencedContainer = "container:TestProject.xcodeproj">
101
+ </BuildableReference>
102
+ </BuildableProductRunnable>
103
+ </ProfileAction>
104
+ <AnalyzeAction
105
+ buildConfiguration = "Debug">
106
+ </AnalyzeAction>
107
+ <ArchiveAction
108
+ buildConfiguration = "Release"
109
+ revealArchiveInOrganizer = "YES">
110
+ </ArchiveAction>
111
+ </Scheme>
@@ -0,0 +1,47 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>SchemeUserState</key>
6
+ <dict>
7
+ <key>TestProject.xcscheme</key>
8
+ <dict>
9
+ <key>orderHint</key>
10
+ <integer>0</integer>
11
+ </dict>
12
+ </dict>
13
+ <key>SuppressBuildableAutocreation</key>
14
+ <dict>
15
+ <key>52eb05e8030b69d64a3f9181a357448c</key>
16
+ <dict>
17
+ <key>primary</key>
18
+ <true/>
19
+ </dict>
20
+ <key>979d0d142284299eeebeb01900864f1f</key>
21
+ <dict>
22
+ <key>primary</key>
23
+ <true/>
24
+ </dict>
25
+ <key>DACE56911C24A14D00E6ABB0</key>
26
+ <dict>
27
+ <key>primary</key>
28
+ <true/>
29
+ </dict>
30
+ <key>DACE56A51C24A14D00E6ABB0</key>
31
+ <dict>
32
+ <key>primary</key>
33
+ <true/>
34
+ </dict>
35
+ <key>DACE56B01C24A14D00E6ABB0</key>
36
+ <dict>
37
+ <key>primary</key>
38
+ <true/>
39
+ </dict>
40
+ <key>a1020a4dd71e9b25d987a18580d8388b</key>
41
+ <dict>
42
+ <key>primary</key>
43
+ <true/>
44
+ </dict>
45
+ </dict>
46
+ </dict>
47
+ </plist>
@@ -0,0 +1,46 @@
1
+ //
2
+ // AppDelegate.swift
3
+ // TestProject
4
+ //
5
+ // Created by Paul Samuels on 18/12/2015.
6
+ // Copyright © 2015 Paul Samuels. All rights reserved.
7
+ //
8
+
9
+ import UIKit
10
+
11
+ @UIApplicationMain
12
+ class AppDelegate: UIResponder, UIApplicationDelegate {
13
+
14
+ var window: UIWindow?
15
+
16
+
17
+ func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
18
+ // Override point for customization after application launch.
19
+ return true
20
+ }
21
+
22
+ func applicationWillResignActive(application: UIApplication) {
23
+ // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24
+ // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
25
+ }
26
+
27
+ func applicationDidEnterBackground(application: UIApplication) {
28
+ // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29
+ // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30
+ }
31
+
32
+ func applicationWillEnterForeground(application: UIApplication) {
33
+ // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34
+ }
35
+
36
+ func applicationDidBecomeActive(application: UIApplication) {
37
+ // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38
+ }
39
+
40
+ func applicationWillTerminate(application: UIApplication) {
41
+ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42
+ }
43
+
44
+
45
+ }
46
+
@@ -0,0 +1,68 @@
1
+ {
2
+ "images" : [
3
+ {
4
+ "idiom" : "iphone",
5
+ "size" : "29x29",
6
+ "scale" : "2x"
7
+ },
8
+ {
9
+ "idiom" : "iphone",
10
+ "size" : "29x29",
11
+ "scale" : "3x"
12
+ },
13
+ {
14
+ "idiom" : "iphone",
15
+ "size" : "40x40",
16
+ "scale" : "2x"
17
+ },
18
+ {
19
+ "idiom" : "iphone",
20
+ "size" : "40x40",
21
+ "scale" : "3x"
22
+ },
23
+ {
24
+ "idiom" : "iphone",
25
+ "size" : "60x60",
26
+ "scale" : "2x"
27
+ },
28
+ {
29
+ "idiom" : "iphone",
30
+ "size" : "60x60",
31
+ "scale" : "3x"
32
+ },
33
+ {
34
+ "idiom" : "ipad",
35
+ "size" : "29x29",
36
+ "scale" : "1x"
37
+ },
38
+ {
39
+ "idiom" : "ipad",
40
+ "size" : "29x29",
41
+ "scale" : "2x"
42
+ },
43
+ {
44
+ "idiom" : "ipad",
45
+ "size" : "40x40",
46
+ "scale" : "1x"
47
+ },
48
+ {
49
+ "idiom" : "ipad",
50
+ "size" : "40x40",
51
+ "scale" : "2x"
52
+ },
53
+ {
54
+ "idiom" : "ipad",
55
+ "size" : "76x76",
56
+ "scale" : "1x"
57
+ },
58
+ {
59
+ "idiom" : "ipad",
60
+ "size" : "76x76",
61
+ "scale" : "2x"
62
+ }
63
+ ],
64
+ "info" : {
65
+ "version" : 1,
66
+ "author" : "xcode"
67
+ }
68
+ }
@@ -0,0 +1,27 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
3
+ <dependencies>
4
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
5
+ </dependencies>
6
+ <scenes>
7
+ <!--View Controller-->
8
+ <scene sceneID="EHf-IW-A2E">
9
+ <objects>
10
+ <viewController id="01J-lp-oVM" sceneMemberID="viewController">
11
+ <layoutGuides>
12
+ <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
13
+ <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
14
+ </layoutGuides>
15
+ <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
16
+ <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
17
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18
+ <animations/>
19
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
20
+ </view>
21
+ </viewController>
22
+ <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
23
+ </objects>
24
+ <point key="canvasLocation" x="53" y="375"/>
25
+ </scene>
26
+ </scenes>
27
+ </document>
@@ -0,0 +1,26 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
3
+ <dependencies>
4
+ <deployment identifier="iOS"/>
5
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
6
+ </dependencies>
7
+ <scenes>
8
+ <!--View Controller-->
9
+ <scene sceneID="tne-QT-ifu">
10
+ <objects>
11
+ <viewController id="BYZ-38-t0r" customClass="ViewController" customModule="TestProject" customModuleProvider="target" sceneMemberID="viewController">
12
+ <layoutGuides>
13
+ <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
14
+ <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
15
+ </layoutGuides>
16
+ <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
17
+ <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
18
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
20
+ </view>
21
+ </viewController>
22
+ <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
23
+ </objects>
24
+ </scene>
25
+ </scenes>
26
+ </document>
@@ -0,0 +1,47 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>en</string>
7
+ <key>CFBundleExecutable</key>
8
+ <string>$(EXECUTABLE_NAME)</string>
9
+ <key>CFBundleIdentifier</key>
10
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11
+ <key>CFBundleInfoDictionaryVersion</key>
12
+ <string>6.0</string>
13
+ <key>CFBundleName</key>
14
+ <string>$(PRODUCT_NAME)</string>
15
+ <key>CFBundlePackageType</key>
16
+ <string>APPL</string>
17
+ <key>CFBundleShortVersionString</key>
18
+ <string>1.0</string>
19
+ <key>CFBundleSignature</key>
20
+ <string>????</string>
21
+ <key>CFBundleVersion</key>
22
+ <string>1</string>
23
+ <key>LSRequiresIPhoneOS</key>
24
+ <true/>
25
+ <key>UILaunchStoryboardName</key>
26
+ <string>LaunchScreen</string>
27
+ <key>UIMainStoryboardFile</key>
28
+ <string>Main</string>
29
+ <key>UIRequiredDeviceCapabilities</key>
30
+ <array>
31
+ <string>armv7</string>
32
+ </array>
33
+ <key>UISupportedInterfaceOrientations</key>
34
+ <array>
35
+ <string>UIInterfaceOrientationPortrait</string>
36
+ <string>UIInterfaceOrientationLandscapeLeft</string>
37
+ <string>UIInterfaceOrientationLandscapeRight</string>
38
+ </array>
39
+ <key>UISupportedInterfaceOrientations~ipad</key>
40
+ <array>
41
+ <string>UIInterfaceOrientationPortrait</string>
42
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
43
+ <string>UIInterfaceOrientationLandscapeLeft</string>
44
+ <string>UIInterfaceOrientationLandscapeRight</string>
45
+ </array>
46
+ </dict>
47
+ </plist>
@@ -0,0 +1,25 @@
1
+ //
2
+ // ViewController.swift
3
+ // TestProject
4
+ //
5
+ // Created by Paul Samuels on 18/12/2015.
6
+ // Copyright © 2015 Paul Samuels. All rights reserved.
7
+ //
8
+
9
+ import UIKit
10
+
11
+ class ViewController: UIViewController {
12
+
13
+ override func viewDidLoad() {
14
+ super.viewDidLoad()
15
+ // Do any additional setup after loading the view, typically from a nib.
16
+ }
17
+
18
+ override func didReceiveMemoryWarning() {
19
+ super.didReceiveMemoryWarning()
20
+ // Dispose of any resources that can be recreated.
21
+ }
22
+
23
+
24
+ }
25
+
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>en</string>
7
+ <key>CFBundleExecutable</key>
8
+ <string>$(EXECUTABLE_NAME)</string>
9
+ <key>CFBundleIdentifier</key>
10
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11
+ <key>CFBundleInfoDictionaryVersion</key>
12
+ <string>6.0</string>
13
+ <key>CFBundleName</key>
14
+ <string>$(PRODUCT_NAME)</string>
15
+ <key>CFBundlePackageType</key>
16
+ <string>BNDL</string>
17
+ <key>CFBundleShortVersionString</key>
18
+ <string>1.0</string>
19
+ <key>CFBundleSignature</key>
20
+ <string>????</string>
21
+ <key>CFBundleVersion</key>
22
+ <string>1</string>
23
+ </dict>
24
+ </plist>
@@ -0,0 +1,36 @@
1
+ //
2
+ // TestProjectTests.swift
3
+ // TestProjectTests
4
+ //
5
+ // Created by Paul Samuels on 18/12/2015.
6
+ // Copyright © 2015 Paul Samuels. All rights reserved.
7
+ //
8
+
9
+ import XCTest
10
+ @testable import TestProject
11
+
12
+ class TestProjectTests: XCTestCase {
13
+
14
+ override func setUp() {
15
+ super.setUp()
16
+ // Put setup code here. This method is called before the invocation of each test method in the class.
17
+ }
18
+
19
+ override func tearDown() {
20
+ // Put teardown code here. This method is called after the invocation of each test method in the class.
21
+ super.tearDown()
22
+ }
23
+
24
+ func testExample() {
25
+ // This is an example of a functional test case.
26
+ // Use XCTAssert and related functions to verify your tests produce the correct results.
27
+ }
28
+
29
+ func testPerformanceExample() {
30
+ // This is an example of a performance test case.
31
+ self.measureBlock {
32
+ // Put the code you want to measure the time of here.
33
+ }
34
+ }
35
+
36
+ }