Changeset 0ead693cbae79e21f5c4828ffc14506af0279788
- Timestamp:
- 07/26/10 21:13:31 (6 weeks ago)
- Author:
- Alban Peignier <alban@…>
- Parents:
- fbc0c51a22a4646da07780df6d8e303e1c8026b4
- Children:
- 4c2e420eff672f881710178e0488b6a07aebec4c
- git-committer:
- Alban Peignier <alban@tryphon.eu> / 2010-07-26T21:13:31Z+0200
- Message:
-
Reload liquid templates when one of them have been updated. Refs #15
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r7781d86
|
r0ead693
|
|
| 35 | 35 | return unless self.class.supports_scm_url? |
| 36 | 36 | |
| | 37 | update_success = false |
| 37 | 38 | if has_resources? |
| 38 | 39 | Dir.chdir(resources_dir) do |
| 39 | 40 | logger.info "Update git template #{scm_url} in #{resources_dir}" |
| 40 | | system "git pull origin master" |
| | 41 | update_success = system "git pull origin master" |
| 41 | 42 | end |
| 42 | 43 | else |
| 43 | 44 | logger.info "Clone git template #{scm_url} in #{resources_dir}" |
| 44 | | system "git clone #{scm_url} #{resources_dir}" |
| | 45 | update_success = system "git clone #{scm_url} #{resources_dir}" |
| | 46 | end |
| | 47 | |
| | 48 | if update_success |
| | 49 | TemplateLiquidEngine.clear_cache! |
| | 50 | true |
| 45 | 51 | end |
| 46 | 52 | end |
-
|
r439b576
|
r0ead693
|
|
| 1 | | require 'extras/liquid_view' |
| 2 | | |
| 3 | | Liquid::Template.file_system = Liquid::LocalFileSystem.new("#{Rails.root}/templates") |
| 4 | | ActionView::Template.register_template_handler :liquid, LiquidView |
| | 1 | TemplateLiquidEngine.init |