Skip to content

Commit

Permalink
Adding bundler, applist button
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Olson committed Dec 20, 2010
1 parent d0f4788 commit 6437005
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ config/appbuilder.yml
db/*.sqlite3
.project
.tmp*
.bundle*
*.swp*
7 changes: 7 additions & 0 deletions .rvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
&& -s "${rvm_path:-$HOME/.rvm}/environments/ruby-1.8.7-p302@appbuilder" ]] ; then
\. "${rvm_path:-$HOME/.rvm}/environments/ruby-1.8.7-p302@appbuilder"
else
rvm --create use "ruby-1.8.7-p302@appbuilder"
fi
10 changes: 10 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# A sample Gemfile
source "http://rubygems.org"

gem "rails", "2.3.8"
gem "authlogic"
gem "httparty"
gem "oauth"
gem "kynetx_am_api"
gem "multipart-post", :require => "net/http/post/multipart"
gem "sqlite3-ruby", :require => "sqlite3"
47 changes: 47 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
GEM
remote: http://rubygems.org/
specs:
actionmailer (2.3.8)
actionpack (= 2.3.8)
actionpack (2.3.8)
activesupport (= 2.3.8)
rack (~> 1.1.0)
activerecord (2.3.8)
activesupport (= 2.3.8)
activeresource (2.3.8)
activesupport (= 2.3.8)
activesupport (2.3.8)
authlogic (2.1.6)
activesupport
crack (0.1.8)
httparty (0.6.1)
crack (= 0.1.8)
json (1.4.6)
kynetx_am_api (0.1.29)
json
multipart-post
oauth
multipart-post (1.0.1)
oauth (0.4.4)
rack (1.1.0)
rails (2.3.8)
actionmailer (= 2.3.8)
actionpack (= 2.3.8)
activerecord (= 2.3.8)
activeresource (= 2.3.8)
activesupport (= 2.3.8)
rake (>= 0.8.3)
rake (0.8.7)
sqlite3-ruby (1.3.2)

PLATFORMS
ruby

DEPENDENCIES
authlogic
httparty
kynetx_am_api
multipart-post
oauth
rails (= 2.3.8)
sqlite3-ruby
1 change: 1 addition & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ def app_menu(current, ruleset_id, additional_breadcrumb=nil)

# TODO: Replace these with the actual images when we get them
menu_items = [
{:controller => "applications", :action => "index", :link => "App List"},
{:controller => "manage", :action => "index", :link => current == :manage ? "<img src='/images/nav/manage-current.png'/>" : "<img src='/images/nav/manage.png'/>"},
{:controller => "applications", :action => "edit", :link => current == :edit ? "<img src='/images/nav/edit-current.png'/>" : "<img src='/images/nav/edit.png'/>"},
{:controller => "test_app", :action => "index", :link => current == :test ? "<img src='/images/nav/test-current.png'/>" : "<img src='/images/nav/test.png'/>"},
Expand Down
27 changes: 21 additions & 6 deletions config/environment.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
# Be sure to restart your server when you modify this file

# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
RAILS_GEM_VERSION = '2.3.8' unless defined? RAILS_GEM_VERSION

# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')

class Rails::Boot
def run
load_initializer

Rails::Initializer.class_eval do
def load_gems
@bundler_loaded ||= Bundler.require :default, Rails.env
end
end

Rails::Initializer.run(:set_load_path)
end
end


Rails::Initializer.run do |config|
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
Expand All @@ -19,11 +34,11 @@
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
# config.gem "sqlite3-ruby", :lib => "sqlite3"
# config.gem "aws-s3", :lib => "aws/s3"
config.gem "authlogic"
config.gem "httparty"
config.gem "oauth"
config.gem "kynetx_am_api"
config.gem "multipart-post", :lib => "net/http/post/multipart"
#config.gem "authlogic"
#config.gem "httparty"
#config.gem "oauth"
#config.gem "kynetx_am_api"
#config.gem "multipart-post", :lib => "net/http/post/multipart"

# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named
Expand Down
21 changes: 21 additions & 0 deletions config/preinitializer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
begin
require "rubygems"
require "bundler"
rescue LoadError
raise "Could not load the bundler gem. Install it with `gem install bundler`."
end

if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24")
raise RuntimeError, "Your bundler version is too old for Rails 2.3." +
"Run `gem install bundler` to upgrade."
end

begin
# Set up load paths for all bundled gems
ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
Bundler.setup
rescue Bundler::GemNotFound
raise RuntimeError, "Bundler couldn't find some gems." +
"Did you run `bundle install`?"
end

0 comments on commit 6437005

Please sign in to comment.