html2markdown 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Readme.md CHANGED
@@ -1,3 +1,11 @@
1
1
  ### Yet Another Html to Markdown ruby lib
2
- we love markdown, cause it is friendly to edit
2
+ We love markdown, cause it is friendly to edit.
3
3
  So we want everything to be markdown
4
+
5
+ ### spec is our promise
6
+ ```ruby
7
+ p = HTMLPage.new :contents => '<strong>haha</strong>'
8
+ p.markdown.should == '**haha**'
9
+ p.contents = '<strong>hehe</strong>'
10
+ p.markdown!.should == '**hehe**'
11
+ ```
@@ -15,4 +15,12 @@ class HTMLPage
15
15
  @content_extrator = content_extrator
16
16
  end
17
17
 
18
+ def markdown
19
+ @markdown ||= markdown!
20
+ end
21
+
22
+ def markdown!
23
+ to_markdown(contents)
24
+ end
25
+
18
26
  end
@@ -1,3 +1,3 @@
1
1
  module HTML2Markdown
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -74,4 +74,11 @@ NEXT!<br>
74
74
  markdown.length.should > 0
75
75
  puts markdown
76
76
  end
77
+
78
+ it "should have markdown method" do
79
+ p = HTMLPage.new :contents => '<strong>haha</strong>'
80
+ p.markdown.should == '**haha**'
81
+ p.contents = '<strong>hehe</strong>'
82
+ p.markdown!.should == '**hehe**'
83
+ end
77
84
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html2markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-28 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
16
- requirement: &2155274260 !ruby/object:Gem::Requirement
16
+ requirement: &2158826900 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2155274260
24
+ version_requirements: *2158826900
25
25
  description: simple and flexible html to markdown converter
26
26
  email:
27
27
  - mike.d.1984@gmail.com