Permalink
Browse files

Updated gem settings

  • Loading branch information...
1 parent e08e7cc commit c6bbb653e632d4ebe221502888e5c3de9b17128e @krakatoa krakatoa committed Oct 22, 2012
Showing with 57 additions and 16 deletions.
  1. +1 −1 Gemfile
  2. +2 −0 Gemfile.lock
  3. +7 −1 Rakefile
  4. +10 −10 cucub-server.gemspec
  5. +32 −0 lib/configuration.rb
  6. +4 −3 lib/cucub-server.rb
  7. +1 −1 lib/server.rb
View
@@ -6,7 +6,7 @@ source "http://rubygems.org"
gem "thor"
gem "servolux"
gem "ma-zmq", :path => "/home/krakatoa/workspace/al-nattahnam/ma-zmq"
-gem "cucub-protocol", :path => "/home/krakatoa/workspace/al-nattahnam/cucub/protocol"
+gem "cucub-protocol", :path => "/home/krakatoa/workspace/al-nattahnam/cucub/protocol", :require => "cucub-protocol"
# Add dependencies to develop your gem here.
# Include everything needed to run rake, tests, features, etc.
View
@@ -2,6 +2,7 @@ PATH
remote: /home/krakatoa/workspace/al-nattahnam/cucub/protocol
specs:
cucub-protocol (0.0.1)
+ inifile
msgpack
PATH
@@ -20,6 +21,7 @@ GEM
ffi-rzmq (0.9.3)
ffi
git (1.2.5)
+ inifile (2.0.2)
jeweler (1.8.4)
bundler (~> 1.0)
git (>= 1.2.5)
View
@@ -27,14 +27,20 @@ Jeweler::Tasks.new do |gem|
end
Jeweler::RubygemsDotOrgTasks.new
+require 'rspec/core'
+require 'rspec/core/rake_task'
+RSpec::Core::RakeTask.new(:spec) do |spec|
+ spec.pattern = FileList['spec/**/*_spec.rb']
+end
+
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end
-task :default => :test
+task :default => :spec
require 'rdoc/task'
Rake::RDocTask.new do |rdoc|
View
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Fernando Alonso"]
- s.date = "2012-09-02"
+ s.date = "2012-10-22"
s.description = "longer description of your gem"
s.email = "krakatoa1987@gmail.com"
s.executables = ["cucub-server"]
@@ -50,28 +50,28 @@ Gem::Specification.new do |s|
s.add_runtime_dependency(%q<thor>, [">= 0"])
s.add_runtime_dependency(%q<servolux>, [">= 0"])
s.add_runtime_dependency(%q<ma-zmq>, [">= 0"])
- s.add_development_dependency(%q<shoulda>, [">= 0"])
- s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
- s.add_development_dependency(%q<bundler>, ["~> 1.1.3"])
+ s.add_runtime_dependency(%q<cucub-protocol>, [">= 0"])
+ s.add_development_dependency(%q<rspec>, [">= 0"])
+ s.add_development_dependency(%q<bundler>, ["~> 1.2.1"])
s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
s.add_development_dependency(%q<simplecov>, [">= 0"])
else
s.add_dependency(%q<thor>, [">= 0"])
s.add_dependency(%q<servolux>, [">= 0"])
s.add_dependency(%q<ma-zmq>, [">= 0"])
- s.add_dependency(%q<shoulda>, [">= 0"])
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
- s.add_dependency(%q<bundler>, ["~> 1.1.3"])
+ s.add_dependency(%q<cucub-protocol>, [">= 0"])
+ s.add_dependency(%q<rspec>, [">= 0"])
+ s.add_dependency(%q<bundler>, ["~> 1.2.1"])
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
s.add_dependency(%q<simplecov>, [">= 0"])
end
else
s.add_dependency(%q<thor>, [">= 0"])
s.add_dependency(%q<servolux>, [">= 0"])
s.add_dependency(%q<ma-zmq>, [">= 0"])
- s.add_dependency(%q<shoulda>, [">= 0"])
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
- s.add_dependency(%q<bundler>, ["~> 1.1.3"])
+ s.add_dependency(%q<cucub-protocol>, [">= 0"])
+ s.add_dependency(%q<rspec>, [">= 0"])
+ s.add_dependency(%q<bundler>, ["~> 1.2.1"])
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
s.add_dependency(%q<simplecov>, [">= 0"])
end
View
@@ -0,0 +1,32 @@
+require 'singleton'
+
+module Cucub
+ class Configuration
+ include Singleton
+
+ def initialize
+ @loader = Cucub::Protocol::Loader.instance
+ set_config_file
+ reload
+ end
+
+ def set_config_file
+ @loader.set_path("./config/protocol.ini")
+ end
+
+ def reload
+ @specification_set = @loader.parse
+ @uses = nil
+ end
+
+ def uses
+ # lazy load array of uses
+ return @uses if @uses
+ uses = []
+ uses << "box" if @specification_set.uses_box
+ uses << "mailbox" if @specification_set.uses_mailbox
+ uses << "board" if @specification_set.uses_board
+ @uses = uses
+ end
+ end
+end
View
@@ -1,5 +1,6 @@
require 'cucub-protocol'
-require 'server'
-require 'channel'
-require 'dispatcher'
+require './lib/configuration'
+require './lib/server'
+require './lib/channel'
+require './lib/dispatcher'
View
@@ -33,7 +33,7 @@ def run
end
def prefork
- workers_pool = Servolux::Pre
+ #workers_pool = Servolux::Pre
end
def before_stopping

0 comments on commit c6bbb65

Please sign in to comment.