reverse_markdown 0.4.6 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/reverse_markdown.rb +1 -0
- data/lib/reverse_markdown/mapper.rb +2 -2
- data/lib/reverse_markdown/version.rb +1 -1
- data/spec/mapper_spec.rb +20 -0
- 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: fb69e03d2dc1bfd473c2073a44a890d25a6c9a25
|
4
|
+
data.tar.gz: 91a7b52f84751dcaf6246024aae160a702fb6fcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acd40208862365222a27f1f4430f6ce067e75b2235cd2d403ac7dc126b408352e934e31ac9380914b41a3fe03ce299fadecc1a78298c92a00e104812e7a5780a
|
7
|
+
data.tar.gz: d1f17eb2540c99d07065f4d8f78bdadee8d2aa88650070fd59ce4d62d560ec27f0e8521d400f7d920e3be4e26346acc2ee5a24e508a9f33abe867b9fb264713e
|
data/lib/reverse_markdown.rb
CHANGED
@@ -6,8 +6,8 @@ module ReverseMarkdown
|
|
6
6
|
attr_accessor :github_style_code_blocks
|
7
7
|
|
8
8
|
def initialize(opts={})
|
9
|
-
self.log_level = :info
|
10
|
-
self.log_enabled = true
|
9
|
+
self.log_level = opts.fetch(:log_level) { :info }
|
10
|
+
self.log_enabled = opts.fetch(:log_enabled) { true }
|
11
11
|
self.li_counter = 0
|
12
12
|
self.github_style_code_blocks = opts[:github_style_code_blocks] || false
|
13
13
|
end
|
data/spec/mapper_spec.rb
CHANGED
@@ -9,6 +9,26 @@ describe ReverseMarkdown::Mapper do
|
|
9
9
|
mapper.process_root(nil).should == ''
|
10
10
|
end
|
11
11
|
|
12
|
+
describe "logging options" do
|
13
|
+
it "has a default log level info" do
|
14
|
+
mapper.log_level.should eq :info
|
15
|
+
end
|
16
|
+
|
17
|
+
it "overwrites log level if option is given" do
|
18
|
+
mapper = ReverseMarkdown::Mapper.new(log_level: :error)
|
19
|
+
mapper.log_level.should eq :error
|
20
|
+
end
|
21
|
+
|
22
|
+
it "enables logging by default" do
|
23
|
+
mapper.log_enabled.should be_true
|
24
|
+
end
|
25
|
+
|
26
|
+
it "disables logging if told to" do
|
27
|
+
mapper = ReverseMarkdown::Mapper.new(log_enabled: false)
|
28
|
+
mapper.log_enabled.should be_false
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
12
32
|
context "error handling" do
|
13
33
|
|
14
34
|
let(:unknown_element) { Nokogiri::XML::Node.new('foo', document) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reverse_markdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johannes Opper
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|