fwtoolkit 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/bin/fwt ADDED
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env ruby
2
+ require 'thor'
3
+ require 'xcodeproj'
4
+ require 'erb'
5
+
6
+ class FWT < Thor
7
+
8
+ include Thor::Actions
9
+
10
+ def self.source_root
11
+ File.join(File.dirname(__FILE__), '..')
12
+ end
13
+
14
+ desc "new APP_PATH PREFIX", "Creates a new Future Workshops iOS project"
15
+ def new(app_path, prefix)
16
+ @app_name = File.basename(app_path)
17
+ @prefix = prefix.upcase
18
+ @path = app_path
19
+ supporting_files = 'Supporting Files'
20
+
21
+ @project = Xcodeproj::Project.new
22
+ @project.root_object.build_configuration_list
23
+ @project.add_system_framework('UIKit')
24
+ #@project.add_system_framework('CoreGraphics') # bug in latest RestKit pod
25
+
26
+ info_plist = "#{@app_name}-Info.plist"
27
+ process_template("Info.plist.erb", info_plist, supporting_files)
28
+
29
+ target = @project.new_target(:application, @app_name, :ios)
30
+ target.build_settings('Debug').merge!(:INFOPLIST_FILE => "$(SRCROOT)/#{@app_name}/#{@app_name}-Info.plist")
31
+ target.build_settings('Debug').merge!(:GCC_PREFIX_HEADER => "#{@app_name}/#{@app_name}-Prefix.pch")
32
+ target.build_settings('Release').merge!(:INFOPLIST_FILE => "$(SRCROOT)/#{@app_name}/#{@app_name}-Info.plist")
33
+ target.build_settings('Release').merge!(:GCC_PREFIX_HEADER => "#{@app_name}/#{@app_name}-Prefix.pch")
34
+
35
+ app_d_h = process_template("AppDelegate.h.erb", "#{@prefix}AppDelegate.h")
36
+ app_d_m = process_template("AppDelegate.m.erb", "#{@prefix}AppDelegate.m")
37
+ main_m = process_template("main.m.erb", "main.m", supporting_files)
38
+ prefix_pch = process_template("Prefix.pch.erb", "#{@app_name}-Prefix.pch", supporting_files)
39
+
40
+ target.add_file_references([app_d_m, main_m])
41
+
42
+ # final save
43
+ @project.save_as File.join(@path, "#{@app_name}.xcodeproj")
44
+ @workspace = Xcodeproj::Workspace.new("#{@app_name}.xcodeproj")
45
+ @workspace.save_as File.join(@path, "#{@app_name}.xcworkspace")
46
+
47
+ # Ruby
48
+ template 'templates/fwt/rvmrc.erb', File.join(@path, '.rvmrc')
49
+ template 'templates/fwt/Gemfile.erb', File.join(@path, 'Gemfile')
50
+ template 'templates/fwt/Rakefile.erb', File.join(@path, 'Rakefile')
51
+ template 'templates/fwt/Podfile.erb', File.join(@path, 'Podfile')
52
+ template 'templates/fwt/gitignore.erb', File.join(@path, '.gitignore')
53
+
54
+ sleep 5
55
+
56
+ inside(@path) do
57
+ run_captured 'bundle'
58
+ run_captured 'rake pod:clean_install'
59
+ run_captured "rake frank:setup['#{@app_name}','#{@prefix}']"
60
+ end
61
+ end
62
+
63
+ private
64
+ def run_captured(cmd)
65
+ run cmd, {:capture => true}
66
+ end
67
+
68
+ def process_template(template_filename, destination_filename, destination_group = "", template_project = 'default_project')
69
+ template "templates/fwt/#{template_project}/#{template_filename}", File.join(@path, @app_name, destination_filename)
70
+ @project.new_file(File.join(@app_name, destination_filename), File.join(@app_name, destination_group))
71
+ end
72
+
73
+ end
74
+
75
+ FWT.start
@@ -17,4 +17,4 @@ class Array
17
17
  end
18
18
  "[#{contents}]"
19
19
  end
