mbrao 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/Gemfile +1 -2
  2. data/doc/ActionView/Template/Handlers/MbraoTemplate.html +1 -1
  3. data/doc/ActionView/Template/Handlers.html +1 -1
  4. data/doc/HTML/Pipeline/KramdownFilter.html +1 -1
  5. data/doc/HTML/Pipeline.html +1 -1
  6. data/doc/HTML.html +1 -1
  7. data/doc/Mbrao/Author.html +1 -1
  8. data/doc/Mbrao/Content.html +1 -1
  9. data/doc/Mbrao/ContentPublicInterface.html +1 -1
  10. data/doc/Mbrao/Exceptions/InvalidDate.html +1 -1
  11. data/doc/Mbrao/Exceptions/InvalidMetadata.html +1 -1
  12. data/doc/Mbrao/Exceptions/Parsing.html +1 -1
  13. data/doc/Mbrao/Exceptions/Rendering.html +1 -1
  14. data/doc/Mbrao/Exceptions/UnavailableLocalization.html +1 -1
  15. data/doc/Mbrao/Exceptions/Unimplemented.html +1 -1
  16. data/doc/Mbrao/Exceptions/UnknownEngine.html +1 -1
  17. data/doc/Mbrao/Exceptions.html +1 -1
  18. data/doc/Mbrao/Parser.html +11 -11
  19. data/doc/Mbrao/ParsingEngines/Base.html +1 -1
  20. data/doc/Mbrao/ParsingEngines/PlainText.html +1 -1
  21. data/doc/Mbrao/ParsingEngines.html +1 -1
  22. data/doc/Mbrao/PublicInterface/ClassMethods.html +20 -329
  23. data/doc/Mbrao/PublicInterface.html +1 -1
  24. data/doc/Mbrao/RenderingEngines/Base.html +1 -1
  25. data/doc/Mbrao/RenderingEngines/HtmlPipeline.html +3 -3
  26. data/doc/Mbrao/RenderingEngines.html +1 -1
  27. data/doc/Mbrao/Validations/ClassMethods.html +50 -50
  28. data/doc/Mbrao/Validations.html +1 -1
  29. data/doc/Mbrao/Version.html +3 -3
  30. data/doc/Mbrao.html +1 -1
  31. data/doc/_index.html +1 -1
  32. data/doc/file.README.html +1 -1
  33. data/doc/index.html +1 -1
  34. data/doc/method_list.html +54 -62
  35. data/doc/top-level-namespace.html +1 -1
  36. data/lib/mbrao/parser.rb +2 -26
  37. data/lib/mbrao/rendering_engines/html_pipeline.rb +1 -1
  38. data/lib/mbrao/version.rb +2 -2
  39. data/mbrao.gemspec +2 -2
  40. data/spec/mbrao/parser_spec.rb +3 -30
  41. data/spec/mbrao/rendering_engines/html_pipeline_spec.rb +6 -6
  42. metadata +7 -7
data/mbrao.gemspec CHANGED
@@ -24,8 +24,8 @@ Gem::Specification.new do |gem|
24
24
 
25
25
  gem.required_ruby_version = ">= 1.9.3"
26
26
 
27
- gem.add_dependency("lazier", "~> 2.7.0")
27
+ gem.add_dependency("lazier", "~> 2.8.0")
28
28
  gem.add_dependency("html-pipeline", "~> 0.0.8")
29
29
  gem.add_dependency("slim", "~> 1.3.6")
30
- gem.add_dependency("kramdown", "~> 0.14.2")
30
+ gem.add_dependency("kramdown", "~> 1.0.1")
31
31
  end
@@ -58,14 +58,14 @@ describe Mbrao::Parser do
58
58
  end
59
59
 
60
60
  describe ".create_engine" do
61
- it "should create an engine via .find_class" do
61
+ it "should create an engine via Lazier.find_class" do
62
62
  reference = ::Mbrao::ParsingEngines::ScopedParser.new
63
63
  cls = ::Mbrao::ParsingEngines::ScopedParser
64
64
  cls.should_receive(:new).exactly(2).and_return(reference)
65
65
 
66
- ::Mbrao::Parser.should_receive(:find_class).with(:scoped_parser, "::Mbrao::ParsingEngines::%CLASS%").and_return(cls)
66
+ ::Lazier.should_receive(:find_class).with(:scoped_parser, "::Mbrao::ParsingEngines::%CLASS%").and_return(cls)
67
67
  expect(::Mbrao::Parser.create_engine(:scoped_parser)).to eq(reference)
68
- ::Mbrao::Parser.should_receive(:find_class).with(:scoped_parser, "::Mbrao::RenderingEngines::%CLASS%").and_return(cls)
68
+ ::Lazier.should_receive(:find_class).with(:scoped_parser, "::Mbrao::RenderingEngines::%CLASS%").and_return(cls)
69
69
  expect(::Mbrao::Parser.create_engine(:scoped_parser, :rendering)).to eq(reference)
70
70
  end
71
71
 
@@ -74,33 +74,6 @@ describe Mbrao::Parser do
74
74
  end
75
75
  end
76
76
 
77
- describe ".find_class" do
78
- it "should return a valid class" do
79
- expect(::Mbrao::Parser.find_class("String")).to eq(String)
80
- expect(::Mbrao::Parser.find_class("ScopedParser", "::Mbrao::ParsingEngines::%CLASS%")).to eq(::Mbrao::ParsingEngines::ScopedParser)
81
- end
82
-
83
- it "should raise an exception if the class is not found" do
84
- expect { ::Mbrao::Parser.find_class(:invalid) }.to raise_error(::Mbrao::Exceptions::Unimplemented)
85
- end
86
-
87
- it "should not expand engine scope if the class starts with ::" do
88
- expect { ::Mbrao::Parser.find_class("::ScopedParser", "::Mbrao::ParsingEngines::%CLASS%") }.to raise_error(::Mbrao::Exceptions::Unimplemented)
89
- end
90
-
91
- it "should only use scope if requested to" do
92
- expect { ::Mbrao::Parser.find_class("::Fixnum", "::Mbrao::ParsingEngines::%CLASS%", true) }.to raise_error(::Mbrao::Exceptions::Unimplemented)
93
- end
94
-
95
- it "should return anything but string or symbol as their class" do
96
- expect(::Mbrao::Parser.find_class(nil)).to eq(NilClass)
97
- expect(::Mbrao::Parser.find_class(1)).to eq(Fixnum)
98
- expect(::Mbrao::Parser.find_class(["A"])).to eq(Array)
99
- expect(::Mbrao::Parser.find_class({a: "b"})).to eq(Hash)
100
- expect(::Mbrao::Parser.find_class(Hash)).to eq(Hash)
101
- end
102
- end
103
-
104
77
  describe ".instance" do
105
78
  it("should call .new") do
106
79
  ::Mbrao::Parser.instance_variable_set(:@instance, nil)
@@ -28,7 +28,7 @@ describe Mbrao::RenderingEngines::HtmlPipeline do
28
28
  end
29
29
 
30
30
  it "should have default options" do
31
- filters = [:kramdown, :table_of_contents, :autolink, :emoji, :image_max_width].collect {|f| ::Mbrao::Parser.find_class(f, "::HTML::Pipeline::%CLASS%Filter", true) }
31
+ filters = [:kramdown, :table_of_contents, :autolink, :emoji, :image_max_width].collect {|f| ::Lazier.find_class(f, "::HTML::Pipeline::%CLASS%Filter", true) }
32
32
  ::HTML::Pipeline.should_receive(:new).with(filters, {gfm: true, asset_root: "/"}).and_call_original
33
33
  reference.render("CONTENT")
34
34
  end
@@ -39,23 +39,23 @@ describe Mbrao::RenderingEngines::HtmlPipeline do
39
39
  end
40
40
 
41
41
  it "should restrict filter used" do
42
- filters = [:table_of_contents, :autolink, :emoji, :image_max_width].collect {|f| ::Mbrao::Parser.find_class(f, "::HTML::Pipeline::%CLASS%Filter", true) }
42
+ filters = [:table_of_contents, :autolink, :emoji, :image_max_width].collect {|f| ::Lazier.find_class(f, "::HTML::Pipeline::%CLASS%Filter", true) }
43
43
  ::HTML::Pipeline.should_receive(:new).with(filters, an_instance_of(Hash)).and_call_original
44
44
  reference.render("CONTENT", {kramdown: false})
45
45
 
46
- filters = [:kramdown, :autolink, :emoji, :image_max_width].collect {|f| ::Mbrao::Parser.find_class(f, "::HTML::Pipeline::%CLASS%Filter", true) }
46
+ filters = [:kramdown, :autolink, :emoji, :image_max_width].collect {|f| ::Lazier.find_class(f, "::HTML::Pipeline::%CLASS%Filter", true) }
47
47
  ::HTML::Pipeline.should_receive(:new).with(filters, an_instance_of(Hash)).and_call_original
48
48
  reference.render("CONTENT", {toc: false})
49
49
 
50
- filters = [:kramdown, :table_of_contents, :emoji, :image_max_width].collect {|f| ::Mbrao::Parser.find_class(f, "::HTML::Pipeline::%CLASS%Filter", true) }
50
+ filters = [:kramdown, :table_of_contents, :emoji, :image_max_width].collect {|f| ::Lazier.find_class(f, "::HTML::Pipeline::%CLASS%Filter", true) }
51
51
  ::HTML::Pipeline.should_receive(:new).with(filters, an_instance_of(Hash)).and_call_original
52
52
  reference.render("CONTENT", {links: false})
53
53
 
54
- filters = [:kramdown, :table_of_contents, :autolink, :image_max_width].collect {|f| ::Mbrao::Parser.find_class(f, "::HTML::Pipeline::%CLASS%Filter", true) }
54
+ filters = [:kramdown, :table_of_contents, :autolink, :image_max_width].collect {|f| ::Lazier.find_class(f, "::HTML::Pipeline::%CLASS%Filter", true) }
55
55
  ::HTML::Pipeline.should_receive(:new).with(filters, an_instance_of(Hash)).and_call_original
56
56
  reference.render("CONTENT", {emoji: false})
57
57
 
58
- filters = [:kramdown, :table_of_contents, :autolink, :emoji].collect {|f| ::Mbrao::Parser.find_class(f, "::HTML::Pipeline::%CLASS%Filter", true) }
58
+ filters = [:kramdown, :table_of_contents, :autolink, :emoji].collect {|f| ::Lazier.find_class(f, "::HTML::Pipeline::%CLASS%Filter", true) }
59
59
  ::HTML::Pipeline.should_receive(:new).with(filters, an_instance_of(Hash)).and_call_original
60
60
  reference.render("CONTENT", {image_max_width: false})
61
61
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mbrao
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-08 00:00:00.000000000 Z
12
+ date: 2013-03-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: lazier
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 2.7.0
21
+ version: 2.8.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 2.7.0
29
+ version: 2.8.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: html-pipeline
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: 0.14.2
69
+ version: 1.0.1
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ dependencies:
74
74
  requirements:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: 0.14.2
77
+ version: 1.0.1
78
78
  description: A content parser and renderer with embedded metadata support.
79
79
  email:
80
80
  - shogun_panda@me.com
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  version: '0'
175
175
  segments:
176
176
  - 0
177
- hash: 2379105030691470614
177
+ hash: 4279351088310912165
178
178
  requirements: []
179
179
  rubyforge_project: mbrao
180
180
  rubygems_version: 1.8.25