schovi / baked_file_system

Virtual File System for Crystal language. Embedding your assets into final binary.
MIT License
177 stars 18 forks source link

undefined method bake_folder #26

Closed sam0x17 closed 6 years ago

sam0x17 commented 6 years ago

Using the example code from the README.md I am getting "undefined method bake_folder" when compiling in Crystal 0.24.2.

require "baked_file_system"

class FileStorage
  extend BakedFileSystem
  bake_folder "../../payload"
end
[sam@sam-X270 datagen]$ crystal build src/datagen.cr
Error in src/datagen.cr:1: while requiring "./datagen/*"

require "./datagen/*"
^

in src/datagen/file_storage.cr:5: undefined method 'bake_folder'

  bake_folder "../../payload"
  ^~~~~~~~~~~

[sam@sam-X270 datagen]$
straight-shoota commented 6 years ago

What version of baked_file_system are you using? bake_folder only exists in master. Maybe you're using v0.9.5 or an older version?

sam0x17 commented 6 years ago

It looks like if you add the dependency the way your instructions say (as below), it will use 0.9.5. What should I put in my shard.yml instead?

dependencies:
  baked_file_system:
    github: schovi/baked_file_system
$ shards install
Fetching https://github.com/schovi/baked_file_system.git
Using baked_file_system (0.9.5)
straight-shoota commented 6 years ago

Unless explicitly specified, shards checks out the most recent tag of the repository (in this case v0.9.5). To use the current master branch, you need to add branch: master:

dependencies:
  baked_file_system:
    github: schovi/baked_file_system
    branch: master

But yeah, that's inconsistent as the documentation doesn't reflect the state it suggest to use. It's probably time for a new release, @schovi WDYT?

schovi commented 6 years ago

Should be alright https://github.com/schovi/baked_file_system/releases/tag/v0.9.6