active_admin_import 3.0.0.pre → 3.0.0

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.
@@ -1,5 +1,6 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
  require 'active_model_lint'
3
- describe ActiveAdminImport::Model do
4
- it_behaves_like "ActiveModel"
5
- end
4
+ describe ActiveAdminImport::Model do
5
+ it_behaves_like 'ActiveModel'
6
+ end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'coveralls'
2
3
  Coveralls.wear!
3
4
 
@@ -5,27 +6,23 @@ $LOAD_PATH.unshift(File.dirname(__FILE__))
5
6
  $LOAD_PATH << File.expand_path('../support', __FILE__)
6
7
 
7
8
  ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)
8
- require "bundler"
9
+ require 'bundler'
9
10
  Bundler.setup
10
11
 
11
- ENV['RAILS'] = '4.1.9'
12
-
13
12
  ENV['RAILS_ENV'] = 'test'
13
+ # Ensure the Active Admin load path is happy
14
+ require 'rails'
15
+ ENV['RAILS'] = Rails.version
14
16
  ENV['RAILS_ROOT'] = File.expand_path("../rails/rails-#{ENV['RAILS']}", __FILE__)
15
-
16
17
  # Create the test app if it doesn't exists
17
- unless File.exists?(ENV['RAILS_ROOT'])
18
- system 'rake setup'
19
- end
18
+ system 'rake setup' unless File.exist?(ENV['RAILS_ROOT'])
20
19
 
21
- # Ensure the Active Admin load path is happy
22
- require 'rails'
23
20
  require 'active_model'
21
+ # require ActiveRecord to ensure that Ransack loads correctly
22
+ require 'active_record'
24
23
  require 'active_admin'
25
- ActiveAdmin.application.load_paths = [ENV['RAILS_ROOT'] + "/app/admin"]
26
-
24
+ ActiveAdmin.application.load_paths = [ENV['RAILS_ROOT'] + '/app/admin']
27
25
  require ENV['RAILS_ROOT'] + '/config/environment.rb'
28
-
29
26
  # Disabling authentication in specs so that we don't have to worry about
30
27
  # it allover the place
31
28
  ActiveAdmin.application.authentication_method = false
@@ -37,23 +34,15 @@ require 'capybara/rails'
37
34
  require 'capybara/rspec'
38
35
  require 'capybara/poltergeist'
39
36
 
40
-
41
-
42
-
43
37
  Capybara.register_driver :poltergeist do |app|
44
- Capybara::Poltergeist::Driver.new(app, {
45
- js_errors: true,
46
- timeout: 80,
47
- debug: true,
48
- :phantomjs_options => ['--debug=no', '--load-images=no']
49
-
50
- })
38
+ Capybara::Poltergeist::Driver.new(app, js_errors: true,
39
+ timeout: 80,
40
+ debug: true,
41
+ phantomjs_options: ['--debug=no', '--load-images=no'])
51
42
  end
52
43
 
53
-
54
44
  Capybara.javascript_driver = :poltergeist
55
45
 
56
-
57
46
  RSpec.configure do |config|
58
47
  config.use_transactional_fixtures = false
59
48
 
@@ -69,4 +58,3 @@ RSpec.configure do |config|
69
58
  DatabaseCleaner.clean
70
59
  end
71
60
  end
72
-
@@ -1,9 +1,10 @@
1
- shared_examples_for "ActiveModel" do
1
+ # frozen_string_literal: true
2
+ shared_examples_for 'ActiveModel' do
2
3
  include ActiveModel::Lint::Tests
3
4
 
4
5
  # to_s is to support ruby-1.9
5
- ActiveModel::Lint::Tests.public_instance_methods.map{|m| m.to_s}.grep(/^test/).each do |m|
6
- example m.gsub('_',' ') do
6
+ ActiveModel::Lint::Tests.public_instance_methods.map(&:to_s).grep(/^test/).each do |m|
7
+ example m.tr('_', ' ') do
7
8
  send m
8
9
  end
9
10
  end
@@ -11,4 +12,4 @@ shared_examples_for "ActiveModel" do
11
12
  def model
12
13
  subject
13
14
  end
14
- end
15
+ end
@@ -1,20 +1,16 @@
1
+ # frozen_string_literal: true
1
2
  def add_author_resource(options = {}, &block)
2
-
3
3
  ActiveAdmin.register Author do
4
- config.filters = false
5
- active_admin_import(options, &block)
4
+ config.filters = false
5
+ active_admin_import(options, &block)
6
6
  end
7
7
  Rails.application.reload_routes!
8
-
9
8
  end
10
9
 
11
-
12
10
  def add_post_resource(options = {}, &block)
13
-
14
11
  ActiveAdmin.register Post do
15
- config.filters = false
16
- active_admin_import(options, &block)
12
+ config.filters = false
13
+ active_admin_import(options, &block)
17
14
  end
18
15
  Rails.application.reload_routes!
19
-
20
16
  end
@@ -1,29 +1,29 @@
1
+ # frozen_string_literal: true
1
2
  # Rails template to build the sample app for specs
2
3
 
3
4
  generate :model, 'author name:string{10}:uniq last_name:string birthday:date'
4
5
  generate :model, 'post title:string:uniq body:text author:references'
5
6
 
6
- #Add validation
7
- inject_into_file "app/models/author.rb", " validates_presence_of :name\n validates_uniqueness_of :last_name\n", after: "Base\n"
8
- inject_into_file "app/models/post.rb", " validates_presence_of :author\n", after: ":author\n"
7
+ # Add validation
8
+ inject_into_file 'app/models/author.rb', " validates_presence_of :name\n validates_uniqueness_of :last_name\n", before: 'end'
9
+ inject_into_file 'app/models/post.rb', " validates_presence_of :author\n", before: 'end'
9
10
 
10
11
  # Configure default_url_options in test environment
11
- inject_into_file "config/environments/test.rb", " config.action_mailer.default_url_options = { :host => 'example.com' }\n", after: "config.cache_classes = true\n"
12
+ inject_into_file 'config/environments/test.rb', " config.action_mailer.default_url_options = { :host => 'example.com' }\n", after: "config.cache_classes = true\n"
12
13
 
13
14
  # Add our local Active Admin to the load path
14
- inject_into_file "config/environment.rb", "\n$LOAD_PATH.unshift('#{File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib'))}')\nrequire \"active_admin\"\n", after: "require File.expand_path('../application', __FILE__)"
15
+ inject_into_file 'config/environment.rb', "\n$LOAD_PATH.unshift('#{File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib'))}')\nrequire \"active_admin\"\n", after: "require File.expand_path('../application', __FILE__)"
15
16
 
16
- run "rm Gemfile"
17
+ run 'rm Gemfile'
17
18
 
18
19
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
19
20
 
20
21
  generate :'active_admin:install --skip-users'
21
22
  generate :'formtastic:install'
22
23
 
23
- run "rm -r test"
24
- run "rm -r spec"
24
+ run 'rm -r test'
25
+ run 'rm -r spec'
25
26
 
26
- # Setup a root path for devise
27
27
  route "root :to => 'admin/dashboard#index'"
28
28
 
29
- rake "db:migrate"
29
+ rake 'db:migrate'
@@ -1,6 +1,7 @@
1
- desc "Creates a test rails app for the specs to run against"
1
+ # frozen_string_literal: true
2
+ desc 'Creates a test rails app for the specs to run against'
2
3
  task :setup do
3
4
  require 'rails/version'
4
- system("mkdir spec/rails") unless File.exists?("spec/rails")
5
- system "bundle exec rails new spec/rails/rails-#{Rails::VERSION::STRING} -m spec/support/rails_template.rb --skip-spring"
6
- end
5
+ system('mkdir spec/rails') unless File.exist?('spec/rails')
6
+ system "bundle exec rails new spec/rails/rails-#{Rails::VERSION::STRING} -m spec/support/rails_template.rb --skip-spring --skip-turbolinks"
7
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_admin_import
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.pre
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Fedoronchuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-19 00:00:00.000000000 Z
11
+ date: 2017-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-import
@@ -16,62 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.8.0
19
+ version: 0.17.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.8.0
26
+ version: 0.17.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rchardet
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.5'
33
+ version: '1.6'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.5'
40
+ version: '1.6'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rubyzip
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.0'
48
- - - ">="
49
- - !ruby/object:Gem::Version
50
- version: 1.0.0
47
+ version: '1.2'
51
48
  type: :runtime
52
49
  prerelease: false
53
50
  version_requirements: !ruby/object:Gem::Requirement
54
51
  requirements:
55
52
  - - "~>"
56
53
  - !ruby/object:Gem::Version
57
- version: '1.0'
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: 1.0.0
54
+ version: '1.2'
61
55
  - !ruby/object:Gem::Dependency
62
- name: rails
56
+ name: activeadmin
63
57
  requirement: !ruby/object:Gem::Requirement
64
58
  requirements:
65
- - - ">="
59
+ - - "~>"
66
60
  - !ruby/object:Gem::Version
67
- version: '4.0'
61
+ version: '1.0'
68
62
  type: :runtime
69
63
  prerelease: false
70
64
  version_requirements: !ruby/object:Gem::Requirement
71
65
  requirements:
72
- - - ">="
66
+ - - "~>"
73
67
  - !ruby/object:Gem::Version
74
- version: '4.0'
68
+ version: '1.0'
75
69
  description: The most efficient way to import for Active Admin
76
70
  email:
77
71
  - fedoronchuk@gmail.com
@@ -80,7 +74,7 @@ extensions: []
80
74
  extra_rdoc_files: []
81
75
  files:
82
76
  - ".gitignore"
83
- - ".hound.yml"
77
+ - ".rubocop.yml"
84
78
  - ".travis.yml"
85
79
  - Gemfile
86
80
  - LICENSE
@@ -90,7 +84,13 @@ files:
90
84
  - app/views/admin/import.html.erb
91
85
  - config/locales/en.yml
92
86
  - config/locales/es.yml
87
+ - config/locales/fr.yml
93
88
  - config/locales/it.yml
89
+ - config/locales/ja.yml
90
+ - config/locales/ko.yml
91
+ - config/locales/pt-BR.yml
92
+ - config/locales/ru.yml
93
+ - config/locales/uk.yml
94
94
  - config/locales/zh-CN.yml
95
95
  - lib/active_admin_import.rb
96
96
  - lib/active_admin_import/authorization.rb
@@ -112,6 +112,7 @@ files:
112
112
  - spec/fixtures/files/authors_win1251_win_endline.csv
113
113
  - spec/fixtures/files/authors_with_ids.csv
114
114
  - spec/fixtures/files/authors_with_semicolons.csv
115
+ - spec/fixtures/files/authors_with_tabs.tsv
115
116
  - spec/fixtures/files/empty.csv
116
117
  - spec/fixtures/files/only_headers.csv
117
118
  - spec/fixtures/files/posts.csv
@@ -140,12 +141,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
141
  version: '0'
141
142
  required_rubygems_version: !ruby/object:Gem::Requirement
142
143
  requirements:
143
- - - ">"
144
+ - - ">="
144
145
  - !ruby/object:Gem::Version
145
- version: 1.3.1
146
+ version: '0'
146
147
  requirements: []
147
148
  rubyforge_project:
148
- rubygems_version: 2.4.6
149
+ rubygems_version: 2.6.10
149
150
  signing_key:
150
151
  specification_version: 4
151
152
  summary: ActiveAdmin import based on activerecord-import gem.
@@ -161,6 +162,7 @@ test_files:
161
162
  - spec/fixtures/files/authors_win1251_win_endline.csv
162
163
  - spec/fixtures/files/authors_with_ids.csv
163
164
  - spec/fixtures/files/authors_with_semicolons.csv
165
+ - spec/fixtures/files/authors_with_tabs.tsv
164
166
  - spec/fixtures/files/empty.csv
165
167
  - spec/fixtures/files/only_headers.csv
166
168
  - spec/fixtures/files/posts.csv
@@ -173,4 +175,3 @@ test_files:
173
175
  - spec/support/active_model_lint.rb
174
176
  - spec/support/admin.rb
175
177
  - spec/support/rails_template.rb
176
- has_rdoc:
data/.hound.yml DELETED
@@ -1,4 +0,0 @@
1
- ruby:
2
- enabled: true
3
- StringLiterals:
4
- EnforcedStyle: single_quotes