update 0.4.7 → 0.4.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/update.rb +15 -14
  2. data/lib/update/version.rb +1 -1
  3. metadata +34 -60
@@ -10,26 +10,27 @@ module Update
10
10
  Update::COMMANDS.each do |together|
11
11
  together.each do |run_together|
12
12
  @commands = run_together
13
- run_in_new_thread.join { report_status }
13
+ run_in_new_thread { report_status }
14
14
  end
15
15
  end
16
16
  end
17
17
 
18
18
  private
19
19
 
20
- def run_in_new_thread
21
- Thread.new do
22
- @commands.each do |command, description|
20
+ def run_fibers
21
+ @commands.each do |command, description|
23
22
  @command, @description = command, description
24
- run_command
25
- check_exit_status
26
- printout
23
+ @fiber = Fiber.new do
24
+ run_command
25
+ check_exit_status
26
+ printout
27
+ end.resume
27
28
  end
28
- end.run
29
+ end
29
30
  end
30
31
 
31
32
  def run_command
32
- @command_output = `#{@command}`
33
+ @fiber.yield puts `#{@command}`
33
34
  end
34
35
 
35
36
  def check_exit_status
@@ -41,17 +42,17 @@ module Update
41
42
  end
42
43
 
43
44
  def printout
44
- green @description
45
- puts @command_output
46
- red @failure_report if @failure_report
45
+ @fiber.yield green @description
46
+ @fiber.yield puts @command_output
47
+ @fiber.yield red @failure_report if @failure_report
47
48
  end
48
49
 
49
50
  def report_status
50
51
  if @failed
51
- red "Update process completed with failures.\a" #chirp
52
+ @fiber.yield red "Update process completed with failures.\a" #chirp
52
53
  @failed.each { |this_failed| puts "Command failed: '#{this_failed}'" }
53
54
  else
54
- green "Update process completed successfully."
55
+ @fiber.yield green "Update process completed successfully."
55
56
  end
56
57
  end
57
58
  end
@@ -1,3 +1,3 @@
1
1
  module Update
2
- VERSION = "0.4.7"
2
+ VERSION = "0.4.8"
3
3
  end
metadata CHANGED
@@ -1,62 +1,46 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: update
3
- version: !ruby/object:Gem::Version
4
- hash: 4308009981960143868
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.8
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 4
9
- - 7
10
- version: 0.4.7
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - shan
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-01-30 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-01-31 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: slop
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70304601198440 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
18
+ requirements:
26
19
  - - ~>
27
- - !ruby/object:Gem::Version
28
- hash: 3455750172089947295
29
- segments:
30
- - 2
31
- - 4
32
- version: "2.4"
20
+ - !ruby/object:Gem::Version
21
+ version: '2.4'
33
22
  type: :development
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: slop
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70304601198440
25
+ - !ruby/object:Gem::Dependency
26
+ name: slop
27
+ requirement: &70304601197800 !ruby/object:Gem::Requirement
39
28
  none: false
40
- requirements:
29
+ requirements:
41
30
  - - ~>
42
- - !ruby/object:Gem::Version
43
- hash: 3455750172089947295
44
- segments:
45
- - 2
46
- - 4
47
- version: "2.4"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.4'
48
33
  type: :runtime
49
- version_requirements: *id002
34
+ prerelease: false
35
+ version_requirements: *70304601197800
50
36
  description: A Ruby Gem for running a list of update commands from command line.
51
- email:
37
+ email:
52
38
  - shannonskipper@gmail.com
53
- executables:
39
+ executables:
54
40
  - update
55
41
  extensions: []
56
-
57
42
  extra_rdoc_files: []
58
-
59
- files:
43
+ files:
60
44
  - .gitignore
61
45
  - Gemfile
62
46
  - README.md
@@ -68,37 +52,27 @@ files:
68
52
  - update.gemspec
69
53
  homepage: https://github.com/havenwood/update
70
54
  licenses: []
71
-
72
55
  post_install_message:
73
56
  rdoc_options: []
74
-
75
- require_paths:
57
+ require_paths:
76
58
  - lib
77
- required_ruby_version: !ruby/object:Gem::Requirement
59
+ required_ruby_version: !ruby/object:Gem::Requirement
78
60
  none: false
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- hash: 2002549777813010636
83
- segments:
84
- - 0
85
- version: "0"
86
- required_rubygems_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ! '>='
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
66
  none: false
88
- requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
91
- hash: 2002549777813010636
92
- segments:
93
- - 0
94
- version: "0"
67
+ requirements:
68
+ - - ! '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
95
71
  requirements: []
96
-
97
72
  rubyforge_project: update
98
73
  rubygems_version: 1.8.15
99
74
  signing_key:
100
75
  specification_version: 3
101
76
  summary: a gem to run a list of updates
102
77
  test_files: []
103
-
104
78
  has_rdoc: