Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Separating the Gemfile that Scout uses for runtime from the one we us…

  • Loading branch information...
commit 46253bdf496c3e1091ca6dafbc35d6a62e76303f 1 parent b434d21
@zdennis zdennis authored
View
8 config/environment.rb
@@ -1,7 +1,7 @@
require 'rubygems'
require 'bundler'
-require File.join(File.dirname(__FILE__), 'environments', ENV["SCOUT_ENV"] || "build")
+require File.join(File.dirname(__FILE__), 'environments', ENV["SCOUT_ENV"])
$: << File.join(File.dirname(__FILE__), '..', 'lib')
@@ -13,11 +13,15 @@ def self.root
def self.config_directory
File.join(root, "config")
end
-
+
def self.config_files
Dir[File.join(config_directory, "*.xml")]
end
+ def self.runtime_config_directory
+ File.join(root, "src/config")
+ end
+
def self.download(url, destination)
require 'open-uri'
open(destination, "wb"){ |f| f.write open(url).read }
View
2  config/environments/development.rb
@@ -1 +1 @@
-Bundler.require(:default)
+Bundler.require(:default, :build)
View
1  config/environments/production.rb
@@ -0,0 +1 @@
+Bundler.require(:default, :build)
View
0  config/environments/build.rb → config/environments/test.rb
File renamed without changes
View
14 lib/tasks/build.rake
@@ -2,6 +2,14 @@ desc "Build Scout"
task :build => ["environment", "air:runtime:check", "air:sdk:check", "build:jruby", "build:bundle", "build:bin", "build:staticmatic", "build:config"]
namespace :build do
+ %w(development test production).each do |env|
+ desc "Build the application for the #{env} environment"
+ task "#{env}" do
+ ENV["SCOUT_ENV"] = env
+ Rake::Task["build"].invoke
+ end
+ end
+
task :jruby => 'environment' do
FileUtils.mkdir_p(Scout.build_vendor_directory)
unless File.exists?(Scout.jruby_complete_jar)
@@ -14,7 +22,7 @@ namespace :build do
# Do not pass in --without bundle as that sets .bundle/config
with_env("BUNDLE_WITHOUT" => "build") do
jruby "gem install -r bundler" unless Scout.jruby_gem_exists?("bundler")
- jruby "bundle"
+ jruby "bundle install --gemfile src/config/Gemfile"
end
end
@@ -28,8 +36,8 @@ namespace :build do
end
task :config => 'environment' do
- FileUtils.cp_r(Scout.config_files, Scout.build_directory)
- # TODO: Gemfile?
+ FileUtils.cp_r Scout.runtime_config_directory, Scout.build_directory
+ FileUtils.cp File.join(Scout.config_directory, "#{ENV['SCOUT_ENV']}.xml"), Scout.build_directory
end
desc "Clears dev environment by removing the build/ directory"
View
2  lib/tasks/run.rake
@@ -1,6 +1,6 @@
%w(development test production).each do |env|
desc "Runs the application in the #{env} environment"
- task "run:#{env}" => "build" do
+ task "run:#{env}" => "build:#{env}" do
with_env(
"GEM_HOME" => nil,
"GEM_PATH" => nil,
View
1  src/bin/compass
@@ -1,5 +1,6 @@
ENV["GEM_HOME"] = File.join File.dirname(__FILE__), "../vendor/gems"
ENV["GEM_PATH"] = ENV["GEM_HOME"]
+ENV["BUNDLE_GEMFILE"] = File.join File.dirname(__FILE__), "../config/Gemfile"
require "rubygems"
require "bundler/setup"
View
6 src/config/Gemfile
@@ -0,0 +1,6 @@
+# A sample Gemfile
+source "http://rubygems.org"
+
+gem "compass", "= 0.11.5"
+gem "compass-960-plugin", "= 0.10.4", :require => "ninesixty"
+gem "yui-compass-plugin", :require => "yui"
View
22 src/config/Gemfile.lock
@@ -0,0 +1,22 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ chunky_png (1.2.0)
+ compass (0.11.5)
+ chunky_png (~> 1.2)
+ fssm (>= 0.2.7)
+ sass (~> 3.1)
+ compass-960-plugin (0.10.4)
+ compass (>= 0.10.0)
+ fssm (0.2.7)
+ sass (3.1.7)
+ yui-compass-plugin (0.3)
+ compass (>= 0.10.0)
+
+PLATFORMS
+ java
+
+DEPENDENCIES
+ compass (= 0.11.5)
+ compass-960-plugin (= 0.10.4)
+ yui-compass-plugin
Please sign in to comment.
Something went wrong with that request. Please try again.