20
- end
20
+ end
@@ -4,8 +4,8 @@ require 'xcodebuild'
4
4
  require 'cucumber/rake/task'
5
5
  require 'core_data'
6
6
  require 'erb'
7
-
8
- TEMPLATES_DIR = File.expand_path('../../../templates/', File.dirname(__FILE__))
7
+ require 'xcodeproj'
8
+ require 'fwtoolkit/tasks/frank_tasks'
9
9
 
10
10
  class String
11
11
  def ruby_format
@@ -43,6 +43,8 @@ module FWToolkit
43
43
  module Tasks
44
44
  class BuildTask < ::Rake::TaskLib
45
45
 
46
+ TEMPLATES_DIR = File.expand_path('../../../templates/', File.dirname(__FILE__))
47
+
46
48
  include Rake::DSL if defined?(Rake::DSL)
47
49
 
48
50
  attr_accessor :workspace
@@ -86,8 +88,7 @@ module FWToolkit
86
88
 
87
89
  task :validate_auth_token do
88
90
  unless ENV['FWBUILD_AUTH_TOKEN']
89
- puts 'Please set FWBUILD_AUTH_TOKEN environment variable'
90
- exit(-1)
91
+ abort 'Please set FWBUILD_AUTH_TOKEN environment variable'
91
92
  end
92
93
  end
93
94
 
@@ -105,25 +106,11 @@ module FWToolkit
105
106
 
106
107
  namespace :frank do
107
108
  desc 'Setup Frank'
108
- task :setup do
109
- sh 'frank setup'
110
-
111
- test_dir = File.join(TEMPLATES_DIR, 'cucumber')
112
- features_dir = File.join('Frank', 'features')
113
- support_dir = File.join(features_dir, 'support')
114
- steps_dir = File.join(features_dir, 'step_definitions')
115
- views_dir = File.join(support_dir, 'views')
116
-
117
- remove_file(File.join(features_dir, 'my_first.feature'))
118
- cp(File.join(test_dir, 'env.rb'), support_dir)
119
- cp(File.join(test_dir, 'mimic.rb'), support_dir)
120
- mkdir(views_dir)
121
- cp(File.join(test_dir, 'my_objects_json.erb'), views_dir)
122
- cp(File.join(test_dir, 'my_objects_xml.erb'), views_dir)
123
- cp(File.join(test_dir, 'launch_steps.rb'), steps_dir)
124
- cp(File.join(test_dir, 'example.feature'), features_dir)
125
- cp(File.join(test_dir, 'AppDelegate+Frank.h'), './')
126
- cp(File.join(test_dir, 'AppDelegate+Frank.m'), './')
109
+ task :setup, [:target, :prefix] do |t, args|
110
+ args.with_defaults(:prefix => '')
111
+
112
+ FWToolkit::Tasks::FrankTasks.new.setup(args[:target], args[:prefix])
113
+
127
114
  end
128
115
 
129
116
  def template(template_file, output_file)
@@ -0,0 +1,41 @@
1
+ require 'thor'
2
+
3
+ module FWToolkit
4
+ module Tasks
5
+ class FrankTasks < Thor
6
+
7
+ include Thor::Actions
8
+
9
+ def self.source_root
10
+ File.join(File.dirname(__FILE__), '..', '..', '..')
11
+ end
12
+
13
+ no_tasks do
14
+ def setup(target = nil, prefix = nil, project_directory = target, project_file = "#{target}.xcodeproj")
15
+ run 'frank setup'
16
+ features_dir = File.join('Frank', 'features')
17
+ remove_file(File.join(features_dir, 'my_first.feature'))
18
+
19
+ if target
20
+ test_dir = File.join(FWToolkit::Tasks::BuildTask::TEMPLATES_DIR, 'cucumber')
21
+ directory(File.join(FWToolkit::Tasks::BuildTask::TEMPLATES_DIR, 'cucumber', 'features'), features_dir, {:force => true})
22
+
23
+ @prefix = prefix
24
+ template 'templates/cucumber/AppDelegate+Frank.h.erb', File.join(project_directory, "#{prefix}AppDelegate+Frank.h")
25
+ template 'templates/cucumber/AppDelegate+Frank.m.erb', File.join(project_directory, "#{prefix}AppDelegate+Frank.m")
26
+
27
+ project = Xcodeproj::Project.new(project_file)
28
+ project.new_file(File.join(project_directory, "#{prefix}AppDelegate+Frank.h"), project_directory)
29
+ frank_app_d_m = project.new_file(File.join(project_directory, "#{prefix}AppDelegate+Frank.m"), project_directory)
30
+
31
+ target = project.targets.select{|t| t.name.eql? target}[0]
32
+ target.add_file_references([frank_app_d_m])
33
+
34
+ project.save_as(project_file)
35
+ end
36
+ end
37
+ end
38
+
39
+ end
40
+ end
41
+ end
@@ -38,6 +38,10 @@ module FWToolkit
38
38
  raise "IOS_SDK not defined. Please define this in your env.rb, i.e. IOS_SDK='5.1'" unless defined?(IOS_SDK)
