cutter 0.5.8 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.rdoc +54 -10
  2. data/lib/cutter/railtie.rb +1 -1
  3. metadata +3 -3
data/README.rdoc CHANGED
@@ -15,9 +15,10 @@ Insert #inspect! method into any of your methods:
15
15
  end
16
16
 
17
17
  your_method(1,"foo",:bar) =>
18
- method `your_method'
19
- variables:
20
- args: [1, "foo", :bar]
18
+
19
+ method `your_method'
20
+ variables:
21
+ args: [1, "foo", :bar]
21
22
 
22
23
  or in more rigorous way:
23
24
 
@@ -26,22 +27,65 @@ or in more rigorous way:
26
27
  end
27
28
 
28
29
  your_another_method(1,"foo",:bar) =>
29
- method `your_another_method'
30
- variables:
31
- first: 1
32
- second: "foo"
33
- third: :bar
34
- block:
30
+
31
+ method `your_another_method'
32
+ variables:
33
+ first: 1
34
+ second: "foo"
35
+ third: :bar
36
+ block:
35
37
 
36
38
 
37
39
  Gives simple but nice trace for inspection: method's name and args that were passed to method
38
40
 
41
+ With :inspect => true we have self#inspect of class to which method belongs to:
42
+
43
+ def method_self_inspect
44
+ ...
45
+ inspect!(:inspect => true) {}
46
+ end
47
+
48
+ method_self_inspect(1,2,3,4,5) =>
49
+
50
+ method: `method_self_inspect'
51
+ called from class: SelfInspectDemo
52
+ variables:
53
+ name: 1
54
+ args: [2, 3, 4, 5]
55
+ block:
56
+ self inspection:
57
+ #<SelfInspectDemo:0x82be488 @variable="I'm variable">
58
+
59
+ And finally :level => N gives caller methods chain (N + 1 caller methods):
60
+
61
+ def method_caller_chain
62
+ ...
63
+ inspect!(:level => 2)
64
+ end
65
+
66
+ method_caller_chain(1,2,3,4,5) =>
67
+
68
+ method: `method_caller_chain'
69
+ called from class: RSpec::Core::ExampleGroup::Nested_1::Nested_1
70
+ variables:
71
+ name: 1
72
+ args: [2, 3, 4, 5]
73
+ block:
74
+ caller methods:
75
+ /home/stanislaw/_work_/gems/cutter/spec/inspection/demo_spec.rb:33:in `method_caller_chain'
76
+ /home/stanislaw/_work_/gems/cutter/spec/inspection/demo_spec.rb:40:in `block (3 levels) in <top (required)>'
77
+ /home/stanislaw/.rvm/gems/ruby-1.9.2-p180@310/gems/rspec-core-2.6.4/lib/rspec/core/example.rb:48:in `instance_eval'
78
+
39
79
  If you want all #inspect! methods fall silent at once, use
40
80
  Cutter::Inspection.quiet!
41
81
  To make them sound again do
42
82
  Cutter::Inspection.loud!
43
83
 
44
- You can clone it and try bundle exec rspec spec/inspection/demo_spec. Very! Very simple!
84
+ You can clone it and try
85
+
86
+ bundle exec rspec spec/inspection/demo_spec.rb
87
+
88
+ Very! Very simple!
45
89
 
46
90
  ==II) #stamper
47
91
  def your_method
@@ -1,7 +1,7 @@
1
1
  module Cutter
2
2
  class Railtie < Rails::Railtie
3
3
  initializer "cutter" do |app|
4
- puts "initializing cutter..."
4
+ #puts "initializing cutter..."
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: cutter
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.8
5
+ version: 0.5.9
6
6
  platform: ruby
7
7
  authors:
8
8
  - stanislaw
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-16 00:00:00 +03:00
13
+ date: 2011-07-23 00:00:00 +03:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -110,7 +110,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
110
  requirements:
111
111
  - - ">="
112
112
  - !ruby/object:Gem::Version
113
- hash: -716599551
113
+ hash: 554901585
114
114
  segments:
115
115
  - 0
116
116
  version: "0"