lanekit 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Zjk5ZTM1ZGRhNzMzYjRhYjVhMDRhMzQyOTQwNGQxMDUyMTliM2FkMg==
4
+ NzNmZTdiNTkwYTJjOWQyMTBmYTY1ZjhjODJmNmIzYzk5MDhhZGNlMA==
5
5
  data.tar.gz: !binary |-
6
- MzRiMTQzMDJkOGQ4NjQxOTFkZDY4NTU3ODY2MTA1NjAyMWIwZTA1ZA==
6
+ MDYwNzFhYjIxZGEyNjUxMmRjMzNiYTJkZjkwNDY5ZjdjNjM4ZTc4NQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDA3YTFhZDZkMGRiY2I0ZWZlM2JmN2RkNTM3YjJiOWNiMmY2ZThkYzk5Mzg0
10
- ZmVjMGZjZGE2YmEwOGFlNDU3NjNmMjAwZWU3OThkNjc3MzRhMzNiZDFmOGQ1
11
- NWUzNDc4MDZkNWRkZjQ0MWIyNGQ1MTUxYzhjNDQwMWM2ZjU5OWQ=
9
+ YmZkZTZmNzgwZmFjNDg4ODA0ZjM5ZTZkMjU4ZGUxZTE2OGFiNTQ0NjRjOWU1
10
+ ZjkwNmFjYzBhODc3YjAxMTMyMmI1NTkxYjVhNjY0ZWZkMmUwOGJiYmNhZWYx
11
+ NDQ5N2FlYjdjZjhmZGIzYjJiYTdjZGM2M2Q1MDRmYzEwZjhjODY=
12
12
  data.tar.gz: !binary |-
13
- NzFhOTJlOTRmNTJkZGQ5OGRiY2M5MjAxNjQ1NDc5NjI2NDJlZGVmMDJkNzM5
14
- YjIyZDkxZjNmNjkwNTI5MGQyNzA1OTIxNjZiOTMzMzk1MGMwN2E2ZDAyMzU1
15
- OWZiMWE5ZjU0NjJlZGM1MGIxZjA1ZmNjMmU4ZWRmMTkyOWNmNzk=
13
+ YmU2NGJiMDE3NzgzNDlhMTAxZWU5YTc3ZmZiOGQxMzU0MjkxYWIwOTE3NTU5
14
+ MjZlMWIzMzFmNzk2YzhiNWZmYjM4ZjFlYzk3ODczZTllMDJjZjkwMTMwYzJh
15
+ YWQ1YTZjNTE0YmFmZGI3MGY4YTAxMGQ5YzZkYWVmYzhiYTM4OWM=
data/lib/lanekit.rb CHANGED
@@ -55,6 +55,32 @@ module LaneKit
55
55
  project.save
56
56
  end
57
57
 
58
+ # Adds a acknowledgements.plist line to a CocoaPods Podfile
59
+ def self.add_acknowledgements_to_podfile(app_name)
60
+ podfile_path = File.expand_path('Podfile')
61
+ if !File.exists?(podfile_path)
62
+ puts "Can't find Podfile #{podfile_path}"
63
+ return
64
+ end
65
+
66
+ str = "
67
+ post_install do | installer |
68
+ require 'fileutils'
69
+ FileUtils.cp_r('Pods/Pods-acknowledgements.plist', '#{app_name}/#{app_name}/Resources/Settings.bundle/Acknowledgements.plist', :remove_destination => true)
70
+ end
71
+ "
72
+
73
+ if !self.does_text_exist_in_file?(podfile_path, "acknowledgements.plist")
74
+ open(podfile_path, 'a') do |file|
75
+ file.puts str
76
+ end
77
+
78
+ system "pod install"
79
+ else
80
+ puts "The acknowledgements.plist already exists in Podfile"
81
+ end
82
+ end
83
+
58
84
  # Adds a pod file line to a CocoaPods Podfile
59
85
  def self.add_pod_to_podfile(pod_name)
60
86
  podfile_path = File.expand_path('Podfile')
@@ -77,7 +103,7 @@ module LaneKit
77
103
  # Returns an app name from a folder path.
78
104
  # "Tracker" => "Tracker", "~/Projects/Runner" => "Runner"
79
105
  def self.derive_app_name(app_path)
80
- app_name = File.basename(app_path).to_s
106
+ File.basename(app_path).to_s
81
107
  end
82
108
 
83
109
  # Model names are lower case
data/lib/lanekit/new.rb CHANGED
@@ -66,10 +66,18 @@ module LaneKit
66
66
  workspace_path = File.join(@app_path_full, "#{@app_name}.xcworkspace")
67
67
  say_status :clean, workspace_path, :yellow
68
68
  workspace = Xcodeproj::Workspace.new_from_xcworkspace(workspace_path)
