jcompiler 0.1.109 → 0.1.110

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: d2ec0564fadc4684c4b0cafc2b4dd894c9de3a25
4
- data.tar.gz: 205036178218fa9ec453238d678024a1b806b50b
3
+ metadata.gz: f02bf1cd33e4ac4ab9bbfac7d22c0bd2b711656a
4
+ data.tar.gz: 99f381256fd52a2bdd39cc61aeb8b044d39a354b
5
5
  SHA512:
6
- metadata.gz: 8b34fa53bf48af5be36d6267748d4eb1a1cb33c98ef76c965da7d75ef4db5fb9a61f2688fc6e060d16b4f926e04a5792e653b35b3fc583bf120583f949a16691
7
- data.tar.gz: cdbce9e6fda20db5b6e53a0832b27afd33ad79adb5a12ee37acdd24d5065be48f03b22d5aabe0765c5302fb5a465ef9615b60068405f9992e719cd0a5da7bdec
6
+ metadata.gz: a6270a9b7ab02ccf6272ef664839eae2de47846944439d058fbda26d6005f242b0970c6a98696092cad499d2602a4ab6c9cf3fe48374b63b50967e44dad7c87d
7
+ data.tar.gz: 7802c7ea92b1a9fc6275c02868950563dfc37274b3f2f22ca8e9d2cdd708aa3895a9d5815203b8a220800a425a24b3e4d040afd86bcbf57b7179c5e2a539b024
data/build CHANGED
@@ -1 +1 @@
1
- 110
1
+ 111
data/lib/initialize.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require_relative 'core_ext/proc'
2
+
1
3
  ActiveSupport::Dependencies.autoload_paths << File.expand_path('..', __FILE__)
2
4
 
3
5
  ActionView::Template.register_template_handler :jcompiler, Jcompiler::Handler
@@ -1,10 +1,17 @@
1
1
  class Jcompiler::Provider
2
+ def initialize
3
+ @context = nil
4
+ end
5
+
2
6
  def object!(arg_name = nil, &block)
7
+ pre_context = context
8
+ context = []
3
9
  srcs, subst_src = if arg_name
4
10
  [block.call(nil), "#{block.parameters[0][1]}=#{arg_name};"]
5
11
  else
6
12
  [block.call, '']
7
13
  end
14
+ context = pre_context
8
15
  %{"{\#{#{subst_src}[#{srcs.join(',')}].join(',')}}"}
9
16
  end
10
17
 
@@ -17,4 +24,12 @@ class Jcompiler::Provider
17
24
  def integer!(i)
18
25
  %{"#{i}"}
19
26
  end
27
+
28
+ def method_missing(name, *args, &block)
29
+ context << %{"\\"#{name}\\":3"}
30
+ end
31
+
32
+ private
33
+
34
+ attr_accessor :context
20
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jcompiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.109
4
+ version: 0.1.110
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tetsuri Moriya
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-23 00:00:00.000000000 Z
11
+ date: 2014-05-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: High performance JSON view via compiled DSL
14
14
  email: