guard-mutant 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +6 -0
- data/Gemfile.devtools +62 -0
- data/Rakefile +2 -0
- data/TODO +4 -0
- data/config/devtools.yml +2 -0
- data/config/flay.yml +3 -0
- data/config/flog.yml +2 -0
- data/config/mutant.yml +3 -0
- data/config/reek.yml +101 -0
- data/config/yardstick.yml +2 -0
- data/guard-mutant.gemspec +18 -0
- data/lib/guard-mutant.rb +1 -0
- data/lib/guard/mutant.rb +37 -0
- data/spec/spec_helper.rb +5 -0
- metadata +102 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 94306cebc981553d4ccb81b8681c323633c66496
|
4
|
+
data.tar.gz: 29f9ea78a0c62bc148338cd18cad2d676bbe33c6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d27f070737a327a7c4c064b460610dc6215a7928da4dff31c839b65b61cb7eddc2846e5b9eadd38e7690565659baac7f7c749896c9f9a35637b2a4fb0052c946
|
7
|
+
data.tar.gz: 6ab49b03fc0b85d957d6123ab15a0fe2e69099d71f73ca5681c65fc414a75e1a839f2d2cd9a01f1a8786b69643880dc3f1298d72d03f36ea7626f288137f4a4b
|
data/Gemfile
ADDED
data/Gemfile.devtools
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
group :development do
|
4
|
+
gem 'rake', '~> 10.1.0'
|
5
|
+
gem 'rspec', '~> 2.14.1'
|
6
|
+
gem 'yard', '~> 0.8.6.2'
|
7
|
+
end
|
8
|
+
|
9
|
+
group :yard do
|
10
|
+
gem 'kramdown', '~> 1.1.0'
|
11
|
+
end
|
12
|
+
|
13
|
+
group :guard do
|
14
|
+
gem 'guard', '~> 1.8.1'
|
15
|
+
gem 'guard-bundler', '~> 1.0.0'
|
16
|
+
gem 'guard-rspec', '~> 3.0.2'
|
17
|
+
gem 'guard-rubocop', '~> 0.2.0'
|
18
|
+
|
19
|
+
# file system change event handling
|
20
|
+
gem 'listen', '~> 1.2.2'
|
21
|
+
gem 'rb-fchange', '~> 0.0.6', :require => false
|
22
|
+
gem 'rb-fsevent', '~> 0.9.3', :require => false
|
23
|
+
gem 'rb-inotify', '~> 0.9.0', :require => false
|
24
|
+
|
25
|
+
# notification handling
|
26
|
+
gem 'libnotify', '~> 0.8.0', :require => false
|
27
|
+
gem 'rb-notifu', '~> 0.0.4', :require => false
|
28
|
+
gem 'terminal-notifier-guard', '~> 1.5.3', :require => false
|
29
|
+
end
|
30
|
+
|
31
|
+
group :metrics do
|
32
|
+
gem 'coveralls', '~> 0.6.7'
|
33
|
+
gem 'flay', '~> 2.3.1'
|
34
|
+
gem 'flog', '~> 4.1.1'
|
35
|
+
gem 'reek', '~> 1.3.1', :git => 'https://github.com/troessner/reek.git'
|
36
|
+
gem 'rubocop', '~> 0.9.1', :git => 'https://github.com/bbatsov/rubocop.git'
|
37
|
+
gem 'simplecov', '~> 0.7.1'
|
38
|
+
gem 'yardstick', '~> 0.9.6'
|
39
|
+
|
40
|
+
platforms :ruby_19, :ruby_20 do
|
41
|
+
gem 'mutant', '~> 0.3.0.beta15'
|
42
|
+
gem 'yard-spellcheck', '~> 0.1.5'
|
43
|
+
end
|
44
|
+
|
45
|
+
platforms :ruby_19 do
|
46
|
+
gem 'json', '~> 1.8.0'
|
47
|
+
end
|
48
|
+
|
49
|
+
platforms :rbx do
|
50
|
+
gem 'pelusa', '~> 0.2.2'
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
group :benchmarks do
|
55
|
+
gem 'rbench', '~> 0.2.3'
|
56
|
+
end
|
57
|
+
|
58
|
+
platform :jruby do
|
59
|
+
group :jruby do
|
60
|
+
gem 'jruby-openssl', '~> 0.8.5'
|
61
|
+
end
|
62
|
+
end
|
data/Rakefile
ADDED
data/TODO
ADDED
data/config/devtools.yml
ADDED
data/config/flay.yml
ADDED
data/config/flog.yml
ADDED
data/config/mutant.yml
ADDED
data/config/reek.yml
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
---
|
2
|
+
UnusedParameters:
|
3
|
+
exclude: []
|
4
|
+
UncommunicativeParameterName:
|
5
|
+
accept: []
|
6
|
+
exclude: []
|
7
|
+
enabled: true
|
8
|
+
reject:
|
9
|
+
- !ruby/regexp /^.$/
|
10
|
+
- !ruby/regexp /[0-9]$/
|
11
|
+
- !ruby/regexp /[A-Z]/
|
12
|
+
TooManyInstanceVariables:
|
13
|
+
exclude: []
|
14
|
+
enabled: true
|
15
|
+
max_instance_variables: 3
|
16
|
+
TooManyMethods:
|
17
|
+
exclude:
|
18
|
+
- Unparser::Emitter # TODO: 13 methods, mostly helpers for deduplicate sublcasses
|
19
|
+
enabled: true
|
20
|
+
max_methods: 10
|
21
|
+
UncommunicativeMethodName:
|
22
|
+
accept: []
|
23
|
+
exclude: []
|
24
|
+
enabled: true
|
25
|
+
reject:
|
26
|
+
- !ruby/regexp /^[a-z]$/
|
27
|
+
- !ruby/regexp /[0-9]$/
|
28
|
+
- !ruby/regexp /[A-Z]/
|
29
|
+
LongParameterList:
|
30
|
+
max_params: 3
|
31
|
+
exclude:
|
32
|
+
- Unparser#self.transquote
|
33
|
+
enabled: true
|
34
|
+
overrides: {}
|
35
|
+
FeatureEnvy:
|
36
|
+
exclude: []
|
37
|
+
enabled: true
|
38
|
+
ClassVariable:
|
39
|
+
exclude: []
|
40
|
+
enabled: true
|
41
|
+
BooleanParameter:
|
42
|
+
exclude: []
|
43
|
+
enabled: true
|
44
|
+
IrresponsibleModule:
|
45
|
+
exclude: []
|
46
|
+
enabled: true
|
47
|
+
UncommunicativeModuleName:
|
48
|
+
accept: []
|
49
|
+
exclude: []
|
50
|
+
enabled: true
|
51
|
+
reject:
|
52
|
+
- !ruby/regexp /^.$/
|
53
|
+
- !ruby/regexp /[0-9]$/
|
54
|
+
NestedIterators:
|
55
|
+
ignore_iterators: []
|
56
|
+
exclude:
|
57
|
+
- Unparser::Emitter#self.children
|
58
|
+
enabled: true
|
59
|
+
max_allowed_nesting: 1
|
60
|
+
TooManyStatements:
|
61
|
+
max_statements: 5
|
62
|
+
exclude: []
|
63
|
+
enabled: true
|
64
|
+
DuplicateMethodCall:
|
65
|
+
allow_calls: []
|
66
|
+
exclude: []
|
67
|
+
enabled: false
|
68
|
+
max_calls: 1
|
69
|
+
UtilityFunction:
|
70
|
+
max_helper_calls: 1
|
71
|
+
exclude: []
|
72
|
+
enabled: true
|
73
|
+
Attribute:
|
74
|
+
exclude: []
|
75
|
+
enabled: false
|
76
|
+
UncommunicativeVariableName:
|
77
|
+
accept: []
|
78
|
+
exclude: []
|
79
|
+
enabled: true
|
80
|
+
reject:
|
81
|
+
- !ruby/regexp /^.$/
|
82
|
+
- !ruby/regexp /[0-9]$/
|
83
|
+
- !ruby/regexp /[A-Z]/
|
84
|
+
RepeatedConditional:
|
85
|
+
exclude: []
|
86
|
+
enabled: true
|
87
|
+
max_ifs: 1
|
88
|
+
DataClump:
|
89
|
+
exclude: []
|
90
|
+
enabled: true
|
91
|
+
max_copies: 1
|
92
|
+
min_clump_size: 3
|
93
|
+
ControlParameter:
|
94
|
+
exclude: []
|
95
|
+
enabled: true
|
96
|
+
NilCheck:
|
97
|
+
enabled: false
|
98
|
+
LongYieldList:
|
99
|
+
max_params: 1
|
100
|
+
exclude: []
|
101
|
+
enabled: true
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Gem::Specification.new do |spec|
|
2
|
+
spec.name = 'guard-mutant'
|
3
|
+
spec.version = '0.0.1'
|
4
|
+
spec.authors = ['Markus Schirp']
|
5
|
+
spec.email = ['mbj@schirp-dso.com']
|
6
|
+
spec.summary = 'Guard plugin for Mutant'
|
7
|
+
spec.description = 'Guard::Mutant automatically mutates Ruby when files are modified.'
|
8
|
+
spec.homepage = 'https://github.com/yujinakayama/guard-rubocop'
|
9
|
+
spec.license = 'MIT'
|
10
|
+
|
11
|
+
spec.files = `git ls-files`.split($/).reject { |f| File.basename(f).start_with?('.') }
|
12
|
+
spec.test_files = spec.files.grep(%r(\A(spec)/))
|
13
|
+
spec.require_paths = ['lib']
|
14
|
+
|
15
|
+
spec.add_runtime_dependency 'guard', '~> 1.8'
|
16
|
+
spec.add_runtime_dependency 'mutant', '~> 0.3.0.beta15'
|
17
|
+
spec.add_runtime_dependency 'inflecto', '~> 0.0.2'
|
18
|
+
end
|
data/lib/guard-mutant.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'guard/mutant'
|
data/lib/guard/mutant.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'guard'
|
2
|
+
require 'guard/guard'
|
3
|
+
|
4
|
+
require 'inflecto'
|
5
|
+
require 'mutant'
|
6
|
+
|
7
|
+
module Guard
|
8
|
+
# Mutant guard
|
9
|
+
class Mutant < Guard
|
10
|
+
|
11
|
+
PREFIX = %r(\A#{Regexp.union('lib', 'app/models', 'app/controllers')})
|
12
|
+
SUFFIX = %r(\.rb\z)
|
13
|
+
EMPTY_STRING = ''.freeze
|
14
|
+
|
15
|
+
# Hook called when paths where changed
|
16
|
+
#
|
17
|
+
# @param [Enumerable<String>]
|
18
|
+
#
|
19
|
+
# @raise [:task_has_failed]
|
20
|
+
# if mutant run failed
|
21
|
+
#
|
22
|
+
# @return [self]
|
23
|
+
# otherwise
|
24
|
+
#
|
25
|
+
# @api private
|
26
|
+
#
|
27
|
+
def run_on_changes(paths)
|
28
|
+
subjects = paths.map do |path|
|
29
|
+
Inflecto.camelize(path.sub(PREFIX, EMPTY_STRING).sub(SUFFIX, EMPTY_STRING))
|
30
|
+
end
|
31
|
+
status = ::Mutant::CLI.run(%w(--rspec-dm2 --fail-fast) + subjects)
|
32
|
+
throw :task_has_failed if status.nonzero?
|
33
|
+
self
|
34
|
+
end
|
35
|
+
|
36
|
+
end # Mutant
|
37
|
+
end # Guard
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: guard-mutant
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Markus Schirp
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-07-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: guard
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.8'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.8'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mutant
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.3.0.beta15
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.3.0.beta15
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: inflecto
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.0.2
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.0.2
|
55
|
+
description: Guard::Mutant automatically mutates Ruby when files are modified.
|
56
|
+
email:
|
57
|
+
- mbj@schirp-dso.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- Gemfile
|
63
|
+
- Gemfile.devtools
|
64
|
+
- Rakefile
|
65
|
+
- TODO
|
66
|
+
- config/devtools.yml
|
67
|
+
- config/flay.yml
|
68
|
+
- config/flog.yml
|
69
|
+
- config/mutant.yml
|
70
|
+
- config/reek.yml
|
71
|
+
- config/yardstick.yml
|
72
|
+
- guard-mutant.gemspec
|
73
|
+
- lib/guard-mutant.rb
|
74
|
+
- lib/guard/mutant.rb
|
75
|
+
- spec/spec_helper.rb
|
76
|
+
homepage: https://github.com/yujinakayama/guard-rubocop
|
77
|
+
licenses:
|
78
|
+
- MIT
|
79
|
+
metadata: {}
|
80
|
+
post_install_message:
|
81
|
+
rdoc_options: []
|
82
|
+
require_paths:
|
83
|
+
- lib
|
84
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - '>='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
requirements: []
|
95
|
+
rubyforge_project:
|
96
|
+
rubygems_version: 2.0.2
|
97
|
+
signing_key:
|
98
|
+
specification_version: 4
|
99
|
+
summary: Guard plugin for Mutant
|
100
|
+
test_files:
|
101
|
+
- spec/spec_helper.rb
|
102
|
+
has_rdoc:
|