rcss 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.
data/CHANGES ADDED
@@ -0,0 +1,9 @@
1
+ = Version 0.3.0
2
+ * Initial public release
3
+ * Server side constants/variables (no include support yet)
4
+ * Documentation
5
+
6
+ = Version 0.2.1
7
+ * ERB evaluation
8
+ * Supports server-side classes using 'extends' attribute
9
+ * Gem-based distribution
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2005 Lukasz 'Bragi Ragnarson' Piestrzeniewicz
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,351 @@
1
+ = Rcss - CSS Server-side Constants for Ruby/Rails
2
+
3
+ Information for version 0.3.0
4
+
5
+ Rcss implements CSS-SSC in Ruby.
6
+
7
+ Main features:
8
+
9
+ * Create rich CSS files using:
10
+
11
+ * ERB templates
12
+
13
+ * Server-side constants
14
+
15
+ * Server-side classes (preliminary)
16
+
17
+ * Simply add Rcss files to any Rails application
18
+
19
+ * Process Rcss files off-line using command line executable
20
+
21
+ == Introduction
22
+
23
+ Rcss addresses issue of CSS maintainability. Even a minor change in complex
24
+ stylesheet usually requires using search-and-replace. A simple way to fix this
25
+ flaw is to allow some kind of constant/variable substitution inside CSS. Using
26
+ Rcss you can achieve that in three ways:
27
+
28
+ === ERB templates
29
+
30
+ ERB templating is the most flexible solution. It uses standard ERB syntax (the
31
+ same you can find in rhtml files). ERB allows you to inlude in the CSS values
32
+ defined in controller. This gives access to database through ActiveRecord and
33
+ allows database-driven CSS themes.
34
+
35
+ Strengths
36
+
37
+ * Access to application data (through ActiveRecord)
38
+ * Flexible Ruby syntax (allowing programmatic CSS)
39
+
40
+ Weaknesses
41
+
42
+ * Syntax unfamiliar to CSS designers
43
+ * A bit ugly and sometimes error-prone embedding
44
+ * Not portable
45
+
46
+ Example
47
+
48
+ <% template_color = "#000"
49
+ template_background = "#fff"
50
+ template_highlight = "#fa3"
51
+ %>
52
+ body {
53
+ color: <%= template_color %>;
54
+ background-color: <%= template_background %>;
55
+ }
56
+
57
+ h1 {
58
+ color: <%= template_background %>;
59
+ background-color: <%= template_highlight %>;
60
+ }
61
+
62
+ === Server-side Constants
63
+
64
+ Server-side Constants were originaly developed by Shaun Inman in PHP. SSC
65
+ extends CSS syntax in a simple way. SCC is cross-platform and easy to use.
66
+
67
+ Rcss differs from original implementation in two ways :
68
+
69
+ * Constants may have complex values (including spaces and commas)
70
+ * Includes are not implemented
71
+
72
+ Strengths
73
+
74
+ * Simple syntax
75
+ * SSC-CSS files can be used in both Rails and PHP applications
76
+
77
+ Weaknesses
78
+
79
+ * Only simple constant substitution
80
+
81
+ Example
82
+
83
+ @server constants {
84
+ template_color: #000;
85
+ template_background: #fff;
86
+ template_highlight: #fa3;
87
+
88
+ // Rcss specific (note spaces and commas)
89
+ template_font: "Trebuchet MS", "Bitstream Vera Sans", helvetica, sans-serif;
90
+ }
91
+
92
+ body {
93
+ color: template_color;
94
+ background-color: template_background;
95
+ font-family: template_font;
96
+ }
97
+
98
+ h1 {
99
+ color: template_background;
100
+ background-color: template_highlight;
101
+ font-family: template_font;
102
+ }
103
+
104
+ === Server-side Classes (preliminary)
105
+
106
+ *Warning* This functionality is subject to rapid change and future versions
107
+ might not be compatible with current implementation.
108
+
109
+ Server-side Classes add multiple inheritence to CSS selectors. Now you can
110
+ 'virtual', server-side selectors and use them to extend normal selectors. It is
111
+ just a simple way of inheriting several attributes at once. Together with two
112
+ technics described above they give a very powerfull tool to create maintainable
113
+ CSS files.
114
+
115
+ Strengths
116
+
117
+ * Simple syntax
118
+ * Specify multiple related attributes at the same time
119
+
120
+ Weaknesses
121
+
122
+ * Syntax is subject to change
123
+ * No templating yet
124
+
125
+ Example
126
+
127
+ @server &serif_font {
128
+ font-family: "Trebuchet MS", "Bitstream Vera Sans", helvetica, sans-serif;
129
+ }
130
+
131
+ @server &highlighted {
132
+ color: #000;
133
+ background-color: #fa3;
134
+ }
135
+
136
+ h1 {
137
+ extends: &highlighted;
138
+ extends: &serif_font;
139
+ }
140
+
141
+ #menu {
142
+ extends: &highlighted;
143
+ }
144
+
145
+ == Installation
146
+
147
+ Download and install Rcss with the following command:
148
+
149
+ gem install --remote rcss
150
+
151
+ == Usage
152
+
153
+ === Command line
154
+
155
+ NAME
156
+ rcss - process rich CSS files
157
+
158
+ SYNOPSIS
159
+ rcss [RcssFile]
160
+
161
+ DESCRIPTION
162
+ Reads and processes rich CSS files. Processed file is printed to standard
163
+ output. If no file is given standard input is processed instead.
164
+
165
+ EXAMPLE
166
+ rcss default.rcss >default.css
167
+
168
+ Will read contents of default.rcss file, evaluate ERB templates, server
169
+ side constants and classes. Output will be redirected to default.css file.
170
+
171
+ === Rails
172
+
173
+ Using Rcss in Rails environment requires several steps.
174
+
175
+ 1. Modify your <code>config/environment.rb</code> file and add following line:
176
+
177
+ require 'rcss'
178
+
179
+ 2. Create controller that will be serving Rcss files. Create
180
+ <code>app/controllers/rcss_controller.rb</code> file with following content:
181
+
182
+ class RcssController < ApplicationController
183
+ def render_rcss
184
+ if params[:rcss] =~ /\.css$/
185
+ template = $`
186
+ else
187
+ template = params[:rcss]
188
+ end
189
+ render :action => template, :type => 'rcss', :layout => false
190
+ end
191
+ end
192
+
193
+ 3. For convenience add route entries that will handle Rcss files. Modify file
194
+ <code>config/routes.rb</code> and add following lines *before* the default route:
195
+
196
+ map.connect 'rcss/:rcss', :controller => 'rcss', :action => 'render_rcss'
197
+ map.rcss 'rcss/:rcss', :controller => 'rcss', :action => 'render_rcss'
198
+
199
+ 4. Create following test Rcss file <code>app/views/rcss/test.rcss</code>:
200
+
201
+ <% test_color = "#000" %>
202
+
203
+ @server constants {
204
+ test_background: #fff;
205
+ }
206
+
207
+ @server &test_class {
208
+ color: <%= test_color %>;
209
+ background-color: test_background;
210
+ }
211
+
212
+ body {
213
+ extends: &test_class;
214
+ }
215
+
216
+ 5. Start your Rails application
217
+
218
+ $ ruby scripts/server
219
+
220
+ Point your browser to location: http://localhost:3000/rcss/test.css
221
+ You should see following content:
222
+
223
+ body {
224
+ color: #000;
225
+ background-color: #fff;
226
+ }
227
+
228
+ == Rcss Syntax
229
+
230
+ Rcss file is processed in three stages:
231
+
232
+ 1. The ERB template is applied
233
+ 2. Server-side constants are gathered
234
+ 3. Server-side constants are evaluated
235
+ 4. Server-side classes are gathered
236
+ 5. Server-side classes are evaluated
237
+
238
+ === Server-side Constants Syntax
239
+
240
+ SSC block has following template:
241
+
242
+ @server constants {
243
+ constant_name: value;
244
+ }
245
+
246
+ Also for compatibility older version is supported:
247
+
248
+ @server variables {
249
+ variable_name: value;
250
+ }
251
+
252
+ There might be several constants/variables blocks in the same file. It does not
253
+ matter where in CSS file they appear, their contents are still applied to whole
254
+ file.
255
+
256
+ When a constant is redefined only later occurence is taken into account so:
257
+
258
+ template_color: #fff;
259
+ ...
260
+ template_color: #000;
261
+
262
+ ...will result in <code>template_color</code> having value <code>#000</code> in all places.
263
+
264
+ To use constant's value simply type it's name anywhere in the code:
265
+
266
+ body {
267
+ color: constant_name;
268
+ }
269
+
270
+ *Note* that since enything can be constant's value it is also possible to use it
271
+ to hold attribute or even selector:
272
+
273
+ @server constants {
274
+ body: #fff;
275
+ }
276
+
277
+ body {
278
+ color: body;
279
+ }
280
+
281
+ This will be evaluated to
282
+
283
+ #fff {
284
+ color: #fff;
285
+ }
286
+
287
+ ..which probably is not what one might expect. For that reason avoid using CSS
288
+ selector and attribute names as constant names.
289
+
290
+ === Server-side Classes Syntax
291
+
292
+ Server-side classes are defined using following template:
293
+
294
+ @server &class_name {
295
+ // normal CSS content
296
+ }
297
+
298
+ The ampersand <code>&</code> before class name is mandatory.
299
+
300
+ To include server-side class in CSS selector use *extends* attribute:
301
+
302
+ body {
303
+ extends: &class_name;
304
+ }
305
+
306
+ Server-side classes may also extend existing ones:
307
+
308
+ @server &highlighted {
309
+ background-color: #fec;
310
+ color: #fff;
311
+ }
312
+
313
+ @server &header {
314
+ extends: &highlighted;
315
+ font-weight: bold;
316
+ }
317
+
318
+ h1 {
319
+ extends: &header;
320
+ }
321
+
322
+ #menu {
323
+ extends: &highlighted;
324
+ }
325
+
326
+ In case of complex extending order in which server-side classes appear in
327
+ the file is important. Class must be already declared before it is used -
328
+ otherwise it will be evaluated to an empty string.
329
+
330
+ == Credits
331
+
332
+ [<b>Shaun Inman</b>] For the original PHP version of CSS-SSC
333
+
334
+ == License
335
+
336
+ Rcss is available under an MIT-style license.
337
+
338
+ :include: MIT-LICENSE
339
+
340
+ == Other stuff
341
+
342
+ Author:: Lukasz 'Bragi Ragnason' Piestrzeniewicz <bragi dot ragnarson at gmail dot com>
343
+ Requires:: Ruby 1.8.0 or later
344
+ Rails 0.13.0 or later
345
+
346
+ == Warranty
347
+
348
+ This software is provided "as is" and without any express or
349
+ implied warranties, including, without limitation, the implied
350
+ warranties of merchantibility and fitness for a particular
351
+ purpose.
data/Rakefile ADDED
@@ -0,0 +1,97 @@
1
+ require 'rake'
2
+ require 'rake/gempackagetask'
3
+ require 'rake/rdoctask'
4
+ require File.dirname(__FILE__) + '/lib/rcss'
5
+
6
+ PKG_VERSION = Rcss::VERSION
7
+ PKG_NAME = "rcss"
8
+ RUBY_FORGE_PROJECT = "rcss"
9
+ RUBY_FORGE_USER = "bragi"
10
+ PKG_FILES = FileList[
11
+ 'README',
12
+ 'CHANGES',
13
+ 'TODO',
14
+ 'MIT-LICENSE',
15
+ 'Rakefile',
16
+ 'lib/**/*.rb',
17
+ 'bin/**/*',
18
+ 'test/**/*'
19
+ ]
20
+
21
+ desc "Builds everything"
22
+ task :default => [:test, :gem, :rdoc]
23
+
24
+ task :gem => :test
25
+
26
+ rd = Rake::RDocTask.new("rdoc") { |rdoc|
27
+ rdoc.rdoc_dir = 'html'
28
+ rdoc.title = "Rcss - CSS Server-side Constants for Ruby/Rails"
29
+ rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README'
30
+ rdoc.rdoc_files.include('README', 'MIT-LICENSE', 'TODO', 'CHANGES')
31
+ rdoc.rdoc_files.include('lib/**/*.rb')
32
+ }
33
+
34
+ spec = Gem::Specification.new do |s|
35
+
36
+ #### Basic information.
37
+ s.name = PKG_NAME
38
+ s.version = PKG_VERSION
39
+ s.summary = "Rcss - CSS Server-side Constants for Ruby/Rails"
40
+ s.description = <<-TXT
41
+ No more search-and-replace in CSS files. Use your familiar ERB syntax (the
42
+ same you use in rhtml files) to deliver constants to CSS files. You can
43
+ even extract values for constants from database using ActiveRecord.
44
+
45
+ * Familiar ERB syntax
46
+
47
+ * Extend your classes with multiple attributes with ease
48
+ TXT
49
+ s.files = PKG_FILES.to_a
50
+ s.executables << 'rcss'
51
+
52
+ ## Load-time details
53
+ s.autorequire = 'rcss'
54
+ ## Author and project details
55
+ s.author = "Bragi Ragnarson"
56
+ s.email = "bragi.ragnarson@gmail.com"
57
+ s.rubyforge_project = RUBY_FORGE_PROJECT
58
+ s.homepage = "http://rcss.rubyforge.org"
59
+
60
+ #### Documentation and testing.
61
+
62
+ s.has_rdoc = true
63
+ # s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
64
+ s.rdoc_options <<
65
+ '--title' << 'Rcss - CSS Server-side Constants for Ruby/Rails' <<
66
+ '--main' << 'README' <<
67
+ '--line-numbers'
68
+ s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
69
+
70
+ end
71
+
72
+ task :test do |t|
73
+ puts "Testing"
74
+ Dir[ 'test/data/*.in.rcss' ].each do |testfile|
75
+ testname = testfile.gsub(/test\/data\/(.*)\.in\.rcss/, '\1')
76
+ rcss = Rcss::Ssc.new(File.read(testfile)).to_css
77
+ css = File.read(testfile.gsub(/\.in\.rcss/ , ".out.css"))
78
+ rcss.gsub!(/^\s*\n/, "")
79
+ css.gsub!(/^\s*\n/, "")
80
+ if rcss == css
81
+ puts "Test \"#{testname}\" passed"
82
+ else
83
+ puts "Test \"#{testname}\" failed"
84
+ puts "--- RESULT ---"
85
+ puts rcss
86
+ puts "--- EXPECTED ---"
87
+ puts css
88
+ puts "---"
89
+ raise
90
+ end
91
+ end
92
+ end
93
+
94
+ Rake::GemPackageTask.new(spec) do |pkg|
95
+ pkg.need_zip = true
96
+ pkg.need_tar = true
97
+ end
data/TODO ADDED
@@ -0,0 +1,8 @@
1
+ = Rcss TODO list
2
+
3
+ == Future development
4
+ * Implement Server-side Templates
5
+ * Generator for controller
6
+
7
+ == Fixes
8
+ * Modify Rakefile to support package task
data/bin/rcss ADDED
@@ -0,0 +1,7 @@
1
+ begin
2
+ require 'rcss'
3
+ rescue LoadError
4
+ require 'rubygems'
5
+ require_gem 'rcss'
6
+ end
7
+ puts Rcss::Ssc.new( ARGF.read ).to_css
data/lib/rcss.rb ADDED
@@ -0,0 +1,120 @@
1
+ require 'erb'
2
+
3
+ require 'rubygems'
4
+
5
+ module Rcss #:nodoc:
6
+
7
+ VERSION = "0.3.0"
8
+
9
+ # Implements CSS-SSC in Ruby.
10
+ #
11
+ # Main features:
12
+ #
13
+ # * Create rich CSS files using:
14
+ #
15
+ # * ERB templates
16
+ #
17
+ # * Server-side constants
18
+ #
19
+ # * Server-side classes (preliminary)
20
+ #
21
+ # * Simply add Rcss files to any Rails application
22
+ #
23
+ # * Process Rcss files off-line using command line executable
24
+ #
25
+ class Ssc < String
26
+
27
+ @@SERVER_CONSTANTS = /@server\s+(?:variables|constants)\s*\{\s*([^\}]+)\s*\}\s*/m
28
+
29
+ @@SERVER_CONSTANT = /([^:\s]+)\s*:\s*([^;]+)\s*;/m
30
+
31
+ @@SERVER_CLASS = /@server\s+(\&\w?[-_\w\d]*)\s+\{([^\}]*)\}/m
32
+
33
+ @@EXTENDS_ATTRIBUTE = /extends\s*:\s*(\&\w?[-_\w\d]*);/m
34
+
35
+ def initialize(string) # :nodoc:
36
+ super(string)
37
+ end
38
+
39
+ def parse(text, binding) # :nodoc:
40
+ classes = Hash.new
41
+ constants = Hash.new
42
+
43
+ # Apply ERB as it has the highest priority
44
+ rcss = ERB.new(text, nil, '-').result(binding)
45
+
46
+ # Apply SSC in two steps:
47
+
48
+ # 1. Find and collect all server-side constants
49
+ rcss.gsub!(@@SERVER_CONSTANTS) do
50
+ $1.scan(@@SERVER_CONSTANT) do
51
+ constants[$1]=$2
52
+ end
53
+ ""
54
+ end
55
+
56
+ # 2. Substitute constants with values
57
+ rcss.gsub!(/[^:;\s]+/) do
58
+ constants[$&] or $&
59
+ end
60
+
61
+ # Apply server-side classes
62
+ rcss.gsub!(@@SERVER_CLASS) do
63
+ class_name = $1
64
+ body = $2
65
+ body.gsub!(@@EXTENDS_ATTRIBUTE) { classes[$1] }
66
+ classes[class_name] = body.strip
67
+ ""
68
+ end
69
+ rcss.gsub!(@@EXTENDS_ATTRIBUTE) { classes[$1] }
70
+
71
+ rcss
72
+ end
73
+
74
+ # Generates CSS from Rcss contents
75
+ #
76
+ # When binding is provided it is used to evaluate ERB template
77
+ #
78
+ # template = <<-TXT
79
+ # @server constants { my_color: #fff; }
80
+ # body { color: my_color; }
81
+ # TXT
82
+ # rcss = Rcss::Ssc.new(template)
83
+ # rcss.to_css
84
+ # #=> "body { color: #fff; }
85
+ #
86
+ def to_css(binding=nil)
87
+ parse(self.dup, binding)
88
+ end
89
+
90
+ private :parse
91
+ end
92
+
93
+ # Rails handler for Rcss files
94
+ class RcssHandler
95
+ include ERB::Util
96
+
97
+ def initialize(action_view) #:nodoc:
98
+ @action_view = action_view
99
+ end
100
+
101
+ # Renders given template using local_assigns for evaluation
102
+ #
103
+ # Modifies response headers:
104
+ #
105
+ # Content-Type: text/css
106
+ #
107
+ def render(template, local_assigns)
108
+ @action_view.controller.headers["Content-Type"] = 'text/css'
109
+ b = binding
110
+
111
+ local_assigns.stringify_keys!
112
+ local_assigns.each { |key, value| eval "#{key} = local_assigns[\"#{key}\"]", b }
113
+ Ssc.new(template).to_css(b)
114
+ end
115
+ end
116
+ end
117
+
118
+ if Object.const_defined? "ActionView"
119
+ ActionView::Base::register_template_handler 'rcss', Rcss::RcssHandler
120
+ end
@@ -0,0 +1,5 @@
1
+ <% color = "#fff" %>
2
+ body {
3
+ font-family: Tahoma, helvetica, sans-serif;
4
+ color: <%= color %>;
5
+ }
@@ -0,0 +1,4 @@
1
+ body {
2
+ font-family: Tahoma, helvetica, sans-serif;
3
+ color: #fff;
4
+ }
@@ -0,0 +1,19 @@
1
+ @server &trebuchet_font {
2
+ font-family: "Trebuchet MS", arial, helvetica, sans-serif;
3
+ }
4
+
5
+ @server &header {
6
+ extends: &trebuchet_font;
7
+ background-color: #fff;
8
+ color: #f00;
9
+ }
10
+
11
+ body {
12
+ extends: &trebuchet_font;
13
+ color: #000;
14
+ }
15
+
16
+ h1 {
17
+ extends: &header;
18
+ font-weight: bold;
19
+ }
@@ -0,0 +1,11 @@
1
+ body {
2
+ font-family: "Trebuchet MS", arial, helvetica, sans-serif;
3
+ color: #000;
4
+ }
5
+
6
+ h1 {
7
+ font-family: "Trebuchet MS", arial, helvetica, sans-serif;
8
+ background-color: #fff;
9
+ color: #f00;
10
+ font-weight: bold;
11
+ }
@@ -0,0 +1,3 @@
1
+ body {
2
+ font-family: Tahoma, helvetica, sans-serif;
3
+ }
@@ -0,0 +1,3 @@
1
+ body {
2
+ font-family: Tahoma, helvetica, sans-serif;
3
+ }
@@ -0,0 +1,23 @@
1
+ @server constants {
2
+ my_color : #fff;
3
+ common-font: Tahoma, helvetica, sans-serif;
4
+ common-font-fixed: Courier, fixed;
5
+ }
6
+
7
+ @server variables {
8
+ my_other_color : #f00;
9
+ }
10
+
11
+ body {
12
+ font-family: common-font;
13
+ color: my_color;
14
+ background-color: my_other_color;
15
+ }
16
+
17
+ pre {
18
+ font-family: common-font-fixed;
19
+ }
20
+
21
+ @server constants { my_color : #0f0; common-font: helvetica; }
22
+
23
+ h1 { color: my_color; font-family: common-font; }
@@ -0,0 +1,11 @@
1
+ body {
2
+ font-family: helvetica;
3
+ color: #0f0;
4
+ background-color: #f00;
5
+ }
6
+
7
+ pre {
8
+ font-family: Courier, fixed;
9
+ }
10
+
11
+ h1 { color: #0f0; font-family: helvetica; }
@@ -0,0 +1,8 @@
1
+ @server constants {
2
+ my_color : #fff;
3
+ }
4
+
5
+ body {
6
+ font-family: Tahoma, helvetica, sans-serif;
7
+ color: my_color;
8
+ }
@@ -0,0 +1,4 @@
1
+ body {
2
+ font-family: Tahoma, helvetica, sans-serif;
3
+ color: #fff;
4
+ }
metadata ADDED
@@ -0,0 +1,69 @@
1
+ !ruby/object:Gem::Specification
2
+ rubygems_version: 0.8.11
3
+ specification_version: 1
4
+ name: rcss
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.3.0
7
+ date: 2005-10-18 00:00:00 +02:00
8
+ summary: Rcss - CSS Server-side Constants for Ruby/Rails
9
+ require_paths:
10
+ - lib
11
+ email: bragi.ragnarson@gmail.com
12
+ homepage: http://rcss.rubyforge.org
13
+ rubyforge_project: rcss
14
+ description: No more search-and-replace in CSS files. Use your familiar ERB syntax (the same you use in rhtml files) to deliver constants to CSS files. You can even extract values for constants from database using ActiveRecord. * Familiar ERB syntax * Extend your classes with multiple attributes with ease
15
+ autorequire: rcss
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: true
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ authors:
29
+ - Bragi Ragnarson
30
+ files:
31
+ - README
32
+ - CHANGES
33
+ - TODO
34
+ - MIT-LICENSE
35
+ - Rakefile
36
+ - lib/rcss.rb
37
+ - bin/rcss
38
+ - test/data
39
+ - test/data/ssc-simple.in.rcss
40
+ - test/data/ssc-complex.in.rcss
41
+ - test/data/ssc-simple.out.css
42
+ - test/data/ssc-complex.out.css
43
+ - test/data/erb.in.rcss
44
+ - test/data/erb.out.css
45
+ - test/data/extend.in.rcss
46
+ - test/data/extend.out.css
47
+ - test/data/simple.in.rcss
48
+ - test/data/simple.out.css
49
+ test_files: []
50
+
51
+ rdoc_options:
52
+ - --title
53
+ - Rcss - CSS Server-side Constants for Ruby/Rails
54
+ - --main
55
+ - README
56
+ - --line-numbers
57
+ extra_rdoc_files:
58
+ - README
59
+ - MIT-LICENSE
60
+ - TODO
61
+ - CHANGES
62
+ executables:
63
+ - rcss
64
+ extensions: []
65
+
66
+ requirements: []
67
+
68
+ dependencies: []
69
+