bryanbraun / middleman-navtree

For building navigation trees & menus in Middleman.
MIT License
45 stars 17 forks source link

Fails with any other 'source' name than 'source #2

Closed oskarrough closed 9 years ago

oskarrough commented 10 years ago

Hi, if you change the name of the default source dir from source to anything else, the build fails.

$ middleman build
WARN: Unresolved specs during Gem::Specification.reset:
      json (>= 1.7.7, ~> 1.7)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
/Library/Ruby/Gems/2.0.0/gems/middleman-navtree-0.1.8/lib/middleman-navtree/extension.rb:63:in `open': No such file or directory - source (Errno::ENOENT)
    from /Library/Ruby/Gems/2.0.0/gems/middleman-navtree-0.1.8/lib/middleman-navtree/extension.rb:63:in `foreach'
    from /Library/Ruby/Gems/2.0.0/gems/middleman-navtree-0.1.8/lib/middleman-navtree/extension.rb:63:in `scan_directory'
    from /Library/Ruby/Gems/2.0.0/gems/middleman-navtree-0.1.8/lib/middleman-navtree/extension.rb:46:in `after_configuration'
    from /Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.4/lib/middleman-core/extension.rb:131:in `block in bind_after_configuration'
    from /Library/Ruby/Gems/2.0.0/gems/uber-0.0.8/lib/uber/options.rb:80:in `instance_exec'
    from /Library/Ruby/Gems/2.0.0/gems/uber-0.0.8/lib/uber/options.rb:80:in `proc!'
    from /Library/Ruby/Gems/2.0.0/gems/uber-0.0.8/lib/uber/options.rb:69:in `evaluate_for'
    from /Library/Ruby/Gems/2.0.0/gems/uber-0.0.8/lib/uber/options.rb:60:in `evaluate'
    from /Library/Ruby/Gems/2.0.0/gems/hooks-0.4.0/lib/hooks/hook.rb:53:in `execute_callback'
    from /Library/Ruby/Gems/2.0.0/gems/hooks-0.4.0/lib/hooks/hook.rb:40:in `block in run'
    from /Library/Ruby/Gems/2.0.0/gems/hooks-0.4.0/lib/hooks/hook.rb:39:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/hooks-0.4.0/lib/hooks/hook.rb:39:in `inject'
    from /Library/Ruby/Gems/2.0.0/gems/hooks-0.4.0/lib/hooks/hook.rb:39:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/hooks-0.4.0/lib/hooks.rb:55:in `run_hook_for'
    from /Library/Ruby/Gems/2.0.0/gems/hooks-0.4.0/lib/hooks/instance_hooks.rb:6:in `run_hook'
    from /Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.4/lib/middleman-core/core_extensions/extensions.rb:179:in `initialize'
    from /Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.4/lib/middleman-core/core_extensions/data.rb:33:in `initialize'
    from /Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.4/lib/middleman-core/application.rb:188:in `initialize'
    from /Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.4/lib/middleman-core/core_extensions/request.rb:49:in `new'
    from /Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.4/lib/middleman-core/core_extensions/request.rb:49:in `inst'
    from /Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.4/lib/middleman-core/cli/build.rb:95:in `shared_instance'
    from /Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.4/lib/middleman-core/cli/build.rb:62:in `build'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.4/lib/middleman-core/cli.rb:72:in `method_missing'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:29:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:126:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.4/lib/middleman-core/cli.rb:20:in `start'
    from /Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.4/bin/middleman:18:in `<top (required)>'
    from /usr/bin/middleman:23:in `load'
    from /usr/bin/middleman:23:in `<main>'
oskarrough commented 10 years ago

Fixed, my mistake. Had only changed the source in the global config.rb, not in navtree-configuration as well. Perhaps it could auto-detect and use that one instead?

bryanbraun commented 9 years ago

Actually, I really like the idea that we simply auto-detect the source folder as defined in Middleman's config (instead of having our own config). Reopening so I can address at some point in the future.

bryanbraun commented 9 years ago

I've just pushed up a commit that tells middleman-navtree to use the source folder defined in middleman. Closing this issue as fixed.