R/sass_find.R

# css.build_sass <- function(){
#
#
#
# }
#
# css.sass_installed <- function(){
#   on_sys <- Sys.info()[['sysname']]
#   if(on_sys == "Linux"){
#     v_str <- "sass -v"
#   }else if(on_sys == "Windows"){
#     v_str <- sprintf("%s\\%s"
#                      list.files("C:\\",
#                                 pattern = "Ruby[0-9]{2}\\-x[0-9]{2}",
#                                 full.names = T),
#                      "bin\\sass -v")
#   }
#
#   path_to <- tryCatch(
#     system(v_str, intern = TRUE, ignore.stderr = TRUE),
#     error = function(e) FALSE
#   )
#
#   if(!path_to){
#     FALSE
#   }else{
#     as.character(v_str)
#   }
# }
#
#
# is.windows <- function(){
#   Sys.info()[['sysname']] == "Windows"
# }
#
# is.linux <- function(){
#   Sys.info()[['sysname']] == "Linux"
# }
#
# css.set_sass_path <- function(...){
#   if(is.windows()){
#
#   }
# }
#
# system('C:\\Ruby23-x64\\bin\\scss inst\\materialize-src\\sass\\materialize.scss this.css')
#
# #' @references
# #' \href{https://ghariaonline.wordpress.com/2016/03/14/materialize-css-changing-default-theme-with-sass/}{linux tutorial}
# #'
# find_ruby <- function(){
#   if(Sys.info()[['sysname']] == "Windows"){
#     ruby_path <- list.files("C:\\", pattern = "Ruby[0-9]{2}\\-x[0-9]{2}",
#                             full.names = T)
#     if(!length(ruby_path)){
#       links <- list(
#         download = "https://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.3.3.exe",
#         visit = "http://rubyinstaller.org/downloads/"
#       )
#       chk <- select.list(title = "Ruby was not detected on your Windows exe paths, would you like to?",
#                          choices = c('download exe now','visit download page and download yourself'))
#
#       browseURL(stri_extract_first_words(chk))
#     }else {
#       ruby_path <- 'sass'
#     }
#   }
#
#
#
#
#   css.find_sass_exe <- function(){
#     if(Sys.info()[['sysname']] == "Windows"){
#
#       find_ruby
#     }
#     'C:\\Ruby23-x64\\bin\\scss'
#   }
CarlBoneri/rtspecs documentation built on June 1, 2017, 11:02 p.m.