jcompiler 0.1.46 → 0.1.47

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: 3c0ab97a27e88f26b38d91cd5e8e9b1266d399c6
4
- data.tar.gz: 910cfe6cf3fe611299f320c3114e2269f10b23ca
3
+ metadata.gz: 5320625b94274c2890de72c0e9590782792d2dd0
4
+ data.tar.gz: 402fa9f040ba61eedda26f853ce88faabca96522
5
5
  SHA512:
6
- metadata.gz: 264dd51d0ddc6c0d7fcb66b633e3f9490e84774bf8c64c37505be36cb6a49653e7b5e99c108b27504032f09cbcb0cd3e1cea8153bd6ccae5e89261a438988953
7
- data.tar.gz: f21fc8edf8f435e9cbf651f2fc8109b92f0cd16d184138373c24b4a1c4a4476979a98a34a35a59f073692e69a7c7e6b15448e5ac951d1e14fb3c76a77ce3d761
6
+ metadata.gz: 4e4175141741799636b2352a38454669dd71d3ed53ac5579e5f28d0501c1ef89e0af1d735163cad119def17d7317e4f10e973b91d379e44d20c2edbf51d8f18f
7
+ data.tar.gz: 8dfba155ab881f604ab5eeb337f5abc7a83ed975b8c52708fc518e49e43a1f195e38966afa5bced72023764fbe0878d6a6dff68da85f64566c40c947b3ce5d4c
data/bin/update ADDED
@@ -0,0 +1,16 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ def stream_out(command)
4
+ IO.popen(command) do |lines|
5
+ lines.each do |line|
6
+ puts line
7
+ STDOUT.flush
8
+ end
9
+ end
10
+ end
11
+
12
+ root_path = File.expand_path('../..', __FILE__)
13
+
14
+ stream_out("rm -f #{root_path}/*.gem 2> /dev/null")
15
+ stream_out("gem build #{root_path}/jcompiler.gemspec")
16
+ stream_out("gem push #{root_path}/*.gem")
data/build ADDED
@@ -0,0 +1 @@
1
+ 48
data/lib/jcompiler.rb CHANGED
@@ -31,20 +31,12 @@ class Jcompiler
31
31
  end
32
32
 
33
33
  def self.code(id, source, bind)
34
+ if @@codes.has_key?(id)
35
+ @@codes[id] ||=
36
+ else
37
+
38
+ end
34
39
  debugger
35
40
  1
36
41
  end
37
42
  end
38
-
39
- class JcompilerHandler
40
- cattr_accessor :default_format
41
- self.default_format = Mime::JSON
42
-
43
- @@jcompiler = Jcompiler.new
44
-
45
- def self.call(template)
46
- "Jcompiler.code(\"#{template.identifier}\", \"#{template.source}\", binding)"
47
- end
48
- end
49
-
50
- ActionView::Template.register_template_handler :jcompiler, JcompilerHandler
@@ -0,0 +1,7 @@
1
+ class Jcompiler::Cache
2
+ @@store = {}
3
+
4
+ def self.read(id, source, bind)
5
+ @@store[id] ||= Jcompiler::Compiler.new(source, bind).compile
6
+ end
7
+ end
@@ -0,0 +1,8 @@
1
+ class Jcompiler::Compiler
2
+ def initialize(source, bind)
3
+ end
4
+
5
+ def compile
6
+ '"[]"'
7
+ end
8
+ end
@@ -0,0 +1,10 @@
1
+ class Jcompiler::Handler
2
+ cattr_accessor :default_format
3
+ self.default_format = Mime::JSON
4
+
5
+ def self.call(template)
6
+ "Jcompiler::Cache.read(\"#{template.identifier}\", \"#{template.source}\", binding)"
7
+ end
8
+ end
9
+
10
+ ActionView::Template.register_template_handler :jcompiler, Jcompiler::Handler
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jcompiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.46
4
+ version: 0.1.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tetsuri Moriya
@@ -21,8 +21,13 @@ files:
21
21
  - Gemfile
22
22
  - Gemfile.lock
23
23
  - README.md
24
+ - bin/update
25
+ - build
24
26
  - jcompiler.gemspec
25
27
  - lib/jcompiler.rb
28
+ - lib/jcompiler/cache.rb
29
+ - lib/jcompiler/compiler.rb
30
+ - lib/jcompiler/handler.rb
26
31
  - tmp/.gitignore
27
32
  homepage: https://bitbucket.org/pandora2000/jcompiler
28
33
  licenses: