Skip to content
Browse files

isolate server files

  • Loading branch information...
1 parent 8783eaa commit 55a0a159e14719c476216e1a0d8e31dfb98aad61 @technoweenie committed Feb 19, 2011
View
23 Gemfile
@@ -1,11 +1,18 @@
source "http://rubygems.org"
gem 'yajl-ruby', :require => 'yajl'
-gem 'excon'
-gem "toystore"
-gem "adapter"
-gem "adapter-riak", :require => 'adapter/riak'
-gem "adapter-redis", :require => 'adapter/redis'
-gem "redis"
-gem "riak-client", :require => 'riak/search'
-gem "sinatra", :require => false
+
+group :client do
+ gem 'faraday'
+end
+
+group :server do
+ gem 'excon'
+ gem "toystore"
+ gem "adapter"
+ gem "adapter-riak", :require => 'adapter/riak'
+ gem "adapter-redis", :require => 'adapter/redis'
+ gem "redis"
+ gem "riak-client", :require => 'riak/search'
+ gem "sinatra", :require => false
+end
View
8 README.md
@@ -27,14 +27,6 @@ And the Riaks:
## USAGE
-You can start an irb console to play around:
-
- ruby allofthestars.rb
-
-If you want to access it over HTTP, start the sinatra API server:
-
- STARS_ENV=production ruby allofthestars.rb
-
All JSON API for now. The actual serialization and fields will likely
change.
View
4 config.ru
@@ -1,3 +1,3 @@
-require File.join(File.dirname(__FILE__), 'allofthestars')
-require 'allofthestars/web'
+require File.join(File.dirname(__FILE__), 'lib/allofthestars/server')
+require 'allofthestars/server/web'
run AllOfTheStars::Web
View
10 allofthestars.rb → lib/allofthestars/server.rb
@@ -7,11 +7,11 @@ class << self
end
end
-Bundler.require(:default)
-$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
+Bundler.require(:default, :server)
+$LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__)
options = {:http_backend => :Excon}
-config = File.expand_path('../db/config.json', __FILE__)
+config = File.expand_path('../../../db/config.json', __FILE__)
if File.exist?(config)
data = ActiveSupport::JSON.decode(IO.read(config))
data.each do |key, value|
@@ -20,5 +20,5 @@ class << self
end
AllOfTheStars.riak_client = Riak::Client.new(options)
-require 'allofthestars/cluster'
-require 'allofthestars/star'
+require 'allofthestars/server/cluster'
+require 'allofthestars/server/star'
View
0 lib/allofthestars/cluster.rb → lib/allofthestars/server/cluster.rb
File renamed without changes.
View
0 lib/allofthestars/star.rb → lib/allofthestars/server/star.rb
File renamed without changes.
View
0 lib/allofthestars/web.rb → lib/allofthestars/server/web.rb
File renamed without changes.

0 comments on commit 55a0a15

Please sign in to comment.
Something went wrong with that request. Please try again.