Skip to content

Commit

Permalink
Bump version: 0.3.4 -> 0.3.5 (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Dec 11, 2017
1 parent 9fc3262 commit 26098ba
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 27 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.3.5] - 2017-12-11
### Added
- Align doc-comments in `--list` output (#273)
- Add `arch()`, `os()`, and `os_family()` functions (#277)
Expand Down
28 changes: 11 additions & 17 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "just"
version = "0.3.4"
version = "0.3.5"
description = "🤖 Just a command runner"
authors = ["Casey Rodarmor <casey@rodarmor.com>"]
license = "CC0-1.0"
Expand Down
1 change: 0 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ publish: lint clippy test
cargo publish
git tag -a {{version}} -m 'Release {{version}}'
git push github {{version}}
git push github

# clean up feature branch BRANCH
done BRANCH:
Expand Down
4 changes: 2 additions & 2 deletions src/assignment_evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ impl<'a, 'b> AssignmentEvaluator<'a, 'b> {
}
Expression::Call{name, arguments: ref call_arguments, ref token} => {
let call_arguments = call_arguments.iter().map(|argument| {
self.evaluate_expression(argument, &arguments)
self.evaluate_expression(argument, arguments)
}).collect::<Result<Vec<String>, RuntimeError>>()?;
::functions::evaluate_function(&token, name, &call_arguments)
::functions::evaluate_function(token, name, &call_arguments)
}
Expression::String{ref cooked_string} => Ok(cooked_string.cooked.clone()),
Expression::Backtick{raw, ref token} => {
Expand Down
14 changes: 9 additions & 5 deletions src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ pub fn resolve_function<'a>(token: &Token<'a>, argc: usize) -> CompilationResult
if let Some(function) = FUNCTIONS.get(&name) {
use self::Function::*;
match (function, argc) {
(&Nullary(_), 0) => Ok(()),
(&Unary(_), 1) => Ok(()),
(&Nullary(_), 0) |
(&Unary(_), 1) |
(&Binary(_), 2) => Ok(()),
_ => {
Err(token.error(CompilationErrorKind::FunctionArgumentCountMismatch{
Expand All @@ -47,7 +47,11 @@ pub fn resolve_function<'a>(token: &Token<'a>, argc: usize) -> CompilationResult
}
}

pub fn evaluate_function<'a>(token: &Token<'a>, name: &'a str, arguments: &[String]) -> RunResult<'a, String> {
pub fn evaluate_function<'a>(
token: &Token<'a>,
name: &'a str,
arguments: &[String]
) -> RunResult<'a, String> {
if let Some(function) = FUNCTIONS.get(name) {
use self::Function::*;
let argc = arguments.len();
Expand Down Expand Up @@ -83,7 +87,7 @@ pub fn os_family() -> Result<String, String> {
Ok(target::os_family().to_string())
}

pub fn env_var<'a>(key: &str) -> Result<String, String> {
pub fn env_var(key: &str) -> Result<String, String> {
use std::env::VarError::*;
match env::var(key) {
Err(NotPresent) => Err(format!("environment variable `{}` not present", key)),
Expand All @@ -93,7 +97,7 @@ pub fn env_var<'a>(key: &str) -> Result<String, String> {
}
}

pub fn env_var_or_default<'a>(key: &str, default: &str) -> Result<String, String> {
pub fn env_var_or_default(key: &str, default: &str) -> Result<String, String> {
use std::env::VarError::*;
match env::var(key) {
Err(NotPresent) => Ok(default.to_string()),
Expand Down
4 changes: 3 additions & 1 deletion src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,9 @@ pub fn run() {
if let Some(doc) = recipe.doc {
print!(
" {:padding$}{} {}", "", doc_color.paint("#"), doc_color.paint(doc),
padding = max_line_width.saturating_sub(line_widths.get(name).cloned().unwrap_or(max_line_width))
padding = max_line_width.saturating_sub(
line_widths.get(name).cloned().unwrap_or(max_line_width)
)
);
}
println!();
Expand Down

0 comments on commit 26098ba

Please sign in to comment.