Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1290)

Unified Diff: pkg/appengine/lib/src/appengine_context.dart

Issue 804973002: Add appengine/gcloud/mustache dependencies. (Closed) Base URL: git@github.com:dart-lang/pub-dartlang-dart.git@master
Patch Set: Added AUTHORS/LICENSE/PATENTS files Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/appengine/lib/src/appengine_context.dart
diff --git a/pkg/appengine/lib/src/appengine_context.dart b/pkg/appengine/lib/src/appengine_context.dart
new file mode 100644
index 0000000000000000000000000000000000000000..78e8ae5495521e8d9d010c750aeb63fb958eb6bf
--- /dev/null
+++ b/pkg/appengine/lib/src/appengine_context.dart
@@ -0,0 +1,33 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library appengine.appengine_context;
+
+import 'server/assets.dart';
+
+class AppengineContext {
+ final String applicationID;
+ final String partition;
+ final String version;
+ final String module;
+ final String instance;
+ final AssetsManager assets;
+
+ AppengineContext(String partition, this.applicationID, this.version,
+ this.module, this.instance, Uri pubServeUrl)
+ : partition = partition,
+ assets = new AssetsManager(pubServeUrl, partition == 'dev');
+
+ bool get isDevelopmentEnvironment => partition == 'dev';
+
+ String get fullQualifiedApplicationId => '$partition~$applicationID';
+
+ String get backgroundTicket {
+ var majorVersion = version.split('_')[0];
+ var escapedApplicationID =
+ applicationID.replaceAll(':', '_').replaceAll('.', '_');
+
+ return '$escapedApplicationID/$module.$majorVersion.$instance';
+ }
+}
« no previous file with comments | « pkg/appengine/lib/src/app_engine_request_handler.dart ('k') | pkg/appengine/lib/src/appengine_internal.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698