yard 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of yard might be problematic. Click here for more details.

Files changed (64) hide show
  1. data/ChangeLog +197 -38
  2. data/LICENSE +1 -1
  3. data/README.md +15 -4
  4. data/docs/GettingStarted.md +6 -6
  5. data/docs/WhatsNew.md +5 -0
  6. data/docs/images/code-objects-class-diagram.png +0 -0
  7. data/docs/images/handlers-class-diagram.png +0 -0
  8. data/docs/images/overview-class-diagram.png +0 -0
  9. data/docs/images/parser-class-diagram.png +0 -0
  10. data/docs/images/tags-class-diagram.png +0 -0
  11. data/lib/yard/autoload.rb +2 -0
  12. data/lib/yard/cli/graph.rb +3 -2
  13. data/lib/yard/cli/server.rb +3 -0
  14. data/lib/yard/cli/yardoc.rb +1 -0
  15. data/lib/yard/code_objects/base.rb +60 -30
  16. data/lib/yard/code_objects/extra_file_object.rb +1 -1
  17. data/lib/yard/code_objects/proxy.rb +1 -0
  18. data/lib/yard/docstring.rb +36 -2
  19. data/lib/yard/docstring_parser.rb +25 -2
  20. data/lib/yard/handlers/base.rb +18 -2
  21. data/lib/yard/handlers/c/handler_methods.rb +1 -1
  22. data/lib/yard/handlers/processor.rb +3 -0
  23. data/lib/yard/handlers/ruby/class_handler.rb +1 -2
  24. data/lib/yard/handlers/ruby/dsl_handler_methods.rb +7 -1
  25. data/lib/yard/handlers/ruby/exception_handler.rb +2 -2
  26. data/lib/yard/handlers/ruby/legacy/class_handler.rb +4 -3
  27. data/lib/yard/handlers/ruby/legacy/exception_handler.rb +2 -2
  28. data/lib/yard/handlers/ruby/legacy/method_handler.rb +4 -4
  29. data/lib/yard/handlers/ruby/legacy/yield_handler.rb +4 -4
  30. data/lib/yard/handlers/ruby/method_handler.rb +6 -6
  31. data/lib/yard/handlers/ruby/struct_handler_methods.rb +4 -4
  32. data/lib/yard/handlers/ruby/yield_handler.rb +4 -4
  33. data/lib/yard/i18n/locale.rb +16 -0
  34. data/lib/yard/parser/ruby/legacy/statement_list.rb +3 -0
  35. data/lib/yard/parser/ruby/ruby_parser.rb +9 -4
  36. data/lib/yard/rubygems/doc_manager.rb +16 -7
  37. data/lib/yard/server/templates/default/fulldoc/html/images/processing.gif +0 -0
  38. data/lib/yard/tags/directives.rb +3 -2
  39. data/lib/yard/tags/overload_tag.rb +1 -1
  40. data/lib/yard/templates/helpers/html_helper.rb +5 -2
  41. data/lib/yard/templates/helpers/html_syntax_highlight_helper.rb +3 -3
  42. data/lib/yard/version.rb +1 -1
  43. data/spec/cli/server_spec.rb +18 -0
  44. data/spec/code_objects/base_spec.rb +32 -1
  45. data/spec/handlers/base_spec.rb +9 -0
  46. data/spec/handlers/dsl_handler_spec.rb +12 -1
  47. data/spec/handlers/examples/dsl_handler_001.rb.txt +16 -1
  48. data/spec/handlers/examples/visibility_handler_001.rb.txt +5 -0
  49. data/spec/handlers/method_handler_spec.rb +3 -3
  50. data/spec/handlers/processor_spec.rb +12 -1
  51. data/spec/handlers/visibility_handler_spec.rb +5 -0
  52. data/spec/parser/ruby/ruby_parser_spec.rb +13 -0
  53. data/spec/parser/source_parser_spec.rb +38 -1
  54. data/spec/server/doc_server_helper_spec.rb +2 -0
  55. data/spec/tags/directives_spec.rb +8 -1
  56. data/spec/tags/overload_tag_spec.rb +1 -1
  57. data/spec/templates/helpers/html_helper_spec.rb +25 -5
  58. data/templates/default/class/setup.rb +1 -1
  59. data/templates/default/module/html/box_info.erb +1 -1
  60. data/templates/default/tags/html/example.erb +1 -1
  61. data/templates/default/tags/setup.rb +1 -1
  62. data/templates/guide/fulldoc/html/css/style.css +12 -5
  63. data/templates/guide/layout/html/layout.erb +4 -4
  64. metadata +3 -3
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2007-2012 Loren Segal
1
+ Copyright (c) 2007-2013 Loren Segal
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person
4
4
  obtaining a copy of this software and associated documentation
