console_progress_bar 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ConsoleProgressBar
2
2
 
3
- TODO: Write a gem description
3
+ You can use this gem on rake tasks, migrations or irb scripts for watching to transaction progress
4
4
 
5
5
  ## Installation
6
6
 
@@ -14,11 +14,57 @@ And then execute:
14
14
 
15
15
  Or install it yourself as:
16
16
 
17
- $ gem install console_progressbar
17
+ $ gem install console_progress_bar
18
18
 
19
19
  ## Usage
20
+ For counter usage:
20
21
 
21
- TODO: Write usage instructions here
22
+ pbar = ConsoleProgressBar::ProgressBar.new
23
+ counter = pbar.counter
24
+ 100.times do
25
+ sleep(0.1)
26
+ counter.increase
27
+ end
28
+
29
+ # advanced usage of counter object
30
+ # total parameter is counts of your total transactions
31
+ # you can show elapsed time by setting with_elapsed_time parameter to true
32
+ # you can show calculated time remaining by setting with_remaining_time parameter to true
33
+ # increament_size parameter sets to increament size
34
+ counter = pbar.counter(:total => 100, :with_elapsed_time => true, :with_remaining_time => true, :increament_size => 5)
35
+
36
+ For animation usage:
37
+
38
+ pbar = ConsoleProgressBar::ProgressBar.new
39
+ animator = pbar.animator
40
+ 100.times do
41
+ sleep(0.1)
42
+ animator.animate
43
+ end
44
+
45
+ # advanced usage of animator object
46
+ # total parameter is counts of your total transactions
47
+ # you can show elapsed time by setting with_elapsed_time parameter to true
48
+ # you can show calculated time remaining by setting with_remaining_time parameter to true
49
+ # increament_size parameter sets to increament size
50
+ animator = pbar.animator(:total => 100, :with_elapsed_time => true, :with_remaining_time => true, :increament_size => 5)
51
+
52
+ For progressbar usage:
53
+
54
+ pbar = ConsoleProgressBar::ProgressBar.new
55
+ bar = pbar.bar
56
+ 100.times do
57
+ sleep(0.1)
58
+ bar.draw
59
+ end
60
+
61
+ # advanced usage of bar object
62
+ # total parameter is counts of your total transactions
63
+ # you can show elapsed time by setting with_elapsed_time parameter to true
64
+ # you can show calculated time remaining by setting with_remaining_time parameter to true
65
+ # increament_size parameter sets to increament size
66
+ # width parameter is width of shown progress bar
67
+ bar = pbar.bar(:total => 100, :with_elapsed_time => true, :with_remaining_time => true, :increament_size => 5, :width => 40)
22
68
 
23
69
  ## Contributing
24
70
 
@@ -17,7 +17,7 @@ module ConsoleProgressBar
17
17
  @output += " "
18
18
  end
19
19
  @output_length = @output.length
20
- print @output
20
+ print @output + "\n"
21
21
  end
22
22
 
23
23
  end
@@ -1,3 +1,3 @@
1
1
  module ConsoleProgressBar
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -1,9 +1,9 @@
1
- require_relative "console_progress_bar/version"
2
- require_relative "console_progress_bar/print_tools"
3
- require_relative "console_progress_bar/extras"
4
- require_relative "console_progress_bar/counter"
5
- require_relative "console_progress_bar/animator"
6
- require_relative "console_progress_bar/bar"
1
+ require "console_progress_bar/version"
2
+ require "console_progress_bar/print_tools"
3
+ require "console_progress_bar/extras"
4
+ require "console_progress_bar/counter"
5
+ require "console_progress_bar/animator"
6
+ require "console_progress_bar/bar"
7
7
 
8
8
  module ConsoleProgressBar
9
9
 
metadata CHANGED
@@ -1,57 +1,55 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: console_progress_bar
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 1
9
- version: 0.0.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
12
- - "Mehmet Emin \xC4\xB0NA\xC3\x87"
7
+ authors:
8
+ - Mehmet Emin İNAÇ
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2013-10-25 00:00:00 +03:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2013-10-25 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: bundler
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
25
19
  - - ~>
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 1
29
- - 3
30
- version: "1.3"
20
+ - !ruby/object:Gem::Version
21
+ version: '1.3'
31
22
  type: :development
32
- version_requirements: *id001
33
- - !ruby/object:Gem::Dependency
34
- name: rake
35
23
  prerelease: false
36
- requirement: &id002 !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- segments:
41
- - 0
42
- version: "0"
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '1.3'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
43
38
  type: :development
44
- version_requirements: *id002
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
45
46
  description: useful progress bar gem for console usage
46
- email:
47
+ email:
47
48
  - mehmetemininac@gmail.com
48
49
  executables: []
49
-
50
50
  extensions: []
51
-
52
51
  extra_rdoc_files: []
53
-
54
- files:
52
+ files:
55
53
  - .gitignore
56
54
  - Gemfile
57
55
  - LICENSE.txt
@@ -65,35 +63,31 @@ files:
65
63
  - lib/console_progress_bar/extras.rb
66
64
  - lib/console_progress_bar/print_tools.rb
67
65
  - lib/console_progress_bar/version.rb
68
- has_rdoc: true
69
66
  homepage: http://github.com/mehmetemininac/progressbar
70
- licenses:
67
+ licenses:
71
68
  - MIT
72
69
  post_install_message:
73
70
  rdoc_options: []
74
-
75
- require_paths:
71
+ require_paths:
76
72
  - lib
77
- required_ruby_version: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- segments:
82
- - 0
83
- version: "0"
84
- required_rubygems_version: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- segments:
89
- - 0
90
- version: "0"
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ required_rubygems_version: !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ! '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
91
85
  requirements: []
92
-
93
86
  rubyforge_project:
94
- rubygems_version: 1.3.6
87
+ rubygems_version: 1.8.24
95
88
  signing_key:
96
89
  specification_version: 3
97
- summary: Progress bar implementation for console scripts which you can show elapsed time and remaining time with animation or progressbar or current percent of total transactions
90
+ summary: Progress bar implementation for console scripts which you can show elapsed
91
+ time and remaining time with animation or progressbar or current percent of total
92
+ transactions
98
93
  test_files: []
99
-