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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12b6c9cb872ab8098620fb864c7a507cc1ffe53f
4
- data.tar.gz: 521c3c4d2f170c39c58939f0d36ef5ec24e06a9c
3
+ metadata.gz: b95d74a44d1d52b8d6ebf23356ccc1b64c8379ad
4
+ data.tar.gz: d4a59c539aaab68f92933b1b02a74ca2b03d9072
5
5
  SHA512:
6
- metadata.gz: ac677eb6eb07cc39cff5d09ee0699c04ba3dfea7f1e0244987bdb02a254e3b9da200d6b09dfa17db0ba015f6f0c4da174df4649867deab005bc743c704689a8a
7
- data.tar.gz: 39cc60843db112afad3a2020c29cc3ae02547859565d08999acd9f068ee4b815e0ef7bbad3f15fc8688372047a06cc85e6ee958577a433222c395be084bbd85e
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 or cl.exe
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
 
@@ -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
@@ -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 number 20 below.
56
- snprintf(file, 1023, "%s#{slash}disclose.file.XXXXXX", tmp_prefix);
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(file);
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(tar_tar, sizeof(unsigned char), sizeof(tar_tar), fp);
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, "tar xf \\"%s\\" -C \\"%s\\"", file + strlen(file) - 20, dir + strlen(dir) - 20);
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
 
@@ -1,3 +1,3 @@
1
1
  class Disclose
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
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.5.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-08 00:00:00.000000000 Z
11
+ date: 2016-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler