yard 0.8.7.2 → 0.8.7.3
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.
- checksums.yaml +4 -4
- data/README.md +11 -2
- data/lib/yard/config.rb +1 -0
- data/lib/yard/handlers/ruby/alias_handler.rb +1 -1
- data/lib/yard/handlers/ruby/legacy/alias_handler.rb +1 -0
- data/lib/yard/server/doc_server_serializer.rb +13 -3
- data/lib/yard/templates/helpers/html_syntax_highlight_helper.rb +1 -0
- data/lib/yard/templates/helpers/markup_helper.rb +1 -1
- data/lib/yard/version.rb +1 -1
- data/spec/handlers/alias_handler_spec.rb +2 -1
- data/spec/handlers/examples/alias_handler_001.rb.txt +2 -0
- data/spec/server/doc_server_serializer_spec.rb +5 -0
- data/spec/templates/helpers/html_syntax_highlight_helper_spec.rb +5 -0
- data/templates/default/fulldoc/html/css/style.css +1 -1
- data/templates/default/fulldoc/html/js/app.js +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4baddf5f52f2913d492f130ec8b45a08d37a6bb7
|
4
|
+
data.tar.gz: 5f96f9b1e90711b3ff6b54b191f3dae793d70793
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 286cf94f1999e471f05bf87ae34d60ca23609648eef332830873ea27b54d407cd68c01e8b552ab026880317ff684623c8a467df7338faef9233bcdc9f8b22d29
|
7
|
+
data.tar.gz: 853a3f70d00f98a04ac81cd0176e4a25f53db77536a451462c60ef7a9fc72d9ac5465806b916feadb5231efc29d138c2744bb9438814370586f7144e1c002d4a
|
data/README.md
CHANGED
@@ -7,8 +7,8 @@
|
|
7
7
|
**Contributors**: http://github.com/lsegal/yard/contributors
|
8
8
|
**Copyright**: 2007-2013
|
9
9
|
**License**: MIT License
|
10
|
-
**Latest Version**: 0.8.7.
|
11
|
-
**Release Date**:
|
10
|
+
**Latest Version**: 0.8.7.3
|
11
|
+
**Release Date**: November 1st 2013
|
12
12
|
|
13
13
|
## Synopsis
|
14
14
|
|
@@ -283,6 +283,15 @@ More options can be seen by typing `yard graph --help`, but here is an example:
|
|
283
283
|
|
284
284
|
## Changelog
|
285
285
|
|
286
|
+
- **November.1.13**: 0.8.7.3 release
|
287
|
+
- Handle Unicode method/class/file names in server URL encoding (lsegal/rubydoc.info#69).
|
288
|
+
- Style keyword style hashes with same symbol color in code highlighting (#707).
|
289
|
+
- Fix broken JS when visiting docs in file:// scheme (#706).
|
290
|
+
- Add support for new AsciiDoc file extensions (#704).
|
291
|
+
- Fix issues where non-Ruby code blocks would not display in Ruby 2 (#702).
|
292
|
+
- Add support for extra Ruby 2 symbol types in Ripper (#701).
|
293
|
+
- Ensure config directory exists before saving config file (#700).
|
294
|
+
|
286
295
|
- **September.18.13**: 0.8.7.2 release
|
287
296
|
- Disallow absolute URLs when using frame anchor support.
|
288
297
|
- Support casted functions in CRuby method declarations (#697)
|
data/lib/yard/config.rb
CHANGED
@@ -10,7 +10,7 @@ class YARD::Handlers::Ruby::AliasHandler < YARD::Handlers::Ruby::Base
|
|
10
10
|
elsif statement.call?
|
11
11
|
statement.parameters(false).each do |obj|
|
12
12
|
case obj.type
|
13
|
-
when :symbol_literal
|
13
|
+
when :symbol_literal, :dyna_symbol
|
14
14
|
names << obj.jump(:ident, :op, :kw, :const).source
|
15
15
|
when :string_literal
|
16
16
|
names << obj.jump(:string_content).source
|
@@ -12,6 +12,7 @@ class YARD::Handlers::Ruby::Legacy::AliasHandler < YARD::Handlers::Ruby::Legacy:
|
|
12
12
|
end
|
13
13
|
raise YARD::Parser::UndocumentableError, statement.tokens.first.text if names.size != 2
|
14
14
|
|
15
|
+
names = names.map {|n| Symbol === n ? n.to_s.gsub('"', '') : n }
|
15
16
|
new_meth, old_meth = names[0].to_sym, names[1].to_sym
|
16
17
|
old_obj = namespace.child(:name => old_meth, :scope => scope)
|
17
18
|
new_obj = register MethodObject.new(namespace, new_meth, scope) do |o|
|
@@ -16,18 +16,28 @@ module YARD
|
|
16
16
|
when CodeObjects::RootObject
|
17
17
|
"toplevel"
|
18
18
|
when CodeObjects::ExtendedMethodObject
|
19
|
-
|
19
|
+
name = object.name.to_s
|
20
|
+
serialized_path(object.namespace) + ':' + urlencode(object.name.to_s)
|
20
21
|
when CodeObjects::MethodObject
|
21
22
|
serialized_path(object.namespace) +
|
22
|
-
(object.scope == :instance ? ":" : ".") +
|
23
|
+
(object.scope == :instance ? ":" : ".") + urlencode(object.name.to_s)
|
23
24
|
when CodeObjects::ConstantObject, CodeObjects::ClassVariableObject
|
24
25
|
serialized_path(object.namespace) + "##{object.name}-#{object.type}"
|
25
26
|
when CodeObjects::ExtraFileObject
|
26
|
-
super(object).gsub(/^file
|
27
|
+
super(object).gsub(/^file\./, 'file/')
|
27
28
|
else
|
28
29
|
super(object)
|
29
30
|
end
|
30
31
|
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def urlencode(name)
|
36
|
+
if name.respond_to?(:force_encoding)
|
37
|
+
name = name.dup.force_encoding('binary')
|
38
|
+
end
|
39
|
+
escape(name)
|
40
|
+
end
|
31
41
|
end
|
32
42
|
end
|
33
43
|
end
|
@@ -18,6 +18,7 @@ module YARD
|
|
18
18
|
|
19
19
|
def html_syntax_highlight_ruby_ripper(source)
|
20
20
|
tokenlist = Parser::Ruby::RubyParser.parse(source, "(syntax_highlight)").tokens
|
21
|
+
raise Parser::ParserSyntaxError if tokenlist.empty? && !source.empty?
|
21
22
|
output = ""
|
22
23
|
tokenlist.each do |s|
|
23
24
|
output << "<span class='tstring'>" if [:tstring_beg, :regexp_beg].include?(s[0])
|
@@ -57,7 +57,7 @@ module YARD
|
|
57
57
|
:html => ['htm', 'html', 'shtml'],
|
58
58
|
:text => ['txt'],
|
59
59
|
:textile => ['textile', 'txtile'],
|
60
|
-
:asciidoc => ['asciidoc'],
|
60
|
+
:asciidoc => ['asciidoc', 'ad', 'adoc', 'asc'],
|
61
61
|
:markdown => ['markdown', 'md', 'mdown', 'mkd'],
|
62
62
|
:rdoc => ['rdoc'],
|
63
63
|
:ruby => ['rb', 'ru']
|
data/lib/yard/version.rb
CHANGED
@@ -7,9 +7,10 @@ describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}AliasHandler"
|
|
7
7
|
P(:A).aliases[P("A#b")].should == :a
|
8
8
|
end
|
9
9
|
|
10
|
-
['c', 'd?', '[]', '[]=', '-@', '%', '*'].each do |a|
|
10
|
+
['c', 'd?', '[]', '[]=', '-@', '%', '*', 'cstrkey', 'cstrmeth'].each do |a|
|
11
11
|
it "should handle the Ruby 'alias' keyword syntax for method ##{a}" do
|
12
12
|
P('A#' + a).should be_instance_of(CodeObjects::MethodObject)
|
13
|
+
P('A#' + a).is_alias?.should be_true
|
13
14
|
end
|
14
15
|
end
|
15
16
|
|
@@ -41,5 +41,10 @@ describe YARD::Server::DocServerSerializer do
|
|
41
41
|
file = CodeObjects::ExtraFileObject.new('a/b/FooBar.md', '')
|
42
42
|
@serializer.serialized_path(file).should == 'file/FooBar'
|
43
43
|
end
|
44
|
+
|
45
|
+
it "should handle unicode data" do
|
46
|
+
file = CodeObjects::ExtraFileObject.new("test\u0160", '')
|
47
|
+
@serializer.serialized_path(file).should == 'file/test_C5A0'
|
48
|
+
end if defined?(::Encoding)
|
44
49
|
end
|
45
50
|
end
|
@@ -44,5 +44,10 @@ describe YARD::Templates::Helpers::HtmlSyntaxHighlightHelper do
|
|
44
44
|
should_receive(:options).and_return(Options.new.update(:highlight => true))
|
45
45
|
html_syntax_highlight("def &x; ... end").should == "def &x; ... end"
|
46
46
|
end if HAVE_RIPPER
|
47
|
+
|
48
|
+
it "should return escaped unhighlighted source if a syntax error is found (ripper)" do
|
49
|
+
should_receive(:options).and_return(Options.new.update(:highlight => true))
|
50
|
+
html_syntax_highlight("$ git clone http://url").should == "$ git clone http://url"
|
51
|
+
end if HAVE_RIPPER
|
47
52
|
end
|
48
53
|
end
|
@@ -324,9 +324,9 @@ pre.code .dot + pre.code .id,
|
|
324
324
|
pre.code .rubyid_to_i pre.code .rubyid_each { color: #0085FF; }
|
325
325
|
pre.code .comment { color: #0066FF; }
|
326
326
|
pre.code .const, pre.code .constant { color: #585CF6; }
|
327
|
+
pre.code .label,
|
327
328
|
pre.code .symbol { color: #C5060B; }
|
328
329
|
pre.code .kw,
|
329
|
-
pre.code .label,
|
330
330
|
pre.code .rubyid_require,
|
331
331
|
pre.code .rubyid_extend,
|
332
332
|
pre.code .rubyid_include { color: #0000FF; }
|
@@ -78,7 +78,12 @@ function framesInit() {
|
|
78
78
|
if (hasFrames) {
|
79
79
|
document.body.className = 'frames';
|
80
80
|
$('#menu .noframes a').attr('href', document.location);
|
81
|
-
|
81
|
+
try {
|
82
|
+
window.top.document.title = $('html head title').text();
|
83
|
+
} catch(error) {
|
84
|
+
// some browsers will not allow this when serving from file://
|
85
|
+
// but we don't want to stop the world.
|
86
|
+
}
|
82
87
|
}
|
83
88
|
else {
|
84
89
|
$('#menu .noframes a').text('frames').attr('href', framesUrl);
|
@@ -211,4 +216,4 @@ $(linkSummaries);
|
|
211
216
|
$(keyboardShortcuts);
|
212
217
|
$(summaryToggle);
|
213
218
|
$(fixOutsideWorldLinks);
|
214
|
-
$(generateTOC);
|
219
|
+
$(generateTOC);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.7.
|
4
|
+
version: 0.8.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Loren Segal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
YARD is a documentation generation tool for the Ruby programming language.
|