cutaneous 0.2.0 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d90ff3764cf47bc3c932b85e5d9833adbb86edcb
4
- data.tar.gz: a996afd411cb3e846cd1237c13b49a9ef4e99e17
3
+ metadata.gz: 25303ab563759f3b74896f8bb3fc8e5617c30fb7
4
+ data.tar.gz: d0151644bb6d3d113a01e0136b3d2fc17723fc71
5
5
  SHA512:
6
- metadata.gz: a01dd50c0274e1fd17d7913d48b0e52913842fbc8ed479442356ff17e83aec31112ae93041b68e47c3c6e4d268f7f33d69c5d4c7975ec6305ee2a5f54abec298
7
- data.tar.gz: 8e94956de888f9b8a12a5494245dfc3e242ef33e5ebdf0fd4c61dd443c59a2eb90163fd2890a3fe4e7e188d6a2bda97fd5e664ed7cc4a4d7da0263dbcb660868
6
+ metadata.gz: 8d8b579189959a783225dc50a5acec4203bcdeec9ed9019a12702ce35a3d08b2b03505e9a79c4f054d106d5caaba852c762b68cdae2251661d0b313192894cbd
7
+ data.tar.gz: 2db1354cc968d5c8799817f301d6cd26635a898cc55b6e0d9f11121135d0ae198637a4870a94deb7db1699fb3331af2eca5ca7fb253007a88279126eb24e3131
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
@@ -14,8 +14,8 @@ Gem::Specification.new do |s|
14
14
  ## If your rubyforge_project name is different, then edit it and comment out
15
15
  ## the sub! line in the Rakefile
16
16
  s.name = 'cutaneous'
17
- s.version = '0.2.0'
18
- s.date = '2014-01-29'
17
+ s.version = '0.3.0'
18
+ s.date = '2016-08-16'
19
19
  s.rubyforge_project = 'cutaneous'
20
20
 
21
21
  ## Make sure your summary is short. The description may be as long
@@ -50,7 +50,7 @@ Gem::Specification.new do |s|
50
50
 
51
51
  ## List your development dependencies here. Development dependencies are
52
52
  ## those that are only needed during development
53
- # s.add_development_dependency('DEVDEPNAME', [">= 1.1.0", "< 2.0.0"])
53
+ s.add_development_dependency('minitest', ['~> 4.7.0'])
54
54
 
55
55
  ## Leave this section as-is. It will be automatically generated from the
56
56
  ## contents of your Git repository via the gemspec task. DO NOT REMOVE
@@ -7,7 +7,7 @@ require 'cutaneous/lexer'
7
7
  require 'cutaneous/compiler'
8
8
 
9
9
  module Cutaneous
10
- VERSION = "0.2.0"
10
+ VERSION = "0.3.0"
11
11
 
12
12
  class CompilationError < Exception; end
13
13
 
@@ -6,7 +6,7 @@ module Cutaneous
6
6
  end
7
7
 
8
8
  def to_script
9
- %{__buf << __decode_params((} << @expression << %{)) ; }
9
+ %{__buf << __decode_params((} << @expression << %{)).to_s ; }
10
10
  end
11
11
 
12
12
  def affect(builder)
@@ -16,7 +16,7 @@ module Cutaneous
16
16
 
17
17
  class EscapedExpression < Expression
18
18
  def to_script
19
- %{__buf << escape(__decode_params((} << @expression << %{))) ; }
19
+ %{__buf << escape(__decode_params((} << @expression << %{)).to_s) ; }
20
20
  end
21
21
  end
22
22
 
@@ -39,8 +39,8 @@ module Cutaneous
39
39
 
40
40
  def path(template_name)
41
41
  filename = filename(template_name)
42
- return filename if ::File.exists?(filename) # Test for an absolute path
43
- @roots.map { |root| ::File.join(root, filename)}.detect { |path| ::File.exists?(path) }
42
+ return filename if ::File.exist?(filename) # Test for an absolute path
43
+ @roots.map { |root| ::File.join(root, filename)}.detect { |path| ::File.exist?(path) }
44
44
  end
45
45
 
46
46
  def filename(template_name)
@@ -49,7 +49,7 @@ module Cutaneous
49
49
 
50
50
  def exists?(template_root, template_name)
51
51
  path = ::File.join(template_root, filename(template_name))
52
- ::File.exists?(path)
52
+ ::File.exist?(path)
53
53
  end
54
54
 
55
55
  def location(template_root, template_name)
@@ -55,7 +55,7 @@ describe Cutaneous do
55
55
 
56
56
  # Ensure that the cached script file is being used by overwriting its contents
57
57
  path = template_path("c", "html", "rb")
58
- assert ::File.exists?(path), "Template cache should have created '#{path}'"
58
+ assert ::File.exist?(path), "Template cache should have created '#{path}'"
59
59
  File.open(path, "w") do |f|
60
60
  f.write("__buf << 'right'")
61
61
  end
@@ -78,7 +78,7 @@ describe Cutaneous do
78
78
 
79
79
  template_path = template_path("c", "html")
80
80
  script_path = template_path("c", "html", "rb")
81
- assert ::File.exists?(script_path), "Template cache should have created '#{script_path}'"
81
+ assert ::File.exist?(script_path), "Template cache should have created '#{script_path}'"
82
82
 
83
83
  File.open(template_path, "w") { |f| f.write("template") }
84
84
  File.utime(now, now, template_path)
@@ -99,7 +99,7 @@ describe Cutaneous do
99
99
 
100
100
  result1 = engine.render("c", context)
101
101
  script_path = template_path("c", "html", "rb")
102
- refute ::File.exists?(script_path), "Template cache should not have created '#{script_path}'"
102
+ refute ::File.exist?(script_path), "Template cache should not have created '#{script_path}'"
103
103
  end
104
104
 
105
105
  it "doesn't attempt to write a cached script for Proc templates" do
@@ -243,6 +243,10 @@ describe Cutaneous do
243
243
  refute engine.dynamic_template?("i am not dynamic")
244
244
  end
245
245
 
246
+ it "ignores escaped tags when testing for dynamic status" do
247
+ refute engine.dynamic_template?("i am not \\${dynamic}")
248
+ end
249
+
246
250
  it "Passes any instance variables & locals between contexts" do
247
251
  context = ContextHash(right: "left")
248
252
  result1 = engine.render("instance", context)
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cutaneous
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garry Hill
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-29 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2016-08-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: minitest
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 4.7.0
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 4.7.0
13
27
  description: Cutaneous is the Ruby templating language designed for use with Spontaneous
14
28
  CMS. It has a simple syntax but powerful features such as Djano style template inheritance
15
29
  through blocks.
@@ -71,22 +85,22 @@ licenses: []
71
85
  metadata: {}
72
86
  post_install_message:
73
87
  rdoc_options:
74
- - --charset=UTF-8
88
+ - "--charset=UTF-8"
75
89
  require_paths:
76
90
  - lib
77
91
  required_ruby_version: !ruby/object:Gem::Requirement
78
92
  requirements:
79
- - - '>='
93
+ - - ">="
80
94
  - !ruby/object:Gem::Version
81
95
  version: 1.9.3
82
96
  required_rubygems_version: !ruby/object:Gem::Requirement
83
97
  requirements:
84
- - - '>='
98
+ - - ">="
85
99
  - !ruby/object:Gem::Version
86
100
  version: '0'
87
101
  requirements: []
88
102
  rubyforge_project: cutaneous
89
- rubygems_version: 2.2.1
103
+ rubygems_version: 2.5.1
90
104
  signing_key:
91
105
  specification_version: 2
92
106
  summary: A Ruby templating language with Django style template inheritance