comma 3.2.0 → 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.
- checksums.yaml +7 -0
- data/{spec/spec.opts → .rspec} +0 -0
- data/.travis.yml +51 -4
- data/Appraisals +3 -3
- data/Gemfile.lock +1 -1
- data/README.markdown +3 -3
- data/Rakefile +2 -1
- data/gemfiles/active3.0.20.gemfile.lock +1 -1
- data/gemfiles/active3.1.12.gemfile.lock +1 -1
- data/gemfiles/{active3.2.14.gemfile → active3.2.17.gemfile} +2 -2
- data/gemfiles/{active3.2.14.gemfile.lock → active3.2.17.gemfile.lock} +20 -18
- data/gemfiles/{active4.0.0.gemfile → active4.0.4.gemfile} +2 -2
- data/gemfiles/{active4.0.0.gemfile.lock → active4.0.4.gemfile.lock} +24 -22
- data/gemfiles/active4.1.1.gemfile +9 -0
- data/gemfiles/active4.1.1.gemfile.lock +66 -0
- data/gemfiles/data_mapper1.2.0.gemfile.lock +1 -1
- data/gemfiles/{mongoid3.1.4.gemfile → mongoid3.1.6.gemfile} +1 -1
- data/gemfiles/{mongoid3.1.4.gemfile.lock → mongoid3.1.6.gemfile.lock} +18 -16
- data/gemfiles/rails3.0.20.gemfile.lock +1 -1
- data/gemfiles/rails3.1.12.gemfile.lock +1 -1
- data/gemfiles/{rails3.2.14.gemfile → rails3.2.17.gemfile} +1 -1
- data/gemfiles/{rails3.2.14.gemfile.lock → rails3.2.17.gemfile.lock} +42 -40
- data/gemfiles/{rails4.0.0.gemfile → rails4.0.4.gemfile} +1 -1
- data/gemfiles/{rails4.0.0.gemfile.lock → rails4.0.4.gemfile.lock} +43 -41
- data/gemfiles/rails4.1.1.gemfile +9 -0
- data/gemfiles/rails4.1.1.gemfile.lock +123 -0
- data/lib/comma.rb +1 -1
- data/lib/comma/header_extractor.rb +5 -3
- data/lib/comma/version.rb +1 -1
- data/spec/comma/rails/active_record_spec.rb +48 -0
- data/spec/controllers/users_controller_spec.rb +17 -4
- data/spec/rails_app/active_record/config.rb +4 -0
- data/spec/rails_app/active_record/models.rb +53 -0
- data/spec/rails_app/data_mapper/config.rb +3 -0
- data/spec/rails_app/mongoid/config.rb +9 -0
- data/spec/rails_app/rails_app.rb +54 -0
- data/spec/spec_helper.rb +15 -45
- metadata +114 -186
- data/spec/rails_app/Rakefile +0 -7
- data/spec/rails_app/app/controllers/application_controller.rb +0 -2
- data/spec/rails_app/app/controllers/users_controller.rb +0 -23
- data/spec/rails_app/app/helpers/application_helper.rb +0 -3
- data/spec/rails_app/app/models/post.rb +0 -10
- data/spec/rails_app/app/models/user.rb +0 -16
- data/spec/rails_app/app/views/layouts/application.html.erb +0 -12
- data/spec/rails_app/app/views/users/index.html.erb +0 -1
- data/spec/rails_app/config.ru +0 -4
- data/spec/rails_app/config/application.rb +0 -42
- data/spec/rails_app/config/boot.rb +0 -8
- data/spec/rails_app/config/database.yml +0 -18
- data/spec/rails_app/config/environment.rb +0 -5
- data/spec/rails_app/config/environments/development.rb +0 -19
- data/spec/rails_app/config/environments/production.rb +0 -37
- data/spec/rails_app/config/environments/test.rb +0 -32
- data/spec/rails_app/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/rails_app/config/initializers/inflections.rb +0 -2
- data/spec/rails_app/config/initializers/secret_token.rb +0 -2
- data/spec/rails_app/config/routes.rb +0 -9
- data/spec/rails_app/db/migrate/20120224085510_create_tables.rb +0 -24
- data/spec/rails_app/db/schema.rb +0 -32
- data/spec/rails_app/public/404.html +0 -26
- data/spec/rails_app/public/422.html +0 -26
- data/spec/rails_app/public/500.html +0 -26
- data/spec/rails_app/public/favicon.ico +0 -0
- data/spec/rails_app/script/rails +0 -6
    
        data/lib/comma.rb
    CHANGED
    
    | @@ -48,7 +48,7 @@ ActiveSupport.on_load(:action_controller) do | |
| 48 48 | 
             
                  mime_type   = options[:mime_type] || Mime::CSV
         | 
| 49 49 | 
             
                  #Capture any CSV optional settings passed to comma or comma specific options
         | 
| 50 50 | 
             
                  csv_options = options.slice(*CSV_HANDLER::DEFAULT_OPTIONS.merge(Comma::DEFAULT_OPTIONS).keys)
         | 
| 51 | 
            -
                  send_data obj.to_comma(csv_options), :type => mime_type, :disposition => "attachment; filename | 
| 51 | 
            +
                  send_data obj.to_comma(csv_options), :type => mime_type, :disposition => "attachment; filename=\"#{filename}.#{extension}\""
         | 
| 52 52 | 
             
                end
         | 
| 53 53 | 
             
              end
         | 
| 54 54 | 
             
            end
         | 
| @@ -40,9 +40,11 @@ module Comma | |
| 40 40 |  | 
| 41 41 | 
             
                private
         | 
| 42 42 |  | 
| 43 | 
            -
                def get_association_class(model_class, association)
         | 
| 44 | 
            -
                  model_class.respond_to?(:reflect_on_association) | 
| 45 | 
            -
                    model_class.reflect_on_association(association) | 
