maruku 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,73 +1,48 @@
1
1
  require 'rubygems'
2
- Gem::manage_gems
3
- require 'rake/gempackagetask'
4
-
5
- require 'maruku_gem'
6
-
7
- task :default => [:package]
8
-
9
- Rake::GemPackageTask.new($spec) do |pkg|
10
- pkg.need_zip = true
11
- pkg.need_tar = true
2
+ require 'bundler'
3
+
4
+ begin
5
+ Bundler.setup(:default, :development)
6
+ rescue Bundler::BundlerError => e
7
+ $stderr.puts e.message
8
+ $stderr.puts "Run `bundle install` to install missing gems"
9
+ exit e.status_code
12
10
  end
13
11
 
14
- PKG_NAME = 'maruku'
15
- PKG_FILE_NAME = "#{PKG_NAME}-#{MaRuKu::Version}"
16
- RUBY_FORGE_PROJECT = PKG_NAME
17
- RUBY_FORGE_USER = 'andrea'
18
-
19
- RELEASE_NAME = MaRuKu::Version
20
- RUBY_FORGE_GROUPID = '2795'
21
- RUBY_FORGE_PACKAGEID = '3292'
12
+ require 'rake/clean'
13
+ require 'rake/rdoctask'
22
14
 
23
- desc "Publish the release files to RubyForge."
24
- task :release => [:gem, :package] do
25
- system("rubyforge login --username #{RUBY_FORGE_USER}")
15
+ task :default => :spec
16
+ CLEAN.replace %w(pkg doc)
26
17
 
27
- gem = "pkg/#{PKG_FILE_NAME}.gem"
28
- # -n notes/#{Maruku::Version}.txt
29
- cmd = "rubyforge add_release %s %s \"%s\" %s" %
30
- [RUBY_FORGE_GROUPID, RUBY_FORGE_PACKAGEID, RELEASE_NAME, gem]
31
-
32
- puts cmd
33
- system(cmd)
34
-
35
- files = ["gem", "tgz", "zip"].map { |ext| "pkg/#{PKG_FILE_NAME}.#{ext}" }
36
- files.each do |file|
37
- # system("rubyforge add_file %s %s %s %s" %
38
- # [RUBY_FORGE_GROUPID, RUBY_FORGE_PACKAGEID, RELEASE_NAME, file])
39
- end
40
- end
18
+ Bundler::GemHelper.install_tasks
41
19
 
20
+ desc "Run all tests"
42
21
  task :test => [:markdown_span_tests, :markdown_block_tests]
43
22
 
23
+ desc "Run block-level tests"
44
24
  task :markdown_block_tests do
45
- tests = Dir['tests/unittest/**/*.md'].join(' ')
46
- puts "Executing tests #{tests}"
47
- # ok = marutest(tests)
48
- ok = system "ruby -Ilib bin/marutest #{tests}"
49
- raise "Failed block unittest" if not ok
25
+ tests = Dir['tests/unittest/**/*.md'].join(' ')
26
+ puts "Executing tests #{tests}"
27
+ ok = system "ruby -Ilib bin/marutest #{tests}"
28
+ raise "Failed block unittest" if not ok
50
29
  end
51
30
 
31
+ desc "Run span-level tests"
52
32
  task :markdown_span_tests do
53
- ok = system( "ruby -Ilib lib/maruku/tests/new_parser.rb v b")
54
- raise "Failed span unittest" if not ok
33
+ ok = system( "ruby -Ilib lib/maruku/tests/new_parser.rb v b")
34
+ raise "Failed span unittest" if not ok
55
35
  end
56
36
 
57
- require 'rake/rdoctask'
58
-
59
37
  Rake::RDocTask.new do |rdoc|
60
- files = [#'README', 'LICENSE', 'COPYING',
61
- 'lib/**/*.rb',
62
- 'rdoc/*.rdoc'#, 'test/*.rb'
63
- ]
64
- rdoc.rdoc_files.add(files)
65
- rdoc.main = "rdoc/main.rdoc" # page to start on
66
- rdoc.title = "Maruku Documentation"
67
- rdoc.template = "jamis.rb"
68
- rdoc.rdoc_dir = 'doc' # rdoc output folder
69
- rdoc.options << '--line-numbers' << '--inline-source'
38
+ files = [#'README', 'LICENSE', 'COPYING',
39
+ 'lib/**/*.rb',
40
+ 'rdoc/*.rdoc'#, 'test/*.rb'
41
+ ]
42
+ rdoc.rdoc_files.add(files)
43
+ rdoc.main = "rdoc/main.rdoc" # page to start on
44
+ rdoc.title = "Maruku Documentation"
45
+ rdoc.template = "jamis.rb"
46
+ rdoc.rdoc_dir = 'doc' # rdoc output folder
47
+ rdoc.options << '--line-numbers' << '--inline-source'
70
48
  end
