marcandre / packable Goto Github PK
View Code? Open in Web Editor NEWExtensive pack and unpack capabilities
License: MIT License
Extensive pack and unpack capabilities
License: MIT License
On newer versions of Ruby, there are many warnings and deprecation warnings present (for instance involving the deprecated Fixnum
and Bignum
). Also, there are uses of alias_method_chain
, which is deprecated in newer versions of activesupport
(use of prepend
is preferred).
➜ packable git:(master) ✗ bundle exec rake test
/home/user/.rvm/gems/ruby-2.4.0/gems/shoulda-context-1.2.2/lib/shoulda/context/context.rb:400: warning: assigned but unused variable - context
/home/user/.rvm/gems/ruby-2.4.0/gems/backports-3.6.8/lib/backports/tools/extreme_object.rb:4: warning: parentheses after method name is interpreted as an argument list, not a decomposed argument
/home/user/.rvm/gems/ruby-2.4.0/gems/backports-3.6.8/lib/backports/tools/extreme_object.rb:8: warning: parentheses after method name is interpreted as an argument list, not a decomposed argument
/home/user/.rvm/gems/ruby-2.4.0/gems/backports-3.6.8/lib/backports/1.8.7/fixnum/div.rb:1: warning: constant ::Fixnum is deprecated
/home/user/.rvm/gems/ruby-2.4.0/gems/backports-3.6.8/lib/backports/1.8.7/fixnum/fdiv.rb:1: warning: constant ::Fixnum is deprecated
/home/user/.rvm/gems/ruby-2.4.0/gems/backports-3.6.8/lib/backports/2.1.0/bignum/bit_length.rb:1: warning: constant ::Bignum is deprecated
/home/user/.rvm/gems/ruby-2.4.0/gems/backports-3.6.8/lib/backports/2.1.0/fixnum/bit_length.rb:1: warning: constant ::Fixnum is deprecated
/home/user/ruby/packable/lib/packable/extensions/io.rb:25: warning: parentheses after method name is interpreted as an argument list, not a decomposed argument
/home/user/ruby/packable/lib/packable/extensions/io.rb:29: warning: parentheses after method name is interpreted as an argument list, not a decomposed argument
/home/user/ruby/packable/lib/packable/extensions/io.rb:42: warning: parentheses after method name is interpreted as an argument list, not a decomposed argument
/home/user/ruby/packable/test/packing_test.rb:49: warning: ambiguous first argument; put parentheses or a space even after `-' operator
/home/user/ruby/packable/lib/packable/extensions/proc.rb:6: warning: method redefined; discarding old __temp_bound_method
/home/user/ruby/packable/test/packing_test.rb:117: warning: previous definition of __temp_bound_method was here
Run options: --seed 17177
# Running:
./home/user/ruby/packable/test/packing_test.rb:58: warning: constant ::Bignum is deprecated
.../home/user/ruby/packable/test/packing_test.rb:72: warning: constant ::Fixnum is deprecated
..F........./home/user/ruby/packable/lib/packable/extensions/io.rb:57: warning: Enumerator.new without a block is deprecated; use Object#to_enum
.
Finished in 0.021756s, 781.3769 runs/s, 3171.4711 assertions/s.
1) Failure:
TestingPack#test_: Filters for Object should be follow accessible everywhere. [/home/user/ruby/packable/test/packing_test.rb:123]:
--- expected
+++ actual
@@ -1 +1,2 @@
-"Fixnum\u0000\u0000\u0000\u0006"
+# encoding: ASCII-8BIT
+"Integer\x00\x00\x00\x06"
17 runs, 69 assertions, 1 failures, 0 errors, 0 skips
rake aborted!
Command failed with status (1)
/home/user/.rvm/gems/ruby-2.4.0@global/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/home/user/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `eval'
/home/user/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => test
(See full trace by running task with --trace)
Hi
I'm using the nmatrix gem and this gem uses as dependency packable. When I perform a require of nmatrix and use the method each of IO, in order to read a plain text file, as for example:
File.open(file_name, 'w').each do |line|
I get the following error:
.gem/ruby/2.4.1/gems/packable-1.3.10/lib/packable/extensions/io.rb:56:in `each': not opened for reading (IOError)
from .gem/ruby/2.4.1/gems/packable-1.3.10/lib/packable/extensions/io.rb:56:in `each_with_packing'
This problem was commented in this issue: SciRuby/nmatrix#548 but I'm not sure about if this is an implementation problem of nmatrix or of packable ¿Can you give me some workaround for this problem or some advice? I'm really stuck with this problem.
Thank you in advance
Pedro Seoane
If I do 1.1.pack(:double)
, I get "?\x8C\xCC\xCD", which is the value I should get were I doing 1.1.pack(:float)
.
1.1.pack('E')
gives the correct value, which is "\x9A\x99\x99\x99\x99\x99\xF1?".
I've tried with a whole bunch of variations, e.g., 1.1.pack(:precision => :double)
. Same result.
how does it get from that line to read_with_packing?
production@server:~/app/releases/failing-release$ bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile --trace
...
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
TypeError: Expected a class or symbol: 16384
/home/production/app/shared/bundle/ruby/1.9.1/gems/packable-1.3.6/lib/packable/packers.rb:56:in `to_class_option_list'
/home/production/app/shared/bundle/ruby/1.9.1/gems/packable-1.3.6/lib/packable/extensions/io.rb:67:in `read_with_packing'
/usr/local/lib/ruby/1.9.1/digest.rb:46:in `block in file'
/usr/local/lib/ruby/1.9.1/digest.rb:44:in `open'
/usr/local/lib/ruby/1.9.1/digest.rb:44:in `file'
/home/production/app/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.3/lib/sprockets/base.rb:133:in `file_digest'
Hi,
There are some test failures with Ruby2.7:
┌──────────────────────────────────────────────────────────────────────────────┐
│ Run tests for ruby2.7 from debian/ruby-test-files.yaml │
└──────────────────────────────────────────────────────────────────────────────┘
RUBYLIB=/home/utkarsh/debian/ruby-team/packale/ruby-packable/debian/ruby-packable/usr/lib/ruby/vendor_ruby:. GEM_PATH=/home/utkarsh/debian/ruby-team/packale/ruby-packable/debian/ruby-packable/usr/share/rubygems-integration/all:/home/utkarsh/.gem/ruby/2.7.0:/var/lib/gems/2.7.0:/usr/lib/ruby/gems/2.7.0:/usr/share/rubygems-integration/2.7.0:/usr/share/rubygems-integration/all:/usr/lib/x86_64-linux-gnu/rubygems-integration/2.7.0 ruby2.7 -ryaml -e YAML.load_file\(\"debian/ruby-test-files.yaml\"\).each\ \{\ \|f\|\ require\ f\ \}
Traceback (most recent call last):
8: from /usr/lib/ruby/vendor_ruby/minitest.rb:68:in `block in autorun'
7: from /usr/lib/ruby/vendor_ruby/minitest.rb:139:in `run'
6: from /usr/lib/ruby/vendor_ruby/minitest.rb:847:in `start'
5: from /usr/lib/ruby/vendor_ruby/minitest.rb:847:in `each'
4: from /usr/lib/ruby/vendor_ruby/minitest.rb:757:in `start'
3: from /usr/lib/ruby/vendor_ruby/minitest.rb:757:in `puts'
2: from /home/utkarsh/debian/ruby-team/packale/ruby-packable/debian/ruby-packable/usr/lib/ruby/vendor_ruby/packable/extensions/io.rb:62:in `write_with_packing'
1: from /home/utkarsh/debian/ruby-team/packale/ruby-packable/debian/ruby-packable/usr/lib/ruby/vendor_ruby/packable/extensions/io.rb:86:in `pack_and_write'
/home/utkarsh/debian/ruby-team/packale/ruby-packable/debian/ruby-packable/usr/lib/ruby/vendor_ruby/packable/extensions/io.rb:86:in `pos': Illegal seek @ rb_io_tell - <STDOUT> (Errno::ESPIPE)
ERROR: Test "ruby2.7" failed. Exiting.
Any clue about the fix?
Hi,
I am preparing a Debian package for your library. While working on the packaging, I stumbled upon a license problem:
the README file says that the project is published under the modified BSD license, and refers to the LICENSE file for the full text of the license, but the content of the LICENSE file is the MIT/Expat license, not the BSD one.
Could you tell precisely which license is used?
Thanks in advance.
Cédric
Your gem fails to test successfully with Ruby 3.0. This is the error:
# Running:
E................
Finished in 0.003977s, 4274.7508 runs/s, 11566.9728 assertions/s.
1) Error:
PackableDocTest#test_doc:
ArgumentError: tried to create Proc object without a block
/<<PKGBUILDDIR>>/debian/ruby-packable/usr/share/rubygems-integration/all/gems/packable-1.3.14/lib/packable/extensions/io.rb:76:in `initialize'
/<<PKGBUILDDIR>>/debian/ruby-packable/usr/share/rubygems-integration/all/gems/packable-1.3.14/lib/packable/extensions/io.rb:76:in `new'
/<<PKGBUILDDIR>>/debian/ruby-packable/usr/share/rubygems-integration/all/gems/packable-1.3.14/lib/packable/extensions/io.rb:76:in `each_with_packing'
/<<PKGBUILDDIR>>/test/packing_doc_test.rb:22:in `test_doc'
/usr/lib/ruby/vendor_ruby/minitest/test.rb:98:in `block (3 levels) in run'
/usr/lib/ruby/vendor_ruby/minitest/test.rb:195:in `capture_exceptions'
/usr/lib/ruby/vendor_ruby/minitest/test.rb:95:in `block (2 levels) in run'
/usr/lib/ruby/vendor_ruby/minitest.rb:270:in `time_it'
/usr/lib/ruby/vendor_ruby/minitest/test.rb:94:in `block in run'
/usr/lib/ruby/vendor_ruby/minitest.rb:365:in `on_signal'
/usr/lib/ruby/vendor_ruby/minitest/test.rb:211:in `with_info_handler'
/usr/lib/ruby/vendor_ruby/minitest/test.rb:93:in `run'
/usr/lib/ruby/vendor_ruby/minitest.rb:1029:in `run_one_method'
/usr/lib/ruby/vendor_ruby/minitest.rb:339:in `run_one_method'
/usr/lib/ruby/vendor_ruby/minitest.rb:326:in `block (2 levels) in run'
/usr/lib/ruby/vendor_ruby/minitest.rb:325:in `each'
/usr/lib/ruby/vendor_ruby/minitest.rb:325:in `block in run'
/usr/lib/ruby/vendor_ruby/minitest.rb:365:in `on_signal'
/usr/lib/ruby/vendor_ruby/minitest.rb:352:in `with_info_handler'
/usr/lib/ruby/vendor_ruby/minitest.rb:324:in `run'
/usr/lib/ruby/vendor_ruby/minitest.rb:164:in `block in __run'
/usr/lib/ruby/vendor_ruby/minitest.rb:164:in `map'
/usr/lib/ruby/vendor_ruby/minitest.rb:164:in `__run'
/usr/lib/ruby/vendor_ruby/minitest.rb:141:in `run'
/usr/lib/ruby/vendor_ruby/minitest.rb:68:in `block in autorun'
17 runs, 46 assertions, 0 failures, 1 errors, 0 skips
ERROR: Test "ruby3.0" failed. Exiting.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.