New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved the Ruby integration into its own XPC service. #120

Merged
merged 10 commits into from Nov 29, 2015

Conversation

Projects
None yet
3 participants
@alloy
Member

alloy commented Nov 29, 2015

  • Adds an extra layer of safety against possible bugs in RubyCocoa.
  • Makes it easier to profile e.g. memory of just the Ruby stuff.
  • Removes the need to have Swift workarounds in RubyCocoa, as there is no Swift in the XPC service.
  • Shows how to create the service for a future ‘installer’ service.
CPInformativeError, // These are user errors
CPStandardError, // These are runtime errors
CPNonRubyError // These are errors on the Objective-C side of the bridge
};

This comment has been minimized.

@segiddins

segiddins Nov 29, 2015

Member

trailing newline

withReply:(void (^ _Nonnull)(NSArray<NSString *> * _Nullable plugins, NSError * _Nullable error))reply;

@end

This comment has been minimized.

@segiddins

segiddins Nov 29, 2015

Member

extra newline

@alloy

This comment has been minimized.

Member

alloy commented Nov 29, 2015

The service is currently not DI’ed into the CPPodfileReflection class, but instead retrieved from the app delegate singleton.

@alloy

This comment has been minimized.

Member

alloy commented Nov 29, 2015

@segiddins 👍


@protocol CPReflectionServiceProtocol

- (void)pluginsFromPodfile:(NSString * _Nonnull)contents

This comment has been minimized.

@orta

orta Nov 29, 2015

Member

nice work on the nulling


} else {
code = CPNonRubyError;
exceptionName = exception.name;
description = exception.reason;

This comment has been minimized.

@orta

orta Nov 29, 2015

Member

in this case the rubyBacktrace is nil which can cause a crash in the error dict

This comment has been minimized.

@alloy

alloy Nov 29, 2015

Member

Good point!

// ReflectionService
//
// Created by Eloy Durán on 28/11/15.
// Copyright © 2015 CocoaPods. All rights reserved.

This comment has been minimized.

@orta

orta Nov 29, 2015

Member

lillllll theeessseeee headers

This comment has been minimized.

@alloy

alloy Nov 29, 2015

Member

Yeah………

@orta

This comment has been minimized.

Member

orta commented Nov 29, 2015

The service is currently not DI’ed into the CPPodfileReflection class

This is cool for now, something like running pod lib create can't live inside a CPPodfileReflection DI hierarchy anyway.

@alloy

This comment has been minimized.

Member

alloy commented Nov 29, 2015

Updated.

@orta

This comment has been minimized.

Member

orta commented Nov 29, 2015

Took a second look at the XPC stuff, I expected it to be much more complex than it is. Looks 👍 - add the newline to app/CPReflectionService/CPRubyErrors.h and its merged.

@alloy

This comment has been minimized.

Member

alloy commented Nov 29, 2015

Those newlines were already fixed.

@orta

This comment has been minimized.

@alloy

This comment has been minimized.

Member

alloy commented Nov 29, 2015

Hmm, weird, I think Xcode might have reverted it… fixed for reals now

@orta

This comment has been minimized.

Member

orta commented Nov 29, 2015

Segiddin's Approved -ish ™️

orta added a commit that referenced this pull request Nov 29, 2015

Merge pull request #120 from CocoaPods/xpc-rubycocoa
Moved the Ruby integration into its own XPC service.

@orta orta merged commit 2dc1eb0 into master Nov 29, 2015

@alloy alloy deleted the xpc-rubycocoa branch Nov 29, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment