@@ -58,7 +58,8 @@ generate_pkg_paths <- function(
5858 pagination_data = .generate_pagination(),
5959 base_url = api_definition @ servers @ url ,
6060 use_prefix = use_prefix ,
61- exclude_from_response = exclude_from_response
61+ exclude_from_response = exclude_from_response ,
62+ pkg_dir = pkg_dir
6263 )
6364}
6465
@@ -74,7 +75,8 @@ generate_pkg_paths <- function(
7475 pagination_data = list (),
7576 base_url ,
7677 use_prefix = FALSE ,
77- exclude_from_response = character ()
78+ exclude_from_response = character (),
79+ pkg_dir = " ."
7880) {
7981 paths_by_operation <- as_bk_data(
8082 paths ,
@@ -87,12 +89,14 @@ generate_pkg_paths <- function(
8789 api_abbr ,
8890 security_data ,
8991 pagination_data ,
90- use_prefix = use_prefix
92+ use_prefix = use_prefix ,
93+ pkg_dir = pkg_dir
9194 )
9295 setup_file <- .bk_use_template(
9396 template = " setup.R" ,
9497 data = list (base_url = base_url ),
95- dir = " tests/testthat"
98+ dir = " tests/testthat" ,
99+ pkg_dir = pkg_dir
96100 )
97101 paths_file_paths <- c(paths_file_paths , setup_file )
98102 }
@@ -523,7 +527,8 @@ S7::method(as_bk_data, class_paths) <- function(
523527 api_abbr ,
524528 security_data ,
525529 pagination_data ,
526- use_prefix = FALSE
530+ use_prefix = FALSE ,
531+ pkg_dir = " ."
527532) {
528533 security_arg_names <- security_data $ security_arg_names %| 0 | % character ()
529534
@@ -558,7 +563,8 @@ S7::method(as_bk_data, class_paths) <- function(
558563 op_id ,
559564 api_abbr ,
560565 security_data ,
561- use_prefix = use_prefix
566+ use_prefix = use_prefix ,
567+ pkg_dir = pkg_dir
562568 )
563569 })))
564570
@@ -568,7 +574,8 @@ S7::method(as_bk_data, class_paths) <- function(
568574 op ,
569575 op_id ,
570576 api_abbr ,
571- use_prefix = use_prefix
577+ use_prefix = use_prefix ,
578+ pkg_dir = pkg_dir
572579 )
573580 })))
574581
@@ -679,7 +686,8 @@ S7::method(as_bk_data, class_paths) <- function(
679686 operation_id ,
680687 api_abbr ,
681688 security_data ,
682- use_prefix = FALSE
689+ use_prefix = FALSE ,
690+ pkg_dir = " ."
683691) {
684692 fn_prefix <- if (use_prefix ) paste0(api_abbr , " _" ) else " "
685693 tidy_policy_body <-
@@ -699,7 +707,8 @@ S7::method(as_bk_data, class_paths) <- function(
699707 pagination_fn = " "
700708 )
701709 ),
702- target = glue :: glue(" paths-{path_operation$tag}-{operation_id}.R" )
710+ target = glue :: glue(" paths-{path_operation$tag}-{operation_id}.R" ),
711+ pkg_dir = pkg_dir
703712 )
704713}
705714
@@ -712,7 +721,8 @@ S7::method(as_bk_data, class_paths) <- function(
712721 path_operation ,
713722 operation_id ,
714723 api_abbr ,
715- use_prefix = FALSE
724+ use_prefix = FALSE ,
725+ pkg_dir = " ."
716726) {
717727 fn_prefix <- if (use_prefix ) paste0(api_abbr , " _" ) else " "
718728 .bk_use_template(
@@ -725,6 +735,7 @@ S7::method(as_bk_data, class_paths) <- function(
725735 test_args = path_operation $ test_args %| 0 | % " "
726736 ),
727737 dir = " tests/testthat" ,
728- target = glue :: glue(" test-paths-{path_operation$tag}-{operation_id}.R" )
738+ target = glue :: glue(" test-paths-{path_operation$tag}-{operation_id}.R" ),
739+ pkg_dir = pkg_dir
729740 )
730741}
0 commit comments