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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c4ba65ee2f3daedeecec17295247c1d3f08afc3
4
- data.tar.gz: 6bab514c4ecb1b2985505d2dded6819165cb8085
3
+ metadata.gz: c64131c184915fe9d0897120ed0fb8de1b61d0f5
4
+ data.tar.gz: 0dec865aa0f75c6d89e4addf72ed0eae8e955863
5
5
  SHA512:
6
- metadata.gz: 1b5c71829738d96df595a5682a105cfac3add69a9780caebff6ce90693d8ed729bba2ac35abd75c7d9c1a0667b8eec2e5d07a2b8ccae57e802acedcfc66a3e3a
7
- data.tar.gz: c5a5ff7ee4497cc6b29399cc6ca1e22f7026238142a5b1052984b831de3cbbee5f8a4aa7ad02378cf19ea54f01584fa3501b172e7d0b93ad81b0698d3d48235e
6
+ metadata.gz: 43a9922bd181b9bcf05568e7cc7bd167ab9764760e334c9637aced0e93bff453a52c535d3f95d03a1726ff3e8044782090ba992e4d89e04fbc2d7bcd5827cb49
7
+ data.tar.gz: 7744c1cf7e43f4ec98253dd80d87bd64f2d4e14d7e5541a28cc4c43d71c2ae28658266a8e273da45af8463b9a50a6294a3b1dda48d2be719da0dbf5810f29a13
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
18
  vendor/
19
+ *.sw[po]
data/.travis.yml CHANGED
@@ -1,10 +1,19 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 2.0.0
5
- - 1.9.3
6
- - 1.9.2
7
- - ruby-head
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
@@ -1,3 +1,11 @@
1
+ ## 0.2.1 / 2014-09-12
2
+
3
+ * Improved busser/mamba/pip module console feedback
4
+
5
+ ## 0.2.0 / 2014-09-11
6
+
7
+ * Install pip if not installed before install mamba.
8
+
1
9
  ## 0.1.0 / 2014-09-06
2
10
 
3
11
  * Initial release
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)
@@ -2,7 +2,7 @@ require 'aruba/cucumber'
2
2
  require 'busser/cucumber'
3
3
 
4
4
  Before do
5
- @aruba_timeout_seconds = 20
5
+ @aruba_timeout_seconds = 60
6
6
  end
7
7
 
8
8
  After do |s|
@@ -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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Busser
4
4
  module Mamba
5
- VERSION = "0.1.0"
5
+ VERSION = '0.2.1'
6
6
  end
7
7
  end
@@ -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
- # A Busser runner plugin for Mamba.
6
- #
7
- # @author Jaime Gil de Sagredo Luna <jaimegildesagredo@gmail.com>
8
- #
9
- class Busser::RunnerPlugin::Mamba < Busser::RunnerPlugin::Base
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
- def test
15
- mamba_path = suite_path('mamba').to_s
16
- requirements_file = File.join(mamba_path, 'requirements.txt')
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
- if File.exists?(requirements_file)
19
- run!("pip install -r #{requirements_file}")
20
- end
25
+ def test
26
+ suite_path = suite_path('mamba').to_s
27
+ requirements_file = File.join(suite_path, 'requirements.txt')
21
28
 
22
- run!("mamba #{mamba_path}")
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.0
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-06 00:00:00.000000000 Z
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