yomikomu 0.1.0 → 0.2.0

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: c79155668190a8c88087c6c5742860d5a67d838a
4
- data.tar.gz: 48d6334da030db6727f082884982fb3046d7d4e7
3
+ metadata.gz: c24a27cea503e28dc7213b777a88feed4945571f
4
+ data.tar.gz: 934dd71846492df18f6848a115166ecd883ff5f7
5
5
  SHA512:
6
- metadata.gz: 2e630562b6fcc1e40d51e8dd22aae77b7048ffe64a3433a229fe8a0ae8c85be30cc6a1af4c0f2780d00fb74ebf5f2689d3cf06b0f335d064d408e9a06793bbd7
7
- data.tar.gz: 03f1ae8cc3d2dc1e5b4c181db83c76d29d1d39cea9e3cbec3ec9a94d07e65a25a98c1f07783fc027415a6860004321aa2d280e29c60fccb1e1a2ea3147283569
6
+ metadata.gz: 46c25d86f4c28d5e75d0528a692f9fe6dc6ed1c88ec087db06003cf9fa0cb5392a2602e8b1fc3b27128efbeda331fd84595468352644c05f74a0d98f3ab05c8f
7
+ data.tar.gz: 90b6790804141298cc316b3f1e64f6f614407ff3843f4ffee1a67bc1f5c9b96a3c0e7cb5cc559b30970987350627e11f4cfb983e7e6da4b492ffa95153a646df
@@ -1,3 +1,3 @@
1
1
  module Yomikomu
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/yomikomu.rb CHANGED
@@ -1,12 +1,6 @@
1
1
  require "yomikomu/version"
2
2
 
3
3
  module Yomikomu
4
- class NullStorage
5
- def load_iseq fname; end
6
- def compile_and_store_iseq fname; end
7
- def remove_compiled_iseq fname; end
8
- end
9
-
10
4
  STATISTICS = Hash.new(0)
11
5
 
12
6
  unless yomu_dir = ENV['YOMIKOMU_STORAGE_DIR']
@@ -17,6 +11,7 @@ module Yomikomu
17
11
  end
18
12
  YOMIKOMU_PREFIX = "#{yomu_dir}/cb."
19
13
  YOMIKOMU_AUTO_COMPILE = ENV['YOMIKOMU_AUTO_COMPILE'] == 'true'
14
+ YOMIKOMU_USE_MMAP = ENV['YOMIKOMU_USE_MMAP']
20
15
 
21
16
  if $VERBOSE
22
17
  def self.info
@@ -40,6 +35,12 @@ module Yomikomu
40
35
  end
41
36
  end
42
37
 
38
+ class NullStorage
39
+ def load_iseq fname; end
40
+ def compile_and_store_iseq fname; end
41
+ def remove_compiled_iseq fname; end
42
+ end
43
+
43
44
  class BasicStorage
44
45
  def initialize
45
46
  require 'digest/sha1'
@@ -152,6 +153,25 @@ module Yomikomu
152
153
  end
153
154
  end
154
155
 
156
+ if YOMIKOMU_USE_MMAP
157
+ require 'mmapped_string'
158
+ Yomikomu.info{ "[RUBY_YOMIKOMU] use mmap" }
159
+
160
+ module MMapFile
161
+ def read_compiled_iseq fname, iseq_key
162
+ MmappedString.open(iseq_key)
163
+ end
164
+ end
165
+
166
+ class FSStorage
167
+ prepend MMapFile
168
+ end
169
+
170
+ class FS2Storage
171
+ prepend MMapFile
172
+ end
173
+ end
174
+
155
175
  class DBMStorage < BasicStorage
156
176
  def initialize
157
177
  require 'dbm'
data/yomikomu.gemspec CHANGED
@@ -19,7 +19,11 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
+ spec.required_ruby_version = '~> 2.3.0dev'
23
+ spec.add_runtime_dependency 'mmapped_string' if /linux/ =~ RUBY_PLATFORM
24
+
22
25
  spec.add_development_dependency "bundler", "~> 1.10"
23
26
  spec.add_development_dependency "rake", "~> 10.0"
24
27
  spec.add_development_dependency "minitest"
28
+ spec.add_development_dependency 'mmapped_string' if /linux/ =~ RUBY_PLATFORM
25
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yomikomu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koichi Sasada
@@ -10,6 +10,20 @@ bindir: exe
10
10
  cert_chain: []
11
11
  date: 2015-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: mmapped_string
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +66,20 @@ dependencies:
52
66
  - - ">="
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: mmapped_string
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
55
83
  description: Dump compiled iseq by binary (kakidasu) and load binary (yomidasu).
56
84
  email:
57
85
  - ko1@atdot.net
@@ -82,9 +110,9 @@ require_paths:
82
110
  - lib
83
111
  required_ruby_version: !ruby/object:Gem::Requirement
84
112
  requirements:
85
- - - ">="
113
+ - - "~>"
86
114
  - !ruby/object:Gem::Version
87
- version: '0'
115
+ version: 2.3.0dev
88
116
  required_rubygems_version: !ruby/object:Gem::Requirement
89
117
  requirements:
90
118
  - - ">="