summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Luis Leal Cardoso Junior <andrehjr@gmail.com>2022-03-09 19:01:20 -0300
committerAndré Luis Leal Cardoso Junior <andrehjr@gmail.com>2022-03-10 00:01:28 -0300
commite43dbb0962eb065e8e8be59fcacd1068bd62519e (patch)
tree986660971b84d530fc4be4d6bd80335d16a467d2
parentdb5b2b4ef67f45cc37357585920c48898a97be1c (diff)
downloadpry-e43dbb0962eb065e8e8be59fcacd1068bd62519e.tar.gz
Remove support for Ruby 1.9.3
-rw-r--r--.circleci/config.yml26
-rw-r--r--.circleci/ruby-1.9.3p551/Dockerfile80
-rw-r--r--README.md2
-rw-r--r--lib/pry/warning.rb13
-rw-r--r--pry.gemspec2
-rw-r--r--spec/commands/edit_spec.rb8
-rw-r--r--spec/editor_spec.rb8
7 files changed, 7 insertions, 132 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
deleted file mode 100644
index 84f20f5b..00000000
--- a/.circleci/config.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-version: 2.1
-
-jobs:
- build:
- working_directory: ~/pry
-
- docker:
- - image: kyrylo/ruby-1.9.3p551
-
- steps:
- - checkout
-
- - run:
- name: Install Bundler dependencies
- command: bundle install
-
- - run:
- name: Install Nano text editor (required for some tests)
- command: apk add nano
-
- - run:
- name: Run unit tests
- command: bundle exec rake
- environment:
- # Make sure TERM is set so Pry can indent correctly inside tests.
- TERM: screen-256color
diff --git a/.circleci/ruby-1.9.3p551/Dockerfile b/.circleci/ruby-1.9.3p551/Dockerfile
deleted file mode 100644
index 2b066293..00000000
--- a/.circleci/ruby-1.9.3p551/Dockerfile
+++ /dev/null
@@ -1,80 +0,0 @@
-FROM alpine
-
-RUN mkdir -p /usr/local/etc \
- && { \
- echo 'install: --no-document'; \
- echo 'update: --no-document'; \
- } >> /usr/local/etc/gemrc
-
-ENV RUBY_MAJOR 1.9
-ENV RUBY_VERSION 1.9.3-p551
-ENV RUBYGEMS_VERSION 1.8.23.2
-ENV BUNDLER_VERSION 1.16.6
-
-RUN set -ex \
- && apk add --no-cache --virtual .ruby-builddeps \
- autoconf \
- bison \
- bzip2 \
- bzip2-dev \
- ca-certificates \
- coreutils \
- curl \
- gcc \
- gdbm-dev \
- glib-dev \
- libc-dev \
- libffi-dev \
- libxml2-dev \
- libxslt-dev \
- linux-headers \
- make \
- ncurses-dev \
- openssl-dev \
- procps \
- readline-dev \
- ruby \
- yaml-dev \
- zlib-dev \
- && curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
- && mkdir -p /usr/src \
- && tar -xzf ruby.tar.gz -C /usr/src \
- && rm ruby.tar.gz \
- && cd /usr/src/ruby-$RUBY_VERSION \
- && { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \
- && { echo '#include <asm/ioctl.h>'; echo; cat io.c; } > io.c.new && mv io.c.new io.c \
- && autoconf \
- && ac_cv_func_isnan=yes ac_cv_func_isinf=yes ./configure --disable-install-doc \
- && make \
- && make install \
- && runDeps="$( \
- scanelf --needed --nobanner --recursive /usr/local \
- | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
- | sort -u \
- | xargs -r apk info --installed \
- | sort -u \
- )" \
- && apk add --virtual .ruby-rundeps $runDeps \
- bzip2 \
- ca-certificates \
- curl \
- libffi-dev \
- openssl-dev \
- yaml-dev \
- procps \
- zlib-dev \
- && apk del .ruby-builddeps \
- && gem update --system $RUBYGEMS_VERSION \
- && rm -r /usr/src/ruby-$RUBY_VERSION
-
-RUN apk add --no-cache git nano build-base
-
-RUN gem update --system 2.7.9
-
-RUN gem install bundler --version "$BUNDLER_VERSION" --force
-
-ENV GEM_HOME /usr/local/bundle
-ENV BUNDLE_PATH="$GEM_HOME" BUNDLE_BIN="$GEM_HOME/bin" BUNDLE_SILENCE_ROOT_WARNING=1 BUNDLE_APP_CONFIG="$GEM_HOME"
-ENV PATH $BUNDLE_BIN:$PATH
-RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" && chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
-CMD [ "irb" ]
diff --git a/README.md b/README.md
index 0dff3959..7203e679 100644
--- a/README.md
+++ b/README.md
@@ -443,7 +443,7 @@ putting the line `Pry.color = false` in your `pryrc` file.
Supported Rubies
----------------
-* CRuby >= 1.9.3
+* CRuby >= 2.0.0
* JRuby >= 1.7
Contact
diff --git a/lib/pry/warning.rb b/lib/pry/warning.rb
index 14c119ed..c65279f7 100644
--- a/lib/pry/warning.rb
+++ b/lib/pry/warning.rb
@@ -10,16 +10,9 @@ class Pry
# @param [String] message
# @return [void]
def self.warn(message)
- if Kernel.respond_to?(:caller_locations)
- location = caller_locations(2..2).first
- path = location.path
- lineno = location.lineno
- else
- # Ruby 1.9.3 support.
- frame = caller[1].split(':') # rubocop:disable Performance/Caller
- path = frame.first
- lineno = frame[1]
- end
+ location = caller_locations(2..2).first
+ path = location.path
+ lineno = location.lineno
Kernel.warn("#{path}:#{lineno}: warning: #{message}")
end
diff --git a/pry.gemspec b/pry.gemspec
index 1df03dfc..db5826d3 100644
--- a/pry.gemspec
+++ b/pry.gemspec
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
s.name = "pry"
s.version = Pry::VERSION
- s.required_ruby_version = '>= 1.9.3'
+ s.required_ruby_version = '>= 2.0'
s.authors = [
'John Mair (banisterfiend)',
diff --git a/spec/commands/edit_spec.rb b/spec/commands/edit_spec.rb
index c51cc59d..cc40bd0e 100644
--- a/spec/commands/edit_spec.rb
+++ b/spec/commands/edit_spec.rb
@@ -23,13 +23,7 @@ describe "edit" do
before do
# OS-specific tempdir name. For GNU/Linux it's "tmp", for Windows it's
# something "Temp".
- @tf_dir =
- if Pry::Helpers::Platform.mri_19?
- Pathname.new(Dir::Tmpname.tmpdir)
- else
- Pathname.new(Dir.tmpdir)
- end
-
+ @tf_dir = Pathname.new(Dir.tmpdir)
@tf_path = File.expand_path(File.join(@tf_dir.to_s, 'bar.rb'))
FileUtils.touch(@tf_path)
end
diff --git a/spec/editor_spec.rb b/spec/editor_spec.rb
index 2005bf1c..a89edfd9 100644
--- a/spec/editor_spec.rb
+++ b/spec/editor_spec.rb
@@ -6,13 +6,7 @@ describe Pry::Editor do
before do
# OS-specific tempdir name. For GNU/Linux it's "tmp", for Windows it's
# something "Temp".
- @tf_dir =
- if Pry::Helpers::Platform.mri_19?
- Pathname.new(Dir::Tmpname.tmpdir)
- else
- Pathname.new(Dir.tmpdir)
- end
-
+ @tf_dir = Pathname.new(Dir.tmpdir)
@tf_path = File.join(@tf_dir.to_s, 'hello world.rb')
@editor = Pry::Editor.new(Pry.new)