newrelic_rpm 3.18.1.330 → 4.0.0.332

Sign up to get free protection for your applications and to get access to all the features.
Files changed (229) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -74
  3. data/CHANGELOG.md +77 -0
  4. data/CONTRIBUTING.md +14 -6
  5. data/LICENSE +1 -88
  6. data/lib/new_relic/agent.rb +2 -103
  7. data/lib/new_relic/agent/agent.rb +3 -32
  8. data/lib/new_relic/agent/commands/thread_profiler_session.rb +2 -6
  9. data/lib/new_relic/agent/configuration/default_source.rb +1 -8
  10. data/lib/new_relic/agent/configuration/yaml_source.rb +1 -12
  11. data/lib/new_relic/agent/cross_app_monitor.rb +2 -1
  12. data/lib/new_relic/agent/cross_app_tracing.rb +4 -2
  13. data/lib/new_relic/agent/datastores/mongo.rb +1 -1
  14. data/lib/new_relic/agent/datastores/redis.rb +1 -1
  15. data/lib/new_relic/agent/encoding_normalizer.rb +1 -20
  16. data/lib/new_relic/agent/error_collector.rb +8 -21
  17. data/lib/new_relic/agent/inbound_request_monitor.rb +4 -1
  18. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +14 -30
  19. data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +1 -1
  20. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +4 -5
  21. data/lib/new_relic/agent/instrumentation/curb.rb +2 -2
  22. data/lib/new_relic/agent/instrumentation/excon.rb +3 -3
  23. data/lib/new_relic/agent/instrumentation/grape.rb +3 -3
  24. data/lib/new_relic/agent/instrumentation/httpclient.rb +2 -2
  25. data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +2 -2
  26. data/lib/new_relic/agent/instrumentation/middleware_proxy.rb +2 -2
  27. data/lib/new_relic/agent/instrumentation/middleware_tracing.rb +3 -7
  28. data/lib/new_relic/agent/instrumentation/queue_time.rb +13 -15
  29. data/lib/new_relic/agent/instrumentation/rack.rb +4 -50
  30. data/lib/new_relic/agent/instrumentation/rake.rb +1 -1
  31. data/lib/new_relic/agent/instrumentation/resque.rb +1 -2
  32. data/lib/new_relic/agent/instrumentation/sinatra.rb +0 -1
  33. data/lib/new_relic/agent/instrumentation/typhoeus.rb +2 -2
  34. data/lib/new_relic/agent/javascript_instrumentor.rb +3 -2
  35. data/lib/new_relic/agent/method_tracer.rb +1 -60
  36. data/lib/new_relic/agent/new_relic_service.rb +3 -2
  37. data/lib/new_relic/agent/new_relic_service/encoders.rb +5 -6
  38. data/lib/new_relic/agent/new_relic_service/json_marshaller.rb +7 -16
  39. data/lib/new_relic/agent/pipe_channel_manager.rb +1 -3
  40. data/lib/new_relic/agent/pipe_service.rb +1 -3
  41. data/lib/new_relic/agent/rules_engine.rb +2 -17
  42. data/lib/new_relic/agent/stats_engine.rb +0 -2
  43. data/lib/new_relic/agent/stats_engine/metric_stats.rb +0 -48
  44. data/lib/new_relic/agent/supported_versions.rb +12 -19
  45. data/lib/new_relic/agent/threading/backtrace_service.rb +1 -1
  46. data/lib/new_relic/agent/transaction.rb +0 -3
  47. data/lib/new_relic/agent/transaction/attributes.rb +1 -10
  48. data/lib/new_relic/agent/vm.rb +1 -4
  49. data/lib/new_relic/agent/vm/jruby_vm.rb +1 -3
  50. data/lib/new_relic/agent/vm/mri_vm.rb +2 -10
  51. data/lib/new_relic/control.rb +1 -2
  52. data/lib/new_relic/control/frameworks/rails.rb +1 -1
  53. data/lib/new_relic/control/frameworks/rails3.rb +1 -2
  54. data/lib/new_relic/control/frameworks/rails4.rb +1 -1
  55. data/lib/new_relic/control/frameworks/rails5.rb +1 -1
  56. data/lib/new_relic/control/instance_methods.rb +1 -1
  57. data/{vendor/gems/dependency_detection-0.0.1.build/lib → lib/new_relic}/dependency_detection.rb +0 -1
  58. data/lib/new_relic/helper.rb +6 -13
  59. data/lib/new_relic/language_support.rb +44 -139
  60. data/lib/new_relic/metric_spec.rb +0 -17
  61. data/lib/new_relic/noticed_error.rb +18 -27
  62. data/lib/new_relic/version.rb +3 -48
  63. data/lib/tasks/versions.rake +7 -5
  64. data/newrelic_rpm.gemspec +1 -16
  65. data/test/agent_helper.rb +4 -2
  66. data/test/environments/lib/environments/runner.rb +5 -14
  67. data/test/environments/norails/Gemfile +0 -8
  68. data/test/environments/rails21/Gemfile +0 -8
  69. data/test/environments/rails21/config/database.yml +1 -1
  70. data/test/environments/rails22/Gemfile +0 -8
  71. data/test/environments/rails22/config/database.yml +1 -1
  72. data/test/environments/rails23/Gemfile +1 -7
  73. data/test/environments/rails23/config/database.yml +1 -1
  74. data/test/environments/rails30/Gemfile +0 -1
  75. data/test/environments/rails30/config/database.yml +1 -1
  76. data/test/environments/rails31/Gemfile +0 -3
  77. data/test/environments/rails31/config/database.yml +1 -1
  78. data/test/environments/rails32/Gemfile +0 -3
  79. data/test/environments/rails32/config/database.yml +1 -1
  80. data/test/environments/rails40/Gemfile +0 -26
  81. data/test/environments/rails40/config/database.yml +1 -1
  82. data/test/environments/rails41/Gemfile +0 -18
  83. data/test/environments/rails41/config/database.yml +1 -1
  84. data/test/environments/rails42/Gemfile +0 -22
  85. data/test/environments/rails42/config/database.yml +1 -1
  86. data/test/environments/rails50/Gemfile +0 -13
  87. data/test/environments/rails50/config/database.yml +1 -1
  88. data/test/helpers/logging.rb +37 -0
  89. data/test/helpers/minitest.rb +50 -0
  90. data/test/helpers/misc.rb +87 -0
  91. data/test/helpers/transaction_sample.rb +44 -0
  92. data/test/multiverse/lib/multiverse/suite.rb +6 -91
  93. data/test/multiverse/script/runner +1 -1
  94. data/test/multiverse/suites/active_record/Envfile +1 -28
  95. data/test/multiverse/suites/active_record/active_record_test.rb +6 -6
  96. data/test/multiverse/suites/active_record/config/database.rb +2 -3
  97. data/test/multiverse/suites/active_record/config/database.yml +0 -2
  98. data/test/multiverse/suites/activemerchant/Envfile +4 -18
  99. data/test/multiverse/suites/agent_only/encoding_handling_test.rb +7 -15
  100. data/test/multiverse/suites/agent_only/error_events_test.rb +1 -7
  101. data/test/multiverse/suites/agent_only/harvest_timestamps_test.rb +4 -20
  102. data/test/multiverse/suites/agent_only/labels_test.rb +1 -1
  103. data/test/multiverse/suites/agent_only/marshaling_test.rb +5 -10
  104. data/test/multiverse/suites/agent_only/script/public_api_when_disabled.rb +0 -11
  105. data/test/multiverse/suites/agent_only/start_up_test.rb +3 -3
  106. data/test/multiverse/suites/agent_only/synthetics_test.rb +1 -1
  107. data/test/multiverse/suites/agent_only/thread_profiling_test.rb +0 -3
  108. data/test/multiverse/suites/agent_only/xray_sessions_test.rb +0 -3
  109. data/test/multiverse/suites/capistrano/Envfile +2 -4
  110. data/test/multiverse/suites/capistrano2/Envfile +0 -4
  111. data/test/multiverse/suites/curb/Envfile +3 -7
  112. data/test/multiverse/suites/datamapper/Envfile +2 -2
  113. data/test/multiverse/suites/datamapper/datamapper_test.rb +2 -2
  114. data/test/multiverse/suites/deferred_instrumentation/sinatra_test.rb +0 -1
  115. data/test/multiverse/suites/delayed_job/Envfile +28 -41
  116. data/test/multiverse/suites/excon/Envfile +0 -3
  117. data/test/multiverse/suites/grape/Envfile +0 -4
  118. data/test/multiverse/suites/grape/grape_versioning_test.rb +2 -2
  119. data/test/multiverse/suites/grape/grape_versioning_test_api.rb +2 -2
  120. data/test/multiverse/suites/json/Envfile +1 -9
  121. data/test/multiverse/suites/marshalling/Envfile +0 -9
  122. data/test/multiverse/suites/memcached/Envfile +5 -23
  123. data/test/multiverse/suites/mongo/Envfile +9 -11
  124. data/test/multiverse/suites/padrino/Envfile +0 -6
  125. data/test/multiverse/suites/rack/http_response_code_test.rb +0 -1
  126. data/test/multiverse/suites/rack/rack_auto_instrumentation_test.rb +5 -10
  127. data/test/multiverse/suites/rack/rack_cascade_test.rb +0 -1
  128. data/test/multiverse/suites/rack/rack_env_mutation_test.rb +0 -1
  129. data/test/multiverse/suites/rack/response_content_type_test.rb +0 -1
  130. data/test/multiverse/suites/rails/Envfile +1 -19
  131. data/test/multiverse/suites/rails/activejob_test.rb +1 -2
  132. data/test/multiverse/suites/rails/error_tracing_test.rb +0 -13
  133. data/test/multiverse/suites/rails/gc_instrumentation_test.rb +12 -32
  134. data/test/multiverse/suites/rake/Envfile +15 -22
  135. data/test/multiverse/suites/redis/redis_instrumentation_test.rb +1 -1
  136. data/test/multiverse/suites/sequel/database.rb +1 -4
  137. data/test/multiverse/suites/sidekiq/Envfile +13 -23
  138. data/test/multiverse/suites/sinatra/sinatra_test_cases.rb +3 -3
  139. data/test/multiverse/suites/typhoeus/Envfile +0 -19
  140. data/test/multiverse/suites/typhoeus/typhoeus_test.rb +3 -3
  141. data/test/multiverse/suites/yajl/Envfile +5 -0
  142. data/test/multiverse/suites/yajl/yajl_test.rb +1 -3
  143. data/test/new_relic/agent/agent/start_test.rb +3 -3
  144. data/test/new_relic/agent/agent_logger_test.rb +2 -2
  145. data/test/new_relic/agent/agent_test.rb +2 -2
  146. data/test/new_relic/agent/attribute_processing_test.rb +3 -4
  147. data/test/new_relic/agent/audit_logger_test.rb +4 -6
  148. data/test/new_relic/agent/aws_info_test.rb +17 -1
  149. data/test/new_relic/agent/busy_calculator_test.rb +14 -16
  150. data/test/new_relic/agent/configuration/manager_test.rb +1 -7
  151. data/test/new_relic/agent/cross_app_monitor_test.rb +1 -1
  152. data/test/new_relic/agent/database_test.rb +2 -10
  153. data/test/new_relic/agent/datastores/mongo/event_formatter_test.rb +90 -93
  154. data/test/new_relic/agent/datastores/redis_test.rb +14 -16
  155. data/test/new_relic/agent/encoding_normalizer_test.rb +38 -40
  156. data/test/new_relic/agent/error_collector_test.rb +16 -49
  157. data/test/new_relic/agent/instrumentation/active_record_helper_test.rb +0 -6
  158. data/test/new_relic/agent/instrumentation/active_record_subscriber_test.rb +1 -1
  159. data/test/new_relic/agent/instrumentation/mongodb_command_subscriber_test.rb +101 -103
  160. data/test/new_relic/agent/instrumentation/rack_test.rb +11 -14
  161. data/test/new_relic/agent/instrumentation/task_instrumentation_test.rb +0 -10
  162. data/test/new_relic/agent/javascript_instrumentor_test.rb +2 -2
  163. data/test/new_relic/agent/method_tracer/class_methods/add_method_tracer_test.rb +0 -10
  164. data/test/new_relic/agent/method_tracer_test.rb +35 -76
  165. data/test/new_relic/agent/new_relic_service_test.rb +86 -102
  166. data/test/new_relic/agent/pipe_channel_manager_test.rb +4 -9
  167. data/test/new_relic/agent/pipe_service_test.rb +2 -3
  168. data/test/new_relic/agent/rpm_agent_test.rb +0 -4
  169. data/test/new_relic/agent/sampled_buffer_test.rb +2 -2
  170. data/test/new_relic/agent/samplers/cpu_sampler_test.rb +28 -0
  171. data/test/new_relic/agent/samplers/memory_sampler_test.rb +66 -0
  172. data/test/new_relic/agent/sized_buffer_test.rb +1 -1
  173. data/test/new_relic/agent/stats_engine/gc_profiler_test.rb +2 -14
  174. data/test/new_relic/agent/stats_engine/metric_stats_test.rb +44 -66
  175. data/test/new_relic/agent/stats_test.rb +6 -8
  176. data/test/new_relic/agent/synthetics_event_buffer_test.rb +1 -1
  177. data/test/new_relic/agent/transaction/attributes_test.rb +4 -12
  178. data/test/new_relic/agent/transaction_test.rb +2 -10
  179. data/test/new_relic/agent/utilization_data_test.rb +17 -1
  180. data/test/new_relic/agent/vm/mri_vm_test.rb +5 -7
  181. data/test/new_relic/agent_test.rb +0 -43
  182. data/test/new_relic/coerce_test.rb +1 -3
  183. data/test/new_relic/fake_collector.rb +3 -3
  184. data/test/new_relic/fake_external_server.rb +1 -1
  185. data/test/new_relic/fake_server.rb +1 -1
  186. data/test/new_relic/http_client_test_cases.rb +3 -3
  187. data/test/new_relic/language_support_test.rb +6 -12
  188. data/test/new_relic/latest_changes_test.rb +0 -11
  189. data/test/new_relic/license_test.rb +3 -8
  190. data/test/new_relic/multiverse_helpers.rb +1 -1
  191. data/test/new_relic/noticed_error_test.rb +11 -7
  192. data/test/new_relic/rack/browser_monitoring_test.rb +1 -3
  193. data/test/nullverse/nullverse_helper.rb +1 -1
  194. data/test/performance/lib/performance.rb +1 -1
  195. data/test/performance/lib/performance/instrumentation/gc_stats.rb +4 -6
  196. data/test/performance/lib/performance/instrumentation/perf_tools.rb +1 -1
  197. data/test/performance/lib/performance/instrumentation/stackprof.rb +1 -1
  198. data/test/performance/lib/performance/platform.rb +1 -8
  199. data/test/performance/script/runner +1 -3
  200. data/test/performance/suites/active_record.rb +3 -24
  201. data/test/test_helper.rb +9 -216
  202. metadata +9 -45
  203. data/lib/conditional_vendored_dependency_detection.rb +0 -7
  204. data/lib/new_relic/agent/hash_extensions.rb +0 -41
  205. data/lib/new_relic/agent/instrumentation/metric_frame.rb +0 -39
  206. data/lib/new_relic/agent/instrumentation/rails/errors.rb +0 -51
  207. data/lib/new_relic/agent/instrumentation/rails3/errors.rb +0 -47
  208. data/lib/new_relic/agent/instrumentation/rails4/errors.rb +0 -46
  209. data/lib/new_relic/agent/stats_engine/samplers.rb +0 -22
  210. data/lib/new_relic/agent/vm/rubinius_vm.rb +0 -140
  211. data/lib/new_relic/json_wrapper.rb +0 -78
  212. data/lib/new_relic/okjson.rb +0 -602
  213. data/lib/new_relic/rack/error_collector.rb +0 -27
  214. data/lib/new_relic/timer_lib.rb +0 -31
  215. data/test/helpers/runtime_detection.rb +0 -17
  216. data/test/multiverse/suites/no_json/Envfile +0 -12
  217. data/test/multiverse/suites/no_json/config/newrelic.yml +0 -27
  218. data/test/multiverse/suites/no_json/marshal_config_test.rb +0 -22
  219. data/test/new_relic/agent/hash_extensions_test.rb +0 -59
  220. data/test/new_relic/agent/instrumentation/metric_frame_test.rb +0 -22
  221. data/test/new_relic/agent/stats_engine/samplers_test.rb +0 -98
  222. data/test/new_relic/agent/vm/rubinius_vm_test.rb +0 -69
  223. data/test/new_relic/json_wrapper_test.rb +0 -32
  224. data/test/new_relic/rack/deferred_instrumentation_test.rb +0 -33
  225. data/test/new_relic/rack/error_collector_test.rb +0 -83
  226. data/test/new_relic/version_number_test.rb +0 -101
  227. data/test/script/before_install/revert_rubygems.sh +0 -15
  228. data/test/script/before_install/update_bundler.sh +0 -12
  229. data/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection/version.rb +0 -7
@@ -42,23 +42,6 @@ class NewRelic::MetricSpec
42
42
  @name.hash ^ @scope.hash
43
43
  end
44
44
 
45
- # return a new metric spec if the given regex
46
- # matches the name or scope.
47
- def sub(pattern, replacement, apply_to_scope = true)
48
- ::NewRelic::Agent.logger.warn("The sub method on metric specs is deprecated") rescue nil
49
- return nil if name !~ pattern &&
50
- (!apply_to_scope || scope.nil? || scope !~ pattern)
51
- new_name = name.sub(pattern, replacement)[LENGTH_RANGE]
52
-
53
- if apply_to_scope
54
- new_scope = (scope && scope.sub(pattern, replacement)[LENGTH_RANGE])
55
- else
56
- new_scope = scope
57
- end
58
-
59
- self.class.new new_name, new_scope
60
- end
61
-
62
45
  def to_s
63
46
  return name if scope.empty?
64
47
  "#{name}:#{scope}"
@@ -15,12 +15,13 @@ class NewRelic::NoticedError
15
15
 
16
16
  attr_reader :exception_id, :is_internal
17
17
 
18
- STRIPPED_EXCEPTION_REPLACEMENT_MESSAGE = "Message removed by New Relic 'strip_exception_messages' setting"
18
+ STRIPPED_EXCEPTION_REPLACEMENT_MESSAGE = "Message removed by New Relic 'strip_exception_messages' setting".freeze
19
+ UNKNOWN_ERROR_CLASS_NAME = 'Error'.freeze
20
+ NIL_ERROR_MESSAGE = '<no message>'.freeze
19
21
 
20
22
  def initialize(path, exception, timestamp = Time.now)
21
23
  @exception_id = exception.object_id
22
24
  @path = path
23
- @exception_class_name = exception.is_a?(Exception) ? exception.class.name : 'Error'
24
25
 
25
26
  # It's critical that we not hold onto the exception class constant in this
26
27
  # class. These objects get serialized for Resque to a process that might
@@ -28,24 +29,7 @@ class NewRelic::NoticedError
28
29
  # while we have the actual exception!
29
30
  @is_internal = (exception.class < NewRelic::Agent::InternalAgentError)
30
31
 
31
- if exception.nil?
32
- @message = '<no message>'
33
- elsif exception.respond_to?(:cause)
34
- @message = (exception.cause || exception).to_s
35
- elsif exception.respond_to?(:original_exception)
36
- @message = (exception.original_exception || exception).to_s
37
- else # exception is not nil, but does not respond to original_exception
38
- @message = exception.to_s
39
- end
40
-
41
-
42
- unless @message.is_a?(String)
43
- # In pre-1.9.3, Exception.new({}).to_s.class != String
44
- # That is, Exception#to_s may not return a String instance if one wasn't
45
- # passed in upon creation of the Exception. So, try to generate a useful
46
- # String representation of the exception message, falling back to failsafe
47
- @message = String(@message.inspect) rescue '<unknown message type>'
48
- end
32
+ extract_class_name_and_message_from(exception)
49
33
 
50
34
  # clamp long messages to 4k so that we don't send a lot of
51
35
  # overhead across the wire
@@ -62,13 +46,6 @@ class NewRelic::NoticedError
62
46
  @timestamp = timestamp
63
47
  end
64
48
 
65
- # @exception_class has been deprecated in favor of the more descriptive
66
- # @exception_class_name.
67
- # @deprecated
68
- def exception_class
69
- exception_class_name
70
- end
71
-
72
49
  def ==(other)
73
50
  if other.respond_to?(:exception_id)
74
51
  exception_id == other.exception_id
@@ -181,4 +158,18 @@ class NewRelic::NoticedError
181
158
  def intrinsic_attributes
182
159
  processed_attributes[INTRINSIC_ATTRIBUTES]
183
160
  end
161
+
162
+ def extract_class_name_and_message_from(exception)
163
+ if exception.nil?
164
+ @exception_class_name = UNKNOWN_ERROR_CLASS_NAME
165
+ @message = NIL_ERROR_MESSAGE
166
+ else
167
+ if defined?(Rails) && Rails::VERSION::MAJOR < 5 && exception.respond_to?(:original_exception)
168
+ exception = exception.original_exception || exception
169
+ end
170
+ @exception_class_name = exception.is_a?(Exception) ? exception.class.name : UNKNOWN_ERROR_CLASS_NAME
171
+ @message = exception.to_s
172
+ end
173
+ end
174
+
184
175
  end
@@ -10,9 +10,9 @@ module NewRelic
10
10
  parts.compact.join('.')
11
11
  end
12
12
 
13
- MAJOR = 3
14
- MINOR = 18
15
- TINY = 1
13
+ MAJOR = 4
14
+ MINOR = 0
15
+ TINY = 0
16
16
 
17
17
  begin
18
18
  require File.join(File.dirname(__FILE__), 'build')
@@ -22,49 +22,4 @@ module NewRelic
22
22
 
23
23
  STRING = build_version_string(MAJOR, MINOR, TINY, BUILD)
24
24
  end
25
-
26
- # Helper class for managing version comparisons
27
- class VersionNumber
28
- attr_reader :parts
29
- include Comparable
30
- def initialize(version_string)
31
- version_string ||= '1.0.0'
32
- @parts = version_string.split('.').map{|n| n =~ /^\d+$/ ? n.to_i : n}
33
- end
34
- def major_version; @parts[0]; end
35
- def minor_version; @parts[1]; end
36
- def tiny_version; @parts[2]; end
37
-
38
- def <=>(other)
39
- other = self.class.new(other) if other.is_a? String
40
- self.class.compare(self.parts, other.parts)
41
- end
42
-
43
- def to_s
44
- @parts.join(".")
45
- end
46
-
47
- def hash
48
- @parts.hash
49
- end
50
-
51
- def eql? other
52
- (self <=> other) == 0
53
- end
54
-
55
- private
56
- def self.compare(parts1, parts2)
57
- a, b = parts1.first, parts2.first
58
- case
59
- when a.nil? && b.nil? then 0
60
- when a.nil? then b.is_a?(Integer) ? -1 : 1
61
- when b.nil? then -compare(parts2, parts1)
62
- when a.to_s == b.to_s then compare(parts1[1..-1], parts2[1..-1])
63
- when a.is_a?(String) then b.is_a?(Integer) ? -1 : (a <=> b)
64
- when b.is_a?(String) then -compare(parts2, parts1)
65
- else # they are both fixnums, not nil
66
- a <=> b
67
- end
68
- end
69
- end
70
25
  end
