Skip to content

Commit

Permalink
Remove support for EOL Rubies (< 2.6)
Browse files Browse the repository at this point in the history
In this PR:
  * Temporarily remove all YARD doc config, to be added back
    after migrating CI to Github Actions, to simplify config
    and dependencies
  * Remove all testing and references to < 2.6 Rubies
  * Simplify JRuby and TruffleRuby testing to latest stable versions

NOT in this PR:
  * Any simplifying code changes that are now possible due to
    removing support for EOL Rubies

Closes #58
  • Loading branch information
ms-ati committed May 4, 2021
1 parent a6253f6 commit 4f258fa
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 86 deletions.
19 changes: 5 additions & 14 deletions .travis.yml
Expand Up @@ -7,25 +7,16 @@ branches:
rvm:
# MRI
- ruby-head
- 3.0
- 2.7
- 2.6
- 2.5
- 2.4
- 2.3
- 2.2
- 2.1
- 1.9.3
# JRuby
- jruby-head
- jruby-9.2
# Truffleruby
- truffleruby-head
- truffleruby-20.3.0
- jruby
- truffleruby

jobs:
allow_failures:
- rvm: ruby-head
- rvm: jruby-head
- rvm: truffleruby-head
- rvm: jruby
- rvm: truffleruby

fast_finish: true
7 changes: 2 additions & 5 deletions Gemfile
@@ -1,11 +1,8 @@
require File.expand_path("on_what", File.dirname(__FILE__))
source "https://rubygems.org"

# Travis-only dependencies go here
if on_travis? && !on_less_than_2_3?
group :test do
gem "codecov", ">= 0.0.9", :require => false
end
if ENV["CI"] == "true"
gem "codecov", require: false, group: "test"
end

# Specify gem's dependencies in docile.gemspec
Expand Down
3 changes: 3 additions & 0 deletions HISTORY.md
Expand Up @@ -7,6 +7,9 @@
constructing a proxy object) when the DSL object and block context object are
identical (*Sorry it took over a year to review and merge this!*)
- Renamed default branch from master to main, see: https://github.com/github/renaming
- Temporarily removed YARD doc configuration, to replace after
migration to Github Actions
- Removed support for all EOL Rubies < 2.6

## [v1.3.5 (Jan 13, 2021)](http://github.com/ms-ati/docile/compare/v1.3.4...v1.3.5)

Expand Down
17 changes: 5 additions & 12 deletions README.md
@@ -1,8 +1,3 @@
## ⚠️WARNING⚠️, 🔴IMPORTANT❗🔴
### Using Docile on an [end-of-life Ruby version (< **2.5**)](https://www.ruby-lang.org/en/downloads/branches/)?
#### Please comment on [issue #58](https://github.com/ms-ati/docile/issues/58) this month 📅!
We'll decide which Ruby versions to continue supporting on **Feb 1st 2021**.

# Docile

