client_variable 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/client_variable.rb +5 -4
- data/lib/client_variable/global.rb +1 -1
- data/lib/client_variable/helper/controller.rb +2 -2
- data/lib/client_variable/helper/view.rb +3 -3
- data/lib/client_variable/rails/engine.rb +3 -3
- data/lib/client_variable/rails/railtie.rb +1 -1
- data/lib/client_variable/request.rb +2 -2
- data/lib/client_variable/version.rb +1 -1
- data/vendor/assets/javascripts/variable.js +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0732e79e3a102d53d28693bf1ea5c9a88d6372c2
|
4
|
+
data.tar.gz: 6525cd8fe81ddcb8931dec17e6e055938d8c6903
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61ae156eea015680a24f830348a0ce8d432b87ac2c29aa0d3f2682917d3092b6703900f2fd78be4ce5abc555d10f9cd77c98e1c34273797839dfd3ac8870cc3d
|
7
|
+
data.tar.gz: 535c1dd129c2bc20e6af3f329a54529aecedacda8e7f31011812ec5ccac92a67edb48e93041a1cf4f689874366dcb30b492a8768bf77566db93e88db52cb2ca3
|
data/lib/client_variable.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'client_variable/version'
|
2
2
|
require 'rails/engine'
|
3
3
|
|
4
|
-
module
|
4
|
+
module ClientVariable
|
5
5
|
class Variable
|
6
6
|
class << self
|
7
7
|
def global
|
@@ -47,10 +47,11 @@ module Client
|
|
47
47
|
|
48
48
|
def self.generate
|
49
49
|
path = "#{Rails.root}/config/client_variable.yml"
|
50
|
-
|
50
|
+
if File.exist?(path)
|
51
51
|
data = YAML.load(ERB.new(File.new("#{Rails.root}/config/client_variable.yml").read).result)
|
52
|
-
data[Rails.env]
|
53
|
-
end
|
52
|
+
config = data[Rails.env]
|
53
|
+
end
|
54
|
+
config || {}
|
54
55
|
end
|
55
56
|
|
56
57
|
class Engine < Rails::Engine; end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module ClientVariable
|
2
2
|
module Helpers
|
3
3
|
module Instance
|
4
4
|
def self.included base
|
@@ -23,4 +23,4 @@ module Client
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
ActionController::Base.send :include,
|
26
|
+
ActionController::Base.send :include, ClientVariable::Helpers::Instance
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'action_view'
|
2
2
|
require 'action_controller'
|
3
3
|
|
4
|
-
module
|
4
|
+
module ClientVariable
|
5
5
|
module Helpers
|
6
6
|
module View
|
7
7
|
extend ActionView::Helpers::JavaScriptHelper
|
@@ -43,11 +43,11 @@ module Client
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def values
|
46
|
-
|
46
|
+
ClientVariable.generate.merge([Global.values, Request.values].inject(:merge))
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
-
ActionView::Base.send :include,
|
53
|
+
ActionView::Base.send :include, ClientVariable::Helpers::View
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'sprockets/engines'
|
2
2
|
require 'tilt/template'
|
3
3
|
|
4
|
-
module
|
4
|
+
module ClientVariable
|
5
5
|
class Engine < Rails::Engine
|
6
6
|
initializer "sprockets.mquy", :after => "sprockets.environment", :group => :all do |app|
|
7
7
|
app.assets.register_engine('.mquy', TiltHandlebars)
|
@@ -31,5 +31,5 @@ module Client
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
Tilt.register 'mquy',
|
35
|
-
Sprockets.register_engine '.mquy',
|
34
|
+
Tilt.register 'mquy', ClientVariable::TiltHandlebars
|
35
|
+
Sprockets.register_engine '.mquy', ClientVariable::TiltHandlebars
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: client_variable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MQuy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09
|
11
|
+
date: 2013-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|