staticmatic 0.10.4 → 0.10.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/staticmatic/helpers.rb +2 -2
- data/spec/helpers_spec.rb +11 -0
- metadata +2 -2
data/VERSION.yml
CHANGED
data/lib/staticmatic/helpers.rb
CHANGED
@@ -44,10 +44,10 @@ module StaticMatic
|
|
44
44
|
filename_without_extension = File.basename(path).chomp(File.extname(path))
|
45
45
|
|
46
46
|
if !filename_without_extension.match(/^\_/)
|
47
|
-
|
47
|
+
path = path.gsub(/#{@staticmatic.base_dir}\/(src|site)\//, "").
|
48
48
|
gsub(/#{filename_without_extension}\.(sass|css)/, "")
|
49
49
|
|
50
|
-
options[:href] = "#{relative_path}#{filename_without_extension}.css"
|
50
|
+
options[:href] = "#{relative_path}#{path}#{filename_without_extension}.css"
|
51
51
|
output << tag(:link, options)
|
52
52
|
end
|
53
53
|
end
|
data/spec/helpers_spec.rb
CHANGED
@@ -26,4 +26,15 @@ describe "Helpers:" do
|
|
26
26
|
@links.should_not match(/\_forms.css/)
|
27
27
|
end
|
28
28
|
end
|
29
|
+
|
30
|
+
context "When using the stylesheet helper from a sub page" do
|
31
|
+
before do
|
32
|
+
@staticmatic.instance_variable_set("@current_page", "/sub/index.html")
|
33
|
+
@links = stylesheets
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should link relative to current page" do
|
37
|
+
@links.should match(/\.\.\/stylesheets/)
|
38
|
+
end
|
39
|
+
end
|
29
40
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: staticmatic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Bartholomew
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
12
|
+
date: 2009-10-07 00:00:00 +01:00
|
13
13
|
default_executable: staticmatic
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|