Skip to content

Commit 774e416

Browse files
authored
Revert introduction of ActiveSupport dependency (#649)
Signed-off-by: James Couball <jcouball@yahoo.com>
1 parent b07c0f7 commit 774e416

File tree

6 files changed

+26
-91
lines changed

6 files changed

+26
-91
lines changed

README.md

Lines changed: 21 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,47 @@
33
# @title README
44
-->
55

6-
# The `git` Gem
6+
# The Git Gem
77

8-
[![Gem Version](https://badge.fury.io/rb/git.svg)](https://badge.fury.io/rb/git)
9-
[![Change Log](https://img.shields.io/badge/change%20log-Latest-green)](https://rubydoc.info/gems/git/file/CHANGELOG.md)
10-
[![Build Status](https://github.com/ruby-git/ruby-git/actions/workflows/continuous_integration.yml/badge.svg)](https://github.com/ruby-git/ruby-git/actions/workflows/continuous_integration.yml)
11-
[![Code Climate](https://codeclimate.com/github/ruby-git/ruby-git.png)](https://codeclimate.com/github/ruby-git/ruby-git)
12-
[![Source Code](https://img.shields.io/badge/source-GitHub-green)](https://github.com/ruby-git/ruby-git)
13-
[![Documentation](https://img.shields.io/badge/documentation-Latest-green)](https://rubydoc.info/gems/git)
14-
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/ruby-git/ruby-git/blob/master/LICENSE)
15-
16-
The git Gem provides an API that can be used to create, read, and manipulate
8+
The Git Gem provides an API that can be used to create, read, and manipulate
179
Git repositories by wrapping system calls to the `git` binary. The API can be
1810
used for working with Git in complex interactions including branching and
1911
merging, object inspection and manipulation, history, patch generation and
2012
more.
2113

22-
## Basic Usage
14+
## Homepage
2315

24-
Get started by obtaining a repository object by:
16+
The project source code is at:
2517

26-
* Opening an existing working copy with [Git.open](https://rubydoc.info/gems/git/Git#open-class_method)
27-
* Initializing a new repository with [Git.init](https://rubydoc.info/gems/git/Git#init-class_method)
28-
* Cloning a repository with [Git.clone](https://rubydoc.info/gems/git/Git#clone-class_method)
18+
http://github.com/ruby-git/ruby-git
2919

30-
Methods that can be called on a repository object are documented in [Git::Base](https://rubydoc.info/gems/git/Git/Base)
20+
## Documentation
3121

32-
## Install
22+
Detailed documentation can be found at:
3323

34-
You can install the `git` gem with the following command:
24+
https://rubydoc.info/gems/git/Git.html
3525

36-
```shell
37-
gem install git
38-
```
39-
40-
## Deprecation Warnings
26+
Get started by obtaining a repository object by:
4127

42-
Deprecation warnings are managed with the `Git.deprecation` attribute.
28+
* opening an existing working copy with [Git.open](https://rubydoc.info/gems/git/Git#open-class_method)
29+
* initializing a new repository with [Git.init](https://rubydoc.info/gems/git/Git#init-class_method)
30+
* cloning a repository with [Git.clone](https://rubydoc.info/gems/git/Git#clone-class_method)
4331

44-
Use this object to define deprecations in the source code:
32+
Methods that can be called on a repository object are documented in [Git::Base](https://rubydoc.info/gems/git/Git/Base)
4533

46-
```ruby
47-
Git.deprecation.deprecate_methods(Git::Branch, stashes: 'use Git::Base#stash_list instead')
48-
```
34+
## Install
4935

50-
The default action when using deprecated items (methods, classes, etc.) is to output
51-
a **DEPRECATION WARNING** to `$stderr` like the following:
36+
You can install Ruby/Git like this:
5237

53-
```text
54-
DEPRECATION WARNING: stashes is deprecated and will be removed from git 2.0.0 (use Git::Base.stash_list instead)
5538
```
56-
57-
The action taken when a deprecated item is used is defined by setting the behavior
58-
on the deprecation object:
59-
60-
```ruby
61-
# Log all deprecation warnings to $stderr (the default)
62-
Git.deprecation = :stderr
63-
64-
# Raise an ActiveSupport::DeprecationException
65-
Git.deprecation = :raise
66-
67-
# Do nothing
68-
Git.deprecation = :silence
39+
sudo gem install git
6940
```
7041

71-
See [ActiveSupport::Deprecation](https://api.rubyonrails.org/classes/ActiveSupport/Deprecation.html)
72-
for more details on how to use deprecations.
42+
## Code Status
43+
44+
* [![Build Status](https://github.com/ruby-git/ruby-git/workflows/CI/badge.svg?branch=master)](https://github.com/ruby-git/ruby-git/actions?query=workflow%3ACI)
45+
* [![Code Climate](https://codeclimate.com/github/ruby-git/ruby-git.png)](https://codeclimate.com/github/ruby-git/ruby-git)
46+
* [![Gem Version](https://badge.fury.io/rb/git.svg)](https://badge.fury.io/rb/git)
7347

7448
## Major Objects
7549

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ task :test do
1818
end
1919
default_tasks << :test
2020

21-
unless RUBY_PLATFORM == 'java' || RUBY_ENGINE == 'truffleruby'
21+
unless RUBY_PLATFORM == 'java'
2222
#
2323
# YARD documentation for this project can NOT be built with JRuby.
2424
# This project uses the redcarpet gem which can not be installed on JRuby.

git.gemspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Gem::Specification.new do |s|
2626
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to?(:required_rubygems_version=)
2727
s.requirements = ['git 1.6.0.0, or greater']
2828

29-
s.add_runtime_dependency 'activesupport', '>= 4.0.0'
3029
s.add_runtime_dependency 'addressable', '~> 2.8'
3130
s.add_runtime_dependency 'rchardet', '~> 1.8'
3231

lib/git.rb

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,7 @@
1-
require 'active_support/deprecation'
2-
3-
module Git
4-
# An object used to manage deprecations
5-
#
6-
# A ActiveSupport::Deprecation object used to manage the deprecations scheduled
7-
# to be removed in the next major release of the `git`` gem.
8-
#
9-
# @example Deprecate a method
10-
# Git.deprecation.deprecate_methods(Git::Branch, stashes: 'use Git::Base#stash_list instead')
11-
#
12-
# @example Set the deprecation behavior
13-
# # Log all deprecation warnings to $stderr (the default)
14-
# Git.deprecation.behavior = :stderr
15-
#
16-
# # Raise an ActiveSupport::DeprecationException
17-
# Git.deprecation.behavior = :raise
18-
#
19-
# # Do nothing
20-
# Git.deprecation.behavior = :raise
21-
#
22-
# @see https://api.rubyonrails.org/classes/ActiveSupport/Deprecation.html ActiveSupport::Deprecation
23-
#
24-
# @return [ActiveSupport::Deprecation]
25-
#
26-
def self.deprecation
27-
@deprecation ||= ActiveSupport::Deprecation.new('2.0.0', 'git')
28-
end
29-
end
1+
# Add the directory containing this file to the start of the load path if it
2+
# isn't there already.
3+
$:.unshift(File.dirname(__FILE__)) unless
4+
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
305

316
require 'git/author'
327
require 'git/base'

tests/test_helper.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
require "git"
77

8-
Git.deprecation.behavior = :silence
9-
108
class Test::Unit::TestCase
119

1210
TEST_ROOT = File.expand_path(__dir__)

tests/units/test_git_deprecation.rb

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)