derketo 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +7 -3
- data/lib/derketo/events/call.rb +1 -1
- data/lib/derketo/events/event.rb +5 -3
- data/lib/derketo/serializers/mermaid.rb +1 -1
- data/lib/derketo/version.rb +1 -1
- data/spec/derketo/helpers_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81155526cdfb56a9df0ef1a7d99581957c2411b3
|
4
|
+
data.tar.gz: '0148827c5127cec9b155153931fd7c9b22342ad0'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9004938e83d097bef504414aadb3724cdb69e886192cdd68587749ec65d345b91df4ca856bff4298e441a4c2c91ff299b122b0dea62ad5dae9f5b82f3acf1054
|
7
|
+
data.tar.gz: 383de7891a6f4f61620ef9596890ddc771194cbc889e64af1dc56aaff6099ed4780785a0094a49fed86d7bcfa3e6cbbff1933589ad9c285af9230fa266b6e453
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -24,15 +24,19 @@ Here's an example sequence diagram that was generated by Derketo:
|
|
24
24
|
|
25
25
|
tracer = Derketo::Tracer.new()
|
26
26
|
tracer.trace { Mermaid.new.sing }
|
27
|
-
|
27
|
+
serialization = Derketo::Serializers::Mermaid.new(tracer).serialize
|
28
28
|
Derketo::Helpers.write('./tmp/test.mmd', serialization)
|
29
29
|
|
30
|
-
## Integrate with
|
30
|
+
## Integrate with Rack/Rails
|
31
31
|
|
32
32
|
All you should have to do is define the root of your project in an ENV called `DERKETO_ROOT` and `require 'derketo/middleware'`.
|
33
|
+
|
34
|
+
If you use Rails, just add `require 'derketo/railtie` to your `application.rb`.
|
35
|
+
|
33
36
|
## Install
|
34
37
|
|
35
|
-
$ gem
|
38
|
+
$ gem build derketo.gemspec
|
39
|
+
$ gem install derketo-<VERSION>.gem
|
36
40
|
|
37
41
|
## Copyright
|
38
42
|
|
data/lib/derketo/events/call.rb
CHANGED
@@ -6,7 +6,7 @@ module Derketo
|
|
6
6
|
if parameters.empty?
|
7
7
|
"\t#{previous.class_name}->>#{class_name}: #{method_id}\n"
|
8
8
|
else
|
9
|
-
"\t#{previous.class_name}->>#{class_name}: #{method_id}(#{parameters})\n"
|
9
|
+
"\t#{previous.class_name}->>#{class_name}: #{method_id}(#{clean(parameters)})\n"
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
data/lib/derketo/events/event.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
require 'json'
|
2
|
+
require 'derketo/helpers'
|
2
3
|
module Derketo
|
3
4
|
class Event
|
5
|
+
include Derketo::Helpers
|
4
6
|
attr_accessor :class_name, :return_value, :type, :method_id, :parameters, :previous, :next
|
5
7
|
|
6
8
|
def initialize(tracepoint)
|
7
|
-
@class_name = tracepoint.defined_class.to_s
|
8
|
-
@return_value = tracepoint.event == :return ? tracepoint.return_value : nil
|
9
|
+
@class_name = clean(tracepoint.defined_class.to_s)
|
10
|
+
@return_value = tracepoint.event == :return ? clean(tracepoint.return_value.to_s) : nil
|
9
11
|
@type = tracepoint.event
|
10
|
-
@method_id = tracepoint.method_id
|
12
|
+
@method_id = clean(tracepoint.method_id.to_s)
|
11
13
|
@parameters = tracepoint.self.method(tracepoint.method_id).parameters
|
12
14
|
@previous = self
|
13
15
|
end
|
data/lib/derketo/version.rb
CHANGED
@@ -46,7 +46,7 @@ describe Derketo::Helpers do
|
|
46
46
|
|
47
47
|
it 'writes to a file' do
|
48
48
|
filename = File.expand_path(File.dirname(__FILE__) + '../../tmp/test.txt')
|
49
|
-
|
49
|
+
Derketo::Helpers.write(filename, 'test')
|
50
50
|
expect(File.file?(filename)).to eq(true)
|
51
51
|
end
|
52
52
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: derketo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Searles
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|