underscore-template-rails 0.0.1
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.
- data/.gitignore +7 -0
- data/Gemfile +20 -0
- data/README.md +55 -0
- data/Rakefile +6 -0
- data/lib/underscore-template-rails.rb +2 -0
- data/lib/underscore-template-rails/engine.rb +13 -0
- data/lib/underscore-template-rails/underscore_template.rb +31 -0
- data/spec/intergration_spec.rb +20 -0
- data/spec/sample_app/.gitignore +15 -0
- data/spec/sample_app/README.rdoc +261 -0
- data/spec/sample_app/Rakefile +7 -0
- data/spec/sample_app/app/assets/images/rails.png +0 -0
- data/spec/sample_app/app/assets/javascripts/application.js +25 -0
- data/spec/sample_app/app/assets/javascripts/config.js +2 -0
- data/spec/sample_app/app/assets/javascripts/templates/test.utmp +3 -0
- data/spec/sample_app/app/assets/stylesheets/application.css +13 -0
- data/spec/sample_app/app/controllers/application_controller.rb +3 -0
- data/spec/sample_app/app/helpers/application_helper.rb +2 -0
- data/spec/sample_app/app/mailers/.gitkeep +0 -0
- data/spec/sample_app/app/models/.gitkeep +0 -0
- data/spec/sample_app/app/views/application/index.html.erb +0 -0
- data/spec/sample_app/app/views/application/variable.html.erb +0 -0
- data/spec/sample_app/app/views/layouts/application.html.erb +14 -0
- data/spec/sample_app/config.ru +4 -0
- data/spec/sample_app/config/application.rb +61 -0
- data/spec/sample_app/config/boot.rb +6 -0
- data/spec/sample_app/config/database.yml +25 -0
- data/spec/sample_app/config/environment.rb +5 -0
- data/spec/sample_app/config/environments/development.rb +37 -0
- data/spec/sample_app/config/environments/production.rb +67 -0
- data/spec/sample_app/config/environments/test.rb +37 -0
- data/spec/sample_app/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/sample_app/config/initializers/inflections.rb +15 -0
- data/spec/sample_app/config/initializers/mime_types.rb +5 -0
- data/spec/sample_app/config/initializers/secret_token.rb +7 -0
- data/spec/sample_app/config/initializers/session_store.rb +8 -0
- data/spec/sample_app/config/initializers/wrap_parameters.rb +14 -0
- data/spec/sample_app/config/locales/en.yml +5 -0
- data/spec/sample_app/config/routes.rb +4 -0
- data/spec/sample_app/db/seeds.rb +7 -0
- data/spec/sample_app/doc/README_FOR_APP +2 -0
- data/spec/sample_app/lib/assets/.gitkeep +0 -0
- data/spec/sample_app/lib/assets/javascripts/underscore.js +1059 -0
- data/spec/sample_app/lib/tasks/.gitkeep +0 -0
- data/spec/sample_app/public/404.html +26 -0
- data/spec/sample_app/public/422.html +26 -0
- data/spec/sample_app/public/500.html +25 -0
- data/spec/sample_app/public/favicon.ico +0 -0
- data/spec/sample_app/public/robots.txt +5 -0
- data/spec/sample_app/script/rails +6 -0
- data/spec/sample_app/test/fixtures/.gitkeep +0 -0
- data/spec/sample_app/test/functional/.gitkeep +0 -0
- data/spec/sample_app/test/integration/.gitkeep +0 -0
- data/spec/sample_app/test/performance/browsing_test.rb +12 -0
- data/spec/sample_app/test/test_helper.rb +13 -0
- data/spec/sample_app/test/unit/.gitkeep +0 -0
- data/spec/sample_app/vendor/assets/javascripts/.gitkeep +0 -0
- data/spec/sample_app/vendor/assets/stylesheets/.gitkeep +0 -0
- data/spec/sample_app/vendor/plugins/.gitkeep +0 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/underscore-template-rails/underscore_template_spec.rb +21 -0
- data/underscore-template-rails.gemspec +19 -0
- metadata +204 -0
File without changes
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/404.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/422.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
23
|
+
</div>
|
24
|
+
</body>
|
25
|
+
</html>
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'rails/performance_test_help'
|
3
|
+
|
4
|
+
class BrowsingTest < ActionDispatch::PerformanceTest
|
5
|
+
# Refer to the documentation for all available options
|
6
|
+
# self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory]
|
7
|
+
# :output => 'tmp/performance', :formats => [:flat] }
|
8
|
+
|
9
|
+
def test_homepage
|
10
|
+
get '/'
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
ENV["RAILS_ENV"] = "test"
|
2
|
+
require File.expand_path('../../config/environment', __FILE__)
|
3
|
+
require 'rails/test_help'
|
4
|
+
|
5
|
+
class ActiveSupport::TestCase
|
6
|
+
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
7
|
+
#
|
8
|
+
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
9
|
+
# -- they do not yet inherit this setting
|
10
|
+
fixtures :all
|
11
|
+
|
12
|
+
# Add more helper methods to be used by all tests here...
|
13
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
ENV["RAILS_ENV"] = "test"
|
2
|
+
|
3
|
+
require File.expand_path("../sample_app/config/environment.rb", __FILE__)
|
4
|
+
|
5
|
+
Rails.backtrace_cleaner.remove_silencers!
|
6
|
+
|
7
|
+
require "capybara"
|
8
|
+
require "capybara/rails"
|
9
|
+
require "capybara/rspec"
|
10
|
+
require "capybara/poltergeist"
|
11
|
+
|
12
|
+
Capybara.javascript_driver = :poltergeist
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe UnderscoreTemplateRails::UnderscoreTemplate do
|
4
|
+
before { Rails.application.assets.cache = {} }
|
5
|
+
|
6
|
+
it 'compiles templates with the .utmp extension' do
|
7
|
+
Rails.configuration.underscore_templates.variable = 'templates'
|
8
|
+
template = Rails.application.assets['templates/test']
|
9
|
+
template.to_s.should == "templates[\"test\"] = _.template(\"<div class=\\\"test\\\">\\n <%= test %>\\n<\\/div>\\n\");"
|
10
|
+
end
|
11
|
+
|
12
|
+
context 'when config.template_variable is set' do
|
13
|
+
it 'sets the variable from the config' do
|
14
|
+
Rails.configuration.underscore_templates.variable = 'argon'
|
15
|
+
template = Rails.application.assets['templates/test']
|
16
|
+
template.to_s.should == "argon[\"test\"] = _.template(\"<div class=\\\"test\\\">\\n <%= test %>\\n<\\/div>\\n\");"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'underscore-template-rails'
|
3
|
+
s.version = '0.0.1'
|
4
|
+
s.authors = 'Jon Bracy'
|
5
|
+
s.email = 'jonbracy@gmail.com'
|
6
|
+
s.homepage = 'https://github.com/42floors/underscore-template-rails'
|
7
|
+
s.summary = 'Underscore Templates for the Rails asset pipeline.'
|
8
|
+
s.description = 'Adds an Sprockets engine to the asset pipeline in Rails to handle templates'
|
9
|
+
|
10
|
+
s.files = `git ls-files`.split("\n")
|
11
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
12
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
13
|
+
s.require_paths = ['lib']
|
14
|
+
|
15
|
+
s.add_dependency 'rails', '>= 3.1.0'
|
16
|
+
s.add_development_dependency 'rspec'
|
17
|
+
s.add_development_dependency 'capybara'
|
18
|
+
s.add_development_dependency 'poltergeist'
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,204 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: underscore-template-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jon Bracy
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-05-10 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: &70096176315340 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.1.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70096176315340
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rspec
|
27
|
+
requirement: &70096176314940 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70096176314940
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: capybara
|
38
|
+
requirement: &70096176314420 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70096176314420
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: poltergeist
|
49
|
+
requirement: &70096176313960 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70096176313960
|
58
|
+
description: Adds an Sprockets engine to the asset pipeline in Rails to handle templates
|
59
|
+
email: jonbracy@gmail.com
|
60
|
+
executables: []
|
61
|
+
extensions: []
|
62
|
+
extra_rdoc_files: []
|
63
|
+
files:
|
64
|
+
- .gitignore
|
65
|
+
- Gemfile
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- lib/underscore-template-rails.rb
|
69
|
+
- lib/underscore-template-rails/engine.rb
|
70
|
+
- lib/underscore-template-rails/underscore_template.rb
|
71
|
+
- spec/intergration_spec.rb
|
72
|
+
- spec/sample_app/.gitignore
|
73
|
+
- spec/sample_app/README.rdoc
|
74
|
+
- spec/sample_app/Rakefile
|
75
|
+
- spec/sample_app/app/assets/images/rails.png
|
76
|
+
- spec/sample_app/app/assets/javascripts/application.js
|
77
|
+
- spec/sample_app/app/assets/javascripts/config.js
|
78
|
+
- spec/sample_app/app/assets/javascripts/templates/test.utmp
|
79
|
+
- spec/sample_app/app/assets/stylesheets/application.css
|
80
|
+
- spec/sample_app/app/controllers/application_controller.rb
|
81
|
+
- spec/sample_app/app/helpers/application_helper.rb
|
82
|
+
- spec/sample_app/app/mailers/.gitkeep
|
83
|
+
- spec/sample_app/app/models/.gitkeep
|
84
|
+
- spec/sample_app/app/views/application/index.html.erb
|
85
|
+
- spec/sample_app/app/views/application/variable.html.erb
|
86
|
+
- spec/sample_app/app/views/layouts/application.html.erb
|
87
|
+
- spec/sample_app/config.ru
|
88
|
+
- spec/sample_app/config/application.rb
|
89
|
+
- spec/sample_app/config/boot.rb
|
90
|
+
- spec/sample_app/config/database.yml
|
91
|
+
- spec/sample_app/config/environment.rb
|
92
|
+
- spec/sample_app/config/environments/development.rb
|
93
|
+
- spec/sample_app/config/environments/production.rb
|
94
|
+
- spec/sample_app/config/environments/test.rb
|
95
|
+
- spec/sample_app/config/initializers/backtrace_silencers.rb
|
96
|
+
- spec/sample_app/config/initializers/inflections.rb
|
97
|
+
- spec/sample_app/config/initializers/mime_types.rb
|
98
|
+
- spec/sample_app/config/initializers/secret_token.rb
|
99
|
+
- spec/sample_app/config/initializers/session_store.rb
|
100
|
+
- spec/sample_app/config/initializers/wrap_parameters.rb
|
101
|
+
- spec/sample_app/config/locales/en.yml
|
102
|
+
- spec/sample_app/config/routes.rb
|
103
|
+
- spec/sample_app/db/seeds.rb
|
104
|
+
- spec/sample_app/doc/README_FOR_APP
|
105
|
+
- spec/sample_app/lib/assets/.gitkeep
|
106
|
+
- spec/sample_app/lib/assets/javascripts/underscore.js
|
107
|
+
- spec/sample_app/lib/tasks/.gitkeep
|
108
|
+
- spec/sample_app/public/404.html
|
109
|
+
- spec/sample_app/public/422.html
|
110
|
+
- spec/sample_app/public/500.html
|
111
|
+
- spec/sample_app/public/favicon.ico
|
112
|
+
- spec/sample_app/public/robots.txt
|
113
|
+
- spec/sample_app/script/rails
|
114
|
+
- spec/sample_app/test/fixtures/.gitkeep
|
115
|
+
- spec/sample_app/test/functional/.gitkeep
|
116
|
+
- spec/sample_app/test/integration/.gitkeep
|
117
|
+
- spec/sample_app/test/performance/browsing_test.rb
|
118
|
+
- spec/sample_app/test/test_helper.rb
|
119
|
+
- spec/sample_app/test/unit/.gitkeep
|
120
|
+
- spec/sample_app/vendor/assets/javascripts/.gitkeep
|
121
|
+
- spec/sample_app/vendor/assets/stylesheets/.gitkeep
|
122
|
+
- spec/sample_app/vendor/plugins/.gitkeep
|
123
|
+
- spec/spec_helper.rb
|
124
|
+
- spec/underscore-template-rails/underscore_template_spec.rb
|
125
|
+
- underscore-template-rails.gemspec
|
126
|
+
homepage: https://github.com/42floors/underscore-template-rails
|
127
|
+
licenses: []
|
128
|
+
post_install_message:
|
129
|
+
rdoc_options: []
|
130
|
+
require_paths:
|
131
|
+
- lib
|
132
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
133
|
+
none: false
|
134
|
+
requirements:
|
135
|
+
- - ! '>='
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
139
|
+
none: false
|
140
|
+
requirements:
|
141
|
+
- - ! '>='
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '0'
|
144
|
+
requirements: []
|
145
|
+
rubyforge_project:
|
146
|
+
rubygems_version: 1.8.11
|
147
|
+
signing_key:
|
148
|
+
specification_version: 3
|
149
|
+
summary: Underscore Templates for the Rails asset pipeline.
|
150
|
+
test_files:
|
151
|
+
- spec/intergration_spec.rb
|
152
|
+
- spec/sample_app/.gitignore
|
153
|
+
- spec/sample_app/README.rdoc
|
154
|
+
- spec/sample_app/Rakefile
|
155
|
+
- spec/sample_app/app/assets/images/rails.png
|
156
|
+
- spec/sample_app/app/assets/javascripts/application.js
|
157
|
+
- spec/sample_app/app/assets/javascripts/config.js
|
158
|
+
- spec/sample_app/app/assets/javascripts/templates/test.utmp
|
159
|
+
- spec/sample_app/app/assets/stylesheets/application.css
|
160
|
+
- spec/sample_app/app/controllers/application_controller.rb
|
161
|
+
- spec/sample_app/app/helpers/application_helper.rb
|
162
|
+
- spec/sample_app/app/mailers/.gitkeep
|
163
|
+
- spec/sample_app/app/models/.gitkeep
|
164
|
+
- spec/sample_app/app/views/application/index.html.erb
|
165
|
+
- spec/sample_app/app/views/application/variable.html.erb
|
166
|
+
- spec/sample_app/app/views/layouts/application.html.erb
|
167
|
+
- spec/sample_app/config.ru
|
168
|
+
- spec/sample_app/config/application.rb
|
169
|
+
- spec/sample_app/config/boot.rb
|
170
|
+
- spec/sample_app/config/database.yml
|
171
|
+
- spec/sample_app/config/environment.rb
|
172
|
+
- spec/sample_app/config/environments/development.rb
|
173
|
+
- spec/sample_app/config/environments/production.rb
|
174
|
+
- spec/sample_app/config/environments/test.rb
|
175
|
+
- spec/sample_app/config/initializers/backtrace_silencers.rb
|
176
|
+
- spec/sample_app/config/initializers/inflections.rb
|
177
|
+
- spec/sample_app/config/initializers/mime_types.rb
|
178
|
+
- spec/sample_app/config/initializers/secret_token.rb
|
179
|
+
- spec/sample_app/config/initializers/session_store.rb
|
180
|
+
- spec/sample_app/config/initializers/wrap_parameters.rb
|
181
|
+
- spec/sample_app/config/locales/en.yml
|
182
|
+
- spec/sample_app/config/routes.rb
|
183
|
+
- spec/sample_app/db/seeds.rb
|
184
|
+
- spec/sample_app/doc/README_FOR_APP
|
185
|
+
- spec/sample_app/lib/assets/.gitkeep
|
186
|
+
- spec/sample_app/lib/assets/javascripts/underscore.js
|
187
|
+
- spec/sample_app/lib/tasks/.gitkeep
|
188
|
+
- spec/sample_app/public/404.html
|
189
|
+
- spec/sample_app/public/422.html
|
190
|
+
- spec/sample_app/public/500.html
|
191
|
+
- spec/sample_app/public/favicon.ico
|
192
|
+
- spec/sample_app/public/robots.txt
|
193
|
+
- spec/sample_app/script/rails
|
194
|
+
- spec/sample_app/test/fixtures/.gitkeep
|
195
|
+
- spec/sample_app/test/functional/.gitkeep
|
196
|
+
- spec/sample_app/test/integration/.gitkeep
|
197
|
+
- spec/sample_app/test/performance/browsing_test.rb
|
198
|
+
- spec/sample_app/test/test_helper.rb
|
199
|
+
- spec/sample_app/test/unit/.gitkeep
|
200
|
+
- spec/sample_app/vendor/assets/javascripts/.gitkeep
|
201
|
+
- spec/sample_app/vendor/assets/stylesheets/.gitkeep
|
202
|
+
- spec/sample_app/vendor/plugins/.gitkeep
|
203
|
+
- spec/spec_helper.rb
|
204
|
+
- spec/underscore-template-rails/underscore_template_spec.rb
|