Code Monkey home page Code Monkey logo

Comments (4)

ScientistJake avatar ScientistJake commented on July 22, 2024

I gave a go at this one.
I haven't tested it within the ramazon function but it provides the correct link! Note that this pulls the most recent build which is not the same one advertised on the shiny server website which is a couple versions back. The latest release might be have some bugs?
Lines 69 to 87:
https://github.com/ScientistJake/ramazon/blob/master/R/ramazon_mac.R

#XML is needed for this next chunk:
#Here we parse the xml of download3.rstudio.org/
#Using the rootsize we can extract the last entry which is the latest version of shiny server
if(!require(XML)){
  install.packages("XML")
  library(XML)
}
xml.url <- 'http://download3.rstudio.org/'
xmlParsed <- xmlParse(xml.url)
rootnode <- xmlRoot(xmlParsed)
rootsize <- xmlSize(rootnode)
latest_shiny_path <- xmlValue(rootnode[[rootsize]][[1]])
shiny_version <- unlist(strsplit(latest_shiny_path,'/'))[3]

# install latest Shiny server version
command <- c("\necho 'R installed'")
command <- append(command,"sudo apt-get install -y gdebi-core")
command <- append(command,paste0("wget https://download3.rstudio.org/",latest_shiny_path))
command <- append(command,paste0("sudo gdebi --non-interactive ",shiny_version))

from ramazon.

AndreaCirilloAC avatar AndreaCirilloAC commented on July 22, 2024

nice and smooth, we'd better handle xml dependence within the package description, avoiding to employ require : http://r-pkgs.had.co.nz/description.html#dependencies

what do you think @ScientistJake ?

from ramazon.

ScientistJake avatar ScientistJake commented on July 22, 2024

@AndreaCirilloAC That looks like the way to do it! I added:

    Imports: 
        XML 

To the DESCRIPTION file and changed the html parsing to call XML:

    xml.url <- 'http://download3.rstudio.org/' 
    xmlParsed <- XML::xmlParse(xml.url) 
    rootnode <- XML::xmlRoot(xmlParsed) 
    rootsize <- XML::xmlSize(rootnode) 
    latest_shiny_path <- XML::xmlValue(rootnode[[rootsize]][[1]]) 
    shiny_version <- unlist(strsplit(latest_shiny_path,'/'))[3] 

I tested the install, and it loads XML. I also tested the XML function above. If you it looks good it's ready to push https://github.com/ScientistJake/ramazon

from ramazon.

AndreaCirilloAC avatar AndreaCirilloAC commented on July 22, 2024

closed with #10, thank you @ScientistJake !

from ramazon.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.