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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0a10facd8c6cb6543e7a19ba8c8b5881b5af1907
4
- data.tar.gz: c53a8137cd6dc6512b40aac096cb87e94bece9eb
2
+ SHA256:
3
+ metadata.gz: 47c99137f09da5ce8d640527b22b66e0a01390eaea9076474e47a7a5f8cb01e8
4
+ data.tar.gz: 2045f17b01936692b85b25b1d44a5c3c0695cfa136eca077ecd0e5550e7b5342
5
5
  SHA512:
6
- metadata.gz: 4fff4466c64df75740c7ffd5c45e9fc6cf76386f5f0724801292d8426e75be987bf0a931ec3b5e36b408c5acc6b1bc717a523a56bd50a4be679f8c2604535b00
7
- data.tar.gz: 05be9a0162b4f93588bdd79a52220decc4c057ce36aad1819f1260800dfdce3a367506c2455a234f8c3ff7351714c2a134aadfd1a4f390b799ad745b9489fa69
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
- # Gemfile.lock
30
- # .ruby-version
31
- # .ruby-gemset
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
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 2.1.0
5
+ - 2.2.0
6
+ - jruby-head
7
+ - rbx-2
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
@@ -1,5 +1,7 @@
1
1
  # Mustache::Sinatra
2
2
 
3
+ [![Build Status](https://travis-ci.org/mustache/mustache-sinatra.svg)](https://travis-ci.org/mustache/mustache-sinatra)
4
+
3
5
  Support for Mustache in your Sinatra app.
4
6
 
5
7
  ## Installation
data/Rakefile CHANGED
@@ -1,2 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
2
3
 
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: [:spec]
@@ -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].const_get(:Views) rescue Object
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
@@ -1,5 +1,5 @@
1
1
  class Mustache
2
2
  module Sinatra
3
- VERSION = "1.0.1"
3
+ VERSION = "2.0.0"
4
4
  end
5
5
  end
@@ -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.7"
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", "<= 0.99.8"
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
@@ -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}}
@@ -0,0 +1,5 @@
1
+ class Index < Layout
2
+ def hello
3
+ 'Hello world'
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ {{around}}
2
+ {{{yield}}}
3
+ {{around}}
@@ -0,0 +1,7 @@
1
+ require 'mustache'
2
+
3
+ class Layout < Mustache
4
+ def around
5
+ 'Around'
6
+ end
7
+ end
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: 1.0.1
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: 2015-01-25 00:00:00.000000000 Z
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.7'
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.7'
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.99.8
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.99.8
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
- rubyforge_project:
92
- rubygems_version: 2.2.2
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
- has_rdoc:
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