h2e-rb 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -5
- data/lib/h2e/converter.rb +1 -1
- data/lib/h2e/version.rb +1 -1
- 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: c0638936d8279d6b544c77a81fe4555c369bde33
|
4
|
+
data.tar.gz: 286983fcf025826b04176e4ffe5e9c3e8dd121df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a36bc4e71d9a3bfbbcdf12e39655d623765170c34297f2d81154d02c71fca73c566ae030d592e5b0a286df6029bfad13d6948f2555bdfccd0714be5cabbfb02
|
7
|
+
data.tar.gz: 0e3d2b7baf3c490709b20a2bd697acc1a28ab2455008c5048a354bea167c0ae53dfb48f6ec75fc5c163aebd4e726343ad6cb1fc091f452c4d9ae652a5d3eed85
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# H2E
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
This module provides to convert HTML to ENML.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,7 +20,11 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
```ruby
|
24
|
+
require 'h2e'
|
25
|
+
converer = H2E::Converter.new
|
26
|
+
enml = converter.from(html)
|
27
|
+
```
|
26
28
|
|
27
29
|
## Development
|
28
30
|
|
@@ -32,7 +34,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
34
|
|
33
35
|
## Contributing
|
34
36
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
37
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/yasuhiroki/h2e-rb. 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.
|
36
38
|
|
37
39
|
|
38
40
|
## License
|
data/lib/h2e/converter.rb
CHANGED
@@ -31,7 +31,7 @@ module H2E
|
|
31
31
|
end
|
32
32
|
if not @html_base_url.nil?
|
33
33
|
if doc.name == "a"
|
34
|
-
href = doc.attribute("href")
|
34
|
+
href = doc.attribute("href")&.value
|
35
35
|
if href =~ %r(^/.+)
|
36
36
|
doc.set("href", "#{@html_base_url}#{href}")
|
37
37
|
elsif (href =~ %r(^(http|https)://.+)).nil?
|
data/lib/h2e/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: h2e-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yasuhiroki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oga
|