guard-pytest 0.0.1 → 0.1.0

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: 14d712028e12963543d1f0f3fc59e4785119cedf
4
- data.tar.gz: f1b571dd0206e6629781c10376493e1a759352cb
3
+ metadata.gz: fe77d15a4bb98b932e55714c3bd83d4500b88cc8
4
+ data.tar.gz: 19bc98da187ab8b90008ae8e663cc79ed4b36bc8
5
5
  SHA512:
6
- metadata.gz: e497586d492dd8988c4859b26d7bdc6165f135a70400e19afd115bdf580f8a10ee0531965a260b81e8bbff4a093f758cd1b2ac36cf88a62ef3d3f50778780fe3
7
- data.tar.gz: 43b47fae91996f298418b3cd4f5f130b7b5ef9a0c9aaa094b0afcdab36c9249be9f49d143918c0ccc3bd01e363417f469a50c3a989000e11460ffa8f083b3676
6
+ metadata.gz: e07c285d6ead14fd6c837c1c0162aa5c5c8bdc898d2ad5031a4b88244c6572cd287d9d46b758fb076879abcc72f7a12094b0d230f71aa59879ba1cca91aca0a0
7
+ data.tar.gz: 3b09b3b6012dd06b19ee7a9745bfa8389129517177972a196b094d5ec482980f9f39f855f0494d18557fcc8b1c73fd156cafe7e20cbd0d310741bffa5620a286
data/.gitignore CHANGED
@@ -1,22 +1,10 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- *.bundle
19
- *.so
20
- *.o
21
- *.a
22
- mkmf.log
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.pyc
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
4
+ before_install:
5
+ - sudo pip install -r requirements.txt
6
+ - gem install bundler -v 1.10.5
7
+ script:
8
+ - bundle exec rspec
9
+ - bundle exec guard init
10
+ - gem build guard-pytest.gemspec
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/LICENSE.txt CHANGED
@@ -1,22 +1,21 @@
1
- Copyright (c) 2014 Ishibashi Kazufusa
1
+ The MIT License (MIT)
2
2
 
3
- MIT License
3
+ Copyright (c) 2015 kazufusa
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
12
11
 
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
15
14
 
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -21,7 +21,7 @@ Or install it yourself as:
21
21
  ## Usage
22
22
 
23
23
  ```ruby
24
- guard :pytest, tb: 'line', q: true do
24
+ guard :pytest, pytest_option: "--doctest-modules --color=yes" do
25
25
  watch(%r{^((?!test/).*)\.py$}) {|m| "test/#{m[1]}_test.py" }
26
26
  watch(%r{^test/.*_test\.py$})
27
27
  end
@@ -29,8 +29,9 @@ end
29
29
 
30
30
  ## Contributing
31
31
 
32
- 1. Fork it ( https://github.com/[my-github-username]/guard-pytest/fork )
33
- 2. Create your feature branch (`git checkout -b my-new-feature`)
34
- 3. Commit your changes (`git commit -am 'Add some feature'`)
35
- 4. Push to the branch (`git push origin my-new-feature`)
36
- 5. Create a new Pull Request
32
+ Bug reports and pull requests are welcome on GitHub at https://github.com/kazufusa/guard-pytest. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
33
+
34
+ ## License
35
+
36
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
37
+
data/Rakefile CHANGED
@@ -1,2 +1,5 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
+ require "rspec/core/rake_task"
4
+ RSpec::Core::RakeTask.new(:spec)
5
+ task default: :spec
data/guard-pytest.gemspec CHANGED
@@ -1,22 +1,30 @@
1
1
  # coding: utf-8
2
- $:.push File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
4
  require 'guard/pytest/version'
4
5
 
5
- Gem::Specification.new do |s|
6
- s.name = "guard-pytest"
7
- s.version = Guard::Pytest::VERSION
8
- s.authors = ["kazufusa"]
9
- s.email = ["kazu.jiyuunosenshi.fusa@gmail.com"]
10
- s.homepage = "https://github.com/kazufusa/guard-pytest"
11
- s.summary = 'Guard gem for Pytest'
12
- s.description = <<-DESC
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "guard-pytest"
8
+ spec.version = Guard::PytestVersion::VERSION
9
+ spec.authors = ["kazufusa"]
10
+ spec.email = ["kazu.jiyuunosenshi.fusa@gmail.com"]
11
+
12
+ spec.summary = 'Guard gem for Pytest'
13
+ spec.description = <<-DESC
13
14
  Guard::Pytest automatically runs Pytest when watched files are modified.
14
15
  DESC
15
- s.license = "MIT"
16
+ spec.homepage = "https://github.com/kazufusa/guard-pytest"
17
+ spec.license = "MIT"
18
+
19
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ spec.bindir = "exe"
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ["lib"]
16
23
 
17
- s.files = `git ls-files -z`.split("\x0")
18
- s.require_paths = ["lib"]
24
+ spec.add_dependency 'guard', '~> 2.12'
25
+ spec.add_dependency 'guard-compat', '~> 1.2'
19
26
 
20
- s.add_dependency 'guard', '>= 1.1.0'
21
- s.add_development_dependency "bundler", "~> 1.6"
27
+ spec.add_development_dependency "bundler", "~> 1.10"
28
+ spec.add_development_dependency "rake", "~> 10.0"
29
+ spec.add_development_dependency 'rspec', "~> 3.0"
22
30
  end
data/lib/guard/pytest.rb CHANGED
@@ -1,28 +1,29 @@
1
- require 'guard'
2
- require 'guard/guard'
1
+ require 'guard/compat/plugin'
2
+ require 'guard/pytest/version'
3
3
 
4
4
  module Guard
5
- class Pytest < Guard
6
- def initialize(watchers = [], options = {})
7
- @option = options.map do |k, v|
8
- if v == true
9
- "#{'-'*(k.length>1? 2: 1) }#{k}"
10
- elsif v.is_a? String
11
- "#{'-'*(k.length>1? 2: 1) }#{k}=#{v}"
12
- end
13
- end.join ' '
14
-
5
+ class Pytest < Plugin
6
+ def initialize(options = {})
15
7
  super
16
8
  end
17
9
 
18
- def run_all
19
- system "py.test #{@option}"
10
+ def start
11
+ end
12
+
13
+ def stop
20
14
  end
21
15
 
22
- def run_on_change(paths)
23
- grouped_paths = paths.group_by{|path| File.exist? path}
16
+ def reload
17
+ end
18
+
19
+ def run_all
20
+ $stdout.puts `py.test #{options[:pytest_option]}`
21
+ true
22
+ end
24
23
 
25
- system "py.test #{@option} #{grouped_paths[true].join ' '}" if grouped_paths[true]
24
+ def run_on_modifications(paths)
25
+ $stdout.puts `py.test #{options[:pytest_option]} #{paths.join ' '}`
26
+ true
26
27
  end
27
28
 
28
29
  end
@@ -1,7 +1,7 @@
1
1
  # Add files and commands to this file, like the example:
2
2
  # watch(%r{file/path}) { target test file/path }
3
3
  #
4
- guard :pytest, tb: 'line', q: true do
4
+ guard :pytest, pytest_option: "--doctest-modules -q --color=yes" do
5
5
  watch(%r{^((?!test/).*)\.py$}) {|m| "test/#{m[1]}_test.py" }
6
6
  watch(%r{^test/.*_test\.py$})
7
7
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
- module Pytest
3
- VERSION = "0.0.1"
2
+ class PytestVersion
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
data/requirements.txt ADDED
@@ -0,0 +1 @@
1
+ pytest
metadata CHANGED
@@ -1,45 +1,86 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-pytest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kazufusa
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2014-10-20 00:00:00.000000000 Z
11
+ date: 2015-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.12'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: guard-compat
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
18
32
  - !ruby/object:Gem::Version
19
- version: 1.1.0
33
+ version: '1.2'
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
- - - ">="
38
+ - - "~>"
25
39
  - !ruby/object:Gem::Version
26
- version: 1.1.0
40
+ version: '1.2'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: '1.6'
47
+ version: '1.10'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.10'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.0'
34
76
  type: :development
35
77
  prerelease: false
36
78
  version_requirements: !ruby/object:Gem::Requirement
37
79
  requirements:
38
80
  - - "~>"
39
81
  - !ruby/object:Gem::Version
40
- version: '1.6'
41
- description: |2
42
- Guard::Pytest automatically runs Pytest when watched files are modified.
82
+ version: '3.0'
83
+ description: " Guard::Pytest automatically runs Pytest when watched files are modified.\n"
43
84
  email:
44
85
  - kazu.jiyuunosenshi.fusa@gmail.com
45
86
  executables: []
@@ -47,6 +88,9 @@ extensions: []
47
88
  extra_rdoc_files: []
48
89
  files:
49
90
  - ".gitignore"
91
+ - ".rspec"
92
+ - ".travis.yml"
93
+ - CODE_OF_CONDUCT.md
50
94
  - Gemfile
51
95
  - LICENSE.txt
52
96
  - README.md
@@ -55,6 +99,7 @@ files:
55
99
  - lib/guard/pytest.rb
56
100
  - lib/guard/pytest/templates/Guardfile
57
101
  - lib/guard/pytest/version.rb
102
+ - requirements.txt
58
103
  homepage: https://github.com/kazufusa/guard-pytest
59
104
  licenses:
60
105
  - MIT
@@ -75,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
120
  version: '0'
76
121
  requirements: []
77
122
  rubyforge_project:
78
- rubygems_version: 2.2.2
123
+ rubygems_version: 2.4.8
79
124
  signing_key:
80
125
  specification_version: 4
81
126
  summary: Guard gem for Pytest