edn_turbo 0.6.2 → 0.7.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
  SHA256:
3
- metadata.gz: 873b791ab9878f7b9bd616689fbfbef2eacb3fd1d6d8ede55a71f182fcf3b9f4
4
- data.tar.gz: a6ff013825a135846e1e3988e17a86d58ca0dd244fcde0a9b73f3eb22218e8cb
3
+ metadata.gz: 52581ae198013dd710765482a20fa056d4cd34e889ae1e22b86d3fa4bbf14316
4
+ data.tar.gz: 88352b596f68647b0106cf95b7c1f5cf6cdb398852de65b2feebe11a1b61506e
5
5
  SHA512:
6
- metadata.gz: aa606e1bc5da4be831d70052415f3c217343e334390de2e72bb141dd18986f6ef3379c03c6f1adec2de86af65951bf2902dc3fcb09fae29874ad448323a7361d
7
- data.tar.gz: 0cf810e71d6a3a3d2cabc798bed067d0826512149ef503d4f2940816e1f3cc15e71d9cffef5eb504b44efa70f597f274decc5147be878c515c3624f5a558854f
6
+ metadata.gz: 0ca4bc29b2d5dd0cbd051dbf77ae1362ea4c9e935166144137e7f37d5025db171ed309e5cd9e405f3f3ac207551dcf64eaf7eb908592dfb0ef440f73917d03db
7
+ data.tar.gz: 1cea625a086d7c9268427d2fd678cc27ff1647014fcf89cf6484511b14659e57bf10fb45fc73aeb85793cbee3a66b15940dac20fd5ff066afb19c48e8e938143
@@ -1,6 +1,16 @@
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.7.0 - 2020-02-07
5
+ ### Added
6
+ - big_decimal_edn_turbo method to replace calling edn-ruby's
7
+ big_decimal as it breaks things in ruby 2.7 and up
8
+
9
+ ### Changed
10
+ - Removed compiler warning due to scalar wrapped in braces
11
+ - Updated docker configs to use latest 2.4 and 2.6 ruby
12
+ versions. Added 2.5 and 2.7 too.
13
+
4
14
  ## 0.6.2 - 2019-05-21
5
15
  ### Fixed
6
16
  - Handling of ##Inf, ##Nan, et al.
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- edn_turbo 0.6.2
1
+ edn_turbo 0.7.0
2
2
  ===============
3
3
 
