Skip to content

Commit

Permalink
Add compile_ruby metadata key introduced by drgtk-2.10-pro (#32)
Browse files Browse the repository at this point in the history
* Add compile_ruby metadata key introduced by drgtk-2.10-pro

* Default to false for old projects

* Add to changelog

Co-authored-by: Matt Pruitt <[email protected]>
  • Loading branch information
logankoester and Matt Pruitt authored Apr 14, 2021
1 parent 35b9ae4 commit 1e99a9c
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
* Fixed dragonruby install from itch.io package
* Fixed issue with add with empty dependencies in config
* Fixed `smaug.rb` generation on Windows
* Add `compile_ruby` flag to enable Bytecode compilation
* Automatically run `smaug install` on `smaug add`
2 changes: 2 additions & 0 deletions cli/src/game_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub struct GameMetadata {
pub gametitle: String,
pub version: String,
pub icon: String,
pub compile_ruby: bool,
}

pub fn from_config(config: &Config) -> GameMetadata {
Expand All @@ -25,6 +26,7 @@ pub fn from_config(config: &Config) -> GameMetadata {
gametitle: project.title,
version: project.version,
icon: project.icon,
compile_ruby: project.compile_ruby,
}
}

Expand Down
1 change: 1 addition & 0 deletions cli/templates/Project.toml.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ title = "{ name }"
version = "0.1.0"
authors = ["TODO: My Name <[email protected]>"]
icon = "metadata/icon.png"
compile_ruby = false

[dragonruby]
version = "{ version }"
Expand Down
1 change: 1 addition & 0 deletions cli/templates/game_metadata.txt.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ gameid={ gameid }
gametitle={ gametitle }
version={ version}
icon={ icon }
compile_ruby={ compile_ruby }
2 changes: 2 additions & 0 deletions smaug/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ pub struct Project {
pub version: String,
pub authors: Vec<String>,
pub icon: String,
#[serde(default)]
pub compile_ruby: bool,
}

#[derive(Debug, Deserialize)]
Expand Down
1 change: 1 addition & 0 deletions smaug/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ pub struct Project {
pub authors: Vec<String>,
pub name: String,
pub version: Version,
pub compile_ruby: bool,
}

0 comments on commit 1e99a9c

Please sign in to comment.