devtools 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +37 -0
  3. data/.rspec +5 -0
  4. data/.rubocop.yml +5 -0
  5. data/.ruby-gemset +1 -0
  6. data/.travis.yml +15 -0
  7. data/Gemfile +5 -0
  8. data/LICENSE +20 -0
  9. data/README.md +47 -0
  10. data/Rakefile +5 -0
  11. data/TODO +0 -0
  12. data/bin/devtools +18 -0
  13. data/circle.yml +7 -0
  14. data/config/flay.yml +3 -0
  15. data/config/flog.yml +2 -0
  16. data/config/mutant.yml +2 -0
  17. data/config/reek.yml +107 -0
  18. data/config/rubocop.yml +117 -0
  19. data/config/yardstick.yml +2 -0
  20. data/default/config/devtools.yml +2 -0
  21. data/default/config/flay.yml +3 -0
  22. data/default/config/flog.yml +2 -0
  23. data/default/config/mutant.yml +3 -0
  24. data/default/config/reek.yml +103 -0
  25. data/default/config/rubocop.yml +91 -0
  26. data/default/config/yardstick.yml +2 -0
  27. data/devtools.gemspec +33 -0
  28. data/lib/devtools.rb +143 -0
  29. data/lib/devtools/config.rb +158 -0
  30. data/lib/devtools/platform.rb +118 -0
  31. data/lib/devtools/project.rb +157 -0
  32. data/lib/devtools/project/initializer.rb +21 -0
  33. data/lib/devtools/project/initializer/rake.rb +19 -0
  34. data/lib/devtools/project/initializer/rspec.rb +105 -0
  35. data/lib/devtools/site.rb +41 -0
  36. data/lib/devtools/site/initializer.rb +57 -0
  37. data/lib/devtools/spec_helper.rb +5 -0
  38. data/shared/spec/shared/abstract_type_behavior.rb +18 -0
  39. data/shared/spec/shared/command_method_behavior.rb +7 -0
  40. data/shared/spec/shared/each_method_behaviour.rb +15 -0
  41. data/shared/spec/shared/hash_method_behavior.rb +9 -0
  42. data/shared/spec/shared/idempotent_method_behavior.rb +12 -0
  43. data/shared/spec/support/ice_nine_config.rb +14 -0
  44. data/spec/spec_helper.rb +31 -0
  45. data/tasks/metrics/ci.rake +18 -0
  46. data/tasks/metrics/coverage.rake +13 -0
  47. data/tasks/metrics/flay.rake +48 -0
  48. data/tasks/metrics/flog.rake +40 -0
  49. data/tasks/metrics/mutant.rake +50 -0
  50. data/tasks/metrics/reek.rake +7 -0
  51. data/tasks/metrics/rubocop.rake +15 -0
  52. data/tasks/metrics/yardstick.rake +26 -0
  53. data/tasks/spec.rake +36 -0
  54. data/tasks/yard.rake +11 -0
  55. metadata +284 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 764c83969a5e3165490c1032274ebae18ebe2b9d
