Skip to content

Commit

Permalink
Ref #61 readme and badges
Browse files Browse the repository at this point in the history
  • Loading branch information
ronnyhdez committed Feb 9, 2020
1 parent 671ef67 commit 1f8b8e7
Show file tree
Hide file tree
Showing 12 changed files with 515 additions and 184 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
^.*\.Rproj$
^\.Rproj\.user$
^README\.Rmd$
^\.travis\.yml$
^codecov\.yml$
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r

language: R
cache: packages
10 changes: 6 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Package: gitear
Title: Client to the 'gitea' API
Version: 0.0.4
Version: 1.0.0
Authors@R: c(
person(family="ixpantia, SRL", role = "aut", email = "[email protected]"),
person("Frans", "van Dunné", role=c("cre", "aut"), email="[email protected]"),
person("Francisco", "Sácida", role="aut", email="[email protected]"),
person("Ronny", "Hernández Mora", role="ctb", email="[email protected]"))
person("Ronny", "Hernández Mora", role="aut", email="[email protected]"))
Description: 'Gitea' is a community managed, lightweight code hosting solution
were projects and their respective git repositories can be managed
<https://gitea.io>. This package gives an interface to the 'Gitea' API to
Expand All @@ -17,8 +17,10 @@ Imports:
License: MIT + file LICENCE
Encoding: UTF-8
LazyData: true
Suggests: testthat,
Suggests:
testthat,
knitr,
rmarkdown
rmarkdown,
covr
RoxygenNote: 7.0.2
VignetteBuilder: knitr
29 changes: 29 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ knitr::opts_chunk$set(
fig.path = "man/figures/README-",
out.width = "100%"
)
library(gitear)
library(dplyr)
```

# gitear <a href="url"><img src="gitear.png" align="right" width="30%"></a>

<!-- badges: start -->
[![CRAN status](https://www.r-pkg.org/badges/version/gitear)](https://cran.r-project.org/package=gitear)
[![Travis build status](https://travis-ci.org/ixpantia/gitear.svg?branch=master)](https://travis-ci.org/ixpantia/gitear)
[![Codecov test coverage](https://codecov.io/gh/ixpantia/gitear/branch/master/graph/badge.svg)](https://codecov.io/gh/ixpantia/gitear?branch=master)
<!-- badges: end -->

The goal of gitear is to request your self-hosted Git service data and import
Expand Down Expand Up @@ -52,5 +56,30 @@ issues <- get_issues(base_url = url_ixpantia,
repo = "ixmandash")
```

## **Environmental variables:**

In order to work with environmental variables to make your scripts safer from
somebody getting your credentials, you can follow the next workflow:

1- Create an .Renviron file with your credentials
2- Restart your R session
3- Store your credentials in an object for using it in your script

Your script could look something like this:

```{r}
# Storing credentials in an object
example_key <- Sys.getenv("example_key")
example_url <- Sys.getenv("example_url")
# Using a function from gitear
issues <- get_issues(base_url = example_url,
api_key = example_key,
owner = "ixpantia",
repo = "lacrmr")
# Check the output
glimpse(issues)
```


42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

[![CRAN
status](https://www.r-pkg.org/badges/version/gitear)](https://cran.r-project.org/package=gitear)
[![Travis build
status](https://travis-ci.org/ixpantia/gitear.svg?branch=master)](https://travis-ci.org/ixpantia/gitear)
[![Codecov test
coverage](https://codecov.io/gh/ixpantia/gitear/branch/master/graph/badge.svg)](https://codecov.io/gh/ixpantia/gitear?branch=master)
<!-- badges: end -->

The goal of gitear is to request your self-hosted Git service data and
Expand Down Expand Up @@ -43,3 +47,41 @@ issues <- get_issues(base_url = url_ixpantia,
owner = "ixpantia",
repo = "ixmandash")
```

## **Environmental variables:**

In order to work with environmental variables to make your scripts safer
from somebody getting your credentials, you can follow the next
workflow:

1- Create an .Renviron file with your credentials 2- Restart your R
session 3- Store your credentials in an object for using it in your
script

Your script could look something like this:

``` r
# Storing credentials in an object
example_key <- Sys.getenv("example_key")
example_url <- Sys.getenv("example_url")

# Using a function from gitear
issues <- get_issues(base_url = example_url,
api_key = example_key,
owner = "ixpantia",
repo = "lacrmr")

# Check the output
glimpse(issues)
#> Observations: 4
#> Variables: 9
#> $ number <int> 38, 26, 24, 15
#> $ title <chr> "lacrmr dejó de funcionar porque llave está deshabilitad…
#> $ created_date <chr> "2020-01-25", "2019-05-03", "2019-05-03", "2019-02-07"
#> $ created_time <chr> "00:45:48", "22:28:41", "21:28:00", "19:55:19"
#> $ updated_date <chr> "2020-01-25", "2020-01-24", "2019-05-03", "2020-01-24"
#> $ updated_time <chr> "00:45:52", "22:03:13", "21:28:14", "22:03:23"
#> $ due_date <lgl> NA, NA, NA, NA
#> $ author <chr> "ronny", "ronny", "ronny", "ronny"
#> $ assignee <chr> "ronny", "ronny", "ronny", "ronny"
```
12 changes: 12 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
comment: false

coverage:
status:
project:
default:
target: auto
threshold: 1%
patch:
default:
target: auto
threshold: 1%
91 changes: 45 additions & 46 deletions docs/articles/Access-diff-issues-on-diff-instances.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1f8b8e7

Please sign in to comment.