Skip to content

Commit 0dda20c

Browse files
authored
Typos and cleanup (#356)
* #355 typo * #354 clearer message for public mode * #353 rename static folder to templates * #351 remove config subcommand * #352 preffered - preferred * #349 typo default env * #357 try --locked build
1 parent 9a1fad5 commit 0dda20c

File tree

10 files changed

+19
-25
lines changed

10 files changed

+19
-25
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,14 @@ jobs:
5656
- name: Install cargo-llvm-cov
5757
uses: taiki-e/install-action@cargo-llvm-cov
5858
- name: Generate code coverage
59-
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
59+
run: cargo llvm-cov --all-features --workspace --lcov --locked --output-path lcov.info
6060
- name: Upload coverage to Codecov
6161
uses: codecov/codecov-action@v1
6262
with:
6363
token: ${{ secrets.CODECOV_TOKEN }}
6464
files: lcov.info
6565
fail_ci_if_error: true
66+
6667
fmt:
6768
name: Rustfmt
6869
runs-on: ubuntu-latest

cli/src/main.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,6 @@ fn main() -> AtomicResult<()> {
192192
.required(true)
193193
)
194194
)
195-
.subcommand(
196-
Command::new("config")
197-
.about("Returns the path of the config file")
198-
.arg(Arg::new("subject")
199-
.help("Subject URL or bookmark of the resource to be destroyed")
200-
.required(true)
201-
)
202-
)
203195
.subcommand(Command::new("list").about("List all bookmarks"))
204196
.subcommand(Command::new("validate").about("Validates the store").hide(true))
205197
.get_matches();

cli/src/new.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub fn new(context: &mut Context) -> AtomicResult<()> {
4343
fn prompt_instance<'a>(
4444
context: &'a Context,
4545
class: &Class,
46-
preffered_shortname: Option<String>,
46+
preferred_shortname: Option<String>,
4747
) -> CLIResult<(Resource, Option<String>)> {
4848
// Not sure about the best way t
4949
// The Path is the thing at the end of the URL, from the domain
@@ -54,7 +54,7 @@ fn prompt_instance<'a>(
5454
let write_ctx = context.get_write_context();
5555

5656
let mut subject = format!("{}/{}", write_ctx.server, path);
57-
if let Some(sn) = &preffered_shortname {
57+
if let Some(sn) = &preferred_shortname {
5858
subject = format!("{}/{}-{}", write_ctx.server, path, sn);
5959
}
6060

@@ -68,15 +68,15 @@ fn prompt_instance<'a>(
6868

6969
for prop_subject in &class.requires {
7070
let field = context.store.get_property(prop_subject)?;
71-
if field.subject == atomic_lib::urls::SHORTNAME && preffered_shortname.clone().is_some() {
71+
if field.subject == atomic_lib::urls::SHORTNAME && preferred_shortname.clone().is_some() {
7272
new_resource.set_propval_string(
7373
field.subject.clone(),
74-
&preffered_shortname.clone().unwrap(),
74+
&preferred_shortname.clone().unwrap(),
7575
&context.store,
7676
)?;
7777
println!(
7878
"Shortname set to {}",
79-
preffered_shortname.clone().unwrap().bold().green()
79+
preferred_shortname.clone().unwrap().bold().green()
8080
);
8181
continue;
8282
}

cli/src/print.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ use crate::Context;
1212
pub const SERIALIZE_OPTIONS: [&str; 7] =
1313
["pretty", "json", "jsonld", "jsonad", "nt", "turtle", "n3"];
1414

15-
/// Returns preffered serialization format. Defaults to pretty.
15+
/// Returns preferred serialization format. Defaults to pretty.
1616
pub fn get_serialization(argmatches: &ArgMatches) -> AtomicResult<Format> {
17-
let format = if let Some(preffered_format) = argmatches.value_of("as") {
18-
match preffered_format {
17+
let format = if let Some(preferred_format) = argmatches.value_of("as") {
18+
match preferred_format {
1919
"pretty" => (Format::Pretty),
2020
"json" => (Format::Json),
2121
"jsonld" => (Format::JsonLd),

server/default.env

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# This file contains default environment variables for runnign atomic-server.
2-
# You can also set these using the command line by passing flags, such as `atomic-server --domain localhost`.
1+
# This file contains default environment variables for running atomic-server.
2+
# You can also set these using the command line by passing flags,
3+
# such as `atomic-server --domain localhost`.
34
# Uncomment lines (remove the `#`) where you want to make adjustments.
45

56
# domain name where the server is hosted, including subdoman, without schema (http) and port

server/openapi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ paths:
1414
"/":
1515
get:
1616
summary: Get a resource
17-
description: Send an HTTP GET request to the URL of the resource. The preffered serialization format is [JSON-AD](https://docs.atomicdata.dev/core/json-ad.html), since that contains full URLs, but it also supports plain JSON, JSON-LD, Turtle and N-Triples.
17+
description: Send an HTTP GET request to the URL of the resource. The preferred serialization format is [JSON-AD](https://docs.atomicdata.dev/core/json-ad.html), since that contains full URLs, but it also supports plain JSON, JSON-LD, Turtle and N-Triples.
1818
parameters:
1919
- in: header
2020
name: x-atomic-public-key

server/src/config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ pub struct Opts {
6565
#[clap(long, env = "ATOMIC_CONFIG_DIR")]
6666
pub config_dir: Option<PathBuf>,
6767

68-
/// CAUTION: Makes data public on the `/search` endpoint. When enabled, it allows POSTing to the /search endpoint and returns search results as single triples, without performing authentication checks. See https://github.com/joepio/atomic-data-rust/blob/master/server/rdf-search.md
68+
/// CAUTION: Makes data publicly readable on the `/search` endpoint. When enabled, it allows POSTing to the /search endpoint and returns search results as single triples, without performing authentication checks. See https://github.com/joepio/atomic-data-rust/blob/master/server/rdf-search.md
6969
#[clap(long, env = "ATOMIC_RDF_SEARCH")]
7070
pub rdf_search: bool,
7171

72-
/// By default, Atomic-Server keeps previous verions of resources indexed in Search. When enabling this flag, previous versions of resources are removed from the search index when their values are updated.
72+
/// By default, Atomic-Server keeps previous versions of resources indexed in Search. When enabling this flag, previous versions of resources are removed from the search index when their values are updated.
7373
#[clap(long, env = "ATOMIC_REMOVE_PREVIOUS_SEARCH")]
7474
pub remove_previous_search: bool,
7575

76-
/// CAUTION: Skip authentication checks, making all data public. Improves performance.
76+
/// CAUTION: Skip authentication checks, making all data publicly readable. Improves performance.
7777
#[clap(long, env = "ATOMIC_PUBLIC_MODE")]
7878
pub public_mode: bool,
7979

server/src/content_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl ContentType {
4343
}
4444
}
4545

46-
/// Returns the preffered content type.
46+
/// Returns the preferred content type.
4747
/// Defaults to HTML if none is found.
4848
pub fn get_accept(map: &HeaderMap) -> ContentType {
4949
let accept_header = match map.get("Accept") {

server/src/handlers/single_page_app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use actix_web::HttpResponse;
66
pub async fn single_page(
77
appstate: actix_web::web::Data<AppState>,
88
) -> AtomicServerResult<HttpResponse> {
9-
let template = include_str!("../../static/atomic-data-browser.html");
9+
let template = include_str!("../../templates/atomic-data-browser.html");
1010
let body = template
1111
.replace("{ script }", &appstate.config.opts.script)
1212
.replace("{ asset_url }", &appstate.config.opts.asset_url);
File renamed without changes.

0 commit comments

Comments
 (0)