serde 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -2
- data/lib/serde.rb +1 -6
- data/serde.gemspec +1 -1
- metadata +1 -3
- data/lib/rubygems_plugin.rb +0 -6
- data/lib/rustc_installer.rb +0 -102
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c38f55a677eb7150048034063e1a1a2617fa2b0fe3386fd08c3ddf6c22790ab
|
4
|
+
data.tar.gz: 5302cb5830f3ec3cbdba65d48b5dc1e88cd7f7a346299609f45719ce64cc4569
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afd1d28e37b256579d1df046bd05e4b895d326870ab4975e30656dd9b2548d4df08a4b9d6c6cc8c76de2c9523ee1626d540c6d6ae271073269d5179fae5c21cd
|
7
|
+
data.tar.gz: 17a79bbd39641e7cad2a43b423104be711e4c7b55d4f64c80f05b33128b2761ceee840a97381d1e1feba64adb4de8c70381bec157635ed66de415aae8ae2ace2
|
data/.gitignore
CHANGED
data/lib/serde.rb
CHANGED
@@ -34,14 +34,9 @@ module Serde
|
|
34
34
|
Dir.chdir(dir) do
|
35
35
|
SerializerGenerator.call(dir, self)
|
36
36
|
|
37
|
-
root_path = File.expand_path('..', __dir__)
|
38
37
|
rust_path = File.expand_path('../rust', __dir__)
|
39
|
-
bin_path = File.expand_path('../bin', __dir__)
|
40
38
|
|
41
|
-
#
|
42
|
-
# `cd #{rust_path}; #{bin_path}/rustc --edition=2018 --crate-name serde_rb src/lib.rs --crate-type staticlib --crate-type cdylib --emit=dep-info,link -C opt-level=3 -C metadata=aff563bf4af79579 --out-dir #{rust_path}/target/release -L dependency=#{rust_path}/target/release/deps --extern serde=#{rust_path}/target/release/deps/libserde-6a9e4ab445963d7f.rlib --extern serde_derive=#{rust_path}/target/release/deps/libserde_derive-20596753c2ed9015.dylib --extern serde_json=#{rust_path}/target/release/deps/libserde_json-489658cb61f64325.rlib -L #{root_path}/.rustc/rust-std-beta-x86_64-apple-darwin/rust-std-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib`
|
43
|
-
`cd #{rust_path}; #{bin_path}/cargo build --release`
|
44
|
-
# rubocop:enable Metrics/LineLength
|
39
|
+
`cd #{rust_path}; cargo +beta build --release`
|
45
40
|
`cp #{rust_path}/target/release/libserde_rb*.a #{dir}/serde_rb/libserde_rb.a`
|
46
41
|
`cd #{dir}/serde_rb; ruby extconf.rb; make clean; make`
|
47
42
|
|
data/serde.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serde
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Komarov
|
@@ -109,8 +109,6 @@ files:
|
|
109
109
|
- Rakefile
|
110
110
|
- bench/bench.rb
|
111
111
|
- examples/app/new.rb
|
112
|
-
- lib/rubygems_plugin.rb
|
113
|
-
- lib/rustc_installer.rb
|
114
112
|
- lib/serde.rb
|
115
113
|
- lib/serde/generate.rb
|
116
114
|
- lib/serde/serializer_generator.rb
|
data/lib/rubygems_plugin.rb
DELETED
data/lib/rustc_installer.rb
DELETED
@@ -1,102 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# TODO: test on different systems and architectures
|
4
|
-
|
5
|
-
require 'tmpdir'
|
6
|
-
require 'net/http'
|
7
|
-
require 'fileutils'
|
8
|
-
require 'rubygems/package'
|
9
|
-
require 'zlib'
|
10
|
-
|
11
|
-
# https://github.com/rust-lang/rustup.rs/blob/243e3d5889a58116fb7eb910e8508b9d0d0a0b04/rustup-init.sh#L172
|
12
|
-
# not considering android and mips for now
|
13
|
-
ostype = `uname -s`.chomp
|
14
|
-
cputype = `uname -m`.chomp
|
15
|
-
|
16
|
-
if ostype == 'Darwin' && cputype == 'i386' && !`sysctl hw.optional.x86_64 | grep -q ': 1'`.nil?
|
17
|
-
cputype = 'x86_64'
|
18
|
-
end
|
19
|
-
|
20
|
-
ostype =
|
21
|
-
case ostype
|
22
|
-
when 'Linux' then 'unknown-linux-gnu'
|
23
|
-
when 'FreeBSD' then 'unknown-freebsd'
|
24
|
-
when 'NetBSD' then 'unknown-netbsd'
|
25
|
-
when 'DragonFly' then 'unknown-dragonfly'
|
26
|
-
when 'Darwin' then 'apple-darwin'
|
27
|
-
when /MINGW/, /MSYS/, /CYGWIN/ then 'pc-windows-gnu'
|
28
|
-
else raise "unrecognized OS type: #{ostype}"
|
29
|
-
end
|
30
|
-
|
31
|
-
cputype =
|
32
|
-
case cputype
|
33
|
-
when 'i386', 'i486', 'i686', 'i786', 'x86' then 'i686'
|
34
|
-
when 'xscale', 'arm' then 'arm'
|
35
|
-
when 'armv6l' then 'armeabihf'
|
36
|
-
when 'armv7l', 'armv8l' then 'armv7eabihf'
|
37
|
-
when 'aarch64' then 'aarch64'
|
38
|
-
when 'x86_64', 'x86-64', 'x64', 'amd64' then 'x86_64'
|
39
|
-
when 'ppc' then 'powerpc'
|
40
|
-
when 'ppc64' then 'powerpc64'
|
41
|
-
when 'ppc64le' then 'powerpc64le'
|
42
|
-
else raise "unknown CPU type: #{cputype}"
|
43
|
-
end
|
44
|
-
|
45
|
-
rustc_name = "rustc-beta-#{cputype}-#{ostype}"
|
46
|
-
ruststd_name = "rust-std-beta-#{cputype}-#{ostype}"
|
47
|
-
cargo_name = "cargo-beta-#{cputype}-#{ostype}"
|
48
|
-
|
49
|
-
TAR_LONGLINK = '././@LongLink'
|
50
|
-
DESTINATION = File.expand_path('../.rustc', __dir__)
|
51
|
-
|
52
|
-
def download_and_extract(name) # rubocop:disable Metrics/MethodLength
|
53
|
-
File.write(
|
54
|
-
"#{name}.tar.gz",
|
55
|
-
Net::HTTP.get(URI("https://static.rust-lang.org/dist/2018-11-27/#{name}.tar.gz")),
|
56
|
-
)
|
57
|
-
|
58
|
-
# https://stackoverflow.com/a/19139114
|
59
|
-
Gem::Package::TarReader.new(Zlib::GzipReader.open("#{name}.tar.gz")) do |tar|
|
60
|
-
dest = nil
|
61
|
-
tar.each do |entry|
|
62
|
-
if entry.full_name == TAR_LONGLINK
|
63
|
-
dest = File.join DESTINATION, entry.read.strip
|
64
|
-
next
|
65
|
-
end
|
66
|
-
dest ||= File.join DESTINATION, entry.full_name
|
67
|
-
if entry.directory?
|
68
|
-
File.delete dest if File.file? dest
|
69
|
-
FileUtils.mkdir_p dest, mode: entry.header.mode, verbose: false
|
70
|
-
elsif entry.file?
|
71
|
-
FileUtils.rm_rf dest if File.directory? dest
|
72
|
-
File.open dest, 'wb' do |f|
|
73
|
-
f.print entry.read
|
74
|
-
end
|
75
|
-
FileUtils.chmod entry.header.mode, dest, verbose: false
|
76
|
-
elsif entry.header.typeflag == '2' # Symlink!
|
77
|
-
File.symlink entry.header.linkname, dest
|
78
|
-
end
|
79
|
-
dest = nil
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
Dir.mktmpdir do |dir|
|
85
|
-
Dir.chdir(dir) do
|
86
|
-
# manifest = Net::HTTP.get(URI('https://static.rust-lang.org/dist/channel-rust-beta.toml'))
|
87
|
-
# puts manifest
|
88
|
-
FileUtils.mkdir_p(File.expand_path('../bin', __dir__))
|
89
|
-
|
90
|
-
FileUtils.rm(File.expand_path('../bin/cargo', __dir__)) rescue nil
|
91
|
-
|
92
|
-
download_and_extract(rustc_name)
|
93
|
-
download_and_extract(ruststd_name)
|
94
|
-
download_and_extract(cargo_name)
|
95
|
-
|
96
|
-
# TODO: windows?
|
97
|
-
FileUtils.ln_s(
|
98
|
-
"#{DESTINATION}/#{cargo_name}/cargo/bin/cargo",
|
99
|
-
File.expand_path('../bin/cargo', __dir__),
|
100
|
-
)
|
101
|
-
end
|
102
|
-
end
|