@@ -25,7 +25,7 @@ namespace :newrelic do
25
25
  end
26
26
  end
27
27
 
28
- def build_erb(format)
28
+ def build_versions_erb(format)
29
29
  require 'erb'
30
30
  path = File.join(File.dirname(__FILE__), "versions.#{format}.erb")
31
31
  template = File.read(File.expand_path(path))
@@ -33,20 +33,22 @@ namespace :newrelic do
33
33
  end
34
34
 
35
35
  def write_versions(title, type, erb)
36
- title.downcase.gsub(" ", "_")
37
- versions_for_type(type)
36
+ anchor = title.downcase.gsub(" ", "_")
37
+ versions = versions_for_type(type)
38
38
  puts erb.result(binding).gsub(/^ *$/, '')
39
+
40
+ "#{anchor} #{versions}" # silences unused warnings
39
41
  end
40
42
 
41
43
  def include_if_exists(filename)
42
44
  path = File.join(File.dirname(__FILE__), filename)
43
- puts File.read(path) if File.exists?(path)
45
+ puts File.read(path) if File.exist?(path)
44
46
  end
45
47
 
46
48
  VersionStruct = Struct.new(:name, :supported, :deprecated, :experimental, :notes)
47
49
 
48
50
  format = args[:format] || "txt"
49
- erb = build_erb(format)
51
+ erb = build_versions_erb(format)
50
52
 
51
53
  include_if_exists("versions.preface.#{format}")
52
54
 
@@ -8,7 +8,7 @@ require 'new_relic/latest_changes'
8
8
  Gem::Specification.new do |s|
9
9
  s.name = "newrelic_rpm"
10
10
  s.version = NewRelic::VERSION::STRING
11
- s.required_ruby_version = '>= 1.8.7'
11
+ s.required_ruby_version = '>= 2.0.0'
12
12
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
13
13
  s.authors = [ "Tim Krajcar", "Matthew Wear", "Katherine Wu", "Kenichi Nakamura" ]
14
14
  s.date = Time.now.strftime('%Y-%m-%d')
@@ -50,24 +50,9 @@ EOS
50
50
  s.add_development_dependency 'pry', '~> 0.9.12'
51
51
  s.add_development_dependency 'hometown', '~> 0.2.5'
52
52
 
53
- # rack-cache ~> 1.2 is specified by actionpack 3.2, but rack-cache 1.3.1 only works on Ruby 1.9.3 & newer. :(
54
- # https://github.com/rtomayko/rack-cache/issues/124
55
- if RUBY_VERSION < "1.9.3"
56
- s.add_development_dependency "rack-cache", "~> 1.2.0"
57
- end
58
-
59
- # version lock down for i18n that is compatible with Ruby 1.8.7
60
- s.add_development_dependency 'i18n', '0.6.11'
61
-
62
53
  if RUBY_PLATFORM == 'java'
63
54
  s.add_development_dependency 'activerecord-jdbcsqlite3-adapter'
64
- s.add_development_dependency 'jruby-openssl', '~> 0.9.10' unless JRUBY_VERSION > '1.7'
65
55
  else
66
56
  s.add_development_dependency 'sqlite3'
67
57
  end
68
-
69
- if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
70
- s.add_development_dependency 'rubysl'
71
- s.add_development_dependency 'racc'
72
- end
73
58
  end
@@ -5,6 +5,8 @@
5
5
  # These helpers should not have any gem dependencies except on newrelic_rpm
6
6
  # itself, and should be usable from within any multiverse suite.
7
7
 
8
+ require 'json'
9
+
8
10
  class ArrayLogDevice
9
11
  def initialize( array=[] )
10
12
  @array = array
@@ -600,7 +602,7 @@ ensure
600
602
  end
601
603
 
602
604
  def json_dump_and_encode(object)
603
- Base64.encode64(NewRelic::JSONWrapper.dump(object))
605
+ Base64.encode64(::JSON.dump(object))
604
606
  end
605
607
 
606
608
  def get_last_analytics_event
@@ -626,7 +628,7 @@ def load_cross_agent_test(name)
626
628
  test_file_path = File.join(cross_agent_tests_dir, "#{name}.json")
627
629
  data = File.read(test_file_path)
628
630
  data.gsub!('callCount', 'call_count')
629
- data = NewRelic::JSONWrapper.load(data)
631
+ data = ::JSON.load(data)
630
632
  data.each { |testcase| testcase['testname'].gsub! ' ', '_' if String === testcase['testname'] }
631
633
  data
632
634
  end
@@ -4,8 +4,8 @@
4
4
 
5
5
  require 'bundler'
6
6
 
7
- require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'multiverse', 'lib', 'multiverse', 'color'))
8
- require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'multiverse', 'lib', 'multiverse', 'shell_utils'))
7
+ require File.expand_path '../../../../multiverse/lib/multiverse/color', __FILE__
8
+ require File.expand_path '../../../../multiverse/lib/multiverse/shell_utils', __FILE__
9
9
 
10
10
  module Environments
11
11
  class Runner
@@ -13,18 +13,11 @@ module Environments
13
13
 
14
14
  BLACKLIST = {
15
15
  "2.2.1" => ["rails50"],
16
- "2.2.0" => ["rails50"],
16
+ "2.2" => ["rails50"],
17
17
  "2.1" => ["rails50"],
18
18
  "2.0" => ["rails50"],
19
19
  "2" => ["rails21", "rails22", "rails23"],
20
- "1.9" => ["rails21", "rails22", "rails50"],
21
- "1.9.2" => ["rails40", "rails41", "rails42", "rails50"],
22
- "1.8.7" => ["rails40", "rails41", "rails42", "rails50"],
23
- "ree" => ["rails40", "rails41", "rails42", "rails50"],
24
- "jruby-1.6" => ["rails40", "rails41", "rails42", "rails50"],
25
- "jruby-1.7" => ["rails21", "rails22", "rails23", "rails50"],
26
- "jruby-9.0" => ["rails21", "rails22", "rails23", "rails30", "rails31", "rails32"],
27
- "rbx-2.0" => ["rails21", "rails22", "rails23", "rails30", "rails31", "rails32"],
20
+ "jruby-9.0" => ["rails21", "rails22", "rails23", "rails30", "rails31", "rails32"]
28
21
  }
29
22
 
30
23
  attr_reader :envs
@@ -34,7 +27,7 @@ module Environments
34
27
  end
35
28
 
36
29
  def env_root
37
- File.join(File.dirname(__FILE__), "..", "..")
30
+ File.expand_path '../../..', __FILE__
38
31
  end
39
32
 
40
33
  def run_and_report
@@ -69,9 +62,7 @@ module Environments
69
62
  dirs = potential_directories
70
63
 
71
64
  version = RUBY_VERSION
72
- version = "ree" if defined?(RUBY_DESCRIPTION) && RUBY_DESCRIPTION =~ /Ruby Enterprise Edition/
73
65
  version = "jruby-#{JRUBY_VERSION[0..2]}" if defined?(JRUBY_VERSION)
74
- version = "rbx-2.0" if defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
75
66
 
76
67
  BLACKLIST.each do |check_version, blacklisted|
77
68
  if version.start_with?(check_version)
@@ -12,14 +12,6 @@ else
12
12
  end
13
13
 
14
14
  gem 'rack-test'
15
- gem 'json', '< 1.8.5' if RUBY_VERSION == "1.8.7"
16
-
17
- platforms :rbx do
18
- gem "rubysl"
19
- gem "rubysl-test-unit"
20
- gem "psych"
21
- gem "racc" # https://github.com/rubinius/rubinius/issues/2632
22
- end
23
15
 
24
16
  gem "newrelic_rpm", :path => "../../.."
25
17
 
@@ -21,11 +21,3 @@ end
21
21
 
22
22
  gem 'pry', '~> 0.9.12'
23
23
  gem 'hometown', '~> 0.2.5'
24
-
25
- if RUBY_VERSION < '1.9'
26
- gem 'git', '< 1.3' # git 1.3.0 requires Ruby version >= 1.9
27
- gem 'json_pure', '< 1.8.5'
28
- gem 'json', '< 1.8.5'
29
- gem 'rdoc', '4.2.0'
30
- end
31
-
@@ -1,6 +1,6 @@
1
1
  mysql: &mysql
2
2
  adapter: mysql
3
- socket: <%= (`uname -s` =~ /Linux/ ) ? "" :"/tmp/mysql.sock" %>
3
+ socket: <%= (`uname -s` =~ /Linux/ ) ? "" : "/tmp/mysql.sock" %>
4
4
  username: root
5
5
  host: localhost
6
6
  database: <%= db = "#{ENV['RUBY_VERSION']}#{ENV['BRANCH']}"; db.empty? ? "rails_blog" : db %>
@@ -22,11 +22,3 @@ end
22
22
 
23
23
  gem 'pry', '~> 0.9.12'
24
24
  gem 'hometown', '~> 0.2.5'
25
-
26
- if RUBY_VERSION < '1.9'
27
- gem 'git', '< 1.3' # git 1.3.0 requires Ruby version >= 1.9
28
- gem 'json_pure', '< 1.8.5'
29
- gem 'json', '< 1.8.5'
30
- gem 'rdoc', '4.2.0'
31
- end
32
-
@@ -1,6 +1,6 @@
1
1
  mysql: &mysql
