Permalink
Browse files

link Bobbit application to rails frontend

  • Loading branch information...
1 parent b662a08 commit eb7361eb75216394d9d1ca1322805d4cb55a9278 @wizardwerdna committed Jul 29, 2012
Showing with 156 additions and 6 deletions.
  1. +15 −0 Gemfile
  2. +101 −0 Gemfile.lock
  3. +3 −3 z_rails.ru
  4. +3 −3 z_rails/config/database.yml
  5. +19 −0 z_rails/initialize_and_seed_memory_repo.rb
  6. +15 −0 z_rails/main.rb
View
15 Gemfile
@@ -1,3 +1,18 @@
source "http://rubygems.org"
gem 'rspec'
gem 'sinatra'
+
+#
+# from rails Gemfile
+#
+gem 'rails', '3.2.6'
+gem 'pg'
+group :assets do
+ gem 'sass-rails', '~> 3.2.3'
+ gem 'coffee-rails', '~> 3.2.1'
+ gem 'uglifier', '>= 1.0.3'
+end
+gem 'jquery-rails'
+
+# gem 'bcrypt-ruby', '~> 3.0.0'
+
View
@@ -1,10 +1,88 @@
GEM
remote: http://rubygems.org/
specs:
+ actionmailer (3.2.6)
+ actionpack (= 3.2.6)
+ mail (~> 2.4.4)
+ actionpack (3.2.6)
+ activemodel (= 3.2.6)
+ activesupport (= 3.2.6)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.1)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.1.3)
+ activemodel (3.2.6)
+ activesupport (= 3.2.6)
+ builder (~> 3.0.0)
+ activerecord (3.2.6)
+ activemodel (= 3.2.6)
+ activesupport (= 3.2.6)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.6)
+ activemodel (= 3.2.6)
+ activesupport (= 3.2.6)
+ activesupport (3.2.6)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ arel (3.0.2)
+ builder (3.0.0)
+ coffee-rails (3.2.2)
+ coffee-script (>= 2.2.0)
+ railties (~> 3.2.0)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.3.3)
diff-lcs (1.1.3)
+ erubis (2.7.0)
+ execjs (1.4.0)
+ multi_json (~> 1.0)
+ hike (1.2.1)
+ i18n (0.6.0)
+ journey (1.0.4)
+ jquery-rails (2.0.2)
+ railties (>= 3.2.0, < 5.0)
+ thor (~> 0.14)
+ json (1.7.4)
+ mail (2.4.4)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.19)
+ multi_json (1.3.6)
+ pg (0.14.0)
+ polyglot (0.3.3)
rack (1.4.1)
+ rack-cache (1.2)
+ rack (>= 0.4)
rack-protection (1.2.0)
rack
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.1)
+ rack (>= 1.0)
+ rails (3.2.6)
+ actionmailer (= 3.2.6)
+ actionpack (= 3.2.6)
+ activerecord (= 3.2.6)
+ activeresource (= 3.2.6)
+ activesupport (= 3.2.6)
+ bundler (~> 1.0)
+ railties (= 3.2.6)
+ railties (3.2.6)
+ actionpack (= 3.2.6)
+ activesupport (= 3.2.6)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (>= 0.14.6, < 2.0)
+ rake (0.9.2.2)
+ rdoc (3.12)
+ json (~> 1.4)
rspec (2.10.0)
rspec-core (~> 2.10.0)
rspec-expectations (~> 2.10.0)
@@ -13,15 +91,38 @@ GEM
rspec-expectations (2.10.0)
diff-lcs (~> 1.1.3)
rspec-mocks (2.10.1)
+ sass (3.1.20)
+ sass-rails (3.2.5)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
sinatra (1.3.2)
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
tilt (~> 1.3, >= 1.3.3)
+ sprockets (2.1.3)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ thor (0.15.4)
tilt (1.3.3)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.33)
+ uglifier (1.2.6)
+ execjs (>= 0.3.0)
+ multi_json (~> 1.3)
PLATFORMS
ruby
DEPENDENCIES
+ coffee-rails (~> 3.2.1)
+ jquery-rails
+ pg
+ rails (= 3.2.6)
rspec
+ sass-rails (~> 3.2.3)
sinatra
+ uglifier (>= 1.0.3)
View
6 z_rails.ru 100644 → 100755
@@ -1,4 +1,4 @@
+#!/usr/bin/env rackup
# This file is used by Rack-based servers to start the application.
-
-require ::File.expand_path('../config/environment', __FILE__)
-run ZRails::Application
+require ::File.expand_path('z_rails/main')
+run Bobbit::Main.new
@@ -17,7 +17,7 @@ development:
encoding: unicode
database: z_rails_development
pool: 5
- username: z_rails
+ username: werdna
password:
# Connect on a TCP socket. Omitted by default since the client uses a
@@ -43,13 +43,13 @@ test:
encoding: unicode
database: z_rails_test
pool: 5
- username: z_rails
+ username: werdna
password:
production:
adapter: postgresql
encoding: unicode
database: z_rails_production
pool: 5
- username: z_rails
+ username: werdna
password:
@@ -0,0 +1,19 @@
+require_relative '../repositories/memory_repos'
+
+def configure_memory_repository
+ Repository.configure ({
+ Page => MemoryRepos::PageRepo.new
+ })
+end
+
+def seed_repository_for_page_entities
+ [
+ Page.new(name: 'google', locator: 'http://www.google.com'),
+ Page.new(name: 'cnn', locator: 'http://www.cnn.com'),
+ Page.new(name: 'apple', locator: 'http://www.apple.com')
+ ].each{|each| Repository.for(Page).store each}
+end
+
+configure_memory_repository
+seed_repository_for_page_entities
+
View
@@ -0,0 +1,15 @@
+require_relative '../application'
+require_relative 'initialize_and_seed_memory_repo'
+require ::File.expand_path('../config/environment', __FILE__)
+
+module Bobbit
+
+ class Main
+
+ def call env
+ ZRails::Application.call env
+ end
+
+ end
+
+end

0 comments on commit eb7361e

Please sign in to comment.