loremGem 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/loremGem.rb +66 -68
- data/lib/loremGem/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3f947582458e21af2c00fc41e2fed0c1cefe517
|
4
|
+
data.tar.gz: b712518c67691e7d24874b4e4c89bd982c0e2a92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c06dce79e959d77c9f7506d7ac52b4575bf5f22e83c490751c94c54e104f55c3e6241452d627e04686d27004298bc32233e660a0e339b463f821e86530dea338
|
7
|
+
data.tar.gz: d6e2978d0fd757e3e4f7527f437911bab5457ac5ad87f0b722fb96ce8017b3ed172a16c3f482305cf5fc9ee68a4200f84ce963c3beecd9ccdd85288a4a91fcca
|
data/lib/loremGem.rb
CHANGED
@@ -3,72 +3,70 @@ require "loremGem/version"
|
|
3
3
|
module LoremGem
|
4
4
|
|
5
5
|
class << self
|
6
|
-
# Inspired by Kaminari
|
7
|
-
def load!
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
end
|
71
|
-
|
72
|
-
end
|
73
|
-
|
6
|
+
# Inspired by Kaminari
|
7
|
+
def load!
|
8
|
+
if rails?
|
9
|
+
register_rails_engine
|
10
|
+
elsif hanami?
|
11
|
+
register_hanami
|
12
|
+
elsif sprockets?
|
13
|
+
register_sprockets
|
14
|
+
end
|
15
|
+
configure_sass
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
# Paths
|
22
|
+
def gem_path
|
23
|
+
@gem_path ||= File.expand_path '..', File.dirname(__FILE__)
|
24
|
+
end
|
25
|
+
|
26
|
+
def stylesheets_path
|
27
|
+
File.join assets_path, 'stylesheets'
|
28
|
+
end
|
29
|
+
|
30
|
+
def javascripts_path
|
31
|
+
File.join assets_path, 'javascripts'
|
32
|
+
end
|
33
|
+
|
34
|
+
def assets_path
|
35
|
+
@assets_path ||= File.join gem_path, 'assets'
|
36
|
+
end
|
37
|
+
|
38
|
+
# Environment detection helpers
|
39
|
+
def sprockets?
|
40
|
+
defined?(::Sprockets)
|
41
|
+
end
|
42
|
+
|
43
|
+
def rails?
|
44
|
+
defined?(::Rails)
|
45
|
+
end
|
46
|
+
|
47
|
+
def hanami?
|
48
|
+
defined?(::Hanami)
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
52
|
+
|
53
|
+
def configure_sass
|
54
|
+
require 'sass'
|
55
|
+
|
56
|
+
::Sass.load_paths << stylesheets_path
|
57
|
+
end
|
58
|
+
|
59
|
+
def register_rails_engine
|
60
|
+
require 'LoremGem/engine'
|
61
|
+
end
|
62
|
+
|
63
|
+
def register_sprockets
|
64
|
+
Sprockets.append_path(stylesheets_path)
|
65
|
+
Sprockets.append_path(javascripts_path)
|
66
|
+
end
|
67
|
+
|
68
|
+
def register_hanami
|
69
|
+
Hanami::Assets.sources << assets_path
|
70
|
+
end
|
71
|
+
end
|
74
72
|
LoremGem.load!
|
data/lib/loremGem/version.rb
CHANGED