shortcode 0.3.1 → 0.3.2
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.
- data/Gemfile.lock +6 -1
- data/README.md +1 -1
- data/lib/shortcode.rb +5 -0
- data/lib/shortcode/configuration.rb +2 -2
- data/lib/shortcode/tag.rb +2 -0
- data/lib/shortcode/version.rb +1 -1
- data/shortcode.gemspec +1 -0
- data/spec/rails_helpers_spec.rb +16 -0
- data/spec/support/fixtures/rails_helper_output_slim.html +1 -0
- data/spec/support/templates/slim/rails_helper.html.slim +1 -0
- metadata +21 -1
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
shortcode (0.3.
|
4
|
+
shortcode (0.3.2)
|
5
5
|
haml (~> 4.0)
|
6
6
|
parslet (= 1.6.0)
|
7
7
|
|
@@ -43,6 +43,10 @@ GEM
|
|
43
43
|
multi_json
|
44
44
|
simplecov-html (~> 0.8.0)
|
45
45
|
simplecov-html (0.8.0)
|
46
|
+
slim (2.0.2)
|
47
|
+
temple (~> 0.6.6)
|
48
|
+
tilt (>= 1.3.3, < 2.1)
|
49
|
+
temple (0.6.7)
|
46
50
|
term-ansicolor (1.3.0)
|
47
51
|
tins (~> 1.0)
|
48
52
|
thor (0.18.1)
|
@@ -59,3 +63,4 @@ DEPENDENCIES
|
|
59
63
|
rake
|
60
64
|
rspec
|
61
65
|
shortcode!
|
66
|
+
slim (~> 2.0)
|
data/README.md
CHANGED
@@ -46,7 +46,7 @@ Shortcode.process("[quote]Hello World[/quote]")
|
|
46
46
|
Shortcode.setup do |config|
|
47
47
|
|
48
48
|
# the template parser to use
|
49
|
-
config.template_parser = :haml # :erb
|
49
|
+
config.template_parser = :haml # :erb, :haml, :slim supported, :haml is default
|
50
50
|
|
51
51
|
# location of the template files, default is "app/views/shortcode_templates"
|
52
52
|
config.template_path = "support/templates/haml"
|
data/lib/shortcode.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
class Shortcode::Configuration
|
2
|
-
# Sets the template parser to use, supports :erb and :
|
2
|
+
# Sets the template parser to use, supports :erb, :haml, and :slim, default is :haml
|
3
3
|
attr_accessor :template_parser
|
4
4
|
|
5
|
-
# Sets the
|
5
|
+
# Sets the path to search for template files
|
6
6
|
attr_accessor :template_path
|
7
7
|
|
8
8
|
# Allows templates to be set from strings rather than read from the filesystem
|
data/lib/shortcode/tag.rb
CHANGED
data/lib/shortcode/version.rb
CHANGED
data/shortcode.gemspec
CHANGED
data/spec/rails_helpers_spec.rb
CHANGED
@@ -3,9 +3,25 @@ require 'spec_helper'
|
|
3
3
|
describe "rails helpers" do
|
4
4
|
|
5
5
|
let(:template) { load_fixture :rails_helper }
|
6
|
+
let(:slim_output) { load_fixture :rails_helper_output_slim, :html }
|
6
7
|
let(:haml_output) { load_fixture :rails_helper_output_haml, :html }
|
7
8
|
let(:erb_output) { load_fixture :rails_helper_output_erb, :html }
|
8
9
|
|
10
|
+
describe "slim" do
|
11
|
+
|
12
|
+
before(:each) do
|
13
|
+
Shortcode.setup do |config|
|
14
|
+
config.template_parser = :slim
|
15
|
+
config.template_path = File.join File.dirname(__FILE__), "support/templates/slim"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
it "are accessible within slim templates" do
|
20
|
+
Shortcode.process(template).gsub("\n",'').should == slim_output.gsub("\n",'')
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
9
25
|
describe "haml" do
|
10
26
|
|
11
27
|
it "are accessible within haml templates" do
|
@@ -0,0 +1 @@
|
|
1
|
+
<i>blah</i>
|
@@ -0,0 +1 @@
|
|
1
|
+
= content_tag :i, @content
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shortcode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -107,6 +107,22 @@ dependencies:
|
|
107
107
|
- - ! '>='
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: slim
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '2.0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '2.0'
|
110
126
|
description: Gem for parsing wordpress style shortcodes
|
111
127
|
email:
|
112
128
|
- jamie@kernowsoul.com
|
@@ -156,6 +172,7 @@ files:
|
|
156
172
|
- spec/support/fixtures/rails_helper.txt
|
157
173
|
- spec/support/fixtures/rails_helper_output_erb.html
|
158
174
|
- spec/support/fixtures/rails_helper_output_haml.html
|
175
|
+
- spec/support/fixtures/rails_helper_output_slim.html
|
159
176
|
- spec/support/fixtures/simple_list.txt
|
160
177
|
- spec/support/fixtures/simple_list_output.html
|
161
178
|
- spec/support/fixtures/simple_quote.txt
|
@@ -177,6 +194,7 @@ files:
|
|
177
194
|
- spec/support/templates/haml/timeline_event.html.haml
|
178
195
|
- spec/support/templates/haml/timeline_info.html.haml
|
179
196
|
- spec/support/templates/haml/timeline_person.html.haml
|
197
|
+
- spec/support/templates/slim/rails_helper.html.slim
|
180
198
|
- spec/tag_spec.rb
|
181
199
|
- spec/transformer_spec.rb
|
182
200
|
homepage: https://github.com/kernow/shortcode
|
@@ -222,6 +240,7 @@ test_files:
|
|
222
240
|
- spec/support/fixtures/rails_helper.txt
|
223
241
|
- spec/support/fixtures/rails_helper_output_erb.html
|
224
242
|
- spec/support/fixtures/rails_helper_output_haml.html
|
243
|
+
- spec/support/fixtures/rails_helper_output_slim.html
|
225
244
|
- spec/support/fixtures/simple_list.txt
|
226
245
|
- spec/support/fixtures/simple_list_output.html
|
227
246
|
- spec/support/fixtures/simple_quote.txt
|
@@ -243,5 +262,6 @@ test_files:
|
|
243
262
|
- spec/support/templates/haml/timeline_event.html.haml
|
244
263
|
- spec/support/templates/haml/timeline_info.html.haml
|
245
264
|
- spec/support/templates/haml/timeline_person.html.haml
|
265
|
+
- spec/support/templates/slim/rails_helper.html.slim
|
246
266
|
- spec/tag_spec.rb
|
247
267
|
- spec/transformer_spec.rb
|