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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0fd73ecc5966518ca878a8cc0f592718ecf924c
4
- data.tar.gz: 3257c2173a968f29c9f0d75ea415a120f5598686
3
+ metadata.gz: af6573ed5b4e036455e0167cbca5207eb00cd9cd
4
+ data.tar.gz: 6b8e01fad5c4a6c6c605a77f9109fb7a0333b982
5
5
  SHA512:
6
- metadata.gz: 7014eec89db667bb0302c677bea2743c26208f2c4fe4ba9a9e3d48ee1aa5e454ac1a46d8de16935068f4d43c2020eea7218a48b9e00952a38452d00e70696e80
7
- data.tar.gz: 9121477c86792c451156df5044a38b37a9e53f09ac8fb5f856a4cbf13fd5508146ca5bef4706518c8b774ef1d3ee604af9275c631b4c5686444224217ef2facf
6
+ metadata.gz: dc373ee23a8a39eaa44481991effd07ee136cbb94d7ff0907aac83276f8c9b77f4ee05c28a2efb9001f522fe53e58f68e17cdbf6a0e374eb13a1d4511aa48235
7
+ data.tar.gz: e08202031b50b48c8c1402403d6e6c51be1273ca03d7953af7acf52ec7a4de7e294541acf7a40566b20299384dcd3b73e7881d3b03bfd449f99984f09b970b64
@@ -8,5 +8,4 @@ sudo: false
8
8
  cache: bundler
9
9
  script: bundle exec rake $TASK
10
10
  env:
11
- - TASK=test
12
- - TASK=rubocop
11
+ - TASK=test_with_coveralls
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
- # Tlopo::Executor
1
+ # tlopo-retry
2
+ [![Gem Version](https://badge.fury.io/rb/tlopo-executor.svg)](http://badge.fury.io/rb/tlopo-executor)
3
+ [![Build Status](https://travis-ci.org/tlopo-ruby/tlopo-executor.svg?branch=master)](https://travis-ci.org/tlopo-ruby/tlopo-executor)
4
+ [![Code Climate](https://codeclimate.com/github/tlopo-ruby/tlopo-executor/badges/gpa.svg)](https://codeclimate.com/github/tlopo-ruby/tlopo-executor)
5
+ [![Dependency Status](https://gemnasium.com/tlopo-ruby/tlopo-executor.svg)](https://gemnasium.com/tlopo-ruby/tlopo-executor)
6
+ [![Coverage Status](https://coveralls.io/repos/github/tlopo-ruby/tlopo-executor/badge.svg?branch=master)](https://coveralls.io/github/tlopo-ruby/tlopo-executor?branch=master)
2
7
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/tlopo/executor`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- $ bundle
20
+ ```Bash
21
+ bundle
22
+ ```
18
23
 
19
24
  Or install it yourself as:
20
25
 
21
- $ gem install tlopo-executor
26
+ ```Bash
27
+ gem install tlopo-executor
28
+ ```
22
29
 
23
30
  ## Usage
24
31
 
25
- TODO: Write usage instructions here
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
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
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
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/tlopo-executor. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
-
37
- ## License
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
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
66
+ ## Tests
40
67
 
41
- ## Code of Conduct
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
- Everyone interacting in the Tlopo::Executor project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/tlopo-executor/blob/master/CODE_OF_CONDUCT.md).
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
@@ -1,5 +1,5 @@
1
1
  module Tlopo
2
2
  class Executor
3
- VERSION = '0.1.0'.freeze
3
+ VERSION = '0.1.1'.freeze
4
4
  end
5
5
  end
@@ -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.0
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-01-13 00:00:00.000000000 Z
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.6.13
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
@@ -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__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here