staticmatic 0.11.0.alpha.1 → 0.11.0.alpha.3
Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml
CHANGED
data/lib/staticmatic/helpers.rb
CHANGED
@@ -22,7 +22,7 @@ module StaticMatic
|
|
22
22
|
if params.length == 0
|
23
23
|
# no specific files requested so include all in no particular order
|
24
24
|
stylesheet_dir = File.join(@staticmatic.src_dir, 'stylesheets')
|
25
|
-
stylesheet_directories = Dir[File.join(stylesheet_dir, '**','*.sass')]
|
25
|
+
stylesheet_directories = Dir[File.join(stylesheet_dir, '**','*.{sass,scss}')]
|
26
26
|
|
27
27
|
# Bit of a hack here - adds any stylesheets that exist in the site/ dir that haven't been generated from source sass
|
28
28
|
Dir[File.join(@staticmatic.site_dir, 'stylesheets', '*.css')].each do |filename|
|
@@ -45,7 +45,7 @@ module StaticMatic
|
|
45
45
|
|
46
46
|
if !filename_without_extension.match(/^\_/)
|
47
47
|
path = path.gsub(/#{@staticmatic.base_dir}\/(src|site)\//, "").
|
48
|
-
gsub(/#{filename_without_extension}\.(sass|css)/, "")
|
48
|
+
gsub(/#{filename_without_extension}\.(sass|scss|css)/, "")
|
49
49
|
|
50
50
|
options[:href] = "#{relative_path}#{path}#{filename_without_extension}.css"
|
51
51
|
output << tag(:link, options)
|
@@ -74,9 +74,16 @@ module StaticMatic::RenderMixin
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def generate_css(source, source_dir = '')
|
77
|
-
full_file_path = File.join(@src_dir, 'stylesheets', source_dir, "#{source}.sass")
|
77
|
+
# full_file_path = File.join(@src_dir, 'stylesheets', source_dir, "#{source}.sass")
|
78
|
+
full_file_path = Dir[File.join(@src_dir, 'stylesheets', source_dir, "#{source}.{sass,scss}")].first
|
79
|
+
|
78
80
|
begin
|
79
81
|
sass_options = { :load_paths => [ File.join(@src_dir, 'stylesheets') ] }.merge(self.configuration.sass_options)
|
82
|
+
|
83
|
+
if File.extname(full_file_path) == ".scss"
|
84
|
+
sass_options[:syntax] = :scss
|
85
|
+
end
|
86
|
+
|
80
87
|
stylesheet = Sass::Engine.new(File.read(full_file_path), sass_options)
|
81
88
|
stylesheet.to_css
|
82
89
|
rescue Exception => e
|
data/spec/helpers_spec.rb
CHANGED
@@ -20,6 +20,7 @@ describe "Helpers:" do
|
|
20
20
|
it "should set up links for all stylesheets" do
|
21
21
|
@links.should match(/stylesheets\/application\.css/)
|
22
22
|
@links.should match(/stylesheets\/nested\/a_nested_stylesheet\.css/)
|
23
|
+
@links.should match(/stylesheets\/sassy\.css/)
|
23
24
|
end
|
24
25
|
|
25
26
|
it "should not link to partials" do
|
data/spec/render_spec.rb
CHANGED
@@ -28,4 +28,10 @@ describe "StaticMatic::Render" do
|
|
28
28
|
@staticmatic.determine_layout("test/projects").should == "projects"
|
29
29
|
end
|
30
30
|
|
31
|
+
context "handling scss" do
|
32
|
+
it "should generate css from scss" do
|
33
|
+
@staticmatic.generate_css("sassy").should match(/color\: \#3bbfce\;/)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
31
37
|
end
|
metadata
CHANGED
@@ -7,8 +7,8 @@ version: !ruby/object:Gem::Version
|
|
7
7
|
- 11
|
8
8
|
- 0
|
9
9
|
- alpha
|
10
|
-
-
|
11
|
-
version: 0.11.0.alpha.
|
10
|
+
- 3
|
11
|
+
version: 0.11.0.alpha.3
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Stephen Bartholomew
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-04-
|
19
|
+
date: 2010-04-22 00:00:00 +01:00
|
20
20
|
default_executable: staticmatic
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -118,7 +118,6 @@ files:
|
|
118
118
|
- spec/sandbox/test_site/site/sub_folder/another_sub_folder/index.html
|
119
119
|
- spec/sandbox/test_site/site/sub_folder/another_sub_folder/index.html.html
|
120
120
|
- spec/sandbox/test_site/site/sub_folder/index.html
|
121
|
-
- spec/sandbox/test_site/src/configuration.rb
|
122
121
|
- spec/sandbox/test_site/src/helpers/application_helper.rb
|
123
122
|
- spec/sandbox/test_site/src/layouts/alternate_layout.haml
|
124
123
|
- spec/sandbox/test_site/src/layouts/default.haml
|
@@ -134,6 +133,7 @@ files:
|
|
134
133
|
- spec/sandbox/test_site/src/stylesheets/css_with_error.sass
|
135
134
|
- spec/sandbox/test_site/src/stylesheets/nested/a_nested_stylesheet.sass
|
136
135
|
- spec/sandbox/test_site/src/stylesheets/partials/_forms.sass
|
136
|
+
- spec/sandbox/test_site/src/stylesheets/sassy.scss
|
137
137
|
- spec/sandbox/tmp/Rakefile
|
138
138
|
- spec/sandbox/tmp/config/compass.rb
|
139
139
|
- spec/sandbox/tmp/config/site.rb
|
@@ -184,7 +184,6 @@ test_files:
|
|
184
184
|
- spec/render_spec.rb
|
185
185
|
- spec/rescue_spec.rb
|
186
186
|
- spec/sandbox/test_site/config/site.rb
|
187
|
-
- spec/sandbox/test_site/src/configuration.rb
|
188
187
|
- spec/sandbox/test_site/src/helpers/application_helper.rb
|
189
188
|
- spec/sandbox/tmp/config/compass.rb
|
190
189
|
- spec/sandbox/tmp/config/site.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
# stub for testing
|