busser-mamba 0.1.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +13 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -0
- data/features/support/env.rb +1 -1
- data/features/test_command.feature +11 -0
- data/lib/busser/mamba/pip.rb +36 -0
- data/lib/busser/mamba/version.rb +1 -1
- data/lib/busser/runner_plugin/mamba.rb +27 -14
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c64131c184915fe9d0897120ed0fb8de1b61d0f5
|
4
|
+
data.tar.gz: 0dec865aa0f75c6d89e4addf72ed0eae8e955863
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43a9922bd181b9bcf05568e7cc7bd167ab9764760e334c9637aced0e93bff453a52c535d3f95d03a1726ff3e8044782090ba992e4d89e04fbc2d7bcd5827cb49
|
7
|
+
data.tar.gz: 7744c1cf7e43f4ec98253dd80d87bd64f2d4e14d7e5541a28cc4c43d71c2ae28658266a8e273da45af8463b9a50a6294a3b1dda48d2be719da0dbf5810f29a13
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,10 +1,19 @@
|
|
1
1
|
language: ruby
|
2
2
|
|
3
3
|
rvm:
|
4
|
-
- 2.
|
5
|
-
-
|
6
|
-
- 1.9.
|
7
|
-
-
|
4
|
+
- 2.1.0
|
5
|
+
- 2.0.0
|
6
|
+
- 1.9.3
|
7
|
+
- 1.9.2
|
8
|
+
- ruby-head
|
9
|
+
|
10
|
+
before_install:
|
11
|
+
- sudo apt-get install python-virtualenv
|
12
|
+
|
13
|
+
script:
|
14
|
+
- virtualenv .venv
|
15
|
+
- . .venv/bin/activate
|
16
|
+
- bundle exec rake
|
8
17
|
|
9
18
|
matrix:
|
10
19
|
allow_failures:
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Busser::RunnerPlugin::Mamba
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/jaimegildesagredo/busser-mamba.svg)](https://travis-ci.org/jaimegildesagredo/busser-mamba)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/busser-mamba.svg)](http://badge.fury.io/rb/busser-mamba)
|
4
5
|
|
5
6
|
A Busser runner plugin for [Mamba](https://github.com/nestorsalceda/mamba.git)
|
data/features/support/env.rb
CHANGED
@@ -35,3 +35,14 @@ Feature: Test command
|
|
35
35
|
1 examples failed of 1 ran
|
36
36
|
"""
|
37
37
|
And the exit status should not be 0
|
38
|
+
|
39
|
+
Scenario: A suite with requirements.txt file
|
40
|
+
Given a file in suite "mamba" named "requirements.txt" with:
|
41
|
+
"""
|
42
|
+
expects
|
43
|
+
"""
|
44
|
+
When I run `busser test mamba`
|
45
|
+
Then the output should contain:
|
46
|
+
"""
|
47
|
+
expects
|
48
|
+
"""
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
module Busser
|
4
|
+
module Mamba
|
5
|
+
# Common methods for pip
|
6
|
+
#
|
7
|
+
# @author Jaime Gil de Sagredo <jaimegildesagredo@gmail.com>
|
8
|
+
#
|
9
|
+
module Pip
|
10
|
+
module_function
|
11
|
+
|
12
|
+
def ensure_pip
|
13
|
+
if !pip_installed?
|
14
|
+
info '`pip` is not installed, installing ...'
|
15
|
+
f = Tempfile.new('busser-mamba', Dir.tmpdir, 'wb+')
|
16
|
+
f.write(Net::HTTP.get(URI('https://bootstrap.pypa.io/get-pip.py')))
|
17
|
+
f.flush
|
18
|
+
run!("python #{f.path}")
|
19
|
+
f.close!
|
20
|
+
info '`pip` was successfully installed.'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def pip_installed?
|
25
|
+
system('pip --version')
|
26
|
+
$?.exitstatus == 0
|
27
|
+
end
|
28
|
+
|
29
|
+
def pip_install(requirements)
|
30
|
+
cmd = "pip install #{requirements}"
|
31
|
+
info "Running #{cmd} ..."
|
32
|
+
run!(cmd)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/lib/busser/mamba/version.rb
CHANGED
@@ -1,24 +1,37 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
require 'busser/runner_plugin'
|
4
|
+
require 'busser/mamba/pip'
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
postinstall do
|
11
|
-
run!("pip install -e git+git://github.com/nestorsalceda/mamba.git#egg=mamba")
|
6
|
+
module Busser
|
7
|
+
module Thor
|
8
|
+
class BaseGroup
|
9
|
+
include Busser::Mamba::Pip
|
10
|
+
end
|
12
11
|
end
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
module RunnerPlugin
|
14
|
+
# A Busser runner plugin for Mamba.
|
15
|
+
#
|
16
|
+
# @author Jaime Gil de Sagredo Luna <jaimegildesagredo@gmail.com>
|
17
|
+
#
|
18
|
+
class Mamba < Base
|
19
|
+
postinstall do
|
20
|
+
ensure_pip
|
21
|
+
pip_install(
|
22
|
+
'-e git+git://github.com/nestorsalceda/mamba.git#egg=mamba')
|
23
|
+
end
|
17
24
|
|
18
|
-
|
19
|
-
|
20
|
-
|
25
|
+
def test
|
26
|
+
suite_path = suite_path('mamba').to_s
|
27
|
+
requirements_file = File.join(suite_path, 'requirements.txt')
|
21
28
|
|
22
|
-
|
29
|
+
if File.exists?(requirements_file)
|
30
|
+
pip_install("-r #{requirements_file}")
|
31
|
+
end
|
32
|
+
|
33
|
+
run!("mamba #{suite_path}")
|
34
|
+
end
|
35
|
+
end
|
23
36
|
end
|
24
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: busser-mamba
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jaime Gil de Sagredo Luna
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: busser
|
@@ -129,6 +129,7 @@ files:
|
|
129
129
|
- features/plugin_list_command.feature
|
130
130
|
- features/support/env.rb
|
131
131
|
- features/test_command.feature
|
132
|
+
- lib/busser/mamba/pip.rb
|
132
133
|
- lib/busser/mamba/version.rb
|
133
134
|
- lib/busser/runner_plugin/mamba.rb
|
134
135
|
homepage: https://github.com/jaimegildesagredo/busser-mamba
|