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 +4 -4
- data/.travis.yml +19 -0
- data/Gemfile +9 -7
- data/lib/active_admin_sidebar.rb +1 -0
- data/lib/active_admin_sidebar/activeadmin_views_pages_base.rb +9 -1
- data/lib/active_admin_sidebar/version.rb +1 -1
- data/spec/spec_helper.rb +3 -19
- data/spec/support/capybara.rb +13 -0
- data/tasks/test.rake +9 -1
- metadata +5 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e7e3d5cb495dbf0506cf8d8b1e3f83c433836b7883447283e479f09b9d50701
|
4
|
+
data.tar.gz: c41d31e107f4812b8c5677caab159093039eab0bd206e13a2d09d79956b3810a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 '
|
8
|
-
|
9
|
-
|
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 '
|
19
|
+
gem 'chromedriver-helper'
|
20
|
+
gem 'byebug'
|
19
21
|
end
|
data/lib/active_admin_sidebar.rb
CHANGED
@@ -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
|
-
|
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
|
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 '
|
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
|
-
|
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.
|
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-
|
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: []
|