Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix loading files when running executable from gem install

  • Loading branch information...
commit 4ca13fefb43867eb93d96e695ea0717edb5ca467 1 parent f41e64f
Dan Ryan authored
2  .gitignore
View
@@ -1,2 +1,4 @@
log/*.log
pkg
+.yardoc
+doc
8 Gemfile
View
@@ -14,6 +14,7 @@ gem 'sinatra', '>= 1.2.6'
gem 'sinatra-logger', '>= 0.1.1', :require => 'sinatra/logger'
gem 'activesupport', '>= 3.0.9', :require => 'active_support/all'
gem 'gli', '>= 1.3.2'
+
group :development, :test do
gem 'rspec', '>= 2.6.0'
gem 'rack-test', '>= 0.6.0', :require => 'rack/test'
@@ -23,3 +24,10 @@ group :development, :test do
gem 'json_spec', '>= 0.5.0'
gem "timecop", ">= 0.3.5"
end
+
+
+group :doc do
+ gem 'yard'
+ # gem 'rdiscount'
+ gem 'yard-dm', '>= 0'
+end
4 Gemfile.lock
View
@@ -72,6 +72,8 @@ GEM
uuidtools (2.1.2)
watchr (0.7)
yajl-ruby (0.8.2)
+ yard (0.7.2)
+ yard-dm (0.1.1)
PLATFORMS
ruby
@@ -98,3 +100,5 @@ DEPENDENCIES
timecop (>= 0.3.5)
watchr (>= 0.7)
yajl-ruby (>= 0.8.2)
+ yard
+ yard-dm
25 README.md
View
@@ -1,5 +1,26 @@
-## TODO
+
+
+
+## Features
+
+### Resources
+
+One of the biggest differences
+### Snapshots
+
+When a snapshot is recorded, it's socked away in its raw form so you can come back at a later time and review the exact state of a given resource without having to piece individual metrics together.
+
+### Metrics
+
+Snapshots are also broken up and saved as individual attribute/value pairs, which enables you to track a particular attribute over a given period of time.
+
+
+## Roadmap
* Documentation. Like, seriously.
-* Have log output go to STDOUT like a proper service
+* Log to STDOUT like a proper service.
+* Callbacks! Decide what happens after data gets collected.
+* Taggable resources and snapshots
+## TODO
+
* Let config file be, er, configurable
7 Rakefile
View
@@ -25,6 +25,13 @@ task :spork do
sh %{bundle exec spork}
end
+
+Bundler.require(:doc)
+desc "Generate documentation"
+YARD::Rake::YardocTask.new do |t|
+ t.files = [ 'lib/**/*.rb' ]
+end
+
# namespace :resque do
# task :setup do
# require 'resque'
14 bin/overwatch-collection
View
@@ -1,9 +1,13 @@
#!/usr/bin/env ruby
-$: << File.expand_path(File.dirname(__FILE__) + "/../lib")
+require 'gli'
+
+$: << File.expand_path(File.join(File.dirname(__FILE__), "../lib"))
require 'overwatch/collection'
-require 'gli'
+
+
+puts $:.inspect
include GLI
@@ -12,17 +16,17 @@ version Overwatch::Collection::VERSION
desc 'Start overwatch-collection server'
command :start do |c|
c.desc 'Port to which to bind'
- c.arg_name '[PORT]'
+ c.arg_name 'PORT'
c.default_value '9001'
c.flag [:p, :port]
c.desc 'Host on which to run'
- c.arg_name '[HOST]'
+ c.arg_name 'HOST'
c.default_value 'localhost'
c.flag [:h, :host]
c.desc 'Config file'
- c.arg_name '[CONFIG]'
+ c.arg_name 'CONFIG'
c.default_value File.expand_path(File.join(File.dirname(__FILE__), "/../config/overwatch.yml"))
c.flag [:c, :config]
20 lib/overwatch/collection.rb
View
@@ -1,15 +1,16 @@
require 'bundler'
Bundler.require(:default)
-$: << File.join(File.dirname(__FILE__), ".")
-
-require 'overwatch/collection/version'
-require 'overwatch/collection/attributes'
-require 'overwatch/collection/models/resource'
-require 'overwatch/collection/models/snapshot'
-require 'overwatch/collection/application'
+require File.expand_path(File.join(File.dirname(__FILE__), "collection/attributes"))
+require File.expand_path(File.join(File.dirname(__FILE__), "collection/models/resource"))
+require File.expand_path(File.join(File.dirname(__FILE__), "collection/models/snapshot"))
+require File.expand_path(File.join(File.dirname(__FILE__), "collection/application"))
module Overwatch
+ module Collection
+ VERSION = "0.0.3"
+ end
+
class << self
def config_path=(path)
@config_path = path
@@ -24,10 +25,7 @@ def config
@config.merge!(YAML.load_file(config_path))
end
end
-
- module Collection
-
- end
+
end
$redis = Redis.new(
4 lib/overwatch/collection/application.rb
View
@@ -42,5 +42,5 @@ class Application < Sinatra::Base
end
end
-require 'overwatch/collection/routes/resource'
-require 'overwatch/collection/routes/snapshot'
+require File.expand_path(File.join(File.dirname(__FILE__), "routes/resource"))
+require File.expand_path(File.join(File.dirname(__FILE__), "routes/snapshot"))
2  lib/overwatch/collection/models/snapshot.rb
View
@@ -4,7 +4,6 @@ class Snapshot
property :id, Serial, :index => true
property :data, Json
- # property :raw_data, Json
property :created_at, DateTime
property :updated_at, DateTime
property :created_on, Date
@@ -48,7 +47,6 @@ def schedule_reaper
end
end
- # Usage: to_dotted_hash({:one => :two}) # => "one.two"
def to_dotted_hash(source=self.data,target = {}, namespace = nil)
prefix = "#{namespace}." if namespace
case source
Please sign in to comment.
Something went wrong with that request. Please try again.