71
-
72
-
73
-
@@ -18,10 +18,6 @@
18
18
  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
19
  #++
20
20
 
21
-
22
- require 'iconv'
23
-
24
-
25
21
  module MaRuKu; module In; module Markdown; module BlockLevelParser
26
22
 
27
23
  def parse_doc(s)
@@ -39,21 +35,23 @@ Summary: Encoding for the document.
39
35
 
40
36
  If the `encoding` attribute is specified, then the content
41
37
  will be converted from the specified encoding to UTF-8.
42
-
43
- Conversion happens using the `iconv` library.
44
38
  =end
45
39
 
46
40
  enc = self.attributes[:encoding]
47
41
  self.attributes.delete :encoding
48
42
  if enc && enc.downcase != 'utf-8'
49
- converted = Iconv.new('utf-8', enc).iconv(data)
50
-
51
- # puts "Data: #{data.inspect}: #{data}"
52
- # puts "Conv: #{converted.inspect}: #{converted}"
53
-
54
- data = converted
43
+
44
+ # Switch to ruby 1.9 String#encode
45
+ # with backward 1.8 compatibility
46
+ if data.respond_to?(:encode!)
47
+ data.encode!('UTF-8', enc)
48
+ else
49
+ require 'iconv'
50
+ data = Iconv.new('utf-8', enc).iconv(data)
51
+ end
52
+
55
53
  end
56
-
54
+
57
55
  @children = parse_text_as_markdown(data)
58
56
 
59
57
  if true #markdown_extra?
@@ -19,9 +19,9 @@
19
19
  #++
20
20
 
21
21
  module MaRuKu
22
- Version = '0.6.0'
22
+ Version = '0.6.1'
23
23
 
24
- MarukuURL = 'http://maruku.rubyforge.org/'
24
+ MarukuURL = 'http://github.com/bhollis/maruku/'
25
25
 
26
26
  # If true, use also PHP Markdown extra syntax
27
27
  #
File without changes
File without changes
metadata CHANGED
@@ -1,28 +1,76 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maruku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ hash: 5
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 6
9
+ - 1
10
+ version: 0.6.1
5
11
  platform: ruby
6
12
  authors:
7
13
  - Andrea Censi
14
+ - Nathan Weizenbaum
8
15
  autorequire: maruku
9
16
  bindir: bin
10
17
  cert_chain: []
11
18
 
12
- date: 2009-05-04 00:00:00 -07:00
13
- default_executable:
19
+ date: 2012-09-16 00:00:00 Z
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
- name: syntax
17
- version_requirement:
18
- version_requirements: !ruby/object:Gem::Requirement
22
+ version_requirements: &id001 !ruby/object:Gem::Requirement
23
+ none: false
19
24
  requirements:
20
25
  - - ">="
21
26
  - !ruby/object:Gem::Version
27
+ hash: 23
28
+ segments:
29
+ - 1
30
+ - 0
31
+ - 0
32
+ version: 1.0.0
33
+ prerelease: false
34
+ requirement: *id001
35
+ name: syntax
36
+ type: :runtime
37
+ - !ruby/object:Gem::Dependency
38
+ version_requirements: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ hash: 23
44
+ segments:
45
+ - 1
46
+ - 0
47
+ - 0
22
48
  version: 1.0.0
23
- version:
24
- description: Maruku is a Markdown interpreter in Ruby. It features native export to HTML and PDF (via Latex). The output is really beautiful!
25
- email: andrea@rubyforge.org
49
+ prerelease: false
50
+ requirement: *id002
51
+ name: syntax
52
+ type: :development
53
+ - !ruby/object:Gem::Dependency
54
+ version_requirements: &id003 !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ~>
58
+ - !ruby/object:Gem::Version
59
+ hash: 63
60
+ segments:
61
+ - 0
62
+ - 9
63
+ - 2
64
+ version: 0.9.2
65
+ prerelease: false
66
+ requirement: *id003
67
+ name: rake
68
+ type: :development
69
+ description: "Maruku is a Markdown interpreter in Ruby.\n\
70
+ \tIt features native export to HTML and PDF (via Latex). The\n\
71
+ \toutput is really beautiful!\n\
72
+ \t"
73
+ email: ben@benhollis.net
26
74
  executables:
27
75
  - maruku
28
76
  - marutex
@@ -146,7 +194,6 @@ files:
146
194
  - tests/unittest/extra_header_id.md
147
195
  - tests/unittest/extra_table1.md
148
196
  - tests/unittest/footnotes.md
149
- - tests/unittest/hang.md
150
197
  - tests/unittest/headers.md
151
198
  - tests/unittest/hex_entities.md
152
199
  - tests/unittest/hrule.md
@@ -220,32 +267,38 @@ files:
220
267
  - unit_test_block.sh
221
268
  - unit_test_span.sh
222
269
  - Rakefile
223
- - maruku_gem.rb
224
- has_rdoc: false
225
- homepage: http://maruku.rubyforge.org
270
+ homepage: http://github.com/bhollis/maruku
271
+ licenses:
272
+ - GPL-2
226
273
  post_install_message:
227
274
  rdoc_options: []
228
275
 
229
276
  require_paths:
230
277
  - lib
231
278
  required_ruby_version: !ruby/object:Gem::Requirement
279
+ none: false
232
280
  requirements:
233
281
  - - ">="
234
282
  - !ruby/object:Gem::Version
283
+ hash: 3
284
+ segments:
285
+ - 0
235
286
  version: "0"
236
- version:
237
287
  required_rubygems_version: !ruby/object:Gem::Requirement
288
+ none: false
238
289
  requirements:
239
290
  - - ">="
240
291
  - !ruby/object:Gem::Version
292
+ hash: 3
293
+ segments:
294
+ - 0
241
295
  version: "0"
242
- version:
243
296
  requirements: []
244
297
 
245
298
  rubyforge_project:
246
- rubygems_version: 1.0.1
299
+ rubygems_version: 1.8.11
247
300
  signing_key:
248
- specification_version: 2
301
+ specification_version: 3
249
302
  summary: Maruku is a Markdown-superset interpreter written in Ruby.
250
303
  test_files: []
251
304
 
@@ -1,33 +0,0 @@
1
-
2
- require 'lib/maruku/version'
3
-
4
- $spec = Gem::Specification.new do |s|
5
- s.name = 'maruku'
6
- s.version = MaRuKu::Version
7
- s.summary = "Maruku is a Markdown-superset interpreter written in Ruby."
8
- s.description = %{Maruku is a Markdown interpreter in Ruby.
9
- It features native export to HTML and PDF (via Latex). The
10
- output is really beautiful!
11
- }
12
- s.files = Dir['lib/**/*.rb'] + Dir['lib/*.rb'] +
13
- Dir['docs/*.md'] + Dir['docs/*.html'] +
14
- Dir['tests/**/*.md'] +
15
- Dir['bin/*'] + Dir['*.sh'] + ['Rakefile', 'maruku_gem.rb']
16
-
17
- s.bindir = 'bin'
18
- s.executables = ['maruku','marutex']
19
-
20
- s.require_path = 'lib'
21
- s.autorequire = 'maruku'
22
-
23
- s.add_dependency('syntax', '>= 1.0.0')
24
-
25
- s.author = "Andrea Censi"
26
- s.email = "andrea@rubyforge.org"
27
- s.homepage = "http://maruku.rubyforge.org"
28
- end
29
-
30
- # s.has_rdoc = true
31
- # s.extra_rdoc_files = Dir['[A-Z]*']
32
- # s.rdoc_options << '--title' << 'Builder -- Easy XML Building'
33
-
@@ -1,29 +0,0 @@
1
- Write a comment here
2
- *** Parameters: ***
3
- {} # params
4
- *** Markdown input: ***
5
- deded {.num_defn #IsbellDuality
6
-
7
-
8
- *** Output of inspect ***
9
- md_el(:document,[md_par(["deded"])],{},[])
10
- *** Output of to_html ***
11
- <p>deded</p>
12
- *** Output of to_latex ***
13
- deded
14
- *** Output of to_md ***
15
- deded
16
- *** Output of to_s ***
17
- deded
18
- *** EOF ***
19
-
20
-
21
-
22
- OK!
23
-
24
-
25
-
26
- *** Output of Markdown.pl ***
27
- (not used anymore)
28
- *** Output of Markdown.pl (parsed) ***
29
- (not used anymore)