sinatra-compass 0.4.0.a → 0.4.0.b
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -0
- data/lib/sinatra/compass.rb +7 -3
- metadata +81 -34
data/README.md
CHANGED
@@ -9,6 +9,12 @@ BigBand
|
|
9
9
|
Sinatra::Compass is part of the [BigBand](http://github.com/rkh/big_band) stack.
|
10
10
|
Check it out if you are looking for other fancy Sinatra extensions.
|
11
11
|
|
12
|
+
|
13
|
+
Installation
|
14
|
+
------------
|
15
|
+
|
16
|
+
gem install sinatra-compass --prerelease
|
17
|
+
|
12
18
|
Usage
|
13
19
|
-----
|
14
20
|
|
data/lib/sinatra/compass.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require "compass"
|
1
2
|
require "sinatra/base"
|
2
3
|
require "sinatra/sugar"
|
3
4
|
require "sinatra/advanced_routes"
|
@@ -6,13 +7,15 @@ module Sinatra
|
|
6
7
|
module Compass
|
7
8
|
|
8
9
|
module ClassMethods
|
9
|
-
attr_reader :compass_route
|
10
|
+
attr_reader :compass_route, :compass_prefix
|
10
11
|
def get_compass(path, &block)
|
12
|
+
path.sub! /^\//, ''
|
11
13
|
block ||= Proc.new do |file|
|
12
14
|
content_type 'text/css', :charset => 'utf-8'
|
13
15
|
compass :"#{path}/#{params[:name]}"
|
14
16
|
end
|
15
17
|
set :compass, :sass_dir => views / path unless compass[:sass_dir] && compass[:sass_dir].directory?
|
18
|
+
@compass_prefix = "/#{path}"
|
16
19
|
@compass_route.deactivate if @compass_route
|
17
20
|
@compass_route = get("/#{path}" / ":name.css", &block)
|
18
21
|
end
|
@@ -23,8 +26,9 @@ module Sinatra
|
|
23
26
|
options.merge! ::Compass.sass_engine_options
|
24
27
|
sass file, options
|
25
28
|
end
|
26
|
-
|
27
|
-
|
29
|
+
|
30
|
+
def stylesheet(name)
|
31
|
+
settings.compass_prefix / name
|
28
32
|
end
|
29
33
|
end
|
30
34
|
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-compass
|
3
|
-
version: &
|
4
|
-
|
3
|
+
version: &id004 !ruby/object:Gem::Version
|
4
|
+
prerelease: true
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 4
|
8
|
+
- 0
|
9
|
+
- b
|
10
|
+
version: 0.4.0.b
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Konstantin Haase
|
@@ -9,66 +15,103 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date: 2010-
|
18
|
+
date: 2010-04-16 00:00:00 +02:00
|
13
19
|
default_executable:
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: monkey-lib
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
25
|
requirements:
|
21
|
-
- -
|
22
|
-
-
|
23
|
-
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
- 4
|
31
|
+
- 0
|
32
|
+
version: 0.4.0
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
24
35
|
- !ruby/object:Gem::Dependency
|
25
36
|
name: sinatra-sugar
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ~>
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
segments:
|
43
|
+
- 0
|
44
|
+
- 4
|
45
|
+
- 0
|
46
|
+
version: 0.4.0
|
26
47
|
type: :runtime
|
27
|
-
|
28
|
-
|
48
|
+
version_requirements: *id002
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: haml-more
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
29
53
|
requirements:
|
30
|
-
- -
|
31
|
-
-
|
32
|
-
|
54
|
+
- - ~>
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
segments:
|
57
|
+
- 0
|
58
|
+
- 4
|
59
|
+
- 0
|
60
|
+
- c
|
61
|
+
version: 0.4.0.c
|
62
|
+
type: :runtime
|
63
|
+
version_requirements: *id003
|
33
64
|
- !ruby/object:Gem::Dependency
|
34
65
|
name: sinatra-test-helper
|
35
|
-
|
36
|
-
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
prerelease: false
|
67
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
38
68
|
requirements:
|
39
69
|
- - "="
|
40
|
-
- *
|
41
|
-
|
70
|
+
- *id004
|
71
|
+
type: :development
|
72
|
+
version_requirements: *id005
|
42
73
|
- !ruby/object:Gem::Dependency
|
43
74
|
name: sinatra
|
44
|
-
|
45
|
-
|
46
|
-
version_requirements: !ruby/object:Gem::Requirement
|
75
|
+
prerelease: false
|
76
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
47
77
|
requirements:
|
48
78
|
- - ">="
|
49
79
|
- !ruby/object:Gem::Version
|
80
|
+
segments:
|
81
|
+
- 0
|
82
|
+
- 9
|
83
|
+
- 4
|
50
84
|
version: 0.9.4
|
51
|
-
|
85
|
+
type: :runtime
|
86
|
+
version_requirements: *id006
|
52
87
|
- !ruby/object:Gem::Dependency
|
53
88
|
name: compass
|
54
|
-
|
55
|
-
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
prerelease: false
|
90
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
57
91
|
requirements:
|
58
92
|
- - ">="
|
59
93
|
- !ruby/object:Gem::Version
|
94
|
+
segments:
|
95
|
+
- 0
|
96
|
+
- 8
|
97
|
+
- 17
|
60
98
|
version: 0.8.17
|
61
|
-
|
99
|
+
type: :runtime
|
100
|
+
version_requirements: *id007
|
62
101
|
- !ruby/object:Gem::Dependency
|
63
102
|
name: rspec
|
64
|
-
|
65
|
-
|
66
|
-
version_requirements: !ruby/object:Gem::Requirement
|
103
|
+
prerelease: false
|
104
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
67
105
|
requirements:
|
68
106
|
- - ">="
|
69
107
|
- !ruby/object:Gem::Version
|
108
|
+
segments:
|
109
|
+
- 1
|
110
|
+
- 3
|
111
|
+
- 0
|
70
112
|
version: 1.3.0
|
71
|
-
|
113
|
+
type: :development
|
114
|
+
version_requirements: *id008
|
72
115
|
description: Better Compass integration for Sinatra (part of BigBand).
|
73
116
|
email: konstantin.mailinglists@googlemail.com
|
74
117
|
executables: []
|
@@ -93,18 +136,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
93
136
|
requirements:
|
94
137
|
- - ">="
|
95
138
|
- !ruby/object:Gem::Version
|
139
|
+
segments:
|
140
|
+
- 0
|
96
141
|
version: "0"
|
97
|
-
version:
|
98
142
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
143
|
requirements:
|
100
144
|
- - ">"
|
101
145
|
- !ruby/object:Gem::Version
|
146
|
+
segments:
|
147
|
+
- 1
|
148
|
+
- 3
|
149
|
+
- 1
|
102
150
|
version: 1.3.1
|
103
|
-
version:
|
104
151
|
requirements: []
|
105
152
|
|
106
153
|
rubyforge_project:
|
107
|
-
rubygems_version: 1.3.
|
154
|
+
rubygems_version: 1.3.6
|
108
155
|
signing_key:
|
109
156
|
specification_version: 3
|
110
157
|
summary: Better Compass integration for Sinatra (part of BigBand).
|