ruby_dep 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d14a8f932140718a77fa7320dcad7cb08a773070
4
- data.tar.gz: 969284805a9cc3499b7265f86a48e02afd0eff4f
3
+ metadata.gz: a2f16307d9cd55e5f2f40793b1c087ee0ac8a8ba
4
+ data.tar.gz: aa16b2493aa7e3e475d20fac054e6a774fe34ea7
5
5
  SHA512:
6
- metadata.gz: 01a246baa7f0bdeaa701606c488c2d1f88fc32aad50eef6510e2a7142603c12969021973f42f0d858d1d034a33ea190caab3e2470f02fcda3c22eb47b0e61fae
7
- data.tar.gz: 3f541d1ce2b598453287f1b2005eeb34da2cbb25962bfdc39d7afea29e5bc467672ad35543d201f38e4116d3974b641052259921e84bb60b0952fdecf6826ac3
6
+ metadata.gz: 876b7f5ec5836d4ebca12d2849bca3dcbdd2c027664e32bbd8bd90da30c26d926aa92c6868d2be5ff552efa43273826b7b638df386e8bc740ec75defdbabb878
7
+ data.tar.gz: b7da4ef153163cb4ffc4d78ab28c4bac529de5999eb174142343ad998e4063d3d0768926375d0a292ad3bce29c798e0eb913e033e2b224e4b23a83355b9f482a
data/README.md CHANGED
@@ -2,6 +2,52 @@
2
2
 
3
3
  [![Gem Version](https://img.shields.io/gem/v/ruby_dep.svg?style=flat)](https://rubygems.org/gems/ruby_dep) [![Build Status](https://travis-ci.org/e2/ruby_dep.svg)](https://travis-ci.org/e2/ruby_dep)
4
4
 
5
+ Avoid incompatible, slower, buggier and insecure Ruby versions.
6
+
7
+ ## IMPORTANT!! : HOW TO CORRECTLY SOLVE ISSUES
8
+
9
+ If you're here because you're having issues, try the following:
10
+
11
+ ## 1. Upgrade Ruby.
12
+
13
+ Ideally to the latest stable possible. It may be a little (or very!) inconvenient, but it helps everyone in the long run.
14
+
15
+ Show the awesome Ruby Core Team your support for their work by letting them focus on newer and better Rubies.
16
+
17
+ ## 2. Upgrade Ruby anyway.
18
+
19
+ If you can't upgrade Ruby because of the environment, work out how to do so anyway.
20
+
21
+ E.g. if you can't install Ruby 2.2.5 on OSX due to RVM issues (even though Ruby 2.2.5 has been released over 5 months ago), then obviously the RVM project may need help or support of some kind. Help the RVM maintainers out - they're awesome! Or, fork the project and heroically take things into your own hands.
22
+
23
+ If Apple (or Amazon or whatever hosting service or company) doesn't provide the latest recommended, supported version of Ruby, use Homebrew (or build from sources) or complain to those companies to provide support. It's unfair for them to prevent users from getting better/faster Rubies.
24
+
25
+ ## 3. Upgrade Bundler (but even the most recent Bundler may not be enough!)
26
+
27
+ Upgrade to a Bundler version that can automatically downgrade the gems for you. If that doesn't help, try this workaround: https://github.com/guard/listen/wiki/Ruby-version-requirements
28
+
29
+ Work on this "downgrading" feature in Bundler is ongoing, so the best version of Bundler for the job may still be an unreleased version (beta, release candidate, etc.).
30
+
31
+ Help the Bundler team out if you can - they're awesome!
32
+
33
+ ## 4. If all else fails, learn SemVer and USE IT!
34
+
35
+ Often, there are older versions of gems that support the Ruby version you need. See http://semver.org/ on how to set version constraints. Then, check out the release notes of the gems you need to know what you're getting (or missing out on).
36
+
37
+ E.g. You can downgrade to RubyDep 1.3.1 (`gem 'ruby_dep', '~> 1.3.1'`) which allows using Ruby 2.2.4
38
+ E.g. Or, You can use Listen 3.0.x (`gem 'listen', '~> 3.0.8'`) to avoid dealing with RubyDep and Listen.
39
+
40
+ If those gem versions are lacking for any reason (e.g. bugs in Listen 3.0.x fixed in 3.1.x), then e.g. open a request for backporting changes to the 3.0.x branch.
41
+
42
+ The idea: if you don't need the latest Ruby ... then you probably don't need the latest of every gem either.
43
+
44
+ ## 5. If all that isn't possible or it doesn't work ...
45
+
46
+ Let me know about it (open an issue), because I'm likely confused about how all the above steps failed.
47
+
48
+ Or it's a bug I don't know about. Please report it - just in case...
49
+
50
+
5
51
  ## Description
6
52
 
7
53
  RubyDep does 2 things right now:
@@ -1,8 +1,40 @@
1
+ require 'logger'
2
+
1
3
  module RubyDep
4
+ def self.logger
5
+ @logger ||= stderr_logger
6
+ end
7
+
8
+ def self.logger=(new_logger)
9
+ @logger = new_logger.nil? ? NullLogger.new : new_logger
10
+ end
11
+
12
+ def self.stderr_logger
13
+ ::Logger.new(STDERR).tap do |logger|
14
+ logger.formatter = proc { |_,_,_,msg| "#{msg}\n" }
15
+ end
16
+ end
17
+
18
+ # Shamelessly stolen from https://github.com/karafka/null-logger
19
+ class NullLogger
20
+ LOG_LEVELS = %w(unknown fatal error warn info debug).freeze
21
+
22
+ def respond_to_missing?(method_name, include_private = false)
23
+ LOG_LEVELS.include?(method_name.to_s) || super
24
+ end
25
+
26
+ def method_missing(method_name, *args, &block)
27
+ LOG_LEVELS.include?(method_name.to_s) ? nil : super
28
+ end
29
+ end
30
+
31
+ # TODO: not used, but kept for the sake of SemVer
32
+ # TODO: remove in next major version
2
33
  class Logger
3
34
  def initialize(device, prefix)
4
35
  @device = device
5
36
  @prefix = prefix
37
+ ::RubyDep.logger.warn("The RubyDep::Logger class is deprecated")
6
38
  end
7
39
 
8
40
  def warning(msg)
@@ -1,3 +1,3 @@
1
1
  module RubyDep
2
- VERSION = '1.4.0'.freeze
2
+ VERSION = '1.5.0'.freeze
3
3
  end
@@ -27,7 +27,6 @@ module RubyDep
27
27
 
28
28
  def initialize
29
29
  @version = RubyVersion.new(RUBY_VERSION, RUBY_ENGINE)
30
- @logger = Logger.new(STDERR, PREFIX)
31
30
  end
32
31
 
33
32
  def show_warnings
@@ -53,9 +52,11 @@ module RubyDep
53
52
  end
54
53
 
55
54
  def warn_ruby(msg)
56
- @logger.warning(msg)
57
- @logger.notice(recommendation)
58
- @logger.notice(NOTICE_HOW_TO_DISABLE)
55
+ RubyDep.logger.tap do |logger|
56
+ logger.warn(PREFIX + msg)
57
+ logger.info(PREFIX + recommendation)
58
+ logger.info(PREFIX + NOTICE_HOW_TO_DISABLE)
59
+ end
59
60
  end
60
61
 
61
62
  def recommendation
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_dep
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cezary Baginski
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-03 00:00:00.000000000 Z
11
+ date: 2016-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler