refinerycms-theming 0.9.8.2 → 0.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/gemspec.rb +4 -3
 - data/lib/refinerycms-theming.rb +23 -21
 - data/refinerycms-theming.gemspec +4 -3
 - metadata +7 -12
 
    
        data/lib/gemspec.rb
    CHANGED
    
    | 
         @@ -1,5 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            #!/usr/bin/env ruby
         
     | 
| 
       2 
     | 
    
         
            -
            version = '0.9. 
     | 
| 
      
 2 
     | 
    
         
            +
            version = '0.9.9'
         
     | 
| 
       3 
3 
     | 
    
         
             
            raise "Could not get version so gemspec can not be built" if version.nil?
         
     | 
| 
       4 
4 
     | 
    
         
             
            files = Dir[%q{**/*}].flatten.reject{|f| f =~ /\.gem$/}
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
         @@ -13,6 +13,7 @@ Gem::Specification.new do |s| 
     | 
|
| 
       13 
13 
     | 
    
         
             
              s.email             = %q{info@refinerycms.com}
         
     | 
| 
       14 
14 
     | 
    
         
             
              s.homepage          = %q{http://refinerycms.com}
         
     | 
| 
       15 
15 
     | 
    
         
             
              s.authors           = %w(Resolve\\ Digital)
         
     | 
| 
      
 16 
     | 
    
         
            +
              s.license           = %q{MIT}
         
     | 
| 
       16 
17 
     | 
    
         
             
              s.require_paths     = %w(lib)
         
     | 
| 
       17 
18 
     | 
    
         | 
| 
       18 
19 
     | 
    
         
             
              s.files             = [
         
     | 
| 
         @@ -22,8 +23,8 @@ Gem::Specification.new do |s| 
     | 
|
| 
       22 
23 
     | 
    
         
             
                '#{Dir.glob("test/**/*.rb").join("',\n    '")}'
         
     | 
| 
       23 
24 
     | 
    
         
             
              ]" if File.directory?("test")}
         
     | 
| 
       24 
25 
     | 
    
         | 
| 
       25 
     | 
    
         
            -
              s.add_dependency('refinerycms', '>= 0.9. 
     | 
| 
      
 26 
     | 
    
         
            +
              s.add_dependency('refinerycms', '>= 0.9.9')
         
     | 
| 
       26 
27 
     | 
    
         
             
            end
         
     | 
| 
       27 
28 
     | 
    
         
             
            EOF
         
     | 
| 
       28 
29 
     | 
    
         | 
| 
       29 
     | 
    
         
            -
            File.open(File.expand_path("../../refinerycms-theming.gemspec", __FILE__), 'w').puts(gemspec)
         
     | 
| 
      
 30 
     | 
    
         
            +
            File.open(File.expand_path("../../refinerycms-theming.gemspec", __FILE__), 'w').puts(gemspec)
         
     | 
    
        data/lib/refinerycms-theming.rb
    CHANGED
    
    | 
         @@ -4,35 +4,37 @@ module Refinery 
     | 
|
| 
       4 
4 
     | 
    
         
             
              class ThemingEngine < ::Rails::Engine
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
                config.to_prepare do
         
     | 
| 
       7 
     | 
    
         
            -
                  ::ApplicationController. 
     | 
| 
      
 7 
     | 
    
         
            +
                  [::ApplicationController, ::Admin::BaseController].each do |controller|
         
     | 
| 
      
 8 
     | 
    
         
            +
                    controller.module_eval do
         
     | 
| 
       8 
9 
     | 
    
         | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
      
 10 
     | 
    
         
            +
                      # Add or remove theme paths to/from Refinery application
         
     | 
| 
      
 11 
     | 
    
         
            +
                      prepend_before_filter :attach_theme_to_refinery
         
     | 
| 
       11 
12 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
      
 13 
     | 
    
         
            +
                      def attach_theme_to_refinery
         
     | 
| 
      
 14 
     | 
    
         
            +
                        # remove any paths relating to any theme.
         
     | 
| 
      
 15 
     | 
    
         
            +
                        view_paths.reject! { |v| v.to_s =~ %r{^themes/} }
         
     | 
| 
       15 
16 
     | 
    
         | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
      
 17 
     | 
    
         
            +
                        # add back theme paths if there is a theme present.
         
     | 
| 
      
 18 
     | 
    
         
            +
                        if (theme = ::Theme.current_theme(request.env)).present?
         
     | 
| 
      
 19 
     | 
    
         
            +
                          # Set up view path again for the current theme.
         
     | 
| 
      
 20 
     | 
    
         
            +
                          view_paths.unshift ::Theme.current_theme_dir.join("views").to_s
         
     | 
| 
       20 
21 
     | 
    
         | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
      
 22 
     | 
    
         
            +
                          # Ensure that routes within the application are top priority.
         
     | 
| 
      
 23 
     | 
    
         
            +
                          # Here we grab all the routes that are under the application's view folder
         
     | 
| 
      
 24 
     | 
    
         
            +
                          # and promote them ahead of any other path.
         
     | 
| 
      
 25 
     | 
    
         
            +
                          view_paths.select{|p| p.to_s =~ %r{^#{Rails.root.join('app', 'views')}}}.each do |app_path|
         
     | 
| 
      
 26 
     | 
    
         
            +
                            view_paths.unshift app_path
         
     | 
| 
      
 27 
     | 
    
         
            +
                          end
         
     | 
| 
       26 
28 
     | 
    
         
             
                        end
         
     | 
| 
       27 
     | 
    
         
            -
                      end
         
     | 
| 
       28 
29 
     | 
    
         | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
      
 30 
     | 
    
         
            +
                        # Set up menu caching for this theme or lack thereof
         
     | 
| 
      
 31 
     | 
    
         
            +
                        if RefinerySetting.table_exists? and
         
     | 
| 
      
 32 
     | 
    
         
            +
                           RefinerySetting.get(:refinery_menu_cache_action_suffix) != (suffix = "#{"#{theme}_" if theme.present?}site_menu")
         
     | 
| 
      
 33 
     | 
    
         
            +
                          RefinerySetting.set(:refinery_menu_cache_action_suffix, suffix)
         
     | 
| 
      
 34 
     | 
    
         
            +
                        end
         
     | 
| 
       33 
35 
     | 
    
         
             
                      end
         
     | 
| 
      
 36 
     | 
    
         
            +
                      protected :attach_theme_to_refinery
         
     | 
| 
       34 
37 
     | 
    
         
             
                    end
         
     | 
| 
       35 
     | 
    
         
            -
                    protected :attach_theme_to_refinery
         
     | 
| 
       36 
38 
     | 
    
         | 
| 
       37 
39 
     | 
    
         
             
                  end
         
     | 
| 
       38 
40 
     | 
    
         | 
    
        data/refinerycms-theming.gemspec
    CHANGED
    
    | 
         @@ -1,12 +1,13 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            Gem::Specification.new do |s|
         
     | 
| 
       2 
2 
     | 
    
         
             
              s.name              = %q{refinerycms-theming}
         
     | 
| 
       3 
     | 
    
         
            -
              s.version           = %q{0.9. 
     | 
| 
      
 3 
     | 
    
         
            +
              s.version           = %q{0.9.9}
         
     | 
| 
       4 
4 
     | 
    
         
             
              s.description       = %q{Theming functionality for the Refinery CMS project, extracted from Refinery CMS core.}
         
     | 
| 
       5 
     | 
    
         
            -
              s.date              = %q{2010- 
     | 
| 
      
 5 
     | 
    
         
            +
              s.date              = %q{2010-12-15}
         
     | 
| 
       6 
6 
     | 
    
         
             
              s.summary           = %q{Theming functionality for the Refinery CMS project.}
         
     | 
| 
       7 
7 
     | 
    
         
             
              s.email             = %q{info@refinerycms.com}
         
     | 
| 
       8 
8 
     | 
    
         
             
              s.homepage          = %q{http://refinerycms.com}
         
     | 
| 
       9 
9 
     | 
    
         
             
              s.authors           = %w(Resolve\ Digital)
         
     | 
| 
      
 10 
     | 
    
         
            +
              s.license           = %q{MIT}
         
     | 
| 
       10 
11 
     | 
    
         
             
              s.require_paths     = %w(lib)
         
     | 
| 
       11 
12 
     | 
    
         | 
| 
       12 
13 
     | 
    
         
             
              s.files             = [
         
     | 
| 
         @@ -82,5 +83,5 @@ Gem::Specification.new do |s| 
     | 
|
| 
       82 
83 
     | 
    
         
             
              ]
         
     | 
| 
       83 
84 
     | 
    
         | 
| 
       84 
85 
     | 
    
         | 
| 
       85 
     | 
    
         
            -
              s.add_dependency('refinerycms', '>= 0.9. 
     | 
| 
      
 86 
     | 
    
         
            +
              s.add_dependency('refinerycms', '>= 0.9.9')
         
     | 
| 
       86 
87 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,12 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: refinerycms-theming
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       4 
     | 
    
         
            -
              hash: 35
         
     | 
| 
       5 
4 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       6 
5 
     | 
    
         
             
              segments: 
         
     | 
| 
       7 
6 
     | 
    
         
             
              - 0
         
     | 
| 
       8 
7 
     | 
    
         
             
              - 9
         
     | 
| 
       9 
     | 
    
         
            -
              -  
     | 
| 
       10 
     | 
    
         
            -
               
     | 
| 
       11 
     | 
    
         
            -
              version: 0.9.8.2
         
     | 
| 
      
 8 
     | 
    
         
            +
              - 9
         
     | 
| 
      
 9 
     | 
    
         
            +
              version: 0.9.9
         
     | 
| 
       12 
10 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       13 
11 
     | 
    
         
             
            authors: 
         
     | 
| 
       14 
12 
     | 
    
         
             
            - Resolve Digital
         
     | 
| 
         @@ -16,7 +14,7 @@ autorequire: 
     | 
|
| 
       16 
14 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       17 
15 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       18 
16 
     | 
    
         | 
| 
       19 
     | 
    
         
            -
            date: 2010- 
     | 
| 
      
 17 
     | 
    
         
            +
            date: 2010-12-15 00:00:00 +13:00
         
     | 
| 
       20 
18 
     | 
    
         
             
            default_executable: 
         
     | 
| 
       21 
19 
     | 
    
         
             
            dependencies: 
         
     | 
| 
       22 
20 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
         @@ -27,12 +25,11 @@ dependencies: 
     | 
|
| 
       27 
25 
     | 
    
         
             
                requirements: 
         
     | 
| 
       28 
26 
     | 
    
         
             
                - - ">="
         
     | 
| 
       29 
27 
     | 
    
         
             
                  - !ruby/object:Gem::Version 
         
     | 
| 
       30 
     | 
    
         
            -
                    hash: 43
         
     | 
| 
       31 
28 
     | 
    
         
             
                    segments: 
         
     | 
| 
       32 
29 
     | 
    
         
             
                    - 0
         
     | 
| 
       33 
30 
     | 
    
         
             
                    - 9
         
     | 
| 
       34 
     | 
    
         
            -
                    -  
     | 
| 
       35 
     | 
    
         
            -
                    version: 0.9. 
     | 
| 
      
 31 
     | 
    
         
            +
                    - 9
         
     | 
| 
      
 32 
     | 
    
         
            +
                    version: 0.9.9
         
     | 
| 
       36 
33 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       37 
34 
     | 
    
         
             
              version_requirements: *id001
         
     | 
| 
       38 
35 
     | 
    
         
             
            description: Theming functionality for the Refinery CMS project, extracted from Refinery CMS core.
         
     | 
| 
         @@ -91,8 +88,8 @@ files: 
     | 
|
| 
       91 
88 
     | 
    
         
             
            - themes/hemingway/views/layouts/application.html.erb
         
     | 
| 
       92 
89 
     | 
    
         
             
            has_rdoc: true
         
     | 
| 
       93 
90 
     | 
    
         
             
            homepage: http://refinerycms.com
         
     | 
| 
       94 
     | 
    
         
            -
            licenses:  
     | 
| 
       95 
     | 
    
         
            -
             
     | 
| 
      
 91 
     | 
    
         
            +
            licenses: 
         
     | 
| 
      
 92 
     | 
    
         
            +
            - MIT
         
     | 
| 
       96 
93 
     | 
    
         
             
            post_install_message: 
         
     | 
| 
       97 
94 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       98 
95 
     | 
    
         | 
| 
         @@ -103,7 +100,6 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       103 
100 
     | 
    
         
             
              requirements: 
         
     | 
| 
       104 
101 
     | 
    
         
             
              - - ">="
         
     | 
| 
       105 
102 
     | 
    
         
             
                - !ruby/object:Gem::Version 
         
     | 
| 
       106 
     | 
    
         
            -
                  hash: 3
         
     | 
| 
       107 
103 
     | 
    
         
             
                  segments: 
         
     | 
| 
       108 
104 
     | 
    
         
             
                  - 0
         
     | 
| 
       109 
105 
     | 
    
         
             
                  version: "0"
         
     | 
| 
         @@ -112,7 +108,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       112 
108 
     | 
    
         
             
              requirements: 
         
     | 
| 
       113 
109 
     | 
    
         
             
              - - ">="
         
     | 
| 
       114 
110 
     | 
    
         
             
                - !ruby/object:Gem::Version 
         
     | 
| 
       115 
     | 
    
         
            -
                  hash: 3
         
     | 
| 
       116 
111 
     | 
    
         
             
                  segments: 
         
     | 
| 
       117 
112 
     | 
    
         
             
                  - 0
         
     | 
| 
       118 
113 
     | 
    
         
             
                  version: "0"
         
     |