fiddle 1.0.0.beta1 → 1.0.0.beta2

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
  SHA1:
3
- metadata.gz: 2fe43921484c5d31435a574dfefe01f997a7d32d
4
- data.tar.gz: e03146994af328004ad234e857040db4820f3734
3
+ metadata.gz: 1c95f026d86d58a824f9925f5a57d8cebbf00e0a
4
+ data.tar.gz: ec3332b0ef7aadc1e47bf5d563e61232410395f6
5
5
  SHA512:
6
- metadata.gz: a5ba7ff66c1000fbc80c61294523e9acba69f39bdce1f168dd748821a1fa2213204b69a3174ab74274e1343f936a8fe0a78053d4b43c6736ac7232e38e6a70d8
7
- data.tar.gz: b650a3bb827441f5a34e51e66df247c8c707383de10083f717a15500fffa020d1f5704b53558ea1b5338a3481fa968a17f2ddfa63ec51ab5b3b7c1f3fbf5a052
6
+ metadata.gz: 7173bf1fa4282f82118ce7dbe0064b170dc0c21ba6d99fbb7e52e356a6ad9710ba2c47e2225e56a2b9052358a8a7763228f302fc3ffbff97555fc2eca9fe6115
7
+ data.tar.gz: a271e17bc2a5626e05fff933991829d377333325269a3d4daec33fc70bb524d1d2c1ab36bf749b0e27e17aec5949313ec51aab7dc9c16215fed753d988415f58
data/.gitignore CHANGED
@@ -7,6 +7,7 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ /ext/fiddle/libffi-*/
10
11
  *.bundle
11
12
  *.so
12
13
  *.dll
@@ -1,5 +1,5 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.5.0
5
- before_install: gem install bundler -v 1.14.6
4
+ - ruby-head
5
+ before_install: gem install bundler
@@ -1,21 +1,22 @@
1
- The MIT License (MIT)
1
+ Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
2
2
 
3
- Copyright (c) 2017 SHIBATA Hiroshi
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions
5
+ are met:
6
+ 1. Redistributions of source code must retain the above copyright
7
+ notice, this list of conditions and the following disclaimer.
8
+ 2. Redistributions in binary form must reproduce the above copyright
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
4
11
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
12
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22
+ SUCH DAMAGE.
data/README.md CHANGED
@@ -32,10 +32,9 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
32
 
33
33
  ## Contributing
34
34
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/hsbt/fiddle.
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/fiddle.
36
36
 
37
37
 
38
38
  ## License
39
39
 
40
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
-
40
+ The gem is available as open source under the terms of the [BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause).
data/Rakefile CHANGED
@@ -10,4 +10,4 @@ end
10
10
  require 'rake/extensiontask'
11
11
  Rake::ExtensionTask.new("fiddle")
12
12
 
13
- task :default => :test
13
+ task :default => [:compile, :test]
@@ -1,7 +1,7 @@
1
1
  #include <fiddle.h>
2
2
  #include <ruby/thread.h>
3
3
 
4
- int ruby_thread_has_gvl_p(void); /* for ext/fiddle/closure.c */
4
+ int ruby_thread_has_gvl_p(void); /* from internal.h */
5
5
 
6
6
  VALUE cFiddleClosure;
7
7
 
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: false
1
+ # frozen_string_literal: true
2
2
  require 'mkmf'
3
3
 
4
4
  # :stopdoc:
@@ -18,6 +18,15 @@ if ! bundle
18
18
  end and (have_library('ffi') || have_library('libffi'))
19
19
  end or
20
20
  begin
21
+ if bundle
22
+ require "fileutils"
23
+ require_relative "../../bin/extlibs"
24
+ extlibs = ExtLibs.new
25
+ cache_dir = File.expand_path("../../tmp/.download_cache", $srcdir)
26
+ ext_dir = File.expand_path("../../ext", $srcdir)
27
+ Dir.glob("#{$srcdir}/libffi-*/").each{|dir| FileUtils.rm_rf(dir)}
28
+ extlibs.run(["--cache=#{cache_dir}", ext_dir])
29
+ end
21
30
  ver = bundle != false &&
