Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include things like github.com/foo.js or janl/github.com.js #85

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Include directories as well as files
Example: localhost:3131/github.com.js

Previously, we would only look for `~/.js/github.com.js`. Now, the following would also appear (if present):

* `~/.js/github.com/pull-request-edit-button.js`
* `~/.js/janl/github.com.js`
* `~/.js/janl/github.com/gpl-warning.js`

This should make it easier to share and fork repos of dotjs files, as well as
putting features into their own "bundles" (inspired slightly by vim's pathogen).
  • Loading branch information
agnoster committed Oct 17, 2012
commit ab59a0dc9044f0b1f55e70cbc45489bd025f11d1
5 changes: 5 additions & 0 deletions bin/djsd
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ dotjs = Class.new(WEBrick::HTTPServlet::AbstractServlet) do
until paths.empty?
file = File.expand_path(paths.join('.'))
files << file if File.file?(file)
# Include files like github.com/pull-request.js or janl/github.com.js,
# for modularity and including gists or other people's dotjs files as
# subdirs
files = files.concat(Dir.glob('**/' + paths.join('.').sub(/.js$/, '/**/*.js')))
files = files.concat(Dir.glob('**/' + paths.join('.')))
paths.shift
end

Expand Down