appengine-tools 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'date'
5
5
  require 'spec/rake/spectask'
6
6
 
7
7
  GEM = "appengine-tools"
8
- GEM_VERSION = "0.0.6"
8
+ GEM_VERSION = "0.0.7"
9
9
  AUTHOR = "Ryan Brown"
10
10
  EMAIL = "ribrdb@gmail.com"
11
11
  HOMEPAGE = "http://code.google.com/p/appengine-jruby"
@@ -24,12 +24,13 @@ spec = Gem::Specification.new do |s|
24
24
  s.homepage = HOMEPAGE
25
25
 
26
26
  s.require_path = 'lib'
27
- s.files = %w(LICENSE README.rdoc Rakefile) + Dir.glob("{lib,spec}/**/*.rb")
27
+ s.files = %w(LICENSE README.rdoc Rakefile) +
28
+ Dir.glob("{lib,spec}/**/*.rb") + Dir.glob("lib/**/*.class")
28
29
  s.executables = [ 'appcfg.rb', 'dev_appserver.rb' ]
29
30
  s.add_dependency('appengine-rack')
30
31
  s.add_dependency('appengine-sdk')
31
32
  s.add_dependency('appengine-jruby-jars')
32
- s.add_dependency('bundler')
33
+ s.add_dependency('bundler', ["~> 0.7.2"])
33
34
  s.add_dependency('rubyzip')
34
35
  end
35
36
 
@@ -25,46 +25,45 @@ module AppEngine
25
25
  if defined? Java
26
26
  AppCfg = AppEngine::SDK.load_appcfg
27
27
  import Java.ComGoogleAppengineToolsAdmin.AppAdminFactory
28
- import Java.ComGoogleAppengineToolsAdmin.AppVersionUpload
29
28
  import Java.ComGoogleAppengineToolsUtil.Logging
30
29
 
31
- class JRubyAppVersionUpload < AppVersionUpload
32
- def initialize(connection, app)
33
- @connection = connection
34
- @app = app
35
- super(connection, app)
36
- end
37
-
38
- def getIndexYaml
39
- indexes = merge_indexes
30
+ $CLASSPATH << File.dirname(__FILE__)
31
+ import Java.ComGoogleAppengineJruby.AppVersionUploadDelegate
32
+ import Java.ComGoogleAppengineJruby.JRubyAppVersionUpload
33
+
34
+ class UploadDelegate
35
+ include AppVersionUploadDelegate
36
+
37
+ def index_yaml(app)
38
+ indexes = merge_indexes(app)
40
39
  if indexes
41
40
  return indexes.to_yaml
42
41
  end
43
- nil
42
+ ''
44
43
  end
45
44
 
46
- def getCronYaml
45
+ def cron_yaml(app)
47
46
  cron = File.join(app.path, 'cron.yaml')
48
47
  if File.exists?(cron)
49
48
  return IO.read(cron)
50
49
  end
51
- nil
50
+ ''
52
51
  end
53
52
 
54
- def getQueueYaml
53
+ def queue_yaml(app)
55
54
  queue = File.join(app.path, 'queue.yaml')
56
55
  if File.exists?(queue)
57
56
  return IO.read(queue)
58
57
  end
59
- nil
58
+ ''
60
59
  end
61
60
 
62
- def merge_indexes
63
- if @app.indexes_xml
64
- indexes = YAML.load(@app.indexes_xml.to_yaml)['indexes']
61
+ def merge_indexes(app)
62
+ if app.indexes_xml
63
+ indexes = YAML.load(app.indexes_xml.to_yaml)['indexes']
65
64
  end
66
65
  indexes ||= []
67
- index_yaml = File.join(@app.path, 'index.yaml')
66
+ index_yaml = File.join(app.path, 'index.yaml')
68
67
  if File.exist?(index_yaml)
69
68
  manual_indexes = YAML.load_file(index_yaml)['indexes'] || []
70
69
  manual_indexes.each do |index|
@@ -109,8 +108,9 @@ EOF
109
108
  end
110
109
 
111
110
  def run_appcfg(args)
111
+ JRubyAppVersionUpload.set_delegate(UploadDelegate.new)
112
112
  factory = AppAdminFactory.new
113
- factory.setAppVersionUploadClass(JRubyAppVersionUpload)
113
+ factory.setAppVersionUploadClass(JRubyAppVersionUpload.java_class)
114
114
  Logging.initializeLogging
115
115
  AppCfg.new(factory, args.to_java(java.lang.String))
116
116
  end
@@ -34,6 +34,8 @@ module AppEngine
34
34
  should_exec = options[:exec]
35
35
  should_exec ||= should_exec.nil?
36
36
 
37
+ # TODO This is really ugly. We should just be using -I
38
+ # for the paths we need (appengine-tools and it's deps)
37
39
  ENV['GEM_HOME'] = Gem.dir
38
40
  ENV['GEM_PATH'] = Gem.path.compact.join(File::SEPARATOR)
39
41
  appcfg = [File.expand_path(File.join(File.dirname($0),
@@ -22,6 +22,13 @@ require 'zip/zipfilesystem'
22
22
  require 'rubygems/command_manager'
23
23
  require 'appengine-tools/bundler'
24
24
 
25
+ # Support Ruby 1.6, without active_support/extensions/facets
26
+ class Symbol
27
+ def to_proc
28
+ Proc.new { |*args| args.shift.__send__(self, *args) }
29
+ end unless :to_proc.respond_to?(:to_proc)
30
+ end
31
+
25
32
  module AppEngine
26
33
  module Admin
27
34
 
@@ -65,16 +72,6 @@ module AppEngine
65
72
  exit e.exit_code unless e.exit_code == 0
66
73
  end
67
74
  bundler_dir = "#{app.gems_dir}/bundler_gems"
68
- # TODO: this temporary hack should be fixed properly
69
- gem_patch = <<MOD
70
- # Injected by appengine-tools to patch bundler for Sinatra and Rails 3
71
- module Gem
72
- def self.default_dir; ENV['GEM_HOME']; end
73
- def self.dir; ENV['GEM_HOME']; end
74
- def self.path; ENV['GEM_PATH']; end
75
- end
76
- MOD
77
- File.open("#{bundler_dir}/environment.rb",'a') {|f| f << gem_patch }
78
75
  FileUtils.rm app.gems_jar, :force => true # blow away the old jar
79
76
  puts "=> Packaging gems"
80
77
  gem_files = Dir["#{bundler_dir}/gems/**/**"] +
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appengine-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Brown
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-07 00:00:00 -08:00
12
+ date: 2009-12-22 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -48,9 +48,9 @@ dependencies:
48
48
  version_requirement:
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ">="
51
+ - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: "0"
53
+ version: 0.7.2
54
54
  version:
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rubyzip
@@ -76,18 +76,20 @@ files:
76
76
  - LICENSE
77
77
  - README.rdoc
78
78
  - Rakefile
79
- - lib/appengine-tools/update_check.rb
80
79
  - lib/appengine-tools/appcfg.rb
80
+ - lib/appengine-tools/boot.rb
81
81
  - lib/appengine-tools/bundler.rb
82
+ - lib/appengine-tools/dev_appserver.rb
82
83
  - lib/appengine-tools/gem_bundler.rb
83
- - lib/appengine-tools/xml-formatter.rb
84
- - lib/appengine-tools/boot.rb
84
+ - lib/appengine-tools/update_check.rb
85
85
  - lib/appengine-tools/web-xml.rb
86
- - lib/appengine-tools/dev_appserver.rb
86
+ - lib/appengine-tools/xml-formatter.rb
87
87
  - spec/rack_spec.rb
88
- - spec/update_check_spec.rb
89
88
  - spec/spec_helper.rb
89
+ - spec/update_check_spec.rb
90
90
  - spec/web-xml_spec.rb
91
+ - lib/appengine-tools/com/google/appengine/jruby/AppVersionUploadDelegate.class
92
+ - lib/appengine-tools/com/google/appengine/jruby/JRubyAppVersionUpload.class
91
93
  has_rdoc: true
92
94
  homepage: http://code.google.com/p/appengine-jruby
93
95
  licenses: []