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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef9efe4edad38a159aae8b484a45d222408c7c34
4
- data.tar.gz: 68281500153ef94cdcaba336bc139a9e930ab46a
3
+ metadata.gz: 4baddf5f52f2913d492f130ec8b45a08d37a6bb7
4
+ data.tar.gz: 5f96f9b1e90711b3ff6b54b191f3dae793d70793
5
5
  SHA512:
6
- metadata.gz: 876cde2d21d6952a00e48c7ab4db8131b54960b7a92d1c1e1fe02e68a253a7f58f9830a93607fe8d55e196acd94a99a8cc72db17352ceeda5d1101e4ffeee6fb
7
- data.tar.gz: 71981d8942aeef7eff85bdac219896656a0d4fab0fc355202bc993e554f3d1e4fd51bef14224134b3d574306ad659238e78e0bda53a170302b32d55adf3c6885
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.2
11
- **Release Date**: September 18th 2013
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)
@@ -132,6 +132,7 @@ module YARD
132
132
  # @return [void]
133
133
  def self.save
134
134
  require 'yaml'
135
+ Dir.mkdir(CONFIG_DIR) unless File.directory?(CONFIG_DIR)
135
136
  File.open(CONFIG_FILE, 'w') {|f| f.write(YAML.dump(options)) }
136
137
  end
137
138
 
@@ -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
- serialized_path(object.namespace) + ':' + escape(object.name.to_s)
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 ? ":" : ".") + escape(object.name.to_s)
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./, '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']
@@ -1,3 +1,3 @@
1
1
  module YARD
2
- VERSION = "0.8.7.2"
2
+ VERSION = "0.8.7.3"
3
3
  end
@@ -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
 
@@ -1,9 +1,11 @@
1
1
  module A
2
2
  def a; end
3
3
  alias_method :b, :a
4
+ alias_method :"cstrmeth", :"a"
4
5
 
5
6
  # Handle keyword syntax too
6
7
  alias :c :a
8
+ alias :"cstrkey" :a
7
9
  alias d? a
8
10
  alias [] a
9
11
  alias []= a
@@ -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 &amp;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
- window.top.document.title = $('html head title').text();
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.2
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-09-18 00:00:00.000000000 Z
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.