letters 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/lib/letters.rb CHANGED
@@ -1,12 +1 @@
1
1
  require "letters/patch/object"
2
- require "set"
3
-
4
- module Letters
5
- def self.object_for_diff=(object)
6
- @@object = object
7
- end
8
-
9
- def self.object_for_diff
10
- @@object if defined?(@@object)
11
- end
12
- end
@@ -1,4 +1,5 @@
1
1
  require "letters/helpers"
2
+ require "letters/diff"
2
3
  require "letters/assertion_error"
3
4
  require "letters/empty_error"
4
5
  require "letters/nil_error"
@@ -0,0 +1,9 @@
1
+ module Letters
2
+ def self.object_for_diff=(object)
3
+ @@object = object
4
+ end
5
+
6
+ def self.object_for_diff
7
+ @@object if defined?(@@object)
8
+ end
9
+ end
@@ -1,4 +1,5 @@
1
1
  require "letters/patch"
2
+ require "set"
2
3
 
3
4
  Letters.patch! Numeric
4
5
  Letters.patch! Symbol
@@ -1,3 +1,3 @@
1
1
  module Letters
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
@@ -1,5 +1,9 @@
1
1
  class ActiveRecord
2
- class Base; end
2
+ class Base
3
+ def -(other)
4
+ self
5
+ end
6
+ end
3
7
  end
4
8
 
5
9
  class ActionController
@@ -11,13 +15,24 @@ class ActionMailer
11
15
  end
12
16
 
13
17
  describe "Rails patches" do
14
- it "adds methods to each of the specified core classes" do
15
- require "letters/patch/core"
18
+ before do
19
+ require "letters/patch/rails"
20
+ end
16
21
 
22
+ it "adds methods to each of the specified core classes" do
17
23
  [ActiveRecord::Base,
18
24
  ActionController::Base,
19
25
  ActionMailer::Base].each do |klass|
20
26
  klass.new.should respond_to(:a)
21
27
  end
22
28
  end
29
+
30
+ it "allows d1/d2 pairs" do
31
+ $stdout.should_receive(:puts)
32
+
33
+ lambda do
34
+ ActiveRecord::Base.new.d1
35
+ ActiveRecord::Base.new.d2
36
+ end.should_not raise_error
37
+ end
23
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: letters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-01 00:00:00.000000000Z
12
+ date: 2012-10-02 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: awesome_print
16
- requirement: &70104704631580 !ruby/object:Gem::Requirement
16
+ requirement: &70156844194680 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70104704631580
24
+ version_requirements: *70156844194680
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activesupport
27
- requirement: &70104704631140 !ruby/object:Gem::Requirement
27
+ requirement: &70156844194240 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70104704631140
35
+ version_requirements: *70156844194240
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: xml-simple
38
- requirement: &70104692351160 !ruby/object:Gem::Requirement
38
+ requirement: &70156844193820 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70104692351160
46
+ version_requirements: *70156844193820
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: colorize
49
- requirement: &70104692350740 !ruby/object:Gem::Requirement
49
+ requirement: &70156844193400 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70104692350740
57
+ version_requirements: *70156844193400
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: debugger
60
- requirement: &70104692350320 !ruby/object:Gem::Requirement
60
+ requirement: &70156844192980 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70104692350320
68
+ version_requirements: *70156844192980
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: timecop
71
- requirement: &70104692349900 !ruby/object:Gem::Requirement
71
+ requirement: &70156844192560 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70104692349900
79
+ version_requirements: *70156844192560
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rspec
82
- requirement: &70104692349480 !ruby/object:Gem::Requirement
82
+ requirement: &70156844031360 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70104692349480
90
+ version_requirements: *70156844031360
91
91
  description: Letters brings Ruby debugging into the 21st century. It leverages print,
92
92
  the debugger, control transfer, even computer beeps to let you see into your code's
93
93
  state.
@@ -98,6 +98,7 @@ extra_rdoc_files: []
98
98
  files:
99
99
  - lib/letters/assertion_error.rb
100
100
  - lib/letters/core_ext.rb
101
+ - lib/letters/diff.rb
101
102
  - lib/letters/empty_error.rb
102
103
  - lib/letters/helpers.rb
103
104
  - lib/letters/nil_error.rb