ztk 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,53 @@
1
+ ################################################################################
2
+ #
3
+ # Author: Zachary Patten <zachary@jovelabs.com>
4
+ # Copyright: Copyright (c) Jove Labs
5
+ # License: Apache License, Version 2.0
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+ ################################################################################
20
+
21
+ require "spec_helper"
22
+
23
+ describe ZTK::Parallel do
24
+
25
+ before(:all) do
26
+ end
27
+
28
+ subject { ZTK::Parallel.new }
29
+
30
+ it "should be of kind ZTK::Parallel class" do
31
+ subject.should be_an_instance_of ZTK::Parallel
32
+ end
33
+
34
+ it "should spawn multiple processes to handle each iteration" do
35
+ 3.times do |x|
36
+ subject.process do
37
+ Process.pid
38
+ end
39
+ end
40
+ subject.waitall
41
+ puts subject.results.inspect
42
+ subject.results.all?{ |r| r.should be_kind_of Integer }
43
+ subject.results.all?{ |r| r.should > 0 }
44
+ if ENV['CI'] && ENV['TRAVIS']
45
+ # for some odd reason this is always -1 on travis-ci
46
+ subject.results.uniq.count.should == 2
47
+ else
48
+ subject.results.uniq.count.should == 3
49
+ end
50
+ subject.results.include?(Process.pid).should be false
51
+ end
52
+
53
+ end
data/ztk.gemspec CHANGED
@@ -4,8 +4,8 @@ require File.expand_path('../lib/ztk/version', __FILE__)
4
4
  Gem::Specification.new do |gem|
5
5
  gem.authors = ["Zachary Patten"]
6
6
  gem.email = ["zachary@jovelabs.com"]
7
- gem.description = %q{Zachary's Toolkit}
8
- gem.summary = %q{Contains various helper classes and utility methods I find I regularly need.}
7
+ gem.description = %q{Zachary's Tool Kit}
8
+ gem.summary = %q{Contains various classes and utilities I find I regularly need.}
9
9
  gem.homepage = "https://github.com/jovelabs/ztk"
10
10
 
11
11
  gem.files = `git ls-files`.split($\)
@@ -17,5 +17,9 @@ Gem::Specification.new do |gem|
17
17
 
18
18
  gem.add_dependency("net-ssh")
19
19
  gem.add_dependency("net-sftp")
20
+
20
21
  gem.add_development_dependency("pry")
22
+ gem.add_development_dependency("rake")
23
+ gem.add_development_dependency("rspec")
24
+ gem.add_development_dependency("simplecov")
21
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ztk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-31 00:00:00.000000000 Z
12
+ date: 2012-09-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-ssh
@@ -59,7 +59,55 @@ dependencies:
59
59
  - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
- description: Zachary's Toolkit
62
+ - !ruby/object:Gem::Dependency
63
+ name: rake
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: rspec
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: simplecov
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ description: Zachary's Tool Kit
63
111
  email:
64
112
  - zachary@jovelabs.com
65
113
  executables:
@@ -68,17 +116,23 @@ extensions: []
68
116
  extra_rdoc_files: []
69
117
  files:
70
118
  - .gitignore
71
- - .rvmrc
119
+ - .rspec
120
+ - .rvmrc.template
121
+ - .travis.yml
72
122
  - Gemfile
73
123
  - LICENSE
74
124
  - README.md
75
125
  - Rakefile
126
+ - WIKI.md
76
127
  - bin/ztk
77
128
  - lib/ztk.rb
78
129
  - lib/ztk/logger.rb
79
130
  - lib/ztk/parallel.rb
80
131
  - lib/ztk/ssh.rb
81
132
  - lib/ztk/version.rb
133
+ - spec/spec_helper.rb
134
+ - spec/ztk/logger_spec.rb
135
+ - spec/ztk/parallel_spec.rb
82
136
  - ztk.gemspec
83
137
  homepage: https://github.com/jovelabs/ztk
84
138
  licenses: []
@@ -92,16 +146,25 @@ required_ruby_version: !ruby/object:Gem::Requirement
92
146
  - - ! '>='
93
147
  - !ruby/object:Gem::Version
94
148
  version: '0'
149
+ segments:
150
+ - 0
151
+ hash: -1407580608740853160
95
152
  required_rubygems_version: !ruby/object:Gem::Requirement
96
153
  none: false
97
154
  requirements:
98
155
  - - ! '>='
99
156
  - !ruby/object:Gem::Version
100
157
  version: '0'
158
+ segments:
159
+ - 0
160
+ hash: -1407580608740853160
101
161
  requirements: []
102
162
  rubyforge_project:
103
163
  rubygems_version: 1.8.24
104
164
  signing_key:
105
165
  specification_version: 3
106
- summary: Contains various helper classes and utility methods I find I regularly need.
107
- test_files: []
166
+ summary: Contains various classes and utilities I find I regularly need.
167
+ test_files:
168
+ - spec/spec_helper.rb
169
+ - spec/ztk/logger_spec.rb
170
+ - spec/ztk/parallel_spec.rb
data/.rvmrc DELETED
@@ -1,2 +0,0 @@
1
- rvm ruby-1.9.3@ztk --create
2
- #[[ $(gem -v) != "1.4.2" ]] && rvm rubygems 1.4.2