| 43 | 
            +
                def get_association_class(model_class, association)      
         | 
| 44 | 
            +
                  if model_class.respond_to?(:reflect_on_association)
         | 
| 45 | 
            +
                    association = model_class.reflect_on_association(association)
         | 
| 46 | 
            +
                    association.klass rescue nil
         | 
| 47 | 
            +
                  end      
         | 
| 46 48 | 
             
                end
         | 
| 47 49 | 
             
              end
         | 
| 48 50 | 
             
            end
         | 
    
        data/lib/comma/version.rb
    CHANGED
    
    
| @@ -5,6 +5,14 @@ if defined? ActiveRecord | |
| 5 5 |  | 
| 6 6 | 
             
              describe Comma, 'generating CSV from an ActiveRecord object' do
         | 
| 7 7 |  | 
| 8 | 
            +
                class Picture < ActiveRecord::Base
         | 
| 9 | 
            +
                  belongs_to :imageable, :polymorphic => true
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                  comma :pr_83 do
         | 
| 12 | 
            +
                    imageable :name => 'Picture'
         | 
| 13 | 
            +
                  end
         | 
| 14 | 
            +
                end
         | 
| 15 | 
            +
             | 
| 8 16 | 
             
                class Person < ActiveRecord::Base
         | 
| 9 17 | 
             
                  scope :teenagers, lambda { where(:age => 13..19) }
         | 
| 10 18 |  | 
| @@ -18,14 +26,40 @@ if defined? ActiveRecord | |
| 18 26 | 
             
                  comma :issue_75 do
         | 
| 19 27 | 
             
                    job :title
         | 
| 20 28 | 
             
                  end
         | 
| 29 | 
            +
             | 
| 30 | 
            +
                  has_many :pictures, :as => :imageable
         | 
| 21 31 | 
             
                end
         | 
| 22 32 |  | 
| 23 33 | 
             
                class Job < ActiveRecord::Base
         | 
| 24 34 | 
             
                  belongs_to :person
         | 
| 35 | 
            +
             | 
| 36 | 
            +
                  comma do
         | 
| 37 | 
            +
                    person_formatter :name => 'Name'
         | 
| 38 | 
            +
                  end
         | 
| 39 | 
            +
             | 
| 40 | 
            +
                  def person_formatter
         | 
| 41 | 
            +
                    @person_formatter ||= PersonFormatter.new(self.person)
         | 
| 42 | 
            +
                  end
         | 
| 43 | 
            +
                end
         | 
| 44 | 
            +
             | 
| 45 | 
            +
                class PersonFormatter
         | 
| 46 | 
            +
                  def initialize(persor)
         | 
| 47 | 
            +
                    @person = persor
         | 
| 48 | 
            +
                  end
         | 
| 49 | 
            +
             | 
| 50 | 
            +
                  def name
         | 
| 51 | 
            +
                    @person.name
         | 
| 52 | 
            +
                  end
         | 
| 25 53 | 
             
                end
         | 
| 26 54 |  | 
| 27 55 | 
             
                before(:all) do
         | 
| 28 56 | 
             
                  #Setup AR model in memory
         | 
| 57 | 
            +
                  ActiveRecord::Base.connection.create_table :pictures, :force => true do |table|
         | 
| 58 | 
            +
                    table.column :name, :string
         | 
| 59 | 
            +
                    table.column :imageable_id, :integer
         | 
| 60 | 
            +
                    table.column :imageable_type, :string
         | 
| 61 | 
            +
                  end
         | 
| 62 | 
            +
             | 
| 29 63 | 
             
                  ActiveRecord::Base.connection.create_table :people, :force => true do |table|
         | 
| 30 64 | 
             
                    table.column :name, :string
         | 
| 31 65 | 
             
                    table.column :age, :integer
         | 
| @@ -39,7 +73,9 @@ if defined? ActiveRecord | |
| 39 73 | 
             
                  Job.reset_column_information
         | 
| 40 74 |  | 
| 41 75 | 
             
                  @person = Person.new(:age => 18, :name => 'Junior')
         | 
| 76 | 
            +
                  @person.build_job(:title => 'Nice job')
         | 
| 42 77 | 
             
                  @person.save!
         | 
| 78 | 
            +
                  Picture.create(:name => 'photo.jpg', :imageable_id => @person.id, :imageable_type => 'Person')
         | 
| 43 79 | 
             
                end
         | 
| 44 80 |  | 
| 45 81 | 
             
                describe "case" do
         | 
| @@ -85,6 +121,18 @@ if defined? ActiveRecord | |
| 85 121 | 
             
                    lambda { Person.all.to_comma(:issue_75) }.should_not raise_error
         | 
| 86 122 | 
             
                  end
         | 
| 87 123 | 
             
                end
         | 
| 124 | 
            +
             | 
| 125 | 
            +
                describe 'with accessor' do
         | 
| 126 | 
            +
                  it 'should not raise exception' do
         | 
| 127 | 
            +
                    Job.all.to_comma.should eq("Name\nJunior\n")
         | 
| 128 | 
            +
                  end
         | 
| 129 | 
            +
                end
         | 
| 130 | 
            +
             | 
| 131 | 
            +
                describe 'github pull-request 83' do
         | 
| 132 | 
            +
                  it 'should not raise NameError' do
         | 
| 133 | 
            +
                    lambda { Picture.all.to_comma(:pr_83) }.should_not raise_exception(NameError)
         | 
| 134 | 
            +
                  end
         | 
| 135 | 
            +
                end
         | 
| 88 136 | 
             
              end
         | 
| 89 137 |  | 
| 90 138 | 
             
            end
         | 
| @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            require 'spec_helper'
         | 
| 2 2 |  | 
| 3 | 
            -
            if defined?( | 
| 3 | 
            +
            if defined?(Rails)
         | 
| 4 4 |  | 
| 5 5 | 
             
              describe UsersController do
         | 
| 6 6 |  | 
| @@ -36,7 +36,7 @@ if defined?(ActionController) && defined?(Rails) | |
| 36 36 |  | 
| 37 37 | 
             
                    response.status.should            == 200
         | 
| 38 38 | 
             
                    response.content_type.should      == 'text/csv'
         | 
| 39 | 
            -
                    response.header["Content-Disposition"].should include('filename=data.csv')
         | 
| 39 | 
            +
                    response.header["Content-Disposition"].should include('filename="data.csv"')
         | 
| 40 40 |  | 
| 41 41 | 
             
                    expected_content =<<-CSV.gsub(/^\s+/,'')
         | 
| 42 42 | 
             
                    First name,Last name,Name
         | 
| @@ -73,7 +73,20 @@ if defined?(ActionController) && defined?(Rails) | |
| 73 73 |  | 
| 74 74 | 
             
                      response.status.should            == 200
         | 
| 75 75 | 
             
                      response.content_type.should      == 'text/csv'
         | 
| 76 | 
            -
                      response.header["Content-Disposition"].should include('filename=my_custom_name.csv')
         | 
| 76 | 
            +
                      response.header["Content-Disposition"].should include('filename="my_custom_name.csv"')
         | 
| 77 | 
            +
                    end
         | 
| 78 | 
            +
             | 
| 79 | 
            +
                    it "should allow a custom filename with spaces" do
         | 
| 80 | 
            +
                      require 'shellwords'
         | 
| 81 | 
            +
                      get :with_custom_options, :format => :csv, :custom_options => { :filename => 'filename with a lot of spaces' }
         | 
| 82 | 
            +
             | 
| 83 | 
            +
                      response.status.should            == 200
         | 
| 84 | 
            +
                      response.content_type.should      == 'text/csv'
         | 
| 85 | 
            +
                      response.header["Content-Disposition"].should include('filename="filename with a lot of spaces.csv"')
         | 
| 86 | 
            +
             | 
| 87 | 
            +
                      filename_string = response.header["Content-Disposition"].split('=').last
         | 
| 88 | 
            +
                      # shellsplit honors quoted strings
         | 
| 89 | 
            +
                      filename_string.shellsplit.length.should == 1
         | 
| 77 90 | 
             
                    end
         | 
| 78 91 |  | 
| 79 92 | 
             
                    it 'should allow a file extension to be set' do
         | 
| @@ -81,7 +94,7 @@ if defined?(ActionController) && defined?(Rails) | |
| 81 94 |  | 
| 82 95 | 
             
                      response.status.should            == 200
         | 
| 83 96 | 
             
                      response.content_type.should      == 'text/csv'
         | 
| 84 | 
            -
                      response.header["Content-Disposition"].should include('filename=data.txt')
         | 
| 97 | 
            +
                      response.header["Content-Disposition"].should include('filename="data.txt"')
         | 
| 85 98 | 
             
                    end
         | 
| 86 99 |  | 
| 87 100 | 
             
                    it 'should allow mime type to be set' do
         | 
| @@ -0,0 +1,53 @@ | |
| 1 | 
            +
            # -*- coding: utf-8 -*-
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            class Post < ActiveRecord::Base
         | 
| 4 | 
            +
              has_one :user
         | 
| 5 | 
            +
             | 
| 6 | 
            +
              comma do
         | 
| 7 | 
            +
                title
         | 
| 8 | 
            +
                description
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                user :full_name
         | 
| 11 | 
            +
              end
         | 
| 12 | 
            +
            end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
            class User < ActiveRecord::Base
         | 
| 15 | 
            +
              comma do
         | 
| 16 | 
            +
                first_name
         | 
| 17 | 
            +
                last_name
         | 
| 18 | 
            +
                full_name "Name"
         | 
| 19 | 
            +
              end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
              comma :shortened do
         | 
| 22 | 
            +
                first_name
         | 
| 23 | 
            +
                last_name
         | 
| 24 | 
            +
              end
         | 
| 25 | 
            +
             | 
| 26 | 
            +
              def full_name
         | 
| 27 | 
            +
                "#{first_name} #{last_name}".strip
         | 
| 28 | 
            +
              end
         | 
| 29 | 
            +
            end
         | 
| 30 | 
            +
             | 
| 31 | 
            +
            class CreateTables < ActiveRecord::Migration
         | 
| 32 | 
            +
              def self.up
         | 
| 33 | 
            +
                create_table :users do |t|
         | 
| 34 | 
            +
                  t.string      :first_name
         | 
| 35 | 
            +
                  t.string      :last_name
         | 
| 36 | 
            +
                  t.timestamps
         | 
| 37 | 
            +
                end
         | 
| 38 | 
            +
             | 
| 39 | 
            +
                create_table :posts do |t|
         | 
| 40 | 
            +
                  t.references :user
         | 
| 41 | 
            +
                  t.string :title
         | 
| 42 | 
            +
                  t.string :description
         | 
| 43 | 
            +
                  t.timestamps
         | 
| 44 | 
            +
                end
         | 
| 45 | 
            +
              end
         | 
| 46 | 
            +
             | 
| 47 | 
            +
              def self.down
         | 
| 48 | 
            +
                drop_table :posts
         | 
| 49 | 
            +
                drop_table :users
         | 
| 50 | 
            +
              end
         | 
| 51 | 
            +
            end
         | 
| 52 | 
            +
            ActiveRecord::Migration.verbose = false
         | 
| 53 | 
            +
            CreateTables.up
         | 
| @@ -0,0 +1,54 @@ | |
| 1 | 
            +
            # -*- coding: utf-8 -*-
         | 
| 2 | 
            +
            require 'action_controller/railtie'
         | 
| 3 | 
            +
            require 'action_view/railtie'
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            # orm configs
         | 
| 6 | 
            +
            require 'rails_app/active_record/config' if defined?(ActiveRecord)
         | 
| 7 | 
            +
             | 
| 8 | 
            +
            app = Class.new(Rails::Application)
         | 
| 9 | 
            +
            app.config.secret_token = '6f6acf0443f74fd0aa8ff07a7c2fbe0a'
         | 
| 10 | 
            +
            app.config.session_store :cookie_store, :key => '_rails_app_session'
         | 
| 11 | 
            +
            app.config.active_support.deprecation = :log
         | 
| 12 | 
            +
            app.config.eager_load = false
         | 
| 13 | 
            +
            app.config.root = File.dirname(__FILE__)
         | 
| 14 | 
            +
            Rails.backtrace_cleaner.remove_silencers!
         | 
| 15 | 
            +
            app.initialize!
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            app.routes.draw do
         | 
| 18 | 
            +
              resources :users, :only => [:index]
         | 
| 19 | 
            +
              get 'with_custom_options', :to => 'users#with_custom_options'
         | 
| 20 | 
            +
              get 'with_custom_style', :to => 'users#with_custom_style'
         | 
| 21 | 
            +
              root :to => 'users#index'
         | 
| 22 | 
            +
            end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
            # models
         | 
| 25 | 
            +
            require 'rails_app/active_record/models' if defined?(ActiveRecord)
         | 
| 26 | 
            +
             | 
| 27 | 
            +
            # controllers
         | 
| 28 | 
            +
            class ApplicationController < ActionController::Base; end
         | 
| 29 | 
            +
            class UsersController < ApplicationController
         | 
| 30 | 
            +
              def index
         | 
| 31 | 
            +
                respond_to do |format|
         | 
| 32 | 
            +
                  format.html { render :text => 'Users!' }
         | 
| 33 | 
            +
                  format.csv  { render :csv => User.all  }
         | 
| 34 | 
            +
                end
         | 
| 35 | 
            +
              end
         | 
| 36 | 
            +
             | 
| 37 | 
            +
              def with_custom_options
         | 
| 38 | 
            +
                render_options = {:csv => User.all}.update(params[:custom_options].symbolize_keys)
         | 
| 39 | 
            +
             | 
| 40 | 
            +
                respond_to do |format|
         | 
| 41 | 
            +
                  format.csv  { render render_options }
         | 
| 42 | 
            +
                end
         | 
| 43 | 
            +
              end
         | 
| 44 | 
            +
             | 
| 45 | 
            +
              def with_custom_style
         | 
| 46 | 
            +
                respond_to do |format|
         | 
| 47 | 
            +
                  format.csv  { render :csv => User.all, :style => :shortened }
         | 
| 48 | 
            +
                end
         | 
| 49 | 
            +
              end
         | 
| 50 | 
            +
             | 
| 51 | 
            +
            end
         | 
| 52 | 
            +
             | 
| 53 | 
            +
            # helpers
         | 
| 54 | 
            +
            Object.const_set(:ApplicationHelper, Module.new)
         | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    | @@ -2,61 +2,31 @@ | |
| 2 2 | 
             
            require 'rubygems'
         | 
| 3 3 | 
             
            $LOAD_PATH.unshift(File.expand_path(File.join(*%w{.. .. lib}), __FILE__))
         | 
| 4 4 |  | 
| 5 | 
            +
            require 'bundler/setup'
         | 
| 6 | 
            +
            Bundler.require
         | 
| 7 | 
            +
             | 
| 5 8 | 
             
            begin
         | 
| 6 9 | 
             
              require 'rails'
         | 
| 7 10 | 
             
            rescue LoadError
         | 
| 8 11 | 
             
            end
         | 
| 9 12 |  | 
| 10 | 
            -
             | 
| 11 | 
            -
             | 
| 12 | 
            -
             | 
| 13 | 
            -
             | 
| 14 | 
            -
               | 
| 13 | 
            +
            %w{data_mapper mongoid active_record}.each do |orm|
         | 
| 14 | 
            +
              begin
         | 
| 15 | 
            +
                require orm
         | 
| 16 | 
            +
                break
         | 
| 17 | 
            +
              rescue LoadError
         | 
| 18 | 
            +
              end
         | 
| 15 19 | 
             
            end
         | 
| 16 20 |  | 
| 17 | 
            -
            require 'bundler/setup'
         | 
| 18 | 
            -
            Bundler.require
         | 
| 19 | 
            -
             | 
| 20 21 | 
             
            if defined? Rails
         | 
| 21 | 
            -
               | 
| 22 | 
            -
              require "rails_app/config/environment"
         | 
| 22 | 
            +
              require 'rails_app/rails_app'
         | 
| 23 23 | 
             
              require 'rspec/rails'
         | 
| 24 | 
            -
              ENV["RAILS_ENV"] = "test"
         | 
| 25 | 
            -
             | 
| 26 | 
            -
              SimpleCov.command_name 'rspec:with_rails'
         | 
| 27 | 
            -
             | 
| 28 | 
            -
              # Requires supporting ruby files with custom matchers and macros, etc,
         | 
| 29 | 
            -
              # in spec/support/ and its subdirectories.
         | 
| 30 | 
            -
              Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|file| require file }
         | 
| 31 | 
            -
             | 
| 32 | 
            -
              load_schema = lambda {
         | 
| 33 | 
            -
                load "#{Rails.root.to_s}/db/schema.rb" # use db agnostic schema by default
         | 
| 34 | 
            -
                # ActiveRecord::Migrator.up('db/migrate') # use migrations
         | 
| 35 | 
            -
              }
         | 
| 36 | 
            -
              silence_stream(STDOUT, &load_schema)
         | 
| 37 | 
            -
             | 
| 38 | 
            -
              RSpec.configure do |config|
         | 
| 39 | 
            -
                config.use_transactional_fixtures = true
         | 
| 40 | 
            -
              end
         | 
| 41 | 
            -
             | 
| 42 24 | 
             
            else
         | 
| 43 | 
            -
               | 
| 44 | 
            -
               | 
| 45 | 
            -
             | 
| 46 | 
            -
              begin
         | 
| 47 | 
            -
                require 'active_record'
         | 
| 48 | 
            -
                config = YAML::load(IO.read(File.dirname(__FILE__) + '/rails_app/config/database.yml'))
         | 
| 49 | 
            -
                ActiveRecord::Base.establish_connection(config['test'])
         | 
| 50 | 
            -
              rescue LoadError
         | 
| 51 | 
            -
              end
         | 
| 52 | 
            -
             | 
| 53 | 
            -
              begin
         | 
| 54 | 
            -
                require 'mongoid'
         | 
| 55 | 
            -
                Mongoid.configure do |mconfig|
         | 
| 56 | 
            -
                  mconfig.sessions = {:default => {:hosts => ['localhost:27017'], :database => 'comma_test'}}
         | 
| 57 | 
            -
                end
         | 
| 58 | 
            -
              rescue LoadError
         | 
| 59 | 
            -
              end
         | 
| 25 | 
            +
              require 'rails_app/data_mapper/config' if defined?(DataMapper)
         | 
| 26 | 
            +
              require 'rails_app/mongoid/config' if defined?(Mongoid)
         | 
| 27 | 
            +
              require 'rails_app/active_record/config' if defined?(ActiveRecord)
         | 
| 60 28 | 
             
            end
         | 
| 61 29 |  | 
| 30 | 
            +
            Dir[File.dirname(__FILE__) + '/support/**/*.rb'].each { |file| require file }
         | 
| 31 | 
            +
             | 
| 62 32 | 
             
            require File.expand_path('../../spec/non_rails_app/ruby_classes' , __FILE__)
         | 
    
        metadata
    CHANGED
    
    | @@ -1,131 +1,111 @@ | |
| 1 | 
            -
            --- !ruby/object:Gem::Specification | 
| 1 | 
            +
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: comma
         | 
| 3 | 
            -
            version: !ruby/object:Gem::Version | 
| 4 | 
            -
               | 
| 5 | 
            -
              prerelease: 
         | 
| 6 | 
            -
              segments: 
         | 
| 7 | 
            -
              - 3
         | 
| 8 | 
            -
              - 2
         | 
| 9 | 
            -
              - 0
         | 
| 10 | 
            -
              version: 3.2.0
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            +
              version: 3.2.1
         | 
| 11 5 | 
             
            platform: ruby
         | 
| 12 | 
            -
            authors: | 
| 6 | 
            +
            authors:
         | 
| 13 7 | 
             
            - Marcus Crafter
         | 
| 14 8 | 
             
            - Tom Meier
         | 
| 15 9 | 
             
            autorequire: 
         | 
| 16 10 | 
             
            bindir: bin
         | 
| 17 11 | 
             
            cert_chain: []
         | 
| 18 | 
            -
             | 
| 19 | 
            -
             | 
| 20 | 
            -
             | 
| 21 | 
            -
            dependencies: 
         | 
| 22 | 
            -
            - !ruby/object:Gem::Dependency 
         | 
| 12 | 
            +
            date: 2014-05-22 00:00:00.000000000 Z
         | 
| 13 | 
            +
            dependencies:
         | 
| 14 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 23 15 | 
             
              name: activesupport
         | 
| 24 | 
            -
               | 
| 25 | 
            -
             | 
| 26 | 
            -
                none: false
         | 
| 27 | 
            -
                requirements: 
         | 
| 16 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 17 | 
            +
                requirements:
         | 
| 28 18 | 
             
                - - ">="
         | 
| 29 | 
            -
                  - !ruby/object:Gem::Version | 
| 30 | 
            -
                    hash: 7
         | 
| 31 | 
            -
                    segments: 
         | 
| 32 | 
            -
                    - 3
         | 
| 33 | 
            -
                    - 0
         | 
| 34 | 
            -
                    - 0
         | 
| 19 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 35 20 | 
             
                    version: 3.0.0
         | 
| 36 21 | 
             
              type: :runtime
         | 
| 37 | 
            -
              version_requirements: *id001
         | 
| 38 | 
            -
            - !ruby/object:Gem::Dependency 
         | 
| 39 | 
            -
              name: rake
         | 
| 40 22 | 
             
              prerelease: false
         | 
| 41 | 
            -
               | 
| 42 | 
            -
                 | 
| 43 | 
            -
                 | 
| 44 | 
            -
             | 
| 45 | 
            -
             | 
| 46 | 
            -
             | 
| 47 | 
            -
             | 
| 48 | 
            -
             | 
| 49 | 
            -
             | 
| 50 | 
            -
             | 
| 23 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 24 | 
            +
                requirements:
         | 
| 25 | 
            +
                - - ">="
         | 
| 26 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 27 | 
            +
                    version: 3.0.0
         | 
| 28 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 29 | 
            +
              name: rake
         | 
| 30 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 31 | 
            +
                requirements:
         | 
| 32 | 
            +
                - - "~>"
         | 
| 33 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 51 34 | 
             
                    version: 0.9.2
         | 
| 52 35 | 
             
              type: :development
         | 
| 53 | 
            -
              version_requirements: *id002
         | 
| 54 | 
            -
            - !ruby/object:Gem::Dependency 
         | 
| 55 | 
            -
              name: sqlite3
         | 
| 56 36 | 
             
              prerelease: false
         | 
| 57 | 
            -
               | 
| 58 | 
            -
                 | 
| 59 | 
            -
                 | 
| 60 | 
            -
             | 
| 61 | 
            -
             | 
| 62 | 
            -
             | 
| 63 | 
            -
             | 
| 64 | 
            -
             | 
| 65 | 
            -
             | 
| 66 | 
            -
             | 
| 37 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 38 | 
            +
                requirements:
         | 
| 39 | 
            +
                - - "~>"
         | 
| 40 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 41 | 
            +
                    version: 0.9.2
         | 
| 42 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 43 | 
            +
              name: sqlite3
         | 
| 44 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 45 | 
            +
                requirements:
         | 
| 46 | 
            +
                - - "~>"
         | 
| 47 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 67 48 | 
             
                    version: 1.3.4
         | 
| 68 49 | 
             
              type: :development
         | 
| 69 | 
            -
              version_requirements: *id003
         | 
| 70 | 
            -
            - !ruby/object:Gem::Dependency 
         | 
| 71 | 
            -
              name: appraisal
         | 
| 72 50 | 
             
              prerelease: false
         | 
| 73 | 
            -
               | 
| 74 | 
            -
                 | 
| 75 | 
            -
                 | 
| 76 | 
            -
             | 
| 77 | 
            -
             | 
| 78 | 
            -
             | 
| 79 | 
            -
             | 
| 80 | 
            -
             | 
| 81 | 
            -
             | 
| 82 | 
            -
             | 
| 51 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 52 | 
            +
                requirements:
         | 
| 53 | 
            +
                - - "~>"
         | 
| 54 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 55 | 
            +
                    version: 1.3.4
         | 
| 56 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 57 | 
            +
              name: appraisal
         | 
| 58 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 59 | 
            +
                requirements:
         | 
| 60 | 
            +
                - - "~>"
         | 
| 61 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 83 62 | 
             
                    version: 0.4.1
         | 
| 84 63 | 
             
              type: :development
         | 
| 85 | 
            -
              version_requirements: *id004
         | 
| 86 | 
            -
            - !ruby/object:Gem::Dependency 
         | 
| 87 | 
            -
              name: rspec
         | 
| 88 64 | 
             
              prerelease: false
         | 
| 89 | 
            -
               | 
| 90 | 
            -
                 | 
| 91 | 
            -
                 | 
| 92 | 
            -
             | 
| 93 | 
            -
             | 
| 94 | 
            -
             | 
| 95 | 
            -
             | 
| 96 | 
            -
             | 
| 97 | 
            -
             | 
| 98 | 
            -
             | 
| 65 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 66 | 
            +
                requirements:
         | 
| 67 | 
            +
                - - "~>"
         | 
| 68 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 69 | 
            +
                    version: 0.4.1
         | 
| 70 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 71 | 
            +
              name: rspec
         | 
| 72 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 73 | 
            +
                requirements:
         | 
| 74 | 
            +
                - - "~>"
         | 
| 75 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 99 76 | 
             
                    version: 2.8.0
         | 
| 100 77 | 
             
              type: :development
         | 
| 101 | 
            -
              version_requirements: *id005
         | 
| 102 | 
            -
            - !ruby/object:Gem::Dependency 
         | 
| 103 | 
            -
              name: simplecov
         | 
| 104 78 | 
             
              prerelease: false
         | 
| 105 | 
            -
               | 
| 106 | 
            -
                 | 
| 107 | 
            -
                 | 
| 79 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 80 | 
            +
                requirements:
         | 
| 81 | 
            +
                - - "~>"
         | 
| 82 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 83 | 
            +
                    version: 2.8.0
         | 
| 84 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 85 | 
            +
              name: simplecov
         | 
| 86 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 87 | 
            +
                requirements:
         | 
| 108 88 | 
             
                - - ">="
         | 
| 109 | 
            -
                  - !ruby/object:Gem::Version | 
| 110 | 
            -
                     | 
| 111 | 
            -
                    segments: 
         | 
| 112 | 
            -
                    - 0
         | 
| 113 | 
            -
                    version: "0"
         | 
| 89 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 90 | 
            +
                    version: '0'
         | 
| 114 91 | 
             
              type: :development
         | 
| 115 | 
            -
               | 
| 92 | 
            +
              prerelease: false
         | 
| 93 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 94 | 
            +
                requirements:
         | 
| 95 | 
            +
                - - ">="
         | 
| 96 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 97 | 
            +
                    version: '0'
         | 
| 116 98 | 
             
            description: Ruby Comma Seperated Values generation library
         | 
| 117 | 
            -
            email: | 
| 99 | 
            +
            email:
         | 
| 118 100 | 
             
            - crafterm@redartisan.com
         | 
| 119 101 | 
             
            - tom@venombytes.com
         | 
| 120 102 | 
             
            executables: []
         | 
| 121 | 
            -
             | 
| 122 103 | 
             
            extensions: []
         | 
| 123 | 
            -
             | 
| 124 104 | 
             
            extra_rdoc_files: []
         | 
| 125 | 
            -
             | 
| 126 | 
            -
             | 
| 127 | 
            -
            - . | 
| 128 | 
            -
            - .travis.yml
         | 
| 105 | 
            +
            files:
         | 
| 106 | 
            +
            - ".gitignore"
         | 
| 107 | 
            +
            - ".rspec"
         | 
| 108 | 
            +
            - ".travis.yml"
         | 
| 129 109 | 
             
            - Appraisals
         | 
| 130 110 | 
             
            - Gemfile
         | 
| 131 111 | 
             
            - Gemfile.lock
         | 
| @@ -137,22 +117,26 @@ files: | |
| 137 117 | 
             
            - gemfiles/active3.0.20.gemfile.lock
         | 
| 138 118 | 
             
            - gemfiles/active3.1.12.gemfile
         | 
| 139 119 | 
             
            - gemfiles/active3.1.12.gemfile.lock
         | 
| 140 | 
            -
            - gemfiles/active3.2. | 