39
39
  IOS_SDK
40
40
  end
41
+
42
+ def fwt_app_path
43
+ ENV['APP_BUNDLE_PATH'] || (defined?(APP_BUNDLE_PATH) && APP_BUNDLE_PATH)
44
+ end
41
45
 
42
46
  def fwt_app_path
43
47
  raise "APP_BUNDLE_PATH not defined. Please define this in your env.rb, i.e. APP_BUNDLE_PATH='File.expand_path( '../../../frankified_build/Frankified.app', __FILE__ )'" unless defined?(APP_BUNDLE_PATH)
@@ -1,3 +1,3 @@
1
1
  module FWToolkit
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
@@ -1,14 +1,14 @@
1
1
  //
2
- // AppDelegate+Frank.h
2
+ // <%= @prefix %>AppDelegate+Frank.h
3
3
  // FWToolkit
4
4
  //
5
5
  // Created by Matt Brooke-Smith on 14/10/2012.
6
6
  // Copyright (c) 2012 Future Workshops. All rights reserved.
7
7
  //
8
8
 
9
- #import "AppDelegate.h"
9
+ #import "<%= @prefix %>AppDelegate.h"
10
10
 
11
- @interface AppDelegate (Frank)
11
+ @interface <%= @prefix %>AppDelegate (Frank)
12
12
 
13
13
  - (void) seedCoreData:(NSString *)json;
14
14
 