4
+ data.tar.gz: 8f7d916f56ce1d5e2e265331583bde25dc276d6f
5
+ SHA512:
6
+ metadata.gz: ad8bba29c9c98632ea5502b1d22e89bc0c4d4a555e7f6f5a856021a33e0484f090b04306f3033e456cda7b133d057393e81905ea63b24a0149fef57efe4c1539
7
+ data.tar.gz: 0fff91e6b6ed417aaf43c3328119f00b861d361b2d503e4bd306b6bb9b192e938a82f921900f92fe79769ee61b743c90980d6860900c7667f92f9695f1095530
@@ -0,0 +1,37 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.sw[op]
15
+
16
+ ## Rubinius
17
+ *.rbc
18
+ .rbx
19
+
20
+ ## PROJECT::GENERAL
21
+ *.gem
22
+ coverage
23
+ profiling
24
+ turbulence
25
+ rdoc
26
+ pkg
27
+ tmp
28
+ doc
29
+ log
30
+ .yardoc
31
+ measurements
32
+
33
+ ## BUNDLER
34
+ .bundle
35
+ Gemfile.lock
36
+
37
+ ## PROJECT::SPECIFIC
data/.rspec ADDED
@@ -0,0 +1,5 @@
1
+ --color
2
+ --format progress
3
+ --profile
4
+ --warnings
5
+ --order random
@@ -0,0 +1,5 @@
1
+ AllCops:
2
+ Include:
3
+ - 'Gemfile'
4
+ Exclude:
5
+ - 'vendor/**/*'
@@ -0,0 +1 @@
1
+ devtools
@@ -0,0 +1,15 @@
1
+ sudo: false
2
+ language: ruby
3
+ bundler_args: --without yard guard benchmarks
4
+ script: "bundle exec rake ci"
5
+ rvm:
6
+ - '2.1'
7
+ - '2.2'
8
+ - rbx
9
+ matrix:
10
+ include:
11
+ - rvm: jruby
12
+ env: JRUBY_OPTS="$JRUBY_OPTS --debug --2.0"
13
+ allow_failures:
14
+ - rvm: jruby
15
+ - rvm: rbx
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ # encoding: utf-8
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2014 Markus Schirp
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,47 @@
1
+ # devtools
2
+
3
+ [![Build Status](https://secure.travis-ci.org/mbj/devtools.png?branch=master)](http://travis-ci.org/mbj/devtools)
4
+ [![Dependency Status](https://gemnasium.com/mbj/devtools.png)](https://gemnasium.com/mbj/devtools)
5
+ [![Code Climate](https://codeclimate.com/github/datamapper/devtools.png)](https://codeclimate.com/github/datamapper/devtools)
6
+ <!-- [![Code Climate](https://codeclimate.com/github/mbj/devtools.png)](https://codeclimate.com/github/mbj/devtools) -->
7
+
8
+ Metagem to assist development.
9
+ Used to centralize metric setup and development gem dependencies.
10
+
11
+ ## Installation
12
+
13
+ Add the git source to your Gemfile's development section, there is currently no gem release.
14
+
15
+ ```ruby
16
+ group :development, :test do
17
+ gem 'devtools', git: 'https://github.com/mbj/devtools.git'
18
+ end
19
+ ```
20
+
21
+ ## RSpec support
22
+
23
+ If you're using RSpec and want to have access to our common setup just adjust
24
+ `spec/spec_helper.rb` to include
25
+
26
+ ```ruby
27
+ require 'devtools/spec_helper'
28
+ ```
29
+
30
+ ## Credits
31
+
32
+ The whole [ROM](https://github.com/rom-rb) team that created and maintained all
33
+ these tasks before they were centralized here.
34
+
35
+ ## Contributing
36
+
37
+ * Fork the project.
38
+ * Make your feature addition or bug fix.
39
+ * Add tests for it. This is important so I don't break it in a
40
+ future version unintentionally.
41
+ * Commit, do not mess with Rakefile or version
42
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
43
+ * Send me a pull request. Bonus points for topic branches.
44
+
45
+ ## License
46
+
47
+ See `LICENSE` file.
@@ -0,0 +1,5 @@
1
+ require 'devtools'
2
+
3
+ ENV['DEVTOOLS_SELF'] = '1'
4
+
5
+ Devtools.init_rake_tasks
data/TODO ADDED
File without changes
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ require 'bundler'
5
+
6
+ Bundler.setup
7
+
8
+ require 'devtools'
9
+
10
+ command = ARGV.first
11
+
12
+ case command
13
+ when 'init' then Devtools.init
14
+ when 'sync' then Devtools.sync
15
+ when 'update' then Devtools.update
16
+ else
17
+ puts 'command not supported'
18
+ end
@@ -0,0 +1,7 @@
1
+ ---
2
+ machine:
3
+ ruby:
4
+ version: '2.2'
5
+ test:
6
+ override:
7
+ - bundle exec rake ci
@@ -0,0 +1,3 @@
1
+ ---
2
+ threshold: 16
3
+ total_score: 97
@@ -0,0 +1,2 @@
1
+ ---
2
+ threshold: 11.1
@@ -0,0 +1,2 @@
1
+ name: devtools
2
+ namespace: Devtools
@@ -0,0 +1,107 @@
1
+ ---
2
+ Attribute:
3
+ enabled: false
4
+ exclude: []
5
+ BooleanParameter:
6
+ enabled: true
7
+ exclude: []
8
+ ClassVariable:
9
+ enabled: true
10
+ exclude: []
11
+ ControlParameter:
12
+ enabled: true
13
+ exclude: []
14
+ DataClump:
15
+ enabled: true
16
+ exclude: []
17
+ max_copies: 0
18
+ min_clump_size: 2
19
+ DuplicateMethodCall:
20
+ enabled: true
21
+ exclude: []
22
+ max_calls: 1
23
+ allow_calls: []
24
+ FeatureEnvy:
25
+ enabled: true
26
+ exclude:
27
+ - Devtools::Site::Initializer#init_gemfile
28
+ - Devtools::Site::Initializer#init_rakefile
29
+ IrresponsibleModule:
30
+ enabled: true
31
+ exclude: []
32
+ LongParameterList:
33
+ enabled: true
34
+ exclude: []
35
+ max_params: 2
36
+ overrides: {}
37
+ LongYieldList:
38
+ enabled: true
39
+ exclude: []
40
+ max_params: 0
41
+ NestedIterators:
42
+ enabled: true
43
+ exclude: []
44
+ max_allowed_nesting: 1
45
+ ignore_iterators: []
46
+ NilCheck:
47
+ enabled: true
48
+ exclude: []
49
+ RepeatedConditional:
50
+ enabled: true
51
+ exclude: []
52
+ max_ifs: 1
53
+ TooManyInstanceVariables:
54
+ enabled: true
55
+ exclude:
56
+ - Devtools::Project
57
+ max_instance_variables: 14 # no adamantium ;)
58
+ TooManyMethods:
59
+ enabled: true
60
+ exclude: []
61
+ max_methods: 15
62
+ TooManyStatements:
63
+ enabled: true
64
+ exclude:
65
+ - Devtools::Project#initialize # needs refactoring, it is way too large
66
+ max_statements: 5
67
+ UncommunicativeMethodName:
68
+ enabled: true
69
+ exclude: []
70
+ reject:
71
+ - !ruby/regexp /^[a-z]$/
72
+ - !ruby/regexp /[0-9]$/
73
+ - !ruby/regexp /[A-Z]/
74
+ accept: []
75
+ UncommunicativeModuleName:
76
+ enabled: true
77
+ exclude: []
78
+ reject:
79
+ - !ruby/regexp /^.$/
80
+ - !ruby/regexp /[0-9]$/
81
+ accept: []
82
+ UncommunicativeParameterName:
83
+ enabled: true
84
+ exclude: []
85
+ reject:
86
+ - !ruby/regexp /^.$/
87
+ - !ruby/regexp /[0-9]$/
88
+ - !ruby/regexp /[A-Z]/
89
+ accept: []
90
+ UncommunicativeVariableName:
91
+ enabled: true
92
+ exclude: []
93
+ reject:
94
+ - !ruby/regexp /^.$/
95
+ - !ruby/regexp /[0-9]$/
96
+ - !ruby/regexp /[A-Z]/
97
+ accept: []
98
+ UnusedParameters:
99
+ enabled: true
100
+ exclude: []
101
+ UtilityFunction:
102
+ enabled: true
103
+ exclude:
104
+ - Devtools::Platform#ruby18?
105
+ - Devtools::Platform#ruby19?
106
+ - Devtools::Platform#ruby20?
107
+ max_helper_calls: 0
@@ -0,0 +1,117 @@
1
+ inherit_from: ../.rubocop.yml
2
+
3
+ # Avoid parameter lists longer than five parameters.
4
+ ParameterLists:
5
+ Max: 3
6
+ CountKeywordArgs: true
7
+
8
+ # Avoid more than `Max` levels of nesting.
9
+ BlockNesting:
10
+ Max: 3
11
+
12
+ # Align with the style guide.
13
+ CollectionMethods:
14
+ PreferredMethods:
15
+ collect: 'map'
16
+ inject: 'reduce'
17
+ find: 'detect'
18
+ find_all: 'select'
19
+
20
+ # Do not force public/protected/private keyword to be indented at the same
21
+ # level as the def keyword. My personal preference is to outdent these keywords
22
+ # because I think when scanning code it makes it easier to identify the
23
+ # sections of code and visually separate them. When the keyword is at the same
24
+ # level I think it sort of blends in with the def keywords and makes it harder
25
+ # to scan the code and see where the sections are.
26
+ AccessModifierIndentation:
27
+ Enabled: false
28
+
29
+ # Limit line length
30
+ LineLength:
31
+ Max: 106
32
+
33
+ # Disable documentation checking until a class needs to be documented once
34
+ Documentation:
35
+ Enabled: false
36
+
37
+ # Do not always use &&/|| instead of and/or.
38
+ AndOr:
39
+ Enabled: false
40
+
41
+ # Do not favor modifier if/unless usage when you have a single-line body
42
+ IfUnlessModifier:
43
+ Enabled: false
44
+
45
+ # Allow case equality operator (in limited use within the specs)
46
+ CaseEquality:
47
+ Enabled: false
48
+
49
+ # Constants do not always have to use SCREAMING_SNAKE_CASE
50
+ ConstantName:
51
+ Enabled: false
52
+
53
+ # Not all trivial readers/writers can be defined with attr_* methods
54
+ TrivialAccessors:
55
+ Enabled: false
56
+
57
+ # Allow empty lines around class body
58
+ EmptyLinesAroundClassBody:
59
+ Enabled: false
60
+
61
+ # Allow empty lines around module body
62
+ EmptyLinesAroundModuleBody:
63
+ Enabled: false
64
+
65
+ # Allow empty lines around block body
66
+ EmptyLinesAroundBlockBody:
67
+ Enabled: false
68
+
69
+ # Allow multiple line operations to not require indentation
70
+ MultilineOperationIndentation:
71
+ Enabled: false
72
+
73
+ # Prefer String#% over Kernel#sprintf
74
+ FormatString:
75
+ Enabled: false
76
+
77
+ # Use square brackets for literal Array objects
78
+ PercentLiteralDelimiters:
79
+ PreferredDelimiters:
80
+ '%': '{}'
81
+ '%i': '[]'
82
+ '%q': ()
83
+ '%Q': ()
84
+ '%r': '{}'
85
+ '%s': ()
86
+ '%w': '[]'
87
+ '%W': '[]'
88
+ '%x': ()
89
+
90
+ # Align if/else blocks with the variable assignment
91
+ EndAlignment:
92
+ AlignWith: variable
93
+
94
+ # Do not always align parameters when it is easier to read
95
+ AlignParameters:
96
+ Exclude:
97
+ - spec/**/*_spec.rb
98
+
99
+ # Prefer #kind_of? over #is_a?
100
+ ClassCheck:
101
+ EnforcedStyle: kind_of?
102
+
103
+ # Do not prefer double quotes to be used when %q or %Q is more appropriate
104
+ UnneededPercentQ:
105
+ Enabled: false
106
+
107
+ # Allow a maximum ABC score
108
+ Metrics/AbcSize:
109
+ Max: 20.1
110
+
111
+ # Do not prefer lambda.call(...) over lambda.(...)
112
+ LambdaCall:
113
+ Enabled: false
114
+
115
+ # Allow additional spaces
116
+ ExtraSpacing:
117
+ Enabled: false
@@ -0,0 +1,2 @@
1
+ ---
2
+ threshold: 100
@@ -0,0 +1,2 @@
1
+ ---
2
+ unit_test_timeout: 0.1
@@ -0,0 +1,3 @@
1
+ ---
2
+ threshold: 0
3
+ total_score: 0
@@ -0,0 +1,2 @@
1
+ ---
2
+ threshold: 0