active_admin_sidebar 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b58bcf234d2f317dcd23d5a57dd77795136ffb7f2758de981514d82163077d90
4
- data.tar.gz: 895b88d334f9306b5caeffaed1bb9440478d25e9c1873c75d498d70365088847
3
+ metadata.gz: 8e7e3d5cb495dbf0506cf8d8b1e3f83c433836b7883447283e479f09b9d50701
4
+ data.tar.gz: c41d31e107f4812b8c5677caab159093039eab0bd206e13a2d09d79956b3810a
5
5
  SHA512:
6
- metadata.gz: d0d6dbc10f05fa74875dd6b07174f812ce5598aec325e37b4d4b45494a5d79a4341b4117b1736849418d1f6be5c677d83da223180a8f35b89002c390e0b923a8
7
- data.tar.gz: 1c4a3c24433bdbcd00bd83afe25a4e01db120059f32ad532cde52aea31d522d239b34457f83e3193c9f005b445442bfe8e970baba37afcb347b535014aa229e1
6
+ metadata.gz: 8e442e3d986f52fc2415a979d1488fd64e056a362704292bf59d73252eddfff5efb1096cc148ddaabd39c79e195e74e5236f877d07e5b63b50cf96725c79cdd7
7
+ data.tar.gz: 49e1113d722386ee9098e69d8f04a4befa1420d58e1aebea33aed97a6c6d99c2114fb9ac1a758d41ce87502f3bfa5457bb39c7614ab94cf9c77ff563ecb637fa
data/.travis.yml ADDED
@@ -0,0 +1,19 @@
1
+ sudo: required
2
+ language: ruby
3
+ addons:
4
+ chrome: stable
5
+
6
+ before_install: gem install bundler -v 1.17.1
7
+
8
+ script: bundle exec rspec
9
+
10
+ env:
11
+ matrix:
12
+ - RAILS=5.1.6 AA=1.1.0
13
+ - RAILS=5.1.6 AA=1.2.1
14
+ - RAILS=5.2.1 AA=1.3.1
15
+ - RAILS=5.2.1 AA=1-4-stable
16
+
17
+ rvm:
18
+ - 2.3
19
+ - 2.5
data/Gemfile CHANGED
@@ -4,16 +4,18 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  group :test do
7
- gem 'sprockets-rails', '3.2.0'
8
- gem 'rails', '5.1.1'
9
- gem 'turbolinks'
7
+ gem 'rails', "#{ENV['RAILS'] || '5.2.1'}"
8
+ if ENV['AA'] == '1-4-stable'
9
+ gem 'activeadmin', git: 'https://github.com/activeadmin/activeadmin.git', branch: '1-4-stable'
10
+ else
11
+ gem 'activeadmin', "#{ENV['AA'] || '1.3.1'}"
12
+ end
13
+
10
14
  gem 'rspec-rails'
11
- gem 'activeadmin', '1.0.0'
12
- gem 'sass-rails'
13
15
  gem 'sqlite3'
14
- gem 'launchy'
15
16
  gem 'database_cleaner'
16
17
  gem 'capybara'
17
18
  gem 'selenium-webdriver'
18
- gem 'poltergeist'
19
+ gem 'chromedriver-helper'
20
+ gem 'byebug'
19
21
  end
@@ -7,6 +7,7 @@ module ActiveAdminSidebar
7
7
  module Rails
8
8
  class Engine < ::Rails::Engine
9
9
  config.after_initialize do
10
+ ActiveAdmin::Views::Pages::Base.prepend ActiveAdminSidebar::ActiveAdminViewsPagesBase
10
11
  ActiveAdmin::BaseController.send :include, ActiveAdminSidebar::Positions
11
12
  end
12
13
  end
@@ -1,4 +1,4 @@
1
- class ActiveAdmin::Views::Pages::Base < Arbre::HTML::Document
1
+ module ActiveAdminSidebar::ActiveAdminViewsPagesBase
2
2
 
3
3
  def build_page_content
4
4
  build_flash_messages