@@ -0,0 +1,82 @@
1
+ //
2
+ // <%= @prefix %>AppDelegate+Frank.m
3
+ // FWToolkit
4
+ //
5
+ // Created by Matt Brooke-Smith on 18/07/2012.
6
+ // Copyright (c) 2012 Future Workshops. All rights reserved.
7
+ //
8
+
9
+ #import "<%= @prefix %>AppDelegate+Frank.h"
10
+ #import <CoreData/CoreData.h>
11
+ #import <JSONKit/JSONKit.h>
12
+ #import <RestKit/RestKit.h>
13
+
14
+ @implementation <%= @prefix %>AppDelegate (Frank)
15
+
16
+ - (void) seedCoreData:(NSString *)json
17
+ {
18
+ NSDictionary *objectsDictionary = [json objectFromJSONString];
19
+
20
+ NSManagedObjectContext *managedObjectContext = [[RBSCoreDataManager sharedManager] managedObjectContext];
21
+
22
+ for (NSString *objectKey in objectsDictionary)
23
+ {
24
+ [self createObjectWithEntityName:objectKey configuredWithDictionary:[objectsDictionary objectForKey:objectKey] inManagedObjectContext:managedObjectContext];
25
+ }
26
+
27
+ NSError *error = nil;
28
+ if (![managedObjectContext save:&error]) {
29
+ NSLog(@"Error saving: %@", [error localizedDescription]);
30
+ }
31
+ }
32
+
33
+ - (NSManagedObject *)createObjectWithEntityName:(NSString *)entityName configuredWithDictionary:(NSDictionary *)dictionary inManagedObjectContext:(NSManagedObjectContext *)context
34
+ {
35
+ NSManagedObject *object = [NSEntityDescription insertNewObjectForEntityForName:entityName inManagedObjectContext:context];
36
+
37
+ NSEntityDescription *objectEntityDescription = [object entity];
38
+
39
+ NSDictionary *attributes = [objectEntityDescription attributesByName];
40
+ NSDictionary *relationships = [objectEntityDescription relationshipsByName];
41
+
42
+ for (NSString *key in [dictionary allKeys])
43
+ {
44
+ if ([[attributes allKeys] containsObject:key])
45
+ {
46
+ id value = [dictionary objectForKey:key];
47
+ if (value != [NSNull null])
48
+ {
49
+ [object setValue:value forKey:key];
50
+ }
51
+ }
52
+ else if ([[relationships allKeys] containsObject:key])
53
+ {
54
+ NSRelationshipDescription *relationshipDescription = [relationships objectForKey:key];
55
+
56
+ NSString *destinationEntityName = [[relationshipDescription destinationEntity] name];
57
+
58
+ if ([relationshipDescription isToMany])
59
+ {
60
+ NSMutableSet *relationshipSet = [NSMutableSet set];
61
+ for (NSDictionary *toManyRelationshipObject in [dictionary objectForKey:key])
62
+ {
63
+ NSManagedObject *destinationObject = [self createObjectWithEntityName:destinationEntityName configuredWithDictionary:toManyRelationshipObject inManagedObjectContext:context];
64
+
65
+ [relationshipSet addObject:destinationObject];
66
+ }
67
+
68
+ [object setValue:relationshipSet forKey:key];
69
+ }
70
+ else
71
+ {
72
+ NSManagedObject *destinationObject = [self createObjectWithEntityName:destinationEntityName configuredWithDictionary:[dictionary objectForKey:key] inManagedObjectContext:context];
73
+
74
+ [object setValue:destinationObject forKey:key];
75
+ }
76
+ }
77
+ }
78
+
79
+ return object;
80
+ }
81
+
82
+ @end
@@ -4,4 +4,5 @@ Feature:
4
4
  In order to # achieve something
5
5
 
6
6
  Scenario: Open the App
7
- Given I restart and launch the app in the iphone simulator
7
+ Given I reset the iOS simulator
8
+ And I launch the app in the iPhone simulator
@@ -0,0 +1,15 @@
1
+ require 'pickle/world'
2
+ require 'fwtoolkit/test/model_helper'
3
+
4
+ Given /^I reset the iOS simulator$/ do
5
+ fwt_simulator_reset_data fwt_ios_sdk
6
+ end
7
+
8
+ Given /^I seed the (iPhone|iPad) simulator with #{capture_model}$/ do |device, capture_model|
9
+ launch_app fwt_app_path, fwt_ios_sdk, device.downcase
10
+ fwt_seed_app_with_pickle_models [capture_model]
11
+ end
12
+
13
+ Given /^I launch the app in the (iPhone|iPad) simulator$/ do |device|
14
+ launch_app app_path, fwt_ios_sdk, device.downcase
15
+ end
@@ -4,7 +4,7 @@ require 'socket'
4
4
  # Listen on the following :port
5
5
  # Add the following to your objective-c code, in the place where your
6
6
  # server root is configured
7
- # #ifdef FRANIFIFIED
7
+ # #ifdef FRANKIFIED
8
8
  # server = "http://localhost:11988"
9
9
  # #else
10
10
  # server = <your production server>
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'fwtoolkit', '~> 0.5.1'
@@ -0,0 +1,4 @@
1
+ platform :ios, '6.0'
2
+
3
+ pod 'RestKit/ObjectMapping', '0.10.3.fw.2'
4
+ pod 'RestKit/Network', '0.10.3.fw.2'
@@ -1,11 +1,15 @@
1
1
  require 'fwtoolkit/tasks/build_tasks'
2
2
 
3
3
  FWToolkit::Tasks::BuildTask.new do |t|
