Permalink
Browse files

Migrated RKCatalog server to Heroku. Referenced as a submodule in Exa…

…mples/RKCatalog/Server for future development. refs #62
  • Loading branch information...
1 parent c35d0ba commit 56d0972e7f8e8153a87b4b56867d0f7be512c729 @blakewatters blakewatters committed Apr 22, 2011
Showing with 42 additions and 100 deletions.
  1. +3 −0 .gitmodules
  2. +38 −0 Examples/RKCatalog/App/RKCatalogAppDelegate.m
  3. +1 −0 Examples/RKCatalog/Server
  4. +0 −100 Examples/RKCatalog/Server/server.rb
View
@@ -1,3 +1,6 @@
[submodule "Specs/Runner/UISpec"]
path = Specs/Runner/UISpec
url = git://github.com/twotoasters/UISpec.git
+[submodule "Examples/RKCatalog/Server"]
+ path = Examples/RKCatalog/Server
+ url = git://github.com/twotoasters/RKCatalog-Server.git
@@ -0,0 +1,38 @@
+//
+// RKCatalogAppDelegate.m
+// RKCatalog
+//
+// Created by Blake Watters on 4/21/11.
+// Copyright 2011 Two Toasters. All rights reserved.
+//
+
+#import "RKCatalogAppDelegate.h"
+#import "RootViewController.h"
+
+NSString* gRKCatalogBaseURL = nil;
+
+@implementation RKCatalogAppDelegate
+
+@synthesize window=_window;
+@synthesize navigationController=_navigationController;
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
+ // Override point for customization after application launch.
+ // Add the navigation controller's view to the window and display.
+ self.window.rootViewController = self.navigationController;
+ [self.window makeKeyAndVisible];
+
+
+ // gRKCatalogBaseURL = [@"http://localhost:4567" retain];
+ gRKCatalogBaseURL = [@"http://rkcatalog.heroku.com/" retain];
+
+ return YES;
+}
+
+- (void)dealloc {
+ [_window release];
+ [_navigationController release];
+ [super dealloc];
+}
+
+@end
Submodule Server added at 00159d
@@ -1,100 +0,0 @@
-# RestKit RKCatalog Sample
-
-require 'rubygems'
-require 'sinatra/base'
-require 'json'
-
-class RKExampleServer < Sinatra::Base
- self.app_file = __FILE__
-
- configure do
- set :logging, true
- set :dump_errors, true
- set :show_exceptions, true
- end
-
- post '/RKParamsExample' do
- "OK"
- end
-
- get '/RKRequestQueueExample' do
- sleep(1.0)
- "OK"
- end
-
- get '/RKBackgroundRequestExample' do
- content_type 'text/plain'
- sleep(5)
- "OK"
- end
-
- get '/RKKeyValueMappingExample' do
- content_type 'application/json'
- %Q{{
- "id": 1234,
- "name": "Personal Checking",
- "balance": 5013.26,
- "transactions": [
- {"id": 1, "payee": "Joe Blow", "amount": 50.16},
- {"id": 2, "payee": "Grocery Store", "amount": 200.15},
- {"id": 3, "payee": "John Doe", "amount": 325.00},
- {"id": 4, "payee": "Grocery Store", "amount": 25.15}]
- }}
- end
-
- # Used by the Relationship mapping examples
- get '/RKRelationshipMappingExample' do
- content_type 'application/json'
- %Q{
- [{"project": {
- "id": 123,
- "name": "Produce RestKit Sample Code",
- "description": "We need more sample code!",
- "user": {
- "id": 1,
- "name": "Blake Watters",
- "email": "blake@twotoasters.com"
- },
- "tasks": [
- {"id": 1, "name": "Identify samples to write", "assigned_user_id": 1},
- {"id": 2, "name": "Write the code", "assigned_user_id": 1},
- {"id": 3, "name": "Push to Github", "assigned_user_id": 1},
- {"id": 4, "name": "Update the mailing list", "assigned_user_id": 1}
- ]
- }},
- {"project": {
- "id": 456,
- "name": "Document Object Mapper",
- "description": "The object mapper could really use some docs!",
- "user": {
- "id": 2,
- "name": "Jeremy Ellison",
- "email": "jeremy@twotoasters.com"
- },
- "tasks": [
- {"id": 5, "name": "Mark up methods with Doxygen markup", "assigned_user_id": 2},
- {"id": 6, "name": "Generate docs and review formatting", "assigned_user_id": 2},
- {"id": 7, "name": "Review docs for accuracy and completeness", "assigned_user_id": 1},
- {"id": 8, "name": "Publish to Github", "assigned_user_id": 2}
- ]
- }},
- {"project": {
- "id": 789,
- "name": "Wash the Cat",
- "description": "Mr. Fluffy is looking like Mr. Scruffy! Time for a bath!",
- "user": {
- "id": 3,
- "name": "Rachit Shukla",
- "email": "rachit@twotoasters.com"
- },
- "tasks": [
- {"id": 9, "name": "Place cat in bathtub", "assigned_user_id": 3},
- {"id": 10, "name": "Run water", "assigned_user_id": 3},
- {"id": 11, "name": "Try not to get scratched", "assigned_user_id": 3}
- ]
- }}]
- }
- end
-end
-
-RKExampleServer.run!

0 comments on commit 56d0972

Please sign in to comment.