data/README.md CHANGED
@@ -6,10 +6,10 @@ YARD: Yay! A Ruby Documentation Tool
6
6
  **Git**: [http://github.com/lsegal/yard](http://github.com/lsegal/yard)
7
7
  **Author**: Loren Segal
8
8
  **Contributors**: See Contributors section below
9
- **Copyright**: 2007-2012
9
+ **Copyright**: 2007-2013
10
10
  **License**: MIT License
11
- **Latest Version**: 0.8.3 (codename "Rainier")
12
- **Release Date**: October 15th 2012
11
+ **Latest Version**: 0.8.4
12
+ **Release Date**: February 4th 2013
13
13
 
14
14
  Synopsis
15
15
  --------
@@ -286,6 +286,17 @@ More options can be seen by typing `yard graph --help`, but here is an example:
286
286
 
287
287
  ## Changelog
288
288
 
289
+ - **February.4.13**: 0.8.4 release
290
+ - Add `-B/--bind` switch to yard server (#593, #608)
291
+ - Add CodeObjects::Base#title for plugins to customize how object
292
+ links display (#646)
293
+ - Disable linking objects filtered out by verifiers (#645)
294
+ - Allow macro expansion on class methods (#632)
295
+ - Expand newly attached macro on first DSL method call (#631)
296
+ - Disable RubyGems plugin in Ruby 2.0 (#627)
297
+ - Fix line range for class/module node bodies (#626)
298
+ - Search extended modules for attached DSL macros (#553)
299
+
289
300
  - **October.14.12**: 0.8.3 release
290
301
  - Add `--non-transitive-tag` to disable tag transitivity (#571)
291
302
  - Support --db inside .yardopts for graph/server commands (#583, #586)
@@ -562,7 +573,7 @@ http://github.com/lsegal/yard/contributors
562
573
 
563
574
  ## Copyright
564
575
 
565
- YARD © 2007-2012 by [Loren Segal](mailto:lsegal@soen.ca). YARD is
576
+ YARD © 2007-2013 by [Loren Segal](mailto:lsegal@soen.ca). YARD is
566
577
  licensed under the MIT license except for some files which come from the
567
578
  RDoc/Ruby distributions. Please see the {file:LICENSE} and {file:LEGAL}
568
579
  documents for more information.
@@ -51,7 +51,7 @@ In YARD, we would simply define our method as:
51
51
 
52
52
  # Converts the object into textual markup given a specific format.
53
53
  #
54
- # @param [Symbol] format the format type, `:text` or `:html`
54
+ # @param format [Symbol] the format type, `:text` or `:html`
55
55
  # @return [String] the object converted into the expected format.
56
56
  def to_format(format = :html)
57
57
  # format the object
@@ -105,7 +105,7 @@ from that docstring/tag into your current object. Consider the example:
105
105
 
106
106
  class MyWebServer
107
107
  # Handles a request
108
- # @param [Request] request the request object
108
+ # @param request [Request] the request object
109
109
  # @return [String] the resulting webpage
110
110
  def get(request) "hello" end
111
111
 
@@ -134,7 +134,7 @@ and return tags:
134
134
 
135
135
  class MyWebServer
136
136
  # Handles a GET request
137
- # @param [Request] request the request object
137
+ # @param request [Request] the request object
138
138
  # @return [String] the resulting webpage
139
139
  def get(request) "hello" end
140
140
 
@@ -165,8 +165,8 @@ with or without a types field.
165
165
  The list of types is in the form `[type1, type2, ...]` and is mostly free-form,
166
166
  so we can also specify duck-types or constant values. For example:
167
167
 
168
- # @param [#to_s] argname any object that responds to `#to_s`
169
- # @param [true, false] argname only true or false
168
+ # @param argname [#to_s] any object that responds to `#to_s`
169
+ # @param argname [true, false] only true or false
170
170
 
171
171
  Note the latter example can be replaced by the meta-type "Boolean".
172
172
  Another meta-type is "void", which stands for "no meaningful value"
@@ -177,7 +177,7 @@ List types can be specified in the form `CollectionClass<ElementType, ...>`.
177
177
  For instance, consider the following Array that holds a set of Strings and
178
178
  Symbols:
179
179
 
180
- # @param [Array<String, Symbol>] list the list of strings and symbols.
180
+ # @param list [Array<String, Symbol>] the list of strings and symbols.
181
181
 
182
182
  We mentioned that these type fields are "mostly" free-form. In truth, they
183
183
  are defined "by convention". To view samples of common type specifications
@@ -17,6 +17,7 @@
17
17
  13. **Single object db now default (multi-object db unsupported)** (0.8.0)
18
18
  14. **Added `--api` tag to generate documentation for API sets** (0.8.1)
19
19
  15. **Added `--non-transitive-tag` to disable transitive tag** (0.8.3)
20
+ 16. **Added `-B/--bind` to bind to a port in yard server** (0.8.4)
20
21
 
21
22
  ## Directives (new behavioural tag syntax) (0.8.0)
22
23
 
@@ -292,6 +293,10 @@ when you define it on a class. Only the class itself has a specific
292
293
  Which will avoid classifying treating @api as a transitive tag
293
294
  when parsing modules and classes.
294
295
 
296
+ ## Added `-B/--bind` to bind to a port in yard server (0.8.4)
297
+
298
+ You can now bind the `yard server` command to a given local port
299
+ with `yard server -B PORT` or `yard server --bind PORT`.
295
300
 
296
301
  # What's New in 0.7.x?
297
302
 
@@ -127,6 +127,7 @@ module YARD
127
127
  end
128
128
 
129
129
  autoload :Base, __p('handlers/base')
130
+ autoload :HandlerAborted, __p('handlers/base')
130
131
  autoload :NamespaceMissingError, __p('handlers/base')
131
132
  autoload :Processor, __p('handlers/processor')
132
133
  end
@@ -230,6 +231,7 @@ module YARD
230
231
  autoload :AttributeDirective, __p('tags/directives')
231
232
  autoload :DefaultFactory, __p('tags/default_factory')
232
233
  autoload :DefaultTag, __p('tags/default_tag')
234
+ autoload :Directive, __p('tags/directives')
233
235
  autoload :EndGroupDirective, __p('tags/directives')
234
236
  autoload :GroupDirective, __p('tags/directives')
235
237
  autoload :Library, __p('tags/library')
@@ -26,7 +26,7 @@ module YARD
26
26
  # :format => :dot
27
27
  attr_reader :options
28
28
 
29
- # The set of objects to include in the graph.
29
+ # The set of objects to include in the graph.
30
30
  attr_reader :objects
31
31
 
32
32
  # Creates a new instance of the command-line utility
@@ -50,7 +50,6 @@ module YARD
50
50
  # @param [Array<String>] args each tokenized argument
51
51
  def run(*args)
52
52
  parse_arguments(*args)
53
- Registry.load
54
53
 
55
54
  contents = objects.map do |o|
56
55
  o.format(options.merge(:serialize => false))
@@ -112,6 +111,8 @@ module YARD
112
111
  common_options(opts)
113
112
  parse_options(opts, args)
114
113
 
114
+ Registry.load
115
+
115
116
  options.verifier = Verifier.new("object.type != :method || #{visibilities.uniq.inspect}.include?(object.visibility)")
116
117
  if args.first
117
118
  @objects = args.map {|o| Registry.at(o) }.compact
@@ -181,6 +181,9 @@ module YARD
181
181
  opts.on('-d', '--daemon', 'Daemonizes the server process') do
182
182
  server_options[:daemonize] = true
183
183
  end
184
+ opts.on('-B HOST', '--bind', 'The host address to bind to') do |host|
185
+ server_options[:Host] = host.to_s
186
+ end
184
187
  opts.on('-p PORT', '--port', 'Serves documentation on PORT') do |port|
185
188
  server_options[:Port] = port.to_i
186
189
  end
@@ -441,6 +441,7 @@ module YARD
441
441
  # @return [void]
442
442
  # @since 0.8.3
443
443
  def apply_locale
444
+ YARD::I18n::Locale.default = options.locale
444
445
  options.files.each do |file|
445
446
  file.locale = options.locale
446
447
  end
@@ -50,7 +50,7 @@ module YARD
50
50
  CONSTANTMATCH = /[A-Z]\w*/
51
51
 
52
52
  # Regular expression to match namespaces (const A or complex path A::B)
53
- NAMESPACEMATCH = /(?:(?:#{NSEPQ})?#{CONSTANTMATCH})+/
53
+ NAMESPACEMATCH = /(?:(?:#{NSEPQ}\s*)?#{CONSTANTMATCH})+/
54
54
 
55
55
  # Regular expression to match a method name
56
56
  METHODNAMEMATCH = /[a-zA-Z_]\w*[!?=]?|[-+~]\@|<<|>>|=~|===?|<=>|[<>]=?|\*\*|[-\/+%^&*~`|]|\[\]=?/
@@ -136,9 +136,10 @@ module YARD
136
136
  # @return [String] a line of source
137
137
  attr_accessor :signature
138
138
 
139
- # The documentation string associated with the object
139
+ # The non-localized documentation string associated with the object
140
140
  # @return [Docstring] the documentation string
141
- attr_reader :docstring
141
+ # @since 0.8.4
142
+ attr_reader :base_docstring
142
143
 
143
144
  # Marks whether or not the method is conditionally defined at runtime
144
145
  # @return [Boolean] true if the method is conditionally defined at runtime
@@ -218,9 +219,8 @@ module YARD
218
219
  @source_type = :ruby
219
220
  @visibility = :public
220
221
  @tags = []
221
- @docstring = Docstring.new('', self)
222
- @docstring_extra = nil
223
- @docstring_extra_tags = nil
222
+ @docstrings = {}
223
+ @base_docstring = Docstring.new('', self)
224
224
  @namespace = nil
225
225
  self.namespace = namespace
226
226
  yield(self) if block_given?
@@ -237,7 +237,7 @@ module YARD
237
237
  ivar = "@#{ivar}"
238
238
  other.instance_variable_set(ivar, instance_variable_get(ivar))
239
239
  end
240
- other.docstring = docstring.to_raw
240
+ other.docstring = @base_docstring.to_raw
241
241
  other
242
242
  end
243
243
 
@@ -365,19 +365,25 @@ module YARD
365
365
  end
366
366
  end
367
367
 
368
- undef docstring
369
- def docstring
370
- return @docstring if !@docstring_extra
371
- case @docstring
372
- when Proxy
373
- return @docstring_extra
374
- when Base
375
- @docstring = @docstring.docstring + @docstring_extra
376
- @docstring.add_tag(*@docstring_extra_tags)
377
- @docstring_extra = nil
378
- @docstring_extra_tags = nil
368
+ # The documentation string associated with the object
369
+ #
370
+ # @param [String, I18n::Locale] locale (I18n::Locale.default)
371
+ # the locale of the documentation string.
372
+ # @return [Docstring] the documentation string
373
+ def docstring(locale = I18n::Locale.default)
374
+ if locale.nil?
375
+ @base_docstring.resolve_reference
376
+ return @base_docstring
377
+ end
378
+
379
+ if locale.is_a?(String)
380
+ locale_name = locale
381
+ locale = nil
382
+ else
383
+ locale_name = locale.name
379
384
  end
380
- @docstring
385
+ @docstrings[locale_name] ||=
386
+ translate_docstring(locale || Registry.locale(locale_name))
381
387
  end
382
388
 
383
389
  # Attaches a docstring to a code object by parsing the comments attached to the statement
@@ -387,16 +393,11 @@ module YARD
387
393
  # the comments attached to the code object to be parsed
388
394
  # into a docstring and meta tags.
389
395
  def docstring=(comments)
390
- if comments =~ /\A\s*\(see (\S+)\s*\)(?:\s|$)/
391
- path, extra = $1, $'
392
- @docstring_extra = Docstring.new(extra, self)
393
- @docstring_extra_tags = Docstring === comments ? comments.tags : []
394
- @docstring_extra.add_tag(*@docstring_extra_tags)
395
- @docstring = Proxy.new(namespace, path)
396
+ @docstrings.clear
397
+ if Docstring === comments
398
+ @base_docstring = comments
396
399
  else
397
- @docstring_extra = nil
398
- @docstring_extra_tags = nil
399
- @docstring = Docstring === comments ? comments : Docstring.new(comments, self)
400
+ @base_docstring = Docstring.new(comments, self)
400
401
  end
401
402
  end
402
403
 
@@ -405,7 +406,7 @@ module YARD
405
406
  #
406
407
  # @return [Symbol] the type of code object this represents
407
408
  def type
408
- self.class.name.split(/#{NSEPQ}/).last.gsub(/Object$/, '').downcase.to_sym
409
+ self.class.name.split('::').last.gsub(/Object$/, '').downcase.to_sym
409
410
  end
410
411
 
411
412
  # Represents the unique path of the object. The default implementation
@@ -426,6 +427,16 @@ module YARD
426
427
  end
427
428
  alias_method :to_s, :path
428
429
 
430
+ # @note
431
+ # Override this method if your object has a special title that does
432
+ # not match the {#path} attribute value. This title will be used
433
+ # when linking or displaying the object.
434
+ # @return [String] the display title for an object
435
+ # @see 0.8.4
436
+ def title
437
+ path
438
+ end
439
+
429
440
  # @param [Base, String] other another code object (or object path)
430
441
  # @return [String] the shortest relative path from this object to +other+
431
442
  # @since 0.5.3
@@ -509,6 +520,14 @@ module YARD
509
520
  # @see Docstring#has_tag?
510
521
  def has_tag?(name); docstring.has_tag?(name) end
511
522
 
523
+ # Add tags to the {#docstring}
524
+ # @see Docstring#add_tag
525
+ # @since 0.8.4
526
+ def add_tag(*tags)
527
+ @docstrings.clear
528
+ @base_docstring.add_tag(*tags)
529
+ end
530
+
512
531
  # @return whether or not this object is a RootObject
513
532
  def root?; false end
514
533
 
@@ -532,7 +551,7 @@ module YARD
532
551
  # @since 0.8.0
533
552
  def copyable_attributes
534
553
  vars = instance_variables.map {|ivar| ivar.to_s[1..-1] }
535
- vars -= %w(docstring namespace name path)
554
+ vars -= %w(base_docstring docstrings namespace name path)
536
555
  vars
537
556
  end
538
557
 
@@ -548,6 +567,17 @@ module YARD
548
567
  indent = last ? last[/^([ \t]*)/, 1].length : 0
549
568
  source.gsub(/^[ \t]{#{indent}}/, '')
550
569
  end
570
+
571
+ def translate_docstring(locale)
572
+ @base_docstring.resolve_reference
573
+ return @base_docstring if locale.nil?
574
+
575
+ text = I18n::Text.new(@base_docstring)
576
+ localized_text = text.translate(locale)
577
+ docstring = Docstring.new(localized_text, self)
578
+ docstring.add_tag(*@base_docstring.tags)
579
+ docstring
580
+ end
551
581
  end
552
582
  end
553
583
  end
@@ -58,7 +58,7 @@ module YARD::CodeObjects
58
58
  end
59
59
  alias to_s inspect
60
60
 
61
- def type; 'extra_file' end
61
+ def type; :extra_file end
62
62
 
63
63
  def ==(other)
64
64
  return false unless self.class === other
@@ -96,6 +96,7 @@ module YARD
96
96
  end
97
97
  alias to_s path
98
98
  alias to_str path
99
+ alias title path
99
100
 
100
101
  # @return [Boolean]
101
102
  def is_a?(klass)
@@ -118,13 +118,23 @@ module YARD
118
118
  end
119
119
  end
120
120
 
121
+ def to_s
122
+ resolve_reference
123
+ super
124
+ end
125
+
121
126
  # Replaces the docstring with new raw content. Called by {#all=}.
122
127
  # @param [String] content the raw comments to be parsed
123
128
  def replace(content, parse = true)
124
129
  content = content.join("\n") if content.is_a?(Array)
125
130
  @tags, @ref_tags = [], []
126
- @all = content
127
- super(parse ? parse_comments(content) : content)
131
+ if parse
132
+ super(parse_comments(content))
133
+ else
134
+ @all = content
135
+ @unresolved_reference = nil
136
+ super(content)
137
+ end
128
138
  end
129
139
  alias all= replace
130
140
 
@@ -136,6 +146,7 @@ module YARD
136
146
  # @return [Docstring] a new copied docstring
137
147
  # @since 0.7.0
138
148
  def dup
149
+ resolve_reference
139
150
  obj = super
140
151
  %w(all summary tags ref_tags).each do |name|
141
152
  val = instance_variable_get("@#{name}")
@@ -155,6 +166,7 @@ module YARD
155
166
  # Gets the first line of a docstring to the period or the first paragraph.
156
167
  # @return [String] The first line or paragraph of the docstring; always ends with a period.
157
168
  def summary
169
+ resolve_reference
158
170
  return @summary if @summary
159
171
  open_parens = ['{', '(', '[']
160
172
  close_parens = ['}', ')', ']']
@@ -298,6 +310,26 @@ module YARD
298
310
 
299
311
  # @endgroup
300
312
 
313
+ # Resolves unresolved other docstring reference if there is
314
+ # unresolved reference. Does nothing if there is no unresolved
315
+ # reference.
316
+ #
317
+ # Normally, you don't need to call this method
318
+ # explicitly. Resolving unresolved reference is done implicitly.
319
+ #
320
+ # @return [void]
321
+ def resolve_reference
322
+ loop do
323
+ return if @unresolved_reference.nil?
324
+ return if CodeObjects::Proxy === @unresolved_reference
325
+
326
+ reference, @unresolved_reference = @unresolved_reference, nil
327
+ resolved_tags = reference.docstring.tags
328
+ self.all = [reference.docstring.all, @all].join("\n")
329
+ add_tag(*resolved_tags)
330
+ end
331
+ end
332
+
301
333
  private
302
334
 
303
335
  # Maps valid reference tags
@@ -319,6 +351,8 @@ module YARD
319
351
  def parse_comments(comments)
320
352
  parser = self.class.parser
321
353
  parser.parse(comments, object)
354
+ @all = parser.raw_text
355
+ @unresolved_reference = parser.reference
322
356
  add_tag(*parser.tags)
323
357
  parser.text
324
358
  end
@@ -54,6 +54,11 @@ module YARD
54
54
  # not attached to any object.
55
55
  attr_accessor :object
56
56
 
57
+ # @return [CodeObjects::Base, nil] the object referenced by
58
+ # the docstring being parsed. May be nil if the docstring doesn't
59
+ # refer to any object.
60
+ attr_accessor :reference
61
+
57
62
  # @return [Handlers::Base, nil] the handler parsing this
58
63
  # docstring. May be nil if this docstring parser is not
59
64
  # initialized through
@@ -79,6 +84,7 @@ module YARD
79
84
  @directives = []
80
85
  @library = library
81
86
  @object = nil
87
+ @reference = nil
82
88
  @handler = nil
83
89
  @state = OpenStruct.new
84
90
  end
@@ -106,8 +112,8 @@ module YARD
106
112
  def parse(content, object = nil, handler = nil)
107
113
  @object = object
108
114
  @handler = handler
109
- @raw_text = content
110
- text = parse_content(content)
115
+ @reference, @raw_text = detect_reference(content)
116
+ text = parse_content(@raw_text)
111
117
  # Remove trailing/leading whitespace / newlines
112
118
  @text = text.gsub(/\A[\r\n\s]+|[\r\n\s]+\Z/, '')
113
119
  call_directives_after_parse
@@ -232,6 +238,23 @@ module YARD
232
238
 
233
239
  private
234
240
 
241
+ def namespace
242
+ if object
243
+ object.namespace
244
+ else
245
+ nil
246
+ end
247
+ end
248
+
249
+ def detect_reference(content)
250
+ if content =~ /\A\s*\(see (\S+)\s*\)(?:\s|$)/
251
+ path, extra = $1, $'
252
+ [CodeObjects::Proxy.new(namespace, path), extra]
253
+ else
254
+ [nil, content]
255
+ end
256
+ end
257
+
235
258
  # @!group Parser Callback Methods
236
259
 
237
260
  # Calls the {Directive#after_parse} callback on all the