fortschritt 0.2.5 → 0.2.6

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: 74932b8ccbd6ec7f920e178b7c7fa1a7ca599ea5
4
- data.tar.gz: 641162f83d4244c035ef46327ce3e8a5af76fd0d
3
+ metadata.gz: 382ac11558dc49a6e06feada424773a35514dc15
4
+ data.tar.gz: 5ab2a1e062c63ca84f8164ac7bd3349a57d9c985
5
5
  SHA512:
6
- metadata.gz: a88d5d348cce61cd8c7d8f3a37bfc73ee695dcad70b305a1b6034921f96e38536cf94f88911194fda6e8118b068e971d2da1008be18a2cbbbb45b299dbf9bf48
7
- data.tar.gz: b1a9468af741af3d734457ea62f7bfcfe723e27a6466e3cc4db9c496cf5815fb52090ad1d520177fb522aa5b9feae8a3700fab5754308c4cd69903ca0cf52f7c
6
+ metadata.gz: 5fce85c767c1e359e443c111bdc310648b031f40262031d34e2f5ccfd01f6d43fbab1c291e3ffb39f28029e951d0c46086b4d1d80d4f4a2980f6d9da949ae609
7
+ data.tar.gz: de9ae32d0a5a65ab10446cfa8ee1e7056faa4fd4aa26de3544d4067729a8f00a16842740f27540d9a4e426bbe4ba982d79e331cbcadefcbe267089f8aacb146e
data/README.md CHANGED
@@ -44,6 +44,10 @@ end
44
44
  # won't output any progress
45
45
  ```
46
46
 
47
+ Please note, within a Rails application fortschritt will detect the `Rails.env.test?` environment and silent itself automatically.
48
+
49
+ Fortschritt will also never output anything to a non-tty STDOUT.
50
+
47
51
  ## Contributing
48
52
 
49
53
  Bug reports and pull requests are welcome on GitHub at https://github.com/xijo/fortschritt.
@@ -17,11 +17,7 @@ if defined?(Rails)
17
17
 
18
18
  extend ActiveSupport::Concern
19
19
 
20
- # Silence fortschritt in tests and in non-terminal context
21
20
  def with_fortschritt(opts = {})
22
- unless opts.has_key?(:silent)
23
- opts[:silent] = Rails.env.test? || !STDOUT.tty?
24
- end
25
21
  Fortschritt.init(size, opts)
26
22
  self
27
23
  end
@@ -8,7 +8,7 @@ module Fortschritt
8
8
  @updated_at = Time.now
9
9
  @average_seconds = 0
10
10
  @started_at = Time.now
11
- @silent = silent
11
+ @silent = silent || !!(Rails.env.test? if defined?(Rails))
12
12
  end
13
13
 
14
14
  def increment
@@ -1,7 +1,7 @@
1
1
  module Fortschritt
2
2
  class Printer
3
3
  def print(meter, stream = STDOUT)
4
- stream.print output(meter)
4
+ stream.print output(meter) if stream.tty?
5
5
  end
6
6
 
7
7
  def output(meter)
@@ -1,3 +1,3 @@
1
1
  module Fortschritt
2
- VERSION = '0.2.5'
2
+ VERSION = '0.2.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fortschritt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Opper
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-18 00:00:00.000000000 Z
11
+ date: 2016-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler