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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b193cd2ec66cb829fb7cf0ac6e9eaea6d107be3
4
- data.tar.gz: fa1019b3746e56ad2b5785f801ea9c2588f1ea69
3
+ metadata.gz: fb69e03d2dc1bfd473c2073a44a890d25a6c9a25
4
+ data.tar.gz: 91a7b52f84751dcaf6246024aae160a702fb6fcf
5
5
  SHA512:
6
- metadata.gz: b6281693ae3f543e427c8e3667654eee30e157a54c8cde75900f676096b3acd70473a052904d6470ad2659abcfd473c6a704ee58b49bae8e1887290f15ee7159
7
- data.tar.gz: 077a7e475ffc4ecd122caa148bac321f3201583a00f5d170b521c2dcf1d4ca96a4531bfc663ee558099618656b20fa2403bd5702b34591ad65a30ebc667a982a
6
+ metadata.gz: acd40208862365222a27f1f4430f6ce067e75b2235cd2d403ac7dc126b408352e934e31ac9380914b41a3fe03ce299fadecc1a78298c92a00e104812e7a5780a
7
+ data.tar.gz: d1f17eb2540c99d07065f4d8f78bdadee8d2aa88650070fd59ce4d62d560ec27f0e8521d400f7d920e3be4e26346acc2ee5a24e508a9f33abe867b9fb264713e
@@ -1,3 +1,4 @@
1
+ require 'digest'
1
2
  require 'reverse_markdown/version'
2
3
  require 'reverse_markdown/mapper'
3
4
  require 'reverse_markdown/errors'
@@ -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
@@ -1,3 +1,3 @@
1
1
  module ReverseMarkdown
2
- VERSION = "0.4.6"
2
+ VERSION = "0.4.7"
3
3
  end
@@ -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.6
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-08-13 00:00:00.000000000 Z
11
+ date: 2013-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri