source_route 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a497dac48db0ce73092b5fd0b1bff7a3d43b017
4
- data.tar.gz: 5008e83d2a398c35c5fc0a6dc379a19d2641ed53
3
+ metadata.gz: 041a4d7886479530f9fde5b9ae5d065ecd8e8d37
4
+ data.tar.gz: 90b253aafe37a4fe6748fa28157928ef6c52e89f
5
5
  SHA512:
6
- metadata.gz: b751bcd35cd72c63133c4367e57d15ae26929084c70c372afe07ca2ec8e35db78f4ad5e94aa8504cb17b50d0d8d20d10fe5e741b77ee2e5a53f8fbd8209908ed
7
- data.tar.gz: bbd3f567b24261dee0a075fb1a2e180eae2cd49761a10fca7eefdf474a5911b07a29c7088bbaae68b4926e57d7b21719e03b8ee3d17ab14d69dffcafe56e9fe9
6
+ metadata.gz: 493b59aebebc7469f2e018541afc7fa109462a2029bee32157248ef7eed86ca940a6b22804356b6ebad0cee9617c097bd1ec7c874d380d6d128fdd8c4154f826
7
+ data.tar.gz: cd3354a5fa9fe8091aedcdb46d28f6dd329df0e8750e139ebe4d4d66a12db21d2eb3e0abeb0f409b7cb7464c0a84268f8ce24be60de9b48900e22cbc9c45c206
data/README.md CHANGED
@@ -60,6 +60,7 @@ Same as the previous example, you will get a html file showing the code trace.
60
60
  It will output the trace when you run the application.
61
61
 
62
62
  see more usage in examples.
63
+ see full usage in examples/callback_in_activesupport.rb
63
64
 
64
65
  ## Test
65
66
 
@@ -78,10 +79,7 @@ see more usage in examples.
78
79
  ### TODO
79
80
 
80
81
  Hide defined class filter. Add vertical timeline.
81
-
82
- Add TpResults and GenerateResult(moved from TpResult) class.
83
- ( http://tympanus.net/codrops/2013/05/02/vertical-timeline/
82
+ (see http://tympanus.net/codrops/2013/05/02/vertical-timeline/
84
83
  http://stackoverflow.com/questions/20896240/responsive-timeline-ui-with-bootstrap3)
85
84
 
86
-
87
85
  Add debug option to provider more verbose messages of what has happened
@@ -16,7 +16,7 @@ html
16
16
  ruby:
17
17
  local_trace_data = @tp_result_chain.map do |tp_result|
18
18
  if tp_result.key?(:defined_class)
19
- tp_result[:defined_class] = tp_result[:defined_class].inspect
19
+ tp_result[:defined_class] = tp_result[:defined_class].to_s
20
20
  tp_result[:return_value] = tp_result[:return_value].inspect if tp_result.key?(:return_value)
21
21
  end
22
22
  tp_result
@@ -60,7 +60,7 @@ html
60
60
  | .
61
61
  mark.method-value(ng-bind="trace.method_id")
62
62
  / workaround for return_value is 'false' and return_value always to be string when existed
63
- div(ng-if="isIncludeReturnValue")
63
+ div(ng-if="trace.hasOwnProperty('return_value')")
64
64
  span
65
65
  | =>
66
66
  span<(ng-bind="trace.return_value")
@@ -97,8 +97,6 @@ html
97
97
  $scope.traces = angular.element("#trace-data").data('trace')
98
98
  $scope.tpEvents = angular.element("#trace-data").data('tp-events')
99
99
 
100
- $scope.isIncludeReturnValue = !angular.isUndefined($scope.traces[0].return_value)
101
-
102
100
  $scope.traceFilter = {event: $scope.tpEvents[0]}
103
101
  if ($scope.tpEvents.length == 1 && angular.isUndefined($scope.traces[0].event)) {
104
102
  _.each($scope.traces, function(trace) {
@@ -2,7 +2,7 @@ module SourceRoute
2
2
 
3
3
  class TpResultChain
4
4
  extend Forwardable
5
- def_delegators :@chain, :each, :index, :first, :last, :size, :push, :values_at, :pop
5
+ def_delegators :@chain, :each, :index, :first, :last, :size, :push, :values_at, :pop, :[]
6
6
 
7
7
  include Enumerable
8
8
 
@@ -1,3 +1,3 @@
1
1
  module SourceRoute
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -24,7 +24,7 @@ module SourceRoute
24
24
  positive[m] = v.map(&:to_s).join('|')
25
25
  end
26
26
 
27
- define_method "#{m}_not" do |v|
27
+ define_method "#{m}_not" do |*v|
28
28
  negatives[m] = v.map(&:to_s).join('|')
29
29
  end
30
30
  end
@@ -45,8 +45,16 @@ class SourceRouteTest < Minitest::Test
45
45
  assert @wrapper.tp_result_chain.size > 0
46
46
  end
47
47
 
48
+ def test_not_match
49
+ SourceRoute.enable do
50
+ method_id_not 'nonsense'
51
+ end
52
+ SampleApp.new.nonsense
53
+ refute_includes @wrapper.tp_result_chain.map(&:values).flatten, 'nonsense'
54
+ end
55
+
48
56
  def test_match_class_name
49
- @source_route = SourceRoute.enable do
57
+ SourceRoute.enable do
50
58
  defined_class :SampleApp
51
59
  end
52
60
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: source_route
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
  - raykin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-25 00:00:00.000000000 Z
11
+ date: 2014-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print