edn_turbo 0.6.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.dir-locals.el +3 -0
- data/CHANGELOG.md +43 -12
- data/LICENSE +1 -1
- data/README.md +11 -3
- data/Rakefile +7 -15
- data/docker/Dockerfile +40 -0
- data/docker/build +11 -0
- data/docker/common.sh +28 -0
- data/docker/console +11 -0
- data/docker/docker-compose.yml +22 -0
- data/docker/entrypoint +3 -0
- data/docker/make-check +8 -0
- data/docker/run +9 -0
- data/ext/edn_turbo/edn_parser.cc +110 -88
- data/ext/edn_turbo/edn_parser.rl +20 -1
- data/ext/edn_turbo/extconf.rb +14 -2
- data/ext/edn_turbo/main.cc +13 -3
- data/ext/edn_turbo/parser.h +1 -1
- data/ext/edn_turbo/parser_def.cc +2 -2
- data/ext/edn_turbo/util.cc +1 -1
- data/ext/edn_turbo/util.h +6 -1
- data/ext/edn_turbo/util_unicode.cc +1 -1
- data/ext/edn_turbo/util_unicode.h +1 -1
- data/lib/edn_turbo/edn_parser.rb +1 -1
- data/lib/edn_turbo/version.rb +5 -3
- data/lib/edn_turbo.rb +7 -1
- data/spec/edn_turbo/edn_parser_spec.rb +9 -0
- metadata +38 -13
- data/Dockerfile +0 -34
- data/bin/build_docker_image.sh +0 -11
- data/bin/console.sh +0 -5
- data/docker-compose.yml +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3a019b63b2ae2c41aa11bf484c883a240d45a2ec3e7a8993bf46823e69a209b
|
4
|
+
data.tar.gz: 84e52336caffb1b3bfc25b7ba468689e8a564bbc4cc633f56415d0c95b09655f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b026cd6b1c43b6e571f2be7647cb249ed740f8af4a23b2208051ec0835968561044ff7c87775ec3dbd4d378bdaa62c8b58ce027e65f8a35cfd93bd4c8a3431b4
|
7
|
+
data.tar.gz: c73e78a41f638fedf58baa8157261ae0063d0fd88cdc3cf1e74e654f3f4f68110bd7f0ab74ab444e1f9b18d2a421370ba0dccfbf6eeb1f1a825e6435c5cd52c5
|
data/.dir-locals.el
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,26 +1,57 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
|
3
3
|
|
4
|
-
## 0.
|
5
|
-
###
|
6
|
-
|
4
|
+
## [0.7.2] - 2021-09-20
|
5
|
+
### Changed
|
6
|
+
* allow rake versions > 12
|
7
|
+
|
8
|
+
## [0.7.1] - 2021-02-07
|
9
|
+
### Changed
|
10
|
+
* Set minimum ruby version to 2.5
|
7
11
|
|
8
12
|
### Fixed
|
9
|
-
|
13
|
+
* Compilation error when building against ruby versions > 2
|
14
|
+
|
15
|
+
## [0.7.0] - 2020-02-07
|
16
|
+
### Added
|
17
|
+
* big_decimal_edn_turbo method to replace calling edn-ruby's
|
18
|
+
big_decimal as it breaks things in ruby 2.7 and up
|
10
19
|
|
11
20
|
### Changed
|
12
|
-
|
21
|
+
* Removed compiler warning due to scalar wrapped in braces
|
22
|
+
* Updated docker configs to use latest 2.4 and 2.6 ruby
|
23
|
+
versions. Added 2.5 and 2.7 too.
|
13
24
|
|
25
|
+
## [0.6.2] - 2019-05-21
|
26
|
+
### Fixed
|
27
|
+
* Handling of ##Inf, ##Nan, et al.
|
28
|
+
|
29
|
+
## [0.6.1] - 2019-05-20
|
30
|
+
### Added
|
31
|
+
* Implement parsing of Ratio literals, represented as a ruby Rational.
|
32
|
+
|
33
|
+
### Fixed
|
34
|
+
* Parsing of exact precision types.
|
35
|
+
|
36
|
+
### Changed
|
37
|
+
* Build lists using EDN::list method that was previously broken.
|
14
38
|
|
15
|
-
## 0.6.0 - 2019-05-13
|
39
|
+
## [0.6.0] - 2019-05-13
|
16
40
|
### Changed
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
41
|
+
* switched from MiniTest to RSpec.
|
42
|
+
* replaced `NULL` with `nullptr`.
|
43
|
+
* replaced old-style casts.
|
44
|
+
* prohibit Parser copy and move ops.
|
45
|
+
* assigning a source that does not respond to `read` now throws
|
22
46
|
`ArgumentError` instead of `RuntimeError`.
|
23
47
|
|
24
48
|
### Added
|
25
|
-
|
49
|
+
* initial version of docker configs for testing on Ubuntu.
|
26
50
|
|
51
|
+
[Unreleased]: https://github.com/edporras/edn_turbo/-/compare/0.7.2...main
|
52
|
+
[0.7.2]: https://github.com/edporras/edn_turbo/-/compare/0.7.1...0.7.2
|
53
|
+
[0.7.1]: https://github.com/edporras/edn_turbo/-/compare/0.7.0...0.7.1
|
54
|
+
[0.7.0]: https://github.com/edporras/edn_turbo/-/compare/0.6.2...0.7.0
|
55
|
+
[0.6.2]: https://github.com/edporras/edn_turbo/-/compare/0.6.1...0.6.2
|
56
|
+
[0.6.1]: https://github.com/edporras/edn_turbo/-/compare/0.6.0...0.6.1
|
57
|
+
[0.6.0]: https://github.com/edporras/edn_turbo/-/compare/0.5.7...0.6.0
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
edn_turbo 0.
|
1
|
+
edn_turbo 0.7.2
|
2
2
|
===============
|
3
3
|
|
4
4
|
Fast [Ragel](http://www.colm.net/open-source/ragel/)-based EDN parser for Ruby.
|
@@ -34,7 +34,7 @@ irb(main):008:0> Benchmark.realtime { 100000.times { EDN::read(s) } }
|
|
34
34
|
Dependencies
|
35
35
|
============
|
36
36
|
|
37
|
-
Ruby 2.
|
37
|
+
Ruby 2.6 or greater.
|
38
38
|
|
39
39
|
- ruby gems:
|
40
40
|
- [rake](http://rake.rubyforge.org)
|
@@ -103,6 +103,14 @@ Or instantiate and reuse an instance of a parser:
|
|
103
103
|
|
104
104
|
Differences with edn gem
|
105
105
|
========================
|
106
|
-
`edn_turbo` reads `String` and core IO types using C-api calls.
|
106
|
+
- `edn_turbo` reads `String` and core IO types using C-api calls.
|
107
107
|
However, data from `StringIO` sources is extracted using `read()`
|
108
108
|
calls into the ruby side.
|
109
|
+
|
110
|
+
- As of v0.6.1, `edn_turbo` supports EDN ratio literals, returning a
|
111
|
+
ruby Rational representation for them. See https://github.com/edn-format/edn/issues/64.
|
112
|
+
|
113
|
+
- As of v0.6.2, `edn_turbo` supports representation of `##Inf` as
|
114
|
+
`Float::INFINITY` and `##NaN` as `Float::NAN`.
|
115
|
+
|
116
|
+
- As of v0.7.1, `edn_turbo` requires ruby 2.5 or greater.
|
data/Rakefile
CHANGED
@@ -36,7 +36,7 @@ CLEAN.include(['*.png', '*.gem'])
|
|
36
36
|
# ragel cc source generation
|
37
37
|
task ragel: GEN_CC_PARSER_SRC_PATH
|
38
38
|
file GEN_CC_PARSER_SRC_PATH => RAGEL_PARSER_SRC_PATH do
|
39
|
-
|
39
|
+
Dir.chdir(EXT_PATH) do
|
40
40
|
sh "ragel -G2 -o #{GEN_CC_PARSER_SRC} #{RAGEL_PARSER_SRC}"
|
41
41
|
src = File.read(GEN_CC_PARSER_SRC).gsub(/[ \t]+$/, '')
|
42
42
|
File.open(GEN_CC_PARSER_SRC, 'w') { |f| f.print src }
|
@@ -44,24 +44,16 @@ file GEN_CC_PARSER_SRC_PATH => RAGEL_PARSER_SRC_PATH do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
# graph generation for testing machine output
|
47
|
-
task :graph, [
|
47
|
+
task :graph, %i[machine] do |_t, args|
|
48
48
|
args.with_defaults(machine: 'EDN_value')
|
49
|
-
|
50
|
-
|
49
|
+
tmpfile = '/tmp/ragel_edn'
|
50
|
+
machine = args[:machine]
|
51
51
|
|
52
52
|
# assumes graphviz is installed
|
53
|
-
sh "ragel -Vp -S #{
|
54
|
-
"dot -Tpng #{
|
53
|
+
sh "ragel -Vp -S #{machine} -o #{tmpfile} #{EXT_PATH}/#{RAGEL_PARSER_SRC} && "\
|
54
|
+
"dot -Tpng #{tmpfile} -o #{machine}.png"
|
55
55
|
end
|
56
56
|
|
57
|
-
task build: [
|
58
|
-
|
59
|
-
# add dependency to test task
|
60
|
-
task test: EXT_BUNDLE
|
61
|
-
|
62
|
-
Rake::TestTask.new do |t|
|
63
|
-
t.libs << 'test'
|
64
|
-
t.test_files = FileList['test/test_output_diff.rb']
|
65
|
-
end
|
57
|
+
task build: %i[clean ragel compile chmod]
|
66
58
|
|
67
59
|
task default: :compile
|
data/docker/Dockerfile
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
FROM buildpack-deps:stretch
|
2
|
+
MAINTAINER github@digressed.net
|
3
|
+
ARG ruby_version
|
4
|
+
|
5
|
+
ENV LC_ALL C.UTF-8
|
6
|
+
|
7
|
+
USER root
|
8
|
+
RUN groupadd -r ned -g 1000 && \
|
9
|
+
useradd -u 1000 -r -g ned -m -s /sbin/nologin -c "Docker image user" ned && \
|
10
|
+
mkdir /home/ned/bin && \
|
11
|
+
mkdir /home/ned/src && \
|
12
|
+
chown -R ned:ned /home/ned
|
13
|
+
|
14
|
+
WORKDIR /home/ned/src
|
15
|
+
|
16
|
+
# Update Ubuntu Software repository && update deps
|
17
|
+
RUN apt-get update && \
|
18
|
+
apt-get install -y \
|
19
|
+
libicu-dev \
|
20
|
+
libreadline-dev \
|
21
|
+
ragel && \
|
22
|
+
rm -rf /var/lib/apt/lists/*
|
23
|
+
|
24
|
+
USER ned
|
25
|
+
|
26
|
+
ENV PATH "/home/ned/.rbenv/bin:/home/ned/.rbenv/shims:$PATH"
|
27
|
+
|
28
|
+
# install rbenv
|
29
|
+
RUN \curl -sL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash - && \
|
30
|
+
eval "$(rbenv init -)"
|
31
|
+
|
32
|
+
RUN rm -f .ruby-version
|
33
|
+
|
34
|
+
# the specified ruby version
|
35
|
+
RUN rbenv install $ruby_version && \
|
36
|
+
rbenv global $ruby_version
|
37
|
+
|
38
|
+
COPY --chown=ned:ned . /home/ned/src
|
39
|
+
|
40
|
+
ENTRYPOINT ["docker/entrypoint"]
|
data/docker/build
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
. docker/common.sh
|
4
|
+
|
5
|
+
set -e
|
6
|
+
|
7
|
+
set_ruby_ver $@
|
8
|
+
|
9
|
+
docker build --build-arg ruby_version=$RUBY_VERSION -f docker/Dockerfile -t digressed/test:edn_turbo-rb-$RUBY_VERSION .
|
10
|
+
docker tag "digressed/test:edn_turbo-rb-$RUBY_VERSION" "edn_turbo-rb-$RUBY_VERSION"
|
11
|
+
docker push "digressed/test:edn_turbo-rb-$RUBY_VERSION"
|
data/docker/common.sh
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
RUBY_MAJOR_VER=3.0
|
4
|
+
|
5
|
+
function update_ruby_build()
|
6
|
+
{
|
7
|
+
if [ -e "~/.rbenv/plugins/" ]; then
|
8
|
+
echo "Updating ruby-build definitions"
|
9
|
+
|
10
|
+
pushd ~/.rbenv/plugins/ruby-build/ >> /dev/null
|
11
|
+
git pull
|
12
|
+
popd >> /dev/null
|
13
|
+
fi
|
14
|
+
}
|
15
|
+
|
16
|
+
function set_ruby_ver()
|
17
|
+
{
|
18
|
+
local args=("$@")
|
19
|
+
|
20
|
+
if [ ${#args[@]} -eq 0 ]; then
|
21
|
+
update_ruby_build
|
22
|
+
RUBY_VERSION=`ruby-build --definitions | grep "^$RUBY_MAJOR_VER" | tail -1`
|
23
|
+
else
|
24
|
+
RUBY_VERSION=$1
|
25
|
+
fi
|
26
|
+
|
27
|
+
echo "Using ruby $RUBY_VERSION"
|
28
|
+
}
|
data/docker/console
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
version: "3"
|
2
|
+
services:
|
3
|
+
|
4
|
+
rb-3.0.2:
|
5
|
+
image: digressed/test:edn_turbo-rb-3.0.2
|
6
|
+
stdin_open: true
|
7
|
+
tty: true
|
8
|
+
|
9
|
+
rb-2.7.4:
|
10
|
+
image: digressed/test:edn_turbo-rb-2.7.4
|
11
|
+
stdin_open: true
|
12
|
+
tty: true
|
13
|
+
|
14
|
+
rb-2.6.8:
|
15
|
+
image: digressed/test:edn_turbo-rb-2.6.8
|
16
|
+
stdin_open: true
|
17
|
+
tty: true
|
18
|
+
|
19
|
+
rb-2.5.9:
|
20
|
+
image: digressed/test:edn_turbo-rb-2.5.9
|
21
|
+
stdin_open: true
|
22
|
+
tty: true
|
data/docker/entrypoint
ADDED
data/docker/make-check
ADDED