22
31
  Dir.glob("#{$srcdir}/libffi-*/")
23
32
  .map {|n| File.basename(n)}
@@ -41,12 +50,12 @@ begin
41
50
  libffi.lib = "#{libffi.builddir}/.libs"
42
51
  libffi.a = "#{libffi.lib}/libffi_convenience.#{$LIBEXT}"
43
52
  nowarn = CONFIG.merge("warnflags"=>"")
44
- libffi.cflags = RbConfig.expand("$(CFLAGS)", nowarn)
53
+ libffi.cflags = RbConfig.expand("$(CFLAGS)".dup, nowarn)
45
54
  ver = ver[/libffi-(.*)/, 1]
46
55
 
47
56
  FileUtils.mkdir_p(libffi.dir)
48
57
  libffi.opt = CONFIG['configure_args'][/'(-C)'/, 1]
49
- libffi.ldflags = RbConfig.expand("$(LDFLAGS) #{libpathflag([relative_from($topdir, "..")])} #{$LIBRUBYARG}")
58
+ libffi.ldflags = RbConfig.expand("$(LDFLAGS) #{libpathflag([relative_from($topdir, "..")])} #{$LIBRUBYARG}".dup)
50
59
  libffi.arch = RbConfig::CONFIG['host']
51
60
  if $mswin
52
61
  unless find_executable(as = /x64/ =~ libffi.arch ? "ml64" : "ml")
@@ -77,7 +86,7 @@ begin
77
86
  args << libffi.opt if libffi.opt
78
87
  args.concat %W[
79
88
  CC=#{cc} CFLAGS=#{libffi.cflags}
80
- CXX=#{cxx} CXXFLAGS=#{RbConfig.expand("$(CXXFLAGS)", nowarn)}
89
+ CXX=#{cxx} CXXFLAGS=#{RbConfig.expand("$(CXXFLAGS)".dup, nowarn)}
81
90
  LD=#{ld} LDFLAGS=#{libffi.ldflags}
82
91
  ]
83
92
 
@@ -1,2 +1,5 @@
1
- ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz md5:83b89587607e3eb65c70d361f13bab43
1
+ ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz \
2
+ md5:83b89587607e3eb65c70d361f13bab43 \
3
+ sha512:980ca30a8d76f963fca722432b1fe5af77d7a4e4d2eac5144fbc5374d4c596609a293440573f4294207e1bdd9fda80ad1e1cafb2ffb543df5a275bc3bd546483 \
4
+ #
2
5
  win32/libffi-3.2.1-mswin.patch -p0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/ruby
2
- # frozen_string_literal: false
2
+ # frozen_string_literal: true
3
3
  require 'fileutils'
4
4
 
5
5
  basedir = File.dirname(__FILE__)
@@ -1,23 +1,21 @@
1
+ # frozen_string_literal: true
1
2
  Gem::Specification.new do |spec|
2
3
  spec.name = "fiddle"
3
- spec.version = '1.0.0.beta1'
4
+ spec.version = '1.0.0.beta2'
4
5
  spec.authors = ["Aaron Patterson", "SHIBATA Hiroshi"]
5
6
  spec.email = ["aaron@tenderlovemaking.com", "hsbt@ruby-lang.org"]
6
7
 
7
8
  spec.summary = %q{A libffi wrapper for Ruby.}
8
9
  spec.description = %q{A libffi wrapper for Ruby.}
9
10
  spec.homepage = "https://github.com/ruby/fiddle"
10
- spec.license = "MIT"
11
+ spec.license = "BSD-2-Clause"
11
12
 
12
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
13
- f.match(%r{^(test|spec|features)/})
14
- end
13
+ spec.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "ext/fiddle/closure.c", "ext/fiddle/closure.h", "ext/fiddle/conversions.c", "ext/fiddle/conversions.h", "ext/fiddle/extconf.rb", "ext/fiddle/extlibs", "ext/fiddle/fiddle.c", "ext/fiddle/fiddle.h", "ext/fiddle/function.c", "ext/fiddle/function.h", "ext/fiddle/handle.c", "ext/fiddle/pointer.c", "ext/fiddle/win32/fficonfig.h", "ext/fiddle/win32/libffi-3.2.1-mswin.patch", "ext/fiddle/win32/libffi-config.rb", "ext/fiddle/win32/libffi.mk.tmpl", "fiddle.gemspec", "lib/fiddle.rb", "lib/fiddle/closure.rb", "lib/fiddle/cparser.rb", "lib/fiddle/function.rb", "lib/fiddle/import.rb", "lib/fiddle/pack.rb", "lib/fiddle/struct.rb", "lib/fiddle/types.rb", "lib/fiddle/value.rb"]
15
14
  spec.bindir = "exe"
16
15
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
17
16
  spec.require_paths = ["lib"]
18
17
 
19
18
  spec.add_development_dependency "bundler"
20
19
  spec.add_development_dependency "rake"
21
- spec.add_development_dependency "minitest", "~> 4.0"
22
20
  spec.add_development_dependency "rake-compiler"
23
21
  end
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: false
1
+ # frozen_string_literal: true
2
2
  require 'fiddle.so'
3
3
  require 'fiddle/function'
4
4
  require 'fiddle/closure'
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: false
1
+ # frozen_string_literal: true
2
2
  module Fiddle
3
3
  class Closure
4
4
 
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: false
1
+ # frozen_string_literal: true
2
2
  module Fiddle
3
3
  # A mixin that provides methods for parsing C struct and prototype signatures.
4
4
  #
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: false
1
+ # frozen_string_literal: true
2
2
  module Fiddle
3
3
  class Function
4
4
  # The ABI of the Function.
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: false
1
+ # frozen_string_literal: true
2
2
  require 'fiddle'
3
3
  require 'fiddle/struct'
4
4
  require 'fiddle/cparser'
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: false
1
+ # frozen_string_literal: true
2
2
  require 'fiddle'
3
3
 
4
4
  module Fiddle
@@ -101,7 +101,7 @@ module Fiddle
101
101
  private
102
102
 
103
103
  def parse_types(types)
104
- @template = ""
104
+ @template = "".dup
105
105
  addr = 0
106
106
  types.each{|t|
107
107
  orig_addr = addr
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: false
1
+ # frozen_string_literal: true
2
2
  require 'fiddle'
3
3
  require 'fiddle/value'
4
4
  require 'fiddle/pack'
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: false
1
+ # frozen_string_literal: true
2
2
  module Fiddle
3
3
  # Adds Windows type aliases to the including class for use with
4
4
  # Fiddle::Importer.
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: false
1
+ # frozen_string_literal: true
2
2
  require 'fiddle'
3
3
 
4
4
  module Fiddle
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fiddle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta1
4
+ version: 1.0.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Patterson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-04-05 00:00:00.000000000 Z
12
+ date: 2017-09-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -39,20 +39,6 @@ dependencies:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
- - !ruby/object:Gem::Dependency
43
- name: minitest
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - "~>"
47
- - !ruby/object:Gem::Version
48
- version: '4.0'
49
- type: :development
50
- prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - "~>"
54
- - !ruby/object:Gem::Version
55
- version: '4.0'
56
42
  - !ruby/object:Gem::Dependency
57
43
  name: rake-compiler
58
44
  requirement: !ruby/object:Gem::Requirement
@@ -111,7 +97,7 @@ files:
111
97
  - lib/fiddle/value.rb
112
98
  homepage: https://github.com/ruby/fiddle
113
99
  licenses:
114
- - MIT
100
+ - BSD-2-Clause
115
101
  metadata: {}
116
102
  post_install_message:
117
103
  rdoc_options: []
@@ -129,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
115
  version: 1.3.1
130
116
  requirements: []
131
117
  rubyforge_project:
132
- rubygems_version: 2.6.11
118
+ rubygems_version: 2.6.13
133
119
  signing_key:
134
120
  specification_version: 4
135
121
  summary: A libffi wrapper for Ruby.