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

Add more options to apipie:cache #262

Merged
merged 1 commit into from
Jul 23, 2014
Merged

Conversation

mbacovsky
Copy link
Contributor

This patch adds cache_part=[index|resources] and OUT=/some/dir options to rake task apipie:cache.
In our enviroment the API is quite big and with the localization it takes a lot of time to generate the cache. With these options I can pre-generate part of the cache during the build time to save some time during installation.

with_loaded_documentation do
puts "#{Time.now} | Documents loaded..."
([nil] + Apipie.configuration.languages).each do |lang|
I18n.locale = lang || Apipie.configuration.default_locale
puts "#{Time.now} | Processing docs for #{lang}"
cache_dir = Apipie.configuration.cache_dir
cache_dir = ENV["OUT"] || Apipie.configuration.cache_dir
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe APIPIE_CACHE_DIR woudl be better name for the env variable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the same convention I found in other apipie tasks. I'd prefer to have them consistent, should I rename them all? I'd be concerned about backward compatibility though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, haven't realized that, np then

@mbacovsky
Copy link
Contributor Author

The conditions in the rake task were fixed.

@iNecas
Copy link
Member

iNecas commented Jul 23, 2014

Looks good, thanks!

iNecas added a commit that referenced this pull request Jul 23, 2014
@iNecas iNecas merged commit 2aa4fbe into Apipie:master Jul 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants