{"action":"created","issue":{"url":"https://api.github.com/repos/nanoc/nanoc/issues/568","labels_url":"https://api.github.com/repos/nanoc/nanoc/issues/568/labels{/name}","comments_url":"https://api.github.com/repos/nanoc/nanoc/issues/568/comments","events_url":"https://api.github.com/repos/nanoc/nanoc/issues/568/events","html_url":"https://github.com/nanoc/nanoc/pull/568","id":74924086,"number":568,"title":"Glob patterns","user":{"login":"ddfreyne","id":6269,"avatar_url":"https://avatars.githubusercontent.com/u/6269?v=3","gravatar_id":"","url":"https://api.github.com/users/ddfreyne","html_url":"https://github.com/ddfreyne","followers_url":"https://api.github.com/users/ddfreyne/followers","following_url":"https://api.github.com/users/ddfreyne/following{/other_user}","gists_url":"https://api.github.com/users/ddfreyne/gists{/gist_id}","starred_url":"https://api.github.com/users/ddfreyne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddfreyne/subscriptions","organizations_url":"https://api.github.com/users/ddfreyne/orgs","repos_url":"https://api.github.com/users/ddfreyne/repos","events_url":"https://api.github.com/users/ddfreyne/events{/privacy}","received_events_url":"https://api.github.com/users/ddfreyne/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nanoc/nanoc/labels/nanoc%204","name":"nanoc 4","color":"e11d21"},{"url":"https://api.github.com/repos/nanoc/nanoc/labels/to%20review","name":"to review","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-10T13:47:03Z","updated_at":"2015-05-10T14:49:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nanoc/nanoc/pulls/568","html_url":"https://github.com/nanoc/nanoc/pull/568","diff_url":"https://github.com/nanoc/nanoc/pull/568.diff","patch_url":"https://github.com/nanoc/nanoc/pull/568.patch"},"body":"This adds glob patterns to nanoc 4. They are not super useful yet, because identifiers are still old-style (without extensions), but it is a good step forward.\r\n\r\nAlso, I guess I lied about nanoc 4 not getting new features!\r\n\r\nNote that `File::FNM_EXTGLOB` is only available in Ruby 2.0 and up. Because of this, nanoc now depends on Ruby ≥ 2.0.0. (This should be fine, since Ruby 1.9.3 reached end-of-life status last February.)\r\n\r\nDocumentation for this new feature:\r\n\r\n## Glob patterns in Rules\r\n\r\nnanoc 4 supports using globs. Globs are more powerful than nanoc’s original pattern syntax, and they are also more commonplace, such as in Unix shells.\r\n\r\nTo enable globs, set `pattern_syntax` to `\"glob\"` in the configuration. For example:\r\n\r\n```yaml\r\npattern_syntax: \"glob\"\r\n```\r\n\r\nnanoc 4 uses Ruby’s [`File.fnmatch` method](http://ruby-doc.org/core/File.html#method-c-fnmatch) with the `File::FNM_PATHNAME` option enabled. The three most useful wildcards are the following:\r\n\r\n`*`\r\n: Matches any file or directory name. Does not cross directory boundaries. For example, `/projects/*.md` matches `/projects/nanoc.md`, but not `/projects/cri.adoc` nor `/projects/nanoc/about.md`.\r\n\r\n`**`\r\n: Matches any file or directory name, and crosses directory boundaries. For example, `/projects/**/*.md` matches both `/projects/nanoc.md` and `/projects/nanoc/history.md`.\r\n\r\n`[abc]`\r\n: Matches any single character in the set. For example, `/people/[kt]im.md` matches only `/people/kim.md` and `/people/tim.md`.\r\n\r\nPlease consult the [`File.fnmatch`](http://ruby-doc.org/core/File.html#method-c-fnmatch) documentation for other supported patterns, and more comprehensive documentation.\r\n\r\nPatterns based on regular expressions are still supported in nanoc 4, so you can still use e.g. `%r{\\A/projects/(cri|nanoc)\\.md\\Z}` to match both `/projects/nanoc.md` and `/projects/cri.md`."},"comment":{"url":"https://api.github.com/repos/nanoc/nanoc/issues/comments/100652543","html_url":"https://github.com/nanoc/nanoc/pull/568#issuecomment-100652543","issue_url":"https://api.github.com/repos/nanoc/nanoc/issues/568","id":100652543,"user":{"login":"bobthecow","id":53660,"avatar_url":"https://avatars.githubusercontent.com/u/53660?v=3","gravatar_id":"","url":"https://api.github.com/users/bobthecow","html_url":"https://github.com/bobthecow","followers_url":"https://api.github.com/users/bobthecow/followers","following_url":"https://api.github.com/users/bobthecow/following{/other_user}","gists_url":"https://api.github.com/users/bobthecow/gists{/gist_id}","starred_url":"https://api.github.com/users/bobthecow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobthecow/subscriptions","organizations_url":"https://api.github.com/users/bobthecow/orgs","repos_url":"https://api.github.com/users/bobthecow/repos","events_url":"https://api.github.com/users/bobthecow/events{/privacy}","received_events_url":"https://api.github.com/users/bobthecow/received_events","type":"User","site_admin":false},"created_at":"2015-05-10T14:49:58Z","updated_at":"2015-05-10T14:49:58Z","body":"I'd say `{foo,bar}` is one of the more useful glob patterns for a static site generator. So it's prolly worth mentioning here?"}}