atome 0.5.5.6.8 → 0.5.5.6.9
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/Rakefile +100 -129
- data/atome.gemspec +6 -0
- data/exe/atome +39 -40
- data/lib/atome/version.rb +2 -1
- data/vendor/assets/Rakefile +4 -3
- data/vendor/assets/application/index.rb +1 -0
- data/vendor/assets/src/js/atome/atome.js +94 -95
- metadata +30 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a905162a755c4deb4bcbd8d7ec8504bb8ad4b3ac123e9846633a95f92e24fdd0
|
4
|
+
data.tar.gz: 5d7214da310e2b2e7632d1faf583274932a60209afba739b77990bd10f34b41b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a743c4f73769c7dfb5c6667899f97ad2bd474696dcebff791097375c7d5a35e50958fefc8de07fc85e2d82a322bb23163a499aef4130a16aa26edb05857ec430
|
7
|
+
data.tar.gz: a81d9d618478984eae77511aaee26773852c574dbaea6cd6cead4920ea522fa92aed0709e1a2c43a474ac227983f7bc012e86d1e1204067b4463f4b1ddbe742a
|
data/Rakefile
CHANGED
@@ -16,53 +16,25 @@ task :cleanup do
|
|
16
16
|
begin
|
17
17
|
cleanup_command.invoke('atome')
|
18
18
|
rescue Gem::SystemExitException => e
|
19
|
-
puts "
|
19
|
+
puts "Error : #{e.message}"
|
20
20
|
end
|
21
21
|
|
22
22
|
begin
|
23
23
|
uninstaller = Gem::Uninstaller.new('atome', { executables: true, all: true, force: true })
|
24
24
|
uninstaller.uninstall
|
25
25
|
rescue Gem::InstallError => e
|
26
|
-
puts "
|
26
|
+
puts "Error uninstalling : #{e.message}"
|
27
27
|
end
|
28
28
|
|
29
29
|
Dir.chdir('pkg') do
|
30
|
-
#
|
30
|
+
# treatment here
|
31
31
|
end
|
32
32
|
|
33
|
-
# if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
34
|
-
# # code to exec for Windows
|
35
|
-
# `gem cleanup atome`
|
36
|
-
# `echo yes | gem uninstall atome`
|
37
|
-
# `cd pkg`
|
38
|
-
#
|
39
|
-
# elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
40
|
-
# # code to exec for MacOS
|
41
|
-
# `gem cleanup atome;yes | gem uninstall atome;cd pkg`
|
42
|
-
# else
|
43
|
-
# # code to exec for Unix/Linux
|
44
|
-
# `gem cleanup atome;yes | gem uninstall atome;cd pkg`
|
45
|
-
# end
|
46
33
|
|
47
34
|
end
|
48
35
|
task :reset_cache do
|
49
36
|
FileUtils.rm_rf('./tmp')
|
50
37
|
FileUtils.rm_rf('./pkg')
|
51
|
-
# if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
52
|
-
# # code to exec for Windows
|
53
|
-
# `rmdir /s /q .\\tmp`
|
54
|
-
# `rmdir /s /q .\\pkg`
|
55
|
-
#
|
56
|
-
# elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
57
|
-
# # code to exec for MacOS
|
58
|
-
# `rm -r -f ./tmp`
|
59
|
-
# `rm -r -f ./pkg`
|
60
|
-
# else
|
61
|
-
# # code to exec for Unix/Linux
|
62
|
-
# `rm -r -f ./tmp`
|
63
|
-
# `rm -r -f ./pkg`
|
64
|
-
# end
|
65
|
-
|
66
38
|
end
|
67
39
|
|
68
40
|
def resolve_requires(file_path, root_path, processed_files = Set.new, depth = 0)
|
@@ -142,73 +114,6 @@ task :test_wasm do
|
|
142
114
|
puts 'atome wasm is build and running!'
|
143
115
|
end
|
144
116
|
|
145
|
-
# task :test_wasm_osx_x86 do
|
146
|
-
# # wasi Source here : https://github.com/kateinoigakukun/wasi-vfs/releases
|
147
|
-
# project_name = :test
|
148
|
-
# source = '.'
|
149
|
-
# destination = './tmp'
|
150
|
-
# script_source = './test/application'
|
151
|
-
# wasi_file = 'wasi-vfs-osx_x86'
|
152
|
-
# host_mode = 'pure_wasm'
|
153
|
-
# create_application(source, destination, project_name)
|
154
|
-
# wasm_common(source, destination, project_name, wasi_file, script_source, host_mode, script_source)
|
155
|
-
# if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
156
|
-
# # code to exec for Windows
|
157
|
-
# `start "" ".\\tmp\\#{project_name}\\src\\index.html"`
|
158
|
-
# elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
159
|
-
# # code to exec for MacOS
|
160
|
-
# `open ./tmp/#{project_name}/src/index.html`
|
161
|
-
# else
|
162
|
-
# # code to exec for Unix/Linux
|
163
|
-
# `open ./tmp/#{project_name}/src/index.html`
|
164
|
-
# end
|
165
|
-
#
|
166
|
-
# puts 'atome wasm is build and running!'
|
167
|
-
# end
|
168
|
-
# task :test_wasm_windows do
|
169
|
-
# # wasi Source here : https://github.com/kateinoigakukun/wasi-vfs/releases
|
170
|
-
# project_name = :test
|
171
|
-
# source = '.'
|
172
|
-
# destination = './tmp'
|
173
|
-
# script_source = './test/application'
|
174
|
-
# wasi_file = 'wasi-vfs.exe pack'
|
175
|
-
# host_mode = 'pure_wasm'
|
176
|
-
# create_application(source, destination, project_name)
|
177
|
-
# wasm_common(source, destination, project_name, wasi_file, host_mode, script_source)
|
178
|
-
# if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
179
|
-
# # code to exec for Windows
|
180
|
-
# `start "" ".\\tmp\\#{project_name}\\src\\index.html"`
|
181
|
-
# elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
182
|
-
# # code to exec for MacOS
|
183
|
-
# `open ./tmp/#{project_name}/src/index.html`
|
184
|
-
# else
|
185
|
-
# # code to exec for Unix/Linux
|
186
|
-
# `open ./tmp/#{project_name}/src/index.html`
|
187
|
-
# end
|
188
|
-
# puts 'atome wasm is build and running!'
|
189
|
-
# end
|
190
|
-
# task :test_wasm_unix do
|
191
|
-
# # wasi Source here : https://github.com/kateinoigakukun/wasi-vfs/releases
|
192
|
-
# project_name = :test
|
193
|
-
# source = '.'
|
194
|
-
# destination = './tmp'
|
195
|
-
# script_source = './test/application'
|
196
|
-
# wasi_file = 'wasi-vfs-unix pack tmp'
|
197
|
-
# host_mode = 'pure_wasm'
|
198
|
-
# create_application(source, destination, project_name)
|
199
|
-
# wasm_common(source, destination, project_name, wasi_file, host_mode, script_source)
|
200
|
-
# if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
201
|
-
# # code to exec for Windows
|
202
|
-
# `start "" ".\\tmp\\#{project_name}\\src\\index.html"`
|
203
|
-
# elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
204
|
-
# # code to exec for MacOS
|
205
|
-
# `open ./tmp/#{project_name}/src/index.html`
|
206
|
-
# else
|
207
|
-
# # code to exec for Unix/Linux
|
208
|
-
# `open ./tmp/#{project_name}/src/index.html`
|
209
|
-
# end
|
210
|
-
# puts 'atome wasm is build and running!'
|
211
|
-
# end
|
212
117
|
|
213
118
|
task :test_opal do
|
214
119
|
project_name = :test
|
@@ -253,7 +158,6 @@ task :server_wasm do
|
|
253
158
|
host_mode = 'pure_wasm'
|
254
159
|
create_application(source, destination, project_name)
|
255
160
|
wasm_common(source, destination, project_name, wasi_file, host_mode, script_source)
|
256
|
-
# `open ./tmp/#{project_name}/src/index.html`
|
257
161
|
puts 'atome wasm is build and running!'
|
258
162
|
build_for_server(destination, project_name, 9292, :production)
|
259
163
|
|
@@ -404,36 +308,103 @@ end
|
|
404
308
|
|
405
309
|
|
406
310
|
task :push_gem do
|
311
|
+
# pushing the gem
|
312
|
+
|
313
|
+
dir_path = './pkg'
|
314
|
+
entries = Dir.entries(dir_path)
|
315
|
+
|
316
|
+
gem_files = entries.select { |file| file.end_with?('.gem') }
|
317
|
+
|
318
|
+
sorted_versions = gem_files.map { |file|
|
319
|
+
file.scan(/\d+\.\d+\.\d+\.\d+\.\d+/).first
|
320
|
+
}.compact.sort_by { |version| Gem::Version.new(version) }
|
321
|
+
|
322
|
+
latest_version = sorted_versions.last
|
323
|
+
latest_file = gem_files.find { |file| file.include?(latest_version) }
|
407
324
|
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
#
|
420
|
-
# end
|
421
|
-
#
|
422
|
-
# puts 'atome gem pushed'
|
325
|
+
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
326
|
+
# code to exec for Windows
|
327
|
+
`cd pkg && gem push #{latest_file}`
|
328
|
+
elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
329
|
+
# code to exec for MacOS
|
330
|
+
`cd pkg; gem push #{latest_file}`
|
331
|
+
# open the app
|
332
|
+
else
|
333
|
+
# code to exec for Unix/Linux
|
334
|
+
`cd pkg; gem push #{latest_file}`
|
335
|
+
end
|
336
|
+
puts "#{latest_file} pushed"
|
423
337
|
end
|
424
338
|
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
#
|
429
|
-
#
|
430
|
-
#
|
431
|
-
|
432
|
-
#
|
433
|
-
|
434
|
-
|
435
|
-
#
|
436
|
-
|
437
|
-
#
|
438
|
-
|
439
|
-
#
|
339
|
+
|
340
|
+
task :full_test do
|
341
|
+
|
342
|
+
# building the gem
|
343
|
+
`rake build` # run build_app thru ARGV in exe atome
|
344
|
+
# installing the gem
|
345
|
+
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
346
|
+
# code to exec for Windows
|
347
|
+
`cd pkg && gem install atome --local`
|
348
|
+
elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
349
|
+
# code to exec for MacOS
|
350
|
+
`cd pkg; gem install atome --local`
|
351
|
+
# open the app
|
352
|
+
else
|
353
|
+
# code to exec for Unix/Linux
|
354
|
+
`cd pkg; gem install atome --local`
|
355
|
+
# open the app
|
356
|
+
end
|
357
|
+
|
358
|
+
puts 'atome gem built and installed'
|
359
|
+
|
360
|
+
# now building new test app
|
361
|
+
project_name = :test
|
362
|
+
source = '.'
|
363
|
+
destination = './tmp'
|
364
|
+
script_source = './test/application'
|
365
|
+
create_application(source, destination, project_name)
|
366
|
+
# the line below is to add addition script to the application folder (useful for test per example)
|
367
|
+
add_to_application_folder(script_source, destination, project_name)
|
368
|
+
# build opal
|
369
|
+
build_opal_library(source, destination, project_name)
|
370
|
+
# build parser
|
371
|
+
build_opal_parser(source, destination, project_name)
|
372
|
+
# build atome kernel
|
373
|
+
build_atome_kernel_for_opal(source, destination, project_name)
|
374
|
+
# build host_mode
|
375
|
+
build_host_mode(destination, project_name, 'web-opal')
|
376
|
+
# build Opal extensions
|
377
|
+
build_opal_extensions(source, destination, project_name)
|
378
|
+
# build application
|
379
|
+
build_opal_application(source, destination, project_name)
|
380
|
+
# open the app
|
381
|
+
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
382
|
+
# code to exec for Windows
|
383
|
+
`start "" "#{destination}\\#{project_name}\\src\\index_opal.html"`
|
384
|
+
elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
385
|
+
# code to exec for MacOS
|
386
|
+
`open #{destination}/#{project_name}/src/index_opal.html`
|
387
|
+
else
|
388
|
+
# code to exec for Unix/Linux
|
389
|
+
`open #{destination}/#{project_name}/src/index_opal.html`
|
390
|
+
end
|
391
|
+
|
392
|
+
puts 'atome opal is build and running!'
|
393
|
+
|
394
|
+
# now running the app
|
395
|
+
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
396
|
+
# code to exec for Windows
|
397
|
+
`cd #{destination} && atome run server`
|
398
|
+
elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
399
|
+
# code to exec for MacOS
|
400
|
+
`cd #{destination}; atome run server`
|
401
|
+
# open the app
|
402
|
+
else
|
403
|
+
# code to exec for Unix/Linux
|
404
|
+
`cd #{destination}; atome run server`
|
405
|
+
# open the app
|
406
|
+
end
|
407
|
+
|
408
|
+
end
|
409
|
+
|
410
|
+
|
data/atome.gemspec
CHANGED
@@ -55,6 +55,12 @@ Gem::Specification.new do |spec|
|
|
55
55
|
spec.add_runtime_dependency 'sqlite3', '~> 1.4'
|
56
56
|
spec.add_runtime_dependency 'uglifier', '~> 0.1'
|
57
57
|
#spec.add_runtime_dependency 'webrick', '~> 1.7.0'
|
58
|
+
# the gem below are need to make the atome server works on Windows
|
59
|
+
spec.add_runtime_dependency 'win32-security', '~> 0.5.0'
|
60
|
+
spec.add_runtime_dependency 'tzinfo-data', '~> 1.2023.4'
|
61
|
+
|
62
|
+
|
63
|
+
|
58
64
|
|
59
65
|
# Uncomment to register a new dependency of your gem
|
60
66
|
# spec.add_dependency "example-gem", "~> 1.0"
|
data/exe/atome
CHANGED
@@ -9,8 +9,10 @@ require 'opal'
|
|
9
9
|
require 'parser'
|
10
10
|
require 'uglifier'
|
11
11
|
|
12
|
+
|
12
13
|
# utils
|
13
14
|
|
15
|
+
|
14
16
|
def modify_and_copy_file(source_path, destination_path, destination_dir)
|
15
17
|
|
16
18
|
file_content = File.read(source_path)
|
@@ -133,15 +135,15 @@ STR
|
|
133
135
|
f.puts opal_compiler_content
|
134
136
|
end
|
135
137
|
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
136
|
-
#
|
138
|
+
# code to exec with Windows
|
137
139
|
`cd #{destination}\\#{project_name}\\tmp\\application\\ && echo %cd% && ruby .opal_compiler.rb`
|
138
140
|
|
139
141
|
elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
140
|
-
#
|
142
|
+
# code to exec with MacOS
|
141
143
|
`cd #{destination}/#{project_name}/tmp/application/;pwd;ruby .opal_compiler.rb`
|
142
144
|
|
143
145
|
else
|
144
|
-
#
|
146
|
+
# code to exec with Unix/Linux
|
145
147
|
`cd #{destination}/#{project_name}/tmp/application/;pwd;ruby .opal_compiler.rb`
|
146
148
|
end
|
147
149
|
|
@@ -264,40 +266,40 @@ def wasm_initialize (source, destination, project_name, wasi_source)
|
|
264
266
|
`cd /d #{wasm_temp_folder} && curl -LO https://github.com/ruby/ruby.wasm/releases/download/2023-11-17-a/ruby-3_2-wasm32-unknown-wasi-full-js.tar.gz
|
265
267
|
`
|
266
268
|
elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
267
|
-
#
|
269
|
+
# code to exec with MacOS
|
268
270
|
# `cd #{wasm_temp_folder};curl -LO https://github.com/ruby/ruby.wasm/releases/latest/download/ruby-3_2-wasm32-unknown-wasi-full-js.tar.gz`
|
269
271
|
`cd #{wasm_temp_folder};curl -LO https://github.com/ruby/ruby.wasm/releases/download/2023-11-17-a/ruby-3_2-wasm32-unknown-wasi-full-js.tar.gz`
|
270
272
|
# debug : https://github.com/ruby/ruby.wasm/releases/download/2023-11-17-a/ruby-3_2-wasm32-unknown-wasi-minimal-js-debug.tar.gz
|
271
273
|
# standard : `cd #{wasm_temp_folder};curl -LO https://github.com/ruby/ruby.wasm/releases/download/2023-11-17-a/ruby-3_2-wasm32-unknown-wasi-full-js.tar.gz`
|
272
274
|
|
273
275
|
else
|
274
|
-
#
|
276
|
+
# code to exec with Unix/Linux
|
275
277
|
`cd #{wasm_temp_folder};curl -LO https://github.com/ruby/ruby.wasm/releases/download/2023-11-17-a/ruby-3_2-wasm32-unknown-wasi-full-js.tar.gz`
|
276
278
|
end
|
277
279
|
|
278
280
|
end
|
279
281
|
|
280
282
|
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
281
|
-
#
|
283
|
+
# code to exec with Windows
|
282
284
|
application_location = "#{destination}\\#{project_name}"
|
283
285
|
|
284
286
|
`cd /d #{wasm_temp_folder} && tar xfz ruby-3_2-wasm32-unknown-wasi-full-js.tar.gz`
|
285
287
|
`move #{wasm_temp_folder}\\3_2-wasm32-unknown-wasi-full-js\\usr\\local\\bin\\ruby #{wasm_temp_folder}\\system_ruby_browser.wasm`
|
286
288
|
`del #{application_location}\\src\\wasm\\ruby_browser.wasm`
|
287
289
|
elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
288
|
-
#
|
290
|
+
# code to exec with MacOS
|
289
291
|
`cd #{wasm_temp_folder}; tar xfz ruby-3_2-wasm32-unknown-wasi-full-js.tar.gz`
|
290
292
|
`mv #{wasm_temp_folder}/3_2-wasm32-unknown-wasi-full-js/usr/local/bin/ruby #{wasm_temp_folder}/system_ruby_browser.wasm`
|
291
293
|
`rm -f #{application_location}/src/wasm/ruby_browser.wasm`
|
292
294
|
else
|
293
|
-
#
|
295
|
+
# code to exec with Unix/Linux
|
294
296
|
`cd #{wasm_temp_folder}; tar xfz ruby-3_2-wasm32-unknown-wasi-full-js.tar.gz`
|
295
297
|
`mv #{wasm_temp_folder}/3_2-wasm32-unknown-wasi-full-js/usr/local/bin/ruby #{wasm_temp_folder}/system_ruby_browser.wasm`
|
296
298
|
`rm -f #{application_location}/src/wasm/ruby_browser.wasm`
|
297
299
|
end
|
298
300
|
|
299
301
|
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
300
|
-
#
|
302
|
+
# code to exec with Windows
|
301
303
|
cmd = <<~STRDELIM
|
302
304
|
"#{application_location}\\src-wasm\\wasm\\#{wasi_source}" pack "#{wasm_temp_folder}\\system_ruby_browser.wasm"
|
303
305
|
-mapdir usr::"#{wasm_temp_folder}\\3_2-wasm32-unknown-wasi-full-js\\usr"
|
@@ -307,7 +309,7 @@ def wasm_initialize (source, destination, project_name, wasi_source)
|
|
307
309
|
-o "#{application_location}\\src\\wasm\\ruby_browser.wasm"
|
308
310
|
STRDELIM
|
309
311
|
elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
310
|
-
#
|
312
|
+
# code to exec with MacOS
|
311
313
|
cmd = <<~STRDELIM
|
312
314
|
#{application_location}/src-wasm/wasm/#{wasi_source} pack #{wasm_temp_folder}/system_ruby_browser.wasm
|
313
315
|
--mapdir usr::#{wasm_temp_folder}/3_2-wasm32-unknown-wasi-full-js/usr
|
@@ -317,7 +319,7 @@ def wasm_initialize (source, destination, project_name, wasi_source)
|
|
317
319
|
-o #{application_location}/src/wasm/ruby_browser.wasm
|
318
320
|
STRDELIM
|
319
321
|
else
|
320
|
-
#
|
322
|
+
# code to exec with Unix/Linux
|
321
323
|
cmd = <<~STRDELIM
|
322
324
|
#{application_location}/src-wasm/wasm/#{wasi_source} pack #{wasm_temp_folder}/system_ruby_browser.wasm
|
323
325
|
--mapdir usr::#{wasm_temp_folder}/3_2-wasm32-unknown-wasi-full-js/usr
|
@@ -347,14 +349,13 @@ end
|
|
347
349
|
def build_for_osx(destination, mode = :dev)
|
348
350
|
# dev or build
|
349
351
|
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
350
|
-
#
|
352
|
+
# code to exec with Windows
|
351
353
|
`cd /d #{destination} && cargo tauri #{mode}`
|
352
|
-
|
353
354
|
elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
354
|
-
#
|
355
|
+
# code to exec with MacOS
|
355
356
|
`cd #{destination};cargo tauri #{mode}`
|
356
357
|
else
|
357
|
-
#
|
358
|
+
# code to exec with Unix/Linux
|
358
359
|
`cd #{destination};cargo tauri #{mode}`
|
359
360
|
end
|
360
361
|
|
@@ -363,13 +364,13 @@ end
|
|
363
364
|
def build_for_server(destination, project_name, port, production)
|
364
365
|
prod = '--env production' if production
|
365
366
|
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
366
|
-
#
|
367
|
+
# code to exec with Windows
|
367
368
|
`cd /d #{destination}\\#{project_name}\\server && puma --port #{port} #{prod}`
|
368
369
|
elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
369
|
-
#
|
370
|
+
# code to exec with MacOS
|
370
371
|
`cd #{destination}/#{project_name}/server;puma --port #{port} #{prod}`
|
371
372
|
else
|
372
|
-
#
|
373
|
+
# code to exec with Unix/Linux
|
373
374
|
`cd #{destination}/#{project_name}/server;puma --port #{port} #{prod}`
|
374
375
|
end
|
375
376
|
|
@@ -385,16 +386,16 @@ location = '/'
|
|
385
386
|
project_name = ARGV[1]
|
386
387
|
|
387
388
|
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
388
|
-
#
|
389
|
+
# code to exec with Windows
|
389
390
|
destination = `cd`.chomp
|
390
391
|
wasi_file = 'wasi-vfs.exe'
|
391
392
|
|
392
393
|
elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
393
|
-
#
|
394
|
+
# code to exec with MacOS
|
394
395
|
destination = `pwd`.chomp
|
395
396
|
wasi_file = 'wasi-vfs-osx_arm' # default to osx arm
|
396
397
|
else
|
397
|
-
#
|
398
|
+
# code to exec with Unix/Linux
|
398
399
|
destination = `pwd`.chomp
|
399
400
|
wasi_file = 'wasi-vfs-unix'
|
400
401
|
end
|
@@ -405,16 +406,7 @@ source = Pathname(__FILE__).parent.parent.to_s
|
|
405
406
|
if ARGV.include?('create')
|
406
407
|
create_application(source, destination, project_name)
|
407
408
|
# create_application(source, destination, project_name, production)
|
408
|
-
|
409
|
-
# build opal
|
410
|
-
build_opal_library(source, destination, project_name)
|
411
|
-
# build parser
|
412
|
-
build_opal_parser(source, destination, project_name)
|
413
|
-
# build atome kernel
|
414
|
-
build_atome_kernel_for_opal(source, destination, project_name)
|
415
|
-
# build Opal extensions
|
416
|
-
build_opal_extensions(source, destination, project_name)
|
417
|
-
# build application
|
409
|
+
|
418
410
|
build_opal_application(source, destination, project_name)
|
419
411
|
end
|
420
412
|
|
@@ -448,13 +440,13 @@ end
|
|
448
440
|
if ARGV.include?('run')
|
449
441
|
|
450
442
|
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
451
|
-
#
|
443
|
+
# code to exec with Windows
|
452
444
|
current_path = `cd`.chomp
|
453
445
|
elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
454
|
-
#
|
446
|
+
# code to exec with MacOS
|
455
447
|
current_path = `pwd`.chomp
|
456
448
|
else
|
457
|
-
#
|
449
|
+
# code to exec with Unix/Linux
|
458
450
|
current_path = `pwd`.chomp
|
459
451
|
end
|
460
452
|
segments = current_path.split("/")
|
@@ -475,13 +467,13 @@ if ARGV.include?('run')
|
|
475
467
|
sleep 1
|
476
468
|
|
477
469
|
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
478
|
-
#
|
470
|
+
# code to exec with Windows
|
479
471
|
`start "" "#{destination}\\#{project_name}\\src\\index_opal.html`
|
480
472
|
elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
481
|
-
#
|
473
|
+
# code to exec with MacOS
|
482
474
|
`open http://localhost:9292`
|
483
475
|
else
|
484
|
-
#
|
476
|
+
# code to exec with Unix/Linux
|
485
477
|
`open http://localhost:9292`
|
486
478
|
end
|
487
479
|
|
@@ -506,16 +498,23 @@ if ARGV.include?('run')
|
|
506
498
|
wasm_common(source, destination, project_name, wasi_file, 'pure_wasm')
|
507
499
|
|
508
500
|
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
509
|
-
#
|
501
|
+
# code to exec with Windows
|
510
502
|
`start "" "#{current_path}\\src\\index.html"`
|
511
503
|
elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
512
|
-
#
|
504
|
+
# code to exec with MacOS
|
513
505
|
`open #{current_path}/src/index.html`
|
514
506
|
else
|
515
|
-
#
|
507
|
+
# code to exec with Unix/Linux
|
516
508
|
`open #{current_path}/src/index.html`
|
517
509
|
end
|
518
510
|
|
519
511
|
end
|
520
512
|
|
521
513
|
end
|
514
|
+
|
515
|
+
|
516
|
+
# if ARGV.include?('build')
|
517
|
+
# puts "kool"
|
518
|
+
# # path = found_path('build')
|
519
|
+
# # build_app(path, production)
|
520
|
+
# end
|
data/lib/atome/version.rb
CHANGED
data/vendor/assets/Rakefile
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
1
|
+
# used by guard , see ./Guardfile
|
2
|
+
task :build do
|
3
|
+
`atome build`
|
4
|
+
end
|
@@ -218,99 +218,98 @@ function fileForOpal(parent, bloc) {
|
|
218
218
|
})
|
219
219
|
|
220
220
|
}
|
221
|
-
//
|
222
|
-
// function importer(){
|
223
|
-
//
|
224
|
-
// // Gestionnaire pour le drag and drop de fichiers
|
225
|
-
// document.body.addEventListener('dragover', function(e) {
|
226
|
-
// e.preventDefault(); // Nécessaire pour autoriser le drop
|
227
|
-
// // Modifier le style si nécessaire
|
228
|
-
// });
|
229
|
-
//
|
230
|
-
// document.body.addEventListener('drop', function(e) {
|
231
|
-
// e.preventDefault();
|
232
|
-
// let files = e.dataTransfer.files; // Obtention de la liste des fichiers déposés
|
233
|
-
//
|
234
|
-
// if (files.length) {
|
235
|
-
// // Parcourir chaque fichier
|
236
|
-
// for (let i = 0; i < files.length; i++) {
|
237
|
-
// let file = files[i];
|
238
|
-
// let reader = new FileReader();
|
239
|
-
//
|
240
|
-
// // Lire le fichier en tant que texte
|
241
|
-
// reader.readAsText(file);
|
242
|
-
//
|
243
|
-
// // Événement déclenché une fois la lecture terminée
|
244
|
-
// reader.onload = function() {
|
245
|
-
// console.log('Contenu du fichier #' + (i + 1));
|
246
|
-
// console.log('Nom: ' + file.name);
|
247
|
-
// console.log('Type: ' + file.type);
|
248
|
-
// console.log('Taille: ' + file.size + ' octets');
|
249
|
-
// console.log('Contenu: \n' + reader.result); // Affichage du contenu du fichier
|
250
|
-
// };
|
251
|
-
//
|
252
|
-
// // Gestion des erreurs de lecture
|
253
|
-
// reader.onerror = function() {
|
254
|
-
// console.error('Erreur de lecture du fichier: ' + file.name);
|
255
|
-
// };
|
256
|
-
// }
|
257
|
-
// }
|
258
|
-
// // if (e.dataTransfer.files.length) {
|
259
|
-
// // alert (e.dataTransfer.files);
|
260
|
-
// // // Traiter les fichiers déposés
|
261
|
-
// // }
|
262
|
-
// });
|
263
|
-
//
|
264
|
-
// // Gestionnaire pour les éléments div
|
265
|
-
// var divs = document.querySelectorAll('.draggable-div');
|
266
|
-
// divs.forEach(function(div) {
|
267
|
-
// div.addEventListener('dragstart', function(e) {
|
268
|
-
// e.dataTransfer.setData('text/plain', 'some-data');
|
269
|
-
// e.stopPropagation(); // Empêcher la propagation au body
|
270
|
-
// });
|
271
|
-
// });
|
272
|
-
//
|
273
|
-
// }
|
274
|
-
//
|
275
|
-
// importer()
|
276
|
-
//
|
277
|
-
//
|
278
|
-
// function exception_import (){
|
279
|
-
// // Sélectionner la div spéciale par son ID
|
280
|
-
// var specialDiv = document.getElementById('exept');
|
281
|
-
//
|
282
|
-
// // Gestionnaire d'événements pour la 'special-div' pour le drag over
|
283
|
-
// specialDiv.addEventListener('dragover', function(e) {
|
284
|
-
//
|
285
|
-
// specialDiv.style.backgroundColor= 'red';
|
286
|
-
// e.preventDefault(); // Prévenir le comportement par défaut
|
287
|
-
// e.stopPropagation(); // Arrêter la propagation de l'événement
|
288
|
-
// });
|
289
|
-
// specialDiv.addEventListener('dragleave', function(e) {
|
290
|
-
// specialDiv.style.backgroundColor = 'yellow'; // Réinitialiser la couleur de fond lors du drag out
|
291
|
-
// e.stopPropagation(); // Arrêter la propagation de l'événement
|
292
|
-
// });
|
293
|
-
// // Gestionnaire d'événements pour la 'special-div' pour le drop
|
294
|
-
// specialDiv.addEventListener('drop', function(e) {
|
295
|
-
// e.preventDefault(); // Prévenir le comportement par défaut
|
296
|
-
// e.stopPropagation(); // Arrêter la propagation de l'événement
|
297
|
-
//
|
298
|
-
// // Traitement spécifique pour les fichiers déposés sur la 'special-div'
|
299
|
-
// console.log('Fichier déposé dans la zone spéciale');
|
300
|
-
// });
|
301
|
-
//
|
302
|
-
// // Gestionnaire d'événements pour le body pour le drop
|
303
|
-
// // document.body.addEventListener('drop', function(e) {
|
304
|
-
// // e.preventDefault(); // Prévenir le comportement par défaut
|
305
|
-
// //
|
306
|
-
// // // Traitement pour les fichiers déposés en dehors de la 'special-div'
|
307
|
-
// // console.log('Fichier déposé hors de la zone spéciale');
|
308
|
-
// // });
|
309
|
-
//
|
310
|
-
//
|
311
|
-
// }
|
312
|
-
// setTimeout(function () {
|
313
|
-
// exception_import();
|
314
|
-
// console.log('ready');
|
315
|
-
// }, 3000);
|
316
221
|
|
222
|
+
function importer(){
|
223
|
+
|
224
|
+
// Gestionnaire pour le drag and drop de fichiers
|
225
|
+
document.body.addEventListener('dragover', function(e) {
|
226
|
+
e.preventDefault(); // Nécessaire pour autoriser le drop
|
227
|
+
// Modifier le style si nécessaire
|
228
|
+
});
|
229
|
+
|
230
|
+
document.body.addEventListener('drop', function(e) {
|
231
|
+
e.preventDefault();
|
232
|
+
let files = e.dataTransfer.files; // Obtention de la liste des fichiers déposés
|
233
|
+
|
234
|
+
if (files.length) {
|
235
|
+
// Parcourir chaque fichier
|
236
|
+
for (let i = 0; i < files.length; i++) {
|
237
|
+
let file = files[i];
|
238
|
+
let reader = new FileReader();
|
239
|
+
|
240
|
+
// Lire le fichier en tant que texte
|
241
|
+
reader.readAsText(file);
|
242
|
+
|
243
|
+
// Événement déclenché une fois la lecture terminée
|
244
|
+
reader.onload = function() {
|
245
|
+
console.log('Contenu du fichier #' + (i + 1));
|
246
|
+
console.log('Nom: ' + file.name);
|
247
|
+
console.log('Type: ' + file.type);
|
248
|
+
console.log('Taille: ' + file.size + ' octets');
|
249
|
+
console.log('Contenu: \n' + reader.result); // Affichage du contenu du fichier
|
250
|
+
};
|
251
|
+
|
252
|
+
// Gestion des erreurs de lecture
|
253
|
+
reader.onerror = function() {
|
254
|
+
console.error('Erreur de lecture du fichier: ' + file.name);
|
255
|
+
};
|
256
|
+
}
|
257
|
+
}
|
258
|
+
// if (e.dataTransfer.files.length) {
|
259
|
+
// alert (e.dataTransfer.files);
|
260
|
+
// // Traiter les fichiers déposés
|
261
|
+
// }
|
262
|
+
});
|
263
|
+
|
264
|
+
// Gestionnaire pour les éléments div
|
265
|
+
var divs = document.querySelectorAll('.draggable-div');
|
266
|
+
divs.forEach(function(div) {
|
267
|
+
div.addEventListener('dragstart', function(e) {
|
268
|
+
e.dataTransfer.setData('text/plain', 'some-data');
|
269
|
+
e.stopPropagation(); // Empêcher la propagation au body
|
270
|
+
});
|
271
|
+
});
|
272
|
+
|
273
|
+
}
|
274
|
+
|
275
|
+
importer()
|
276
|
+
|
277
|
+
|
278
|
+
function exception_import (){
|
279
|
+
// Sélectionner la div spéciale par son ID
|
280
|
+
var specialDiv = document.getElementById('my_box');
|
281
|
+
|
282
|
+
// Gestionnaire d'événements pour la 'special-div' pour le drag over
|
283
|
+
specialDiv.addEventListener('dragover', function(e) {
|
284
|
+
|
285
|
+
specialDiv.style.backgroundColor= 'red';
|
286
|
+
e.preventDefault(); // Prévenir le comportement par défaut
|
287
|
+
e.stopPropagation(); // Arrêter la propagation de l'événement
|
288
|
+
});
|
289
|
+
specialDiv.addEventListener('dragleave', function(e) {
|
290
|
+
specialDiv.style.backgroundColor = 'yellow'; // Réinitialiser la couleur de fond lors du drag out
|
291
|
+
e.stopPropagation(); // Arrêter la propagation de l'événement
|
292
|
+
});
|
293
|
+
// Gestionnaire d'événements pour la 'special-div' pour le drop
|
294
|
+
specialDiv.addEventListener('drop', function(e) {
|
295
|
+
e.preventDefault(); // Prévenir le comportement par défaut
|
296
|
+
e.stopPropagation(); // Arrêter la propagation de l'événement
|
297
|
+
|
298
|
+
// Traitement spécifique pour les fichiers déposés sur la 'special-div'
|
299
|
+
console.log('Fichier déposé dans la zone spéciale');
|
300
|
+
});
|
301
|
+
|
302
|
+
// Gestionnaire d'événements pour le body pour le drop
|
303
|
+
document.body.addEventListener('drop', function(e) {
|
304
|
+
e.preventDefault(); // Prévenir le comportement par défaut
|
305
|
+
|
306
|
+
// Traitement pour les fichiers déposés en dehors de la 'special-div'
|
307
|
+
console.log('Fichier déposé hors de la zone spéciale');
|
308
|
+
});
|
309
|
+
|
310
|
+
|
311
|
+
}
|
312
|
+
setTimeout(function () {
|
313
|
+
exception_import();
|
314
|
+
console.log('ready');
|
315
|
+
}, 3000);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atome
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.5.6.
|
4
|
+
version: 0.5.5.6.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean-Eric Godard
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: arduino_firmata
|
@@ -318,6 +318,34 @@ dependencies:
|
|
318
318
|
- - "~>"
|
319
319
|
- !ruby/object:Gem::Version
|
320
320
|
version: '0.1'
|
321
|
+
- !ruby/object:Gem::Dependency
|
322
|
+
name: win32-security
|
323
|
+
requirement: !ruby/object:Gem::Requirement
|
324
|
+
requirements:
|
325
|
+
- - "~>"
|
326
|
+
- !ruby/object:Gem::Version
|
327
|
+
version: 0.5.0
|
328
|
+
type: :runtime
|
329
|
+
prerelease: false
|
330
|
+
version_requirements: !ruby/object:Gem::Requirement
|
331
|
+
requirements:
|
332
|
+
- - "~>"
|
333
|
+
- !ruby/object:Gem::Version
|
334
|
+
version: 0.5.0
|
335
|
+
- !ruby/object:Gem::Dependency
|
336
|
+
name: tzinfo-data
|
337
|
+
requirement: !ruby/object:Gem::Requirement
|
338
|
+
requirements:
|
339
|
+
- - "~>"
|
340
|
+
- !ruby/object:Gem::Version
|
341
|
+
version: 1.2023.4
|
342
|
+
type: :runtime
|
343
|
+
prerelease: false
|
344
|
+
version_requirements: !ruby/object:Gem::Requirement
|
345
|
+
requirements:
|
346
|
+
- - "~>"
|
347
|
+
- !ruby/object:Gem::Version
|
348
|
+
version: 1.2023.4
|
321
349
|
description: the creative framework.
|
322
350
|
email:
|
323
351
|
- jeezs@atopme.one
|