hparser 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e0e9c4a8998be7369d61c61260b30bda66092a2f
4
+ data.tar.gz: 4d466fc8d360d45fabf4ab2b9a10875271b92a47
5
+ SHA512:
6
+ metadata.gz: e4f17441160d92e13b3c67a54014c3febc56ea9e83275061bc7d09b69f5a703269741044f9c3b45adda8bfeb0bdf7dcda999a4248304742156bf1611c7a5e21a
7
+ data.tar.gz: b8924948ed9c896b96158bab7c8bc8d49140983555c8bb45ad6f812d4b4c482a16fea512e516bdaf2be8a3750b7b9eb1235d45723de6aed4e46f2705457f9965
data/.travis.yml CHANGED
@@ -3,3 +3,4 @@ rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
5
  - 2.1.2
6
+ - 2.2.3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
@@ -1 +1,13 @@
1
- Dir[File.dirname(__FILE__)+'/*.rb'].each{|x| require x}
1
+ require 'hparser/block/collectable'
2
+ require 'hparser/block/dl'
3
+ require 'hparser/block/footnote_list'
4
+ require 'hparser/block/head'
5
+ require 'hparser/block/list'
6
+ require 'hparser/block/p'
7
+ require 'hparser/block/pair'
8
+ require 'hparser/block/pre'
9
+ require 'hparser/block/quote'
10
+ require 'hparser/block/raw'
11
+ require 'hparser/block/see_more'
12
+ require 'hparser/block/super_pre'
13
+ require 'hparser/block/table'
@@ -9,7 +9,7 @@ module HParser
9
9
  def self.parse scanner,context,inlines
10
10
 
11
11
  content = format = nil
12
- if scanner.scan(/^>\|([A-Za-z0-9]*)\|\s*?$/)
12
+ if scanner.scan(/^>\|([A-Za-z0-9]+)?\|\s*?$/)
13
13
  lines = []
14
14
  format = scanner.matched_pattern[1]
15
15
  until scanner.scan(/^\|\|<\s*?$/) do
@@ -34,6 +34,10 @@ module HParser
34
34
  def self.<=>(o)
35
35
  -1
36
36
  end
37
+
38
+ def ==(o)
39
+ self.class == o.class and self.content == o.content and self.format == o.format
40
+ end
37
41
  end
38
42
  end
39
43
  end
data/lib/hparser/html.rb CHANGED
@@ -135,7 +135,7 @@ module HParser
135
135
 
136
136
  def to_html
137
137
  content = html_content.gsub(/&/, "&amp;").gsub(/\"/, "&quot;").gsub(/>/, "&gt;").gsub(/</, "&lt;")
138
- if format != "" && @@use_pygments
138
+ if format && @@use_pygments
139
139
  # quick hack language name converter (super pre -> pygments)
140
140
  lang = format
141
141
  case format
@@ -1 +1,9 @@
1
- Dir[File.dirname(__FILE__)+'/*.rb'].each{|x| require x}
1
+ require 'hparser/inline/collectable'
2
+ require 'hparser/inline/comment'
3
+ require 'hparser/inline/footnote'
4
+ require 'hparser/inline/fotolife'
5
+ require 'hparser/inline/hatena_id'
6
+ require 'hparser/inline/parser'
7
+ require 'hparser/inline/tex'
8
+ require 'hparser/inline/text'
9
+ require 'hparser/inline/url'
data/test/test_block.rb CHANGED
@@ -89,8 +89,7 @@ END
89
89
  <foo />
90
90
  ||<
91
91
  END
92
- assert_equal [SuperPre.new('<foo />')], parsed
93
- assert_equal 'xml', parsed.first.format
92
+ assert_equal [SuperPre.new('<foo />', 'xml')], parsed
94
93
  end
95
94
 
96
95
  def test_list
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hparser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
5
- prerelease:
4
+ version: 0.4.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - HIROKI Mizuno
@@ -11,38 +10,34 @@ authors:
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2014-08-11 00:00:00.000000000 Z
13
+ date: 2015-10-29 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: rake
18
17
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
18
  requirements:
21
- - - ! '>='
19
+ - - ">="
22
20
  - !ruby/object:Gem::Version
23
21
  version: 0.9.2
24
22
  type: :development
25
23
  prerelease: false
26
24
  version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
25
  requirements:
29
- - - ! '>='
26
+ - - ">="
30
27
  - !ruby/object:Gem::Version
31
28
  version: 0.9.2
32
29
  - !ruby/object:Gem::Dependency
33
30
  name: pry
34
31
  requirement: !ruby/object:Gem::Requirement
35
- none: false
36
32
  requirements:
37
- - - ! '>='
33
+ - - ">="
38
34
  - !ruby/object:Gem::Version
39
35
  version: '0'
40
36
  type: :development
41
37
  prerelease: false
42
38
  version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
39
  requirements:
45
- - - ! '>='
40
+ - - ">="
46
41
  - !ruby/object:Gem::Version
47
42
  version: '0'
48
43
  description: Hatena Syntax parser for Ruby
@@ -51,8 +46,8 @@ executables: []
51
46
  extensions: []
52
47
  extra_rdoc_files: []
53
48
  files:
54
- - .gitignore
55
- - .travis.yml
49
+ - ".gitignore"
50
+ - ".travis.yml"
56
51
  - ChangeLog
57
52
  - Gemfile
58
53
  - README.rdoc
@@ -120,33 +115,26 @@ files:
120
115
  - test/test_url.rb
121
116
  homepage: https://github.com/hotchpotch/hparser
122
117
  licenses: []
118
+ metadata: {}
123
119
  post_install_message:
124
120
  rdoc_options: []
125
121
  require_paths:
126
122
  - lib
127
123
  required_ruby_version: !ruby/object:Gem::Requirement
128
- none: false
129
124
  requirements:
130
- - - ! '>='
125
+ - - ">="
131
126
  - !ruby/object:Gem::Version
132
127
  version: '0'
133
- segments:
134
- - 0
135
- hash: 1601111818909404423
136
128
  required_rubygems_version: !ruby/object:Gem::Requirement
137
- none: false
138
129
  requirements:
139
- - - ! '>='
130
+ - - ">="
140
131
  - !ruby/object:Gem::Version
141
132
  version: '0'
142
- segments:
143
- - 0
144
- hash: 1601111818909404423
145
133
  requirements: []
146
134
  rubyforge_project:
147
- rubygems_version: 1.8.23.2
135
+ rubygems_version: 2.4.5.1
148
136
  signing_key:
149
- specification_version: 3
137
+ specification_version: 4
150
138
  summary: Hatena Syntax parser for Ruby
151
139
  test_files:
152
140
  - test/integration_texts/error1.ok.hatena