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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 695a3c68e9f69b9423a4da07056dfd8f264f62b39896c938938e56d1e28c395f
4
- data.tar.gz: a370c5b31f462288fd340771c901d47f27e45e2308ef98728cb6abe59596631a
3
+ metadata.gz: d3a019b63b2ae2c41aa11bf484c883a240d45a2ec3e7a8993bf46823e69a209b
4
+ data.tar.gz: 84e52336caffb1b3bfc25b7ba468689e8a564bbc4cc633f56415d0c95b09655f
5
5
  SHA512:
6
- metadata.gz: 9b9b5aeb7c5b62d4add2ff2faa190138cf1baf0e902bdf3a28468c382ef0e94f6c95f93e3e05c48d7deb31e708d92f41607da60183b510593aa741eb68817be5
7
- data.tar.gz: 39fb3b6b18cf3593fd537843aa2a08089552cb8900691ca88e3d8a86d05706e5f5ef557c8f3521c0b68b812652d1770f5f3a4621ca30087fa06299266a330352
6
+ metadata.gz: b026cd6b1c43b6e571f2be7647cb249ed740f8af4a23b2208051ec0835968561044ff7c87775ec3dbd4d378bdaa62c8b58ce027e65f8a35cfd93bd4c8a3431b4
7
+ data.tar.gz: c73e78a41f638fedf58baa8157261ae0063d0fd88cdc3cf1e74e654f3f4f68110bd7f0ab74ab444e1f9b18d2a421370ba0dccfbf6eeb1f1a825e6435c5cd52c5
data/.dir-locals.el ADDED
@@ -0,0 +1,3 @@
1
+ ((c++-mode
2
+ (flycheck-clang-language-standard . "c++11")
3
+ (flycheck-gcc-language-standard . "c++11")))
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.6.1 - 2019-05-20
5
- ### Added
6
- - Implement parsing of Ratio literals, represented as a ruby Rational.
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
- - Parsing of exact precision types.
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
- - Build lists using EDN::list method that was previously broken.
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
- - switched from MiniTest to RSpec.
18
- - replaced `NULL` with `nullptr`.
19
- - replaced old-style casts.
20
- - prohibit Parser copy and move ops.
21
- - assigning a source that does not respond to `read` now throws
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
- - initial version of docker configs for testing on Ubuntu.
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
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015-2019 Ed Porras
3
+ Copyright (c) 2015-2021 Ed Porras
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- edn_turbo 0.6.1
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.4 or greater as `edn_turbo` does not use the deprecated `Fixnum` or `Bignum`.
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
- cd EXT_PATH do
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, [:machine] do |_t, args|
47
+ task :graph, %i[machine] do |_t, args|
48
48
  args.with_defaults(machine: 'EDN_value')
49
- TMPFILE = '/tmp/ragel_edn'
50
- MACHINE = args[:machine]
49
+ tmpfile = '/tmp/ragel_edn'
50
+ machine = args[:machine]
51
51
 
52
52
  # assumes graphviz is installed
53
- sh "ragel -Vp -S #{MACHINE} -o #{TMPFILE} #{EXT_PATH}/#{RAGEL_PARSER_SRC} && "\
54
- "dot -Tpng #{TMPFILE} -o #{MACHINE}.png"
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: [:clean, :ragel, :compile, :chmod]
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,11 @@
1
+ #!/bin/bash
2
+
3
+ if [ $# -eq 0 ]; then
4
+ RUBY_VERSION=3.0.0
5
+ else
6
+ RUBY_VERSION=$1
7
+ fi
8
+
9
+ echo "running on ruby ${RUBY_VERSION}"
10
+
11
+ docker-compose -f docker/docker-compose.yml run rb-$RUBY_VERSION /bin/bash
@@ -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
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ exec "$@"
data/docker/make-check ADDED
@@ -0,0 +1,8 @@
1
+ #!/bin/bash
2
+
3
+ set -x -e
4
+
5
+ gem install bundler &&
6
+ bundle && \
7
+ rake compile && \
8
+ bundle exec rspec
data/docker/run ADDED
@@ -0,0 +1,9 @@
1
+ #!/bin/bash
2
+
3
+ . docker/common.sh
4
+
5
+ set -e
6
+
7
+ set_ruby_ver $@
8
+
9
+ docker-compose -f docker/docker-compose.yml run rb-$RUBY_VERSION docker/make-check