@@ -9,6 +9,14 @@ class ActiveAdmin::Views::Pages::Base < Arbre::HTML::Document
9
9
  end
10
10
  end
11
11
 
12
+ def build_sidebar
13
+ if defined?(super)
14
+ super
15
+ else
16
+ sidebar sidebar_sections_for_action, id: 'sidebar'
17
+ end
18
+ end
19
+
12
20
  def left_sidebar?
13
21
  assigns[:sidebar_options].try!(:[], :position) == :left
14
22
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveAdminSidebar
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -27,11 +27,12 @@ ActiveAdmin.application.authentication_method = false
27
27
  ActiveAdmin.application.current_user_method = false
28
28
 
29
29
  require 'rspec/rails'
30
- require 'support/admin'
31
30
  require 'capybara/rails'
32
31
  require 'capybara/rspec'
33
- require 'capybara/poltergeist'
32
+ require 'selenium-webdriver'
34
33
 
34
+ require 'support/admin'
35
+ require 'support/capybara'
35
36
 
36
37
  RSpec.configure do |config|
37
38
  config.use_transactional_fixtures = false
@@ -49,20 +50,3 @@ RSpec.configure do |config|
49
50
  end
50
51
 
51
52
  end
52
-
53
- # RSpec.configure do |config|
54
- # config.before(:each, js: true) do
55
- # page.driver.browser.manage.window.maximize if page.driver.browser.respond_to?(:manage)
56
- # end
57
- # end
58
- # Capybara.javascript_driver = :selenium
59
-
60
- Capybara.register_driver :poltergeist do |app|
61
- Capybara::Poltergeist::Driver.new(app, {
62
- js_errors: true,
63
- timeout: 80,
64
- debug: true,
65
- :phantomjs_options => ['--debug=no', '--load-images=no']
66
- })
67
- end
68
- Capybara.javascript_driver = :poltergeist
@@ -0,0 +1,13 @@
1
+ Capybara.configure do |config|
2
+ config.match = :prefer_exact
3
+ end
4
+
5
+ Capybara.register_driver :selenium_chrome do |app|
6
+ options = Selenium::WebDriver::Chrome::Options.new(
7
+ args: %w[headless disable-gpu no-sandbox]
8
+ )
9
+ Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
10
+ end
11
+
12
+ Capybara.server = :webrick
13
+ Capybara.javascript_driver = :selenium_chrome
data/tasks/test.rake CHANGED
@@ -2,5 +2,13 @@ desc "Creates a test rails app for the specs to run against"
2
2
  task :setup do
3
3
  require 'rails/version'
4
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"
5
+
6
+ rails_new_opts = %w(
7
+ --skip-turbolinks
8
+ --skip-spring
9
+ --skip-bootsnap
10
+ -m
11
+ spec/support/rails_template.rb
12
+ )
13
+ system "bundle exec rails new spec/rails/rails-#{Rails::VERSION::STRING} #{rails_new_opts.join(' ')}"
6
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_admin_sidebar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-14 00:00:00.000000000 Z
11
+ date: 2018-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeadmin
@@ -31,6 +31,7 @@ executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
+ - ".travis.yml"
34
35
  - Gemfile
35
36
  - LICENSE
36
37
  - README.md
@@ -47,6 +48,7 @@ files:
47
48
  - spec/sidebars_spec.rb
48
49
  - spec/spec_helper.rb
49
50
  - spec/support/admin.rb
51
+ - spec/support/capybara.rb
50
52
  - spec/support/rails_template.rb
51
53
  - tasks/test.rake
52
54
  homepage: https://github.com/Fivell/active_admin_sidebar
@@ -72,8 +74,4 @@ rubygems_version: 2.7.7
72
74
  signing_key:
73
75
  specification_version: 4
74
76
  summary: active_admin_sidebar gem
75
- test_files:
76
- - spec/sidebars_spec.rb
77
- - spec/spec_helper.rb
78
- - spec/support/admin.rb
79
- - spec/support/rails_template.rb
77
+ test_files: []