noah 0.0.5-jruby
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +13 -0
- data/.gitignore +7 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +83 -0
- data/README.md +213 -0
- data/Rakefile +105 -0
- data/autotest/discover.rb +1 -0
- data/bin/noah +8 -0
- data/config.ru +3 -0
- data/doc/coverage/index.html +138 -0
- data/doc/coverage/jquery-1.3.2.min.js +19 -0
- data/doc/coverage/jquery.tablesorter.min.js +15 -0
- data/doc/coverage/lib-helpers_rb.html +393 -0
- data/doc/coverage/lib-models_rb.html +1449 -0
- data/doc/coverage/noah_rb.html +2019 -0
- data/doc/coverage/print.css +12 -0
- data/doc/coverage/rcov.js +42 -0
- data/doc/coverage/screen.css +270 -0
- data/lib/noah/app.rb +317 -0
- data/lib/noah/applications.rb +46 -0
- data/lib/noah/configurations.rb +49 -0
- data/lib/noah/helpers.rb +57 -0
- data/lib/noah/hosts.rb +54 -0
- data/lib/noah/models.rb +5 -0
- data/lib/noah/services.rb +57 -0
- data/lib/noah/version.rb +3 -0
- data/lib/noah/watchers.rb +18 -0
- data/lib/noah.rb +18 -0
- data/noah.gemspec +44 -0
- data/spec/application_spec.rb +83 -0
- data/spec/configuration_spec.rb +25 -0
- data/spec/host_spec.rb +119 -0
- data/spec/noahapp_application_spec.rb +108 -0
- data/spec/noahapp_configuration_spec.rb +112 -0
- data/spec/noahapp_host_spec.rb +116 -0
- data/spec/noahapp_service_spec.rb +121 -0
- data/spec/noahapp_spec.rb +20 -0
- data/spec/service_spec.rb +112 -0
- data/spec/spec_helper.rb +105 -0
- data/views/200.erb +1 -0
- data/views/404.erb +1 -0
- data/views/500.erb +1 -0
- data/views/index.haml +49 -0
- metadata +309 -0
data/.autotest
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'autotest/growl'
|
2
|
+
Autotest.add_hook(:initialize) {|at|
|
3
|
+
at.add_exception %r{^\.git} # ignore Version Control System
|
4
|
+
at.add_exception %r{^./tmp} # ignore temp files, lest autotest will run again, and again...
|
5
|
+
at.clear_mappings # take out the default (test/test*rb)
|
6
|
+
at.add_mapping(%r{^noah\.rb$}) {|f, _|
|
7
|
+
Dir['spec/**/*.rb']
|
8
|
+
}
|
9
|
+
at.add_mapping(%r{^lib/.*\.rb$}) {|f, _|
|
10
|
+
Dir['spec/**/*.rb']
|
11
|
+
}
|
12
|
+
nil
|
13
|
+
}
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
noah (0.0.5-java)
|
5
|
+
haml (= 3.0.25)
|
6
|
+
ohm (= 0.1.3)
|
7
|
+
ohm-contrib (= 0.1.0)
|
8
|
+
rake (= 0.8.7)
|
9
|
+
sinatra (= 1.1.2)
|
10
|
+
sinatra-namespace (= 0.6.1)
|
11
|
+
vegas (= 0.1.8)
|
12
|
+
|
13
|
+
GEM
|
14
|
+
remote: http://rubygems.org/
|
15
|
+
specs:
|
16
|
+
ZenTest (4.4.2)
|
17
|
+
autotest (4.4.6)
|
18
|
+
ZenTest (>= 4.4.1)
|
19
|
+
autotest-growl (0.2.9)
|
20
|
+
backports (1.18.2)
|
21
|
+
diff-lcs (1.1.2)
|
22
|
+
haml (3.0.25)
|
23
|
+
jruby-jars (1.5.6)
|
24
|
+
jruby-rack (1.0.5)
|
25
|
+
monkey-lib (0.5.4)
|
26
|
+
backports
|
27
|
+
nest (1.1.0)
|
28
|
+
redis (~> 2.1)
|
29
|
+
ohm (0.1.3)
|
30
|
+
nest (~> 1.0)
|
31
|
+
ohm-contrib (0.1.0)
|
32
|
+
ohm
|
33
|
+
rack (1.2.1)
|
34
|
+
rack-test (0.5.7)
|
35
|
+
rack (>= 1.0)
|
36
|
+
rake (0.8.7)
|
37
|
+
redis (2.1.1)
|
38
|
+
rspec (2.4.0)
|
39
|
+
rspec-core (~> 2.4.0)
|
40
|
+
rspec-expectations (~> 2.4.0)
|
41
|
+
rspec-mocks (~> 2.4.0)
|
42
|
+
rspec-core (2.4.0)
|
43
|
+
rspec-expectations (2.4.0)
|
44
|
+
diff-lcs (~> 1.1.2)
|
45
|
+
rspec-mocks (2.4.0)
|
46
|
+
rubyzip (0.9.4)
|
47
|
+
sinatra (1.1.2)
|
48
|
+
rack (~> 1.1)
|
49
|
+
tilt (~> 1.2)
|
50
|
+
sinatra-advanced-routes (0.5.1)
|
51
|
+
monkey-lib (~> 0.5.0)
|
52
|
+
sinatra (~> 1.0)
|
53
|
+
sinatra-sugar (~> 0.5.0)
|
54
|
+
sinatra-namespace (0.6.1)
|
55
|
+
sinatra (~> 1.1)
|
56
|
+
sinatra-reloader (0.5.0)
|
57
|
+
sinatra (~> 1.0)
|
58
|
+
sinatra-advanced-routes (~> 0.5.0)
|
59
|
+
sinatra-sugar (0.5.0)
|
60
|
+
monkey-lib (~> 0.5.0)
|
61
|
+
sinatra (~> 1.0)
|
62
|
+
tilt (1.2.2)
|
63
|
+
vegas (0.1.8)
|
64
|
+
rack (>= 1.0.0)
|
65
|
+
warbler (1.2.1)
|
66
|
+
jruby-jars (>= 1.4.0)
|
67
|
+
jruby-rack (>= 1.0.0)
|
68
|
+
rake (>= 0.8.7)
|
69
|
+
rubyzip (>= 0.9.4)
|
70
|
+
|
71
|
+
PLATFORMS
|
72
|
+
java
|
73
|
+
ruby
|
74
|
+
|
75
|
+
DEPENDENCIES
|
76
|
+
ZenTest (= 4.4.2)
|
77
|
+
autotest (= 4.4.6)
|
78
|
+
autotest-growl (= 0.2.9)
|
79
|
+
noah!
|
80
|
+
rack-test (= 0.5.7)
|
81
|
+
rspec (= 2.4.0)
|
82
|
+
sinatra-reloader (= 0.5.0)
|
83
|
+
warbler (= 1.2.1)
|
data/README.md
ADDED
@@ -0,0 +1,213 @@
|
|
1
|
+
# Noah testing quickstart
|
2
|
+
(make sure redis is running)
|
3
|
+
|
4
|
+
## Setup
|
5
|
+
There is no specific configuration file in use anymore. Everything is configured via command-line options to the noah binary or stored in config.ru.
|
6
|
+
|
7
|
+
* The instance of Redis is configured via the `REDIS_URL` env setting. This is honored by Ohm.
|
8
|
+
* Redis DSN strings are in the format of "redis://hostname:port/db"
|
9
|
+
* `RACK_ENV` is honored.
|
10
|
+
* `rake sample["redis://localhost:6379/2"]` populates the locally running redis instance - db 2
|
11
|
+
* `rake spec` runs the test suite (using 'redis://localhost:6379/3' for storing test data)
|
12
|
+
|
13
|
+
_rake sample_
|
14
|
+
|
15
|
+
Creating Host entry for 'localhost'
|
16
|
+
Create Service entry for redis
|
17
|
+
Create Service entry for noah
|
18
|
+
Creating Application entry for 'noah'
|
19
|
+
Creating Configuration entry for 'noah'
|
20
|
+
Creating sample entries - Host and Service
|
21
|
+
Creating sample entries - Application and Configuration
|
22
|
+
Setup successful!
|
23
|
+
|
24
|
+
## Run it
|
25
|
+
There are two way to run Noah
|
26
|
+
|
27
|
+
### config.ru
|
28
|
+
Edit config.ru to change the redis instance or rack environment.
|
29
|
+
|
30
|
+
### bin/noah
|
31
|
+
The binary script in bin was created using [Vegas](https://github.com/quirkey/vegas). It accepts the familiar rack options as well as an option for specifying the redis url.
|
32
|
+
|
33
|
+
bin/noah -p 9292 -s thin -d -F -e production -r redis://localhost:6379/2
|
34
|
+
[2011-02-07 16:48:15 -0500] Starting 'noah'...
|
35
|
+
[2011-02-07 16:48:15 -0500] trying port 9292...
|
36
|
+
Couldn't get a file descriptor referring to the console
|
37
|
+
[2011-02-07 16:48:15 -0500] Running with Rack handler: Rack::Handler::Thin
|
38
|
+
>> Thin web server (v1.2.7 codename No Hup)
|
39
|
+
>> Maximum connections set to 1024
|
40
|
+
>> Listening on 0.0.0.0:9292, CTRL+C to stop
|
41
|
+
|
42
|
+
If you leave off `-F`, all information will be logged to `$HOME/.vegas/noah`. Run `bin/noah -h` for more options.
|
43
|
+
|
44
|
+
Please note on JRuby that the port setting does not work for some f'cking reason. Bug claims to have been fixed. Until then, when on Jruby run like so:
|
45
|
+
|
46
|
+
noah -F -d -r redis://localhost:6379/0
|
47
|
+
|
48
|
+
## Example links
|
49
|
+
[Noah Start Page](http://localhost:9292/)
|
50
|
+
|
51
|
+
If you have Noah running, you can hit the above link for some links created by the setup samples.
|
52
|
+
|
53
|
+
## All configs
|
54
|
+
_curl http://localhost:9292/c/_
|
55
|
+
|
56
|
+
[
|
57
|
+
{"id":"1",
|
58
|
+
"name":"db",
|
59
|
+
"format":"string",
|
60
|
+
"body":"redis://127.0.0.1:6379/0",
|
61
|
+
"update_at":"2011-01-17 14:12:43 UTC",
|
62
|
+
"application":"noah"
|
63
|
+
}
|
64
|
+
]
|
65
|
+
|
66
|
+
## All services
|
67
|
+
_curl http://localhost:9292/s/_
|
68
|
+
|
69
|
+
[
|
70
|
+
{
|
71
|
+
"id":"1",
|
72
|
+
"name":"redis",
|
73
|
+
"status":"up",
|
74
|
+
"updated_at":"2011-01-17 14:12:43 UTC",
|
75
|
+
"host":"localhost"
|
76
|
+
},
|
77
|
+
{
|
78
|
+
"id":"2",
|
79
|
+
"name":"noah",
|
80
|
+
"status":"up",
|
81
|
+
"updated_at":"2011-01-17 14:12:43 UTC",
|
82
|
+
"host":"localhost"
|
83
|
+
}
|
84
|
+
]
|
85
|
+
|
86
|
+
## All hosts
|
87
|
+
_curl http://localhost:9292/h/_
|
88
|
+
|
89
|
+
[
|
90
|
+
{
|
91
|
+
"id":"1",
|
92
|
+
"name":"localhost",
|
93
|
+
"status":"up",
|
94
|
+
"updated_at":"2011-01-17 14:12:43 UTC",
|
95
|
+
"services":[
|
96
|
+
{
|
97
|
+
"id":"1",
|
98
|
+
"name":"redis",
|
99
|
+
"status":"up",
|
100
|
+
"updated_at":"2011-01-17 14:12:43 UTC",
|
101
|
+
"host":"localhost"
|
102
|
+
},
|
103
|
+
{
|
104
|
+
"id":"2",
|
105
|
+
"name":"noah",
|
106
|
+
"status":"up",
|
107
|
+
"updated_at":"2011-01-17 14:12:43 UTC",
|
108
|
+
"host":"localhost"
|
109
|
+
}
|
110
|
+
]
|
111
|
+
}
|
112
|
+
]
|
113
|
+
|
114
|
+
## All applications
|
115
|
+
_curl http://localhost:9292/a/_
|
116
|
+
|
117
|
+
[
|
118
|
+
{
|
119
|
+
"id":"1",
|
120
|
+
"name":"noah",
|
121
|
+
"updated_at":"2011-01-17 14:12:43 UTC"
|
122
|
+
}
|
123
|
+
]
|
124
|
+
|
125
|
+
Most other combinations of endpoints work as well:
|
126
|
+
|
127
|
+
* `http://localhost:9292/h/<hostname>/<servicename>` - `<servicename>` on `<hostname>`
|
128
|
+
* `http://localhost:9292/a/<appname>/<configname>` - Configuration for `<appname>`
|
129
|
+
* `http://localhost:9292/c/<appname>/<element>` - Specific configuration element for `<appname>`
|
130
|
+
|
131
|
+
{
|
132
|
+
"id":"1",
|
133
|
+
"name":"db",
|
134
|
+
"format":"string",
|
135
|
+
"body":"redis://127.0.0.1:6379/0",
|
136
|
+
"update_at":"2011-01-17 14:12:43 UTC",
|
137
|
+
"application":"noah"
|
138
|
+
}
|
139
|
+
|
140
|
+
# Adding new entries
|
141
|
+
There are two ways to add new objects: via irb and via the [API](https://github.com/lusis/Noah/wiki/Stabilize-API) on a running instance. The API is still in a state of flux.
|
142
|
+
|
143
|
+
## Adding a new application and configuration item
|
144
|
+
|
145
|
+
irb -rohm -rohm/contrib -r./lib/noah/models.rb
|
146
|
+
|
147
|
+
a1 = Application.create(:name => 'myapplication')
|
148
|
+
if a1.save
|
149
|
+
a1.configurations << Configuration.create(:name => 'jsonconfigobj', :format => 'json', :body => '{"configvar1":"foo","configvar2":"bar"}', :application => a1)
|
150
|
+
end
|
151
|
+
JSON.parse(Configuration[2].body)
|
152
|
+
|
153
|
+
{"configvar1"=>"foo", "configvar2"=>"bar"}
|
154
|
+
|
155
|
+
## database.yml inside Noah? Sure!
|
156
|
+
|
157
|
+
dbyaml = <<EOY
|
158
|
+
development:
|
159
|
+
adapter: mysql
|
160
|
+
database: rails_development
|
161
|
+
username: root
|
162
|
+
password: my super secret password
|
163
|
+
EOY
|
164
|
+
a2 = Application.create(:name => 'myrailsapp')
|
165
|
+
if a2.save
|
166
|
+
a2.configurations << Configuration.create(:name => 'database.yml', :format => 'yaml', :body => dbyaml, :application => a2)
|
167
|
+
end
|
168
|
+
puts YAML.dump(Configuration[3].body)
|
169
|
+
|
170
|
+
development:
|
171
|
+
adapter: mysql
|
172
|
+
database: rails_development
|
173
|
+
username: root
|
174
|
+
password: my super secret password
|
175
|
+
|
176
|
+
# Hosts and Services/Applications and Configurations
|
177
|
+
Host/Services and Applications/Configurations are almost the same thing with a few exceptions. Here are some basic facts:
|
178
|
+
|
179
|
+
* Hosts have many Services
|
180
|
+
* Applications have many Configurations
|
181
|
+
* Hosts and Services have a status - `up`,`down` or `pending`
|
182
|
+
|
183
|
+
The intention of the `status` field for Hosts and Services is that a service might, when starting up, set the appropriate status. Same goes for said service shutting down. This also applies to hosts (i.e. a curl PUT is sent to Noah during the boot process).
|
184
|
+
|
185
|
+
While an application might have different "configurations" based on environment (production, qa, dev), the Configuration object in Noah is intended to be more holistic i.e. these are the Configuration atoms (a yaml file, property X, property Y) that form the running configuration of an Application.
|
186
|
+
|
187
|
+
Here's a holistic example using a tomcat application:
|
188
|
+
|
189
|
+
* Host running tomcat comes up. It sets its status as "pending"
|
190
|
+
* Each service on the box starts up and sets its status to "pending" and finally "up" (think steps in the init script for the service)
|
191
|
+
* Tomcat (now in the role of `Application`) given a single property in a properties file called "bootstrap.url", grabs a list of `Configuration`atoms it needs to run. Let's say, by default, Tomcat starts up with all webapps disabled. Using the `Configuration` item `webapps`, it knows which ones to start up.
|
192
|
+
* Each webapp (an application under a different context root) now has the role of `Application` and the role of `Service`. As an application, the webapp would grab things that would normally be stored in a .properties file. Maybe even the log4j.xml file. In the role of `Service`, a given webapp might be an API endpoint and so it would have a hostname (a virtual host maybe?) and services associated with it. Each of those, has a `status`.
|
193
|
+
|
194
|
+
That might be confusing and it's a fairly overly-contrived example. A more comon use case would be the above where, instead of storing the database.yml on the server, the Rails application actually reads the file from Noah. Now that might not be too exciting but try this example:
|
195
|
+
|
196
|
+
* Rails application with memcached as part of the stack.
|
197
|
+
* Instead of a local configuration file, the list of memcached servers is a `Configuration` object belonging to the rails application's `Application` object.
|
198
|
+
* As new memcached servers are brought online, your CM tool (puppet or chef) updates Noah
|
199
|
+
* Your Rails application either via restarting (and thus rebootstrapping the list of memcached servers from Noah) or using the Watcher subsystem is instantly aware of those servers. You could fairly easily implement a custom Watcher that, when the list of memcached server changes, the Passenger restart file is written.
|
200
|
+
|
201
|
+
Make sense?
|
202
|
+
|
203
|
+
# Constraints
|
204
|
+
You can view all the constraints inside `models.rb` but here they are for now:
|
205
|
+
|
206
|
+
* A new host must have at least `name` and `status` set.
|
207
|
+
* A new service must have at least `name` and `status` set.
|
208
|
+
* Each Host `name` must be unique
|
209
|
+
* Each Service `name` per Host must be unique
|
210
|
+
* Each Application `name` must exist and be unique
|
211
|
+
* Each Configuration name per Application must be unique.
|
212
|
+
* Each Configuration must have `name`,`format` and `body`
|
213
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
begin
|
3
|
+
Bundler.setup(:default, :development)
|
4
|
+
rescue Bundler::BundlerError => e
|
5
|
+
$stderr.puts e.message
|
6
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
7
|
+
exit e.status_code
|
8
|
+
end
|
9
|
+
require 'rake'
|
10
|
+
|
11
|
+
require 'rspec/core'
|
12
|
+
require 'rspec/core/rake_task'
|
13
|
+
|
14
|
+
Bundler::GemHelper.install_tasks
|
15
|
+
|
16
|
+
desc "Populate database with sample dataset"
|
17
|
+
task :sample, :redis_url do |t, args|
|
18
|
+
require 'ohm'
|
19
|
+
begin
|
20
|
+
require 'yajl'
|
21
|
+
rescue LoadError
|
22
|
+
require 'json'
|
23
|
+
end
|
24
|
+
require File.join(File.dirname(__FILE__), 'lib','noah')
|
25
|
+
|
26
|
+
|
27
|
+
Ohm::connect(:url => args.redis_url)
|
28
|
+
Ohm::redis.flushdb
|
29
|
+
puts "Creating Host entry for 'localhost'"
|
30
|
+
h = Host.create(:name => 'localhost', :status => "up")
|
31
|
+
if h.save
|
32
|
+
%w[redis noah].each do |service|
|
33
|
+
puts "Create Service entry for #{service}"
|
34
|
+
s = Service.create(:name => service, :status => "up", :host => h)
|
35
|
+
h.services << s
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
puts "Creating Application entry for 'noah'"
|
40
|
+
a = Application.create(:name => 'noah')
|
41
|
+
if a.save
|
42
|
+
puts "Creating Configuration entry for 'noah'"
|
43
|
+
cr = Configuration.create(:name => 'redis', :format => 'string', :body => 'redis://127.0.0.1:6379/0', :application => a)
|
44
|
+
ch = Configuration.create(:name => 'host', :format => 'string', :body => 'localhost', :application => a)
|
45
|
+
cp = Configuration.create(:name => 'port', :format => 'string', :body => '9292', :application => a)
|
46
|
+
%w[cr ch cp].each do |c|
|
47
|
+
a.configurations << eval(c)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
puts "Creating sample entries - Host and Service"
|
52
|
+
%w[host1.domain.com host2.domain.com host3.domain.com].each do |host|
|
53
|
+
h = Host.create(:name => host, :status => "up")
|
54
|
+
if h.save
|
55
|
+
%w[http https smtp mysql].each do |service|
|
56
|
+
s = Service.create(:name => service, :status => "pending", :host => h)
|
57
|
+
h.services << s
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
puts "Creating sample entries - Application and Configuration"
|
63
|
+
my_yaml = <<EOY
|
64
|
+
development:
|
65
|
+
database: development_database
|
66
|
+
adapter: mysql
|
67
|
+
username: dev_user
|
68
|
+
password: dev_password
|
69
|
+
EOY
|
70
|
+
my_json = <<EOJ
|
71
|
+
{
|
72
|
+
"id":"hostname",
|
73
|
+
"data":"localhost"
|
74
|
+
}
|
75
|
+
EOJ
|
76
|
+
|
77
|
+
a1 = Application.create(:name => 'myrailsapp1')
|
78
|
+
if a1.save
|
79
|
+
c1 = Configuration.create(:name => 'database.yml', :format => 'yaml', :body => my_yaml, :application => a1)
|
80
|
+
a1.configurations << c1
|
81
|
+
end
|
82
|
+
|
83
|
+
a2 = Application.create(:name => 'myrestapp1')
|
84
|
+
if a2.save
|
85
|
+
c2 = Configuration.create(:name => 'config.json', :format => 'json', :body => my_json, :application => a2)
|
86
|
+
a2.configurations << c2
|
87
|
+
end
|
88
|
+
puts "Sample data populated!"
|
89
|
+
end
|
90
|
+
|
91
|
+
|
92
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
93
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
94
|
+
end
|
95
|
+
|
96
|
+
namespace :coverage do
|
97
|
+
desc "Delete aggregate coverage data."
|
98
|
+
task(:clean) { rm_f "coverage.data" }
|
99
|
+
end
|
100
|
+
desc "Run Rcov code coverage analysis"
|
101
|
+
RSpec::Core::RakeTask.new(:coverage) do |t|
|
102
|
+
t.rcov = true
|
103
|
+
t.verbose = true
|
104
|
+
t.rcov_opts = %q[--aggregate coverage.data --sort coverage --text-report --exclude "config,.bundle/*,gems/*,spec/*" -o doc/coverage -Ilib -i "noah.rb"]
|
105
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
Autotest.add_discovery { "rspec2" }
|
data/bin/noah
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")))
|
3
|
+
require 'noah'
|
4
|
+
require 'vegas'
|
5
|
+
|
6
|
+
Vegas::Runner.new(Noah::App, 'noah') do |runner, opts, app|
|
7
|
+
opts.on("-r", "--redis URL", "redis url to connect to (default: redis://localhost:6379/0)") {|r| ENV["REDIS_URL"] = r }
|
8
|
+
end
|
data/config.ru
ADDED
@@ -0,0 +1,138 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
+
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
|
5
|
+
<title>Noah C0 Coverage Information - RCov</title>
|
6
|
+
<link href="screen.css" media="all" rel="stylesheet" type="text/css" />
|
7
|
+
<link href="print.css" media="print" rel="stylesheet" type="text/css" />
|
8
|
+
|
9
|
+
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
|
10
|
+
<script type="text/javascript" src="jquery.tablesorter.min.js"></script>
|
11
|
+
<script type="text/javascript" src="rcov.js"></script>
|
12
|
+
</head>
|
13
|
+
<body>
|
14
|
+
<h1>Noah C0 Coverage Information - RCov</h1>
|
15
|
+
|
16
|
+
|
17
|
+
<noscript><style type="text/css">.if_js { display:none; }</style></noscript>
|
18
|
+
|
19
|
+
<div class="filters if_js">
|
20
|
+
<fieldset>
|
21
|
+
<label>File Filter:</label>
|
22
|
+
<select id="file_filter" class="filter">
|
23
|
+
<option value="all_files">Show All</option>
|
24
|
+
<option value="lib">lib/</option>
|
25
|
+
</select>
|
26
|
+
</fieldset>
|
27
|
+
<fieldset>
|
28
|
+
<label>Code Coverage Threshold:</label>
|
29
|
+
<select id="coverage_filter" class="filter">
|
30
|
+
<option value="all_coverage">Show All</option>
|
31
|
+
<option value="10">< 10% Coverage</option><option value="20">< 20% Coverage</option><option value="30">< 30% Coverage</option><option value="40">< 40% Coverage</option><option value="50">< 50% Coverage</option><option value="60">< 60% Coverage</option><option value="70">< 70% Coverage</option><option value="80">< 80% Coverage</option><option value="90">< 90% Coverage</option><option value="100">< 100% Coverage</option>
|
32
|
+
<option value="110">= 100% Coverage</option>
|
33
|
+
</select>
|
34
|
+
</fieldset>
|
35
|
+
</div>
|
36
|
+
|
37
|
+
<div class="report_table_wrapper">
|
38
|
+
<table class='report' id='report_table'>
|
39
|
+
<thead>
|
40
|
+
<tr>
|
41
|
+
<th class="left_align">Name</th>
|
42
|
+
<th class="right_align">Total Lines</th>
|
43
|
+
<th class="right_align">Lines of Code</th>
|
44
|
+
<th class="left_align">Total Coverage</th>
|
45
|
+
<th class="left_align">Code Coverage</th>
|
46
|
+
</tr>
|
47
|
+
</thead>
|
48
|
+
<tfoot>
|
49
|
+
<tr>
|
50
|
+
<td class="left_align">TOTAL</td>
|
51
|
+
<td class='right_align'><tt>612</tt></td>
|
52
|
+
<td class='right_align'><tt>521</tt></td>
|
53
|
+
<td class="left_align"><div class="percent_graph_legend"><tt class=''>83.33%</tt></div>
|
54
|
+
<div class="percent_graph">
|
55
|
+
<div class="covered" style="width:83px"></div>
|
56
|
+
<div class="uncovered" style="width:17px"></div>
|
57
|
+
</div></td>
|
58
|
+
<td class="left_align"><div class="percent_graph_legend"><tt class='coverage_total'>81.96%</tt></div>
|
59
|
+
<div class="percent_graph">
|
60
|
+
<div class="covered" style="width:82px"></div>
|
61
|
+
<div class="uncovered" style="width:18px"></div>
|
62
|
+
</div></td>
|
63
|
+
</tr>
|
64
|
+
</tfoot>
|
65
|
+
<tbody>
|
66
|
+
|
67
|
+
<tr class="all_files all_coverage 60 70 80 90 100 lib even">
|
68
|
+
<td class="left_align"><a href="lib-helpers_rb.html">lib/helpers.rb</a></td>
|
69
|
+
<td class='right_align'><tt>55</tt></td>
|
70
|
+
<td class='right_align'><tt>45</tt></td>
|
71
|
+
<td class="left_align"><div class="percent_graph_legend"><tt class=''>56.36%</tt></div>
|
72
|
+
<div class="percent_graph">
|
73
|
+
<div class="covered" style="width:56px"></div>
|
74
|
+
<div class="uncovered" style="width:44px"></div>
|
75
|
+
</div></td>
|
76
|
+
<td class="left_align"><div class="percent_graph_legend"><tt class=''>57.78%</tt></div>
|
77
|
+
<div class="percent_graph">
|
78
|
+
<div class="covered" style="width:58px"></div>
|
79
|
+
<div class="uncovered" style="width:42px"></div>
|
80
|
+
</div></td>
|
81
|
+
</tr>
|
82
|
+
|
83
|
+
<tr class="all_files all_coverage 90 100 odd">
|
84
|
+
<td class="left_align"><a href="noah_rb.html">noah.rb</a></td>
|
85
|
+
<td class='right_align'><tt>326</tt></td>
|
86
|
+
<td class='right_align'><tt>285</tt></td>
|
87
|
+
<td class="left_align"><div class="percent_graph_legend"><tt class=''>82.52%</tt></div>
|
88
|
+
<div class="percent_graph">
|
89
|
+
<div class="covered" style="width:83px"></div>
|
90
|
+
<div class="uncovered" style="width:17px"></div>
|
91
|
+
</div></td>
|
92
|
+
<td class="left_align"><div class="percent_graph_legend"><tt class=''>81.05%</tt></div>
|
93
|
+
<div class="percent_graph">
|
94
|
+
<div class="covered" style="width:81px"></div>
|
95
|
+
<div class="uncovered" style="width:19px"></div>
|
96
|
+
</div></td>
|
97
|
+
</tr>
|
98
|
+
|
99
|
+
<tr class="all_files all_coverage 90 100 lib even">
|
100
|
+
<td class="left_align"><a href="lib-models_rb.html">lib/models.rb</a></td>
|
101
|
+
<td class='right_align'><tt>231</tt></td>
|
102
|
+
<td class='right_align'><tt>191</tt></td>
|
103
|
+
<td class="left_align"><div class="percent_graph_legend"><tt class=''>90.91%</tt></div>
|
104
|
+
<div class="percent_graph">
|
105
|
+
<div class="covered" style="width:91px"></div>
|
106
|
+
<div class="uncovered" style="width:9px"></div>
|
107
|
+
</div></td>
|
108
|
+
<td class="left_align"><div class="percent_graph_legend"><tt class=''>89.01%</tt></div>
|
109
|
+
<div class="percent_graph">
|
110
|
+
<div class="covered" style="width:89px"></div>
|
111
|
+
<div class="uncovered" style="width:11px"></div>
|
112
|
+
</div></td>
|
113
|
+
</tr>
|
114
|
+
|
115
|
+
</tbody>
|
116
|
+
</table>
|
117
|
+
</div>
|
118
|
+
|
119
|
+
<p>Generated on 2011-01-31 05:03:32 -0500 with <a href="http://github.com/relevance/rcov">rcov 0.9.8</a></p>
|
120
|
+
|
121
|
+
<script type="text/javascript">
|
122
|
+
$(document).ready(function(){$("#report_table").tablesorter({widgets: ['zebra'], textExtraction: 'complex'});});
|
123
|
+
$('.filter').change(function(){
|
124
|
+
ff = $('#file_filter').val();
|
125
|
+
cf = $('#coverage_filter').val();
|
126
|
+
$('table#report_table tbody tr').each(function(i){
|
127
|
+
if ((this.className.split(" ").indexOf(ff) > -1) && (this.className.split(" ").indexOf(cf) > -1)) {
|
128
|
+
this.style.display = "";
|
129
|
+
} else {
|
130
|
+
this.style.display = "none";
|
131
|
+
};
|
132
|
+
restripe();
|
133
|
+
})
|
134
|
+
})
|
135
|
+
</script>
|
136
|
+
|
137
|
+
</body>
|
138
|
+
</html>
|