jcompiler 0.1.91 → 0.1.93

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: 17d228cc0e4a4a814b5214753fae6135fe9eed06
4
- data.tar.gz: b1ad3deaf71c5cfe5038c602e462ba1cdd01ce3e
3
+ metadata.gz: b5289efac529f01ab83aaf69ada86ac5452e180a
4
+ data.tar.gz: 0d63d2d4797b63891d336df841d824775df04b52
5
5
  SHA512:
6
- metadata.gz: 69c05a8e4d2e7643fc2f0418d39c98fc241984f980dde9ef974bd1a626397ca982c3e8ceca8a19be3a2d8249fbea1cca2c2534776283e892fbeaf73990beb5d1
7
- data.tar.gz: 96921c44b2feb2b5989dc0a0520e882b73bd42a126dff4ba9eeb35b60b97371dd65ac92e717301a3f3869798c1ed5da976c305dcffa92c9e7a56e792368df781
6
+ metadata.gz: ee83a196f442a1b9d8a3f6170f361687f849f8c9f22e531efc688a62d2613087f94c9ad0a7452d6369acbe63d4c5f6ba45e90b6fa081226b3d9a47c9bb6f7560
7
+ data.tar.gz: 1758765c5759acb63f2ad69f18505800b420f03e22dfe894685b93f782ca9a49ef31de09729c2452a8eb09e079db6a3ab6a8e13ba5a0954075c1b248a00c56d8
data/Gemfile CHANGED
@@ -1,6 +1,3 @@
1
1
  source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
-
5
- gem 'ParseTree'
6
- gem 'sourcify'
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jcompiler (0.1.84)
5
- ParseTree (~> 3.0.9)
4
+ jcompiler (0.1.92)
5
+ ParseTree (~> 3.0, >= 3.0.9)
6
6
  sourcify (~> 0)
7
7
 
8
8
  GEM
@@ -33,6 +33,4 @@ PLATFORMS
33
33
  ruby
34
34
 
35
35
  DEPENDENCIES
36
- ParseTree
37
36
  jcompiler!
38
- sourcify
data/build CHANGED
@@ -1 +1 @@
1
- 92
1
+ 94
data/jcompiler.gemspec CHANGED
@@ -8,6 +8,4 @@ Gem::Specification.new do |s|
8
8
  s.homepage = 'https://bitbucket.org/pandora2000/jcompiler'
9
9
  s.license = 'MIT'
10
10
  s.files = `git ls-files`.split("\n")
11
- s.add_dependency 'ParseTree', '~> 3.0', '>= 3.0.9'
12
- s.add_dependency 'sourcify', '~> 0'
13
11
  end
@@ -1,7 +1,7 @@
1
1
  class Jcompiler::Cache
2
2
  @@store = {}
3
3
 
4
- def self.read(id, source, bind)
5
- @@store[id] ||= Jcompiler::Compiler.new(source, bind).compile
4
+ def self.read(id, source)
5
+ @@store[id] ||= Jcompiler::Compiler.new(source).compile
6
6
  end
7
7
  end
@@ -1,15 +1,14 @@
1
1
  class Jcompiler::Compiler
2
- def initialize(source, bind)
2
+ def initialize(source)
3
3
  @source = source
4
- @bind = bind
5
4
  end
6
5
 
7
6
  def compile
8
- bind.local_variable_set(:json, Jcompiler::Provider.new(bind))
9
- bind.eval(source)
7
+ json = Jcompiler::Provider.new
8
+ eval(source)
10
9
  end
11
10
 
12
11
  private
13
12
 
14
- attr_reader :source, :bind
13
+ attr_reader :source
15
14
  end
@@ -3,6 +3,6 @@ class Jcompiler::Handler
3
3
  self.default_format = Mime::JSON
4
4
 
5
5
  def self.call(template)
6
- "Jcompiler::Cache.read(\"#{template.identifier}\", \"#{template.source}\", binding)"
6
+ Jcompiler::Cache.read(template.identifier, template.source)
7
7
  end
8
8
  end
@@ -1,17 +1,7 @@
1
1
  class Jcompiler::Provider
2
- def initialize(bind)
3
- @bind = bind
4
- end
5
-
6
2
  def array!(arr, &block)
7
- File.open('/tmp/hoge', 'w') do |f|
8
- f.puts(block.call(1))
9
- end
10
- puts block.to_source(attached_to: :block)
11
- "[]"
12
- end
3
+ #item_name = block.parameters[0][1].to_s
13
4
 
14
- private
15
-
16
- attr_reader :bind
5
+ "\"[]\""
6
+ end
17
7
  end
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.91
4
+ version: 0.1.93
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tetsuri Moriya
@@ -9,41 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2014-05-23 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: ParseTree
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '3.0'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 3.0.9
23
- type: :runtime
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '3.0'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 3.0.9
33
- - !ruby/object:Gem::Dependency
34
- name: sourcify
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '0'
40
- type: :runtime
41
- prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: '0'
12
+ dependencies: []
47
13
  description: High performance JSON view via compiled DSL
48
14
  email:
49
15
  - tetsuri.moriya@gmail.com