Permalink
Browse files

Removed Framework

  • Loading branch information...
1 parent d0277dd commit b15c89ad604d5358215301a87e2d40ecf8fd5e9f Maria Shaldibina and Tim Labeeuw committed Feb 20, 2013
@@ -16,9 +16,8 @@ class StagingPlugin::Config < VCAP::Config
},
optional("environment") => { # This is misnamed, but it is called this
- "services" => [Hash], # throughout the existing staging code. We use
- "framework_info" => Hash, # it to maintain consistency.
- "runtime_info" => Hash,
+ "services" => [Hash], # throughout the existing staging code.
+ "runtime_info" => Hash, # We use it to maintain consistency.
"resources" => {
"memory" => Integer,
"disk" => Integer,
@@ -43,11 +43,10 @@ def self.camelize(word)
uc_parts.join
end
- def self.load_plugin_for(framework)
- framework = framework.to_s
- plugin_path = File.join(staging_root, framework, 'plugin.rb')
+ def self.load_plugin_for
+ plugin_path = File.join(staging_root, 'buildpack', 'plugin.rb')
require plugin_path
- Object.const_get("#{camelize(framework)}Plugin")
+ BuildpackPlugin
end
# Exits the process with a nonzero status if ARGV does not contain valid
@@ -99,8 +98,6 @@ def self.from_file(cfg_filename)
#
# NB: Environment is not what you think it is (better named app_properties?). It is a hash of:
# :services => [service_binding_hash] # See ServiceBinding#for_staging in cloud_controller/app/models/service_binding.rb
- # :framework => {framework properties from manifest}
- # :runtime => {runtime properties}
# :resources => { # See App#resource_requirements or App#limits (they return identical hashes)
# :memory => mem limits in MB # in cloud_controller/app/models/app.rb
# :disk => disk limits in MB
@@ -148,10 +145,6 @@ def script_dir
destination_directory
end
- def framework
- environment[:framework_info]
- end
-
def stage_application
raise NotImplementedError, "subclasses must implement a 'stage_application' method"
end
@@ -201,7 +194,6 @@ def environment_hash
@env_variables ||= build_environment_hash
end
- # Overridden in subclasses when the framework needs to start from a different directory.
def change_directory_for_start
"cd app"
end
@@ -289,31 +281,10 @@ def copy_source_files(dest = nil)
system "cp -a #{File.join(source_directory, "*")} #{dest}"
end
- def detection_rules
- environment[:framework_info][:detection]
- end
-
def bound_services
environment[:services] || []
end
- # Returns all the application files that match detection patterns.
- # This excludes files that are checked for existence/non-existence.
- # Returned pathnames are relative to the app directory:
- # e.g. [sinatra_app.rb, lib/somefile.rb]
- def app_files_matching_patterns
- matching = []
- detection_rules.each do |rule|
- rule.each do |glob, pattern|
- next unless String === pattern
- full_glob = File.join(app_dir, glob)
- files = scan_files_for_regexp(app_dir, full_glob, pattern)
- matching.concat(files)
- end
- end
- matching
- end
-
# Full path to the Ruby we are running under.
def current_ruby
File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
@@ -39,7 +39,7 @@ def app_source(tempdir = nil)
# automatically deletes it when the block returns.
def stage(env = {})
raise "Call 'app_fixture :name_of_app' before staging" unless @app_fixture
- plugin_klass = StagingPlugin.load_plugin_for(env[:framework_info][:name])
+ plugin_klass = BuildpackPlugin
working_dir = Dir.mktmpdir("#{@app_fixture}-staged")
source_tempdir = nil
source_dir = app_source
@@ -262,18 +262,6 @@ def packages_with_start_script(staged_dir, start_command)
end
def buildpack_staging_env(services=[])
- {:runtime_info => {
- :name => "ruby18",
- :version => "1.8.7",
- :description => "Ruby 1.8.7",
- :executable => "/usr/bin/ruby",
- :environment => {"bundle_gemfile" => nil}
- },
- :framework_info => {
- :name => "buildpack",
- :runtimes => [{"ruby18" => {"default" => true}}, {"ruby19" => {"default" => false}}]
- },
- :services => services
- }
+ { :services => services }
end
end
View
@@ -38,8 +38,6 @@
'source_dir' => 'test',
'dest_dir' => 'test',
'environment' => {
- 'framework_info' => {'name' => 'sinatra'},
- 'runtime_info' => {'name' => 'ruby18'},
'resources' => {
'memory' => 128,
'disk' => 2048,

0 comments on commit b15c89a

Please sign in to comment.