Code Monkey home page Code Monkey logo

smaug's Introduction

Smaug

Smaug is a tool to manage your DragonRuby Game Toolkit projects.

Installation

Manual Installation

You can download the latest version from the release page.

Linux

Arch Linux

Smaug is on the AUR.

Mac

Install with homebrew.

brew tap ereborstudios/tap
brew install smaug

Windows

Install with scoop.

scoop bucket add ereborstudios https://github.com/ereborstudios/scoop-bucket.git
scoop install smaug

Other Operating Systems

We do not maintain packages for any other operating systems. You can use Cargo as a package manager.

  1. Install rust through your package manager or with rustup
  2. Run cargo install smaug-bin

Usage

smaug 0.4.0
Matt Pruitt <[email protected]>
Create games and share packages with the DragonRuby community

USAGE:
    smaug.exe [FLAGS] <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
        --json       Returns JSON
    -q, --quiet      Silence all output
    -v, --verbose    Displays more information
    -V, --version    Prints version information

SUBCOMMANDS:
    add           Add a dependency to Smaug.toml
    bind          Create bindings for c extensions (Pro only)
    build         Builds your DragonRuby project.
    config        Displays your current project's Smaug configuration
    docs          Opens DragonRuby docs in your web browser
    dragonruby    Manages your local DragonRuby installation.
    help          Prints this message or the help of the given subcommand(s)
    init          Initializes an existing project as a Smaug project.
    install       Installs dependencies from Smaug.toml.
    new           Start a new DragonRuby project
    package       Manages your DragonRuby package.
    publish       Publish your DragonRuby project to Itch.io
    run           Runs your DragonRuby project.

Starting a new DragonRuby project

  1. Download a copy of the DragonRuby Game Toolkit from either Itch.io (standard) or the DragonRuby website (pro).
  2. Install your downloaded copy of DragonRuby: smaug dragonruby install ~/Downloads/dragonruby-linux-amd64.zip.
  3. Create a new project: smaug new my-game then cd my-game.
  4. Edit your project's configuration at Smaug.toml.
  5. Run your game: smaug run.
  6. Build your game: smaug build.
    • Builds will be stored in my-game/builds.
  7. Publish your game: smaug publish.

Migrate an existing DragonRuby project

The following instructions assume your project lives at ~/projects/dragonruby-linux-amd64/mygame.

  1. Move your game's directory outside of the DragonRuby directory: mv ~/projects/dragonruby-linux-amd64/mygame ~/projects/mygame.
  2. Install your version of DragonRuby: smaug dragonruby install ~/projects/dragonruby-linux-amd64.
  3. Add smaug to your project: smaug init ~/projects/mygame.
  4. cd ~/projects/mygame
  5. Edit your project's configuration at Smaug.toml.
  6. Run your game: smaug run.
  7. Build your game: smaug build.
    • Builds will be stored in my-game/builds.
  8. Publish your game: smaug publish.

Install a package

  1. Edit Smaug.toml:
    [dependencies]
    draco = "0.6.1"
    
  2. Run smaug install
  3. Add require "app/smaug.rb" to the top of your main.rb.

Package Sources

# Smaug Registry
name = "version"

# Directory
name = "path/to/package"

# Zip File
name = "path/to/package.zip"

# Online Zip File
name = "https://example.com/package.zip"

# Git Repository
name = "https://github.com/example/package"

# Git Repository Tag
name = { repo = "https://github.com/example/package", tag = "v1.0" }

Creating a package

  1. Run dragonruby package init from your package's directory.
  2. Edit your package's new Smaug.toml file to configure the package.
  3. Add each of the files that are needed for the DragonRuby project.
    requires = [
        "lib/library.rb",
        "lib/library/other.rb"
    ]
    
  4. Publish your changes.

Install Files

You can install files into the game project from your package.

[package.installs]
# "location in package" = "location in game project"
"tiles/grass.png" = "app/sprites/grass.png"

smaug's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

smaug's Issues

Feature request: open docs from CLI

Perhaps this is a bit lazy of me, but it would be neat if I could type smaug docs and have the docs for the working project version of DR docs open in a browser window.

I'd PR this if my rust wasn't so... rusty (sorry). Just throwing this out there, feel free to close/ignore if it's not inline with the mission of the project.

thread 'main' panicked at 'Could not create canonical path:

Help help! :)

I have an existing largisth DR project and did a smaug init and that worked fine. Did smaug run and got the following error. Smaug run works fine on other projects.

Also, the discord invite link on your website didn't work for me.

RUST_BACKTRACE=full smaug run
thread 'main' panicked at 'Could not create canonical path: Os { code: 2, kind: NotFound, message: "No such file or directory" }', cli/src/commands/run.rs:71:51
stack backtrace:
   0:        0x10925e9da - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h533490cb0144b9ac
   1:        0x10928ea5b - core::fmt::write::hd6db5571778cce6c
   2:        0x10924f66a - std::io::Write::write_fmt::h3b731249d14dbbaf
   3:        0x109255e15 - std::panicking::default_hook::{{closure}}::h47e90b77f003c5b7
   4:        0x1092559ee - std::panicking::default_hook::ha5ca508e09960444
   5:        0x10925641a - std::panicking::rust_panic_with_hook::hc8381a31241f686e
   6:        0x10925efde - std::panicking::begin_panic_handler::{{closure}}::h459ea290df0e978a
   7:        0x10925eb37 - std::sys_common::backtrace::__rust_end_short_backtrace::h7b815ac00a857fce
   8:        0x109255f03 - _rust_begin_unwind
   9:        0x1092ac08f - core::panicking::panic_fmt::hedd127944bd71c57
  10:        0x1092ac585 - core::result::unwrap_failed::h191e80e385ea5324
  11:        0x108deef2d - <smaug::commands::run::Run as smaug::command::Command>::run::h419222623b3fc2a9
  12:        0x108e1085c - smaug::main::hd568646c306bfef5
  13:        0x108df2596 - std::sys_common::backtrace::__rust_begin_short_backtrace::h4ab5572004134eef
  14:        0x108e032ac - std::rt::lang_start::{{closure}}::h0e0abfd90a6d2abf
  15:        0x109248ce5 - std::rt::lang_start_internal::h63a1a32878b6f038
  16:        0x108e11869 - _main

Smaug should tell you you have the wrong version

Tried to run my game:

beck:craigjump fregas$ smaug run

Could not find the configured version of DragonRuby. Install it with `smaug dragonruby install`

Thanks for using Smaug!
๐Ÿ“ฆ Explore the package registry at https://smaug.dev/
๐Ÿฆ— Find a bug? File an issue: https://github.com/ereborstudios/smaug/issues
๐Ÿ™‹ Have a question? Start a discussion: https://github.com/ereborstudios/smaug/discussions
๐Ÿ’ฌ Want to chat? Join us on Discord: https://discord.gg/rwT64EtDee

Followed the directions and installed DR:

beck:craigjump fregas$ smaug dragonruby install ~/p/personal/dragonruby/dragonruby-current/

Installed DragonRuby DragonRuby Pro 4.3 (pro-4.3)

Smaug seemed happy so I tried again:

beck:craigjump fregas$ smaug run

Could not find the configured version of DragonRuby. Install it with `smaug dragonruby install`

Turned out, I had installed the wrong version of dragonruby, but smaug did not tell me that. I just had to look in my Smaug.toml file.

I think Smaug should tell you the SPECIFIC version you're game is using.

Create lock file

Keeps track of all copied dependency files with their content hash to check for local changes.

`smaug build` recursively copies all builds into the current game

To reproduce: Create two separate games in separate paths and build each one, then look in each game's build directory. They'll have the builds for all the games, not just the one you're working on.

It looks like Smaug is recursively copying all of the files from the build directory of the DragonRuby installation. Smaug should take care to only copy the build files that were generated only for the current game.

`smaug add` broken on windows

