optipipe 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/optipipe/models/mapper.rb +14 -16
- data/lib/optipipe/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: 85492f3aeccad8a655259c18a3dacfea5b68944b
|
4
|
+
data.tar.gz: 525e89e4da9b61eca8c8e179664f208624f17449
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4001b43c9690715a1539e60b2c231607fba61cff2816c88c87791b456b03b8a61a2f67888aec8ca04ed23ad07ba6c02d212fd28acf09c62ff66c73681679bdc7
|
7
|
+
data.tar.gz: 7767ae51b75fb9a4eb00fdc67bb4b0c13df9e4be4a8ddf0fc1a41a6201523c70153ed8eb84322a980fde8bf8c7bfbaa4f8d231595c6ef165c6f057045e7ba571
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Optipipe
|
2
2
|
def self.initial_load!
|
3
|
-
Mapper.
|
4
|
-
Mapper.
|
3
|
+
Mapper.load_yaml_data('javascripts')
|
4
|
+
Mapper.load_yaml_data('stylesheets')
|
5
5
|
end
|
6
6
|
|
7
7
|
class Mapper
|
@@ -14,23 +14,21 @@ module Optipipe
|
|
14
14
|
get_yaml_data('stylesheets')[controller_path]
|
15
15
|
end
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
def get_yaml_data(type)
|
17
|
+
def load_yaml_data(type)
|
20
18
|
const_name = :"#{type.upcase}_YAML_DATA"
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
yaml_data
|
25
|
-
|
26
|
-
data = YAML.load(File.open(mapper_yaml))
|
27
|
-
yaml_data[data['controller_path']] ||= []
|
28
|
-
yaml_data[data['controller_path']] << data
|
29
|
-
end
|
30
|
-
self.const_set(const_name, yaml_data)
|
19
|
+
yaml_data = {}
|
20
|
+
Dir.glob(Rails.root.join('app', 'assets', type, 'optipipe', 'mappers', '*')).each do |mapper_yaml|
|
21
|
+
data = YAML.load(File.open(mapper_yaml))
|
22
|
+
yaml_data[data['controller_path']] ||= []
|
23
|
+
yaml_data[data['controller_path']] << data
|
31
24
|
end
|
25
|
+
self.const_set(const_name, yaml_data)
|
26
|
+
end
|
32
27
|
|
33
|
-
|
28
|
+
private
|
29
|
+
|
30
|
+
def get_yaml_data(type)
|
31
|
+
self.const_get(:"#{type.upcase}_YAML_DATA")
|
34
32
|
end
|
35
33
|
end
|
36
34
|
end
|
data/lib/optipipe/version.rb
CHANGED