4
4
  Fast [Ragel](http://www.colm.net/open-source/ragel/)-based EDN parser for Ruby.
@@ -0,0 +1,38 @@
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
+ # the specified ruby version
33
+ RUN rbenv install $ruby_version && \
34
+ rbenv global $ruby_version
35
+
36
+ COPY --chown=ned:ned . /home/ned/src
37
+
38
+ ENTRYPOINT ["docker/entrypoint"]
@@ -0,0 +1,11 @@
1
+ #!/bin/bash
2
+
3
+ if [ $# -eq 0 ]; then
4
+ RUBY_VERSION=2.7.0
5
+ else
6
+ RUBY_VERSION=$1
7
+ fi
8
+
9
+ set -e
10
+
11
+ docker build --build-arg ruby_version=$RUBY_VERSION -f docker/Dockerfile -t digressed/test:edn_turbo-rb-$RUBY_VERSION .
@@ -0,0 +1,11 @@
1
+ #!/bin/bash
2
+
3
+ if [ $# -eq 0 ]; then
4
+ RUBY_VERSION=2.7.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,24 @@
1
+ version: "3"
2
+ services:
3
+
4
+ rb-2.7.0:
5
+ image: digressed/test:edn_turbo-rb-2.7.0
6
+ stdin_open: true
7
+ tty: true
8
+
9
+ rb-2.6.5:
10
+ image: digressed/test:edn_turbo-rb-2.6.5
11
+ stdin_open: true
12
+ tty: true
13
+
14
+ rb-2.5.7:
15
+ image: digressed/test:edn_turbo-rb-2.5.7
16
+ stdin_open: true
17
+ tty: true
18
+
19
+ rb-2.4.9:
20
+ image: digressed/test:edn_turbo-rb-2.4.9
21
+ stdin_open: true
22
+ tty: true
23
+ # volumes:
24
+ # - /Volumes/homes/ep/work/edn_turbo:/home/ned/app
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ exec "$@"
@@ -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
@@ -0,0 +1,11 @@
1
+ #!/bin/bash
2
+
3
+ if [ $# -eq 0 ]; then
4
+ RUBY_VERSION=2.7.0
5
+ else
6
+ RUBY_VERSION=$1
7
+ fi
8
+
9
+ set -e
10
+
11
+ docker-compose -f docker/docker-compose.yml run rb-$RUBY_VERSION docker/make-check
@@ -2,7 +2,7 @@
2
2
  #line 1 "edn_parser.rl"
3
3
  // The MIT License (MIT)
4
4
 
5
- // Copyright (c) 2015-2019 Ed Porras
5
+ // Copyright (c) 2015-2020 Ed Porras
6
6
 
7
7
  // Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  // of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  // The MIT License (MIT)
2
2
 
3
- // Copyright (c) 2015-2019 Ed Porras
3
+ // Copyright (c) 2015-2020 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
@@ -60,7 +60,19 @@ lib_dirs =
60
60
  dir_config('icuuc', header_dirs, lib_dirs)
61
61
 
62
62
  # feels very hackish to do this but the new icu4c needs it on MacOS
63
- $CXXFLAGS << ' -stdlib=libc++ -Wno-deprecated-register' if RUBY_PLATFORM =~ /darwin/
63
+ if RUBY_PLATFORM =~ /darwin/
64
+ $CXXFLAGS << ' -stdlib=libc++ -Wno-deprecated-register'
65
+ else
66
+ # remove some flags that are either clang-specific or unrecognized
67
+ # but somehow get passed under linux (?!)
68
+ %w[
69
+ -Wno-self-assign -Wno-parentheses-equality -Wno-constant-logical-operand
70
+ -Wno-cast-function-type -Wdeclaration-after-statement -Wimplicit-function-declaration
71
+ -Wimplicit-int
72
+ ].each do |f|
73
+ $warnflags.sub!(f, '')
74
+ end
75
+ end
64
76
  $CXXFLAGS << ' -std=c++11 -std=gnu++11'
65
77
 
66
78
  abort "\n>> failed to find icu4c headers - is icu4c installed?\n\n" unless
@@ -1,6 +1,6 @@
1
1
  // The MIT License (MIT)
2
2
 
3
- // Copyright (c) 2015-2019 Ed Porras
3
+ // Copyright (c) 2015-2020 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
@@ -26,6 +26,7 @@
26
26
  #include <cstring>
27
27
 
28
28
  #include <ruby/ruby.h>
29
+ #include <ruby/version.h>
29
30
  #include <ruby/io.h>
30
31
 
31
32
  #include "parser.h"
@@ -62,7 +63,7 @@ namespace edn {
62
63
 
63
64
  static const rb_data_type_t parser_data_type = {
64
65
  "edn_turbo::Parser",
65
- {0, delete_parser, 0, {0}},
66
+ {0, delete_parser, 0, 0},
66
67
  0, 0,
67
68
  RUBY_TYPED_FREE_IMMEDIATELY,
68
69
  };
@@ -217,9 +218,16 @@ void Init_edn_turbo(void)
217
218
  edn::EDN_MAKE_SYMBOL_METHOD = rb_intern("symbol");
218
219
  edn::EDN_MAKE_LIST_METHOD = rb_intern("list");
219
220
  edn::EDN_MAKE_SET_METHOD = rb_intern("set");
220
- edn::EDN_MAKE_BIG_DECIMAL_METHOD = rb_intern("big_decimal");
221
221
  edn::EDN_TAGGED_ELEM_METHOD = rb_intern("tagged_element");
222
222
 
223
+ #if defined(RUBY_API_VERSION_MAJOR) && (RUBY_API_VERSION_MAJOR == 2) && \
224
+ defined(RUBY_API_VERSION_MINOR) && (RUBY_API_VERSION_MINOR > 4)
225
+ // see lib/edn_turbo.rb
226
+ edn::EDN_MAKE_BIG_DECIMAL_METHOD = rb_intern("big_decimal_edn_turbo");
227
+ #else
228
+ edn::EDN_MAKE_BIG_DECIMAL_METHOD = rb_intern("big_decimal");
229
+ #endif
230
+
223
231
  // defined in EDNT - see edn_parser.rb
224
232
  edn::EDNT_EXTENDED_VALUE_METHOD = rb_intern("extend_for_meta");
225
233
  edn::EDN_MAKE_RATIONAL_METHOD = rb_intern("rational"); // should be in edn-ruby
@@ -1,6 +1,6 @@
1
1
  // The MIT License (MIT)
2
2
 
3
- // Copyright (c) 2015-2019 Ed Porras
3
+ // Copyright (c) 2015-2020 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
@@ -1,6 +1,6 @@
1
1
  // The MIT License (MIT)
2
2
 
3
- // Copyright (c) 2015-2019 Ed Porras
3
+ // Copyright (c) 2015-2020 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
@@ -205,7 +205,7 @@ namespace edn
205
205
  // =================================================================
206
206
  //
207
207
  // error reporting
208
- void Parser::error(const std::string& func, const std::string& err, char c) const
208
+ void Parser::error(const std::string& /*func*/, const std::string& err, char c) const
209
209
  {
210
210
  std::cerr << "Parse error "
211
211
  // "from " << func << "() "
@@ -1,6 +1,6 @@
1
1
  // The MIT License (MIT)
2
2
 
3
- // Copyright (c) 2015-2019 Ed Porras
3
+ // Copyright (c) 2015-2020 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
@@ -1,6 +1,6 @@
1
1
  // The MIT License (MIT)
2
2
 
3
- // Copyright (c) 2015-2019 Ed Porras
3
+ // Copyright (c) 2015-2020 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
@@ -1,6 +1,6 @@
1
1
  // The MIT License (MIT)
2
2
 
3
- // Copyright (c) 2015-2019 Ed Porras
3
+ // Copyright (c) 2015-2020 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
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License (MIT)
4
4
  #
5
- # Copyright (c) 2015-2019 Ed Porras
5
+ # Copyright (c) 2015-2020 Ed Porras
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -36,4 +36,10 @@ module EDN
36
36
  def self.rational(value)
37
37
  Rational(value)
38
38
  end
39
+
40
+ # edn-ruby uses BigDecimal.new() which breaks in ruby >= 2.7.0 so we
41
+ # use this instead
42
+ def self.big_decimal_edn_turbo(value)
43
+ BigDecimal(value)
44
+ end
39
45
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License (MIT)
4
4
  #
5
- # Copyright (c) 2015-2019 Ed Porras
5
+ # Copyright (c) 2015-2020 Ed Porras
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  # The MIT License (MIT)
2
2
  #
3
- # Copyright (c) 2015-2019 Ed Porras
3
+ # Copyright (c) 2015-2020 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
@@ -21,6 +21,6 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  module EDNT
24
- VERSION = '0.6.2'.freeze
25
- RELEASE_DATE = '2019-05-21'.freeze
24
+ VERSION = '0.7.0'.freeze
25
+ RELEASE_DATE = '2020-02-07'.freeze
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edn_turbo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ed Porras
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-21 00:00:00.000000000 Z
11
+ date: 2020-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: edn
@@ -103,16 +103,19 @@ files:
103
103
  - ".gitignore"
104
104
  - ".rspec"
105
105
  - CHANGELOG.md
106
- - Dockerfile
107
106
  - Gemfile
108
107
  - LICENSE
109
108
  - README.md
110
109
  - Rakefile
111
- - bin/build_docker_image.sh
112
- - bin/console.sh
113
110
  - bin/ppedn
114
111
  - bin/ppedn-ruby
115
- - docker-compose.yml
112
+ - docker/Dockerfile
113
+ - docker/build
114
+ - docker/console
115
+ - docker/docker-compose.yml
116
+ - docker/entrypoint
117
+ - docker/make-check
118
+ - docker/run
116
119
  - ext/edn_turbo/depend
117
120
  - ext/edn_turbo/edn_parser.cc
118
121
  - ext/edn_turbo/edn_parser.rl
@@ -148,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
151
  - !ruby/object:Gem::Version
149
152
  version: '0'
150
153
  requirements: []
151
- rubygems_version: 3.0.3
154
+ rubygems_version: 3.1.2
152
155
  signing_key:
153
156
  specification_version: 3
154
157
  summary: Read EDN files
data/Dockerfile DELETED
@@ -1,34 +0,0 @@
1
- FROM buildpack-deps:stretch
2
- MAINTAINER github@digressed.net
3
-
4
- ENV LC_ALL C.UTF-8
5
-
6
- # Update Ubuntu Software repository
7
- RUN apt-get update
8
-
9
- # install dependencies & utils
10
- RUN apt-get install -y \
11
- libicu-dev \
12
- curl \
13
- libreadline-dev
14
-
15
- # aliases, environment
16
- RUN echo 'alias h="history"' >> /root/.bashrc
17
- RUN echo 'alias be="bundle exec"' >> /root/.bashrc
18
- ENV PATH "/root/.rbenv/bin:/root/.rbenv/shims:$PATH"
19
-
20
- # install rbenv & ruby
21
- RUN \curl -sL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash -
22
- RUN eval "$(rbenv init -)"
23
-
24
- ENV RUBY_VERSION=2.6.3
25
- RUN rbenv install ${RUBY_VERSION}
26
- RUN rbenv global ${RUBY_VERSION}
27
-
28
- # mute bundle warning about root user
29
- RUN bundle config --global silence_root_warning 1
30
-
31
- WORKDIR /gem
32
-
33
- # cleanup
34
- RUN rm -rf /var/lib/apt/lists/*
@@ -1,11 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e
4
-
5
- if [[ $# -eq 0 ]]; then
6
- RUBY_VERSION=2.6.3
7
- else
8
- RUBY_VERSION=$1
9
- fi
10
-
11
- docker build -t edn_turbo_image:$RUBY_VERSION .
@@ -1,5 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e
4
-
5
- docker-compose run edn_turbo /bin/bash
@@ -1,10 +0,0 @@
1
- version: "3"
2
- services:
3
-
4
- edn_turbo:
5
- image: edn_turbo_image:2.6.3
6
- stdin_open: true
7
- tty: true
8
- volumes:
9
- - ~/.bash_history:/root/.bash_history
10
- - /Volumes/homes/ep/work/edn_turbo:/gem