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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb12ce93b8eb79dacbca9af5d17aaf12da3a1819
4
- data.tar.gz: ca8d21faac2fa05a11c64ffc3ab1c0f615f9bb3d
3
+ metadata.gz: 85492f3aeccad8a655259c18a3dacfea5b68944b
4
+ data.tar.gz: 525e89e4da9b61eca8c8e179664f208624f17449
5
5
  SHA512:
6
- metadata.gz: ef2240339bc407fe03cc50450fa8856eb1583cdc7e9a1719b9c4247f36c4dde1405ddf6e186a1b3153dd315e5400af2e7c0dcc5bc167cb7748804189342be49b
7
- data.tar.gz: f95d8f5eb9d3e0f6340ffb3d3965f7fa3c74fdaa64d3e2e9b3ff056307be452f41c5912f4015181238b5a6b18710e00f40529d83e103730809883600839b73d2
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.class_eval { remove_const(:JAVASCRIPTS_YAML_DATA) } if Mapper.const_defined?(:JAVASCRIPTS_YAML_DATA)
4
- Mapper.class_eval { remove_const(:STYLESHEETS_YAML_DATA) } if Mapper.const_defined?(:STYLESHEETS_YAML_DATA)
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
- private
18
-
19
- def get_yaml_data(type)
17
+ def load_yaml_data(type)
20
18
  const_name = :"#{type.upcase}_YAML_DATA"
21
- if self.const_defined?(const_name) && Rails.env.production?
22
- yaml_data = self.const_get(const_name)
23
- else
24
- yaml_data = {}
25
- Dir.glob(Rails.root.join('app', 'assets', type, 'optipipe', 'mappers', '*')).each do |mapper_yaml|
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
- yaml_data
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
@@ -1,3 +1,3 @@
1
1
  module Optipipe
2
- VERSION = '0.4.2'
2
+ VERSION = '0.4.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optipipe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ykogure