disclose 0.8.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/disclose.rb +6 -3
- data/lib/disclose/c.rb +9 -8
- 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: 93713cf11010a8e4430cbb4a496e2e8beae8bde5
|
4
|
+
data.tar.gz: 7fcc89464ee986db24620e80dd89f897a80c75c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff54d92ed6ddab82544ab7aaf5c82d6a2ce6df3655c39e656d9bb7935552608669f7ecb922309a27631485a0af690c76732cdb22176e5d0e4f19675a596da165
|
7
|
+
data.tar.gz: 29593874c4fa7bf48a8f7ff70c4f71889975164926eba540886c041af18ec91bc5a5c7970eea3112681e1588a6ca35074aace664270892ad7ec3803712bfc7d9
|
data/lib/disclose.rb
CHANGED
@@ -10,9 +10,12 @@ class Disclose
|
|
10
10
|
class Error < RuntimeError; end
|
11
11
|
|
12
12
|
def self.usage
|
13
|
-
%
|
13
|
+
%Q{
|
14
|
+
disclose v#{VERSION}
|
15
|
+
|
14
16
|
Usage: disclose [node_path] [project_path]
|
15
17
|
e.g. disclose /usr/local/bin/node /usr/local/lib/node_modules/coffee-script
|
18
|
+
|
16
19
|
}.strip
|
17
20
|
end
|
18
21
|
|
@@ -43,7 +46,7 @@ Usage: disclose [node_path] [project_path]
|
|
43
46
|
|
44
47
|
def tar!
|
45
48
|
chdir(@working_dir) do
|
46
|
-
exe("tar
|
49
|
+
exe("tar hcf tar.tar -C \"#{@project_path}\" . -C \"#{File.dirname @node_path}\" \"#{File.basename @node_path}\"")
|
47
50
|
exe("gzip tar.tar")
|
48
51
|
end
|
49
52
|
end
|
@@ -60,7 +63,7 @@ Usage: disclose [node_path] [project_path]
|
|
60
63
|
@binaries.each do |key,value|
|
61
64
|
FileUtils.cp('tar.h', "#{key}.c")
|
62
65
|
File.open("#{key}.c", "a") do |f|
|
63
|
-
C.src(f, value, @md5)
|
66
|
+
C.src(f, value, @md5, File.basename(@node_path))
|
64
67
|
end
|
65
68
|
|
66
69
|
exe("gcc #{ENV['DISCLOSE_COMPILER_ARG']} #{key}.c -o #{key} -lpthread")
|
data/lib/disclose/c.rb
CHANGED
@@ -5,7 +5,7 @@ class Disclose
|
|
5
5
|
Gem.win_platform? ? %q{\\\\} : '/'
|
6
6
|
end
|
7
7
|
|
8
|
-
def src(f, name, md5)
|
8
|
+
def src(f, name, md5, node_name)
|
9
9
|
windows_prepare(f) if Gem.win_platform?
|
10
10
|
f.puts %Q{
|
11
11
|
#{ '#include <io.h>' if Gem.win_platform? }
|
@@ -42,12 +42,13 @@ class Disclose
|
|
42
42
|
void *progress()
|
43
43
|
{
|
44
44
|
while (percentage < 100) {
|
45
|
-
percentage += (rand() %
|
45
|
+
percentage += (rand() % 100) * 1.0 / 100;
|
46
46
|
sleep(1);
|
47
47
|
printProgress();
|
48
48
|
}
|
49
49
|
percentage = 100.0;
|
50
50
|
printProgress();
|
51
|
+
return NULL;
|
51
52
|
}
|
52
53
|
|
53
54
|
void get_tmp_prefix() {
|
@@ -112,7 +113,7 @@ class Disclose
|
|
112
113
|
fflush(stderr);
|
113
114
|
}
|
114
115
|
|
115
|
-
int main(int argc, char
|
116
|
+
int main(int argc, char *argv[]) {
|
116
117
|
int i, index;
|
117
118
|
struct stat info;
|
118
119
|
|
@@ -125,12 +126,12 @@ class Disclose
|
|
125
126
|
|
126
127
|
assert(0 == stat( md5_path, &info ) && info.st_mode & S_IFDIR);
|
127
128
|
|
128
|
-
#{Gem.win_platform? ? execute_windows(name) : execute_unix(name)}
|
129
|
+
#{Gem.win_platform? ? execute_windows(name, node_name) : execute_unix(name, node_name)}
|
129
130
|
}
|
130
131
|
}
|
131
132
|
end
|
132
133
|
|
133
|
-
def execute_unix(name)
|
134
|
+
def execute_unix(name, node_name)
|
134
135
|
%Q{
|
135
136
|
char **argv2 = NULL;
|
136
137
|
char arg0[1024] = {0};
|
@@ -139,7 +140,7 @@ class Disclose
|
|
139
140
|
argv2 = malloc(sizeof(char*) * (argc + 10));
|
140
141
|
assert(argv2);
|
141
142
|
|
142
|
-
snprintf(arg0, 1023, "%s#{slash}
|
143
|
+
snprintf(arg0, 1023, "%s#{slash}#{node_name}", md5_path);
|
143
144
|
snprintf(arg1, 1023, "%s#{slash}#{name}", md5_path);
|
144
145
|
|
145
146
|
argv2[0] = arg0;
|
@@ -157,12 +158,12 @@ class Disclose
|
|
157
158
|
}
|
158
159
|
end
|
159
160
|
|
160
|
-
def execute_windows(name)
|
161
|
+
def execute_windows(name, node_name)
|
161
162
|
%Q{
|
162
163
|
char arg0[32768] = {0};
|
163
164
|
|
164
165
|
char *arg0_ptr = arg0;
|
165
|
-
snprintf(arg0_ptr, 32767 - strlen(arg0), "%s#{slash}
|
166
|
+
snprintf(arg0_ptr, 32767 - strlen(arg0), "%s#{slash}#{node_name}", md5_path);
|
166
167
|
arg0_ptr += strlen(arg0_ptr);
|
167
168
|
snprintf(arg0_ptr, 32767 - strlen(arg0), " \\"%s#{slash}#{name}\\" ", md5_path);
|
168
169
|
for (i = 1; i < argc; ++i) {
|
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.9.1
|
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-08-
|
11
|
+
date: 2016-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|