69
- container = "container:#{@app_name}/#{@app_name}.xcodeproj"
70
- if workspace.include?(container)
71
- workspace.projpaths.delete(container)
72
- workspace.save_as(workspace_path)
69
+
70
+ this_app = 0
71
+ workspace.file_references.each do |reference|
72
+ ## https://github.com/CocoaPods/Xcodeproj/issues/190
73
+ if reference.path.include? @app_name
74
+ this_app += 1
75
+ if this_app > 1
76
+ workspace.file_references.delete(reference)
77
+ workspace.save_as(workspace_path)
78
+ break
79
+ end
80
+ end
73
81
  end
74
82
  end
75
83
 
@@ -85,6 +93,11 @@ module LaneKit
85
93
  Dir.chdir(@project_path) do
86
94
  puts "Installing CocoaPods for RestKit"
87
95
  system "pod install"
96
+
97
+ end
98
+ # Add the acknowledgements to the Pod file
99
+ Dir.chdir(@app_path_full) do
100
+ LaneKit.add_acknowledgements_to_podfile(@app_name)
88
101
  end
89
102
  end
90
103
 
@@ -1,3 +1,3 @@
1
1
  module LaneKit
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.0"
3
3
  end
@@ -5,10 +5,4 @@ inhibit_all_warnings!
5
5
 
6
6
  link_with ['lanekit-ios-project', 'lanekit-ios-projectTests']
7
7
 
8
- pod 'RestKit', '0.23.1'
9
-
10
- post_install do | installer |
11
- require 'fileutils'
12
- FileUtils.cp_r('../Pods/Pods-acknowledgements.plist', 'lanekit-ios-project/Resources/Settings.bundle/Acknowledgements.plist', :remove_destination => true)
13
- end
14
-
8
+ pod 'RestKit', '0.23.2'
@@ -8,4 +8,6 @@
8
8
 
9
9
  @property (strong, nonatomic) UIWindow *window;
10
10
 
11
+ + (LKAppDelegate *)sharedAppDelegate;
12
+
11
13
  @end
@@ -7,6 +7,25 @@
7
7
 
8
8
  @implementation LKAppDelegate
9
9
 
10
+ + (LKAppDelegate *)sharedAppDelegate
11
+ {
12
+ return (LKAppDelegate *)UIApplication.sharedApplication.delegate;
13
+ }
14
+
15
+ + (void)initialize
16
+ {
17
+ if (self == [LKAppDelegate class]) {
18
+ }
19
+ }
20
+
21
+ - (instancetype)init
22
+ {
23
+ self = [super init];
24
+ if (self) {
25
+ }
26
+ return self;
27
+ }
28
+
10
29
  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
11
30
  {
12
31
  UIViewController *controller = UIViewController.new;
@@ -20,6 +20,7 @@ typedef void(^<%=@provider_base_class_name%>CallbackBlock)(NSError *error, id re
20
20
  - (void)downloadWithCompletionBlock:(LKResourceProviderCallbackBlock)completionBlock;
21
21
  - (Class)modelClass;
22
22
  - (id)processResult:(RKMappingResult *)mappingResult withError:(NSError **)error;
23
+ - (void)processError:(NSError *)error;
23
24
  - (RKResponseDescriptor *)responseDescriptor;
24
25
 
25
26
  @end
@@ -20,12 +20,17 @@
20
20
  NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:baseURL]];
21
21
  RKResponseDescriptor *responseDescriptor = [self responseDescriptor];
22
22
  RKObjectRequestOperation *operation = [[RKObjectRequestOperation alloc] initWithRequest:request responseDescriptors:@[responseDescriptor]];
23
+
24
+ [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
23
25
 
24
26
  [operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) {
27
+ [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
25
28
  NSError *error = nil;
26
29
  id result = [self processResult:mappingResult withError:&error];
27
30
  completionBlock(nil, result);
28
31
  } failure:^(RKObjectRequestOperation *operation, NSError *error) {
32
+ [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
33
+ [self processError:error];
29
34
  completionBlock(error, nil);
30
35
  }];
31
36
  [operation start];
@@ -43,6 +48,11 @@
43
48
  return nil;
44
49
  }
45
50
 
51
+ // Subclasses can override this method
52
+ - (void)processError:(NSError *)error
53
+ {
54
+ }
55
+
46
56
  // Subclasses may need to override this method
47
57
  - (RKResponseDescriptor *)responseDescriptor
48
58
  {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lanekit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Larry Aasen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-25 00:00:00.000000000 Z
11
+ date: 2014-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods
@@ -67,7 +67,7 @@ description: ! 'LaneKit is an iOS Objective-C code generator for integration wit
67
67
  including fixtures and tests. LaneKit is a command line app written in Ruby and
68
68
  packaged as a Ruby Gem.'
69
69
  email:
70
- - larryaasen@gmail.com
70
+ - ''
71
71
  executables:
72
72
  - lanekit
73
73
  extensions: []