C:\Users\RantingBob\Sync\dev\tbs>smaug add draco
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `"[project]\ntitle = \"tbs\"\nversion = \"0.1.0\"\nauthors = [\"[email protected]\"]\nicon = \"metadata/icon.png\"\n\r\n[dragonruby]\nversion = \"2.10\"\nedition = \"standard\"\n\r\n[itch]\n# The Project URL you set when you created the game on Itch.io. https://my-username.itch.io/my-game.\n# This will also be the name of your build files, so fill it out even if you aren\'t uploading to Itch.io.\nurl = \"https://rantingbob.itch.io/tbs\"\n# Your username on Itch.io.\nusername = \"rantingbob\"\n\r\n[dependencies]\n"`,
 right: `"[project]\r\ntitle = \"tbs\"\r\nversion = \"0.1.0\"\r\nauthors = [\"[email protected]\"]\r\nicon = \"metadata/icon.png\"\r\n\r\n[dragonruby]\r\nversion = \"2.10\"\r\nedition = \"standard\"\r\n\r\n[itch]\r\n# The Project URL you set when you created the game on Itch.io. https://my-username.itch.io/my-game.\r\n# This will also be the name of your build files, so fill it out even if you aren\'t uploading to Itch.io.\r\nurl = \"https://rantingbob.itch.io/tbs\"\r\n# Your username on Itch.io.\r\nusername = \"rantingbob\"\r\n\r\n[dependencies]\r\n"`', cli\src\commands\add.rs:52:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Smaug.toml

[project]
title = "tbs"
version = "0.1.0"
authors = ["[email protected]"]
icon = "metadata/icon.png"

[dragonruby]
version = "2.10"
edition = "standard"

[itch]
url = "https://rantingbob.itch.io/tbs"
username = "rantingbob"

[dependencies]

Smaug Run Failing on Windows 11

Getting a blank screen when running smaug run? I've run smaug install on my drgk zip and can see it in my list. But running smaug run in my new project, I just get a blank screen.
Windows 11
smaug 0.5.1
dragonruby pro 3.20
image

game meta data:

# This file was automatically @generated by Smaug.
# Do not manually edit this file. Edit Smaug.toml instead.

devid=todo-change-me
devtitle=My Name &lt;[email protected]&gt;
gameid=first
gametitle=first
version=0.1.0
icon=metadata/icon.png
compile_ruby=false

To me, the Game Dir defined looks odd:
image

Cannot add dragonruby zip

smaug dragonruby install /path/to/dragonruby.zip fails with the following error:

thread 'main' panicked at 'Couldn't find DragonRuby: DragonRubyNotFound { path: "/home/[user]/.cache/smaug/dragonruby-linux-amd64" }', cli/src/commands/dragonruby/install.rs:36:41
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

smaug version: 0.3.2
dragonruby version: 3.2
os: linux/endeavourOS
shell: fish v3.1.1

steps to reproduce:

  1. install smaug through the AUR package, as directed by the install instructions
  2. attempt to install a dragonruby zip

Add update task

smaug update will compare files with the lock file entries and overwrite any updated files and delete and removed files. If the local file has changed, ask if they want to replace/delete it.

Installation instructions on webpage are wrong?

Hi there - thanks for making Smaug!

The install instructions say:

smaug install ~/Downloads/dragonruby-linux-amd64.zip

image

This results in:

โžœ  ~ smaug install DragonRuby/dragonruby-gtk-macos.zip
error: Found argument 'DragonRuby/dragonruby-gtk-macos.zip' which wasn't expected, or isn't valid in this context

If you tried to supply `DragonRuby/dragonruby-gtk-macos.zip` as a PATTERN use `-- DragonRuby/dragonruby-gtk-macos.zip`

USAGE:
    smaug install [FLAGS] [OPTIONS]

For more information try --help

The git repo says it should be:

smaug dragonruby install ~/Downloads/dragonruby-linux-amd64.zip.zip

Which worked for me ( with the Mac-gtk version )

Cannot install DragonRuby >= 3.0

DragonRuby from version 3.0 starts using a CHANGELOG-CURR.txt instead of CHANGELOG.txt so the install command cannot properly determine the version of the zip file.

So it would be good to also look for both CHANGELOG-CURR.txt or CHANGELOG.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.