Skip to content
This repository was archived by the owner on May 18, 2025. It is now read-only.

Commit 5440e5b

Browse files
author
Mattia Roccoberton
committed
Minor improvements
1 parent d790931 commit 5440e5b

6 files changed

Lines changed: 28 additions & 44 deletions

File tree

.rubocop.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,3 @@ AllCops:
1010
- spec/dummy/**/*
1111
- vendor/**/*
1212
NewCops: enable
13-
14-
Gemspec/RequiredRubyVersion:
15-
Enabled: false
16-
17-
Naming/FileName:
18-
Enabled: false
19-
20-
Layout/LineLength:
21-
Enabled: true
22-
Max: 120
23-
24-
Style/HashEachMethods:
25-
Enabled: true
26-
27-
Style/HashTransformKeys:
28-
Enabled: true
29-
30-
Style/HashTransformValues:
31-
Enabled: true

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# Active Admin Medium Editor
22
[![gem version](https://badge.fury.io/rb/activeadmin_medium_editor.svg)](https://badge.fury.io/rb/activeadmin_medium_editor)
33
[![Gem downloads](https://badgen.net/rubygems/dt/activeadmin_medium_editor)](https://rubygems.org/gems/activeadmin_medium_editor)
4+
45
[![linters](https://github.com/blocknotes/activeadmin_medium_editor/actions/workflows/linters.yml/badge.svg)](https://github.com/blocknotes/activeadmin_medium_editor/actions/workflows/linters.yml)
5-
[![specs](https://github.com/blocknotes/activeadmin_medium_editor/actions/workflows/specs.yml/badge.svg)](https://github.com/blocknotes/activeadmin_medium_editor/actions/workflows/specs.yml)
6+
[![specs Rails 6.0](https://github.com/blocknotes/activeadmin_medium_editor/actions/workflows/specs_rails60.yml/badge.svg)](https://github.com/blocknotes/activeadmin_medium_editor/actions/workflows/specs_rails60.yml)
7+
[![specs Rails 6.1](https://github.com/blocknotes/activeadmin_medium_editor/actions/workflows/specs_rails61.yml/badge.svg)](https://github.com/blocknotes/activeadmin_medium_editor/actions/workflows/specs_rails61.yml)
8+
[![specs Rails 7.0](https://github.com/blocknotes/activeadmin_medium_editor/actions/workflows/specs_rails70.yml/badge.svg)](https://github.com/blocknotes/activeadmin_medium_editor/actions/workflows/specs_rails70.yml)
69

710
An Active Admin plugin to use [medium-editor](https://github.com/yabwe/medium-editor), a compact and clean WYSIWYG editor.
811

bin/rails

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,16 @@
11
#!/usr/bin/env ruby
2-
# frozen_string_literal: true
2+
# This command will automatically be run when you run "rails" with Rails gems
3+
# installed from the root of your application.
34

4-
#
5-
# This file was generated by Bundler.
6-
#
7-
# The application 'rails' is installed as part of a gem, and
8-
# this file is here to facilitate running it.
9-
#
5+
ENV['RAILS_ENV'] ||= 'test'
106

11-
require "pathname"
12-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13-
Pathname.new(__FILE__).realpath)
7+
ENGINE_ROOT = File.expand_path('..', __dir__)
8+
ENGINE_PATH = File.expand_path('../lib/activeadmin_medium_editor', __dir__)
9+
APP_PATH = File.expand_path('../spec/dummy/config/application', __dir__)
1410

15-
bundle_binstub = File.expand_path("../bundle", __FILE__)
11+
# Set up gems listed in the Gemfile.
12+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
13+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
1614

17-
if File.file?(bundle_binstub)
18-
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19-
load(bundle_binstub)
20-
else
21-
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22-
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23-
end
24-
end
25-
26-
require "rubygems"
27-
require "bundler/setup"
28-
29-
load Gem.bin_path("railties", "rails")
15+
require 'rails/all'
16+
require 'rails/engine/commands'

lib/activeadmin/medium_editor/version.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
module ActiveAdmin
44
module MediumEditor
55
VERSION = '0.2.14'
6+
MEDIUM_VERSION = '5.23.3'
67
end
78
end

spec/dummy/config/routes.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
Rails.application.routes.draw do
22
ActiveAdmin.routes(self)
3+
4+
root to: redirect('/admin')
35
end

spec/system/medium_js_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
RSpec.describe 'Medium JS', type: :system do
4+
it 'defines a Javascript object for the editor', :aggregate_failures do
5+
visit '/admin/posts'
6+
7+
expect(page.evaluate_script('typeof MediumEditor')).to eq 'function'
8+
expect(page.evaluate_script('MediumEditor.version.toString()')).to eq ActiveAdmin::MediumEditor::MEDIUM_VERSION
9+
end
10+
end

0 commit comments

Comments
 (0)