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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62a34d096d4e43ff626eb69835c161385d17286c
4
- data.tar.gz: 9471aec2a2e21590e4510bc1b8d648d0494c5622
3
+ metadata.gz: 9b0412ad9e96ec997906ddaa1da46dc8142cb920
4
+ data.tar.gz: 30a0842a20254f14971ac2f683744a133140e7fa
5
5
  SHA512:
6
- metadata.gz: 429bbb9e104d98c08e81508c9475d7f5921ab20f4c10cd5e58792c63cd58c61181c08744ac632ca0211045d6027feb6f0b985920bfb3c68d6e45e9727df7811d
7
- data.tar.gz: 23d835aea3caae6e78c520ab631019a3f99e74c2e57e0704da39d73c598e4f115a7aa436e626145d1883e47210f3bc42bbad0acb1a7aa471f69761493e447b5b
6
+ metadata.gz: 5c99ee43f83d8f5866e3e67c0dbf1a480b8c2769b976a61cea091c3056bb5f5d0d41114dbf2356de60d3f91d474045415dc280ecd045356a9005e0c80fa0c7c3
7
+ data.tar.gz: d2491e2bbb50288a763bc61135ac162e834a22aac9f56764c8e495287229e16a7aa1966b7f6fa3a071172b3ef782e854e9b200a22e7955b1c94ff6f77becd40c
data/.gitignore CHANGED
@@ -11,4 +11,5 @@ coverage
11
11
  spec/reports
12
12
  Gemfile.lock
13
13
  .rvmrc
14
- .ruby-version
14
+ .ruby-version
15
+ .snippr-rspec-persistence.file
@@ -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
@@ -13,7 +13,7 @@ module Snippr
13
13
  private
14
14
 
15
15
  def in_env?
16
- sources.include?(Rails.env)
16
+ sources.include?(::Rails.env)
17
17
  end
18
18
 
19
19
  def sources
@@ -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.0'
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", "~> 2.14.0"
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
@@ -10,7 +10,7 @@ describe Snippr::Tardis do
10
10
 
11
11
  it "accepts simple values" do
12
12
  Snippr::Tardis.enabled = "truthy"
13
- expect(Snippr::Tardis.enabled).to be_true
13
+ expect(Snippr::Tardis.enabled).to eq true
14
14
  end
15
15
  end
16
16
  end
@@ -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 be_true
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 be_false
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 be_false
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 be_true
47
+ expect(snippr(:missing).missing?).to eq true
48
48
  end
49
49
  end
50
50
 
@@ -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.0
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: 2014-08-26 00:00:00.000000000 Z
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: 2.14.0
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: 2.14.0
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.4.1
227
+ rubygems_version: 2.5.1
228
228
  signing_key:
229
229
  specification_version: 4
230
230
  summary: File based content management