| 141 | 
            -
            - gemfiles/active3.2. | 
| 142 | 
            -
            - gemfiles/active4.0. | 
| 143 | 
            -
            - gemfiles/active4.0. | 
| 120 | 
            +
            - gemfiles/active3.2.17.gemfile
         | 
| 121 | 
            +
            - gemfiles/active3.2.17.gemfile.lock
         | 
| 122 | 
            +
            - gemfiles/active4.0.4.gemfile
         | 
| 123 | 
            +
            - gemfiles/active4.0.4.gemfile.lock
         | 
| 124 | 
            +
            - gemfiles/active4.1.1.gemfile
         | 
| 125 | 
            +
            - gemfiles/active4.1.1.gemfile.lock
         | 
| 144 126 | 
             
            - gemfiles/data_mapper1.2.0.gemfile
         | 
| 145 127 | 
             
            - gemfiles/data_mapper1.2.0.gemfile.lock
         | 
| 146 | 
            -
            - gemfiles/mongoid3.1. | 
| 147 | 
            -
            - gemfiles/mongoid3.1. | 
| 128 | 
            +
            - gemfiles/mongoid3.1.6.gemfile
         | 
| 129 | 
            +
            - gemfiles/mongoid3.1.6.gemfile.lock
         | 
| 148 130 | 
             
            - gemfiles/rails3.0.20.gemfile
         | 
| 149 131 | 
             
            - gemfiles/rails3.0.20.gemfile.lock
         | 
| 150 132 | 
             
            - gemfiles/rails3.1.12.gemfile
         | 
| 151 133 | 
             
            - gemfiles/rails3.1.12.gemfile.lock
         | 
| 152 | 
            -
            - gemfiles/rails3.2. | 
| 153 | 
            -
            - gemfiles/rails3.2. | 
| 154 | 
            -
            - gemfiles/rails4.0. | 
| 155 | 
            -
            - gemfiles/rails4.0. | 
| 134 | 
            +
            - gemfiles/rails3.2.17.gemfile
         | 
| 135 | 
            +
            - gemfiles/rails3.2.17.gemfile.lock
         | 
| 136 | 
            +
            - gemfiles/rails4.0.4.gemfile
         | 
| 137 | 
            +
            - gemfiles/rails4.0.4.gemfile.lock
         | 
| 138 | 
            +
            - gemfiles/rails4.1.1.gemfile
         | 
| 139 | 
            +
            - gemfiles/rails4.1.1.gemfile.lock
         | 
| 156 140 | 
             
            - init.rb
         | 
| 157 141 | 
             
            - lib/comma.rb
         | 
| 158 142 | 
             
            - lib/comma/array.rb
         | 
| @@ -173,70 +157,37 @@ files: | |
| 173 157 | 
             
            - spec/comma/rails/mongoid_spec.rb
         | 
| 174 158 | 
             
            - spec/controllers/users_controller_spec.rb
         | 
| 175 159 | 
             
            - spec/non_rails_app/ruby_classes.rb
         | 
| 176 | 
            -
            - spec/rails_app/ | 
| 177 | 
            -
            - spec/rails_app/ | 
| 178 | 
            -
            - spec/rails_app/ | 
| 179 | 
            -
            - spec/rails_app/ | 
| 180 | 
            -
            - spec/rails_app/ | 
| 181 | 
            -
            - spec/rails_app/app/models/user.rb
         | 
| 182 | 
            -
            - spec/rails_app/app/views/layouts/application.html.erb
         | 
| 183 | 
            -
            - spec/rails_app/app/views/users/index.html.erb
         | 
| 184 | 
            -
            - spec/rails_app/config.ru
         | 
| 185 | 
            -
            - spec/rails_app/config/application.rb
         | 
| 186 | 
            -
            - spec/rails_app/config/boot.rb
         | 
| 187 | 
            -
            - spec/rails_app/config/database.yml
         | 
| 188 | 
            -
            - spec/rails_app/config/environment.rb
         | 
| 189 | 
            -
            - spec/rails_app/config/environments/development.rb
         | 
| 190 | 
            -
            - spec/rails_app/config/environments/production.rb
         | 
| 191 | 
            -
            - spec/rails_app/config/environments/test.rb
         | 
| 192 | 
            -
            - spec/rails_app/config/initializers/backtrace_silencers.rb
         | 
| 193 | 
            -
            - spec/rails_app/config/initializers/inflections.rb
         | 
| 194 | 
            -
            - spec/rails_app/config/initializers/secret_token.rb
         | 
| 195 | 
            -
            - spec/rails_app/config/routes.rb
         | 
| 196 | 
            -
            - spec/rails_app/db/migrate/20120224085510_create_tables.rb
         | 
| 197 | 
            -
            - spec/rails_app/db/schema.rb
         | 
| 198 | 
            -
            - spec/rails_app/public/404.html
         | 
| 199 | 
            -
            - spec/rails_app/public/422.html
         | 
| 200 | 
            -
            - spec/rails_app/public/500.html
         | 
| 201 | 
            -
            - spec/rails_app/public/favicon.ico
         | 
| 202 | 
            -
            - spec/rails_app/script/rails
         | 
| 203 | 
            -
            - spec/spec.opts
         | 
| 160 | 
            +
            - spec/rails_app/active_record/config.rb
         | 
| 161 | 
            +
            - spec/rails_app/active_record/models.rb
         | 
| 162 | 
            +
            - spec/rails_app/data_mapper/config.rb
         | 
| 163 | 
            +
            - spec/rails_app/mongoid/config.rb
         | 
| 164 | 
            +
            - spec/rails_app/rails_app.rb
         | 
| 204 165 | 
             
            - spec/spec_helper.rb
         | 
| 205 | 
            -
            has_rdoc: true
         | 
| 206 166 | 
             
            homepage: http://github.com/crafterm/comma
         | 
| 207 | 
            -
            licenses: | 
| 167 | 
            +
            licenses:
         | 
| 208 168 | 
             
            - MIT
         | 
| 169 | 
            +
            metadata: {}
         | 
| 209 170 | 
             
            post_install_message: 
         | 
| 210 171 | 
             
            rdoc_options: []
         | 
| 211 | 
            -
             | 
| 212 | 
            -
            require_paths: 
         | 
| 172 | 
            +
            require_paths:
         | 
| 213 173 | 
             
            - lib
         | 
| 214 | 
            -
            required_ruby_version: !ruby/object:Gem::Requirement | 
| 215 | 
            -
               | 
| 216 | 
            -
              requirements: 
         | 
| 174 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 175 | 
            +
              requirements:
         | 
| 217 176 | 
             
              - - ">="
         | 
| 218 | 
            -
                - !ruby/object:Gem::Version | 
| 219 | 
            -
                   | 
| 220 | 
            -
             | 
| 221 | 
            -
             | 
| 222 | 
            -
                  version: "0"
         | 
| 223 | 
            -
            required_rubygems_version: !ruby/object:Gem::Requirement 
         | 
| 224 | 
            -
              none: false
         | 
| 225 | 
            -
              requirements: 
         | 
| 177 | 
            +
                - !ruby/object:Gem::Version
         | 
| 178 | 
            +
                  version: '0'
         | 
| 179 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 180 | 
            +
              requirements:
         | 
| 226 181 | 
             
              - - ">="
         | 
| 227 | 
            -
                - !ruby/object:Gem::Version | 
| 228 | 
            -
                   | 
| 229 | 
            -
                  segments: 
         | 
| 230 | 
            -
                  - 0
         | 
| 231 | 
            -
                  version: "0"
         | 
| 182 | 
            +
                - !ruby/object:Gem::Version
         | 
| 183 | 
            +
                  version: '0'
         | 
| 232 184 | 
             
            requirements: []
         | 
| 233 | 
            -
             | 
| 234 185 | 
             
            rubyforge_project: comma
         | 
| 235 | 
            -
            rubygems_version:  | 
| 186 | 
            +
            rubygems_version: 2.2.2
         | 
| 236 187 | 
             
            signing_key: 
         | 
| 237 | 
            -
            specification_version:  | 
| 188 | 
            +
            specification_version: 4
         | 
| 238 189 | 
             
            summary: Ruby Comma Seperated Values generation library
         | 
| 239 | 
            -
            test_files: | 
| 190 | 
            +
            test_files:
         | 
| 240 191 | 
             
            - spec/comma/comma_spec.rb
         | 
| 241 192 | 
             
            - spec/comma/data_extractor_spec.rb
         | 
| 242 193 | 
             
            - spec/comma/header_extractor_spec.rb
         | 
| @@ -245,32 +196,9 @@ test_files: | |
| 245 196 | 
             
            - spec/comma/rails/mongoid_spec.rb
         | 
| 246 197 | 
             
            - spec/controllers/users_controller_spec.rb
         | 
| 247 198 | 
             
            - spec/non_rails_app/ruby_classes.rb
         | 
| 248 | 
            -
            - spec/rails_app/ | 
| 249 | 
            -
            - spec/rails_app/ | 
| 250 | 
            -
            - spec/rails_app/ | 
| 251 | 
            -
            - spec/rails_app/ | 
| 252 | 
            -
            - spec/rails_app/ | 
| 253 | 
            -
            - spec/rails_app/app/models/user.rb
         | 
| 254 | 
            -
            - spec/rails_app/app/views/layouts/application.html.erb
         | 
| 255 | 
            -
            - spec/rails_app/app/views/users/index.html.erb
         | 
| 256 | 
            -
            - spec/rails_app/config.ru
         | 
| 257 | 
            -
            - spec/rails_app/config/application.rb
         | 
| 258 | 
            -
            - spec/rails_app/config/boot.rb
         | 
| 259 | 
            -
            - spec/rails_app/config/database.yml
         | 
| 260 | 
            -
            - spec/rails_app/config/environment.rb
         | 
| 261 | 
            -
            - spec/rails_app/config/environments/development.rb
         | 
| 262 | 
            -
            - spec/rails_app/config/environments/production.rb
         | 
| 263 | 
            -
            - spec/rails_app/config/environments/test.rb
         | 
| 264 | 
            -
            - spec/rails_app/config/initializers/backtrace_silencers.rb
         | 
| 265 | 
            -
            - spec/rails_app/config/initializers/inflections.rb
         | 
| 266 | 
            -
            - spec/rails_app/config/initializers/secret_token.rb
         | 
| 267 | 
            -
            - spec/rails_app/config/routes.rb
         | 
| 268 | 
            -
            - spec/rails_app/db/migrate/20120224085510_create_tables.rb
         | 
| 269 | 
            -
            - spec/rails_app/db/schema.rb
         | 
| 270 | 
            -
            - spec/rails_app/public/404.html
         | 
| 271 | 
            -
            - spec/rails_app/public/422.html
         | 
| 272 | 
            -
            - spec/rails_app/public/500.html
         | 
| 273 | 
            -
            - spec/rails_app/public/favicon.ico
         | 
| 274 | 
            -
            - spec/rails_app/script/rails
         | 
| 275 | 
            -
            - spec/spec.opts
         | 
| 199 | 
            +
            - spec/rails_app/active_record/config.rb
         | 
| 200 | 
            +
            - spec/rails_app/active_record/models.rb
         | 
| 201 | 
            +
            - spec/rails_app/data_mapper/config.rb
         | 
| 202 | 
            +
            - spec/rails_app/mongoid/config.rb
         | 
| 203 | 
            +
            - spec/rails_app/rails_app.rb
         | 
| 276 204 | 
             
            - spec/spec_helper.rb
         |