trace_location 0.3.0 → 0.4.0
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/trace_location/generator.rb +1 -0
- data/lib/trace_location/generator/csv.rb +39 -0
- data/lib/trace_location/report.rb +1 -0
- data/lib/trace_location/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac60bad7314ff13ccd86da5e6b88bff9dd50afedb445a3afabee76495aee49fb
|
4
|
+
data.tar.gz: 911bbeafa5bdb0d29d47e99fdb1cee89b55abc8b9d44f4157c5b9833e5dc093c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 211e0891220cb42c8def533b18ca2baeb55fd91c88c847d861482e5a80cae0feba5d5c292ec4b537fcf6173525c49f337bd46ce93f12922a9b6772a92a73227a
|
7
|
+
data.tar.gz: 7fa374686f1131f66e1046469fae708f643a0a6be6040f9773da60c2777e0a8a03c51e8962300d4ffe83d1fe1afd5dd4879fd2e4490db4b134e25185e65770d6
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'csv'
|
4
|
+
|
5
|
+
module TraceLocation
|
6
|
+
module Generator
|
7
|
+
class Csv < Base # :nodoc:
|
8
|
+
def initialize(events, return_value, options)
|
9
|
+
@events = events
|
10
|
+
@return_value = return_value
|
11
|
+
@dest_dir = options.fetch(:dest_dir) { ::TraceLocation.config.dest_dir }
|
12
|
+
@file_path = File.join(@dest_dir, "trace_location-#{Time.now.strftime('%Y%m%d%H%m%s')}.csv")
|
13
|
+
end
|
14
|
+
|
15
|
+
def generate
|
16
|
+
setup_dir
|
17
|
+
create_file
|
18
|
+
$stdout.puts "Created at #{file_path}"
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
attr_reader :events, :return_value, :dest_dir, :file_path
|
24
|
+
|
25
|
+
def setup_dir
|
26
|
+
FileUtils.mkdir_p(dest_dir)
|
27
|
+
end
|
28
|
+
|
29
|
+
def create_file
|
30
|
+
CSV.open(file_path, 'wb+') do |csv|
|
31
|
+
csv << %w[event method path lineno]
|
32
|
+
events.each do |e|
|
33
|
+
csv << [e.event, e.method_str, e.path, e.lineno]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trace_location
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoshiyuki Hirano
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -78,6 +78,7 @@ files:
|
|
78
78
|
- lib/trace_location/event.rb
|
79
79
|
- lib/trace_location/generator.rb
|
80
80
|
- lib/trace_location/generator/base.rb
|
81
|
+
- lib/trace_location/generator/csv.rb
|
81
82
|
- lib/trace_location/generator/log.rb
|
82
83
|
- lib/trace_location/railtie.rb
|
83
84
|
- lib/trace_location/report.rb
|