mustache-sinatra 1.0.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +3 -3
- data/.rspec +2 -0
- data/.travis.yml +7 -0
- data/CHANGELOG.md +16 -0
- data/README.md +2 -0
- data/Rakefile +4 -0
- data/lib/mustache/sinatra/helpers.rb +8 -3
- data/lib/mustache/sinatra/version.rb +1 -1
- data/mustache-sinatra.gemspec +5 -2
- data/spec/normal_usage_spec.rb +23 -0
- data/spec/spec_helper.rb +29 -0
- data/spec/views/index.mustache +1 -0
- data/spec/views/index.rb +5 -0
- data/spec/views/layout.mustache +3 -0
- data/spec/views/layout.rb +7 -0
- metadata +70 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 47c99137f09da5ce8d640527b22b66e0a01390eaea9076474e47a7a5f8cb01e8
|
4
|
+
data.tar.gz: 2045f17b01936692b85b25b1d44a5c3c0695cfa136eca077ecd0e5550e7b5342
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eadb2528f85b97e48f45dab9b3c7a518eb1bdd3d37c48f31098266ad597571f70cf9a272d747420c818b4c67e17ea2c168f1bab40ec3fbffb3329abe36ec207a
|
7
|
+
data.tar.gz: 4e8a7c6a5f7ad3ec55a23cc1a74d7d3e350330bd5e595195120fb98b1153f55845914a92334272b244bc13e6f3d6d8ff0098afb8328ae9b26d6e595284d45835
|
data/.gitignore
CHANGED
@@ -26,9 +26,9 @@ build/
|
|
26
26
|
|
27
27
|
# for a library or gem, you might want to ignore these files since the code is
|
28
28
|
# intended to run in multiple environments; otherwise, check them in:
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
Gemfile.lock
|
30
|
+
.ruby-version
|
31
|
+
.ruby-gemset
|
32
32
|
|
33
33
|
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
34
34
|
.rvmrc
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# v2.0.0, March 13 2023
|
2
|
+
|
3
|
+
- Require `mustache` v1.0 or higher. In retrospect this should have been a major release, as
|
4
|
+
there's bound to be many breaking changes.
|
5
|
+
|
6
|
+
# v1.0.2, March 12 2023 (YANKED)
|
7
|
+
|
8
|
+
- Require `mustache` v1.0 or higher
|
9
|
+
|
10
|
+
# v1.0.1, January 25 2015
|
11
|
+
|
12
|
+
- Library now requires `mustache`
|
13
|
+
|
14
|
+
# v1.0.0, December 2 2014
|
15
|
+
|
16
|
+
- First version extracted from `mustache` gem
|
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -88,7 +88,7 @@ class Mustache
|
|
88
88
|
options[:namespace] ||= self.class
|
89
89
|
|
90
90
|
unless options[:namespace].to_s.include? 'Views'
|
91
|
-
options[:namespace] = options[:namespace]
|
91
|
+
options[:namespace] = add_views_to_namespace(options[:namespace])
|
92
92
|
end
|
93
93
|
|
94
94
|
factory = Class.new(Mustache) do
|
@@ -143,7 +143,12 @@ class Mustache
|
|
143
143
|
klass.template_path = options[:templates] if options[:templates]
|
144
144
|
klass
|
145
145
|
end
|
146
|
-
end
|
147
146
|
|
147
|
+
def add_views_to_namespace(namespace)
|
148
|
+
namespace.const_get(:Views)
|
149
|
+
rescue NameError
|
150
|
+
namespace.const_set(:Views, Module.new)
|
151
|
+
end
|
152
|
+
end
|
148
153
|
end
|
149
|
-
end
|
154
|
+
end
|
data/mustache-sinatra.gemspec
CHANGED
@@ -18,8 +18,11 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
22
22
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
24
|
+
spec.add_development_dependency "rack-test", "~> 0.6"
|
25
|
+
spec.add_development_dependency "sinatra", "~> 1.4"
|
23
26
|
|
24
|
-
spec.add_dependency "mustache", "
|
27
|
+
spec.add_dependency "mustache", "~> 1.0"
|
25
28
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'mustache/sinatra'
|
2
|
+
|
3
|
+
RSpec.describe 'normal usage' do
|
4
|
+
let(:app) {
|
5
|
+
Class.new(Sinatra::Application) do
|
6
|
+
set :mustache, {
|
7
|
+
templates: 'views',
|
8
|
+
views: 'views',
|
9
|
+
namespace: Object
|
10
|
+
}
|
11
|
+
|
12
|
+
get '/' do
|
13
|
+
mustache :index
|
14
|
+
end
|
15
|
+
end
|
16
|
+
}
|
17
|
+
|
18
|
+
it 'looks up the template' do
|
19
|
+
get '/'
|
20
|
+
expect(last_response).to be_ok
|
21
|
+
expect(last_response.body).to eq("Around\nHello world\n\nAround\n")
|
22
|
+
end
|
23
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'rack/test'
|
2
|
+
require 'sinatra'
|
3
|
+
require_relative 'views/layout'
|
4
|
+
require_relative 'views/index'
|
5
|
+
|
6
|
+
RSpec.configure do |config|
|
7
|
+
config.expect_with :rspec do |expectations|
|
8
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
9
|
+
end
|
10
|
+
|
11
|
+
config.mock_with :rspec do |mocks|
|
12
|
+
mocks.verify_partial_doubles = true
|
13
|
+
end
|
14
|
+
|
15
|
+
config.filter_run :focus
|
16
|
+
config.run_all_when_everything_filtered = true
|
17
|
+
config.disable_monkey_patching!
|
18
|
+
config.warnings = true
|
19
|
+
config.profile_examples = 10
|
20
|
+
config.order = :random
|
21
|
+
Kernel.srand config.seed
|
22
|
+
config.include Rack::Test::Methods
|
23
|
+
|
24
|
+
if config.files_to_run.one?
|
25
|
+
config.default_formatter = 'doc'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
Dir.chdir('spec')
|
@@ -0,0 +1 @@
|
|
1
|
+
{{hello}}
|
data/spec/views/index.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mustache-sinatra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricardo Mendes
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.6'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,20 +38,62 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rack-test
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.6'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.6'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: sinatra
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.4'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.4'
|
41
83
|
- !ruby/object:Gem::Dependency
|
42
84
|
name: mustache
|
43
85
|
requirement: !ruby/object:Gem::Requirement
|
44
86
|
requirements:
|
45
|
-
- - "
|
87
|
+
- - "~>"
|
46
88
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0
|
89
|
+
version: '1.0'
|
48
90
|
type: :runtime
|
49
91
|
prerelease: false
|
50
92
|
version_requirements: !ruby/object:Gem::Requirement
|
51
93
|
requirements:
|
52
|
-
- - "
|
94
|
+
- - "~>"
|
53
95
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0
|
96
|
+
version: '1.0'
|
55
97
|
description: Mustache support for Sinatra applications
|
56
98
|
email:
|
57
99
|
- rokusu@gmail.com
|
@@ -60,6 +102,9 @@ extensions: []
|
|
60
102
|
extra_rdoc_files: []
|
61
103
|
files:
|
62
104
|
- ".gitignore"
|
105
|
+
- ".rspec"
|
106
|
+
- ".travis.yml"
|
107
|
+
- CHANGELOG.md
|
63
108
|
- Gemfile
|
64
109
|
- LICENSE
|
65
110
|
- LICENSE.txt
|
@@ -69,11 +114,17 @@ files:
|
|
69
114
|
- lib/mustache/sinatra/helpers.rb
|
70
115
|
- lib/mustache/sinatra/version.rb
|
71
116
|
- mustache-sinatra.gemspec
|
117
|
+
- spec/normal_usage_spec.rb
|
118
|
+
- spec/spec_helper.rb
|
119
|
+
- spec/views/index.mustache
|
120
|
+
- spec/views/index.rb
|
121
|
+
- spec/views/layout.mustache
|
122
|
+
- spec/views/layout.rb
|
72
123
|
homepage: https://github.com/mustache/mustache-sinatra
|
73
124
|
licenses:
|
74
125
|
- MIT
|
75
126
|
metadata: {}
|
76
|
-
post_install_message:
|
127
|
+
post_install_message:
|
77
128
|
rdoc_options: []
|
78
129
|
require_paths:
|
79
130
|
- lib
|
@@ -88,10 +139,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
139
|
- !ruby/object:Gem::Version
|
89
140
|
version: '0'
|
90
141
|
requirements: []
|
91
|
-
|
92
|
-
|
93
|
-
signing_key:
|
142
|
+
rubygems_version: 3.1.6
|
143
|
+
signing_key:
|
94
144
|
specification_version: 4
|
95
145
|
summary: Mustache support for Sinatra applications
|
96
|
-
test_files:
|
97
|
-
|
146
|
+
test_files:
|
147
|
+
- spec/normal_usage_spec.rb
|
148
|
+
- spec/spec_helper.rb
|
149
|
+
- spec/views/index.mustache
|
150
|
+
- spec/views/index.rb
|
151
|
+
- spec/views/layout.mustache
|
152
|
+
- spec/views/layout.rb
|