gem_liux2 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/gem_liux2/version.rb +1 -1
- data/lib/gem_liux2.rb +40 -41
- metadata +3 -3
data/lib/gem_liux2/version.rb
CHANGED
data/lib/gem_liux2.rb
CHANGED
@@ -1,54 +1,53 @@
|
|
1
|
-
testcss_stylesheets_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'scss'))
|
2
|
-
begin
|
3
|
-
|
4
|
-
|
5
|
-
rescue LoadError
|
6
|
-
|
7
|
-
if ENV.key? 'SASS_PATH'
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
end
|
1
|
+
# testcss_stylesheets_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'scss'))
|
2
|
+
# begin
|
3
|
+
# require 'compass'
|
4
|
+
# Compass::Frameworks.register('testcss', :stylesheets_directory => testcss_stylesheets_path)
|
5
|
+
# rescue LoadError
|
6
|
+
# # compass not found, register on the Sass path via the environment.
|
7
|
+
# if ENV.key? 'SASS_PATH'
|
8
|
+
# ENV['SASS_PATH'] += File::PATH_SEPARATOR + testcss_stylesheets_path
|
9
|
+
# else
|
10
|
+
# ENV['SASS_PATH'] = testcss_stylesheets_path
|
11
|
+
# end
|
12
|
+
# end
|
13
13
|
|
14
14
|
# testcss_stylesheets_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'scss'))
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
#
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
# configure_sass
|
23
|
-
# end
|
16
|
+
module GemLiux2
|
17
|
+
class << self
|
18
|
+
# Inspired by Kaminari
|
19
|
+
def load!
|
20
|
+
register_compass_extension if compass?
|
24
21
|
|
25
|
-
|
22
|
+
configure_sass
|
23
|
+
end
|
26
24
|
|
27
|
-
#
|
28
|
-
# File.expand_path(File.join(File.dirname(__FILE__), "..", *subdirs))
|
29
|
-
# end
|
25
|
+
# Paths
|
30
26
|
|
31
|
-
|
27
|
+
def base_directory(*subdirs)
|
28
|
+
File.expand_path(File.join(File.dirname(__FILE__), "..", *subdirs))
|
29
|
+
end
|
32
30
|
|
33
|
-
#
|
34
|
-
# defined?(::Compass::Frameworks)
|
35
|
-
# end
|
31
|
+
# Environment detection helpers
|
36
32
|
|
37
|
-
|
33
|
+
def compass?
|
34
|
+
defined?(::Compass::Frameworks)
|
35
|
+
end
|
38
36
|
|
39
|
-
|
40
|
-
# require 'sass'
|
41
|
-
# require 'sass_paths'
|
42
|
-
# # ::Sass.load_paths << base_directory("scss")
|
43
|
-
# SassPaths.append_gem_path("gem_liux2", base_directory("scss"))
|
44
|
-
# end
|
37
|
+
private
|
45
38
|
|
46
|
-
|
47
|
-
|
48
|
-
|
39
|
+
def configure_sass
|
40
|
+
require 'sass'
|
41
|
+
::Sass.load_paths << base_directory("scss")
|
42
|
+
# SassPaths.append_gem_path("gem_liux2", base_directory("scss"))
|
43
|
+
end
|
49
44
|
|
50
|
-
|
51
|
-
|
45
|
+
def register_compass_extension
|
46
|
+
::Compass::Frameworks.register('testcss', :stylesheets_directory => base_directory("scss"))
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
52
51
|
|
53
|
-
|
52
|
+
GemLiux2.load!
|
54
53
|
|
metadata
CHANGED