spectator-emacs 0.2.2 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ODk1Y2ZjZmZlYjVmNjc1YTkyZmNmNzEzOWUzMDExYWQxNzhiNmUwOQ==
5
+ data.tar.gz: !binary |-
6
+ NzMxNzU3MzYyYWZlZWM0YmMxYWU2MDI1NmJmNjY0ZWM5MmY2ZTZhMw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ MTg0NGYyN2ZmYzBlZjk3NWIxMWRlMDFhOTI5ZDRjYWZmNWQ1OWIzN2E5OTcx
10
+ ZTYyMDk4NjMxZjFjY2E1ODA5YzQ3ZjEwMzRmYWQ0M2M3Y2Q4MjA1ZjRiMzUx
11
+ ZThjNzRlODY1ZTE5MTUyM2I5MDJlZTM1ZjhmMzFiZDk2YmIwYjc=
12
+ data.tar.gz: !binary |-
13
+ MTUxZjQyNjM0OWMxN2YxN2UyMGE4MzA4ZDZlOGFlY2YwOTIzMDNjMGY3MmNj
14
+ MmU1NWUyOTY0MDY5YzY4MmZkYmYzY2E4YjczOWM4NTg1NjYzOWUyNWJmYjQ1
15
+ YjNmNzlmNTg4YTRhNDI0MTlmZmE0MTA4MjBkNTE2NjQyZjliNjA=
data/Gemfile.lock CHANGED
@@ -1,11 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spectator-emacs (0.2.2)
4
+ spectator-emacs (0.2.3)
5
5
  docopt
6
6
  open4
7
7
  rspec
8
- spectator (~> 1.2)
8
+ spectator (= 1.2.6)
9
9
 
10
10
  GEM
11
11
  remote: http://rubygems.org/
@@ -14,7 +14,7 @@ GEM
14
14
  docopt (0.5.0)
15
15
  ffi (1.8.1)
16
16
  json (1.7.7)
17
- listen (1.0.2)
17
+ listen (1.1.3)
18
18
  rb-fsevent (>= 0.9.3)
19
19
  rb-inotify (>= 0.9)
20
20
  rb-kqueue (>= 0.2)
@@ -43,7 +43,9 @@ GEM
43
43
  listen
44
44
  notify
45
45
  term-ansicolor
46
- term-ansicolor (1.1.5)
46
+ term-ansicolor (1.2.1)
47
+ tins (~> 0.8)
48
+ tins (0.8.0)
47
49
  yard (0.8.6.1)
48
50
 
49
51
  PLATFORMS
data/README.md CHANGED
@@ -87,44 +87,6 @@ require 'spectator/emacs'
87
87
  summary
88
88
  end
89
89
 
90
- # The default summary extraction method works with
91
- # the standard documentation formatter, or any formatter
92
- # that puts the summary on the last line and with the
93
- # same format of the documentation formatter.
94
- # It uses the helper function
95
- # Spectator::Spec#extract_rspec_stats, which can be
96
- # useful if the summary is expressed with the same
97
- # pattern but on a line other than the last.
98
- # For example, the RSpecOrgFormatter puts the summary on
99
- # the 6th-last line.
100
- #
101
- def extract_rspec_org_summary(output)
102
- runner.extract_rspec_stats(output, -6)
103
- end
104
-
105
- # Suppose rspec is using a custom formatter that
106
- # puts the summary in a format in the last lines
107
- # with a format like the following:
108
- #
109
- # Examples: 123
110
- # Errors: 12
111
- # Pending: 2
112
- #
113
- def runner.extract_rspec_summary(output)
114
- summary_lines = summary[-3..-1]
115
- examples = summary[-3].split(':')[1].to_i
116
- errors = summary[-2].split(':')[1].to_i
117
- pending = summary[-1].split(':')[1].to_i
118
- stats = {
119
- :examples => examples,
120
- :failures => failures,
121
- :pending => pending,
122
- :summary => format_summary(examples, failures, pending)
123
- }
124
- stats.merge(:status => rspec_status(stats))
125
- stats
126
- end
127
- end
128
90
  ```
129
91
 
130
92
 
@@ -155,3 +117,7 @@ See LICENSE.txt for details.
155
117
  [spectator]:http://github.com/elia/spectator
156
118
  [RSpecOrgFormatter]:http://github.org/laynor/rspec_org_formatter
157
119
  [melpa]:http://melpa.milkbox.net/
120
+
121
+ ## Thank yous
122
+ Thanks to Roberto Romero (sildur) for the automatic summary line detection patch!
123
+
@@ -158,9 +158,6 @@ module Spectator
158
158
  # Returns a hash that summarizes the rspec results.
159
159
  #
160
160
  # @param [String] output the rspec output
161
- # @param [Integer] line_number the line number of the summary in the rspec
162
- # output. It can be negative: -1 indicates the last line, -2
163
- # indicates the second last line and so on.
164
161
  # @return [Hash] a hash table with keys ```:examples, :failures, :pending, :summary, :status```.
165
162
  #
166
163
  # * **:examples** => number of examples ran
@@ -168,9 +165,9 @@ module Spectator
168
165
  # * **:pending** => number of pending examples ran
169
166
  # * **:summary** => the summary string from which the above have been extracted
170
167
  # * **:status** => one of ```:failure, :pending, :success```
171
- def extract_rspec_stats(output, line_number)
172
- summary_line = output.split("\n")[line_number]
168
+ def extract_rspec_stats(output)
173
169
  summary_regex = /^(\d*)\sexamples?,\s(\d*)\s(errors?|failures?)[^\d]*((\d*)\spending)?/
170
+ summary_line = output.split("\n").detect { |line| line.match(summary_regex) }
174
171
  matchdata = summary_line.match(summary_regex)
175
172
  raise SummaryExtractionError.new if matchdata.nil?
176
173
  _, examples, failures, _, pending = matchdata.to_a
@@ -195,14 +192,7 @@ module Spectator
195
192
  # :success, :pending, :failure
196
193
  # ```
