tod-travis 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/README.md +3 -1
- data/lib/tod/executor.rb +15 -6
- data/lib/tod/result.rb +3 -3
- data/lib/tod/runner.rb +1 -3
- data/lib/tod/version.rb +1 -1
- metadata +2 -3
- data/TODO.md +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d00e00ac4149bb084cff31242ead9b448a2a5755
|
4
|
+
data.tar.gz: 738a0bc4d726cc37acef41e9258912ea768ab21f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14a7144eb7902358d182b90ccd2da748c0b0999ea1a5450011dd2ca5bb4378cd2c1f7341bfda2ec6d760fe714140098423a6f776c4fbbfc8072dd1b87274c847
|
7
|
+
data.tar.gz: 1b99ea48bd87712b638ad4bc18e9267c46c6fad9b28377e4d39016f78c74f2430ef3cbd9f53cf063190a73039cb4d02275284ac92ea177018bc78eba235d1dd6
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Tod
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/mckomo/tod.svg?branch=master)](https://travis-ci.org/mckomo/tod) [![Code Climate](https://codeclimate.com/github/mckomo/tod/badges/gpa.svg)](https://codeclimate.com/github/mckomo/tod)
|
4
|
+
|
3
5
|
Tod runs commands from your `.travis.yml` file. Type `tod` instead of `docker run -v $(pwd):/my-app -it my-app some-tests` to run your tests
|
4
6
|
|
5
7
|
## Installation
|
@@ -7,7 +9,7 @@ Tod runs commands from your `.travis.yml` file. Type `tod` instead of `docker ru
|
|
7
9
|
Install it yourself simply as:
|
8
10
|
|
9
11
|
```bash
|
10
|
-
$ gem install tod
|
12
|
+
$ gem install tod-travis
|
11
13
|
```
|
12
14
|
|
13
15
|
Check the installation with following:
|
data/lib/tod/executor.rb
CHANGED
@@ -1,14 +1,23 @@
|
|
1
|
+
require 'open3'
|
2
|
+
|
1
3
|
module Tod
|
2
4
|
class Executor
|
3
5
|
|
4
|
-
def execute(command)
|
5
|
-
|
6
|
+
def execute(command, &block)
|
7
|
+
process = Open3.popen2e("#{command}") do |stdin, stdoe, wait_thread|
|
8
|
+
read_thread(stdoe, &block).join
|
9
|
+
wait_thread.value
|
10
|
+
end
|
11
|
+
|
12
|
+
Result.new(process.exitstatus)
|
13
|
+
end
|
6
14
|
|
7
|
-
|
8
|
-
f.close
|
9
|
-
code = $?.exitstatus
|
15
|
+
private
|
10
16
|
|
11
|
-
|
17
|
+
def read_thread(stream)
|
18
|
+
Thread.new do
|
19
|
+
stream.each { |line| yield(line) if block_given? }
|
20
|
+
end
|
12
21
|
end
|
13
22
|
|
14
23
|
end
|
data/lib/tod/result.rb
CHANGED
data/lib/tod/runner.rb
CHANGED
@@ -15,9 +15,7 @@ module Tod
|
|
15
15
|
|
16
16
|
@travis.section(section).each do |command|
|
17
17
|
|
18
|
-
result = @executor.execute(command)
|
19
|
-
|
20
|
-
puts result.output unless result.output.empty?
|
18
|
+
result = @executor.execute(command) { |line| puts line }
|
21
19
|
|
22
20
|
if result.error?
|
23
21
|
return result.code
|
data/lib/tod/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tod-travis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mckomo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -95,7 +95,6 @@ files:
|
|
95
95
|
- Gemfile
|
96
96
|
- LICENSE
|
97
97
|
- README.md
|
98
|
-
- TODO.md
|
99
98
|
- exe/tod
|
100
99
|
- lib/tod.rb
|
101
100
|
- lib/tod/executor.rb
|
data/TODO.md
DELETED