active_scaffold_export 3.0.6 → 3.2.1
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/.document +1 -1
- data/{MIT-LICENSE → LICENSE.txt} +1 -2
- data/README +14 -0
- data/Rakefile +4 -7
- data/active_scaffold_export.gemspec +26 -25
- data/{frontends/default → app/assets}/images/export.png +0 -0
- data/{frontends/default/stylesheets/export-stylesheet.css → app/assets/stylesheets/active_scaffold_export.css.erb} +10 -0
- data/{frontends/default → app/assets}/stylesheets/export-stylesheet-ie.css +0 -0
- data/frontends/default/views/_export.csv.erb +4 -1
- data/init.rb +6 -1
- data/lib/active_scaffold/actions/export.rb +18 -40
- data/lib/active_scaffold/helpers/export_helpers.rb +1 -18
- data/lib/active_scaffold_export.rb +3 -29
- data/lib/active_scaffold_export/config/core.rb +1 -1
- data/lib/active_scaffold_export/engine.rb +8 -0
- data/lib/active_scaffold_export/version.rb +2 -2
- metadata +85 -127
- data/Gemfile +0 -10
- data/README.markdown +0 -65
    
        data/.document
    CHANGED
    
    
    
        data/{MIT-LICENSE → LICENSE.txt}
    RENAMED
    
    
    
        data/README
    ADDED
    
    | @@ -0,0 +1,14 @@ | |
| 1 | 
            +
            This is active_scaffold_export plugin, forked from Volker Hochstein. 
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            This version works for official ActiveScaffold gem/plugin (https://github.com/activescaffold/active_scaffold)
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            It works with Rails 3.1 master branch of ActiveScaffold.
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            For older versions, please refer to https://github.com/vhochstein/active_scaffold_export
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            gem 'active_scaffold_export'
         | 
| 10 | 
            +
            or
         | 
| 11 | 
            +
            gem 'active_scaffold_export', :git => 'git://github.com/naaano/active_scaffold_export.git'
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            In addition you have to add folowing line to your application.css file:
         | 
| 14 | 
            +
             *= require active_scaffold_export
         | 
    
        data/Rakefile
    CHANGED
    
    | @@ -16,16 +16,13 @@ Jeweler::Tasks.new do |gem| | |
| 16 16 | 
             
              # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
         | 
| 17 17 | 
             
              gem.name = "active_scaffold_export"
         | 
| 18 18 | 
             
              gem.version = ActiveScaffoldExport::Version::STRING
         | 
| 19 | 
            -
              gem.homepage = "http://github.com/ | 
| 19 | 
            +
              gem.homepage = "http://github.com/naaano/active_scaffold_export"
         | 
| 20 20 | 
             
              gem.license = "MIT"
         | 
| 21 21 | 
             
              gem.summary = %Q{Exporting Records with ActiveScaffold}
         | 
| 22 | 
            -
              gem.description = %Q{ | 
| 22 | 
            +
              gem.description = %Q{Exporting Records with ActiveScaffold}
         | 
| 23 23 | 
             
              gem.email = "activescaffold@googlegroups.com"
         | 
| 24 | 
            -
              gem.authors = ["Volker Hochstein", " | 
| 25 | 
            -
              gem.add_runtime_dependency 'active_scaffold', ' | 
| 26 | 
            -
              if RUBY_VERSION < "1.9"
         | 
| 27 | 
            -
                gem.add_runtime_dependency "fastercsv"
         | 
| 28 | 
            -
              end
         | 
| 24 | 
            +
              gem.authors = ["Volker Hochstein", "Sergio Cambra", "Hernan Astudillo"]
         | 
| 25 | 
            +
              gem.add_runtime_dependency 'active_scaffold', '~> 3.1'
         | 
| 29 26 | 
             
              # Include your dependencies below. Runtime dependencies are required when using your gem,
         | 
| 30 27 | 
             
              # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
         | 
| 31 28 | 
             
              #  gem.add_runtime_dependency 'jabber4r', '> 0.1'
         | 
| @@ -4,27 +4,27 @@ | |
| 4 4 | 
             
            # -*- encoding: utf-8 -*-
         | 
| 5 5 |  | 
| 6 6 | 
             
            Gem::Specification.new do |s|
         | 
| 7 | 
            -
              s.name =  | 
| 8 | 
            -
              s.version = "3. | 
| 7 | 
            +
              s.name = "active_scaffold_export"
         | 
| 8 | 
            +
              s.version = "3.2.1"
         | 
| 9 9 |  | 
| 10 10 | 
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         | 
| 11 | 
            -
              s.authors = ["Volker Hochstein", " | 
| 12 | 
            -
              s.date =  | 
| 13 | 
            -
              s.description =  | 
| 14 | 
            -
              s.email =  | 
| 11 | 
            +
              s.authors = ["Volker Hochstein", "Sergio Cambra", "Hernan Astudillo"]
         | 
| 12 | 
            +
              s.date = "2012-02-14"
         | 
| 13 | 
            +
              s.description = "Exporting Records with ActiveScaffold"
         | 
| 14 | 
            +
              s.email = "activescaffold@googlegroups.com"
         | 
| 15 15 | 
             
              s.extra_rdoc_files = [
         | 
| 16 | 
            -
                " | 
| 16 | 
            +
                "LICENSE.txt",
         | 
| 17 | 
            +
                "README"
         | 
| 17 18 | 
             
              ]
         | 
| 18 19 | 
             
              s.files = [
         | 
| 19 20 | 
             
                ".document",
         | 
| 20 | 
            -
                " | 
| 21 | 
            -
                " | 
| 22 | 
            -
                "README.markdown",
         | 
| 21 | 
            +
                "LICENSE.txt",
         | 
| 22 | 
            +
                "README",
         | 
| 23 23 | 
             
                "Rakefile",
         | 
| 24 24 | 
             
                "active_scaffold_export.gemspec",
         | 
| 25 | 
            -
                " | 
| 26 | 
            -
                " | 
| 27 | 
            -
                " | 
| 25 | 
            +
                "app/assets/images/export.png",
         | 
| 26 | 
            +
                "app/assets/stylesheets/active_scaffold_export.css.erb",
         | 
| 27 | 
            +
                "app/assets/stylesheets/export-stylesheet-ie.css",
         | 
| 28 28 | 
             
                "frontends/default/views/_export.csv.erb",
         | 
| 29 29 | 
             
                "frontends/default/views/_export_form_body.html.erb",
         | 
| 30 30 | 
             
                "frontends/default/views/_show_export.html.erb",
         | 
| @@ -35,39 +35,40 @@ Gem::Specification.new do |s| | |
| 35 35 | 
             
                "lib/active_scaffold/helpers/export_helpers.rb",
         | 
| 36 36 | 
             
                "lib/active_scaffold_export.rb",
         | 
| 37 37 | 
             
                "lib/active_scaffold_export/config/core.rb",
         | 
| 38 | 
            +
                "lib/active_scaffold_export/engine.rb",
         | 
| 38 39 | 
             
                "lib/active_scaffold_export/version.rb"
         | 
| 39 40 | 
             
              ]
         | 
| 40 | 
            -
              s.homepage =  | 
| 41 | 
            +
              s.homepage = "http://github.com/naaano/active_scaffold_export"
         | 
| 41 42 | 
             
              s.licenses = ["MIT"]
         | 
| 42 43 | 
             
              s.require_paths = ["lib"]
         | 
| 43 | 
            -
              s.rubygems_version =  | 
| 44 | 
            -
              s.summary =  | 
| 44 | 
            +
              s.rubygems_version = "1.8.10"
         | 
| 45 | 
            +
              s.summary = "Hability to export records to CSV with ActiveScaffold"
         | 
| 45 46 |  | 
| 46 47 | 
             
              if s.respond_to? :specification_version then
         | 
| 47 48 | 
             
                s.specification_version = 3
         | 
| 48 49 |  | 
| 49 50 | 
             
                if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
         | 
| 51 | 
            +
                  s.add_runtime_dependency(%q<active_scaffold>, [">= 0"])
         | 
| 50 52 | 
             
                  s.add_development_dependency(%q<shoulda>, [">= 0"])
         | 
| 51 53 | 
             
                  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
         | 
| 52 | 
            -
                  s.add_development_dependency(%q<jeweler>, ["~> 1. | 
| 54 | 
            +
                  s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
         | 
| 53 55 | 
             
                  s.add_development_dependency(%q<rcov>, [">= 0"])
         | 
| 54 | 
            -
                  s.add_runtime_dependency(%q<active_scaffold>, [">= 3. | 
| 55 | 
            -
                  s.add_runtime_dependency(%q<fastercsv>, [">= 0"])
         | 
| 56 | 
            +
                  s.add_runtime_dependency(%q<active_scaffold>, [">= 3.1"])
         | 
| 56 57 | 
             
                else
         | 
| 58 | 
            +
                  s.add_dependency(%q<active_scaffold>, [">= 0"])
         | 
| 57 59 | 
             
                  s.add_dependency(%q<shoulda>, [">= 0"])
         | 
| 58 60 | 
             
                  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
         | 
| 59 | 
            -
                  s.add_dependency(%q<jeweler>, ["~> 1. | 
| 61 | 
            +
                  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
         | 
| 60 62 | 
             
                  s.add_dependency(%q<rcov>, [">= 0"])
         | 
| 61 | 
            -
                  s.add_dependency(%q<active_scaffold>, [">= 3. | 
| 62 | 
            -
                  s.add_dependency(%q<fastercsv>, [">= 0"])
         | 
| 63 | 
            +
                  s.add_dependency(%q<active_scaffold>, [">= 3.1"])
         | 
| 63 64 | 
             
                end
         | 
| 64 65 | 
             
              else
         | 
| 66 | 
            +
                s.add_dependency(%q<active_scaffold>, [">= 0"])
         | 
| 65 67 | 
             
                s.add_dependency(%q<shoulda>, [">= 0"])
         | 
| 66 68 | 
             
                s.add_dependency(%q<bundler>, ["~> 1.0.0"])
         | 
| 67 | 
            -
                s.add_dependency(%q<jeweler>, ["~> 1. | 
| 69 | 
            +
                s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
         | 
| 68 70 | 
             
                s.add_dependency(%q<rcov>, [">= 0"])
         | 
| 69 | 
            -
                s.add_dependency(%q<active_scaffold>, [" | 
| 70 | 
            -
                s.add_dependency(%q<fastercsv>, [">= 0"])
         | 
| 71 | 
            +
                s.add_dependency(%q<active_scaffold>, ["~> 3.1"])
         | 
| 71 72 | 
             
              end
         | 
| 72 73 | 
             
            end
         | 
| 73 74 |  | 
| 
            File without changes
         | 
| @@ -1,4 +1,5 @@ | |
| 1 1 | 
             
            .active-scaffold-header div.actions a.show_export {
         | 
| 2 | 
            +
              background-image: url(<%= asset_path 'export.png' %>);
         | 
| 2 3 | 
             
              background-image: url(../../../images/active_scaffold/default/export.png);
         | 
| 3 4 | 
             
              background-position: 1px 50%;
         | 
| 4 5 | 
             
              background-repeat: no-repeat;
         | 
| @@ -25,3 +26,12 @@ | |
| 25 26 | 
             
            .active-scaffold div.show_export-view label #delimiter {
         | 
| 26 27 | 
             
              font-family: monospace;
         | 
| 27 28 | 
             
            }
         | 
| 29 | 
            +
             | 
| 30 | 
            +
            .as_touch .active-scaffold-header div.actions a.show_export {
         | 
| 31 | 
            +
              padding: 7px 5px 7px 25px;
         | 
| 32 | 
            +
            }
         | 
| 33 | 
            +
             | 
| 34 | 
            +
            .as_touch .active-scaffold .active-scaffold-header div.actions > a.show_export {
         | 
| 35 | 
            +
              padding: 7px 5px 7px 25px;
         | 
| 36 | 
            +
              background-position: 5px 50%;
         | 
| 37 | 
            +
            }
         | 
| 
            File without changes
         | 
| @@ -1,4 +1,6 @@ | |
| 1 1 | 
             
            <%
         | 
| 2 | 
            +
              require 'csv' if RUBY_VERSION >= "1.9"
         | 
| 3 | 
            +
             | 
| 2 4 | 
             
              fcsv_options = {
         | 
| 3 5 | 
             
                :row_sep => "\n",
         | 
| 4 6 | 
             
                :col_sep => params[:delimiter],
         | 
| @@ -6,7 +8,8 @@ | |
| 6 8 | 
             
                :headers => @export_columns.collect { |column| format_export_column_header_name(column) }
         | 
| 7 9 | 
             
              }
         | 
| 8 10 |  | 
| 9 | 
            -
               | 
| 11 | 
            +
              csv_lib = Object.const_defined?('CSV') ? CSV : FasterCSV
         | 
| 12 | 
            +
              data = csv_lib.generate(fcsv_options) do |csv|
         | 
| 10 13 | 
             
                csv << fcsv_options[:headers] unless params[:skip_header] == 'true'
         | 
| 11 14 | 
             
                @records.each do |record|
         | 
| 12 15 | 
             
                  csv << @export_columns.collect { |column|
         | 
    
        data/init.rb
    CHANGED
    
    
| @@ -5,7 +5,7 @@ module ActiveScaffold::Actions | |
| 5 5 | 
             
                  base.before_filter :init_session_var
         | 
| 6 6 |  | 
| 7 7 | 
             
                  as_export_plugin_path = File.join(ActiveScaffold::Config::Export.plugin_directory, 'frontends', 'default' , 'views')
         | 
| 8 | 
            -
             | 
| 8 | 
            +
                  
         | 
| 9 9 | 
             
                  base.add_active_scaffold_path as_export_plugin_path
         | 
| 10 10 | 
             
                end
         | 
| 11 11 |  | 
| @@ -43,60 +43,38 @@ module ActiveScaffold::Actions | |
| 43 43 | 
             
                    params.merge!(options)
         | 
| 44 44 | 
             
                  end
         | 
| 45 45 |  | 
| 46 | 
            -
                   | 
| 47 | 
            -
                  if request.env['HTTP_USER_AGENT'] =~ /msie/i
         | 
| 48 | 
            -
                    response.headers['Pragma'] = "public"
         | 
| 49 | 
            -
                    response.headers['Cache-Control'] = "no-cache, must-revalidate, post-check=0, pre-check=0"
         | 
| 50 | 
            -
                    response.headers['Expires'] = "0"
         | 
| 51 | 
            -
                  end
         | 
| 46 | 
            +
                  find_items_for_export
         | 
| 52 47 |  | 
| 53 | 
            -
                  response.headers['Content-type'] = 'text/csv'
         | 
| 54 48 | 
             
                  response.headers['Content-Disposition'] = "attachment; filename=#{export_file_name}"
         | 
| 55 | 
            -
             | 
| 56 | 
            -
                  @export_columns = export_config.columns.reject { |col| params[:export_columns][col.name.to_sym].nil? }
         | 
| 57 | 
            -
                  includes_for_export_columns = @export_columns.collect{ |col| col.includes }.flatten.uniq.compact
         | 
| 58 | 
            -
                  self.active_scaffold_includes.concat includes_for_export_columns
         | 
| 59 | 
            -
                  @export_config = export_config
         | 
| 60 | 
            -
             | 
| 61 | 
            -
                  # start streaming output
         | 
| 62 | 
            -
                  self.response_body = proc { |response, output|
         | 
| 63 | 
            -
                    find_items_for_export do |records|
         | 
| 64 | 
            -
                      @records = records
         | 
| 65 | 
            -
                      str = render_to_string :partial => 'export', :layout => false
         | 
| 66 | 
            -
                      output.write(str)
         | 
| 67 | 
            -
                      params[:skip_header] = 'true' # skip header on the next run
         | 
| 68 | 
            -
                    end
         | 
| 69 | 
            -
                  }
         | 
| 49 | 
            +
                  render :partial => 'export', :layout => false, :content_type => Mime::CSV, :status => response_status
         | 
| 70 50 | 
             
                end
         | 
| 71 51 |  | 
| 72 52 | 
             
                protected
         | 
| 53 | 
            +
             | 
| 73 54 | 
             
                # The actual algorithm to do the export
         | 
| 74 | 
            -
                def find_items_for_export | 
| 75 | 
            -
                   | 
| 76 | 
            -
             | 
| 77 | 
            -
             | 
| 78 | 
            -
             | 
| 79 | 
            -
                   | 
| 55 | 
            +
                def find_items_for_export
         | 
| 56 | 
            +
                  export_config = active_scaffold_config.export
         | 
| 57 | 
            +
                  export_columns = export_config.columns.reject { |col| params[:export_columns][col.name.to_sym].nil? }
         | 
| 58 | 
            +
             | 
| 59 | 
            +
                  includes_for_export_columns = export_columns.collect{ |col| col.includes }.flatten.uniq.compact
         | 
| 60 | 
            +
                  self.active_scaffold_includes.concat includes_for_export_columns
         | 
| 61 | 
            +
             | 
| 62 | 
            +
                  find_options = { :sorting => active_scaffold_config.list.user.sorting }
         | 
| 80 63 | 
             
                  params[:search] = session[:search]
         | 
| 81 64 | 
             
                  do_search rescue nil
         | 
| 82 65 | 
             
                  params[:segment_id] = session[:segment_id]
         | 
| 83 66 | 
             
                  do_segment_search rescue nil
         | 
| 84 | 
            -
             | 
| 85 | 
            -
                  if params[:full_download] == 'true'
         | 
| 86 | 
            -
                    find_options.merge!({
         | 
| 87 | 
            -
                      :per_page => 10000,
         | 
| 88 | 
            -
                      :page => 1
         | 
| 89 | 
            -
                    })
         | 
| 90 | 
            -
                    find_page(find_options).pager.each do |page|
         | 
| 91 | 
            -
                      yield page.items
         | 
| 92 | 
            -
                    end
         | 
| 93 | 
            -
                  else
         | 
| 67 | 
            +
                  unless params[:full_download] == 'true'
         | 
| 94 68 | 
             
                    find_options.merge!({
         | 
| 69 | 
            +
                      :pagination => active_scaffold_config.list.pagination,
         | 
| 95 70 | 
             
                      :per_page => active_scaffold_config.list.user.per_page,
         | 
| 96 71 | 
             
                      :page => active_scaffold_config.list.user.page
         | 
| 97 72 | 
             
                    })
         | 
| 98 | 
            -
                    yield find_page(find_options).items
         | 
| 99 73 | 
             
                  end
         | 
| 74 | 
            +
             | 
| 75 | 
            +
                  @export_config = export_config
         | 
| 76 | 
            +
                  @export_columns = export_columns
         | 
| 77 | 
            +
                  @records = find_page(find_options).items
         | 
| 100 78 | 
             
                end
         | 
| 101 79 |  | 
| 102 80 | 
             
                # The default name of the downloaded file.
         | 
| @@ -1,24 +1,7 @@ | |
| 1 | 
            -
            # coding: utf-8
         | 
| 2 | 
            -
             | 
| 3 1 | 
             
            module ActiveScaffold
         | 
| 4 2 | 
             
              module Helpers
         | 
| 5 3 | 
             
                # Helpers that assist with the rendering of a Export Column
         | 
| 6 4 | 
             
                module ExportHelpers
         | 
| 7 | 
            -
                  def self.included(base)
         | 
| 8 | 
            -
                    base.alias_method_chain :active_scaffold_stylesheets, :export
         | 
| 9 | 
            -
                    base.alias_method_chain :active_scaffold_ie_stylesheets, :export
         | 
| 10 | 
            -
                  end
         | 
| 11 | 
            -
             | 
| 12 | 
            -
                  # Provides stylesheets to include with +stylesheet_link_tag+
         | 
| 13 | 
            -
                  def active_scaffold_stylesheets_with_export(frontend = :default)
         | 
| 14 | 
            -
                    active_scaffold_stylesheets_without_export.to_a << ActiveScaffold::Config::Core.asset_path("export-stylesheet.css", frontend)
         | 
| 15 | 
            -
                  end
         | 
| 16 | 
            -
             | 
| 17 | 
            -
                  # Provides stylesheets for IE to include with +stylesheet_link_tag+
         | 
| 18 | 
            -
                  def active_scaffold_ie_stylesheets_with_export(frontend = :default)
         | 
| 19 | 
            -
                    active_scaffold_ie_stylesheets_without_export.to_a << ActiveScaffold::Config::Core.asset_path("export-stylesheet-ie.css", frontend)
         | 
| 20 | 
            -
                  end
         | 
| 21 | 
            -
             | 
| 22 5 | 
             
                  ## individual columns can be overridden by defining
         | 
| 23 6 | 
             
                  # a helper method <column_name>_export_column(record)
         | 
| 24 7 | 
             
                  # You can customize the output of all columns by
         | 
| @@ -63,7 +46,7 @@ module ActiveScaffold | |
| 63 46 |  | 
| 64 47 | 
             
                  def format_plural_association_export_column(association_records)
         | 
| 65 48 | 
             
                    firsts = association_records.first(4).collect { |v| v.to_label }
         | 
| 66 | 
            -
                    firsts[ | 
| 49 | 
            +
                    firsts[3] = ' ' if firsts.length == 4
         | 
| 67 50 | 
             
                    format_value(firsts.join(','))
         | 
| 68 51 | 
             
                  end
         | 
| 69 52 |  | 
| @@ -1,20 +1,8 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
            if CSV.const_defined? :Reader
         | 
| 3 | 
            -
              # Ruby 1.8 compatible
         | 
| 4 | 
            -
              begin
         | 
| 5 | 
            -
                require 'fastercsv'
         | 
| 6 | 
            -
                Object.send(:remove_const, :CSV)
         | 
| 7 | 
            -
                CSV = FasterCSV
         | 
| 8 | 
            -
              rescue Gem::LoadError
         | 
| 9 | 
            -
                raise "For ruby 1.8, the 'fastercsv' gem is required"
         | 
| 10 | 
            -
              end
         | 
| 11 | 
            -
            else
         | 
| 12 | 
            -
              # CSV is now FasterCSV in ruby 1.9
         | 
| 13 | 
            -
            end
         | 
| 14 | 
            -
             | 
| 15 | 
            -
            # Make sure that ActiveScaffold has already been included
         | 
| 1 | 
            +
            ACTIVE_SCAFFOLD_EXPORT_GEM = true
         | 
| 16 2 | 
             
            ActiveScaffold rescue throw "should have included ActiveScaffold plug in first.  Please make sure that this plug-in comes alphabetically after the ActiveScaffold plug-in"
         | 
| 17 3 |  | 
| 4 | 
            +
            require 'active_scaffold_export/engine'
         | 
| 5 | 
            +
            require 'active_scaffold_export/version'
         | 
| 18 6 |  | 
| 19 7 | 
             
            # Load our overrides
         | 
| 20 8 | 
             
            require "active_scaffold_export/config/core.rb"
         | 
| @@ -39,18 +27,4 @@ module ActiveScaffold | |
| 39 27 | 
             
              end
         | 
| 40 28 | 
             
            end
         | 
| 41 29 |  | 
| 42 | 
            -
            # Register our helper methods
         | 
| 43 30 | 
             
            ActionView::Base.send(:include, ActiveScaffold::Helpers::ExportHelpers)
         | 
| 44 | 
            -
             | 
| 45 | 
            -
             | 
| 46 | 
            -
            ##
         | 
| 47 | 
            -
            ## Run the install assets script, too, just to make sure
         | 
| 48 | 
            -
            ## But at least rescue the action in production
         | 
| 49 | 
            -
            ##
         | 
| 50 | 
            -
            if defined?(ACTIVE_SCAFFOLD_EXPORT_PLUGIN)
         | 
| 51 | 
            -
              ActiveScaffoldAssets.copy_to_public(ActiveScaffoldExport.root)
         | 
| 52 | 
            -
            else
         | 
| 53 | 
            -
              Rails::Application.initializer("active_scaffold_export.install_assets", :after => "active_scaffold.install_assets") do
         | 
| 54 | 
            -
                ActiveScaffoldAssets.copy_to_public(ActiveScaffoldExport.root)
         | 
| 55 | 
            -
              end
         | 
| 56 | 
            -
            end
         | 
| @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            # Need to open the AS module carefully due to Rails 2.3 lazy loading
         | 
| 2 2 | 
             
            ActiveScaffold::Config::Core.class_eval do
         | 
| 3 | 
            -
              # For some  | 
| 3 | 
            +
              # For some note obvious reasons, the class variables need to be defined
         | 
| 4 4 | 
             
              # *before* the cattr !!
         | 
| 5 5 | 
             
              self.send :class_variable_set, :@@export_show_form, true
         | 
| 6 6 | 
             
              self.send :class_variable_set, :@@export_allow_full_download, true
         | 
    
        metadata
    CHANGED
    
    | @@ -1,133 +1,100 @@ | |
| 1 | 
            -
            --- !ruby/object:Gem::Specification | 
| 1 | 
            +
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: active_scaffold_export
         | 
| 3 | 
            -
            version: !ruby/object:Gem::Version | 
| 4 | 
            -
               | 
| 3 | 
            +
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            +
              version: 3.2.1
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 | 
            -
              segments: 
         | 
| 7 | 
            -
              - 3
         | 
| 8 | 
            -
              - 0
         | 
| 9 | 
            -
              - 6
         | 
| 10 | 
            -
              version: 3.0.6
         | 
| 11 6 | 
             
            platform: ruby
         | 
| 12 | 
            -
            authors: | 
| 7 | 
            +
            authors:
         | 
| 13 8 | 
             
            - Volker Hochstein
         | 
| 14 | 
            -
            -  | 
| 15 | 
            -
            -  | 
| 9 | 
            +
            - Sergio Cambra
         | 
| 10 | 
            +
            - Hernan Astudillo
         | 
| 16 11 | 
             
            autorequire: 
         | 
| 17 12 | 
             
            bindir: bin
         | 
| 18 13 | 
             
            cert_chain: []
         | 
| 19 | 
            -
             | 
| 20 | 
            -
             | 
| 21 | 
            -
             | 
| 22 | 
            -
             | 
| 23 | 
            -
             | 
| 24 | 
            -
              type: :development
         | 
| 25 | 
            -
              requirement: &id001 !ruby/object:Gem::Requirement 
         | 
| 14 | 
            +
            date: 2012-02-14 00:00:00.000000000 Z
         | 
| 15 | 
            +
            dependencies:
         | 
| 16 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 17 | 
            +
              name: active_scaffold
         | 
| 18 | 
            +
              requirement: &14910960 !ruby/object:Gem::Requirement
         | 
| 26 19 | 
             
                none: false
         | 
| 27 | 
            -
                requirements: | 
| 28 | 
            -
                - -  | 
| 29 | 
            -
                  - !ruby/object:Gem::Version | 
| 30 | 
            -
                     | 
| 31 | 
            -
             | 
| 32 | 
            -
                    - 0
         | 
| 33 | 
            -
                    version: "0"
         | 
| 34 | 
            -
              name: shoulda
         | 
| 35 | 
            -
              version_requirements: *id001
         | 
| 20 | 
            +
                requirements:
         | 
| 21 | 
            +
                - - ! '>='
         | 
| 22 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 23 | 
            +
                    version: '0'
         | 
| 24 | 
            +
              type: :runtime
         | 
| 36 25 | 
             
              prerelease: false
         | 
| 37 | 
            -
             | 
| 26 | 
            +
              version_requirements: *14910960
         | 
| 27 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 28 | 
            +
              name: shoulda
         | 
| 29 | 
            +
              requirement: &14908980 !ruby/object:Gem::Requirement
         | 
| 30 | 
            +
                none: false
         | 
| 31 | 
            +
                requirements:
         | 
| 32 | 
            +
                - - ! '>='
         | 
| 33 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 34 | 
            +
                    version: '0'
         | 
| 38 35 | 
             
              type: :development
         | 
| 39 | 
            -
               | 
| 36 | 
            +
              prerelease: false
         | 
| 37 | 
            +
              version_requirements: *14908980
         | 
| 38 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 39 | 
            +
              name: bundler
         | 
| 40 | 
            +
              requirement: &14907580 !ruby/object:Gem::Requirement
         | 
| 40 41 | 
             
                none: false
         | 
| 41 | 
            -
                requirements: | 
| 42 | 
            +
                requirements:
         | 
| 42 43 | 
             
                - - ~>
         | 
| 43 | 
            -
                  - !ruby/object:Gem::Version | 
| 44 | 
            -
                    hash: 23
         | 
| 45 | 
            -
                    segments: 
         | 
| 46 | 
            -
                    - 1
         | 
| 47 | 
            -
                    - 0
         | 
| 48 | 
            -
                    - 0
         | 
| 44 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 49 45 | 
             
                    version: 1.0.0
         | 
| 50 | 
            -
              name: bundler
         | 
| 51 | 
            -
              version_requirements: *id002
         | 
| 52 | 
            -
              prerelease: false
         | 
| 53 | 
            -
            - !ruby/object:Gem::Dependency 
         | 
| 54 46 | 
             
              type: :development
         | 
| 55 | 
            -
               | 
| 47 | 
            +
              prerelease: false
         | 
| 48 | 
            +
              version_requirements: *14907580
         | 
| 49 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 50 | 
            +
              name: jeweler
         | 
| 51 | 
            +
              requirement: &14906560 !ruby/object:Gem::Requirement
         | 
| 56 52 | 
             
                none: false
         | 
| 57 | 
            -
                requirements: | 
| 53 | 
            +
                requirements:
         | 
| 58 54 | 
             
                - - ~>
         | 
| 59 | 
            -
                  - !ruby/object:Gem::Version | 
| 60 | 
            -
                     | 
| 61 | 
            -
                    segments: 
         | 
| 62 | 
            -
                    - 1
         | 
| 63 | 
            -
                    - 5
         | 
| 64 | 
            -
                    - 2
         | 
| 65 | 
            -
                    version: 1.5.2
         | 
| 66 | 
            -
              name: jeweler
         | 
| 67 | 
            -
              version_requirements: *id003
         | 
| 68 | 
            -
              prerelease: false
         | 
| 69 | 
            -
            - !ruby/object:Gem::Dependency 
         | 
| 55 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 56 | 
            +
                    version: 1.6.4
         | 
| 70 57 | 
             
              type: :development
         | 
| 71 | 
            -
              requirement: &id004 !ruby/object:Gem::Requirement 
         | 
| 72 | 
            -
                none: false
         | 
| 73 | 
            -
                requirements: 
         | 
| 74 | 
            -
                - - ">="
         | 
| 75 | 
            -
                  - !ruby/object:Gem::Version 
         | 
| 76 | 
            -
                    hash: 3
         | 
| 77 | 
            -
                    segments: 
         | 
| 78 | 
            -
                    - 0
         | 
| 79 | 
            -
                    version: "0"
         | 
| 80 | 
            -
              name: rcov
         | 
| 81 | 
            -
              version_requirements: *id004
         | 
| 82 58 | 
             
              prerelease: false
         | 
| 83 | 
            -
             | 
| 84 | 
            -
             | 
| 85 | 
            -
               | 
| 59 | 
            +
              version_requirements: *14906560
         | 
| 60 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 61 | 
            +
              name: rcov
         | 
| 62 | 
            +
              requirement: &14905760 !ruby/object:Gem::Requirement
         | 
| 86 63 | 
             
                none: false
         | 
| 87 | 
            -
                requirements: | 
| 88 | 
            -
                - -  | 
| 89 | 
            -
                  - !ruby/object:Gem::Version | 
| 90 | 
            -
                     | 
| 91 | 
            -
             | 
| 92 | 
            -
                    - 3
         | 
| 93 | 
            -
                    - 0
         | 
| 94 | 
            -
                    - 12
         | 
| 95 | 
            -
                    version: 3.0.12
         | 
| 96 | 
            -
              name: active_scaffold
         | 
| 97 | 
            -
              version_requirements: *id005
         | 
| 64 | 
            +
                requirements:
         | 
| 65 | 
            +
                - - ! '>='
         | 
| 66 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 67 | 
            +
                    version: '0'
         | 
| 68 | 
            +
              type: :development
         | 
| 98 69 | 
             
              prerelease: false
         | 
| 99 | 
            -
             | 
| 100 | 
            -
             | 
| 101 | 
            -
               | 
| 70 | 
            +
              version_requirements: *14905760
         | 
| 71 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 72 | 
            +
              name: active_scaffold
         | 
| 73 | 
            +
              requirement: &14905200 !ruby/object:Gem::Requirement
         | 
| 102 74 | 
             
                none: false
         | 
| 103 | 
            -
                requirements: | 
| 104 | 
            -
                - -  | 
| 105 | 
            -
                  - !ruby/object:Gem::Version | 
| 106 | 
            -
                     | 
| 107 | 
            -
             | 
| 108 | 
            -
                    - 0
         | 
| 109 | 
            -
                    version: "0"
         | 
| 110 | 
            -
              name: fastercsv
         | 
| 111 | 
            -
              version_requirements: *id006
         | 
| 75 | 
            +
                requirements:
         | 
| 76 | 
            +
                - - ! '>='
         | 
| 77 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 78 | 
            +
                    version: '3.1'
         | 
| 79 | 
            +
              type: :runtime
         | 
| 112 80 | 
             
              prerelease: false
         | 
| 113 | 
            -
             | 
| 81 | 
            +
              version_requirements: *14905200
         | 
| 82 | 
            +
            description: Exporting Records with ActiveScaffold
         | 
| 114 83 | 
             
            email: activescaffold@googlegroups.com
         | 
| 115 84 | 
             
            executables: []
         | 
| 116 | 
            -
             | 
| 117 85 | 
             
            extensions: []
         | 
| 118 | 
            -
             | 
| 119 | 
            -
             | 
| 120 | 
            -
            - README | 
| 121 | 
            -
            files: | 
| 86 | 
            +
            extra_rdoc_files:
         | 
| 87 | 
            +
            - LICENSE.txt
         | 
| 88 | 
            +
            - README
         | 
| 89 | 
            +
            files:
         | 
| 122 90 | 
             
            - .document
         | 
| 123 | 
            -
            -  | 
| 124 | 
            -
            -  | 
| 125 | 
            -
            - README.markdown
         | 
| 91 | 
            +
            - LICENSE.txt
         | 
| 92 | 
            +
            - README
         | 
| 126 93 | 
             
            - Rakefile
         | 
| 127 94 | 
             
            - active_scaffold_export.gemspec
         | 
| 128 | 
            -
            -  | 
| 129 | 
            -
            -  | 
| 130 | 
            -
            -  | 
| 95 | 
            +
            - app/assets/images/export.png
         | 
| 96 | 
            +
            - app/assets/stylesheets/active_scaffold_export.css.erb
         | 
| 97 | 
            +
            - app/assets/stylesheets/export-stylesheet-ie.css
         | 
| 131 98 | 
             
            - frontends/default/views/_export.csv.erb
         | 
| 132 99 | 
             
            - frontends/default/views/_export_form_body.html.erb
         | 
| 133 100 | 
             
            - frontends/default/views/_show_export.html.erb
         | 
| @@ -138,40 +105,31 @@ files: | |
| 138 105 | 
             
            - lib/active_scaffold/helpers/export_helpers.rb
         | 
| 139 106 | 
             
            - lib/active_scaffold_export.rb
         | 
| 140 107 | 
             
            - lib/active_scaffold_export/config/core.rb
         | 
| 108 | 
            +
            - lib/active_scaffold_export/engine.rb
         | 
| 141 109 | 
             
            - lib/active_scaffold_export/version.rb
         | 
| 142 | 
            -
             | 
| 143 | 
            -
             | 
| 144 | 
            -
            licenses: 
         | 
| 110 | 
            +
            homepage: http://github.com/naaano/active_scaffold_export
         | 
| 111 | 
            +
            licenses:
         | 
| 145 112 | 
             
            - MIT
         | 
| 146 113 | 
             
            post_install_message: 
         | 
| 147 114 | 
             
            rdoc_options: []
         | 
| 148 | 
            -
             | 
| 149 | 
            -
            require_paths: 
         | 
| 115 | 
            +
            require_paths:
         | 
| 150 116 | 
             
            - lib
         | 
| 151 | 
            -
            required_ruby_version: !ruby/object:Gem::Requirement | 
| 117 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 152 118 | 
             
              none: false
         | 
| 153 | 
            -
              requirements: | 
| 154 | 
            -
              - -  | 
| 155 | 
            -
                - !ruby/object:Gem::Version | 
| 156 | 
            -
                   | 
| 157 | 
            -
             | 
| 158 | 
            -
                  - 0
         | 
| 159 | 
            -
                  version: "0"
         | 
| 160 | 
            -
            required_rubygems_version: !ruby/object:Gem::Requirement 
         | 
| 119 | 
            +
              requirements:
         | 
| 120 | 
            +
              - - ! '>='
         | 
| 121 | 
            +
                - !ruby/object:Gem::Version
         | 
| 122 | 
            +
                  version: '0'
         | 
| 123 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 161 124 | 
             
              none: false
         | 
| 162 | 
            -
              requirements: | 
| 163 | 
            -
              - -  | 
| 164 | 
            -
                - !ruby/object:Gem::Version | 
| 165 | 
            -
                   | 
| 166 | 
            -
                  segments: 
         | 
| 167 | 
            -
                  - 0
         | 
| 168 | 
            -
                  version: "0"
         | 
| 125 | 
            +
              requirements:
         | 
| 126 | 
            +
              - - ! '>='
         | 
| 127 | 
            +
                - !ruby/object:Gem::Version
         | 
| 128 | 
            +
                  version: '0'
         | 
| 169 129 | 
             
            requirements: []
         | 
| 170 | 
            -
             | 
| 171 130 | 
             
            rubyforge_project: 
         | 
| 172 | 
            -
            rubygems_version: 1. | 
| 131 | 
            +
            rubygems_version: 1.8.15
         | 
| 173 132 | 
             
            signing_key: 
         | 
| 174 133 | 
             
            specification_version: 3
         | 
| 175 | 
            -
            summary:  | 
| 134 | 
            +
            summary: Hability to export records to CSV with ActiveScaffold
         | 
| 176 135 | 
             
            test_files: []
         | 
| 177 | 
            -
             | 
    
        data/Gemfile
    DELETED
    
    
    
        data/README.markdown
    DELETED
    
    | @@ -1,65 +0,0 @@ | |
| 1 | 
            -
            active_scaffold_export
         | 
| 2 | 
            -
            ======================
         | 
| 3 | 
            -
             | 
| 4 | 
            -
            Active Scaffold plugin for CSV exports.
         | 
| 5 | 
            -
             | 
| 6 | 
            -
            Introduction
         | 
| 7 | 
            -
            ------------
         | 
| 8 | 
            -
             | 
| 9 | 
            -
            This Active Scaffold plugin provides a configurable CSV 'Export'
         | 
| 10 | 
            -
            action for Active Scaffold controllers.
         | 
| 11 | 
            -
             | 
| 12 | 
            -
            Installation
         | 
| 13 | 
            -
            ------------
         | 
| 14 | 
            -
             | 
| 15 | 
            -
            You can use active_scaffold_export with the latest Rails 3, but you'll
         | 
| 16 | 
            -
            need to also install the vhochstein port of active_scaffold.
         | 
| 17 | 
            -
             | 
| 18 | 
            -
                $ rails plugin install git://github.com/vhochstein/active_scaffold.git
         | 
| 19 | 
            -
             | 
| 20 | 
            -
            In your Gemfile:
         | 
| 21 | 
            -
             | 
| 22 | 
            -
                gem "active_scaffold_export"
         | 
| 23 | 
            -
             | 
| 24 | 
            -
            Features
         | 
| 25 | 
            -
            --------
         | 
| 26 | 
            -
             | 
| 27 | 
            -
            * Uses FasterCSV for CSV generation
         | 
| 28 | 
            -
            * Works with Rails 3 (thanks vhochstein!)
         | 
| 29 | 
            -
            * Scales to many, many records (thanks Alexander Malysh!)
         | 
| 30 | 
            -
            * Let the user pick which columns to export.
         | 
| 31 | 
            -
            * Download full lists or just a single page.
         | 
| 32 | 
            -
            * Don't like commas? No problem, uses your favorite delimiter!
         | 
| 33 | 
            -
            * Don't need no stinkin' headers?  Drop 'em.
         | 
| 34 | 
            -
             | 
| 35 | 
            -
            Usage
         | 
| 36 | 
            -
            -----
         | 
| 37 | 
            -
             | 
| 38 | 
            -
                active_scaffold :users do |config|
         | 
| 39 | 
            -
                  actions.add :export  # this is required, all other configuration is optional
         | 
| 40 | 
            -
             | 
| 41 | 
            -
                  export.columns = [ :id, :email, :created_at ]  # uses list columns by default
         | 
| 42 | 
            -
                  export.allow_full_download = false             # defaults to true
         | 
| 43 | 
            -
                  export.show_form = true                        # whether to show customization form or not, default to true
         | 
| 44 | 
            -
                  export.force_quotes = true                          # defaults to false
         | 
| 45 | 
            -
                  export.default_deselected_columns = [ :created_at ] # optional
         | 
| 46 | 
            -
                  export.default_delimiter = ';'                      # defaults to ','
         | 
| 47 | 
            -
                  export.default_skip_header = true                   # defaults to false
         | 
| 48 | 
            -
                  export.default_full_download = false                # defaults to true
         | 
| 49 | 
            -
                end
         | 
| 50 | 
            -
             | 
| 51 | 
            -
            Note on Patches/Pull Requests
         | 
| 52 | 
            -
            -----------------------------
         | 
| 53 | 
            -
             | 
| 54 | 
            -
            * Fork the project.
         | 
| 55 | 
            -
            * Make your feature addition or bug fix.
         | 
| 56 | 
            -
            * Add tests for it. This is important so I don't break it in a
         | 
| 57 | 
            -
              future version unintentionally.
         | 
| 58 | 
            -
            * Commit, do not mess with rakefile, version, or history.
         | 
| 59 | 
            -
              (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
         | 
| 60 | 
            -
            * Send me a pull request. Bonus points for topic branches.
         | 
| 61 | 
            -
             | 
| 62 | 
            -
            Copyright
         | 
| 63 | 
            -
            ---------
         | 
| 64 | 
            -
             | 
| 65 | 
            -
            Copyright (c) 2010 Mojo Tech, LLC. See MIT-LICENSE for details.
         |