develry 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +37 -0
  3. data/.rspec +5 -0
  4. data/.ruby-gemset +1 -0
  5. data/.travis.yml +30 -0
  6. data/Gemfile +7 -0
  7. data/Guardfile +32 -0
  8. data/LICENSE +20 -0
  9. data/README.md +71 -0
  10. data/Rakefile +5 -0
  11. data/TODO +0 -0
  12. data/bin/develry +18 -0
  13. data/config/flay.yml +3 -0
  14. data/config/flog.yml +2 -0
  15. data/config/mutant.yml +2 -0
  16. data/config/reek.yml +106 -0
  17. data/config/rubocop.yml +66 -0
  18. data/config/yardstick.yml +2 -0
  19. data/default/config/develry.yml +4 -0
  20. data/default/config/flay.yml +3 -0
  21. data/default/config/flog.yml +2 -0
  22. data/default/config/mutant.yml +3 -0
  23. data/default/config/reek.yml +103 -0
  24. data/default/config/rubocop.yml +58 -0
  25. data/default/config/yardstick.yml +2 -0
  26. data/develry.gemspec +53 -0
  27. data/lib/develry.rb +164 -0
  28. data/lib/develry/config.rb +167 -0
  29. data/lib/develry/platform.rb +118 -0
  30. data/lib/develry/project.rb +144 -0
  31. data/lib/develry/project/initializer.rb +21 -0
  32. data/lib/develry/project/initializer/rake.rb +19 -0
  33. data/lib/develry/project/initializer/rspec.rb +104 -0
  34. data/lib/develry/site.rb +64 -0
  35. data/lib/develry/site/initializer.rb +73 -0
  36. data/lib/develry/spec_helper.rb +5 -0
  37. data/shared/Gemfile +55 -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 +17 -0
  42. data/shared/spec/shared/idempotent_method_behavior.rb +9 -0
  43. data/shared/spec/support/ice_nine_config.rb +14 -0
  44. data/spec/spec_helper.rb +33 -0
  45. data/tasks/metrics/ci.rake +18 -0
  46. data/tasks/metrics/coverage.rake +13 -0
  47. data/tasks/metrics/flay.rake +66 -0
  48. data/tasks/metrics/flog.rake +59 -0
  49. data/tasks/metrics/mutant.rake +44 -0
  50. data/tasks/metrics/reek.rake +27 -0
  51. data/tasks/metrics/rubocop.rake +18 -0
  52. data/tasks/metrics/yardstick.rake +42 -0
  53. data/tasks/spec.rake +28 -0
  54. data/tasks/yard.rake +11 -0
  55. metadata +452 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 055c0b14509c72eee7d30b5036083be099d87a6b
4
+ data.tar.gz: a07e91d14265e9147e6adbbd95df2fd6a5325a17
5
+ SHA512:
6
+ metadata.gz: c95f0cb9ed58d8cc21e976fdd3a6f8a97e50a9ce8f3e7392a03b1f9c69f2082cdae605904a755f4413c1067c7721681fc1e9bc34ab88d00a21b42decedc0dbd3
7
+ data.tar.gz: 96d46e4e9938e7c8768685483b681e45be5c1cc8202683331d308089eb80fdeaaba315363c9a7000e424eee2635f433bb2b44a9b43bdea99eee761d8c0981579
@@ -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 @@
1
+ devtools
@@ -0,0 +1,30 @@
1
+ language: ruby
2
+ before_install: gem install bundler
3
+ bundler_args: --without yard guard benchmarks
4
+ script: "bundle exec rake ci"
5
+ rvm:
6
+ - 1.9.3
7
+ - 2.0.0
8
+ - ruby-head
9
+ - rbx-19mode
10
+ matrix:
11
+ include:
12
+ - rvm: jruby-19mode
13
+ env: JRUBY_OPTS="$JRUBY_OPTS --debug"
14
+ - rvm: jruby-head
15
+ env: JRUBY_OPTS="$JRUBY_OPTS --debug"
16
+ allow_failures:
17
+ # broken on travis
18
+ - rvm: ruby-head
19
+ notifications:
20
+ irc:
21
+ channels:
22
+ - irc.freenode.org#rom-rb
23
+ on_success: never
24
+ on_failure: change
25
+ email:
26
+ recipients:
27
+ - dan.kubb@gmail.com
28
+ - mbj@schirp-dso.com
29
+ on_success: never
30
+ on_failure: change
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ # encoding: utf-8
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
6
+
7
+ eval_gemfile 'shared/Gemfile'
@@ -0,0 +1,32 @@
1
+ # encoding: utf-8
2
+
3
+ guard :bundler do
4
+ watch('Gemfile')
5
+ watch('Gemfile.lock')
6
+ watch(%w{.+.gemspec\z})
7
+ end
8
+
9
+ guard :rspec, cli: File.read('.rspec').split.push('--fail-fast').join(' '), keep_failed: false do
10
+ # Run all specs if configuration is modified
11
+ watch('.rspec') { 'spec' }
12
+ watch('Guardfile') { 'spec' }
13
+ watch('Gemfile.lock') { 'spec' }
14
+ watch('spec/spec_helper.rb') { 'spec' }
15
+
16
+ # Run all specs if supporting files are modified
17
+ watch(%r{\Aspec/(?:fixtures|lib|support|shared)/.+\.rb\z}) { 'spec' }
18
+
19
+ # Run unit specs if associated lib code is modified
20
+ watch(%r{\Alib/(.+)\.rb\z}) { |m| Dir["spec/unit/#{m[1]}*"] }
21
+ watch(%r{\Alib/(.+)/support/(.+)\.rb\z}) { |m| Dir["spec/unit/#{m[1]}/#{m[2]}*"] }
22
+ watch("lib/#{File.basename(File.expand_path('../', __FILE__))}.rb") { 'spec' }
23
+
24
+ # Run a spec if it is modified
25
+ watch(%r{\Aspec/(?:unit|integration)/.+_spec\.rb\z})
26
+ end
27
+
28
+ guard :rubocop, cli: %w[--config config/rubocop.yml] do
29
+ watch(%r{.+\.(?:rb|rake)\z})
30
+ watch(%r{\Aconfig/rubocop\.yml\z}) { |m| File.dirname(m[0]) }
31
+ watch(%r{(?:.+/)?\.rubocop\.yml\z}) { |m| File.dirname(m[0]) }
32
+ end
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013 Ruby Object Mapper Team
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,71 @@
1
+ # develry
2
+
3
+ [![Build Status](https://secure.travis-ci.org/rom-rb/develry.png?branch=master)](http://travis-ci.org/rom-rb/develry)
4
+ [![Dependency Status](https://gemnasium.com/rom-rb/develry.png)](https://gemnasium.com/rom-rb/develry)
5
+ [![Code Climate](https://codeclimate.com/github/datamapper/develry.png)](https://codeclimate.com/github/datamapper/develry)
6
+ <!-- [![Code Climate](https://codeclimate.com/github/rom-rb/develry.png)](https://codeclimate.com/github/rom-rb/develry) -->
7
+
8
+ Metagem to assist [ROM](https://github.com/rom-rb)-style development.
9
+ Used to centralize metric setup and development gem dependencies.
10
+
11
+ ## Installation
12
+
13
+ The installation looks stupid because Gemfiles are not nestable (A Gemfile cannot
14
+ include another Gemfile from a remote repository). Because of this we use an
15
+ updatable local copy of the shared parts.
16
+
17
+ Add the git source to your Gemfile's development section:
18
+
19
+ ```ruby
20
+ group :development, :test do
21
+ gem 'develry', git: 'https://github.com/rom-rb/develry.git'
22
+ end
23
+ ```
24
+
25
+ To initialize develry in a project run the following command:
26
+
27
+ ```ruby
28
+ bundle install
29
+ bundle exec develry init
30
+ ```
31
+
32
+ This will *change your Gemfile and Rakefile* and add config files. Make sure to
33
+ review the diff and don't freak out :wink:
34
+
35
+ ## Updating
36
+
37
+ Later on if you want to update to the latest develry just run:
38
+
39
+ ```
40
+ bundle update develry
41
+ bundle exec develry sync
42
+ bundle install
43
+ ```
44
+
45
+ ## RSpec support
46
+
47
+ If you're using RSpec and want to have access to our common setup just adjust
48
+ `spec/spec_helper.rb` to include
49
+
50
+ ```ruby
51
+ require 'develry/spec_helper'
52
+ ```
53
+
54
+ ## Credits
55
+
56
+ The whole [ROM](https://github.com/rom-rb) team that created and maintained all
57
+ these tasks before they were centralized here.
58
+
59
+ ## Contributing
60
+
61
+ * Fork the project.
62
+ * Make your feature addition or bug fix.
63
+ * Add tests for it. This is important so I don't break it in a
64
+ future version unintentionally.
65
+ * Commit, do not mess with Rakefile or version
66
+ (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)
67
+ * Send me a pull request. Bonus points for topic branches.
68
+
69
+ ## License
70
+
71
+ See `LICENSE` file.
@@ -0,0 +1,5 @@
1
+ require 'develry'
2
+
3
+ ENV['DEVELRY_SELF'] = '1'
4
+
5
+ Develry.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 'develry'
9
+
10
+ command = ARGV.first
11
+
12
+ case command
13
+ when 'init' then Develry.init
14
+ when 'sync' then Develry.sync
15
+ when 'update' then Develry.update
16
+ else
17
+ puts 'command not supported'
18
+ end
@@ -0,0 +1,3 @@
1
+ ---
2
+ threshold: 9
3
+ total_score: 105
@@ -0,0 +1,2 @@
1
+ ---
2
+ threshold: 24.2
@@ -0,0 +1,2 @@
1
+ name: develry
2
+ namespace: Develry
@@ -0,0 +1,106 @@
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: 1
19
+ DuplicateMethodCall:
20
+ enabled: true
21
+ exclude: []
22
+ max_calls: 1
23
+ allow_calls: []
24
+ FeatureEnvy:
25
+ enabled: true
26
+ exclude:
27
+ - Develry::Site::Initializer#init_gemfile
28
+ - Develry::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
+ - Develry::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
+ max_statements: 5
66
+ UncommunicativeMethodName:
67
+ enabled: true
68
+ exclude: []
69
+ reject:
70
+ - !ruby/regexp /^[a-z]$/
71
+ - !ruby/regexp /[0-9]$/
72
+ - !ruby/regexp /[A-Z]/
73
+ accept: []
74
+ UncommunicativeModuleName:
75
+ enabled: true
76
+ exclude: []
77
+ reject:
78
+ - !ruby/regexp /^.$/
79
+ - !ruby/regexp /[0-9]$/
80
+ accept: []
81
+ UncommunicativeParameterName:
82
+ enabled: true
83
+ exclude: []
84
+ reject:
85
+ - !ruby/regexp /^.$/
86
+ - !ruby/regexp /[0-9]$/
87
+ - !ruby/regexp /[A-Z]/
88
+ accept: []
89
+ UncommunicativeVariableName:
90
+ enabled: true
91
+ exclude: []
92
+ reject:
93
+ - !ruby/regexp /^.$/
94
+ - !ruby/regexp /[0-9]$/
95
+ - !ruby/regexp /[A-Z]/
96
+ accept: []
97
+ UnusedParameters:
98
+ enabled: true
99
+ exclude: []
100
+ UtilityFunction:
101
+ enabled: true
102
+ exclude:
103
+ - Develry::Platform#ruby18?
104
+ - Develry::Platform#ruby19?
105
+ - Develry::Platform#ruby20?
106
+ max_helper_calls: 0
@@ -0,0 +1,66 @@
1
+ AllCops:
2
+ Includes:
3
+ - '**/*.rake'
4
+ - 'Gemfile'
5
+ - 'Gemfile.develry'
6
+ Excludes:
7
+ - '**/vendor/**'
8
+ - '**/benchmarks/**'
9
+
10
+ # Avoid parameter lists longer than five parameters.
11
+ ParameterLists:
12
+ Max: 3
13
+ CountKeywordArgs: true
14
+
15
+ MethodLength:
16
+ CountComments: false
17
+ Max: 15
18
+
19
+ # Avoid more than `Max` levels of nesting.
20
+ BlockNesting:
21
+ Max: 3
22
+
23
+ # Align with the style guide.
24
+ CollectionMethods:
25
+ PreferredMethods:
26
+ collect: 'map'
27
+ inject: 'reduce'
28
+ find: 'detect'
29
+ find_all: 'select'
30
+
31
+ # Do not force public/protected/private keyword to be indented at the same
32
+ # level as the def keyword. My personal preference is to outdent these keywords
33
+ # because I think when scanning code it makes it easier to identify the
34
+ # sections of code and visually separate them. When the keyword is at the same
35
+ # level I think it sort of blends in with the def keywords and makes it harder
36
+ # to scan the code and see where the sections are.
37
+ AccessControl:
38
+ Enabled: false
39
+
40
+ # Limit line length
41
+ LineLength:
42
+ Max: 113 # TODO: lower to 79 once the rubocop branch in shared/Gemfile is removed
43
+
44
+ # Disable documentation checking until a class needs to be documented once
45
+ Documentation:
46
+ Enabled: false
47
+
48
+ # Do not favor modifier if/unless usage when you have a single-line body
49
+ IfUnlessModifier:
50
+ Enabled: false
51
+
52
+ # Allow case equality operator (in limited use within the specs)
53
+ CaseEquality:
54
+ Enabled: false
55
+
56
+ # Constants do not always have to use SCREAMING_SNAKE_CASE
57
+ ConstantName:
58
+ Enabled: false
59
+
60
+ # Not all trivial readers/writers can be defined with attr_* methods
61
+ TrivialAccessors:
62
+ Enabled: false
63
+
64
+ # Do not prefer do/end over {} for multiline blocks
65
+ Blocks:
66
+ Enabled: false
@@ -0,0 +1,2 @@
1
+ ---
2
+ threshold: 100
@@ -0,0 +1,4 @@
1
+ ---
2
+ unit_test_timeout: 0.1
3
+ fail_on_branch:
4
+ - "master"