appjam 0.1.8.8 → 0.1.8.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +22 -62
- data/lib/appjam/generators/gist.yml +1 -1
- data/lib/appjam/generators/templates/blank/EiffelApplication.xcodeproj/project.pbxproj +1166 -482
- data/lib/appjam/generators/templates/blank/EiffelApplication.xcodeproj/project.xcworkspace/xcuserdata/eiffel.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/EiffelApplication-Prefix.pch.tt +26 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/AwesomeMenu.h +52 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/AwesomeMenu.m +412 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/AwesomeMenuItem.h +44 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/AwesomeMenuItem.m +97 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/bg-addbutton-highlighted.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/bg-addbutton-highlighted@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/bg-addbutton.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/bg-addbutton@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/bg-menuitem-highlighted.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/bg-menuitem-highlighted@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/bg-menuitem.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/bg-menuitem@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/icon-plus-highlighted.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/icon-plus-highlighted@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/icon-plus.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/icon-plus@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/icon-star.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/icon-star@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/CMPopTipView/CMPopTipView.h +167 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/CMPopTipView/CMPopTipView.m +639 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/FXLabel/FXLabel.h +97 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/FXLabel/FXLabel.m +1080 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/MBProgressHUD/MBProgressHUD.h +451 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/MBProgressHUD/MBProgressHUD.m +865 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/FacingView.h +42 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/FacingView.m +56 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/FoldView.h +90 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/FoldView.m +316 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/MultiFoldView.h +104 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/MultiFoldView.m +516 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldConstants.h +49 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldNavigationController.h +18 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldNavigationController.m +88 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldResources.bundle/swipe_guide_left.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldResources.bundle/swipe_guide_left@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldResources.bundle/swipe_guide_right.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldResources.bundle/swipe_guide_right@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldSwipeHintView.h +25 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldSwipeHintView.m +76 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldView.h +131 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldView.m +941 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/Resources/swipe_guide.psd +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/Resources/swipe_guide2.psd +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/ShadowView.h +46 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/ShadowView.m +82 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/TouchThroughUIView.h +39 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/TouchThroughUIView.m +72 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/UIView+Screenshot.h +42 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/UIView+Screenshot.m +100 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/NSBubbleData.h +34 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/NSBubbleData.m +140 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/UIBubbleHeaderTableViewCell.h +17 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/UIBubbleHeaderTableViewCell.m +57 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/UIBubbleTableView.h +30 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/UIBubbleTableView.m +233 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/UIBubbleTableViewCell.h +19 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/UIBubbleTableViewCell.m +122 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/UIBubbleTableViewDataSource.h +24 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/UIBubbleTypingTableViewCell.h +20 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/UIBubbleTypingTableViewCell.m +56 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/bubbleMine.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/bubbleMine@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/bubbleSomeone.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/bubbleSomeone@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/missingAvatar.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/missingAvatar@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/typingMine.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/typingMine@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/typingSomeone.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/typingSomeone@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIGlossyButton/UIGlossyButton.h +124 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIGlossyButton/UIGlossyButton.m +545 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIGlossyButton/UIView+LayerEffects.h +22 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIGlossyButton/UIView+LayerEffects.m +32 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/AFIncrementalStore/AFIncrementalStore.h +344 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/AFIncrementalStore/AFIncrementalStore.m +848 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/AFIncrementalStore/AFRESTClient.h +135 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/AFIncrementalStore/AFRESTClient.m +441 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/InflectorKit/NSString+InflectorKit.h +40 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/InflectorKit/NSString+InflectorKit.m +36 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/InflectorKit/TTTStringInflector.h +76 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/InflectorKit/TTTStringInflector.m +270 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/MKAnnotationView+WebCache.h +95 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/MKAnnotationView+WebCache.m +78 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDImageCache.h +144 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDImageCache.m +311 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageCompat.h +40 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageCompat.m +54 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageDecoder.h +18 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageDecoder.m +70 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageDownloader.h +102 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageDownloader.m +226 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageDownloaderOperation.h +25 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageDownloaderOperation.m +339 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageManager.h +167 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageManager.m +244 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageOperation.h +15 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImagePrefetcher.h +58 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImagePrefetcher.m +127 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/UIButton+WebCache.h +173 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/UIButton+WebCache.m +129 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/UIImageView+WebCache.h +140 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/UIImageView+WebCache.m +84 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CPAnimationSequence/CPAnimationProgram.h +28 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CPAnimationSequence/CPAnimationSequence.h +28 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CPAnimationSequence/CPAnimationStep.h +49 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CPAnimationSequence/private/CPAnimationProgram.m +100 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CPAnimationSequence/private/CPAnimationSequence.m +85 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CPAnimationSequence/private/CPAnimationStep.m +122 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaAsyncSocket/GCDAsyncSocket.h +1074 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaAsyncSocket/GCDAsyncSocket.m +7430 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Categories/DDData.h +14 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Categories/DDData.m +158 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Categories/DDNumber.h +12 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Categories/DDNumber.m +88 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Categories/DDRange.h +56 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Categories/DDRange.m +104 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPAuthenticationRequest.h +45 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPAuthenticationRequest.m +195 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPConnection.h +119 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPConnection.m +2708 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPLogging.h +136 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPMessage.h +48 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPMessage.m +113 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPResponse.h +149 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPServer.h +205 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPServer.m +772 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Mime/MultipartFormDataParser.h +65 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Mime/MultipartFormDataParser.m +529 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Mime/MultipartMessageHeader.h +33 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Mime/MultipartMessageHeader.m +86 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Mime/MultipartMessageHeaderField.h +23 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Mime/MultipartMessageHeaderField.m +211 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPAsyncFileResponse.h +75 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPAsyncFileResponse.m +405 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPDataResponse.h +13 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPDataResponse.m +79 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPDynamicFileResponse.h +52 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPDynamicFileResponse.m +292 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPErrorResponse.h +9 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPErrorResponse.m +38 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPFileResponse.h +25 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPFileResponse.m +237 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPRedirectResponse.h +12 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPRedirectResponse.m +73 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/WebSocket.h +105 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/WebSocket.m +791 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Extensions/WebDAV/DAVConnection.h +7 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Extensions/WebDAV/DAVConnection.m +160 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Extensions/WebDAV/DAVResponse.h +11 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Extensions/WebDAV/DAVResponse.m +372 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Extensions/WebDAV/DELETEResponse.h +7 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Extensions/WebDAV/DELETEResponse.m +49 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Extensions/WebDAV/PUTResponse.h +8 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Extensions/WebDAV/PUTResponse.m +69 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/hpple/TFHpple.h +54 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/hpple/TFHpple.m +102 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/hpple/TFHppleElement.h +103 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/hpple/TFHppleElement.m +200 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/hpple/XPathQuery.h +10 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/hpple/XPathQuery.m +197 -0
- data/lib/appjam/version.rb +1 -1
- metadata +164 -3
@@ -0,0 +1,38 @@
|
|
1
|
+
#import "HTTPErrorResponse.h"
|
2
|
+
|
3
|
+
@implementation HTTPErrorResponse
|
4
|
+
|
5
|
+
-(id)initWithErrorCode:(int)httpErrorCode
|
6
|
+
{
|
7
|
+
if ((self = [super init]))
|
8
|
+
{
|
9
|
+
_status = httpErrorCode;
|
10
|
+
}
|
11
|
+
|
12
|
+
return self;
|
13
|
+
}
|
14
|
+
|
15
|
+
- (UInt64) contentLength {
|
16
|
+
return 0;
|
17
|
+
}
|
18
|
+
|
19
|
+
- (UInt64) offset {
|
20
|
+
return 0;
|
21
|
+
}
|
22
|
+
|
23
|
+
- (void)setOffset:(UInt64)offset {
|
24
|
+
;
|
25
|
+
}
|
26
|
+
|
27
|
+
- (NSData*) readDataOfLength:(NSUInteger)length {
|
28
|
+
return nil;
|
29
|
+
}
|
30
|
+
|
31
|
+
- (BOOL) isDone {
|
32
|
+
return YES;
|
33
|
+
}
|
34
|
+
|
35
|
+
- (NSInteger) status {
|
36
|
+
return _status;
|
37
|
+
}
|
38
|
+
@end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
#import "HTTPResponse.h"
|
3
|
+
|
4
|
+
@class HTTPConnection;
|
5
|
+
|
6
|
+
|
7
|
+
@interface HTTPFileResponse : NSObject <HTTPResponse>
|
8
|
+
{
|
9
|
+
HTTPConnection *connection;
|
10
|
+
|
11
|
+
NSString *filePath;
|
12
|
+
UInt64 fileLength;
|
13
|
+
UInt64 fileOffset;
|
14
|
+
|
15
|
+
BOOL aborted;
|
16
|
+
|
17
|
+
int fileFD;
|
18
|
+
void *buffer;
|
19
|
+
NSUInteger bufferSize;
|
20
|
+
}
|
21
|
+
|
22
|
+
- (id)initWithFilePath:(NSString *)filePath forConnection:(HTTPConnection *)connection;
|
23
|
+
- (NSString *)filePath;
|
24
|
+
|
25
|
+
@end
|
@@ -0,0 +1,237 @@
|
|
1
|
+
#import "HTTPFileResponse.h"
|
2
|
+
#import "HTTPConnection.h"
|
3
|
+
#import "HTTPLogging.h"
|
4
|
+
|
5
|
+
#import <unistd.h>
|
6
|
+
#import <fcntl.h>
|
7
|
+
|
8
|
+
#if ! __has_feature(objc_arc)
|
9
|
+
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
|
10
|
+
#endif
|
11
|
+
|
12
|
+
// Log levels : off, error, warn, info, verbose
|
13
|
+
// Other flags: trace
|
14
|
+
static const int httpLogLevel = HTTP_LOG_LEVEL_WARN; // | HTTP_LOG_FLAG_TRACE;
|
15
|
+
|
16
|
+
#define NULL_FD -1
|
17
|
+
|
18
|
+
|
19
|
+
@implementation HTTPFileResponse
|
20
|
+
|
21
|
+
- (id)initWithFilePath:(NSString *)fpath forConnection:(HTTPConnection *)parent
|
22
|
+
{
|
23
|
+
if((self = [super init]))
|
24
|
+
{
|
25
|
+
HTTPLogTrace();
|
26
|
+
|
27
|
+
connection = parent; // Parents retain children, children do NOT retain parents
|
28
|
+
|
29
|
+
fileFD = NULL_FD;
|
30
|
+
filePath = [[fpath copy] stringByResolvingSymlinksInPath];
|
31
|
+
if (filePath == nil)
|
32
|
+
{
|
33
|
+
HTTPLogWarn(@"%@: Init failed - Nil filePath", THIS_FILE);
|
34
|
+
|
35
|
+
return nil;
|
36
|
+
}
|
37
|
+
|
38
|
+
NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil];
|
39
|
+
if (fileAttributes == nil)
|
40
|
+
{
|
41
|
+
HTTPLogWarn(@"%@: Init failed - Unable to get file attributes. filePath: %@", THIS_FILE, filePath);
|
42
|
+
|
43
|
+
return nil;
|
44
|
+
}
|
45
|
+
|
46
|
+
fileLength = (UInt64)[[fileAttributes objectForKey:NSFileSize] unsignedLongLongValue];
|
47
|
+
fileOffset = 0;
|
48
|
+
|
49
|
+
aborted = NO;
|
50
|
+
|
51
|
+
// We don't bother opening the file here.
|
52
|
+
// If this is a HEAD request we only need to know the fileLength.
|
53
|
+
}
|
54
|
+
return self;
|
55
|
+
}
|
56
|
+
|
57
|
+
- (void)abort
|
58
|
+
{
|
59
|
+
HTTPLogTrace();
|
60
|
+
|
61
|
+
[connection responseDidAbort:self];
|
62
|
+
aborted = YES;
|
63
|
+
}
|
64
|
+
|
65
|
+
- (BOOL)openFile
|
66
|
+
{
|
67
|
+
HTTPLogTrace();
|
68
|
+
|
69
|
+
fileFD = open([filePath UTF8String], O_RDONLY);
|
70
|
+
if (fileFD == NULL_FD)
|
71
|
+
{
|
72
|
+
HTTPLogError(@"%@[%p]: Unable to open file. filePath: %@", THIS_FILE, self, filePath);
|
73
|
+
|
74
|
+
[self abort];
|
75
|
+
return NO;
|
76
|
+
}
|
77
|
+
|
78
|
+
HTTPLogVerbose(@"%@[%p]: Open fd[%i] -> %@", THIS_FILE, self, fileFD, filePath);
|
79
|
+
|
80
|
+
return YES;
|
81
|
+
}
|
82
|
+
|
83
|
+
- (BOOL)openFileIfNeeded
|
84
|
+
{
|
85
|
+
if (aborted)
|
86
|
+
{
|
87
|
+
// The file operation has been aborted.
|
88
|
+
// This could be because we failed to open the file,
|
89
|
+
// or the reading process failed.
|
90
|
+
return NO;
|
91
|
+
}
|
92
|
+
|
93
|
+
if (fileFD != NULL_FD)
|
94
|
+
{
|
95
|
+
// File has already been opened.
|
96
|
+
return YES;
|
97
|
+
}
|
98
|
+
|
99
|
+
return [self openFile];
|
100
|
+
}
|
101
|
+
|
102
|
+
- (UInt64)contentLength
|
103
|
+
{
|
104
|
+
HTTPLogTrace();
|
105
|
+
|
106
|
+
return fileLength;
|
107
|
+
}
|
108
|
+
|
109
|
+
- (UInt64)offset
|
110
|
+
{
|
111
|
+
HTTPLogTrace();
|
112
|
+
|
113
|
+
return fileOffset;
|
114
|
+
}
|
115
|
+
|
116
|
+
- (void)setOffset:(UInt64)offset
|
117
|
+
{
|
118
|
+
HTTPLogTrace2(@"%@[%p]: setOffset:%llu", THIS_FILE, self, offset);
|
119
|
+
|
120
|
+
if (![self openFileIfNeeded])
|
121
|
+
{
|
122
|
+
// File opening failed,
|
123
|
+
// or response has been aborted due to another error.
|
124
|
+
return;
|
125
|
+
}
|
126
|
+
|
127
|
+
fileOffset = offset;
|
128
|
+
|
129
|
+
off_t result = lseek(fileFD, (off_t)offset, SEEK_SET);
|
130
|
+
if (result == -1)
|
131
|
+
{
|
132
|
+
HTTPLogError(@"%@[%p]: lseek failed - errno(%i) filePath(%@)", THIS_FILE, self, errno, filePath);
|
133
|
+
|
134
|
+
[self abort];
|
135
|
+
}
|
136
|
+
}
|
137
|
+
|
138
|
+
- (NSData *)readDataOfLength:(NSUInteger)length
|
139
|
+
{
|
140
|
+
HTTPLogTrace2(@"%@[%p]: readDataOfLength:%lu", THIS_FILE, self, (unsigned long)length);
|
141
|
+
|
142
|
+
if (![self openFileIfNeeded])
|
143
|
+
{
|
144
|
+
// File opening failed,
|
145
|
+
// or response has been aborted due to another error.
|
146
|
+
return nil;
|
147
|
+
}
|
148
|
+
|
149
|
+
// Determine how much data we should read.
|
150
|
+
//
|
151
|
+
// It is OK if we ask to read more bytes than exist in the file.
|
152
|
+
// It is NOT OK to over-allocate the buffer.
|
153
|
+
|
154
|
+
UInt64 bytesLeftInFile = fileLength - fileOffset;
|
155
|
+
|
156
|
+
NSUInteger bytesToRead = (NSUInteger)MIN(length, bytesLeftInFile);
|
157
|
+
|
158
|
+
// Make sure buffer is big enough for read request.
|
159
|
+
// Do not over-allocate.
|
160
|
+
|
161
|
+
if (buffer == NULL || bufferSize < bytesToRead)
|
162
|
+
{
|
163
|
+
bufferSize = bytesToRead;
|
164
|
+
buffer = reallocf(buffer, (size_t)bufferSize);
|
165
|
+
|
166
|
+
if (buffer == NULL)
|
167
|
+
{
|
168
|
+
HTTPLogError(@"%@[%p]: Unable to allocate buffer", THIS_FILE, self);
|
169
|
+
|
170
|
+
[self abort];
|
171
|
+
return nil;
|
172
|
+
}
|
173
|
+
}
|
174
|
+
|
175
|
+
// Perform the read
|
176
|
+
|
177
|
+
HTTPLogVerbose(@"%@[%p]: Attempting to read %lu bytes from file", THIS_FILE, self, (unsigned long)bytesToRead);
|
178
|
+
|
179
|
+
ssize_t result = read(fileFD, buffer, bytesToRead);
|
180
|
+
|
181
|
+
// Check the results
|
182
|
+
|
183
|
+
if (result < 0)
|
184
|
+
{
|
185
|
+
HTTPLogError(@"%@: Error(%i) reading file(%@)", THIS_FILE, errno, filePath);
|
186
|
+
|
187
|
+
[self abort];
|
188
|
+
return nil;
|
189
|
+
}
|
190
|
+
else if (result == 0)
|
191
|
+
{
|
192
|
+
HTTPLogError(@"%@: Read EOF on file(%@)", THIS_FILE, filePath);
|
193
|
+
|
194
|
+
[self abort];
|
195
|
+
return nil;
|
196
|
+
}
|
197
|
+
else // (result > 0)
|
198
|
+
{
|
199
|
+
HTTPLogVerbose(@"%@[%p]: Read %ld bytes from file", THIS_FILE, self, (long)result);
|
200
|
+
|
201
|
+
fileOffset += result;
|
202
|
+
|
203
|
+
return [NSData dataWithBytes:buffer length:result];
|
204
|
+
}
|
205
|
+
}
|
206
|
+
|
207
|
+
- (BOOL)isDone
|
208
|
+
{
|
209
|
+
BOOL result = (fileOffset == fileLength);
|
210
|
+
|
211
|
+
HTTPLogTrace2(@"%@[%p]: isDone - %@", THIS_FILE, self, (result ? @"YES" : @"NO"));
|
212
|
+
|
213
|
+
return result;
|
214
|
+
}
|
215
|
+
|
216
|
+
- (NSString *)filePath
|
217
|
+
{
|
218
|
+
return filePath;
|
219
|
+
}
|
220
|
+
|
221
|
+
- (void)dealloc
|
222
|
+
{
|
223
|
+
HTTPLogTrace();
|
224
|
+
|
225
|
+
if (fileFD != NULL_FD)
|
226
|
+
{
|
227
|
+
HTTPLogVerbose(@"%@[%p]: Close fd[%i]", THIS_FILE, self, fileFD);
|
228
|
+
|
229
|
+
close(fileFD);
|
230
|
+
}
|
231
|
+
|
232
|
+
if (buffer)
|
233
|
+
free(buffer);
|
234
|
+
|
235
|
+
}
|
236
|
+
|
237
|
+
@end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
#import "HTTPRedirectResponse.h"
|
2
|
+
#import "HTTPLogging.h"
|
3
|
+
|
4
|
+
#if ! __has_feature(objc_arc)
|
5
|
+
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
|
6
|
+
#endif
|
7
|
+
|
8
|
+
// Log levels : off, error, warn, info, verbose
|
9
|
+
// Other flags: trace
|
10
|
+
static const int httpLogLevel = HTTP_LOG_LEVEL_OFF; // | HTTP_LOG_FLAG_TRACE;
|
11
|
+
|
12
|
+
|
13
|
+
@implementation HTTPRedirectResponse
|
14
|
+
|
15
|
+
- (id)initWithPath:(NSString *)path
|
16
|
+
{
|
17
|
+
if ((self = [super init]))
|
18
|
+
{
|
19
|
+
HTTPLogTrace();
|
20
|
+
|
21
|
+
redirectPath = [path copy];
|
22
|
+
}
|
23
|
+
return self;
|
24
|
+
}
|
25
|
+
|
26
|
+
- (UInt64)contentLength
|
27
|
+
{
|
28
|
+
return 0;
|
29
|
+
}
|
30
|
+
|
31
|
+
- (UInt64)offset
|
32
|
+
{
|
33
|
+
return 0;
|
34
|
+
}
|
35
|
+
|
36
|
+
- (void)setOffset:(UInt64)offset
|
37
|
+
{
|
38
|
+
// Nothing to do
|
39
|
+
}
|
40
|
+
|
41
|
+
- (NSData *)readDataOfLength:(NSUInteger)length
|
42
|
+
{
|
43
|
+
HTTPLogTrace();
|
44
|
+
|
45
|
+
return nil;
|
46
|
+
}
|
47
|
+
|
48
|
+
- (BOOL)isDone
|
49
|
+
{
|
50
|
+
return YES;
|
51
|
+
}
|
52
|
+
|
53
|
+
- (NSDictionary *)httpHeaders
|
54
|
+
{
|
55
|
+
HTTPLogTrace();
|
56
|
+
|
57
|
+
return [NSDictionary dictionaryWithObject:redirectPath forKey:@"Location"];
|
58
|
+
}
|
59
|
+
|
60
|
+
- (NSInteger)status
|
61
|
+
{
|
62
|
+
HTTPLogTrace();
|
63
|
+
|
64
|
+
return 302;
|
65
|
+
}
|
66
|
+
|
67
|
+
- (void)dealloc
|
68
|
+
{
|
69
|
+
HTTPLogTrace();
|
70
|
+
|
71
|
+
}
|
72
|
+
|
73
|
+
@end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
|
3
|
+
@class HTTPMessage;
|
4
|
+
@class GCDAsyncSocket;
|
5
|
+
|
6
|
+
|
7
|
+
#define WebSocketDidDieNotification @"WebSocketDidDie"
|
8
|
+
|
9
|
+
@interface WebSocket : NSObject
|
10
|
+
{
|
11
|
+
dispatch_queue_t websocketQueue;
|
12
|
+
|
13
|
+
HTTPMessage *request;
|
14
|
+
GCDAsyncSocket *asyncSocket;
|
15
|
+
|
16
|
+
NSData *term;
|
17
|
+
|
18
|
+
BOOL isStarted;
|
19
|
+
BOOL isOpen;
|
20
|
+
BOOL isVersion76;
|
21
|
+
|
22
|
+
id __unsafe_unretained delegate;
|
23
|
+
}
|
24
|
+
|
25
|
+
+ (BOOL)isWebSocketRequest:(HTTPMessage *)request;
|
26
|
+
|
27
|
+
- (id)initWithRequest:(HTTPMessage *)request socket:(GCDAsyncSocket *)socket;
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Delegate option.
|
31
|
+
*
|
32
|
+
* In most cases it will be easier to subclass WebSocket,
|
33
|
+
* but some circumstances may lead one to prefer standard delegate callbacks instead.
|
34
|
+
**/
|
35
|
+
@property (/* atomic */ unsafe_unretained) id delegate;
|
36
|
+
|
37
|
+
/**
|
38
|
+
* The WebSocket class is thread-safe, generally via it's GCD queue.
|
39
|
+
* All public API methods are thread-safe,
|
40
|
+
* and the subclass API methods are thread-safe as they are all invoked on the same GCD queue.
|
41
|
+
**/
|
42
|
+
@property (nonatomic, readonly) dispatch_queue_t websocketQueue;
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Public API
|
46
|
+
*
|
47
|
+
* These methods are automatically called by the HTTPServer.
|
48
|
+
* You may invoke the stop method yourself to close the WebSocket manually.
|
49
|
+
**/
|
50
|
+
- (void)start;
|
51
|
+
- (void)stop;
|
52
|
+
|
53
|
+
/**
|
54
|
+
* Public API
|
55
|
+
*
|
56
|
+
* Sends a message over the WebSocket.
|
57
|
+
* This method is thread-safe.
|
58
|
+
**/
|
59
|
+
- (void)sendMessage:(NSString *)msg;
|
60
|
+
|
61
|
+
/**
|
62
|
+
* Public API
|
63
|
+
*
|
64
|
+
* Sends a message over the WebSocket.
|
65
|
+
* This method is thread-safe.
|
66
|
+
**/
|
67
|
+
- (void)sendData:(NSData *)msg;
|
68
|
+
|
69
|
+
/**
|
70
|
+
* Subclass API
|
71
|
+
*
|
72
|
+
* These methods are designed to be overriden by subclasses.
|
73
|
+
**/
|
74
|
+
- (void)didOpen;
|
75
|
+
- (void)didReceiveMessage:(NSString *)msg;
|
76
|
+
- (void)didClose;
|
77
|
+
|
78
|
+
@end
|
79
|
+
|
80
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
81
|
+
#pragma mark -
|
82
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
83
|
+
|
84
|
+
/**
|
85
|
+
* There are two ways to create your own custom WebSocket:
|
86
|
+
*
|
87
|
+
* - Subclass it and override the methods you're interested in.
|
88
|
+
* - Use traditional delegate paradigm along with your own custom class.
|
89
|
+
*
|
90
|
+
* They both exist to allow for maximum flexibility.
|
91
|
+
* In most cases it will be easier to subclass WebSocket.
|
92
|
+
* However some circumstances may lead one to prefer standard delegate callbacks instead.
|
93
|
+
* One such example, you're already subclassing another class, so subclassing WebSocket isn't an option.
|
94
|
+
**/
|
95
|
+
|
96
|
+
@protocol WebSocketDelegate
|
97
|
+
@optional
|
98
|
+
|
99
|
+
- (void)webSocketDidOpen:(WebSocket *)ws;
|
100
|
+
|
101
|
+
- (void)webSocket:(WebSocket *)ws didReceiveMessage:(NSString *)msg;
|
102
|
+
|
103
|
+
- (void)webSocketDidClose:(WebSocket *)ws;
|
104
|
+
|
105
|
+
@end
|