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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1cd0765e76ebfc085bc1c188129bf8325426f948
4
- data.tar.gz: bc980fd96d38642276207304b8e49e81fe2096e6
3
+ metadata.gz: 81155526cdfb56a9df0ef1a7d99581957c2411b3
4
+ data.tar.gz: '0148827c5127cec9b155153931fd7c9b22342ad0'
5
5
  SHA512:
6
- metadata.gz: a20c173ea69b8aad777094c0e2043257883ea89f8a4f3596f7ec88cef8307474843ddd6f1a178551ba5090b31c5cfdb48524d98a94e2cf32425b0dff90c79d1d
7
- data.tar.gz: d74f290acc033f60896f85c70296cc5ff10aa2daf725709563ce3234421107ed5c957f2f080c91afb541cd14ae6cd560822211c12fb64cf16713c034536f5815
6
+ metadata.gz: 9004938e83d097bef504414aadb3724cdb69e886192cdd68587749ec65d345b91df4ca856bff4298e441a4c2c91ff299b122b0dea62ad5dae9f5b82f3acf1054
7
+ data.tar.gz: 383de7891a6f4f61620ef9596890ddc771194cbc889e64af1dc56aaff6099ed4780785a0094a49fed86d7bcfa3e6cbbff1933589ad9c285af9230fa266b6e453
data/.gitignore CHANGED
@@ -4,3 +4,4 @@
4
4
  /doc/
5
5
  /pkg/
6
6
  /vendor/cache/*.gem
7
+ *.gem
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
- serializaton = Derketo::Serializers::Mermaid.new(tracer).serialize
27
+ serialization = Derketo::Serializers::Mermaid.new(tracer).serialize
28
28
  Derketo::Helpers.write('./tmp/test.mmd', serialization)
29
29
 
30
- ## Integrate with a Rack Application
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 install derketo
38
+ $ gem build derketo.gemspec
39
+ $ gem install derketo-<VERSION>.gem
36
40
 
37
41
  ## Copyright
38
42
 
@@ -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
@@ -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
@@ -15,7 +15,7 @@ module Derketo
15
15
  end
16
16
 
17
17
  def participant(class_name)
18
- "\tparticipant #{clean(class_name)}\n"
18
+ "\tparticipant #{class_name}\n"
19
19
  end
20
20
 
21
21
  def serialize
@@ -1,4 +1,4 @@
1
1
  module Derketo
2
2
  # derketo version
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
@@ -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
- @dummy_class.write(filename, 'test')
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.0
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-04 00:00:00.000000000 Z
11
+ date: 2018-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler