disclose 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -1
- data/lib/disclose.rb +2 -1
- data/lib/disclose/c.rb +15 -5
- data/lib/disclose/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b95d74a44d1d52b8d6ebf23356ccc1b64c8379ad
|
4
|
+
data.tar.gz: d4a59c539aaab68f92933b1b02a74ca2b03d9072
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7b7eba4cb7bdf8d722081c8eba77591d7806d357ae7fbca700ca0690c8eadca15635c2c627fa47c7a04990cf760e8d6aa089f0473ece01dfa1bde588080d82f
|
7
|
+
data.tar.gz: 7cae9d66964f9e9213e4eed97467830e35a244f326a0a20cb539618386e397d08db6c922c9936b9e217f92eb07729a644ad3295986d63800e56a33eb59bf5cde
|
data/README.md
CHANGED
@@ -17,8 +17,16 @@ Pack your Node.js project into an executable without recompiling Node.js.
|
|
17
17
|
Make sure that your system has the following components,
|
18
18
|
|
19
19
|
- tar
|
20
|
+
- gzip
|
20
21
|
- xxd
|
21
|
-
- cc
|
22
|
+
- cc
|
23
|
+
|
24
|
+
or on Windows,
|
25
|
+
|
26
|
+
- `tar.exe`, which could be installed by gnuwin32
|
27
|
+
- `gzip.exe`, which could be installed by gnuwin32
|
28
|
+
- `xxd.exe`, which could be installed by gvim
|
29
|
+
- `cl.exe`, which could be installed by Visual Studio
|
22
30
|
|
23
31
|
## Usage
|
24
32
|
|
data/lib/disclose.rb
CHANGED
@@ -44,12 +44,13 @@ Usage: disclose [node_path] [project_path]
|
|
44
44
|
def tar!
|
45
45
|
chdir(@working_dir) do
|
46
46
|
exe("tar cf tar.tar -C \"#{@project_path}\" . -C \"#{File.dirname @node_path}\" \"#{File.basename @node_path}\"")
|
47
|
+
exe("gzip tar.tar")
|
47
48
|
end
|
48
49
|
end
|
49
50
|
|
50
51
|
def header!
|
51
52
|
chdir(@working_dir) do
|
52
|
-
exe("xxd -i tar.tar > tar.h")
|
53
|
+
exe("xxd -i tar.tar.gz > tar.h")
|
53
54
|
@md5 = Digest::MD5.file('tar.h').to_s
|
54
55
|
end
|
55
56
|
end
|
data/lib/disclose/c.rb
CHANGED
@@ -24,6 +24,7 @@ class Disclose
|
|
24
24
|
windows_prepare(f) if Gem.win_platform?
|
25
25
|
f.puts unistd
|
26
26
|
f.puts %Q{
|
27
|
+
#include <string.h>
|
27
28
|
#include <stdio.h>
|
28
29
|
#include <stdlib.h>
|
29
30
|
#include <assert.h>
|
@@ -46,30 +47,39 @@ class Disclose
|
|
46
47
|
|
47
48
|
void untar() {
|
48
49
|
char cmd[1024] = {0};
|
50
|
+
char file0[1024] = {0};
|
49
51
|
char file[1024] = {0};
|
50
52
|
char dir[1024] = {0};
|
51
53
|
FILE *fp = NULL;
|
52
54
|
int ret;
|
53
55
|
|
54
56
|
// Be careful about the number of XXXXXX
|
55
|
-
// Relate to the magical
|
56
|
-
snprintf(
|
57
|
+
// Relate to the magical numbers 23, 20, 19 below.
|
58
|
+
snprintf(file0, 1023, "%s#{slash}disclose.file.XXXXXX", tmp_prefix);
|
57
59
|
snprintf(dir, 1023, "%s#{slash}disclose.dir.XXXXXX", tmp_prefix);
|
58
60
|
|
59
|
-
mktemp(
|
61
|
+
mktemp(file0);
|
60
62
|
mktemp(dir);
|
61
63
|
mkdir(dir#{', 0777' unless Gem.win_platform?});
|
62
64
|
|
65
|
+
snprintf(file, 1023, "%s.gz", file0);
|
66
|
+
|
63
67
|
fp = fopen(file, "wb");
|
64
68
|
assert(fp);
|
65
|
-
fwrite(
|
69
|
+
fwrite(tar_tar_gz, sizeof(unsigned char), sizeof(tar_tar_gz), fp);
|
66
70
|
fclose(fp);
|
67
71
|
|
68
72
|
#{tar_windows if Gem.win_platform?}
|
69
73
|
|
70
74
|
chdir(tmp_prefix);
|
71
75
|
|
72
|
-
snprintf(cmd, 1023, "
|
76
|
+
snprintf(cmd, 1023, "gzip -d \\"%s\\"", file + strlen(file) - 23);
|
77
|
+
ret = system(cmd);
|
78
|
+
assert(0 == ret);
|
79
|
+
|
80
|
+
file[strlen(file) - 3] = '\\0';
|
81
|
+
|
82
|
+
snprintf(cmd, 1023, "tar xf \\"%s\\" -C \\"%s\\"", file + strlen(file) - 20, dir + strlen(dir) - 19);
|
73
83
|
ret = system(cmd);
|
74
84
|
assert(0 == ret);
|
75
85
|
|
data/lib/disclose/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: disclose
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The rugged tests are fragile
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|