Skip to content

Commit

Permalink
* check_antiword_installed failed for Linux and Mac users. It now w…
Browse files Browse the repository at this point in the history
…orks on

  Windows, Linux, and Mac.  Thanks to José de Jesus Filho for catching this and
  working through the process on Linux (see issue #5).
  • Loading branch information
trinker committed Apr 19, 2017
1 parent 2410899 commit 4ce7323
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 20 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: textreadr
Title: Read Text Documents into R
Version: 0.4.0
Version: 0.4.1
Authors@R: c(person("Tyler", "Rinker", email =
"tyler.rinker@gmail.com", role = c("aut", "cre")),
person("Bryan", "Goodrich", role = "ctb"))
Expand Down
6 changes: 5 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ textreadr 0.4.0 -
BUG FIXES

* The README.md called for `ex_` functions from **qdapRegex**. This was the dev
version of **qdapRegex**. THis is now the CRAN version and now works for users.
version of **qdapRegex**. This is now the CRAN version and now works for users.

* `check_antiword_installed` failed for Linux and Mac users. It now works on
Windows, Linux, and Mac. Thanks to José de Jesus Filho for catching this and
working through the process on Linux (see issue #5).

NEW FEATURES

Expand Down
22 changes: 11 additions & 11 deletions R/check_antiword_installed.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@ check_antiword_installed <- function(antiword.path = textreadr::antiword_loc(),
out <- file.exists(antiword.path)

if (isTRUE(out)) {

mess <- paste0("antiword appears to be installed.\n\n",
"...Let the .doc extraction begin!\n\n")
if (isTRUE(verbose)) message(mess)
return(invisible(NULL))

} else {

os <- Sys.info()[['sysname']]

switch(os,
Windows= {install_anitword_windows()},
Linux = {install_anitword_linux()},
Darwin = {install_anitword_mac()},
stop(paste0(os, 'is not a supported operating system.'))
)
)


}
}

Expand All @@ -55,10 +55,10 @@ install_anitword_windows <- function(){
} else {
message("Let me try...\nHold on. It may take some time...\n")
}

root <- strsplit(getwd(), "(/|\\\\)+")[[1]][1]
download <- textreadr::antiword_url()

download <- textreadr::antiword_url()
temp <- tempdir()
dest <- file.path(temp, basename(download))
utils::download.file(download, dest)
Expand All @@ -77,9 +77,9 @@ install_anitword_windows <- function(){
}

install_anitword_linux <- function(){
stop('Antiword must be installed first. Please try:\n\nsudo apt-get install antiword')
stop('Antiword must be installed first. Please install first:\n\nsudo apt-get install antiword')
}

install_anitword_mac <- function(){
stop('Antiword must be installed first. Please install from:\n\nhttp://www.finkproject.org/pdb/package.php/antiword')
stop('Antiword must be installed first. Please install first via:\n\nhttp://www.finkproject.org/pdb/package.php/antiword')
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Status](https://travis-ci.org/trinker/textreadr.svg?branch=master)](https://trav
[![Coverage
Status](https://coveralls.io/repos/trinker/textreadr/badge.svg?branch=master)](https://coveralls.io/r/trinker/textreadr?branch=master)
[![](http://cranlogs.r-pkg.org/badges/textreadr)](https://cran.r-project.org/package=textreadr)
<a href="https://img.shields.io/badge/Version-0.4.0-orange.svg"><img src="https://img.shields.io/badge/Version-0.4.0-orange.svg" alt="Version"/></a>
<a href="https://img.shields.io/badge/Version-0.4.1-orange.svg"><img src="https://img.shields.io/badge/Version-0.4.1-orange.svg" alt="Version"/></a>
</p>

**textreadr** is a small collection of convenience tools for reading
Expand Down Expand Up @@ -211,7 +211,7 @@ Here I download a .docx file of presidential debated from 2012.
read_docx() %>%
head(3)

## pres.deb1.docx read into C:\Users\Tyler\AppData\Local\Temp\RtmpmMCOHL
## pres.deb1.docx read into C:\Users\Tyler\AppData\Local\Temp\Rtmp2nx2JB

## [1] "LEHRER: We'll talk about -- specifically about health care in a moment. But what -- do you support the voucher system, Governor?"
## [2] "ROMNEY: What I support is no change for current retirees and near-retirees to Medicare. And the president supports taking $716 billion out of that program."
Expand Down Expand Up @@ -631,7 +631,7 @@ I demonstrate pairings with
textshape::split_index(which(.$loc) -1) %>%
lapply(select, -loc)

## SCDB_2012_01_codebook.pdf read into C:\Users\Tyler\AppData\Local\Temp\RtmpmMCOHL
## SCDB_2012_01_codebook.pdf read into C:\Users\Tyler\AppData\Local\Temp\Rtmp2nx2JB

## Function to extract cases
ex_vs <- qdapRegex::ex_(pattern = "((of|[A-Z][A-Za-z'.,-]+)\\s+)+([Vv]s?\\.\\s+)(([A-Z][A-Za-z'.,-]+\\s+)*((of|[A-Z][A-Za-z',.-]+),?($|\\s+|\\d))+)")
Expand Down
4 changes: 2 additions & 2 deletions inst/CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ citEntry(entry = "manual",
author = "Tyler W. Rinker",
organization = "University at Buffalo/SUNY",
address = "Buffalo, New York",
note = "version 0.4.0",
note = "version 0.4.1",
year = "2017",
url = "http://github.com/trinker/textreadr",
textVersion = paste("Rinker, T. W. (2017).",
"textreadr: Read Text Documents into R",
"version 0.4.0. University at Buffalo. Buffalo, New York.",
"version 0.4.1. University at Buffalo. Buffalo, New York.",
"http://github.com/trinker/textreadr")
)
4 changes: 2 additions & 2 deletions inst/maintenance.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#========
# BUILD
#========
source("inst/build.R")
update_date(); source("inst/build.R")

#==========================
# Run unit tests
Expand Down Expand Up @@ -51,7 +51,7 @@ expand_statdoc(path2, to.icon = extras, readme = rdme)

x <- readLines(path2)
x[grepl("<h2>Authors</h2>", x)] <- paste(
c("<h2>Author</h2>"
c("<h2>Author</h2>"
#rep("<h2>Contributor</h2>", 1)
),
c("Tyler W. Rinker")
Expand Down

0 comments on commit 4ce7323

Please sign in to comment.