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

Support nanoc environments #859

Merged
merged 10 commits into from Aug 22, 2016

Commits on Aug 21, 2016

  1. Support nanoc environments

    Introduce basic support for nanoc environment:
    - nanoc command is updated to include --env argument
    - config are overriden using the active environment if any
    - unless define in environment, output_dir is {{output_dir}}/{{env_name}}
    
    Setting environments is done in nanoc.yaml using the `environments` property.
    Example usage is:
    
    ```
    output_dir: output
    
    environments:
      default: &default
        base_url: ...
        ...
      development:
        <<: *default
        base_url: ...
      production:
        <<: *default
        base_url: ...
      yet_another_env:
        <<: *default
        base_url: ...
        output_dir: build
    ```
    
    Selecting working environment can be done:
    - using environment variable `NANOC_ENVIRONMENT`
    - using `nanoc --env=[<value>]`
    barraq committed Aug 21, 2016
    Copy the full SHA
    eedd9a2 View commit details
    Browse the repository at this point in the history
  2. fixup! Denis review

    - Document env attr_reader
    - Only allow String and nil for environment name
    - Remove argument for with_environment
    - Make :environments a constant
    - Lot of parentheses fix
    - Renamed NANOC_ENVIRONMENT to NANOC_ENV for consistency with Rails, Rake, etc.
    - Prefer Fetch(a,b) over a||b
    - Refactor tmp_path logic into Nanoc::Int::Store
    - Make -e, --env argument required
    - Updated test according to previous changes
    barraq committed Aug 21, 2016
    Copy the full SHA
    1342a61 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    b8e4c18 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    8676556 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    f76c179 View commit details
    Browse the repository at this point in the history
  6. fixup! improve store

    - add Contracts
    - rename store to store_name
    - use named arguments
    barraq committed Aug 21, 2016
    Copy the full SHA
    e208d05 View commit details
    Browse the repository at this point in the history
  7. fixup! rename env to env_name

    barraq committed Aug 21, 2016
    Copy the full SHA
    aae3803 View commit details
    Browse the repository at this point in the history
  8. Copy the full SHA
    6e67994 View commit details
    Browse the repository at this point in the history
  9. Copy the full SHA
    8793956 View commit details
    Browse the repository at this point in the history
  10. fixup! add missing test

    barraq committed Aug 21, 2016
    Copy the full SHA
    15b0075 View commit details
    Browse the repository at this point in the history