styledown 1.0.1.pre.0 → 1.0.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 +4 -4
- data/Gemfile.lock +18 -0
- data/History.md +13 -4
- data/Rakefile +3 -3
- data/Readme.md +8 -5
- data/lib/styledown.rb +3 -5
- data/lib/styledown/version.rb +1 -1
- data/styledown.gemspec +1 -0
- data/test/test.rb +11 -11
- data/test/test_helper.rb +3 -3
- metadata +20 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df06c86182e53d5b03ec55520225440e2073a516
|
4
|
+
data.tar.gz: 9c75d127f8cb337b804c4c8751c7af4b07c7b2e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01f58d60d4c26115fcf7e2f4386284236d947f57eb8c9a8f0b1c5f34e423ec77028a94104af24857421defb3537c5129bce0973c0ca9ae1d06e26e7e987ce056
|
7
|
+
data.tar.gz: be86c407612e46adf0c621f59c452c905337814fdc523c0b7c6a2406b74c55e3572ea09e5b4f01df0313929ed1b6229c7622e526ebd92507916afedb2e3138f9
|
data/Gemfile.lock
ADDED
data/History.md
CHANGED
@@ -1,8 +1,17 @@
|
|
1
|
-
## v1.0.1
|
1
|
+
## [v1.0.1]
|
2
|
+
> Apr 19, 2016
|
2
3
|
|
3
|
-
|
4
|
-
* Add support for `Styledown.parse(array of files)`.
|
4
|
+
- Release as a non-prerelease-version. No functional changes.
|
5
5
|
|
6
|
-
|
6
|
+
[v1.0.1]: https://github.com/styledown/styledown-rails/compare/v1.0.1.pre.0...v1.0.1
|
7
|
+
|
8
|
+
## v1.0.1.pre.0
|
9
|
+
> September 5, 2014
|
10
|
+
|
11
|
+
- Update Styledown source to 1.0.1.
|
12
|
+
- Add support for `Styledown.parse(array of files)`.
|
13
|
+
|
14
|
+
## v0.7.0.pre.0
|
15
|
+
> September 1, 2014
|
7
16
|
|
8
17
|
Initial pre-release. No Rails integration, but plain Ruby integration works.
|
data/Rakefile
CHANGED
data/Readme.md
CHANGED
@@ -1,17 +1,20 @@
|
|
1
|
-
Styledown
|
2
|
-
|
1
|
+
Styledown
|
2
|
+
=========
|
3
3
|
|
4
4
|
Ruby integration of [Styledown].
|
5
5
|
|
6
|
-
*NB: This is a work in progress. Check back in a few weeks.*
|
7
6
|
|
8
|
-
|
7
|
+
[](https://travis-ci.org/styledown/styledown-rails "See test builds")
|
8
|
+
|
9
|
+
## Ruby integration
|
9
10
|
|
10
11
|
```rb
|
11
12
|
# Gemfile
|
12
13
|
gem 'styledown'
|
13
14
|
```
|
14
15
|
|
16
|
+
[](http://rubygems.org/gems/styledown "View this project in Rubygems")
|
17
|
+
|
15
18
|
## Plain Ruby integration
|
16
19
|
|
17
20
|
API for `Styledown.parse` is exactly the same as the JS version ([docs]).
|
@@ -49,5 +52,5 @@ Authored and maintained by Rico Sta. Cruz with help from [contributors].
|
|
49
52
|
> Twitter [@rstacruz](https://twitter.com/rstacruz)
|
50
53
|
|
51
54
|
[MIT License]: http://mit-license.org/
|
52
|
-
[contributors]: http://github.com/styledown/styledown-
|
55
|
+
[contributors]: http://github.com/styledown/styledown-rails/contributors
|
53
56
|
[Styledown]: https://github.com/styledown/styledown
|
data/lib/styledown.rb
CHANGED
@@ -12,10 +12,8 @@ module Styledown
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
def parse(source, options={})
|
16
|
-
if array_of_filenames?(source)
|
17
|
-
source = unpack_files(source)
|
18
|
-
end
|
15
|
+
def parse(source, options = {})
|
16
|
+
source = unpack_files(source) if array_of_filenames?(source)
|
19
17
|
|
20
18
|
context.call('Styledown.parse', source, options)
|
21
19
|
end
|
@@ -24,7 +22,7 @@ module Styledown
|
|
24
22
|
context.eval('Styledown.version')
|
25
23
|
end
|
26
24
|
|
27
|
-
private
|
25
|
+
private
|
28
26
|
|
29
27
|
def unpack_files(source)
|
30
28
|
source.map { |file| { name: file, data: File.read(file) } }
|
data/lib/styledown/version.rb
CHANGED
data/styledown.gemspec
CHANGED
data/test/test.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
require File.expand_path('../test_helper', __FILE__)
|
2
2
|
|
3
|
-
describe
|
4
|
-
it
|
3
|
+
describe 'Styledown.js_version' do
|
4
|
+
it 'produces a string' do
|
5
5
|
Styledown.js_version.must_match /^\d+\.\d+\.\d+/
|
6
6
|
end
|
7
7
|
end
|
8
8
|
|
9
|
-
describe
|
9
|
+
describe 'Basic parsing' do
|
10
10
|
before do
|
11
11
|
@output = Styledown.parse('### hi')
|
12
12
|
end
|
13
13
|
|
14
|
-
it
|
14
|
+
it 'produces an HTML fragment' do
|
15
15
|
@output.must_match /<h3[^>]+>hi<\/h3>/
|
16
16
|
end
|
17
17
|
|
@@ -20,19 +20,19 @@ describe "Basic parsing" do
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
describe
|
23
|
+
describe 'Working with many files' do
|
24
24
|
before do
|
25
25
|
@output = Styledown.parse([
|
26
|
-
{ :
|
27
|
-
{ :
|
26
|
+
{ name: 'input.md', data: '### hi from md' },
|
27
|
+
{ name: 'input.css', data: "/**\n * hi from css:\n * world\n */" }
|
28
28
|
])
|
29
29
|
end
|
30
30
|
|
31
|
-
it
|
31
|
+
it 'parses the Markdown file' do
|
32
32
|
@output.must_match /<h3[^>]+>hi from md<\/h3>/
|
33
33
|
end
|
34
34
|
|
35
|
-
it
|
35
|
+
it 'parses the CSS file' do
|
36
36
|
@output.must_match /<h3[^>]+>hi from css<\/h3>/
|
37
37
|
end
|
38
38
|
end
|
@@ -42,11 +42,11 @@ describe 'head options' do
|
|
42
42
|
@output = Styledown.parse('### hi', head: '<meta>')
|
43
43
|
end
|
44
44
|
|
45
|
-
it
|
45
|
+
it 'includes the head text' do
|
46
46
|
@output.must_match /<meta>/
|
47
47
|
end
|
48
48
|
|
49
|
-
it
|
49
|
+
it 'produces an HTML document' do
|
50
50
|
@output.must_match /^<!doctype html>/
|
51
51
|
end
|
52
52
|
end
|
data/test/test_helper.rb
CHANGED
@@ -4,17 +4,17 @@ require './lib/styledown'
|
|
4
4
|
begin
|
5
5
|
require 'minitest/reporters'
|
6
6
|
if ENV['reporter'] == 'spec'
|
7
|
-
Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new(:
|
7
|
+
Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new(color: true)
|
8
8
|
else
|
9
9
|
Minitest::Reporters.use! Minitest::Reporters::ProgressReporter.new
|
10
10
|
end
|
11
11
|
rescue LoadError => e
|
12
12
|
end
|
13
13
|
|
14
|
-
def test_path(path='')
|
14
|
+
def test_path(path = '')
|
15
15
|
File.expand_path("../#{path}", __FILE__)
|
16
16
|
end
|
17
17
|
|
18
|
-
def fixture_path(path='')
|
18
|
+
def fixture_path(path = '')
|
19
19
|
test_path "fixtures/#{path}"
|
20
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: styledown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.1
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rico Sta. Cruz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: execjs
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
description:
|
28
42
|
email: hi@ricostacruz.com
|
29
43
|
executables: []
|
@@ -36,6 +50,7 @@ files:
|
|
36
50
|
- ".gitignore"
|
37
51
|
- ".travis.yml"
|
38
52
|
- Gemfile
|
53
|
+
- Gemfile.lock
|
39
54
|
- History.md
|
40
55
|
- Notes.md
|
41
56
|
- Rakefile
|
@@ -64,12 +79,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
64
79
|
version: '0'
|
65
80
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
81
|
requirements:
|
67
|
-
- - "
|
82
|
+
- - ">="
|
68
83
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
84
|
+
version: '0'
|
70
85
|
requirements: []
|
71
86
|
rubyforge_project:
|
72
|
-
rubygems_version: 2.
|
87
|
+
rubygems_version: 2.5.1
|
73
88
|
signing_key:
|
74
89
|
specification_version: 4
|
75
90
|
summary: "..."
|