197
194
  def extract_rspec_summary(output)
198
- begin
199
- extract_rspec_stats output, @summary_line_number
200
- rescue SummaryExtractionError
201
- puts "--- Error while extracting summary with the default method.".red
202
- print "--- Summary line number: ".yellow
203
- @summary_line_number = STDIN.gets.to_i
204
- extract_rspec_summary output
205
- end
195
+ extract_rspec_stats output
206
196
  end
207
197
 
208
198
  # Runs a command and returns a hash containing exit status,
@@ -475,7 +465,6 @@ An error happened during the test run. Check your spec files.
475
465
  @enotify_port = options[:enotify_port]
476
466
  @notification_messages = options[:notification_messages]
477
467
  @notification_face = options[:notification_face]
478
- @summary_line_number = options[:summary_line] || -1
479
468
  @enotify_slot_id = options[:slot_id] ||
480
469
  ((File.basename Dir.pwd).split('_').map {|s| s.capitalize}).join.gsub('-','/')
481
470
  check_if_bundle_needed
@@ -1,6 +1,6 @@
1
1
  module Spectator
2
2
  module Emacs
3
3
  # spectator-emacs version
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.4"
5
5
  end
6
6
  end
@@ -37,7 +37,7 @@ Gem::Specification.new do |gem|
37
37
  gem.add_development_dependency 'yard'
38
38
  gem.add_development_dependency 'redcarpet'
39
39
  gem.add_dependency 'rspec'
40
- gem.add_dependency 'spectator', '~> 1.2'
40
+ gem.add_dependency 'spectator', '1.2.6'
41
41
  gem.add_dependency 'open4'
42
42
  gem.add_dependency 'docopt'
43
43
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spectator-emacs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
5
- prerelease:
4
+ version: 0.2.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Alessandro Piras
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-29 00:00:00.000000000 Z
11
+ date: 2013-05-26 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rdoc
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rspec
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rubygems-tasks
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: yard
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ! '>='
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ! '>='
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: redcarpet
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ! '>='
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ! '>='
92
81
  - !ruby/object:Gem::Version
@@ -94,7 +83,6 @@ dependencies:
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: rspec
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ! '>='
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :runtime
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ! '>='
108
95
  - !ruby/object:Gem::Version
@@ -110,23 +97,20 @@ dependencies:
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: spectator
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ~>
101
+ - - '='
116
102
  - !ruby/object:Gem::Version
117
- version: '1.2'
103
+ version: 1.2.6
118
104
  type: :runtime
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ~>
108
+ - - '='
124
109
  - !ruby/object:Gem::Version
125
- version: '1.2'
110
+ version: 1.2.6
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: open4
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
115
  - - ! '>='
132
116
  - !ruby/object:Gem::Version
@@ -134,7 +118,6 @@ dependencies:
134
118
  type: :runtime
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
122
  - - ! '>='
140
123
  - !ruby/object:Gem::Version
@@ -142,7 +125,6 @@ dependencies:
142
125
  - !ruby/object:Gem::Dependency
143
126
  name: docopt
144
127
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
128
  requirements:
147
129
  - - ! '>='
148
130
  - !ruby/object:Gem::Version
@@ -150,7 +132,6 @@ dependencies:
150
132
  type: :runtime
151
133
  prerelease: false
152
134
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
135
  requirements:
155
136
  - - ! '>='
156
137
  - !ruby/object:Gem::Version
@@ -189,33 +170,26 @@ files:
189
170
  homepage: https://github.com/laynor/spectator-emacs#readme
190
171
  licenses:
191
172
  - MIT
173
+ metadata: {}
192
174
  post_install_message:
193
175
  rdoc_options: []
194
176
  require_paths:
195
177
  - lib
196
178
  required_ruby_version: !ruby/object:Gem::Requirement
197
- none: false
198
179
  requirements:
199
180
  - - ! '>='
200
181
  - !ruby/object:Gem::Version
201
182
  version: '0'
202
- segments:
203
- - 0
204
- hash: 2730408837952110721
205
183
  required_rubygems_version: !ruby/object:Gem::Requirement
206
- none: false
207
184
  requirements:
208
185
  - - ! '>='
209
186
  - !ruby/object:Gem::Version
210
187
  version: '0'
211
- segments:
212
- - 0
213
- hash: 2730408837952110721
214
188
  requirements: []
215
189
  rubyforge_project:
216
- rubygems_version: 1.8.24
190
+ rubygems_version: 2.0.3
217
191
  signing_key:
218
- specification_version: 3
192
+ specification_version: 4
219
193
  summary: A Spectator monkey-patch that displays notifications on the emacs modeline.
220
194
  test_files:
221
195
  - spec/emacs_spec.rb