mirror of
https://github.com/ms-ati/docile
synced 2023-03-27 23:21:52 -04:00
Remove support for EOL Rubies (< 2.6)
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
This commit is contained in:
parent
a6253f63e5
commit
4f258fab7a
9 changed files with 20 additions and 86 deletions
19
.travis.yml
19
.travis.yml
|
@ -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
Gemfile
7
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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
17
README.md
17
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
|
||||
|
||||
[](https://rubygems.org/gems/docile)
|
||||
|
@ -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?
|
||||
|
@ -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?
|
||||
|
@ -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).
|
||||
|
||||
|
@ -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
Rakefile
16
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]
|
||||
|
@ -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
|
||||
|
|
|
@ -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|
|
||||
|
@ -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
|
||||
|
|
|
@ -124,7 +124,7 @@ module Docile
|
|||
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
on_what.rb
18
on_what.rb
|
@ -1,18 +0,0 @@
|
|||
# NOTE: Very simple tests for what system we are on, extracted for sharing
|
||||
# between Rakefile, gemspec, and spec_helper. Not for use in actual library.
|
||||
|
||||
def on_travis?
|
||||
ENV["CI"] == "true"
|
||||
end
|
||||
|
||||
def on_jruby?
|
||||
defined?(RUBY_ENGINE) && "jruby" == RUBY_ENGINE
|
||||
end
|
||||
|
||||
def on_less_than_2_0?
|
||||
RUBY_VERSION < "2.0.0"
|
||||
end
|
||||
|
||||
def on_less_than_2_3?
|
||||
RUBY_VERSION < "2.3.0"
|
||||
end
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue