glyph 0.5.2 → 0.5.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/AUTHORS.textile +1 -0
  3. data/CHANGELOG.textile +104 -59
  4. data/Gemfile.lock +46 -0
  5. data/LICENSE.textile +1 -1
  6. data/README.textile +106 -120
  7. data/book/lib/layouts/bookindex.glyph +6 -106
  8. data/book/lib/layouts/bookpage.glyph +8 -108
  9. data/book/lib/layouts/project.glyph +0 -1
  10. data/book/text/acknowledgements.glyph +1 -0
  11. data/book/text/changelog.glyph +7 -1
  12. data/glyph.gemspec +10 -10
  13. data/lib/glyph.rb +1 -1
  14. data/spec/files/test.scss +1 -1
  15. data/spec/lib/analyzer_spec.rb +60 -61
  16. data/spec/lib/bookmark_spec.rb +21 -21
  17. data/spec/lib/commands_spec.rb +53 -54
  18. data/spec/lib/config_spec.rb +16 -16
  19. data/spec/lib/document_spec.rb +35 -35
  20. data/spec/lib/glyph_spec.rb +32 -32
  21. data/spec/lib/interpreter_spec.rb +8 -8
  22. data/spec/lib/macro_spec.rb +51 -49
  23. data/spec/lib/macro_validators_spec.rb +14 -14
  24. data/spec/lib/node_spec.rb +25 -25
  25. data/spec/lib/parser_spec.rb +26 -26
  26. data/spec/lib/reporter_spec.rb +32 -32
  27. data/spec/lib/syntax_node_spec.rb +33 -33
  28. data/spec/macros/core_spec.rb +95 -95
  29. data/spec/macros/filters_spec.rb +9 -8
  30. data/spec/macros/html5_spec.rb +17 -17
  31. data/spec/macros/macros_spec.rb +33 -33
  32. data/spec/macros/textile_spec.rb +15 -15
  33. data/spec/macros/web5_spec.rb +3 -3
  34. data/spec/macros/web_spec.rb +19 -19
  35. data/spec/macros/xml_spec.rb +15 -15
  36. data/spec/tasks/generate_spec.rb +34 -34
  37. data/spec/tasks/load_spec.rb +15 -15
  38. data/spec/tasks/project_spec.rb +15 -15
  39. data/styles/coderay.css +2 -0
  40. data/styles/coderay.css.map +7 -0
  41. data/styles/default.css +9 -7
  42. data/styles/default.css.map +7 -0
  43. data/styles/pagination.css +18 -23
  44. data/styles/pagination.css.map +7 -0
  45. data/tasks/generate.rake +12 -5
  46. metadata +47 -68
  47. data/glyph-0.5.1.gem +0 -0
@@ -1,106 +1,6 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <title>Glyph - Document Authoring Framework</title>
5
-
6
- <meta charset="utf-8" />
7
- <meta name="author" content="Fabio Cevasco" />
8
- <meta name="copyright" content="Fabio Cevasco" />
9
- <meta name="robots" content="all, follow" />
10
- <meta name="Revisit-After" content="2 Days" />
11
- <meta name="language" content="en" />
12
- <meta name="target_country" content="en-us" />
13
- <meta name="country" content="United States" />
14
- <meta name="readability-verification" content="XmaVzRjmcFL5Bb2Fu9TZVdDKzhA3apQdxexTB2rK"/>
15
- <meta name="description" content="H3RALD - Fabio Cevasco's Web Site" />
16
-
17
- <meta name="keywords" content="h3rald, fabio cevasco, glyph" />
18
- <link rel="shortcut icon" href="/favicon.png" type="image/png" />
19
- <meta content="44.388041;9.073248" name="ICBM" />
20
-
21
- <link rel="stylesheet" type="text/css" href="/styles/html5reset.css" />
22
- <link rel="stylesheet" type="text/css" href="/styles/style.css" />
23
-
24
- <script src="http://www.google.com/jsapi?key=ABQIAAAAr6RY1Z6dchG_sX9WDLSy3xRlq2n1sm52B5HDRR5tm6o8XM18FhR56xHNNH6CsX86uN5VoTrglpyOyQ" type="text/javascript"></script>
25
- <script src="/js/sevenup.js" type="text/javascript"></script>
26
- <script src="/js/sevenup_black.js" type="text/javascript"></script>
27
- <script type="text/javascript">google.load("jquery", "1");</script>
28
- <script src="/js/jquery-timeago.js" type="text/javascript"></script>
29
- <script src="/js/jquery-easing.js" type="text/javascript"></script>
30
- <script src="/js/jquery-fancybox.js" type="text/javascript"></script>
31
- <script src="/js/date.js" type="text/javascript"></script>
32
- <script src="/js/feeds.js" type="text/javascript"></script>
33
- <script src="/js/hyphenator.js" type="text/javascript"></script>
34
- <script src="/js/init.js" type="text/javascript"></script>
35
- <script src="/js/search.js" type="text/javascript"></script>
36
- </head>
37
- <body>
38
- <section id="container">
39
-
40
- <header class="page">
41
- <nav class="home-link">
42
- <a href="/">
43
- <span class="logo">
44
- <span class="hrald"><span class="h">H</span>&nbsp;<span class="rald">RALD</span></span>
45
- <span class="three">3</span>
46
- </span>
47
- </a>
48
- </nav>
49
-
50
- <nav class="section">
51
- /<a href="/glyph/" rel="glyph">GLYPH</a>
52
- </nav>
53
-
54
- </header>
55
- <article class="page">
56
- <header>
57
- <hgroup>
58
- <h1>Glyph - Document Authoring Framework</h1>
59
- <h2>Documentation</h2>
60
-
61
- </hgroup>
62
-
63
- </header>
64
- <section id="body-text" class="hyphenate glyph-index">
65
- toc[]
66
- <nav id="sharing-buttons">
67
- <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="h3rald">Tweet</a>
68
- <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
69
- </nav>
70
- </section>
71
- </article>
72
-
73
-
74
- <footer>
75
- <section>
76
- <nav>
77
- <a href="/about/">ABOUT</a>\|<a href="/contact/">CONTACT</a>
78
- </nav>
79
- <p>H3RALD Web Site v8.1.2 &copy; 2004 &mdash; 2011 <em>Fabio Cevasco</em></p>
80
- </section>
81
- </footer>
82
- </section><!-- #container end -->
83
-
84
- <!-- Start Google Analytics -->
85
- <script type="text/javascript">
86
- var _gaq = _gaq \|\| \[\];
87
- _gaq.push(\['_setAccount', 'UA-18587377-1'\]);
88
- _gaq.push(\['_trackPageview'\]);
89
-
90
- (function() {
91
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
92
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
93
- var s = document.getElementsByTagName('script')\[0\]; s.parentNode.insertBefore(ga, s);
94
- })();
95
- </script>
96
- <!-- End Google Analytics -->
97
- <!-- Start of StatCounter Code -->
98
- <script type="text/javascript">
99
- var sc_project=6193656;
100
- var sc_invisible=1;
101
- var sc_security="57f7ee2a";
102
- </script>
103
- <script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script>
104
- <!-- End of StatCounter Code -->
105
- </body>
106
- </html>
1
+ -----
2
+ permalink: index
3
+ title: Glyph Documentation
4
+ type: page
5
+ -----
6
+ toc[]
@@ -1,108 +1,8 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <title>{{title}} - Glyph</title>
5
-
6
- <meta charset="utf-8" />
7
- <meta name="author" content="Fabio Cevasco" />
8
- <meta name="copyright" content="Fabio Cevasco" />
9
- <meta name="robots" content="all, follow" />
10
- <meta name="Revisit-After" content="2 Days" />
11
- <meta name="language" content="en" />
12
- <meta name="target_country" content="en-us" />
13
- <meta name="country" content="United States" />
14
- <meta name="readability-verification" content="XmaVzRjmcFL5Bb2Fu9TZVdDKzhA3apQdxexTB2rK"/>
15
- <meta name="description" content="H3RALD - Fabio Cevasco's Web Site" />
16
-
17
- <meta name="keywords" content="h3rald, fabio cevasco, glyph" />
18
- <link rel="shortcut icon" href="/favicon.png" type="image/png" />
19
- <meta content="44.388041;9.073248" name="ICBM" />
20
-
21
- <link rel="stylesheet" type="text/css" href="/styles/html5reset.css" />
22
- <link rel="stylesheet" type="text/css" href="/styles/style.css" />
23
-
24
- <script src="http://www.google.com/jsapi?key=ABQIAAAAr6RY1Z6dchG_sX9WDLSy3xRlq2n1sm52B5HDRR5tm6o8XM18FhR56xHNNH6CsX86uN5VoTrglpyOyQ" type="text/javascript"></script>
25
- <script src="/js/sevenup.js" type="text/javascript"></script>
26
- <script src="/js/sevenup_black.js" type="text/javascript"></script>
27
- <script type="text/javascript">google.load("jquery", "1");</script>
28
- <script src="/js/jquery-timeago.js" type="text/javascript"></script>
29
- <script src="/js/jquery-easing.js" type="text/javascript"></script>
30
- <script src="/js/jquery-fancybox.js" type="text/javascript"></script>
31
- <script src="/js/date.js" type="text/javascript"></script>
32
- <script src="/js/feeds.js" type="text/javascript"></script>
33
- <script src="/js/hyphenator.js" type="text/javascript"></script>
34
- <script src="/js/init.js" type="text/javascript"></script>
35
- <script src="/js/search.js" type="text/javascript"></script>
36
- </head>
37
- <body>
38
- <section id="container">
39
-
40
- <header class="page">
41
- <nav class="home-link">
42
- <a href="/">
43
- <span class="logo">
44
- <span class="hrald"><span class="h">H</span>&nbsp;<span class="rald">RALD</span></span>
45
- <span class="three">3</span>
46
- </span>
47
- </a>
48
- </nav>
49
-
50
- <nav class="section">
51
- /<a href="/glyph/" rel="glyph">GLYPH</a>
52
- </nav>
53
-
54
- </header>
55
- <article class="page glyph-book">
56
- <header>
57
- <hgroup>
58
- <h1>{{title}}</h1>
59
- <h2>Glyph</h2>
60
- </hgroup>
61
- </header>
62
- <section id="body-text" class="hyphenate glyph-book">
63
-
64
- navigation[{{id}}]
65
- {{contents}}
66
- navigation[{{id}}]
67
- <nav id="sharing-buttons">
68
- <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="h3rald">Tweet</a>
69
- <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
70
- </nav>
71
- </section>
72
- </article>
73
-
74
-
75
- <footer>
76
- <section>
77
- <nav>
78
- <a href="/about/">ABOUT</a>\|<a href="/contact/">CONTACT</a>
79
- </nav>
80
- <p>H3RALD Web Site v8.1.2 &copy; 2004 &mdash; 2012 <em>Fabio Cevasco</em></p>
81
- </section>
82
- </footer>
83
- </section><!-- #container end -->
84
-
85
-
86
- <!-- Start Google Analytics -->
87
- <script type="text/javascript">
88
- var _gaq = _gaq \|\| \[\];
89
- _gaq.push(\['_setAccount', 'UA-18587377-1'\]);
90
- _gaq.push(\['_trackPageview'\]);
91
-
92
- (function() {
93
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
94
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
95
- var s = document.getElementsByTagName('script')\[0\]; s.parentNode.insertBefore(ga, s);
96
- })();
97
- </script>
98
- <!-- End Google Analytics -->
99
- <!-- Start of StatCounter Code -->
100
- <script type="text/javascript">
101
- var sc_project=6193656;
102
- var sc_invisible=1;
103
- var sc_security="57f7ee2a";
104
- </script>
105
- <script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script>
106
- <!-- End of StatCounter Code -->
107
- </body>
108
- </html>
1
+ -----
2
+ permalink: {{id}}
3
+ title: Glyph &ndash; {{title}}
4
+ type: page
5
+ -----
6
+ navigation[{{id}}]
7
+ {{contents}}
8
+ navigation[{{id}}]
@@ -2,7 +2,6 @@
2
2
  permalink: glyph
3
3
  filters_pre:
4
4
  - erb
5
- - redcloth
6
5
  title: "Glyph"
7
6
  subtitle: "A Rapid Document Authoring Framework"
8
7
  type: project
@@ -8,5 +8,6 @@ Special thanks to the following individuals who contributed to Glyph by reportin
8
8
  * =>[http://www.stuartellis.eu|Stuart Ellis] (stuartellis)
9
9
  * Eric Givens (darthzippy)
10
10
  * =>[http://www.taylored-software.com/|Tammy Cravit] (tammycravit)
11
+ * =>[https://github.com/grv87|Basil Peace] (grv87)
11
12
  ]
12
13
 
@@ -32,11 +32,17 @@ def:[issue|
32
32
  td[txt[{{1}}]]
33
33
  ]
34
34
  ]
35
- ?[eq[%[ARGV\[0\]]|generate]|
35
+ ?[eq[%[ARGV\[0\]]|CHANGELOG]|
36
36
  %:[%>|"#{value} macro"]
37
37
  %:[#>|"#{value} command"]
38
38
  %:[$>|"#{value} setting"]
39
39
  ]
40
+
41
+ release[0.5.3|October 4 2014|
42
+ bugs[
43
+ issue[216|Fix error with SCSS generation]
44
+ ]
45
+ ]
40
46
  release[0.5.2|November 11th 2012|
41
47
  features[
42
48
  issue[208|HTML output now indented automatically.]
@@ -2,13 +2,13 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "glyph"
5
- s.version = "0.5.2"
5
+ s.version = "0.5.3.1"
6
6
  s.summary = "Glyph -- A Ruby-powered Document Authoring Framework"
7
7
  s.description = "Glyph is a framework for structured document authoring."
8
8
  s.homepage = "http://www.h3rald.com/glyph/"
9
9
  s.authors = ["Fabio Cevasco"]
10
10
  s.email = "h3rald@h3rald.com"
11
- s.date = "2012-11-10"
11
+ s.date = "2014-10-04"
12
12
  s.license = "MIT"
13
13
 
14
14
  s.files = ["Rakefile"]
@@ -32,15 +32,15 @@ Gem::Specification.new do |s|
32
32
  s.default_executable = "glyph"
33
33
  s.extra_rdoc_files = Dir.glob "*.textile"
34
34
 
35
- s.add_runtime_dependency("gli", [">= 2.4.1"])
36
- s.add_runtime_dependency("extlib", [">= 0.9.15"])
37
- s.add_runtime_dependency("rake", [">= 0.9.2.2"])
35
+ s.add_runtime_dependency("gli", [">= 2.12.2"])
36
+ s.add_runtime_dependency("extlib", [">= 0.9.16"])
37
+ s.add_runtime_dependency("rake", [">= 10.3.2"])
38
38
 
39
- s.add_development_dependency("rspec", [">= 2.11.0"])
40
- s.add_development_dependency("yard", [">= 0.8.3"])
41
- s.add_development_dependency("directory_watcher", [">= 1.4.1"])
42
- s.add_development_dependency("sass", [">= 3.2.1"])
39
+ s.add_development_dependency("rspec", [">= 3.1.0"])
40
+ s.add_development_dependency("yard", [">= 0.8.7.4"])
41
+ s.add_development_dependency("directory_watcher", [">= 1.5.1"])
42
+ s.add_development_dependency("sass", [">= 3.4.5"])
43
43
  s.add_development_dependency("RedCloth", [">= 4.2.9"])
44
44
  s.add_development_dependency("bluecloth", [">= 2.2.0"])
45
- s.add_development_dependency("coderay", [">= 1.0.8"])
45
+ s.add_development_dependency("coderay", [">= 1.1.0"])
46
46
  end
@@ -72,7 +72,7 @@ module Glyph
72
72
  class MutualInclusionError < MacroError; end
73
73
 
74
74
  # The current version of Glyph
75
- VERSION = "0.5.2"
75
+ VERSION = "0.5.3.1"
76
76
 
77
77
  # All the currently-loaded macros
78
78
  MACROS = {}
@@ -1,5 +1,5 @@
1
1
  $test: 10px;
2
2
  #main {
3
- background-color: blue;
3
+ background-color: #0000ff;
4
4
  margin: $test + 2px;
5
5
  }
@@ -20,118 +20,117 @@ describe Glyph::Analyzer do
20
20
  end
21
21
 
22
22
  it "should be initialized with a document" do
23
- lambda { Glyph::Analyzer.new(Glyph.document) }.should_not raise_error
24
- lambda { Glyph::Analyzer.new }.should_not raise_error
23
+ expect { Glyph::Analyzer.new(Glyph.document) }.not_to raise_error
24
+ expect { Glyph::Analyzer.new }.not_to raise_error
25
25
  end
26
26
 
27
27
  it "should expose a macro node iterator" do
28
- lambda { @a.with_macros }.should raise_error(ArgumentError, "No block given")
28
+ expect { @a.with_macros }.to raise_error(ArgumentError, "No block given")
29
29
  count = 0
30
- lambda { @a.with_macros {|n| count+=1} }.should_not raise_error
31
- count.should == 20
30
+ expect { @a.with_macros {|n| count+=1} }.not_to raise_error
31
+ expect(count).to eq(20)
32
32
  count = 0
33
- lambda { @a.with_macros(:snippet) {|n| count+=1} }.should_not raise_error
34
- count.should == 2
33
+ expect { @a.with_macros(:snippet) {|n| count+=1} }.not_to raise_error
34
+ expect(count).to eq(2)
35
35
  count = 0
36
- lambda { @a.with_macros(:&) {|n| count+=1} }.should_not raise_error
37
- count.should == 2
36
+ expect { @a.with_macros(:&) {|n| count+=1} }.not_to raise_error
37
+ expect(count).to eq(2)
38
38
  end
39
39
 
40
40
  it "should access macro instance arrays by definition" do
41
- @a.macro_array_for(:snippet).should == []
41
+ expect(@a.macro_array_for(:snippet)).to eq([])
42
42
  @a.with_macros {}
43
- @a.macro_array_for(:snippet).length.should == 2
44
- @a.macro_array_for(:&).length.should == 2
45
- @a.macro_array_for(:section).length.should == 4
43
+ expect(@a.macro_array_for(:snippet).length).to eq(2)
44
+ expect(@a.macro_array_for(:&).length).to eq(2)
45
+ expect(@a.macro_array_for(:section).length).to eq(4)
46
46
  end
47
47
 
48
48
  it "should raise an error if a stat is not available" do
49
- lambda { @a.stats_for :unknown }.should raise_error(RuntimeError, "Unable to calculate unknown stats")
49
+ expect { @a.stats_for :unknown }.to raise_error(RuntimeError, "Unable to calculate unknown stats")
50
50
  end
51
51
 
52
52
  it "should calculate stats for all macros" do
53
- lambda {@a.stats_for :macros}.should_not raise_error
54
- @a.stats[:macros].blank?.should == false
53
+ expect {@a.stats_for :macros}.not_to raise_error
54
+ expect(@a.stats[:macros].blank?).to eq(false)
55
55
  c = @a.stats[:macros]
56
- c[:definitions].should == (Glyph::MACROS.keys - Glyph::ALIASES[:by_alias].keys).uniq.sort
57
- c[:aliases].should == Glyph::ALIASES[:by_alias].keys.sort
58
- c[:instances].length.should == 20
59
- c[:used_definitions].should == [:anchor, :include, :link, :markdown, :section, :snippet, :"snippet:", :textile, :toc]
56
+ expect(c[:definitions]).to eq((Glyph::MACROS.keys - Glyph::ALIASES[:by_alias].keys).uniq.sort)
57
+ expect(c[:aliases]).to eq(Glyph::ALIASES[:by_alias].keys.sort)
58
+ expect(c[:instances].length).to eq(20)
59
+ expect(c[:used_definitions]).to eq([:anchor, :include, :link, :markdown, :section, :snippet, :"snippet:", :textile, :toc])
60
60
  end
61
61
 
62
62
  it "should calculate stats for a single macro" do
63
- lambda {@a.stats_for :macro, :dsfash }.should raise_error(ArgumentError, "Unknown macro 'dsfash'")
64
- lambda {@a.stats_for :macro, :frontmatter }.should
65
- raise_error(ArgumentError, "Alias 'frontmatter' is not used in this document, did you mean 'section'?")
66
- lambda {@a.stats_for :macro, :section }.should_not raise_error
63
+ expect {@a.stats_for :macro, :dsfash }.to raise_error(ArgumentError, "Unknown macro 'dsfash'")
64
+ expect {@a.stats_for :macro, :frontmatter }.to raise_error(ArgumentError, "Macro 'frontmatter' is not used in this document, did you mean 'section'?")
65
+ expect {@a.stats_for :macro, :section }.not_to raise_error
67
66
  c = @a.stats[:macro]
68
- c[:instances].length.should == 4
69
- c[:files].should == [["document.glyph", 1], ["text/a/b/c/included.textile", 1],
70
- ["text/a/b/c/markdown.markdown", 1], ["text/container.textile", 1]]
67
+ expect(c[:instances].length).to eq(4)
68
+ expect(c[:files]).to eq([["document.glyph", 1], ["text/a/b/c/included.textile", 1],
69
+ ["text/a/b/c/markdown.markdown", 1], ["text/container.textile", 1]])
71
70
  @a.stats_for :macro, :"&"
72
71
  c = @a.stats[:macro]
73
- c[:alias_for].should == :snippet
74
- c[:instances].length.should == 2
72
+ expect(c[:alias_for]).to eq(:snippet)
73
+ expect(c[:instances].length).to eq(2)
75
74
  end
76
75
 
77
76
  it "should calculate stats for all bookmarks" do
78
- lambda {@a.stats_for :bookmarks}.should_not raise_error
77
+ expect {@a.stats_for :bookmarks}.not_to raise_error
79
78
  c = @a.stats[:bookmarks]
80
- c[:codes].should == [:h_1, :h_2, :md, :refs, :toc, :unused]
81
- c[:unreferenced].should == [:h_2, :md, :toc, :unused]
82
- c[:referenced].should == [[:h_1, 1], [:refs, 1]]
79
+ expect(c[:codes]).to eq([:h_1, :h_2, :md, :refs, :toc, :unused])
80
+ expect(c[:unreferenced]).to eq([:h_2, :md, :toc, :unused])
81
+ expect(c[:referenced]).to eq([[:h_1, 1], [:refs, 1]])
83
82
  end
84
83
 
85
84
  it "should calculate stats for a single bookmark" do
86
- lambda {@a.stats_for :bookmark, '#h_7'}.should raise_error(ArgumentError, "Bookmark 'h_7' does not exist")
87
- lambda {@a.stats_for :bookmark, '#h_1'}.should_not raise_error
85
+ expect {@a.stats_for :bookmark, '#h_7'}.to raise_error(ArgumentError, "Bookmark 'h_7' does not exist")
86
+ expect {@a.stats_for :bookmark, '#h_1'}.not_to raise_error
88
87
  c = @a.stats[:bookmark]
89
- c[:file].should == "text/container.textile"
90
- c[:references].should == [["text/references.glyph", 1]]
91
- c[:type].should == :header
88
+ expect(c[:file]).to eq("text/container.textile")
89
+ expect(c[:references]).to eq([["text/references.glyph", 1]])
90
+ expect(c[:type]).to eq(:header)
92
91
  end
93
92
 
94
93
  it "should calculate stats for all links do" do
95
- lambda {@a.stats_for :links}.should_not raise_error
94
+ expect {@a.stats_for :links}.not_to raise_error
96
95
  c = @a.stats[:links]
97
- c[:internal].should == [["#h_1", {:total=>1, :files=>[["text/references.glyph", 1]]}],
98
- ["#refs", {:total=>1, :files=>[["text/references.glyph", 1]]}]]
99
- c[:external].should == [["http://www.h3rald.com", {:total=>1, :files=>[["text/references.glyph", 1]]}]]
96
+ expect(c[:internal]).to eq([["#h_1", {:total=>1, :files=>[["text/references.glyph", 1]]}],
97
+ ["#refs", {:total=>1, :files=>[["text/references.glyph", 1]]}]])
98
+ expect(c[:external]).to eq([["http://www.h3rald.com", {:total=>1, :files=>[["text/references.glyph", 1]]}]])
100
99
  end
101
100
 
102
101
  it "should calculate stats for a single link" do
103
- lambda {@a.stats_for :link, 'q'}.should raise_error(ArgumentError, "No link matching /q/ was found")
104
- lambda {@a.stats_for :link, 'h'}.should_not raise_error
102
+ expect {@a.stats_for :link, 'q'}.to raise_error(ArgumentError, "No link matching /q/ was found")
103
+ expect {@a.stats_for :link, 'h'}.not_to raise_error
105
104
  c = @a.stats[:link][:stats]
106
- c.should == [["#h_1", {:total=>1, :files=>[["text/references.glyph", 1]]}],
107
- ["http://www.h3rald.com",{:total=>1, :files=>[["text/references.glyph", 1]]}]]
105
+ expect(c).to eq([["#h_1", {:total=>1, :files=>[["text/references.glyph", 1]]}],
106
+ ["http://www.h3rald.com",{:total=>1, :files=>[["text/references.glyph", 1]]}]])
108
107
  end
109
108
 
110
109
  it "should calculate stats for all snippets" do
111
- lambda {@a.stats_for :snippets}.should_not raise_error
110
+ expect {@a.stats_for :snippets}.not_to raise_error
112
111
  c = @a.stats[:snippets]
113
- c[:used].should == [:test]
114
- c[:total].should == 2
115
- c[:unused].should == [:unused]
116
- c[:definitions].should == [:test, :unused]
112
+ expect(c[:used]).to eq([:test])
113
+ expect(c[:total]).to eq(2)
114
+ expect(c[:unused]).to eq([:unused])
115
+ expect(c[:definitions]).to eq([:test, :unused])
117
116
  end
118
117
 
119
118
  it "should calculate stats for a single snippet" do
120
- lambda {@a.stats_for :snippet, 'test1'}.should raise_error(ArgumentError, "Snippet 'test1' does not exist")
121
- lambda {@a.stats_for :snippet, 'unused'}.should raise_error(ArgumentError, "Snippet 'unused' is not used in this document")
122
- lambda {@a.stats_for :snippet, 'test'}.should_not raise_error
119
+ expect {@a.stats_for :snippet, 'test1'}.to raise_error(ArgumentError, "Snippet 'test1' does not exist")
120
+ expect {@a.stats_for :snippet, 'unused'}.to raise_error(ArgumentError, "Snippet 'unused' is not used in this document")
121
+ expect {@a.stats_for :snippet, 'test'}.not_to raise_error
123
122
  c = @a.stats[:snippet][:stats]
124
- c.should == {:total=>2, :files=>[["document.glyph", 1], ["text/references.glyph", 1]]}
123
+ expect(c).to eq({:total=>2, :files=>[["document.glyph", 1], ["text/references.glyph", 1]]})
125
124
  end
126
125
 
127
126
  it "should calculate global stats" do
128
- lambda {@a.stats_for :global}.should_not raise_error
127
+ expect {@a.stats_for :global}.not_to raise_error
129
128
  c = @a.stats
130
- c[:bookmarks].blank?.should == false
131
- c[:links].blank?.should == false
132
- c[:snippets].blank?.should == false
133
- c[:macros].blank?.should == false
134
- c[:files].should == {:layouts=>0, :images=>1, :styles=>1, :text=>4, :lib=>0}
129
+ expect(c[:bookmarks].blank?).to eq(false)
130
+ expect(c[:links].blank?).to eq(false)
131
+ expect(c[:snippets].blank?).to eq(false)
132
+ expect(c[:macros].blank?).to eq(false)
133
+ expect(c[:files]).to eq({:layouts=>0, :images=>1, :styles=>1, :text=>4, :lib=>0})
135
134
  end
136
135
 
137
136
  end