This commit is contained in:
Carlos Martín Nieto 2016-05-19 19:08:33 +02:00
Родитель d8ab58a63f
Коммит f72b45206f
7 изменённых файлов: 37 добавлений и 5 удалений

4
.gitignore поставляемый
Просмотреть файл

@ -6,3 +6,7 @@ pkg
ext/bert/c/Makefile
ext/bert/c/*.bundle
ext/bert/c/*.o
/vendor/
/.bundle/
*.so
/bin/

5
Gemfile Normal file
Просмотреть файл

@ -0,0 +1,5 @@
# frozen_string_literal: true
# A sample Gemfile
source "https://rubygems.org"
gemspec

21
Gemfile.lock Normal file
Просмотреть файл

@ -0,0 +1,21 @@
PATH
remote: .
specs:
bert (1.1.7)
GEM
remote: https://rubygems.org/
specs:
git (1.3.0)
thoughtbot-shoulda (2.11.1)
PLATFORMS
ruby
DEPENDENCIES
bert!
git
thoughtbot-shoulda
BUNDLED WITH
1.12.4

Просмотреть файл

@ -42,7 +42,7 @@ task :clean do
end
end
task :test => :check_dependencies do
task :test do
require 'fileutils'
puts "\nCleaning extension build files and running all specs in native ruby mode..."
@ -77,7 +77,7 @@ end
task :default => :test
require 'rake/rdoctask'
require 'rdoc/task'
Rake::RDocTask.new do |rdoc|
if File.exist?('VERSION')
version = File.read('VERSION')
@ -93,4 +93,4 @@ end
task :console do
exec('irb -I lib -rbert')
end
end

Просмотреть файл

@ -10,7 +10,8 @@ ITER = 1_000
def setup
tiny = t[:ok, :awesome]
small = t[:ok, :answers, [42] * 42]
large = ["abc" * 1000] * 100
#large = ["abc" * 1000] * 100
large = "a" * (1024 * 1024 * 64)
complex = [42, {:foo => 'bac' * 100}, t[(1..100).to_a]] * 10
$tiny_encoded_bert = BERT.encode(tiny)
@ -84,4 +85,4 @@ Benchmark.bm(13) do |bench|
bench.report("Ruby small") {ITER.times {Marshal.load($small_encoded_ruby)}}
bench.report("Ruby large") {ITER.times {Marshal.load($large_encoded_ruby)}}
bench.report("Ruby complex") {ITER.times {Marshal.load($complex_encoded_ruby)}}
end
end

Двоичные данные
bert.gemspec

Двоичный файл не отображается.

Просмотреть файл

@ -1,3 +1,4 @@
# coding: utf-8
require 'test_helper'
class BertTest < Test::Unit::TestCase