client_variable 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f7c94ffc24ff4e1ffde03b09ace0e0e4aa2d9ca
4
- data.tar.gz: f2b764f1283f1613ec5fe67db04c416da6be69e8
3
+ metadata.gz: 0732e79e3a102d53d28693bf1ea5c9a88d6372c2
4
+ data.tar.gz: 6525cd8fe81ddcb8931dec17e6e055938d8c6903
5
5
  SHA512:
6
- metadata.gz: c87745189d44cff603ae4438452bf18655d67e32c9418b100487188e02842c246dcbcb4e65250e530bae8f384153bdaf00052f02fe1bfe19b8dc868a40967f76
7
- data.tar.gz: 57452bc6a541eb9a33644b6198f35ed926579c40684b57b4ec3b7acb58d7ec892312bdf5980bb1d0ea0ba9565d52a6fac04c5d678d98d2820ad3e391f9785d05
6
+ metadata.gz: 61ae156eea015680a24f830348a0ce8d432b87ac2c29aa0d3f2682917d3092b6703900f2fd78be4ce5abc555d10f9cd77c98e1c34273797839dfd3ac8870cc3d
7
+ data.tar.gz: 535c1dd129c2bc20e6af3f329a54529aecedacda8e7f31011812ec5ccac92a67edb48e93041a1cf4f689874366dcb30b492a8768bf77566db93e88db52cb2ca3
@@ -1,7 +1,7 @@
1
1
  require 'client_variable/version'
2
2
  require 'rails/engine'
3
3
 
4
- module Client
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
- config = if File.exist?(path)
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 Client
1
+ module ClientVariable
2
2
  class Global < Variable
3
3
  class << self
4
4
  def values
@@ -1,4 +1,4 @@
1
- module Client
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, Client::Helpers::Instance
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 Client
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
- Client.generate.merge([Global.values, Request.values].inject(:merge))
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, Client::Helpers::View
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 Client
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', Client::TiltHandlebars
35
- Sprockets.register_engine '.mquy', Client::TiltHandlebars
34
+ Tilt.register 'mquy', ClientVariable::TiltHandlebars
35
+ Sprockets.register_engine '.mquy', ClientVariable::TiltHandlebars
@@ -1,6 +1,6 @@
1
1
  require "action_controller/railtie"
2
2
 
3
- module Client
3
+ module ClientVariable
4
4
  class Railtie < ::Rails::Railtie
5
5
  rake_tasks do
6
6
  load "client_variable/rails/task.rake"
@@ -1,4 +1,4 @@
1
- module Client
1
+ module ClientVariable
2
2
  class Request
3
3
  class << self
4
4
  def env
@@ -19,7 +19,7 @@ module Client
19
19
  end
20
20
 
21
21
  def values
22
- env.blank? ? {} : env['client']
22
+ env && env['client'] ? env['client'] : {}
23
23
  end
24
24
 
25
25
  def clear
@@ -1,3 +1,3 @@
1
1
  module ClientVariable
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -1,4 +1,6 @@
1
1
  rails = (function(exports, global) {
2
+ 'use strict';
3
+
2
4
  var datum = exports;
3
5
  var defaultSeparator = '.';
4
6
 
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.5
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-24 00:00:00.000000000 Z
11
+ date: 2013-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler