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

Added lib_dir (Array<String>) support to configuration file. #424

Merged
merged 1 commit into from Apr 25, 2014

Conversation

Projects
None yet
2 participants
@gpakosz
Copy link
Member

commented Apr 21, 2014

Makes nanoc load code snippets from configurable directories.

filename
)
end
@code_snippets.concat code_snippets

This comment has been minimized.

Copy link
@ddfreyne

ddfreyne Apr 25, 2014

Member

Braces around arguments here:

@code_snippets.concat(code_snippets)
``
@@ -33,6 +33,7 @@ class Site
# `DEFAULT_CONFIG`.
DEFAULT_CONFIG = {
:text_extensions => %w( css erb haml htm html js less markdown md php rb sass scss txt xhtml xml coffee hb handlebars mustache ms slim ).sort,
:lib_dir => %w( lib ),

This comment has been minimized.

Copy link
@ddfreyne

ddfreyne Apr 25, 2014

Member

lib_dirs (plural) would be a better name.

)
@code_snippets = []
config[:lib_dir].each do |dir|
code_snippets = Dir[File.join(dir, '**/*.rb')].sort.map do |filename|

This comment has been minimized.

Copy link
@ddfreyne

ddfreyne Apr 25, 2014

Member

I’m inclined to just use

Dir["#{lib}/**/*.rb"]
@ddfreyne

This comment has been minimized.

Copy link
Member

commented Apr 25, 2014

The create-site command (in lib/nanoc/cli/commands/create-site.rb) should be updated so that new configurations have the lib_dirs attribute.

@ddfreyne

This comment has been minimized.

Copy link
Member

commented Apr 25, 2014

👍 otherwise.

Added lib_dir (Array<String>) support to configuration file.
Makes nanoc load code snippets from configurable directories.
@gpakosz

This comment has been minimized.

Copy link
Member Author

commented Apr 25, 2014

Updated. Not sure about create-site command since the current default configuration populated by the create-site command doesn't contain everything nanoc can do: e.g. static data sources

@ddfreyne

This comment has been minimized.

Copy link
Member

commented Apr 25, 2014

Yeah, maybe skipping the create-site changes is okay.

To do: update the documentation on the web site. (I will tackle that later when I write the 3.7 documentation.)

ddfreyne added a commit that referenced this pull request Apr 25, 2014

@ddfreyne ddfreyne merged commit 7b2957b into nanoc:master Apr 25, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

@ddfreyne ddfreyne removed the to review label May 1, 2014

@gpakosz gpakosz deleted the gpakosz:configurable-lib-dir branch Jul 15, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.