Skip to content

Commit

Permalink
Merge pull request #644 from chaadow/update_ci
Browse files Browse the repository at this point in the history
Update best in place for rails 7.0 / 7.1 / 7.2 and main
  • Loading branch information
seuros authored Aug 14, 2024
2 parents 60d987d + 4ae8053 commit 3e714f5
Show file tree
Hide file tree
Showing 15 changed files with 84 additions and 163 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Ruby CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
name: Ruby ${{ matrix.ruby }} - Gemfile ${{ matrix.gemfile }}
runs-on: ubuntu-latest

strategy:
matrix:
ruby: [3.1.6, 3.2.5, 3.3.4]
gemfile:
- gemfiles/rails_7.0.gemfile
- gemfiles/rails_7.1.gemfile
- gemfiles/rails_7.2.gemfile
- gemfiles/rails_edge.gemfile
allow_failures:
gemfile: gemfiles/rails_edge.gemfile

env:
RAILS_ENV: test
DISPLAY: ":99.0"

steps:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Install dependencies
run: |
gem install bundler
bundle install --gemfile ${{ matrix.gemfile }}
- name: Set up PhantomJS
run: |
mkdir travis-phantomjs
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
tar -xvf $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis-phantomjs
echo "$PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64/bin" >> $GITHUB_PATH
- name: Run tests
run: bundle exec rspec
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

38 changes: 11 additions & 27 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,35 +1,19 @@
appraise "rails-3.2" do
gem 'rails', github: "rails/rails", branch: '3-2-stable'
gem 'strong_parameters'
gem 'test-unit'
appraise "rails-7.0" do
gem 'sqlite3', '~> 1.4'
gem "rails", github: "rails/rails", branch: '7-0-stable'
end

appraise "rails-4.0" do
gem "rails", github: "rails/rails", branch: '4-0-stable'
gem 'test-unit'
appraise "rails-7.1" do
gem 'sqlite3', '~> 1.4'
gem "rails", '7.1.0' # issue with 7-1-stable
end

appraise "rails-4.1" do
gem "rails", github: "rails/rails", branch: '4-1-stable'
end

appraise "rails-4.2" do
gem "rails", github: "rails/rails", branch: '4-2-stable'
end

appraise "rails-5.0" do
gem "rails", github: "rails/rails", branch: '5-0-stable'
end

appraise "rails-5.1" do
gem "rails", github: "rails/rails", branch: '5-1-stable'
end

appraise "rails-6.1" do
gem "rails", github: "rails/rails", branch: '6-1-stable'
appraise "rails-7.2" do
gem 'sqlite3', '~> 1.4'
gem "rails", github: "rails/rails", branch: '7-2-stable'
end

appraise "rails-edge" do
gem "rails", github: "rails/rails"
gem 'arel', github: 'rails/arel'
gem 'sqlite3', '~> 1.4'
gem "rails", github: "rails/rails", branch: 'main'
end
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ source 'https://rails-assets.org'
# Specify your gem's dependencies in best_in_place.gemspec
gemspec

