slim_assets 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.travis.yml +3 -0
- data/README.md +7 -1
- data/lib/slim_assets/slim_sprockets_engine.rb +1 -1
- data/lib/slim_assets/version.rb +1 -1
- data/slim_assets.gemspec +1 -0
- data/spec/rails_app/app/assets/javascripts/helpers.jst.ejs.slim +3 -0
- data/spec/render_spec.rb +7 -0
- data/spec/spec_helper.rb +14 -0
- metadata +32 -19
- data/Gemfile.lock +0 -119
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -19,7 +19,7 @@ Add this to your `Gemfile`
|
|
19
19
|
|
20
20
|
## Templates directory
|
21
21
|
|
22
|
-
You should
|
22
|
+
You should locate your templates under `app/assets`; we suggest `app/assets/templates`. In your Javascript manifest file (for example `application.js`), use `require_tree`
|
23
23
|
|
24
24
|
//= require_tree ../templates
|
25
25
|
|
@@ -58,3 +58,9 @@ All the ActionView and route helpers are available in your template. If you use
|
|
58
58
|
* Wes Gibbs : @wgibbs
|
59
59
|
|
60
60
|
This gem is heavily based on their [haml_assets gem](https://github.com/infbio/haml_assets)
|
61
|
+
|
62
|
+
# About the Author
|
63
|
+
|
64
|
+
[Crowd Interactive](http://www.crowdint.com) is a web design and development company that happens to work in Colima, Mexico.
|
65
|
+
We specialize in building and growing online retail stores. We don’t work with everyone – just companies we believe in. Call us today to see if there’s a fit.
|
66
|
+
Find more info [here](http://www.crowdint.com)!
|
@@ -41,7 +41,7 @@ module SlimAssets
|
|
41
41
|
def prepare; end
|
42
42
|
|
43
43
|
def render_slim(context, locals)
|
44
|
-
Slim::Template.new {|t| data }.render(context)
|
44
|
+
Slim::Template.new(generator: Temple::Generators::RailsOutputBuffer) {|t| data }.render(context)
|
45
45
|
end
|
46
46
|
|
47
47
|
# The Sprockets context is shared among all the processors, give Slim its
|
data/lib/slim_assets/version.rb
CHANGED
data/slim_assets.gemspec
CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_runtime_dependency "tilt"
|
23
23
|
|
24
24
|
s.add_development_dependency 'rails', '~> 3.1.0'
|
25
|
+
s.add_development_dependency 'sqlite3'
|
25
26
|
s.add_development_dependency 'rspec'
|
26
27
|
s.add_development_dependency 'rspec-rails'
|
27
28
|
s.add_development_dependency 'ejs'
|
data/spec/render_spec.rb
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
+
class Post < ActiveRecord::Base
|
4
|
+
end
|
5
|
+
|
3
6
|
describe SlimAssets do
|
4
7
|
it "should have the proper format" do
|
5
8
|
RailsApp::Application.assets['link_to.jst.ejs.slim'].to_s.should == "(function() {\n this.JST || (this.JST = {});\n this.JST[\"link_to\"] = function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('<h1><div class=\"text\">Render works</div></h1>');}return __p.join('');};\n}).call(this);\n"
|
6
9
|
end
|
10
|
+
|
11
|
+
it "should use rails helpers" do
|
12
|
+
RailsApp::Application.assets['helpers.jst.ejs.slim'].to_s.should == "(function() {\n this.JST || (this.JST = {});\n this.JST[\"helpers\"] = function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('<h1>Form</h1><form accept-charset=\"UTF-8\" action=\"/\" class=\"new_post\" id=\"new_post\" method=\"post\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"✓\" /></div><input id=\"post_title\" name=\"post[title]\" size=\"30\" type=\"text\" /></form>');}return __p.join('');};\n}).call(this);\n"
|
13
|
+
end
|
7
14
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -6,3 +6,17 @@ require 'rails_app/config/environment'
|
|
6
6
|
require 'slim_assets'
|
7
7
|
require 'ejs'
|
8
8
|
require 'rspec/rails'
|
9
|
+
require 'active_record'
|
10
|
+
|
11
|
+
Rails.cache.clear
|
12
|
+
|
13
|
+
ActiveRecord::Base.
|
14
|
+
establish_connection(adapter: "sqlite3", database: ":memory:")
|
15
|
+
|
16
|
+
ActiveRecord::Schema.define(:version => 0) do
|
17
|
+
create_table "posts", :force => true do |t|
|
18
|
+
t.string "title"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slim_assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-
|
12
|
+
date: 2012-02-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: slim
|
16
|
-
requirement: &
|
16
|
+
requirement: &70234736320160 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70234736320160
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: tilt
|
27
|
-
requirement: &
|
27
|
+
requirement: &70234736319100 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70234736319100
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rails
|
38
|
-
requirement: &
|
38
|
+
requirement: &70234736316440 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,21 @@ dependencies:
|
|
43
43
|
version: 3.1.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70234736316440
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: sqlite3
|
49
|
+
requirement: &70234736314460 !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: *70234736314460
|
47
58
|
- !ruby/object:Gem::Dependency
|
48
59
|
name: rspec
|
49
|
-
requirement: &
|
60
|
+
requirement: &70234736329620 !ruby/object:Gem::Requirement
|
50
61
|
none: false
|
51
62
|
requirements:
|
52
63
|
- - ! '>='
|
@@ -54,10 +65,10 @@ dependencies:
|
|
54
65
|
version: '0'
|
55
66
|
type: :development
|
56
67
|
prerelease: false
|
57
|
-
version_requirements: *
|
68
|
+
version_requirements: *70234736329620
|
58
69
|
- !ruby/object:Gem::Dependency
|
59
70
|
name: rspec-rails
|
60
|
-
requirement: &
|
71
|
+
requirement: &70234736328480 !ruby/object:Gem::Requirement
|
61
72
|
none: false
|
62
73
|
requirements:
|
63
74
|
- - ! '>='
|
@@ -65,10 +76,10 @@ dependencies:
|
|
65
76
|
version: '0'
|
66
77
|
type: :development
|
67
78
|
prerelease: false
|
68
|
-
version_requirements: *
|
79
|
+
version_requirements: *70234736328480
|
69
80
|
- !ruby/object:Gem::Dependency
|
70
81
|
name: ejs
|
71
|
-
requirement: &
|
82
|
+
requirement: &70234736327300 !ruby/object:Gem::Requirement
|
72
83
|
none: false
|
73
84
|
requirements:
|
74
85
|
- - ! '>='
|
@@ -76,10 +87,10 @@ dependencies:
|
|
76
87
|
version: '0'
|
77
88
|
type: :development
|
78
89
|
prerelease: false
|
79
|
-
version_requirements: *
|
90
|
+
version_requirements: *70234736327300
|
80
91
|
- !ruby/object:Gem::Dependency
|
81
92
|
name: psych
|
82
|
-
requirement: &
|
93
|
+
requirement: &70234736326180 !ruby/object:Gem::Requirement
|
83
94
|
none: false
|
84
95
|
requirements:
|
85
96
|
- - ! '>='
|
@@ -87,7 +98,7 @@ dependencies:
|
|
87
98
|
version: '0'
|
88
99
|
type: :development
|
89
100
|
prerelease: false
|
90
|
-
version_requirements: *
|
101
|
+
version_requirements: *70234736326180
|
91
102
|
description: Use Slim with Rails helpers in the asset pipeline
|
92
103
|
email:
|
93
104
|
- david@crowdint.com
|
@@ -98,8 +109,8 @@ files:
|
|
98
109
|
- .gitignore
|
99
110
|
- .rspec
|
100
111
|
- .rvmrc
|
112
|
+
- .travis.yml
|
101
113
|
- Gemfile
|
102
|
-
- Gemfile.lock
|
103
114
|
- README.md
|
104
115
|
- Rakefile
|
105
116
|
- lib/slim_assets.rb
|
@@ -110,6 +121,7 @@ files:
|
|
110
121
|
- spec/rails_app/.gitignore
|
111
122
|
- spec/rails_app/Rakefile
|
112
123
|
- spec/rails_app/app/assets/javascripts/empty.jst.ejs.slim
|
124
|
+
- spec/rails_app/app/assets/javascripts/helpers.jst.ejs.slim
|
113
125
|
- spec/rails_app/app/assets/javascripts/link_to.jst.ejs.slim
|
114
126
|
- spec/rails_app/app/controllers/application_controller.rb
|
115
127
|
- spec/rails_app/config.ru
|
@@ -138,7 +150,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
138
150
|
version: '0'
|
139
151
|
segments:
|
140
152
|
- 0
|
141
|
-
hash:
|
153
|
+
hash: 1527951104491763291
|
142
154
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
155
|
none: false
|
144
156
|
requirements:
|
@@ -147,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
159
|
version: '0'
|
148
160
|
segments:
|
149
161
|
- 0
|
150
|
-
hash:
|
162
|
+
hash: 1527951104491763291
|
151
163
|
requirements: []
|
152
164
|
rubyforge_project: slim_assets
|
153
165
|
rubygems_version: 1.8.11
|
@@ -158,6 +170,7 @@ test_files:
|
|
158
170
|
- spec/rails_app/.gitignore
|
159
171
|
- spec/rails_app/Rakefile
|
160
172
|
- spec/rails_app/app/assets/javascripts/empty.jst.ejs.slim
|
173
|
+
- spec/rails_app/app/assets/javascripts/helpers.jst.ejs.slim
|
161
174
|
- spec/rails_app/app/assets/javascripts/link_to.jst.ejs.slim
|
162
175
|
- spec/rails_app/app/controllers/application_controller.rb
|
163
176
|
- spec/rails_app/config.ru
|
data/Gemfile.lock
DELETED
@@ -1,119 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
slim_assets (0.0.1)
|
5
|
-
slim
|
6
|
-
tilt
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: http://rubygems.org/
|
10
|
-
specs:
|
11
|
-
actionmailer (3.1.0)
|
12
|
-
actionpack (= 3.1.0)
|
13
|
-
mail (~> 2.3.0)
|
14
|
-
actionpack (3.1.0)
|
15
|
-
activemodel (= 3.1.0)
|
16
|
-
activesupport (= 3.1.0)
|
17
|
-
builder (~> 3.0.0)
|
18
|
-
erubis (~> 2.7.0)
|
19
|
-
i18n (~> 0.6)
|
20
|
-
rack (~> 1.3.2)
|
21
|
-
rack-cache (~> 1.0.3)
|
22
|
-
rack-mount (~> 0.8.2)
|
23
|
-
rack-test (~> 0.6.1)
|
24
|
-
sprockets (~> 2.0.0)
|
25
|
-
activemodel (3.1.0)
|
26
|
-
activesupport (= 3.1.0)
|
27
|
-
bcrypt-ruby (~> 3.0.0)
|
28
|
-
builder (~> 3.0.0)
|
29
|
-
i18n (~> 0.6)
|
30
|
-
activerecord (3.1.0)
|
31
|
-
activemodel (= 3.1.0)
|
32
|
-
activesupport (= 3.1.0)
|
33
|
-
arel (~> 2.2.1)
|
34
|
-
tzinfo (~> 0.3.29)
|
35
|
-
activeresource (3.1.0)
|
36
|
-
activemodel (= 3.1.0)
|
37
|
-
activesupport (= 3.1.0)
|
38
|
-
activesupport (3.1.0)
|
39
|
-
multi_json (~> 1.0)
|
40
|
-
arel (2.2.1)
|
41
|
-
bcrypt-ruby (3.0.1)
|
42
|
-
builder (3.0.0)
|
43
|
-
diff-lcs (1.1.3)
|
44
|
-
ejs (1.0.0)
|
45
|
-
erubis (2.7.0)
|
46
|
-
hike (1.2.1)
|
47
|
-
i18n (0.6.0)
|
48
|
-
mail (2.3.0)
|
49
|
-
i18n (>= 0.4.0)
|
50
|
-
mime-types (~> 1.16)
|
51
|
-
treetop (~> 1.4.8)
|
52
|
-
mime-types (1.16)
|
53
|
-
multi_json (1.0.3)
|
54
|
-
polyglot (0.3.2)
|
55
|
-
psych (1.2.2)
|
56
|
-
rack (1.3.3)
|
57
|
-
rack-cache (1.0.3)
|
58
|
-
rack (>= 0.4)
|
59
|
-
rack-mount (0.8.3)
|
60
|
-
rack (>= 1.0.0)
|
61
|
-
rack-ssl (1.3.2)
|
62
|
-
rack
|
63
|
-
rack-test (0.6.1)
|
64
|
-
rack (>= 1.0)
|
65
|
-
rails (3.1.0)
|
66
|
-
actionmailer (= 3.1.0)
|
67
|
-
actionpack (= 3.1.0)
|
68
|
-
activerecord (= 3.1.0)
|
69
|
-
activeresource (= 3.1.0)
|
70
|
-
activesupport (= 3.1.0)
|
71
|
-
bundler (~> 1.0)
|
72
|
-
railties (= 3.1.0)
|
73
|
-
railties (3.1.0)
|
74
|
-
actionpack (= 3.1.0)
|
75
|
-
activesupport (= 3.1.0)
|
76
|
-
rack-ssl (~> 1.3.2)
|
77
|
-
rake (>= 0.8.7)
|
78
|
-
rdoc (~> 3.4)
|
79
|
-
thor (~> 0.14.6)
|
80
|
-
rake (0.9.2)
|
81
|
-
rdoc (3.9.4)
|
82
|
-
rspec (2.6.0)
|
83
|
-
rspec-core (~> 2.6.0)
|
84
|
-
rspec-expectations (~> 2.6.0)
|
85
|
-
rspec-mocks (~> 2.6.0)
|
86
|
-
rspec-core (2.6.4)
|
87
|
-
rspec-expectations (2.6.0)
|
88
|
-
diff-lcs (~> 1.1.2)
|
89
|
-
rspec-mocks (2.6.0)
|
90
|
-
rspec-rails (2.6.1)
|
91
|
-
actionpack (~> 3.0)
|
92
|
-
activesupport (~> 3.0)
|
93
|
-
railties (~> 3.0)
|
94
|
-
rspec (~> 2.6.0)
|
95
|
-
slim (1.1.0)
|
96
|
-
temple (~> 0.3.5)
|
97
|
-
tilt (~> 1.3.2)
|
98
|
-
sprockets (2.0.0)
|
99
|
-
hike (~> 1.2)
|
100
|
-
rack (~> 1.0)
|
101
|
-
tilt (~> 1.1, != 1.3.0)
|
102
|
-
temple (0.3.5)
|
103
|
-
thor (0.14.6)
|
104
|
-
tilt (1.3.3)
|
105
|
-
treetop (1.4.10)
|
106
|
-
polyglot
|
107
|
-
polyglot (>= 0.3.1)
|
108
|
-
tzinfo (0.3.29)
|
109
|
-
|
110
|
-
PLATFORMS
|
111
|
-
ruby
|
112
|
-
|
113
|
-
DEPENDENCIES
|
114
|
-
ejs
|
115
|
-
psych
|
116
|
-
rails (~> 3.1.0)
|
117
|
-
rspec
|
118
|
-
rspec-rails
|
119
|
-
slim_assets!
|