snippr 0.17.0 → 0.17.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/lib/snippr/processor/dynamics.rb +1 -1
- data/lib/snippr/segment_filter/on_rails_env.rb +1 -1
- data/snippr.gemspec +2 -2
- data/spec/snippr/processor/dynamics_spec.rb +6 -0
- data/spec/snippr/tardis_spec.rb +1 -1
- data/spec/snippr/view_helper_spec.rb +4 -4
- data/spec/spec_helper.rb +1 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b0412ad9e96ec997906ddaa1da46dc8142cb920
|
4
|
+
data.tar.gz: 30a0842a20254f14971ac2f683744a133140e7fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c99ee43f83d8f5866e3e67c0dbf1a480b8c2769b976a61cea091c3056bb5f5d0d41114dbf2356de60d3f91d474045415dc280ecd045356a9005e0c80fa0c7c3
|
7
|
+
data.tar.gz: d2491e2bbb50288a763bc61135ac162e834a22aac9f56764c8e495287229e16a7aa1966b7f6fa3a071172b3ef782e854e9b200a22e7955b1c94ff6f77becd40c
|
data/.gitignore
CHANGED
@@ -18,7 +18,7 @@ module Snippr
|
|
18
18
|
method = $3
|
19
19
|
safety = $6
|
20
20
|
if $3 && (value.respond_to?($3) || $2 == "!")
|
21
|
-
params = recursive_process(($4 || "").gsub(/[\t\r\n]/,""), opts).split("\",\"")
|
21
|
+
params = recursive_process(($4 || "").gsub(/[\t\r\n]/,""), opts).gsub(/"\s*,\s*"/,'","').split("\",\"")
|
22
22
|
replacement = value.send(method, *params).to_s
|
23
23
|
elsif $3
|
24
24
|
replacement = match
|
data/snippr.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = "snippr"
|
4
|
-
s.version = '0.17.
|
4
|
+
s.version = '0.17.2'
|
5
5
|
s.date = Time.now
|
6
6
|
s.platform = Gem::Platform::RUBY
|
7
7
|
s.authors = ["Daniel Harrington", "Thomas Jachmann", "Frank Schumacher"]
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.add_runtime_dependency "activesupport"
|
18
18
|
|
19
19
|
s.add_development_dependency "ci_reporter", "~> 1.6.5"
|
20
|
-
s.add_development_dependency "rspec", "~>
|
20
|
+
s.add_development_dependency "rspec", "~> 3.4"
|
21
21
|
s.add_development_dependency "rake", "~> 10.0"
|
22
22
|
|
23
23
|
unless ENV["CI"]
|
@@ -8,6 +8,7 @@ describe Snippr::Processor::Dynamics do
|
|
8
8
|
def method2(param); "METHOD WITH #{param}"; end
|
9
9
|
def method3(param1, param2); "METHOD WITH #{param1} AND #{param2}"; end
|
10
10
|
def method4; ""; end
|
11
|
+
def method5(param1, param2, param3); "METHOD WITH #{param1} AND #{param2} AND #{param3}"; end
|
11
12
|
end
|
12
13
|
|
13
14
|
it "replaces placeholders with dynamic values" do
|
@@ -48,6 +49,11 @@ describe Snippr::Processor::Dynamics do
|
|
48
49
|
expect(subject.process(tpl, :var => Klass.new)).to eq("An instance METHOD WITH PARAMETER1 AND PARAMETER2")
|
49
50
|
end
|
50
51
|
|
52
|
+
it "allows calling methods with multiple parameters on placeholders unevently spaced" do
|
53
|
+
tpl = 'An instance {var.method5("PARAMETER1", "PARAMETER2", "PARAMETER3")}'
|
54
|
+
expect(subject.process(tpl, :var => Klass.new)).to eq("An instance METHOD WITH PARAMETER1 AND PARAMETER2 AND PARAMETER3")
|
55
|
+
end
|
56
|
+
|
51
57
|
it "keeps the {snip} if calling a method but the method is not defined" do
|
52
58
|
expect(subject.process("An instance {var.method_not_exist()}", :var => Klass.new)).to eq("An instance {var.method_not_exist()}")
|
53
59
|
end
|
data/spec/snippr/tardis_spec.rb
CHANGED
@@ -29,22 +29,22 @@ describe Snippr::ViewHelper do
|
|
29
29
|
context "existing snippet" do
|
30
30
|
|
31
31
|
it "returns true when calling .exists?" do
|
32
|
-
expect(snippr(:home).exists?).to
|
32
|
+
expect(snippr(:home).exists?).to eq true
|
33
33
|
end
|
34
34
|
|
35
35
|
it "returns false when calling .missing?" do
|
36
|
-
expect(snippr(:home).missing?).to
|
36
|
+
expect(snippr(:home).missing?).to eq false
|
37
37
|
end
|
38
38
|
|
39
39
|
end
|
40
40
|
|
41
41
|
context "missing snippet" do
|
42
42
|
it "returns false when calling .exists?" do
|
43
|
-
expect(snippr(:missing).exists?).to
|
43
|
+
expect(snippr(:missing).exists?).to eq false
|
44
44
|
end
|
45
45
|
|
46
46
|
it "returns true when calling .missing?" do
|
47
|
-
expect(snippr(:missing).missing?).to
|
47
|
+
expect(snippr(:missing).missing?).to eq true
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
data/spec/spec_helper.rb
CHANGED
@@ -8,6 +8,7 @@ Bundler.require(:default, :development)
|
|
8
8
|
I18n.enforce_available_locales = false
|
9
9
|
|
10
10
|
RSpec.configure do |config|
|
11
|
+
config.example_status_persistence_file_path = ".snippr-rspec-persistence.file"
|
11
12
|
config.before do
|
12
13
|
Snippr::I18n.enabled = nil
|
13
14
|
Snippr::Links.adjust_urls_except = nil
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snippr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Harrington
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2015-12-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: i18n
|
@@ -60,14 +60,14 @@ dependencies:
|
|
60
60
|
requirements:
|
61
61
|
- - "~>"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
63
|
+
version: '3.4'
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
68
|
- - "~>"
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version:
|
70
|
+
version: '3.4'
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: rake
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
@@ -224,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
224
224
|
version: '0'
|
225
225
|
requirements: []
|
226
226
|
rubyforge_project: snippr
|
227
|
-
rubygems_version: 2.
|
227
|
+
rubygems_version: 2.5.1
|
228
228
|
signing_key:
|
229
229
|
specification_version: 4
|
230
230
|
summary: File based content management
|