Class: Appsignal::Sourcemap::Uploader
- Inherits:
-
Object
- Object
- Appsignal::Sourcemap::Uploader
- Defined in:
- lib/appsignal/sourcemap/uploader.rb
Constant Summary collapse
- UPLOAD_URI =
URI("https://appsignal.com/api/sourcemaps")
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(sourcemap_path) ⇒ Uploader
constructor
A new instance of Uploader.
- #upload ⇒ Object
Constructor Details
#initialize(sourcemap_path) ⇒ Uploader
Returns a new instance of Uploader.
12 13 14 |
# File 'lib/appsignal/sourcemap/uploader.rb', line 12 def initialize(sourcemap_path) @sourcemap_path = sourcemap_path end |
Class Method Details
.upload(sourcemap_path) ⇒ Object
8 9 10 |
# File 'lib/appsignal/sourcemap/uploader.rb', line 8 def self.upload(sourcemap_path) new(sourcemap_path).upload end |
Instance Method Details
#upload ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/appsignal/sourcemap/uploader.rb', line 16 def upload Rails.logger.debug("Starting sourcemap upload '#{@sourcemap_path}' with parameters: #{request_form_data}") response = Net::HTTP.start(UPLOAD_URI.hostname, UPLOAD_URI.port, use_ssl: true) do |http| http.request(request) end if response.is_a?(Net::HTTPSuccess) Rails.logger.debug("Finished sourcemap upload '#{@sourcemap_path}'") File.delete(sourcemap_full_path) return end Rails.logger.error " Uploading sourcemap \#{@sourcemap_path} failed with message '\#{response.message}'.\n Response: \#{response.body}\n MESSAGE\nend\n" |