tlopo-executor 0.1.0 → 0.1.1
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 +4 -4
- data/.travis.yml +1 -2
- data/Gemfile +11 -0
- data/README.md +49 -18
- data/Rakefile +3 -0
- data/lib/tlopo/executor/version.rb +1 -1
- data/tlopo-executor.gemspec +2 -1
- metadata +18 -8
- data/bin/console +0 -14
- data/bin/setup +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af6573ed5b4e036455e0167cbca5207eb00cd9cd
|
4
|
+
data.tar.gz: 6b8e01fad5c4a6c6c605a77f9109fb7a0333b982
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc373ee23a8a39eaa44481991effd07ee136cbb94d7ff0907aac83276f8c9b77f4ee05c28a2efb9001f522fe53e58f68e17cdbf6a0e374eb13a1d4511aa48235
|
7
|
+
data.tar.gz: e08202031b50b48c8c1402403d6e6c51be1273ca03d7953af7acf52ec7a4de7e294541acf7a40566b20299384dcd3b73e7881d3b03bfd449f99984f09b970b64
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -4,3 +4,14 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in tlopo-executor.gemspec
|
6
6
|
gemspec
|
7
|
+
|
8
|
+
group :test do
|
9
|
+
gem 'coveralls', '~> 0.8.17'
|
10
|
+
gem 'simplecov', '~> 0.12.0'
|
11
|
+
end
|
12
|
+
|
13
|
+
if RUBY_VERSION > '2.1.0'
|
14
|
+
group :perf do
|
15
|
+
gem 'memory_profiler', '~> 0.9.8'
|
16
|
+
end
|
17
|
+
end
|
data/README.md
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
-
#
|
1
|
+
# tlopo-retry
|
2
|
+
[](http://badge.fury.io/rb/tlopo-executor)
|
3
|
+
[](https://travis-ci.org/tlopo-ruby/tlopo-executor)
|
4
|
+
[](https://codeclimate.com/github/tlopo-ruby/tlopo-executor)
|
5
|
+
[](https://gemnasium.com/tlopo-ruby/tlopo-executor)
|
6
|
+
[](https://coveralls.io/github/tlopo-ruby/tlopo-executor?branch=master)
|
2
7
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
8
|
+
A simple Executor service aka Threadpool executor
|
6
9
|
|
7
10
|
## Installation
|
8
11
|
|
@@ -14,30 +17,58 @@ gem 'tlopo-executor'
|
|
14
17
|
|
15
18
|
And then execute:
|
16
19
|
|
17
|
-
|
20
|
+
```Bash
|
21
|
+
bundle
|
22
|
+
```
|
18
23
|
|
19
24
|
Or install it yourself as:
|
20
25
|
|
21
|
-
|
26
|
+
```Bash
|
27
|
+
gem install tlopo-executor
|
28
|
+
```
|
22
29
|
|
23
30
|
## Usage
|
24
31
|
|
25
|
-
|
26
|
-
|
27
|
-
## Development
|
28
|
-
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
32
|
+
Simple retry usage
|
30
33
|
|
31
|
-
|
34
|
+
```ruby
|
35
|
+
require 'tlopo/executor'
|
36
|
+
require 'socket'
|
37
|
+
require 'timeout'
|
38
|
+
|
39
|
+
exec = Tlopo::Executor.new
|
40
|
+
|
41
|
+
['80','443','22'].each do |port|
|
42
|
+
exec.schedule(
|
43
|
+
proc do
|
44
|
+
begin
|
45
|
+
Timeout.timeout(1){TCPSocket.new('www.google.co.uk', port ).close}
|
46
|
+
rescue
|
47
|
+
raise "Port #{port} is not open"
|
48
|
+
end
|
49
|
+
end
|
50
|
+
)
|
51
|
+
end
|
52
|
+
errors = exec.run.errors
|
53
|
+
p errors unless exec.success?
|
54
|
+
```
|
32
55
|
|
33
56
|
## Contributing
|
34
57
|
|
35
|
-
|
36
|
-
|
37
|
-
|
58
|
+
1. Fork it ( https://github.com/[my-github-username]/kubeclient/fork )
|
59
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
60
|
+
3. Test your changes with `rake test rubocop`, add new tests if needed.
|
61
|
+
4. If you added a new functionality, add it to README
|
62
|
+
5. Commit your changes (`git commit -am 'Add some feature'`)
|
63
|
+
6. Push to the branch (`git push origin my-new-feature`)
|
64
|
+
7. Create a new Pull Request
|
38
65
|
|
39
|
-
|
66
|
+
## Tests
|
40
67
|
|
41
|
-
|
68
|
+
This library is tested with Minitest.
|
69
|
+
Please run all tests before submitting a Pull Request, and add new tests for new functionality.
|
42
70
|
|
43
|
-
|
71
|
+
Running tests:
|
72
|
+
```ruby
|
73
|
+
rake test
|
74
|
+
```
|
data/Rakefile
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
2
|
require 'rake/testtask'
|
3
3
|
require 'rubocop/rake_task'
|
4
|
+
require 'coveralls/rake/task'
|
4
5
|
|
5
6
|
task default: %i[test rubocop]
|
7
|
+
task test_with_coveralls: [:default, 'coveralls:push']
|
6
8
|
|
7
9
|
Rake::TestTask.new(:test) do |t|
|
8
10
|
t.libs << 'test'
|
@@ -11,3 +13,4 @@ Rake::TestTask.new(:test) do |t|
|
|
11
13
|
end
|
12
14
|
|
13
15
|
RuboCop::RakeTask.new
|
16
|
+
Coveralls::RakeTask.new
|
data/tlopo-executor.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
18
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
19
|
if spec.respond_to?(:metadata)
|
20
|
-
#spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
20
|
+
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
21
21
|
else
|
22
22
|
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
23
23
|
'public gem pushes.'
|
@@ -33,4 +33,5 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.add_development_dependency('bundler', '~> 1.15')
|
34
34
|
spec.add_development_dependency('minitest', '~> 5.0')
|
35
35
|
spec.add_development_dependency('rake', '~> 10.0')
|
36
|
+
spec.add_development_dependency('rubocop', '~> 0.52.1')
|
36
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tlopo-executor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tiago Lopo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,12 +52,24 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.52.1
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.52.1
|
55
69
|
description: A simple executor service aka threadpool executor
|
56
70
|
email:
|
57
71
|
- tiagolopo@yahoo.com.br
|
58
|
-
executables:
|
59
|
-
- console
|
60
|
-
- setup
|
72
|
+
executables: []
|
61
73
|
extensions: []
|
62
74
|
extra_rdoc_files: []
|
63
75
|
files:
|
@@ -69,8 +81,6 @@ files:
|
|
69
81
|
- LICENSE.txt
|
70
82
|
- README.md
|
71
83
|
- Rakefile
|
72
|
-
- bin/console
|
73
|
-
- bin/setup
|
74
84
|
- exe/tlopo-executor
|
75
85
|
- lib/tlopo/executor.rb
|
76
86
|
- lib/tlopo/executor/version.rb
|
@@ -95,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
105
|
version: '0'
|
96
106
|
requirements: []
|
97
107
|
rubyforge_project:
|
98
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.5.1
|
99
109
|
signing_key:
|
100
110
|
specification_version: 4
|
101
111
|
summary: A simple executor service aka threadpool executor
|
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'bundler/setup'
|
4
|
-
require 'tlopo/executor'
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require 'irb'
|
14
|
-
IRB.start(__FILE__)
|