4
- t.workspace = '<Project Name>.xcworkspace'
5
- t.scheme = '<Scheme Name>'
4
+ # Used for Frank testing
5
+ t.workspace = '<%= @app_name %>.xcworkspace'
6
+ t.scheme = '<%= @app_name %>'
7
+ t.bundle_identifier = 'com.futureworkshops.<%= @app_name %>'
8
+
9
+ # Used for FW Build upload
6
10
  t.certificate = 'iPhone Developer: Matt Brooke-Smith (WQH444M434)'
7
11
  t.provisioning_profile = '/Users/matt/Library/MobileDevice/Provisioning Profiles/72515CD9-7732-40D5-BE5F-8AE06BF5769C.mobileprovision'
8
- t.bundle_identifier = '<Bundle Identifier>'
12
+
9
13
  end
10
14
 
11
15
  namespace :services do
@@ -0,0 +1,12 @@
1
+ //
2
+ // <%= @app_name %>AppDelegate.m
3
+ // <%= @app_name %>
4
+ //
5
+ // Copyright (c) <%= Date.today.year %> Future Workshops. All rights reserved.
6
+ //
7
+
8
+ @interface <%= @prefix %>AppDelegate : UIResponder <UIApplicationDelegate>
9
+
10
+ @property (strong, nonatomic) UIWindow *window;
11
+
12
+ @end
@@ -0,0 +1,20 @@
1
+ //
2
+ // <%= @app_name %>AppDelegate.m
3
+ // <%= @app_name %>
4
+ //
5
+ // Copyright (c) <%= Date.today.year %> Future Workshops. All rights reserved.
6
+ //
7
+
8
+ #import "<%= @prefix %>AppDelegate.h"
9
+
10
+ @implementation <%= @prefix %>AppDelegate
11
+
12
+ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
13
+ {
14
+ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
15
+ self.window.backgroundColor = [UIColor whiteColor];
16
+ [self.window makeKeyAndVisible];
17
+ return YES;
18
+ }
19
+
20
+ @end
@@ -0,0 +1,45 @@
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>CFBundleDisplayName</key>
8
+ <string>${PRODUCT_NAME}</string>
9
+ <key>CFBundleExecutable</key>
10
+ <string>${EXECUTABLE_NAME}</string>
11
+ <key>CFBundleIdentifier</key>
12
+ <string>com.futureworkshops.${PRODUCT_NAME:rfc1034identifier}</string>
13
+ <key>CFBundleInfoDictionaryVersion</key>
14
+ <string>6.0</string>
15
+ <key>CFBundleName</key>
16
+ <string>${PRODUCT_NAME}</string>
17
+ <key>CFBundlePackageType</key>
18
+ <string>APPL</string>
19
+ <key>CFBundleShortVersionString</key>
20
+ <string>1.0</string>
21
+ <key>CFBundleSignature</key>
22
+ <string>????</string>
23
+ <key>CFBundleVersion</key>
24
+ <string>1.0</string>
25
+ <key>LSRequiresIPhoneOS</key>
26
+ <true/>
27
+ <key>UIRequiredDeviceCapabilities</key>
28
+ <array>
29
+ <string>armv7</string>
30
+ </array>
31
+ <key>UISupportedInterfaceOrientations</key>
32
+ <array>
33
+ <string>UIInterfaceOrientationPortrait</string>
34
+ <string>UIInterfaceOrientationLandscapeLeft</string>
35
+ <string>UIInterfaceOrientationLandscapeRight</string>
36
+ </array>
37
+ <key>UISupportedInterfaceOrientations~ipad</key>
38
+ <array>
39
+ <string>UIInterfaceOrientationPortrait</string>
40
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
41
+ <string>UIInterfaceOrientationLandscapeLeft</string>
42
+ <string>UIInterfaceOrientationLandscapeRight</string>
43
+ </array>
44
+ </dict>
45
+ </plist>
@@ -0,0 +1,6 @@
1
+ #import <Availability.h>
2
+
3
+ #ifdef __OBJC__
4
+ #import <UIKit/UIKit.h>
5
+ #import <Foundation/Foundation.h>
6
+ #endif
@@ -0,0 +1,15 @@
1
+ //
2
+ // main.m
3
+ // <%= @app_name %>
4
+ //
5
+ // Copyright (c) <%= Date.today.year %> Future Workshops. All rights reserved.
6
+ //
7
+
8
+ #import "<%= @prefix %>AppDelegate.h"
9
+
10
+ int main(int argc, char *argv[])
11
+ {
12
+ @autoreleasepool {
13
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([<%= @prefix %>AppDelegate class]));
14
+ }
15
+ }
@@ -0,0 +1,31 @@
1
+ # Ruby
2
+ tmp/
3
+ log/
4
+ db/production.sqlite3
5
+ db/development.sqlite3
6
+
7
+ # Xcode
8
+ build/*
9
+ *.pbxuser
10
+ !default.pbxuser
11
+ *.mode1v3
12
+ !default.mode1v3
13
+ *.mode2v3
14
+ !default.mode2v3
15
+ *.perspectivev3
16
+ !default.perspectivev3
17
+ !default.xcworkspace
18
+ xcuserdata
19
+ profile
20
+ *.moved-aside
21
+ # Finder
22
+ .DS_Store
23
+ .svn
24
+ *.swp
25
+ *.~nib
26
+
27
+ # Frank
28
+ Frank/frankified_build/
29
+
30
+ # Cocoapods
31
+ /Pods/
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # This is an RVM Project .rvmrc file, used to automatically load the ruby
4
+ # development environment upon cd'ing into the directory
5
+
6
+ # First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
7
+ # Only full ruby name is supported here, for short names use:
8
+ # echo "rvm use 1.9.3" > .rvmrc
9
+ environment_id="ruby-1.9.3@<%= @app_name %>"
10
+
11
+ # First we attempt to load the desired environment directly from the environment
12
+ # file. This is very fast and efficient compared to running through the entire
13
+ # CLI and selector. If you want feedback on which environment was used then
14
+ # insert the word 'use' after --create as this triggers verbose mode.
15
+ if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
16
+ && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
17
+ then
18
+ \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
19
+ [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] &&
20
+ \. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true
21
+ else
22
+ # If the environment file has not yet been created, use the RVM CLI to select.
23
+ rvm --create "$environment_id" || {
24
+ echo "Failed to create RVM environment '${environment_id}'."
25
+ return 1
26
+ }
27
+ fi
28
+
29
+ # Run bundler
30
+ #if [[ -s Gemfile ]] && {
31
+ # ! builtin command -v bundle >/dev/null ||
32
+ # builtin command -v bundle | GREP_OPTIONS= \grep $rvm_path/bin/bundle >/dev/null
33
+ #}
34
+ #then
35
+ # printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
36
+ # gem install bundler
37
+ #fi
38
+ #if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null
39
+ #then
40
+ # bundle install | GREP_OPTIONS= \grep -vE '^Using|Your bundle is complete'
41
+ #fi
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fwtoolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-28 00:00:00.000000000 Z
12
+ date: 2012-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cucumber
@@ -59,22 +59,6 @@ dependencies:
59
59
  - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
- - !ruby/object:Gem::Dependency
63
- name: xcodeproj
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - '='
68
- - !ruby/object:Gem::Version
69
- version: 0.3.5
70
- type: :runtime
71
- prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - '='
76
- - !ruby/object:Gem::Version
77
- version: 0.3.5
78
62
  - !ruby/object:Gem::Dependency
79
63
  name: core_data
80
64
  requirement: !ruby/object:Gem::Requirement
@@ -162,7 +146,7 @@ dependencies:
162
146
  requirements:
163
147
  - - '='
164
148
  - !ruby/object:Gem::Version
165
- version: 1.1.1
149
+ version: 1.1.1.fw.1
166
150
  type: :runtime
167
151
  prerelease: false
168
152
  version_requirements: !ruby/object:Gem::Requirement
@@ -170,7 +154,7 @@ dependencies:
170
154
  requirements:
171
155
  - - '='
172
156
  - !ruby/object:Gem::Version
173
- version: 1.1.1
157
+ version: 1.1.1.fw.1
174
158
  - !ruby/object:Gem::Dependency
175
159
  name: CFPropertyList
176
160
  requirement: !ruby/object:Gem::Requirement
@@ -226,7 +210,7 @@ dependencies:
226
210
  requirements:
227
211
  - - '='
228
212
  - !ruby/object:Gem::Version
229
- version: 0.15.2
213
+ version: 0.16.0
230
214
  type: :runtime
231
215
  prerelease: false
232
216
  version_requirements: !ruby/object:Gem::Requirement
@@ -234,7 +218,7 @@ dependencies:
234
218
  requirements:
235
219
  - - '='
236
220
  - !ruby/object:Gem::Version
237
- version: 0.15.2
221
+ version: 0.16.0
238
222
  - !ruby/object:Gem::Dependency
239
223
  name: jbuilder
240
224
  requirement: !ruby/object:Gem::Requirement
@@ -251,16 +235,35 @@ dependencies:
251
235
  - - '='
252
236
  - !ruby/object:Gem::Version
253
237
  version: 0.8.2
238
+ - !ruby/object:Gem::Dependency
239
+ name: xcodeproj
240
+ requirement: !ruby/object:Gem::Requirement
241
+ none: false
242
+ requirements:
243
+ - - '='
244
+ - !ruby/object:Gem::Version
245
+ version: 0.4.0
246
+ type: :runtime
247
+ prerelease: false
248
+ version_requirements: !ruby/object:Gem::Requirement
249
+ none: false
250
+ requirements:
251
+ - - '='
252
+ - !ruby/object:Gem::Version
253
+ version: 0.4.0
254
254
  description: ''
255
255
  email:
256
256
  - matt@futureworkshops.com
257
- executables: []
257
+ executables:
258
+ - fwt
258
259
  extensions: []
259
260
  extra_rdoc_files: []
260
261
  files:
262
+ - bin/fwt
261
263
  - lib/fwtoolkit.rb
262
264
  - lib/fwtoolkit/cli.rb
263
265
  - lib/fwtoolkit/tasks/build_tasks.rb
266
+ - lib/fwtoolkit/tasks/frank_tasks.rb
264
267
  - lib/fwtoolkit/test/frank_model.rb
265
268
  - lib/fwtoolkit/test/misc_steps.rb
266
269
  - lib/fwtoolkit/test/model_helper.rb
@@ -269,15 +272,24 @@ files:
269
272
  - lib/fwtoolkit/test/ui_helper.rb
270
273
  - lib/fwtoolkit/test/ui_steps.rb
271
274
  - lib/fwtoolkit/version.rb
272
- - templates/cucumber/AppDelegate+Frank.h
273
- - templates/cucumber/AppDelegate+Frank.m
274
- - templates/cucumber/Rakefile
275
- - templates/cucumber/env.rb
276
- - templates/cucumber/example.feature
277
- - templates/cucumber/launch_steps.rb
278
- - templates/cucumber/mimic.rb
279
- - templates/cucumber/my_objects_json.erb
280
- - templates/cucumber/my_objects_xml.erb
275
+ - templates/cucumber/AppDelegate+Frank.h.erb
276
+ - templates/cucumber/AppDelegate+Frank.m.erb
277
+ - templates/cucumber/features/example.feature
278
+ - templates/cucumber/features/step_definitions/launch_steps.rb
279
+ - templates/cucumber/features/support/env.rb
280
+ - templates/cucumber/features/support/mimic.rb
281
+ - templates/cucumber/features/support/views/my_objects_json.erb
282
+ - templates/cucumber/features/support/views/my_objects_xml.erb
283
+ - templates/fwt/Gemfile.erb
284
+ - templates/fwt/Podfile.erb
285
+ - templates/fwt/Rakefile.erb
286
+ - templates/fwt/default_project/AppDelegate.h.erb
287
+ - templates/fwt/default_project/AppDelegate.m.erb
288
+ - templates/fwt/default_project/Info.plist.erb
289
+ - templates/fwt/default_project/Prefix.pch.erb
290
+ - templates/fwt/default_project/main.m.erb
291
+ - templates/fwt/gitignore.erb
292
+ - templates/fwt/rvmrc.erb
281
293
  - templates/models/factories.rb.erb
282
294
  - templates/models/model.rb.erb
283
295
  homepage: ''
@@ -292,12 +304,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
292
304
  - - ! '>='
293
305
  - !ruby/object:Gem::Version
294
306
  version: '0'
307
+ segments:
308
+ - 0
309
+ hash: 1193230210254549573
295
310
  required_rubygems_version: !ruby/object:Gem::Requirement
296
311
  none: false
297
312
  requirements:
298
313
  - - ! '>='
299
314
  - !ruby/object:Gem::Version
300
315
  version: '0'
316
+ segments:
317
+ - 0
318
+ hash: 1193230210254549573
301
319
  requirements: []
302
320
  rubyforge_project:
303
321
  rubygems_version: 1.8.24
@@ -1,40 +0,0 @@
1
- //
2
- // AppDelegate+Frank.m
3
- // FWToolkit
4
- //
5
- // Created by Matt Brooke-Smith on 18/07/2012.
6
- // Copyright (c) 2012 Future Workshops. All rights reserved.
7
- //
8
-
9
- #import "AppDelegate+Frank.h"
10
- #import <CoreData/CoreData.h>
11
- #import <JSONKit/JSONKit.h>
12
- #import <RestKit/RestKit.h>
13
-
14
- @implementation AppDelegate (Frank)
15
-
16
- - (void) seedCoreData:(NSString *)json
17
- {
18
- NSArray *objectsArray = [json objectFromJSONString];
19
- NSManagedObjectContext *managedObjectContext = [[RKObjectManager sharedManager].objectStore managedObjectContextForCurrentThread];
20
- for (NSDictionary *objectDictionary in objectsArray) {
21
- NSString *entityName = [objectDictionary allKeys][0];
22
- NSDictionary *dictionary = [objectDictionary objectForKey:entityName];
23
- NSManagedObject *object = [NSEntityDescription insertNewObjectForEntityForName:entityName inManagedObjectContext:managedObjectContext];
24
- for (NSString *nextKey in [dictionary allKeys]) {
25
- if ([object respondsToSelector:NSSelectorFromString(nextKey)]) {
26
- NSObject *value = [dictionary objectForKey:nextKey];
27
- if (value != [NSNull null]) {
28
- [object setValue:value forKey:nextKey];
29
- }
30
- }
31
- }
32
- }
33
-
34
- NSError *error = nil;
35
- if (![managedObjectContext save:&error]) {
36
- NSLog(@"Error saving: %@", [error localizedDescription]);
37
- }
38
- }
39
-
40
- @end
@@ -1,29 +0,0 @@
1
- require 'pickle/world'
2
-
3
- def ios_sdk
4
- IOS_SDK
5
- end
6
-
7
- def xcode_version
8
- XCODE_VERSION
9
- end
10
-
11
- def app_path
12
- ENV['APP_BUNDLE_PATH'] || (defined?(APP_BUNDLE_PATH) && APP_BUNDLE_PATH)
13
- end
14
-
15
- Given /^I launch the app in the (iphone|ipad) simulator$/ do |device|
16
- launch_app app_path, ios_sdk, device
17
- end
18
-
19
- Given /^I reset and launch the app in the (iphone|ipad) simulator$/ do |device|
20
- fwt_simulator_reset_data ios_sdk
21
- launch_app app_path, ios_sdk, device
22
- end
23
-
24
- Given /^I reset and launch the app in the (iphone|ipad) simulator, seeded with #{capture_model}$/ do |device, capture_model|
25
- fwt_simulator_reset_data ios_sdk
26
- launch_app app_path, ios_sdk, device
27
- fwt_seed_app [capture_model]
28
- launch_app app_path, ios_sdk, device
29
- end