Skip to content

Commit

Permalink
Playing with alternative file inclusion mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
mdenwood committed Sep 8, 2023
1 parent b936335 commit b260b67
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ Imports:
cyphr,
stringr,
shiny,
shinythemes
shinythemes,
markdown
Depends:
R (>= 4.1.0),
tidyverse
Expand Down
56 changes: 56 additions & 0 deletions notebooks/D2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Generated by roxygen2: do not edit by hand

export(get_public_keys)
export(gy_decrypt)
export(gy_deserialise)
export(gy_deserialize)
export(gy_encrypt)
export(gy_info)
export(gy_join_group)
export(gy_key_funs)
export(gy_load)
export(gy_profile)
export(gy_public_file)
export(gy_readRDS)
export(gy_save)
export(gy_saveRDS)
export(gy_serialise)
export(gy_serialize)
export(gy_set_group)
export(gy_setup)
export(gy_unzip)
export(gy_users)
export(gy_zip)
export(run_app)
import(shiny)
import(shinydashboard)
importFrom(base64enc,base64decode)
importFrom(base64enc,base64encode)
importFrom(getPass,getPass)
importFrom(keyring,key_delete)
importFrom(keyring,key_get)
importFrom(keyring,key_list)
importFrom(keyring,key_set_with_value)
importFrom(qs,qdeserialize)
importFrom(qs,qserialize)
importFrom(rstudioapi,isAvailable)
importFrom(rstudioapi,selectDirectory)
importFrom(sodium,auth_decrypt)
importFrom(sodium,auth_encrypt)
importFrom(sodium,data_decrypt)
importFrom(sodium,data_encrypt)
importFrom(sodium,hash)
importFrom(sodium,keygen)
importFrom(sodium,pubkey)
importFrom(sodium,sig_keygen)
importFrom(sodium,sig_pubkey)
importFrom(sodium,sig_sign)
importFrom(sodium,sig_verify)
importFrom(sodium,simple_decrypt)
importFrom(sodium,simple_encrypt)
importFrom(stringr,str_c)
importFrom(stringr,str_glue)
importFrom(stringr,str_remove)
importFrom(zip,unzip)
importFrom(zip,zip)
importFrom(zip,zip_list)
56 changes: 56 additions & 0 deletions notebooks/NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Generated by roxygen2: do not edit by hand

export(get_public_keys)
export(gy_decrypt)
export(gy_deserialise)
export(gy_deserialize)
export(gy_encrypt)
export(gy_info)
export(gy_join_group)
export(gy_key_funs)
export(gy_load)
export(gy_profile)
export(gy_public_file)
export(gy_readRDS)
export(gy_save)
export(gy_saveRDS)
export(gy_serialise)
export(gy_serialize)
export(gy_set_group)
export(gy_setup)
export(gy_unzip)
export(gy_users)
export(gy_zip)
export(run_app)
import(shiny)
import(shinydashboard)
importFrom(base64enc,base64decode)
importFrom(base64enc,base64encode)
importFrom(getPass,getPass)
importFrom(keyring,key_delete)
importFrom(keyring,key_get)
importFrom(keyring,key_list)
importFrom(keyring,key_set_with_value)
importFrom(qs,qdeserialize)
importFrom(qs,qserialize)
importFrom(rstudioapi,isAvailable)
importFrom(rstudioapi,selectDirectory)
importFrom(sodium,auth_decrypt)
importFrom(sodium,auth_encrypt)
importFrom(sodium,data_decrypt)
importFrom(sodium,data_encrypt)
importFrom(sodium,hash)
importFrom(sodium,keygen)
importFrom(sodium,pubkey)
importFrom(sodium,sig_keygen)
importFrom(sodium,sig_pubkey)
importFrom(sodium,sig_sign)
importFrom(sodium,sig_verify)
importFrom(sodium,simple_decrypt)
importFrom(sodium,simple_encrypt)
importFrom(stringr,str_c)
importFrom(stringr,str_glue)
importFrom(stringr,str_remove)
importFrom(zip,unzip)
importFrom(zip,zip)
importFrom(zip,zip_list)
Binary file added notebooks/archive.zip
Binary file not shown.
20 changes: 20 additions & 0 deletions notebooks/binary_enc.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
files <- c("DESCRIPTION", "NAMESPACE")

files |>
set_names() |>
lapply(function(ff) readBin(ff, "raw", file.size(ff)*1.1)) ->
dd

dd |> object.size()
serialize(dd, NULL) |> object.size()
qs::qserialize(dd) |> object.size()

library("archive")
writeBin(dd[[1]], archive_write("notebooks/archive.zip", files[1]))
writeBin(dd[[2]], archive_write("notebooks/archive.zip", files[2]))
## Note: this only does 1 file at a time; we need archive_write_files

archive("notebooks/archive.zip")

?archive::archive_write

0 comments on commit b260b67

Please sign in to comment.