Skip to content

Commit dc43254

Browse files
authored
No longer requires admin permissions to run plugin. (#12)
Updated plugin to use framework instead of separate app so as not to require admin permissions.
1 parent a1e5a74 commit dc43254

File tree

538 files changed

+2857
-47605
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

538 files changed

+2857
-47605
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/DateTools

sketch-plugin-manager.sketchplugin/Contents/Resources/Sketch Plugin Manager.app/Contents/Resources/Carthage/Build/Mac/ObjectiveGit.framework/Headers renamed to sketch-plugin-manager.sketchplugin/Contents/Resources/Frameworks/DateTools.framework/Headers

File renamed without changes.

sketch-plugin-manager.sketchplugin/Contents/Resources/Sketch Plugin Manager.app/Contents/Resources/Carthage/Build/Mac/ObjectiveGit.framework/Modules renamed to sketch-plugin-manager.sketchplugin/Contents/Resources/Frameworks/DateTools.framework/Modules

File renamed without changes.

sketch-plugin-manager.sketchplugin/Contents/Resources/Sketch Plugin Manager.app/Contents/Frameworks/DateToolsSwift.framework/Resources renamed to sketch-plugin-manager.sketchplugin/Contents/Resources/Frameworks/DateTools.framework/Resources

File renamed without changes.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Copyright (C) 2014 by Matthew York
2+
//
3+
// Permission is hereby granted, free of charge, to any
4+
// person obtaining a copy of this software and
5+
// associated documentation files (the "Software"), to
6+
// deal in the Software without restriction, including
7+
// without limitation the rights to use, copy, modify, merge,
8+
// publish, distribute, sublicense, and/or sell copies of the
9+
// Software, and to permit persons to whom the Software is
10+
// furnished to do so, subject to the following conditions:
11+
//
12+
// The above copyright notice and this permission notice shall
13+
// be included in all copies or substantial portions of the Software.
14+
//
15+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17+
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19+
// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20+
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21+
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
23+
#import <Foundation/Foundation.h>
24+
25+
FOUNDATION_EXPORT const long long SECONDS_IN_YEAR;
26+
FOUNDATION_EXPORT const NSInteger SECONDS_IN_MONTH_28;
27+
FOUNDATION_EXPORT const NSInteger SECONDS_IN_MONTH_29;
28+
FOUNDATION_EXPORT const NSInteger SECONDS_IN_MONTH_30;
29+
FOUNDATION_EXPORT const NSInteger SECONDS_IN_MONTH_31;
30+
FOUNDATION_EXPORT const NSInteger SECONDS_IN_WEEK;
31+
FOUNDATION_EXPORT const NSInteger SECONDS_IN_DAY;
32+
FOUNDATION_EXPORT const NSInteger SECONDS_IN_HOUR;
33+
FOUNDATION_EXPORT const NSInteger SECONDS_IN_MINUTE;
34+
FOUNDATION_EXPORT const NSInteger MILLISECONDS_IN_DAY;
35+
#import "DTError.h"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Copyright (C) 2014 by Matthew York
2+
//
3+
// Permission is hereby granted, free of charge, to any
4+
// person obtaining a copy of this software and
5+
// associated documentation files (the "Software"), to
6+
// deal in the Software without restriction, including
7+
// without limitation the rights to use, copy, modify, merge,
8+
// publish, distribute, sublicense, and/or sell copies of the
9+
// Software, and to permit persons to whom the Software is
10+
// furnished to do so, subject to the following conditions:
11+
//
12+
// The above copyright notice and this permission notice shall
13+
// be included in all copies or substantial portions of the Software.
14+
//
15+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17+
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19+
// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20+
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21+
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
23+
#import <Foundation/Foundation.h>
24+
25+
#pragma mark - Domain
26+
extern NSString *const DTErrorDomain;
27+
28+
#pragma mark - Status Codes
29+
static const NSUInteger DTInsertOutOfBoundsException = 0;
30+
static const NSUInteger DTRemoveOutOfBoundsException = 1;
31+
static const NSUInteger DTBadTypeException = 2;
32+
33+
@interface DTError : NSObject
34+
35+
+(void)throwInsertOutOfBoundsException:(NSInteger)index array:(NSArray *)array;
36+
+(void)throwRemoveOutOfBoundsException:(NSInteger)index array:(NSArray *)array;
37+
+(void)throwBadTypeException:(id)obj expectedClass:(Class)classType;
38+
@end
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
// Copyright (C) 2014 by Matthew York
2+
//
3+
// Permission is hereby granted, free of charge, to any
4+
// person obtaining a copy of this software and
5+
// associated documentation files (the "Software"), to
6+
// deal in the Software without restriction, including
7+
// without limitation the rights to use, copy, modify, merge,
8+
// publish, distribute, sublicense, and/or sell copies of the
9+
// Software, and to permit persons to whom the Software is
10+
// furnished to do so, subject to the following conditions:
11+
//
12+
// The above copyright notice and this permission notice shall
13+
// be included in all copies or substantial portions of the Software.
14+
//
15+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17+
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19+
// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20+
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21+
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
23+
#import <Foundation/Foundation.h>
24+
25+
26+
typedef NS_ENUM(NSUInteger, DTTimePeriodRelation){
27+
DTTimePeriodRelationAfter,
28+
DTTimePeriodRelationStartTouching,
29+
DTTimePeriodRelationStartInside,
30+
DTTimePeriodRelationInsideStartTouching,
31+
DTTimePeriodRelationEnclosingStartTouching,
32+
DTTimePeriodRelationEnclosing,
33+
DTTimePeriodRelationEnclosingEndTouching,
34+
DTTimePeriodRelationExactMatch,
35+
DTTimePeriodRelationInside,
36+
DTTimePeriodRelationInsideEndTouching,
37+
DTTimePeriodRelationEndInside,
38+
DTTimePeriodRelationEndTouching,
39+
DTTimePeriodRelationBefore,
40+
DTTimePeriodRelationNone //One or more of the dates does not exist
41+
};
42+
43+
typedef NS_ENUM(NSUInteger, DTTimePeriodSize) {
44+
DTTimePeriodSizeSecond,
45+
DTTimePeriodSizeMinute,
46+
DTTimePeriodSizeHour,
47+
DTTimePeriodSizeDay,
48+
DTTimePeriodSizeWeek,
49+
DTTimePeriodSizeMonth,
50+
DTTimePeriodSizeYear
51+
};
52+
53+
typedef NS_ENUM(NSUInteger, DTTimePeriodInterval) {
54+
DTTimePeriodIntervalOpen,
55+
DTTimePeriodIntervalClosed
56+
};
57+
58+
typedef NS_ENUM(NSUInteger, DTTimePeriodAnchor) {
59+
DTTimePeriodAnchorStart,
60+
DTTimePeriodAnchorCenter,
61+
DTTimePeriodAnchorEnd
62+
};
63+
64+
@interface DTTimePeriod : NSObject
65+
66+
/**
67+
* The start date for a DTTimePeriod representing the starting boundary of the time period
68+
*/
69+
@property (nonatomic,strong) NSDate *StartDate;
70+
71+
/**
72+
* The end date for a DTTimePeriod representing the ending boundary of the time period
73+
*/
74+
@property (nonatomic,strong) NSDate *EndDate;
75+
76+
#pragma mark - Custom Init / Factory Methods
77+
-(instancetype)initWithStartDate:(NSDate *)startDate endDate:(NSDate *)endDate;
78+
+(instancetype)timePeriodWithStartDate:(NSDate *)startDate endDate:(NSDate *)endDate;
79+
+(instancetype)timePeriodWithSize:(DTTimePeriodSize)size startingAt:(NSDate *)date;
80+
+(instancetype)timePeriodWithSize:(DTTimePeriodSize)size amount:(NSInteger)amount startingAt:(NSDate *)date;
81+
+(instancetype)timePeriodWithSize:(DTTimePeriodSize)size endingAt:(NSDate *)date;
82+
+(instancetype)timePeriodWithSize:(DTTimePeriodSize)size amount:(NSInteger)amount endingAt:(NSDate *)date;
83+
+(instancetype)timePeriodWithAllTime;
84+
85+
#pragma mark - Time Period Information
86+
-(BOOL)hasStartDate;
87+
-(BOOL)hasEndDate;
88+
-(BOOL)isMoment;
89+
-(double)durationInYears;
90+
-(double)durationInWeeks;
91+
-(double)durationInDays;
92+
-(double)durationInHours;
93+
-(double)durationInMinutes;
94+
-(double)durationInSeconds;
95+
96+
#pragma mark - Time Period Relationship
97+
-(BOOL)isEqualToPeriod:(DTTimePeriod *)period;
98+
-(BOOL)isInside:(DTTimePeriod *)period;
99+
-(BOOL)contains:(DTTimePeriod *)period;
100+
-(BOOL)overlapsWith:(DTTimePeriod *)period;
101+
-(BOOL)intersects:(DTTimePeriod *)period;
102+
-(DTTimePeriodRelation)relationToPeriod:(DTTimePeriod *)period;
103+
-(NSTimeInterval)gapBetween:(DTTimePeriod *)period;
104+
105+
#pragma mark - Date Relationships
106+
-(BOOL)containsDate:(NSDate *)date interval:(DTTimePeriodInterval)interval;
107+
108+
#pragma mark - Period Manipulation
109+
#pragma mark Shifts
110+
-(void)shiftEarlierWithSize:(DTTimePeriodSize)size;
111+
-(void)shiftEarlierWithSize:(DTTimePeriodSize)size amount:(NSInteger)amount;
112+
-(void)shiftLaterWithSize:(DTTimePeriodSize)size;
113+
-(void)shiftLaterWithSize:(DTTimePeriodSize)size amount:(NSInteger)amount;
114+
115+
#pragma mark Lengthen / Shorten
116+
-(void)lengthenWithAnchorDate:(DTTimePeriodAnchor)anchor size:(DTTimePeriodSize)size;
117+
-(void)lengthenWithAnchorDate:(DTTimePeriodAnchor)anchor size:(DTTimePeriodSize)size amount:(NSInteger)amount;
118+
-(void)shortenWithAnchorDate:(DTTimePeriodAnchor)anchor size:(DTTimePeriodSize)size;
119+
-(void)shortenWithAnchorDate:(DTTimePeriodAnchor)anchor size:(DTTimePeriodSize)size amount:(NSInteger)amount;
120+
121+
#pragma mark - Helper Methods
122+
-(DTTimePeriod *)copy;
123+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright (C) 2014 by Matthew York
2+
//
3+
// Permission is hereby granted, free of charge, to any
4+
// person obtaining a copy of this software and
5+
// associated documentation files (the "Software"), to
6+
// deal in the Software without restriction, including
7+
// without limitation the rights to use, copy, modify, merge,
8+
// publish, distribute, sublicense, and/or sell copies of the
9+
// Software, and to permit persons to whom the Software is
10+
// furnished to do so, subject to the following conditions:
11+
//
12+
// The above copyright notice and this permission notice shall
13+
// be included in all copies or substantial portions of the Software.
14+
//
15+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17+
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19+
// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20+
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21+
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
23+
#import <Foundation/Foundation.h>
24+
#import "DTTimePeriodGroup.h"
25+
26+
@interface DTTimePeriodChain : DTTimePeriodGroup {
27+
DTTimePeriod *First;
28+
DTTimePeriod *Last;
29+
}
30+
31+
@property (nonatomic, readonly) DTTimePeriod *First;
32+
@property (nonatomic, readonly) DTTimePeriod *Last;
33+
34+
#pragma mark - Custom Init / Factory Chain
35+
+(DTTimePeriodChain *)chain;
36+
37+
#pragma mark - Chain Existence Manipulation
38+
-(void)addTimePeriod:(DTTimePeriod *)period;
39+
-(void)insertTimePeriod:(DTTimePeriod *)period atInedx:(NSInteger)index;
40+
-(void)removeTimePeriodAtIndex:(NSInteger)index;
41+
-(void)removeLatestTimePeriod;
42+
-(void)removeEarliestTimePeriod;
43+
44+
#pragma mark - Chain Relationship
45+
-(BOOL)isEqualToChain:(DTTimePeriodChain *)chain;
46+
47+
#pragma mark - Updates
48+
-(void)updateVariables;
49+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Copyright (C) 2014 by Matthew York
2+
//
3+
// Permission is hereby granted, free of charge, to any
4+
// person obtaining a copy of this software and
5+
// associated documentation files (the "Software"), to
6+
// deal in the Software without restriction, including
7+
// without limitation the rights to use, copy, modify, merge,
8+
// publish, distribute, sublicense, and/or sell copies of the
9+
// Software, and to permit persons to whom the Software is
10+
// furnished to do so, subject to the following conditions:
11+
//
12+
// The above copyright notice and this permission notice shall
13+
// be included in all copies or substantial portions of the Software.
14+
//
15+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17+
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19+
// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20+
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21+
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
23+
#import <Foundation/Foundation.h>
24+
#import "DTTimePeriodGroup.h"
25+
26+
@interface DTTimePeriodCollection : DTTimePeriodGroup
27+
28+
#pragma mark - Custom Init / Factory Methods
29+
+(DTTimePeriodCollection *)collection;
30+
31+
#pragma mark - Collection Manipulation
32+
-(void)addTimePeriod:(DTTimePeriod *)period;
33+
-(void)insertTimePeriod:(DTTimePeriod *)period atIndex:(NSInteger)index;
34+
-(void)removeTimePeriodAtIndex:(NSInteger)index;
35+
36+
#pragma mark - Sorting
37+
-(void)sortByStartAscending;
38+
-(void)sortByStartDescending;
39+
-(void)sortByEndAscending;
40+
-(void)sortByEndDescending;
41+
-(void)sortByDurationAscending;
42+
-(void)sortByDurationDescending;
43+
44+
#pragma mark - Collection Relationship
45+
-(DTTimePeriodCollection *)periodsInside:(DTTimePeriod *)period;
46+
-(DTTimePeriodCollection *)periodsIntersectedByDate:(NSDate *)date;
47+
-(DTTimePeriodCollection *)periodsIntersectedByPeriod:(DTTimePeriod *)period;
48+
-(DTTimePeriodCollection *)periodsOverlappedByPeriod:(DTTimePeriod *)period;
49+
-(BOOL)isEqualToCollection:(DTTimePeriodCollection *)collection considerOrder:(BOOL)considerOrder;
50+
51+
#pragma mark - Helper Methods
52+
-(DTTimePeriodCollection *)copy;
53+
54+
#pragma mark - Updates
55+
-(void)updateVariables;
56+
@end

0 commit comments

Comments
 (0)