diff --git a/.travis.yml b/.travis.yml index 238fd3d..df65451 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,20 +16,26 @@ gemfile: - gemfiles/active4.2.8.gemfile - gemfiles/active5.0.1.gemfile - gemfiles/active5.1.0.gemfile + - gemfiles/active5.2.0.gemfile - gemfiles/rails4.1.16.gemfile - gemfiles/rails4.2.8.gemfile - gemfiles/rails5.0.1.gemfile - gemfiles/rails5.1.0.gemfile + - gemfiles/rails5.2.0.gemfile matrix: exclude: - rvm: 2.1.10 gemfile: gemfiles/active5.0.1.gemfile - rvm: 2.1.10 gemfile: gemfiles/active5.1.0.gemfile + - rvm: 2.1.10 + gemfile: gemfiles/active5.2.0.gemfile - rvm: 2.1.10 gemfile: gemfiles/rails5.0.1.gemfile - rvm: 2.1.10 gemfile: gemfiles/rails5.1.0.gemfile + - rvm: 2.1.10 + gemfile: gemfiles/rails5.2.0.gemfile - rvm: 2.4.1 gemfile: gemfiles/active4.1.16.gemfile - rvm: 2.4.1 diff --git a/Appraisals b/Appraisals index 9bd9cc0..b990d70 100644 --- a/Appraisals +++ b/Appraisals @@ -1,4 +1,4 @@ -['4.1.16', '4.2.8', '5.0.1', '5.1.0'].each do |version_number| +['4.1.16', '4.2.8', '5.0.1', '5.1.0', '5.2.0'].each do |version_number| clean_number = version_number.gsub(/[<>~=]*/, '') appraise "rails#{clean_number}" do diff --git a/Gemfile.lock b/Gemfile.lock index 6131277..206e79e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: comma (4.1.0) - activesupport (>= 4.0.0, < 5.2) + activesupport (>= 4.0.0, < 6) GEM remote: https://rubygems.org/ @@ -30,7 +30,7 @@ GEM diff-lcs (1.2.5) docile (1.1.5) i18n (0.7.0) - json (1.8.2) + json (1.8.6) mime-types (1.25.1) minitest (5.9.0) multi_json (1.1.0) diff --git a/comma.gemspec b/comma.gemspec index 7b4ef25..f1a84e1 100644 --- a/comma.gemspec +++ b/comma.gemspec @@ -1,6 +1,4 @@ -# -*- encoding: utf-8 -*- - -$:.push File.expand_path("../lib", __FILE__) +$:.push File.expand_path("lib", __dir__) require "comma/version" Gem::Specification.new do |s| @@ -20,7 +18,7 @@ Gem::Specification.new do |s| s.licenses = ['MIT'] - s.add_dependency 'activesupport', ['>= 4.0.0', '< 5.2'] + s.add_dependency 'activesupport', ['>= 4.0.0', '< 6'] s.add_development_dependency 'appraisal', ['~> 1.0.0'] s.add_development_dependency 'rake', ['~> 10.5.0'] diff --git a/gemfiles/active4.1.16.gemfile.lock b/gemfiles/active4.1.16.gemfile.lock index 51a5759..c227a29 100644 --- a/gemfiles/active4.1.16.gemfile.lock +++ b/gemfiles/active4.1.16.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: comma (4.1.0) - activesupport (>= 4.0.0, < 5.2) + activesupport (>= 4.0.0, < 6) GEM remote: https://rubygems.org/ @@ -36,7 +36,7 @@ GEM diff-lcs (1.2.5) docile (1.1.5) i18n (0.7.0) - json (1.8.3) + json (1.8.6) minitest (5.9.0) parser (2.4.0.0) ast (~> 2.2) diff --git a/gemfiles/active4.2.8.gemfile.lock b/gemfiles/active4.2.8.gemfile.lock index 08fd266..79265e1 100644 --- a/gemfiles/active4.2.8.gemfile.lock +++ b/gemfiles/active4.2.8.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: comma (4.1.0) - activesupport (>= 4.0.0, < 5.2) + activesupport (>= 4.0.0, < 6) GEM remote: https://rubygems.org/ diff --git a/gemfiles/active5.0.1.gemfile.lock b/gemfiles/active5.0.1.gemfile.lock index 60b6885..1b67ecd 100644 --- a/gemfiles/active5.0.1.gemfile.lock +++ b/gemfiles/active5.0.1.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: comma (4.1.0) - activesupport (>= 4.0.0, < 5.2) + activesupport (>= 4.0.0, < 6) GEM remote: https://rubygems.org/ diff --git a/gemfiles/active5.1.0.gemfile.lock b/gemfiles/active5.1.0.gemfile.lock index abfd99a..b4356e2 100644 --- a/gemfiles/active5.1.0.gemfile.lock +++ b/gemfiles/active5.1.0.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: comma (4.1.0) - activesupport (>= 4.0.0, < 5.2) + activesupport (>= 4.0.0, < 6) GEM remote: https://rubygems.org/ diff --git a/gemfiles/active5.2.0.gemfile b/gemfiles/active5.2.0.gemfile new file mode 100644 index 0000000..bf9b793 --- /dev/null +++ b/gemfiles/active5.2.0.gemfile @@ -0,0 +1,10 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "coveralls", :require => false +gem "rubocop", :require => false +gem "activesupport", "5.2.0" +gem "activerecord", "5.2.0" + +gemspec :path => "../" diff --git a/gemfiles/active5.2.0.gemfile.lock b/gemfiles/active5.2.0.gemfile.lock new file mode 100644 index 0000000..b435688 --- /dev/null +++ b/gemfiles/active5.2.0.gemfile.lock @@ -0,0 +1,106 @@ +PATH + remote: .. + specs: + comma (4.1.0) + activesupport (>= 4.0.0, < 6) + +GEM + remote: https://rubygems.org/ + specs: + activemodel (5.2.0) + activesupport (= 5.2.0) + activerecord (5.2.0) + activemodel (= 5.2.0) + activesupport (= 5.2.0) + arel (>= 9.0) + activesupport (5.2.0) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + appraisal (1.0.3) + bundler + rake + thor (>= 0.14.0) + arel (9.0.0) + ast (2.4.0) + concurrent-ruby (1.0.5) + coveralls (0.8.21) + json (>= 1.8, < 3) + simplecov (~> 0.14.1) + term-ansicolor (~> 1.3) + thor (~> 0.19.4) + tins (~> 1.6) + diff-lcs (1.3) + docile (1.1.5) + i18n (1.0.0) + concurrent-ruby (~> 1.0) + json (2.1.0) + minitest (5.11.3) + parallel (1.12.1) + parser (2.5.0.5) + ast (~> 2.4.0) + powerpack (0.1.1) + rainbow (3.0.0) + rake (10.5.0) + rspec (3.5.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-activemodel-mocks (1.0.3) + activemodel (>= 3.0) + activesupport (>= 3.0) + rspec-mocks (>= 2.99, < 4.0) + rspec-core (3.5.4) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-its (1.2.0) + rspec-core (>= 3.0.0) + rspec-expectations (>= 3.0.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) + rubocop (0.54.0) + parallel (~> 1.10) + parser (>= 2.5) + powerpack (~> 0.1) + rainbow (>= 2.2.2, < 4.0) + ruby-progressbar (~> 1.7) + unicode-display_width (~> 1.0, >= 1.0.1) + ruby-progressbar (1.9.0) + simplecov (0.14.1) + docile (~> 1.1.0) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.2) + sqlite3 (1.3.13) + term-ansicolor (1.6.0) + tins (~> 1.0) + thor (0.19.4) + thread_safe (0.3.6) + tins (1.16.3) + tzinfo (1.2.5) + thread_safe (~> 0.1) + unicode-display_width (1.3.0) + +PLATFORMS + ruby + +DEPENDENCIES + activerecord (= 5.2.0) + activesupport (= 5.2.0) + appraisal (~> 1.0.0) + comma! + coveralls + rake (~> 10.5.0) + rspec (~> 3.5.0) + rspec-activemodel-mocks + rspec-its + rubocop + sqlite3 (~> 1.3.11) + +BUNDLED WITH + 1.16.0 diff --git a/gemfiles/rails4.1.16.gemfile.lock b/gemfiles/rails4.1.16.gemfile.lock index 428fa89..66393bc 100644 --- a/gemfiles/rails4.1.16.gemfile.lock +++ b/gemfiles/rails4.1.16.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: comma (4.1.0) - activesupport (>= 4.0.0, < 5.2) + activesupport (>= 4.0.0, < 6) GEM remote: https://rubygems.org/ @@ -39,8 +39,8 @@ GEM thor (>= 0.14.0) arel (5.0.1.20140414130214) ast (2.3.0) - builder (3.2.2) - concurrent-ruby (1.0.2) + builder (3.2.3) + concurrent-ruby (1.0.5) coveralls (0.8.15) json (>= 1.8, < 3) simplecov (~> 0.12.0) @@ -50,14 +50,13 @@ GEM diff-lcs (1.2.5) docile (1.1.5) erubis (2.7.0) - i18n (0.7.0) - json (1.8.3) - mail (2.6.4) - mime-types (>= 1.16, < 4) - mime-types (3.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2016.0521) - minitest (5.9.0) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + json (1.8.6) + mail (2.7.0) + mini_mime (>= 0.1.1) + mini_mime (1.0.0) + minitest (5.11.3) parser (2.4.0.0) ast (~> 2.2) power_assert (0.3.0) @@ -123,7 +122,7 @@ GEM json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.0) - sprockets (3.7.0) + sprockets (3.7.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (2.3.3) @@ -135,10 +134,10 @@ GEM tins (~> 1.0) test-unit (3.2.1) power_assert - thor (0.19.1) - thread_safe (0.3.5) + thor (0.19.4) + thread_safe (0.3.6) tins (1.12.0) - tzinfo (1.2.2) + tzinfo (1.2.5) thread_safe (~> 0.1) unicode-display_width (1.2.1) @@ -160,4 +159,4 @@ DEPENDENCIES test-unit BUNDLED WITH - 1.14.6 + 1.16.0 diff --git a/gemfiles/rails4.2.8.gemfile.lock b/gemfiles/rails4.2.8.gemfile.lock index 8989cd0..26b360e 100644 --- a/gemfiles/rails4.2.8.gemfile.lock +++ b/gemfiles/rails4.2.8.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: comma (4.1.0) - activesupport (>= 4.0.0, < 5.2) + activesupport (>= 4.0.0, < 6) GEM remote: https://rubygems.org/ diff --git a/gemfiles/rails5.0.1.gemfile.lock b/gemfiles/rails5.0.1.gemfile.lock index b642783..04b2be0 100644 --- a/gemfiles/rails5.0.1.gemfile.lock +++ b/gemfiles/rails5.0.1.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: comma (4.1.0) - activesupport (>= 4.0.0, < 5.2) + activesupport (>= 4.0.0, < 6) GEM remote: https://rubygems.org/ diff --git a/gemfiles/rails5.1.0.gemfile.lock b/gemfiles/rails5.1.0.gemfile.lock index c4e4a5f..a77701a 100644 --- a/gemfiles/rails5.1.0.gemfile.lock +++ b/gemfiles/rails5.1.0.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: comma (4.1.0) - activesupport (>= 4.0.0, < 5.2) + activesupport (>= 4.0.0, < 6) GEM remote: https://rubygems.org/ diff --git a/gemfiles/rails5.2.0.gemfile b/gemfiles/rails5.2.0.gemfile new file mode 100644 index 0000000..c8c4043 --- /dev/null +++ b/gemfiles/rails5.2.0.gemfile @@ -0,0 +1,11 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "coveralls", :require => false +gem "rubocop", :require => false +gem "rails", "5.2.0" +gem "rspec-rails" +gem "test-unit" + +gemspec :path => "../" diff --git a/gemfiles/rails5.2.0.gemfile.lock b/gemfiles/rails5.2.0.gemfile.lock new file mode 100644 index 0000000..f190f42 --- /dev/null +++ b/gemfiles/rails5.2.0.gemfile.lock @@ -0,0 +1,204 @@ +PATH + remote: .. + specs: + comma (4.1.0) + activesupport (>= 4.0.0, < 6) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (5.2.0) + actionpack (= 5.2.0) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailer (5.2.0) + actionpack (= 5.2.0) + actionview (= 5.2.0) + activejob (= 5.2.0) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.2.0) + actionview (= 5.2.0) + activesupport (= 5.2.0) + rack (~> 2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.2.0) + activesupport (= 5.2.0) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (5.2.0) + activesupport (= 5.2.0) + globalid (>= 0.3.6) + activemodel (5.2.0) + activesupport (= 5.2.0) + activerecord (5.2.0) + activemodel (= 5.2.0) + activesupport (= 5.2.0) + arel (>= 9.0) + activestorage (5.2.0) + actionpack (= 5.2.0) + activerecord (= 5.2.0) + marcel (~> 0.3.1) + activesupport (5.2.0) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + appraisal (1.0.3) + bundler + rake + thor (>= 0.14.0) + arel (9.0.0) + ast (2.4.0) + builder (3.2.3) + concurrent-ruby (1.0.5) + coveralls (0.8.21) + json (>= 1.8, < 3) + simplecov (~> 0.14.1) + term-ansicolor (~> 1.3) + thor (~> 0.19.4) + tins (~> 1.6) + crass (1.0.3) + diff-lcs (1.3) + docile (1.1.5) + erubi (1.7.1) + globalid (0.4.1) + activesupport (>= 4.2.0) + i18n (1.0.0) + concurrent-ruby (~> 1.0) + json (2.1.0) + loofah (2.2.2) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.0) + mini_mime (>= 0.1.1) + marcel (0.3.2) + mimemagic (~> 0.3.2) + method_source (0.9.0) + mimemagic (0.3.2) + mini_mime (1.0.0) + mini_portile2 (2.3.0) + minitest (5.11.3) + nio4r (2.3.0) + nokogiri (1.8.2) + mini_portile2 (~> 2.3.0) + parallel (1.12.1) + parser (2.5.0.5) + ast (~> 2.4.0) + power_assert (1.1.1) + powerpack (0.1.1) + rack (2.0.4) + rack-test (1.0.0) + rack (>= 1.0, < 3) + rails (5.2.0) + actioncable (= 5.2.0) + actionmailer (= 5.2.0) + actionpack (= 5.2.0) + actionview (= 5.2.0) + activejob (= 5.2.0) + activemodel (= 5.2.0) + activerecord (= 5.2.0) + activestorage (= 5.2.0) + activesupport (= 5.2.0) + bundler (>= 1.3.0) + railties (= 5.2.0) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.0.4) + loofah (~> 2.2, >= 2.2.2) + railties (5.2.0) + actionpack (= 5.2.0) + activesupport (= 5.2.0) + method_source + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rainbow (3.0.0) + rake (10.5.0) + rspec (3.5.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-activemodel-mocks (1.0.3) + activemodel (>= 3.0) + activesupport (>= 3.0) + rspec-mocks (>= 2.99, < 4.0) + rspec-core (3.5.4) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-its (1.2.0) + rspec-core (>= 3.0.0) + rspec-expectations (>= 3.0.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-rails (3.5.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) + rubocop (0.54.0) + parallel (~> 1.10) + parser (>= 2.5) + powerpack (~> 0.1) + rainbow (>= 2.2.2, < 4.0) + ruby-progressbar (~> 1.7) + unicode-display_width (~> 1.0, >= 1.0.1) + ruby-progressbar (1.9.0) + simplecov (0.14.1) + docile (~> 1.1.0) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.2) + sprockets (3.7.1) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.3.13) + term-ansicolor (1.6.0) + tins (~> 1.0) + test-unit (3.2.7) + power_assert + thor (0.19.4) + thread_safe (0.3.6) + tins (1.16.3) + tzinfo (1.2.5) + thread_safe (~> 0.1) + unicode-display_width (1.3.0) + websocket-driver (0.7.0) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.3) + +PLATFORMS + ruby + +DEPENDENCIES + appraisal (~> 1.0.0) + comma! + coveralls + rails (= 5.2.0) + rake (~> 10.5.0) + rspec (~> 3.5.0) + rspec-activemodel-mocks + rspec-its + rspec-rails + rubocop + sqlite3 (~> 1.3.11) + test-unit + +BUNDLED WITH + 1.16.0 diff --git a/lib/comma.rb b/lib/comma.rb index 1167b08..dabc66a 100644 --- a/lib/comma.rb +++ b/lib/comma.rb @@ -13,9 +13,8 @@ end end -if defined? Rails and (Rails.version.split('.').map(&:to_i).first < 3) - raise "Error - This Comma version only supports Rails 3.x. Please use a 2.x version of Comma for use with earlier rails versions." -end +raise "Error - This Comma version only supports Rails 3.x. Please use a 2.x version of Comma for use with earlier rails versions." if + defined? Rails and (Rails.version.split('.').map(&:to_i).first < 3) module Comma DEFAULT_OPTIONS = { diff --git a/lib/comma/data_extractor.rb b/lib/comma/data_extractor.rb index 8961276..8240ff4 100644 --- a/lib/comma/data_extractor.rb +++ b/lib/comma/data_extractor.rb @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- require 'comma/extractor' module Comma @@ -51,9 +50,8 @@ def method_missing(symbol, *args, &block) end def method_missing(sym, *args, &block) - if args.blank? - @results << ExtractValueFromInstance.new(@instance).extract(sym, &block) - end + @results << ExtractValueFromInstance.new(@instance).extract(sym, &block) if + args.blank? args.each do |arg| case arg diff --git a/lib/comma/data_mapper_collection.rb b/lib/comma/data_mapper_collection.rb index 269a1e0..74427d8 100644 --- a/lib/comma/data_mapper_collection.rb +++ b/lib/comma/data_mapper_collection.rb @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - class DataMapper::Collection def to_comma(style = :default) Comma::Generator.new(self, style).run(:each) diff --git a/lib/comma/extractor.rb b/lib/comma/extractor.rb index 724ab89..5e55eb1 100644 --- a/lib/comma/extractor.rb +++ b/lib/comma/extractor.rb @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - module Comma class Extractor diff --git a/lib/comma/generator.rb b/lib/comma/generator.rb index 18388c6..862aad0 100644 --- a/lib/comma/generator.rb +++ b/lib/comma/generator.rb @@ -26,9 +26,8 @@ def run(iterator_method) def append_csv(csv, iterator_method) return '' if @instance.empty? - unless @options.has_key?(:write_headers) && !@options[:write_headers] - csv << @instance.first.to_comma_headers(@style) - end + csv << @instance.first.to_comma_headers(@style) unless + @options.has_key?(:write_headers) && !@options[:write_headers] @instance.send(iterator_method) do |object| csv << object.to_comma(@style) end diff --git a/lib/comma/header_extractor.rb b/lib/comma/header_extractor.rb index 64a83a0..b15f5fd 100644 --- a/lib/comma/header_extractor.rb +++ b/lib/comma/header_extractor.rb @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- require 'comma/extractor' require 'active_support/core_ext/class/attribute' require 'active_support/core_ext/date_time/conversions' diff --git a/lib/comma/object.rb b/lib/comma/object.rb index b0a316a..b43b802 100644 --- a/lib/comma/object.rb +++ b/lib/comma/object.rb @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- require 'comma/data_extractor' require 'comma/header_extractor' diff --git a/spec/comma/data_extractor_spec.rb b/spec/comma/data_extractor_spec.rb index ba7cc61..372f9b3 100644 --- a/spec/comma/data_extractor_spec.rb +++ b/spec/comma/data_extractor_spec.rb @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- require 'spec_helper' # comma do diff --git a/spec/comma/header_extractor_spec.rb b/spec/comma/header_extractor_spec.rb index d9a18ab..97090b3 100644 --- a/spec/comma/header_extractor_spec.rb +++ b/spec/comma/header_extractor_spec.rb @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- require 'spec_helper' # comma do @@ -8,7 +7,7 @@ # isbn :number_10 => 'ISBN-10', :number_13 => 'ISBN-13' # end -describe Comma::HeaderExtractor do # rubocop:disable Metcirs/BlockLength +describe Comma::HeaderExtractor do # rubocop:disable Metrics/BlockLength before do @isbn = Isbn.new('123123123', '321321321') diff --git a/spec/comma/rails/active_record_spec.rb b/spec/comma/rails/active_record_spec.rb index b31a370..b39246b 100644 --- a/spec/comma/rails/active_record_spec.rb +++ b/spec/comma/rails/active_record_spec.rb @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- require 'spec_helper' if defined? ActiveRecord diff --git a/spec/comma/rails/data_mapper_collection_spec.rb b/spec/comma/rails/data_mapper_collection_spec.rb index 79d7f30..31884d5 100644 --- a/spec/comma/rails/data_mapper_collection_spec.rb +++ b/spec/comma/rails/data_mapper_collection_spec.rb @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- require 'spec_helper' if defined? DataMapper diff --git a/spec/comma/rails/mongoid_spec.rb b/spec/comma/rails/mongoid_spec.rb index ecbd1eb..a4fe52b 100644 --- a/spec/comma/rails/mongoid_spec.rb +++ b/spec/comma/rails/mongoid_spec.rb @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- require 'spec_helper' if defined? Mongoid diff --git a/spec/rails_app/active_record/config.rb b/spec/rails_app/active_record/config.rb index eedd9f2..3423517 100644 --- a/spec/rails_app/active_record/config.rb +++ b/spec/rails_app/active_record/config.rb @@ -1,4 +1,2 @@ -# -*- coding: utf-8 -*- - ActiveRecord::Base.configurations = {'test' => {'adapter' => 'sqlite3', 'database' => ':memory:'}} ActiveRecord::Base.establish_connection(:test) diff --git a/spec/rails_app/active_record/models.rb b/spec/rails_app/active_record/models.rb index d4becc7..c705350 100644 --- a/spec/rails_app/active_record/models.rb +++ b/spec/rails_app/active_record/models.rb @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - class Post < ActiveRecord::Base has_one :user diff --git a/spec/rails_app/data_mapper/config.rb b/spec/rails_app/data_mapper/config.rb index c62ea2b..f81a281 100644 --- a/spec/rails_app/data_mapper/config.rb +++ b/spec/rails_app/data_mapper/config.rb @@ -1,3 +1 @@ -# -*- coding: utf-8 -*- - DataMapper.setup(:default, 'sqlite::memory:') diff --git a/spec/rails_app/mongoid/config.rb b/spec/rails_app/mongoid/config.rb index 61f8b1c..c861889 100644 --- a/spec/rails_app/mongoid/config.rb +++ b/spec/rails_app/mongoid/config.rb @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - Mongoid.configure do |config| config.sessions = { :default => { diff --git a/spec/rails_app/rails_app.rb b/spec/rails_app/rails_app.rb index 4d2e666..234f90d 100644 --- a/spec/rails_app/rails_app.rb +++ b/spec/rails_app/rails_app.rb @@ -1,11 +1,10 @@ -# -*- coding: utf-8 -*- require 'action_controller/railtie' require 'action_view/railtie' # orm configs require 'rails_app/active_record/config' if defined?(ActiveRecord) -app = Class.new(Rails::Application) +app = CommaTestApp = Class.new(Rails::Application) app.config.secret_token = '6f6acf0443f74fd0aa8ff07a7c2fbe0a' app.config.session_store :cookie_store, :key => '_rails_app_session' app.config.active_support.deprecation = :log diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 09016dd..15cbc17 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- require 'rubygems' $LOAD_PATH.unshift(File.expand_path(File.join(*%w{.. .. lib}), __FILE__)) @@ -35,4 +34,4 @@ Dir[File.dirname(__FILE__) + '/support/**/*.rb'].each { |file| require file } -require File.expand_path('../../spec/non_rails_app/ruby_classes' , __FILE__) +require File.expand_path('../spec/non_rails_app/ruby_classes' , __dir__)