fortschritt 0.2.4 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: '0148b750db1d646ff0a91fc491453e6ead105e27'
4
- data.tar.gz: 6274fb3fdce34e26b08fa5a158577f78a5648d1e
2
+ SHA256:
3
+ metadata.gz: 410850425ce6a0416aba93fa42c7f889b084a10f945c69196b2ba1fdca08c6da
4
+ data.tar.gz: b83172478ef655c56e7931e4228d9ee1c24a0c2518ebbf0fc06c1b4bb464bdd8
5
5
  SHA512:
6
- metadata.gz: 16b8407659a26de6ae5b57e672495f7e7b46d10dcd72f91c03d2e1a40f5b32fc4752250ec879e33bc8bdaef30e5c4071488961e4f6b3aa0afa505f4a7ff25724
7
- data.tar.gz: 7b969b16cf66a7487024f90b6c81b732f132fb781b0e97fe5f2818483e5262041b08353770c543cd9d3e819cbcf4f4f306af04dd33b72b068cf240a7582f5036
6
+ metadata.gz: f4f1f157407ac01655408da4ced69b54e20989270bb24e5222cbdf73ca87e3705497825ccc20f96c231aae85c1d185aff4f873fb927139bc51c5174580663f3e
7
+ data.tar.gz: 8c4790fb62d00205e92afde33dc39b6f7ebab7700688f3c0e9baf686a73026d7f55bc8d5abf766c2f01cb48eb99ba023e30bd842187c60d150a60668b73c661d
@@ -0,0 +1,20 @@
1
+ version: 2.1
2
+
3
+ executors:
4
+ ruby:
5
+ docker:
6
+ - image: circleci/ruby
7
+
8
+ jobs:
9
+ test:
10
+ executor: ruby
11
+ steps:
12
+ - checkout
13
+ - run: bundle
14
+ - run: gem install rspec
15
+ - run: rspec
16
+
17
+ workflows:
18
+ test:
19
+ jobs:
20
+ - test
data/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2
+ Version 2, December 2004
3
+
4
+ Copyright (C) 2021 Johannes Opper <johannes.opper@gmail.com>
5
+
6
+ Everyone is permitted to copy and distribute verbatim or modified
7
+ copies of this license document, and changing it is allowed as long
8
+ as the name is changed.
9
+
10
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12
+
13
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
data/README.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Fortschritt
2
2
 
3
+ * no colors
4
+ * no config
5
+ * no tty stuff
6
+ * no terminal size calculation
7
+ * no dependencies
8
+
3
9
  ## Installation
4
10
 
5
11
  Add this line to your application's Gemfile:
@@ -44,6 +50,10 @@ end
44
50
  # won't output any progress
45
51
  ```
46
52
 
53
+ Please note, within a Rails application fortschritt will detect the `Rails.env.test?` environment and silent itself automatically.
54
+
55
+ Fortschritt will also never output anything to a non-tty STDOUT.
56
+
47
57
  ## Contributing
48
58
 
49
59
  Bug reports and pull requests are welcome on GitHub at https://github.com/xijo/fortschritt.
data/fortschritt.gemspec CHANGED
@@ -12,13 +12,14 @@ Gem::Specification.new do |spec|
12
12
  spec.summary = %q{non-fancy progress}
13
13
  spec.description = %q{non-fancy progress}
14
14
  spec.homepage = "https://github.com/xijo/fortschritt"
15
+ spec.license = "WTFPL"
15
16
 
16
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
18
  spec.bindir = "exe"
18
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
20
  spec.require_paths = ["lib"]
20
21
 
21
- spec.add_development_dependency "bundler", "~> 1.10"
22
- spec.add_development_dependency "rake", "~> 10.0"
22
+ spec.add_development_dependency "bundler", "> 1.10"
23
+ spec.add_development_dependency "rake", "~> 12.3.3"
23
24
  spec.add_development_dependency "rspec"
24
25
  end
@@ -1,6 +1,6 @@
1
1
  module Enumerable
2
- def with_fortschritt(opts = {})
3
- Fortschritt.init(size, opts)
2
+ def with_fortschritt(**opts)
3
+ Fortschritt.init(size, **opts)
4
4
  self
5
5
  end
6
6
  end
@@ -17,8 +17,8 @@ if defined?(Rails)
17
17
 
18
18
  extend ActiveSupport::Concern
19
19
 
20
- def with_fortschritt(opts = {})
21
- Fortschritt.init(size, opts)
20
+ def with_fortschritt(**opts)
21
+ Fortschritt.init(size, **opts)
22
22
  self
23
23
  end
24
24
  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.4'
2
+ VERSION = '1.0.0'
3
3
  end
data/lib/fortschritt.rb CHANGED
@@ -8,8 +8,8 @@ module Fortschritt
8
8
  @meter and @meter.increment
9
9
  end
10
10
 
11
- def self.init(total, opts = {})
12
- @meter = Fortschritt::Meter.new(total, opts)
11
+ def self.init(total, silent: false)
12
+ @meter = Fortschritt::Meter.new(total, silent: silent)
13
13
  end
14
14
 
15
15
  def self.printer
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fortschritt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 1.0.0
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: 2021-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.10'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.10'
27
27
  - !ruby/object:Gem::Dependency
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: 12.3.3
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: 12.3.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -59,10 +59,12 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - ".circleci/config.yml"
62
63
  - ".gitignore"
63
64
  - ".rspec"
64
65
  - ".travis.yml"
65
66
  - Gemfile
67
+ - LICENSE
66
68
  - README.md
67
69
  - Rakefile
68
70
  - bin/console
@@ -74,7 +76,8 @@ files:
74
76
  - lib/fortschritt/printer.rb
75
77
  - lib/fortschritt/version.rb
76
78
  homepage: https://github.com/xijo/fortschritt
77
- licenses: []
79
+ licenses:
80
+ - WTFPL
78
81
  metadata: {}
79
82
  post_install_message:
80
83
  rdoc_options: []
@@ -91,8 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
94
  - !ruby/object:Gem::Version
92
95
  version: '0'
93
96
  requirements: []
94
- rubyforge_project:
95
- rubygems_version: 2.5.2
97
+ rubygems_version: 3.1.4
96
98
  signing_key:
97
99
  specification_version: 4
98
100
  summary: non-fancy progress