motion-kramdown 0.5.0 → 0.5.1

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: 8fd59aa42442a883766e182755509ca88a104fd6
4
- data.tar.gz: 1b6950617b913dd6b6008e5e3790476dffc4e00d
3
+ metadata.gz: 170d5050de06949a6d7e2b553f49bbdd02de26dc
4
+ data.tar.gz: bc8cb1616378918befb148b0c2522adee0b09f1c
5
5
  SHA512:
6
- metadata.gz: 3fe906689c82391b256133cdd1ce0283f6ab10aea5c1ed1761c2071210f5060c7cd4836fa81555a88d82196f3839020f967e6cb6be6d833e06051881cb19f611
7
- data.tar.gz: d9432cefa45a87160dad48bb861ce7d281597f7b44b5cf32186f640a17edac6f40ed993f3ff879019f1a35b1bda2d1e8ac31122066cbcab2d85150ee00fb3ee3
6
+ metadata.gz: 48565bd9aa912fa94e02bffbbe43e3ec00ff50c166e62872a0a6867e4b543482678afc886896c2936236af57d627f7d66fc2abc948a697a3e71618c514af1683
7
+ data.tar.gz: 4afc303834b5fecfb03cfbed8a24530efb59d8038fdbd1778f0aea1a2b14c6a24035b46c6e1a3171e5bf4b4e2b41eb2b99703e1f4dd55713d583a926ddb5fa86
@@ -34,9 +34,18 @@ module Kramdown
34
34
  end
35
35
  content = content.sub(/^\s*/, '')
36
36
 
37
- indent_re = /^ {#{indentation}}/
38
- content_re = /^(?:(?:\t| {4}){#{indentation / 4}} {#{indentation % 4}}|(?:\t| {4}){#{indentation / 4 + 1}}).*\S.*\n/
39
- lazy_re = /(?!^ {0,#{[indentation, 3].min}}(?:#{IAL_BLOCK}|#{LAZY_END_HTML_STOP}|#{LAZY_END_HTML_START})).*\S.*\n/
37
+ unless (indent_re = StringScanner.get_regex("^ {#{indentation}}")) # RM
38
+ indent_re = /^ {#{indentation}}/
39
+ StringScanner.cache_regex("^ {#{indentation}}", indent_re) # RM
40
+ end # RM
41
+ unless (content_re = StringScanner.get_regex("^(?:(?:\t| {4}){#{indentation / 4}} {#{indentation % 4}}|(?:\t| {4}){#{indentation / 4 + 1}}).*\S.*\n")) # RM
42
+ content_re = /^(?:(?:\t| {4}){#{indentation / 4}} {#{indentation % 4}}|(?:\t| {4}){#{indentation / 4 + 1}}).*\S.*\n/
43
+ StringScanner.cache_regex("^(?:(?:\t| {4}){#{indentation / 4}} {#{indentation % 4}}|(?:\t| {4}){#{indentation / 4 + 1}}).*\S.*\n", content_re) # RM
44
+ end # RM
45
+ unless (lazy_re = StringScanner.get_regex("(?!^ {0,#{[indentation, 3].min}}(?:#{IAL_BLOCK}|#{LAZY_END_HTML_STOP}|#{LAZY_END_HTML_START})).*\S.*\n")) # RM
46
+ lazy_re = /(?!^ {0,#{[indentation, 3].min}}(?:#{IAL_BLOCK}|#{LAZY_END_HTML_STOP}|#{LAZY_END_HTML_START})).*\S.*\n/
47
+ StringScanner.cache_regex("(?!^ {0,#{[indentation, 3].min}}(?:#{IAL_BLOCK}|#{LAZY_END_HTML_STOP}|#{LAZY_END_HTML_START})).*\S.*\n", lazy_re) # RM
48
+ end # RM
40
49
  [content, indentation, content_re, lazy_re, indent_re]
41
50
  end
42
51
 
@@ -1,6 +1,6 @@
1
1
  module MotionKramdown
2
2
 
3
3
  # The motion-kramdown version.
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.1'
5
5
 
6
6
  end
@@ -0,0 +1,30 @@
1
+ # RUNS = 20
2
+ # FILES = ['mdsyntax.text', 'mdbasics.text']
3
+ # benchmark_dir = File.join(File.dirname(__FILE__), '../benchmark')
4
+ #
5
+ # puts
6
+ # puts "Running tests on #{Time.now.strftime("%Y-%m-%d")} under #{RUBY_DESCRIPTION}"
7
+ #
8
+ # FILES.each do |file|
9
+ # data = File.read(File.join(benchmark_dir, file))
10
+ # puts
11
+ # puts "Test using file #{file} and #{RUNS} runs"
12
+ # results = Benchmark.bmbm do |b|
13
+ # b.report("kramdown #{Kramdown::VERSION}") { RUNS.times { Kramdown::Document.new(data).to_html } }
14
+ # # b.report("Maruku #{MaRuKu::Version}") { RUNS.times { Maruku.new(data, :on_error => :ignore).to_html } }
15
+ # end
16
+ #
17
+ # puts
18
+ # # puts "Real time of X divided by real time of kramdown"
19
+ # # kd = results.shift.real
20
+ # # %w[Maruku BlueFeather BlueCloth RDiscount redcarpet].each do |name|
21
+ # # puts name.ljust(19) << (results.shift.real/kd).round(4).to_s
22
+ # # end
23
+ # end
24
+ #
25
+ # describe "Benchmark Test" do
26
+ # it "benchmarks with mdsyntax.text and mdbasics.text" do
27
+ # expect(true).to eq true
28
+ # end
29
+ # end
30
+ #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-kramdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Walker
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-24 00:00:00.000000000 Z
12
+ date: 2015-02-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: motion-strscan
@@ -111,6 +111,7 @@ files:
111
111
  - lib/rubymotion/rexml_shim.rb
112
112
  - lib/rubymotion/set.rb
113
113
  - lib/rubymotion/version.rb
114
+ - spec/bench_mark.rb
114
115
  - spec/document_tree.rb
115
116
  - spec/gfm_to_html.rb
116
117
  - spec/helpers/it_behaves_like.rb
@@ -149,6 +150,7 @@ signing_key:
149
150
  specification_version: 4
150
151
  summary: RubyMotion version of kramdown parser for Markdown
151
152
  test_files:
153
+ - spec/bench_mark.rb
152
154
  - spec/document_tree.rb
153
155
  - spec/gfm_to_html.rb
154
156
  - spec/helpers/it_behaves_like.rb