2
2
  adapter: mysql
3
- socket: <%= (`uname -s` =~ /Linux/ ) ? "" :"/tmp/mysql.sock" %>
3
+ socket: <%= (`uname -s` =~ /Linux/ ) ? "" : "/tmp/mysql.sock" %>
4
4
  username: root
5
5
  host: localhost
6
6
  database: <%= db = "#{ENV['RUBY_VERSION']}#{ENV['BRANCH']}"; db.empty? ? "rails_blog" : db %>
@@ -7,13 +7,7 @@ gem 'minitest', '~>4.7.5'
7
7
  gem 'mocha', :require => false
8
8
  gem 'rack', '< 2.0.0'
9
9
  gem 'rack-test'
10
- gem 'json', '< 1.8.5' if RUBY_VERSION == "1.8.7"
11
-
12
- if RUBY_VERSION < '2.0'
13
- gem 'rdoc', '4.2.0'
14
- else
15
- gem 'rdoc'
16
- end
10
+ gem 'rdoc'
17
11
 
18
12
  gem "newrelic_rpm", :path => '../../..'
19
13
 
@@ -1,6 +1,6 @@
1
1
  mysql: &mysql
2
2
  adapter: mysql
3
- socket: <%= (`uname -s` =~ /Linux/ ) ? "" :"/tmp/mysql.sock" %>
3
+ socket: <%= (`uname -s` =~ /Linux/ ) ? "" : "/tmp/mysql.sock" %>
4
4
  username: root
5
5
  host: localhost
6
6
  database: <%= db = "#{ENV['RUBY_VERSION']}#{ENV['BRANCH']}"; db.empty? ? "rails_blog" : db %>
@@ -7,7 +7,6 @@ gem 'minitest', '~>4.7.5'
7
7
  gem 'mocha', :require => false
8
8
  gem 'rack', '< 2.0.0'
9
9
  gem 'rack-test'
10
- gem 'json', '< 1.8.5' if RUBY_VERSION == "1.8.7"
11
10
 
12
11
  gem 'newrelic_rpm', :path => '../../..'
13
12
 
@@ -1,6 +1,6 @@
1
1
  mysql: &mysql
2
2
  adapter: mysql
3
- socket: <%= (`uname -s` =~ /Linux/ ) ? "" :"/tmp/mysql.sock" %>
3
+ socket: <%= (`uname -s` =~ /Linux/ ) ? "" : "/tmp/mysql.sock" %>
4
4
  username: root
5
5
  host: localhost
6
6
  database: <%= db = "#{ENV['RUBY_VERSION']}#{ENV['BRANCH']}"; db.empty? ? "rails_blog" : db %>
@@ -8,7 +8,6 @@ gem 'minitest', '~>4.7.5'
8
8
  gem 'mocha', :require => false
9
9
  gem 'rack', '< 2.0.0'
10
10
  gem 'rack-test'
11
- gem 'json', '< 1.8.5' if RUBY_VERSION == "1.8.7"
12
11
 
13
12
  gem 'newrelic_rpm', :path => '../../..'
14
13
 
@@ -23,5 +22,3 @@ end
23
22
 
24
23
  gem 'pry', '~> 0.9.12'
25
24
  gem 'hometown', '~> 0.2.5'
26
-
27
- gem 'rack-cache', '< 1.3' if RUBY_VERSION < '1.9.3' # rack-cache 1.3.0 only supports >= 1.9.3
@@ -1,6 +1,6 @@
1
1
  mysql: &mysql
2
2
  adapter: mysql
3
- socket: <%= (`uname -s` =~ /Linux/ ) ? "" :"/tmp/mysql.sock" %>
3
+ socket: <%= (`uname -s` =~ /Linux/ ) ? "" : "/tmp/mysql.sock" %>
4
4
  username: root
5
5
  host: localhost
6
6
  database: <%= db = "#{ENV['RUBY_VERSION']}#{ENV['BRANCH']}"; db.empty? ? "rails_blog" : db %>
@@ -8,7 +8,6 @@ gem 'minitest', '~>4.7.5'
8
8
  gem 'mocha', :require => false
9
9
  gem 'rack', '< 2.0.0'
10
10
  gem 'rack-test'
11
- gem 'json', '< 1.8.5' if RUBY_VERSION == "1.8.7"
12
11
 
13
12
  gem "newrelic_rpm", :path => "../../.."
14
13
 
@@ -25,5 +24,3 @@ end
25
24
 
26
25
  gem 'pry', '~> 0.9.12'
27
26
  gem 'hometown', '~> 0.2.5'
28
-
29
- gem 'rack-cache', '< 1.3' if RUBY_VERSION < '1.9.3' # rack-cache 1.3.0 only supports >= 1.9.3