Navigation Menu

Skip to content

Commit

Permalink
Fixes for optparse incompatibility, jruby problem with samplers, newr…
Browse files Browse the repository at this point in the history
…eliccontroller not getting found
  • Loading branch information
Bill Kayser committed Apr 8, 2009
1 parent 486a6a1 commit 4f60604
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
11 changes: 7 additions & 4 deletions lib/new_relic/agent/agent.rb
Expand Up @@ -547,12 +547,15 @@ def connect
end

def load_samplers
sampler_files = File.join(File.dirname(__FILE__), 'samplers', '*.rb')
Dir.glob(sampler_files) do |file|
sampler_files_root = File.join(File.dirname(__FILE__), 'samplers')
samplers = %w[memory.rb]
samplers += %w[cpu.rb mongrel.rb] unless RUBY_PLATFORM =~ /java/
for sampler in samplers do
begin
require file
log.debug "Loading sampler #{sampler}"
require File.join(sampler_files_root, sampler)
rescue => e
log.error "Error loading sampler '#{file}': #{e}"
log.error "Error loading sampler '#{sampler}': #{e}"
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/new_relic/local_environment.rb
Expand Up @@ -125,9 +125,9 @@ def default_port
require 'optparse'
# If nothing else is found, use the 3000 default
default_port = 3000
ARGV.clone.options do |opts|
OptionParser.new do |opts|
opts.on("-p", "--port=port", String) { | default_port | }
opts.parse!
opts.parse!(ARGV.clone)
end
default_port
end
Expand Down
2 changes: 2 additions & 0 deletions lib/new_relic/version.rb
Expand Up @@ -13,6 +13,8 @@ def self.changes
CHANGELOG = <<EOF
2009-04-10 version 2.8.9
* fix problem finding the newrelic controller in dev mode
* fix incompatibility with older versions of optparse
* fix potential jvm problem with jruby
2009-03-27 version 2.8.8
* fix error with jruby on windows
2009-03-20 version 2.8.7
Expand Down
1 change: 1 addition & 0 deletions ui/controllers/newrelic_controller.rb
@@ -1,5 +1,6 @@
class NewrelicController < ActionController::Base
include NewrelicHelper
helper NewrelicHelper

# See http://wiki.rubyonrails.org/rails/pages/Safe+ERB:
# We don't need to worry about checking taintedness
Expand Down

0 comments on commit 4f60604

Please sign in to comment.