[![Gem Version](https://img.shields.io/gem/v/docile.svg)](https://rubygems.org/gems/docile)
Expand All @@ -29,7 +24,7 @@ coding a bit more docile...

## Usage

### Basic: Ruby [Array](http://ruby-doc.org/core-2.2.2/Array.html) as DSL
### Basic: Ruby [Array](http://ruby-doc.org/core-3.0.0/Array.html) as DSL

Let's say that we want to make a DSL for modifying Array objects.
Wouldn't it be great if we could just treat the methods of Array as a DSL?
Expand Down Expand Up @@ -274,11 +269,11 @@ Sometimes, you want to use an object as a DSL, but it doesn't quite fit the
above.

Instead of methods like
[Array#push](http://www.ruby-doc.org/core-2.0/Array.html#method-i-push), which
[Array#push](http://www.ruby-doc.org/core-3.0.0/Array.html#method-i-push), which
modifies the object at hand, it has methods like
[String#reverse](http://www.ruby-doc.org/core-2.0/String.html#method-i-reverse),
[String#reverse](http://www.ruby-doc.org/core-3.0.0/String.html#method-i-reverse),
which returns a new object without touching the original. Perhaps it's even
[frozen](http://www.ruby-doc.org/core-2.0/Object.html#method-i-freeze) in
[frozen](http://www.ruby-doc.org/core-3.0.0/Object.html#method-i-freeze) in
order to enforce [immutability](http://en.wikipedia.org/wiki/Immutable_object).

Wouldn't it be great if we could just treat these methods as a DSL as well?
Expand Down Expand Up @@ -356,7 +351,7 @@ $ gem install docile

## Status

Works on [all ruby versions since 1.9.3](https://github.com/ms-ati/docile/blob/master/.travis.yml), or so Travis CI [tells us](https://travis-ci.org/ms-ati/docile).
Works on [all currently supported ruby versions](https://github.com/ms-ati/docile/blob/master/.travis.yml), or so Travis CI [tells us](https://travis-ci.org/ms-ati/docile).

Used by some pretty cool gems to implement their DSLs, notably including [SimpleCov](https://github.com/colszowka/simplecov). Keep an eye out for new gems using Docile at the [Ruby Toolbox](https://www.ruby-toolbox.com/projects/docile).

Expand All @@ -382,5 +377,3 @@ Docile releases follow [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.
Copyright (c) 2012-2021 Marc Siegel.

Licensed under the [MIT License](http://choosealicense.com/licenses/mit/), see [LICENSE](LICENSE) for details.


16 changes: 0 additions & 16 deletions Rakefile
@@ -1,7 +1,6 @@
require "rake/clean"
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require File.expand_path("on_what", File.dirname(__FILE__))

# Default task for `rake` is to run rspec
task :default => [:spec]
Expand All @@ -11,18 +10,3 @@ RSpec::Core::RakeTask.new

# Configure `rake clobber` to delete all generated files
CLOBBER.include("pkg", "doc", "coverage")

# To limit needed compatibility with versions of dependencies, only configure
# yard doc generation when *not* on Travis, JRuby, or < 2.0
if !on_travis? && !on_jruby? && !on_less_than_2_0?
require "github/markup"
require "redcarpet"
require "yard"
require "yard/rake/yardoc_task"

YARD::Rake::YardocTask.new do |t|
OTHER_PATHS = %w()
t.files = ["lib/**/*.rb", OTHER_PATHS]
t.options = %w(--markup-provider=redcarpet --markup=markdown --main=README.md)
end
end
19 changes: 3 additions & 16 deletions docile.gemspec
@@ -1,5 +1,4 @@
$:.push File.expand_path("../lib", __FILE__)
require File.expand_path("on_what", File.dirname(__FILE__))
require "docile/version"

Gem::Specification.new do |s|
Expand All @@ -25,20 +24,8 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]

# Specify oldest supported Ruby version
s.required_ruby_version = ">= 1.9.3"
s.required_ruby_version = ">= 2.6.0"

# Run rspec tests from rake even on old Ruby versions
s.add_development_dependency "rake", "< 11.0" # See http://stackoverflow.com/questions/35893584/nomethoderror-undefined-method-last-comment-after-upgrading-to-rake-11
s.add_development_dependency "rspec", "~> 3.0"
s.add_development_dependency "rspec-expectations", "!= 3.8.3" # Workaround for RSpec's issue, see: https://github.com/rspec/rspec-expectations/issues/1111

# To limit needed compatibility with versions of dependencies, only configure
# yard doc generation when *not* on Travis, JRuby, or < 2.3
if !on_travis? && !on_jruby? && !on_less_than_2_3?
# Github flavored markdown in YARD documentation
# http://blog.nikosd.com/2011/11/github-flavored-markdown-in-yard.html
s.add_development_dependency "yard"
s.add_development_dependency "redcarpet"
s.add_development_dependency "github-markup"
end
s.add_development_dependency "rake", "~> 12.3.3"
s.add_development_dependency "rspec", "~> 3.9"
end
2 changes: 1 addition & 1 deletion lib/docile.rb
Expand Up @@ -124,7 +124,7 @@ def dsl_eval_with_block_return(dsl, *args, &block)
def dsl_eval_immutable(dsl, *args, &block)
exec_in_proxy_context(dsl, ChainingFallbackContextProxy, *args, &block)
end

ruby2_keywords :dsl_eval_immutable if respond_to?(:ruby2_keywords, true)
module_function :dsl_eval_immutable
end
18 changes: 0 additions & 18 deletions on_what.rb

This file was deleted.

5 changes: 1 addition & 4 deletions spec/spec_helper.rb
@@ -1,16 +1,13 @@
require File.expand_path("on_what", File.dirname(File.dirname(__FILE__)))

# Code coverage (via SimpleCov)
begin
require "simplecov"
SimpleCov.start do
add_filter "/spec/" # exclude test code
add_filter "/vendor/" # exclude gems which are vendored on Travis CI
add_filter "/on_what.rb" # exclude help used only in gemspec
end

# On CI we publish simplecov results to codecov.io
if on_travis?
if ENV["CI"] == "true"
require "codecov"
SimpleCov.formatter = SimpleCov::Formatter::Codecov
end
Expand Down

0 comments on commit 4f258fa

Please sign in to comment.