progress-bar 0.1.0 → 0.2.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: 15e1e7a3da698b5115471ff04c861b171b0aac26
4
- data.tar.gz: 1898796322af4e0e101f1bd9c6fe329e8eed5cdb
3
+ metadata.gz: 9ee00bdd00686cd7974a76d943cfb0c93faf8514
4
+ data.tar.gz: 99fb955b4cf3873c1d8b905ee966ac10c9658817
5
5
  SHA512:
6
- metadata.gz: a0005cbbcbc1221ea8bb919d4bd3e4a9370b9485fbbe3296c7e414b2a919520f740bf56ba7bc571e4281e56593538d71f2aa12b5cdbc6eab2654470aed60e4ef
7
- data.tar.gz: f573844f75ca253a7f4afe4472aa2768fe9cfc3c2464327136b014d0f831a5b1b7825bece437086e0bf1b979050e3d8bb745f28543c532fff88238581769573b
6
+ metadata.gz: 63f37da19bc5852e1644d8bed571749ddacfd464db7954343543c169eaa7266cc7f35e3bb7fc291a9a89a22dfb37da779d99cef5f38ca69dc595c77dea9eab98
7
+ data.tar.gz: c0c62ec8a6a97435dff5c2e869b5fcdd76df0c5cb6effea66d8df2dcffd22f3fbc54bab3caad1e2eb4a1635714b6ee6ddfac5bd497fc30c747d609b71309b714
data/README.md ADDED
@@ -0,0 +1,23 @@
1
+ ProgressBar
2
+ ===========
3
+
4
+ Usage
5
+ =====
6
+
7
+ This example will use your Terminal, if possible.
8
+ If your program will be started without a Terminal,
9
+ it will use kdialog for display a window.
10
+
11
+ pb = ProgressBar.new 100, 'Initial Text...'
12
+ pb.i += 5
13
+ pb.inc! 5
14
+ pb.text = 'Something different'
15
+ pb.inc! 20
16
+ pb.text = 'Second phase'
17
+ pb.inc! 60
18
+ pb.text = 'Last Steps'
19
+ pb.inc! 20
20
+ pb.text = 'Done!'
21
+
22
+ If you want to force to use kdialog use ProgressBar::KDialog.new or
23
+ if you want to use your Console, use ProgressBar::Console.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
data/lib/progress-bar.rb CHANGED
@@ -1,6 +1,18 @@
1
1
  require 'dbus'
2
2
 
3
- class Progress
3
+ module ProgressBar
4
+ def self.new *a
5
+ if STDERR.tty?
6
+ Console.new *a
7
+ elsif 'KDE' == ENV['XDG_CURRENT_DESKTOP']
8
+ KDialog.new *a
9
+ else
10
+ KDialog.new *a
11
+ end
12
+ end
13
+ end
14
+
15
+ class ProgressBar::Base
4
16
  attr_reader :max, :i, :text, :error
5
17
  attr_accessor :start
6
18
  def initialize max = nil, text = nil
@@ -38,7 +50,7 @@ class Progress
38
50
  def finish() end
39
51
  end
40
52
 
41
- class ConsoleProgress < Progress
53
+ class ProgressBar::Console < ProgressBar::Base
42
54
  def initialize *a
43
55
  super *a
44
56
  change_text
@@ -65,7 +77,7 @@ class ConsoleProgress < Progress
65
77
  end
66
78
  end
67
79
 
68
- class KDialogProgress < Progress
80
+ class ProgressBar::KDialog < ProgressBar::Base
69
81
  attr_reader :dialog_service_path, :dialog_object_path, :errors, :dialog_object
70
82
  def initialize *a
71
83
  super *a
data/progress-bar.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "progress-bar"
8
- s.version = "0.1.0"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Denis Knauf"]
@@ -14,14 +14,14 @@ Gem::Specification.new do |s|
14
14
  s.email = "\#{\"de\"}nis@denkn.at"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
- "README.rdoc"
17
+ "README.md"
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
21
  "Gemfile",
22
22
  "Gemfile.lock",
23
23
  "LICENSE.txt",
24
- "README.rdoc",
24
+ "README.md",
25
25
  "Rakefile",
26
26
  "VERSION",
27
27
  "lib/progress-bar.rb",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: progress-bar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Knauf
@@ -100,13 +100,13 @@ executables: []
100
100
  extensions: []
101
101
  extra_rdoc_files:
102
102
  - LICENSE.txt
103
- - README.rdoc
103
+ - README.md
104
104
  files:
105
105
  - .document
106
106
  - Gemfile
107
107
  - Gemfile.lock
108
108
  - LICENSE.txt
109
- - README.rdoc
109
+ - README.md
110
110
  - Rakefile
111
111
  - VERSION
112
112
  - lib/progress-bar.rb
data/README.rdoc DELETED
@@ -1,19 +0,0 @@
1
- = progress-bar
2
-
3
- Description goes here.
4
-
5
- == Contributing to progress-bar
6
-
7
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
9
- * Fork the project.
10
- * Start a feature/bugfix branch.
11
- * Commit and push until you are happy with your contribution.
12
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
-
15
- == Copyright
16
-
17
- Copyright (c) 2014 Denis Knauf. See LICENSE.txt for
18
- further details.
19
-