gem 'activerecord'
gem 'rails-assets-jquery', '1.11.1'
gem 'rails-assets-jquery-ui', '1.10.4'
gem 'rdiscount'
Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
[![Build Status](https://secure.travis-ci.org/bernat/best_in_place.png)](http://travis-ci.org/bernat/best_in_place)
**The Unobtrusive in Place editing solution**

**NB**: For Rails >= 6.1 you can install the gem from this repository with:

gem "best_in_place", git: "https://github.com/mmotherwell/best_in_place"

## Description

**Best in Place** is a jQuery based AJAX Inplace-Editor that takes profit of RESTful server-side controllers to allow users to edit stuff with
Expand Down Expand Up @@ -230,7 +226,6 @@ def update
end
```


## Custom display methods

### Using `display_as`
Expand Down
5 changes: 2 additions & 3 deletions best_in_place.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ DESC
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]

s.add_runtime_dependency 'actionpack', '>= 3.2'
s.add_runtime_dependency 'railties', '>= 3.2'

s.add_runtime_dependency 'actionpack', '>= 7.0'
s.add_runtime_dependency 'railties', '>= 7.0'
end
25 changes: 0 additions & 25 deletions gemfiles/rails_4.1.gemfile

This file was deleted.

25 changes: 0 additions & 25 deletions gemfiles/rails_5.0.gemfile

This file was deleted.

25 changes: 0 additions & 25 deletions gemfiles/rails_5.1.gemfile

This file was deleted.

9 changes: 4 additions & 5 deletions gemfiles/rails_3.2.gemfile → gemfiles/rails_7.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
source "https://rubygems.org"
source "https://rails-assets.org"

gem "activerecord"
gem "rails-assets-jquery", "1.11.1"
gem "rails-assets-jquery-ui", "1.10.4"
gem "rdiscount"
Expand All @@ -13,12 +12,12 @@ gem "combustion"
gem "sprockets-rails"
gem "capybara"
gem "poltergeist"
gem "sqlite3"
gem "sqlite3", "~> 1.4"
gem "appraisal"
gem "launchy"
gem "rails", github: "rails/rails", branch: "3-2-stable"
gem "strong_parameters"
gem "test-unit"
gem "puma"
gem "phantomjs", require: "phantomjs/poltergeist"
gem "rails", github: "rails/rails", branch: "7-0-stable"

platforms :mri_21 do
gem "byebug"
Expand Down
7 changes: 4 additions & 3 deletions gemfiles/rails_4.2.gemfile → gemfiles/rails_7.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
source "https://rubygems.org"
source "https://rails-assets.org"

gem "activerecord"
gem "rails-assets-jquery", "1.11.1"
gem "rails-assets-jquery-ui", "1.10.4"
gem "rdiscount"
Expand All @@ -13,10 +12,12 @@ gem "combustion"
gem "sprockets-rails"
gem "capybara"
gem "poltergeist"
gem "sqlite3"
gem "sqlite3", "~> 1.4"
gem "appraisal"
gem "launchy"
gem "rails", github: "rails/rails", branch: "4-2-stable"
gem "puma"
gem "phantomjs", require: "phantomjs/poltergeist"
gem "rails", "7.1.0"

platforms :mri_21 do
gem "byebug"
Expand Down
8 changes: 4 additions & 4 deletions gemfiles/rails_4.0.gemfile → gemfiles/rails_7.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
source "https://rubygems.org"
source "https://rails-assets.org"

gem "activerecord"
gem "rails-assets-jquery", "1.11.1"
gem "rails-assets-jquery-ui", "1.10.4"
gem "rdiscount"
Expand All @@ -13,11 +12,12 @@ gem "combustion"
gem "sprockets-rails"
gem "capybara"
gem "poltergeist"
gem "sqlite3"
gem "sqlite3", "~> 1.4"
gem "appraisal"
gem "launchy"
gem "rails", github: "rails/rails", branch: "4-0-stable"
gem "test-unit"
gem "puma"
gem "phantomjs", require: "phantomjs/poltergeist"
gem "rails", github: "rails/rails", branch: "7-2-stable"

platforms :mri_21 do
gem "byebug"
Expand Down
8 changes: 4 additions & 4 deletions gemfiles/rails_edge.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
source "https://rubygems.org"
source "https://rails-assets.org"

gem "activerecord"
gem "rails-assets-jquery", "1.11.1"
gem "rails-assets-jquery-ui", "1.10.4"
gem "rdiscount"
Expand All @@ -13,11 +12,12 @@ gem "combustion"
gem "sprockets-rails"
gem "capybara"
gem "poltergeist"
gem "sqlite3"
gem "sqlite3", "~> 1.4"
gem "appraisal"
gem "launchy"
gem "rails", github: "rails/rails"
gem "arel", github: "rails/arel"
gem "puma"
gem "phantomjs", require: "phantomjs/poltergeist"
gem "rails", github: "rails/rails", branch: "main"

platforms :mri_21 do
gem "byebug"
Expand Down
3 changes: 2 additions & 1 deletion lib/best_in_place/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,11 @@ def best_in_place_deprecated_options(opts)
{from: :sanitize, to: :raw}
]

deprecator = ActiveSupport::Deprecation.new
deprecations.each do |deprecation|
if deprecated_option = opts.delete(deprecation[:from])
opts[deprecation[:from]] = deprecated_option
ActiveSupport::Deprecation.warn("[Best_in_place] :#{deprecation[:from]} is deprecated in favor of :#{deprecation[:to]} ")
deprecator.warn("[Best_in_place] :#{deprecation[:from]} is deprecated in favor of :#{deprecation[:to]} ")
end
end
end
Expand Down
5 changes: 2 additions & 3 deletions spec/helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
end

it "should show deprecation warning" do
expect(ActiveSupport::Deprecation).to receive(:warn).with("[Best_in_place] :path is deprecated in favor of :url ")
expect_any_instance_of(ActiveSupport::Deprecation).to receive(:warn).with("[Best_in_place] :path is deprecated in favor of :url ")

helper.best_in_place @user, :name, path: "http://example.com"
end
Expand Down Expand Up @@ -93,7 +93,6 @@
expect(@span.attribute("data-bip-inner-class")).to be_nil
end


it "should have be sanitized by default" do
expect(@span.attribute("data-bip-raw")).to be_nil
end
Expand Down Expand Up @@ -335,7 +334,7 @@
end

it "should render the date as text" do
expect(@span.text).to eq(@user.birth_date.to_date.to_s)
expect(@span.text).to eq(@user.birth_date.utc.to_s)
end

it "should have a date data-bip-type" do
Expand Down

0 comments on commit 3e714f5

Please sign in to comment.