cnblog_back_up_to_markdown 0.1.0 → 0.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3812c5bf4be3b8d84b5078a9dac0db824c480426
4
- data.tar.gz: de408314f6e4ad933d163c5f75dca7755f321ad3
3
+ metadata.gz: 288ba4180f843ef5f6cbf4cfcb125f56f7b6a129
4
+ data.tar.gz: 632039ea4b0082cc3dab9485e6ad8ab48e33b933
5
5
  SHA512:
6
- metadata.gz: 400795c0124fc1301a3efb893a8ab5a9c9f504c0abbfc4211e937a51176dbb0f32fc9fb5d7926738de8edab163f7a5608abd81d220264d3f825249b0441cd4ff
7
- data.tar.gz: fc0a1dee4e9b9574f8ee4ac3226b0f2bd5913f890bd0492876fef30dd6c0b2406a4ff83d9723e2ae28d06473a251315f9c03c0526e877f4bb906ee452ccc0638
6
+ metadata.gz: e8850fe6c08fa68d272573eba0eb2df4ab6ebf228569ea69e40482175c576cb59e0c8deebb938c761420e0eb6f38d7182466f129516d142a86782dbf04221846
7
+ data.tar.gz: 57d59680c726a95edbba7230a78d8346786e668320e1a4cca22ca93be358c702d4c6cf9012eb82ff5fe30c8367e0d8f64b68d0f0b15e9330a382f574c449a536
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.3.0
data/README.md CHANGED
@@ -1,14 +1,23 @@
1
- # CnblogBackUpToMarkdown
1
+ ## Summary
2
+ [![Gem Version](https://badge.fury.io/rb/cnblog_back_up_to_markdown.svg)](https://badge.fury.io/rb/cnblog_back_up_to_markdown)
3
+ [![Build Status](https://travis-ci.org/haoxilu/cnblog_back_up_to_markdown.svg?branch=master)](https://travis-ci.org/haoxilu/cnblog_back_up_to_markdown)
4
+ [![codecov.io](https://codecov.io/github/haoxilu/cnblog_back_up_to_markdown/coverage.svg?branch=master)](https://codecov.io/github/haoxilu/cnblog_back_up_to_markdown?branch=master)
2
5
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/cnblog_back_up_to_markdown`. To experiment with that code, run `bin/console` for an interactive prompt.
6
+ Convert [cnblog bakcup](http://i.cnblogs.com/BlogBackup.aspx) to markdown or markdown file.
4
7
 
5
- TODO: Delete this and the text above, and describe your gem
8
+ Github: [https://github.com/haoxilu/cnblog_back_up_to_markdown](https://github.com/haoxilu/cnblog_back_up_to_markdown)
9
+
10
+ Ruby Gem: [https://rubygems.org/gems/cnblog_back_up_to_markdown](https://rubygems.org/gems/cnblog_back_up_to_markdown)
11
+ ## Requirements
12
+ 1. [Nokogiri](http://nokogiri.org/)
13
+ 2. Ruby 1.9.3 or higher
6
14
 
7
15
  ## Installation
8
16
 
9
17
  Add this line to your application's Gemfile:
10
18
 
11
19
  ```ruby
20
+ gem 'reverse_markdown'
12
21
  gem 'cnblog_back_up_to_markdown'
13
22
  ```
14
23
 
@@ -22,17 +31,27 @@ Or install it yourself as:
22
31
 
23
32
  ## Usage
24
33
 
25
- TODO: Write usage instructions here
34
+ ### Ruby
35
+
36
+ require
26
37
 
27
- ## Development
38
+ ```ruby
39
+ require 'cnblog_back_up_to_markdown'
40
+ ```
28
41
 
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
42
+ use
30
43
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
44
+ ```ruby
45
+ file_path = File.expand_path("app/controllers/CNBlogs_BlogBackup_131_201311_201602.xml")
46
+ File.open(file_path) do |f|
47
+ @articles = CnblogBackUpToMarkdown::convert(f)
48
+ end
49
+ ```
32
50
 
33
- ## Contributing
51
+ ### CommandLine
52
+ It's also possible to convert cnblog's backup file to mrakdown using this library.
34
53
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cnblog_back_up_to_markdown. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
54
+ cnblog_parser convert CNBlogs_BlogBackup_131_201311_201602.xml
36
55
 
37
56
 
38
57
  ## License
@@ -28,9 +28,12 @@ Gem::Specification.new do |spec|
28
28
  spec.executables << 'cnblog_parser'
29
29
  spec.require_paths = ["lib"]
30
30
 
31
+ spec.add_dependency 'nokogiri'
32
+ spec.add_dependency "reverse_markdown", '~> 1.0.1'
33
+
31
34
  spec.add_development_dependency "bundler", "~> 1.11"
32
35
  spec.add_development_dependency "rake", "~> 10.0"
33
36
  spec.add_development_dependency "rspec", '~> 3.4'
34
- spec.add_development_dependency "reverse_markdown", '~> 1.0.1'
35
37
  spec.add_development_dependency "thor", '~> 0.19.1'
38
+ spec.add_development_dependency "codecov"
36
39
  end
@@ -1,3 +1,3 @@
1
1
  module CnblogBackUpToMarkdown
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cnblog_back_up_to_markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - haoxilu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-15 00:00:00.000000000 Z
11
+ date: 2016-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: nokogiri
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: reverse_markdown
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.0.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.0.1
13
41
  - !ruby/object:Gem::Dependency
14
42
  name: bundler
15
43
  requirement: !ruby/object:Gem::Requirement
@@ -53,33 +81,33 @@ dependencies:
53
81
  - !ruby/object:Gem::Version
54
82
  version: '3.4'
55
83
  - !ruby/object:Gem::Dependency
56
- name: reverse_markdown
84
+ name: thor
57
85
  requirement: !ruby/object:Gem::Requirement
58
86
  requirements:
59
87
  - - "~>"
60
88
  - !ruby/object:Gem::Version
61
- version: 1.0.1
89
+ version: 0.19.1
62
90
  type: :development
63
91
  prerelease: false
64
92
  version_requirements: !ruby/object:Gem::Requirement
65
93
  requirements:
66
94
  - - "~>"
67
95
  - !ruby/object:Gem::Version
68
- version: 1.0.1
96
+ version: 0.19.1
69
97
  - !ruby/object:Gem::Dependency
70
- name: thor
98
+ name: codecov
71
99
  requirement: !ruby/object:Gem::Requirement
72
100
  requirements:
73
- - - "~>"
101
+ - - ">="
74
102
  - !ruby/object:Gem::Version
75
- version: 0.19.1
103
+ version: '0'
76
104
  type: :development
77
105
  prerelease: false
78
106
  version_requirements: !ruby/object:Gem::Requirement
79
107
  requirements:
80
- - - "~>"
108
+ - - ">="
81
109
  - !ruby/object:Gem::Version
82
- version: 0.19.1
110
+ version: '0'
83
111
  description: 将博客园备份xml文件通过命令转为markdown文件,或者将博客园备份xml直接转为可以调用的对象
84
112
  email:
85
113
  - mail@haoxilu.net
@@ -90,6 +118,7 @@ extra_rdoc_files: []
90
118
  files:
91
119
  - ".gitignore"
92
120
  - ".rspec"
121
+ - ".travis.yml"
93
122
  - CODE_OF_CONDUCT.md
94
123
  - Gemfile
95
124
  - LICENSE.txt