Permalink
Browse files

Gem layout, before applying http://florianhanke.com/blog/2011/02/02/r…

  • Loading branch information...
1 parent d4e1f5a commit eabe454a7cbacbe54a661fc3686b9be12fb82c0f @dmytro committed Mar 12, 2013
View
@@ -6,3 +6,4 @@ doc
.DS_Store
tmp
.rbx
+*.gem
View
35 Gemfile
@@ -1,35 +1,2 @@
source 'http://rubygems.org'
-
-gem 'sinatra', '>= 1.3.1'
-
-gem 'ruby-nagios', ">= 0.1.0"
-# :git => 'https://github.com/dmytro/ruby-nagios.git',
-# :branch => 'fix/stale_objects_in_statusdat'
-#
-# RSpec modules should be in all environments - to be able to test prod config
-# too
-#
-gem 'rspec-core'
-gem 'rspec-mocks'
-gem 'rspec-expectations'
-
-group :development,:test do
- gem 'redcarpet', :platforms => :ruby
- gem 'sinatra-contrib', '>= 1.3.1'
- gem 'rake'
- gem 'yard', "~> 0.8"
- gem "growl", "~> 1.0.3"
- gem "guard-brakeman", "~> 0.5.0"
- gem "guard-rspec", "~> 1.2.1"
-end
-
-# for Hash.extract!
-gem 'activesupport'
-
-
-# Active_Model required for this:
-# 'active_model/serialization'
-# 'active_model/serializers/xml' # for Hash.to_xml
-gem 'activemodel'
-
-gem 'json'
+gemspec
View
@@ -1,13 +1,27 @@
+PATH
+ remote: .
+ specs:
+ nagira (0.2.2)
+ activemodel
+ activesupport
+ json
+ rspec
+ rspec-core
+ rspec-expectations
+ rspec-mocks
+ ruby-nagios (>= 0.1.0)
+ sinatra (>= 1.3.1)
+
GEM
remote: http://rubygems.org/
specs:
- activemodel (3.2.5)
- activesupport (= 3.2.5)
+ activemodel (3.2.12)
+ activesupport (= 3.2.12)
builder (~> 3.0.0)
- activesupport (3.2.5)
+ activesupport (3.2.12)
i18n (~> 0.6)
multi_json (~> 1.0)
- backports (2.6.1)
+ backports (3.1.1)
brakeman (1.7.1)
activesupport
erubis (~> 2.6)
@@ -20,78 +34,86 @@ GEM
ruby_parser (= 2.3.1)
sass (~> 3.0)
terminal-table (~> 1.4)
- builder (3.0.0)
- diff-lcs (1.1.3)
+ builder (3.0.4)
+ coderay (1.0.9)
+ diff-lcs (1.2.1)
erubis (2.7.0)
- eventmachine (0.12.10)
+ eventmachine (1.0.3)
fastercsv (1.5.5)
growl (1.0.3)
- guard (1.3.2)
- listen (>= 0.4.2)
+ guard (1.6.2)
+ listen (>= 0.6.0)
+ lumberjack (>= 1.0.2)
+ pry (>= 0.9.10)
+ terminal-table (>= 1.4.3)
thor (>= 0.14.6)
- guard-brakeman (0.5.0)
- brakeman (>= 1.5.3)
+ guard-brakeman (0.5.1)
+ brakeman (~> 1.7.0)
guard (>= 1.1.0)
guard-rspec (1.2.1)
guard (>= 1.1)
- haml (3.1.7)
- highline (1.6.14)
- i18n (0.6.0)
- json (1.7.3)
- json_pure (1.7.5)
- listen (0.5.0)
- multi_json (1.3.6)
- rack (1.4.1)
- rack-protection (1.2.0)
+ haml (3.1.8)
+ highline (1.6.15)
+ i18n (0.6.4)
+ json (1.7.7)
+ json_pure (1.7.7)
+ listen (0.7.3)
+ lumberjack (1.0.2)
+ method_source (0.8.1)
+ multi_json (1.6.1)
+ pry (0.9.12)
+ coderay (~> 1.0.5)
+ method_source (~> 0.8)
+ slop (~> 3.4)
+ rack (1.5.2)
+ rack-protection (1.4.0)
rack
- rack-test (0.6.1)
+ rack-test (0.6.2)
rack (>= 1.0)
- rake (0.9.2.2)
+ rake (10.0.3)
redcarpet (2.2.2)
- rspec-core (2.10.1)
- rspec-expectations (2.10.0)
- diff-lcs (~> 1.1.3)
- rspec-mocks (2.10.1)
+ rspec (2.13.0)
+ rspec-core (~> 2.13.0)
+ rspec-expectations (~> 2.13.0)
+ rspec-mocks (~> 2.13.0)
+ rspec-core (2.13.0)
+ rspec-expectations (2.13.0)
+ diff-lcs (>= 1.1.3, < 2.0)
+ rspec-mocks (2.13.0)
ruby-nagios (0.1.0)
ruby2ruby (1.3.1)
ruby_parser (~> 2.0)
sexp_processor (~> 3.0)
ruby_parser (2.3.1)
sexp_processor (~> 3.0)
- sass (3.2.1)
+ sass (3.2.7)
sexp_processor (3.2.0)
- sinatra (1.3.2)
- rack (~> 1.3, >= 1.3.6)
- rack-protection (~> 1.2)
+ sinatra (1.3.5)
+ rack (~> 1.4)
+ rack-protection (~> 1.3)
tilt (~> 1.3, >= 1.3.3)
- sinatra-contrib (1.3.1)
+ sinatra-contrib (1.3.2)
backports (>= 2.0)
eventmachine
rack-protection
rack-test
sinatra (~> 1.3.0)
tilt (~> 1.3)
+ slop (3.4.3)
terminal-table (1.4.5)
- thor (0.16.0)
- tilt (1.3.3)
- yard (0.8.1)
+ thor (0.17.0)
+ tilt (1.3.5)
+ yard (0.8.5.2)
PLATFORMS
ruby
DEPENDENCIES
- activemodel
- activesupport
growl (~> 1.0.3)
guard-brakeman (~> 0.5.0)
guard-rspec (~> 1.2.1)
- json
+ nagira!
rake
redcarpet
- rspec-core
- rspec-expectations
- rspec-mocks
- ruby-nagios (>= 0.1.0)
- sinatra (>= 1.3.1)
sinatra-contrib (>= 1.3.1)
yard (~> 0.8)
View
@@ -1,3 +1,7 @@
+ - v.0.2.2
+ - Packaged as gem
+ - Add background parser
+ - Add ActiveSupport
* Wed Dec 19 2012 - Dmytro Kovalov
- v.0.2.1
- fix for DOS formatted and spaces in config ; better error reporting for spec. fixes #8
View
@@ -8,11 +8,22 @@ Version {include:file:version.txt}
## Description
-Light-weight web services API for fetching status of Nagios application objects:
+- Light-weight web services RESTful API for reading and changing status of Nagios objects:
+ - host status
+ - service status
+- and for read-only access to:
+* Nagios objects
+ - hosts
+ - services,
+ - contacts,
+ - groups of
+ - hosts
+ - services
+ - contacts
+ - escalations, etc.
+* Nagios server configuration
+* Nagios runtime environment
-* Objects file: hosts, services, contacts, `(host|service|contact)groups`, escalations, etc.
-
-* Status file: hoststatus, servicestatus, etc.
## Source Code
View
@@ -44,7 +44,7 @@
#
#
-require_relative 'lib/nagira'
+require 'nagira'
##
# Main class of Nagira application implementing RESTful API for
@@ -267,13 +267,6 @@ class Nagira < Sinatra::Base
body( @callback ? "#{@callback.to_s} (#{@data.to_json})" : @data.send("to_#{@format}") )
end
- require_relative "app/routes/get/config"
- require_relative "app/routes/get/objects"
- require_relative "app/routes/get/status"
-
- require_relative "app/routes/put"
- require_relative "app/routes/put/status"
-
##
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -7,11 +7,19 @@
require 'active_model/serializers/xml' # for Hash.to_xml
require 'sinatra'
require 'sinatra/reloader'
-require 'pp'
$: << File.dirname(__FILE__) << File.dirname(File.dirname(__FILE__))
require 'config/defaults'
+
+require "app/routes/get/config"
+require "app/routes/get/objects"
+require "app/routes/get/status"
+
+require "app/routes/put"
+require "app/routes/put/status"
+
+
#
# environment file must go after default, some settings override
# defaults.
View
@@ -8,21 +8,47 @@ spec = Gem::Specification.new do |s|
s.homepage = 'http://dmytro.github.com/nagira'
s.platform = Gem::Platform::RUBY
s.summary = 'Nagira : Nagios RESTful API'
- s.description = ""
+ s.description =<<-EOF
- s.files = ( %w{ nagira.rb version.txt spec/00_configuration_spec.rb } +
- Dir.glob("./app/**/*.rb") +
- Dir.glob("./lib/**/*.rb") +
- Dir.glob("./config/*.rb")
+Nagira -- Nagios RESTful API
+============================
+
+Description
+------------
+
+Light-weight web services RESTful API for reading and changing
+status of Nagios objects: host status service status and for
+read-only access to: Nagios objects hosts services, contacts,
+groups of hosts services contacts escalations, etc., to Nagios
+server configuration and to Nagios runtime environment
+
+EOF
+
+ s.files = ( %w{ bin/nagira Rakefile version.txt} +
+ Dir.glob("{app,lib,spec,config}/**/*")
).uniq
s.require_paths << 'lib'
- s.has_rdoc = true
- s.extra_rdoc_files = ['README.md']
- s.rdoc_options << '--title' << 'Nagira' << '--main' << 'README.md' << '-ri'
s.bindir = 'bin'
- s.executables << 'nagira.rb'
- s.add_dependency('nagios')
- s.add_development_dependency('rake')
- s.add_development_dependency('yard')
+ s.executables << 'nagira'
+ # GEMS
+
+ s.add_dependency 'activemodel'
+ s.add_dependency 'activesupport'
+ s.add_dependency 'json'
+ s.add_dependency 'rspec'
+ s.add_dependency 'rspec-core'
+ s.add_dependency 'rspec-expectations'
+ s.add_dependency 'rspec-mocks'
+ s.add_dependency 'ruby-nagios', ">= 0.1.0"
+ s.add_dependency 'sinatra', '>= 1.3.1'
+
+ # Dev
+ s.add_development_dependency "growl", "~> 1.0.3"
+ s.add_development_dependency "guard-brakeman", "~> 0.5.0"
+ s.add_development_dependency "guard-rspec", "~> 1.2.1"
+ s.add_development_dependency 'rake'
+ s.add_development_dependency 'redcarpet'
+ s.add_development_dependency 'sinatra-contrib', '>= 1.3.1'
+ s.add_development_dependency 'yard', "~> 0.8"
end
View
@@ -1 +1 @@
-0.2.1
+0.2.2

0 comments on commit eabe454

Please sign in to comment.