scout 2.0.5 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +5 -0
- data/Rakefile +12 -9
- data/lib/scout.rb +1 -1
- data/lib/scout/plugin.rb +44 -1
- data/lib/scout/server.rb +1 -1
- metadata +2 -2
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -86,10 +86,12 @@ task :publish_scout => [:package] do
|
|
86
86
|
puts "Publishing on Scout Server"
|
87
87
|
sh "scp -r pkg/*.gem " +
|
88
88
|
"deploy@gems.scoutapp.com:/var/www/gems/gems"
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
89
|
+
ssh_out = ""
|
90
|
+
Net::SSH.start('gems.scoutapp.com','deploy') do |session|
|
91
|
+
ssh_out = session.exec!("/usr/bin/gem generate_index -d /var/www/gems").to_s.chomp
|
92
|
+
end
|
93
|
+
puts ssh_out
|
94
|
+
puts "Published, and updated gem server."
|
93
95
|
end
|
94
96
|
|
95
97
|
desc "Publishes Gem to Rubyforge"
|
@@ -141,17 +143,18 @@ task :publish_beta_scout => [:package] do
|
|
141
143
|
puts "Publishing on Scout Server"
|
142
144
|
sh "scp -r pkg/*.gem " +
|
143
145
|
"deploy@gems.scoutapp.com:/var/www/beta-gems/gems"
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
146
|
+
ssh_out = ""
|
147
|
+
Net::SSH.start('gems.scoutapp.com','deploy') do |session|
|
148
|
+
ssh_out = session.exec!("/usr/bin/gem generate_index -d /var/www/gems").to_s.chomp
|
149
|
+
end
|
150
|
+
puts ssh_out
|
151
|
+
puts "Published, and updated gem server."
|
148
152
|
|
149
153
|
sh "scp -r doc/html/* " +
|
150
154
|
"deploy@gems.scoutapp.com:/var/www/beta-gems/docs"
|
151
155
|
|
152
156
|
end
|
153
157
|
|
154
|
-
|
155
158
|
desc "Add new files to Subersion"
|
156
159
|
task :svn_add do
|
157
160
|
system "svn status | grep '^\?' | sed -e 's/? *//' | sed -e 's/ /\ /g' | xargs svn add"
|
data/lib/scout.rb
CHANGED
data/lib/scout/plugin.rb
CHANGED
@@ -12,6 +12,26 @@ module Scout
|
|
12
12
|
def load(last_run, memory, options)
|
13
13
|
new(last_run, memory, options)
|
14
14
|
end
|
15
|
+
|
16
|
+
#
|
17
|
+
# You can use this method to indicate one or more libraries your plugin
|
18
|
+
# requires:
|
19
|
+
#
|
20
|
+
# class MyNeedyPlugin < Scout::Plugin
|
21
|
+
# needs "faster_csv", "elif"
|
22
|
+
# # ...
|
23
|
+
# end
|
24
|
+
#
|
25
|
+
# Your build_report() method will not be called if all libraries cannot
|
26
|
+
# be loaded. RubyGems will be loaded if needed to find the libraries.
|
27
|
+
#
|
28
|
+
def needs(*libraries)
|
29
|
+
if libraries.empty?
|
30
|
+
@needs ||= [ ]
|
31
|
+
else
|
32
|
+
needs.push(*libraries.flatten)
|
33
|
+
end
|
34
|
+
end
|
15
35
|
end
|
16
36
|
|
17
37
|
# Creates a new Scout Plugin to run.
|
@@ -114,8 +134,31 @@ module Scout
|
|
114
134
|
# automatically be returned as the end result of the run.
|
115
135
|
#
|
116
136
|
def run
|
117
|
-
build_report
|
137
|
+
build_report if self.class.needs.all? { |l| library_available?(l) }
|
118
138
|
data_for_server
|
119
139
|
end
|
140
|
+
|
141
|
+
private
|
142
|
+
|
143
|
+
#
|
144
|
+
# Returns true is a library can be loaded. A bare require is made as the
|
145
|
+
# first attempt. If that fails, RubyGems is loaded and another attempt is
|
146
|
+
# made. If the library cannot be loaded either way, an error() is generated
|
147
|
+
# and build_report() will not be called.
|
148
|
+
#
|
149
|
+
def library_available?(library)
|
150
|
+
begin
|
151
|
+
require library
|
152
|
+
rescue LoadError
|
153
|
+
begin
|
154
|
+
require "rubygems"
|
155
|
+
require library
|
156
|
+
rescue LoadError
|
157
|
+
error("Failed to load library", "Could not load #{library}")
|
158
|
+
return false
|
159
|
+
end
|
160
|
+
end
|
161
|
+
true
|
162
|
+
end
|
120
163
|
end
|
121
164
|
end
|
data/lib/scout/server.rb
CHANGED
@@ -116,7 +116,7 @@ module Scout
|
|
116
116
|
return
|
117
117
|
rescue Exception
|
118
118
|
raise if $!.is_a? SystemExit
|
119
|
-
error "Plugin failed to run: #{$!.backtrace}"
|
119
|
+
error "Plugin failed to run: #{$!.class}: #{$!}\n#{$!.backtrace.join("\n")}"
|
120
120
|
end
|
121
121
|
info "Plugin completed its run."
|
122
122
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Highgroove Studios
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-08-28 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|