td_critic 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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0a9c8ba02ecf239276aa565bb1631a5ebf7945ba
4
+ data.tar.gz: d69fd22bc71aa014798f4ff9325f2a4c3c82d61f
5
+ SHA512:
6
+ metadata.gz: 504b81c3b50206e12ea3ab125de1bd077cb2f51f1a495699bedf0be84dc16c496eebf4d9cead6497a78da3454ebf8a5caf36f36dc4aee7b179940f8e6822b5f7
7
+ data.tar.gz: 2515b65b75f84e08d75febb43093f58bdae69d017427732ab7989953dcae53f0ad7f2e8a5e164265b875864739ff351c14b50bdc8164d2c9130d8642c48becb9
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.gem
data/.rubocop.yml ADDED
@@ -0,0 +1,2 @@
1
+ inherit_from:
2
+ rubocop.yml
data/.travis.yml ADDED
@@ -0,0 +1,14 @@
1
+ sudo: false
2
+ notifications:
3
+ email:
4
+ on_success: never
5
+ language: ruby
6
+ cache:
7
+ directories:
8
+ - vendor/bundle
9
+ before_install:
10
+ - gem update --remote bundler
11
+ script:
12
+ - bundle exec rubocop --display-cop-names
13
+ gemfile:
14
+ - Gemfile
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in td_critic.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 trommsdorff + drüner innovation + marketing consultants GmbH
4
+
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:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
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 THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # TD Critic
2
+
3
+ <img src="https://cloud.githubusercontent.com/assets/300693/10975524/18686db6-83f0-11e5-82e7-34b1d64f6870.jpeg" alt="Your ruby SUX!" title="SHAME" align="right" border="1" width="150"/>
4
+
5
+ > Critic <br/>
6
+ > -- One who forms and expresses judgments of the merits, faults, value, or truth of a matter.
7
+
8
+ TD Critic is a gem that specializes in judging your coding style.
9
+
10
+ <br/><br/><br/>
11
+
12
+ ## Installation
13
+
14
+ Add this to your application's Gemfile:
15
+
16
+ ```ruby
17
+ gem 'td_critic'
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ Add the following line to your rubocop config
23
+
24
+ ```
25
+ inherit_gem:
26
+ td_critic: rubocop.yml
27
+ ```
28
+
29
+ You can use the `rubocop` rake task to run rubocop on only the **recently changed files** (by [Yury Lebedev](https://github.com/lebedev-yury))
30
+
31
+ ```
32
+ bundle exec rake rubocop
33
+ ```
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,21 @@
1
+ require 'rubocop/rake_task'
2
+
3
+ desc 'Run Rubocop on the recent changes'
4
+ RuboCop::RakeTask.new(:rubocop) do |task|
5
+ if (branch = `git rev-parse --abbrev-ref HEAD`) == 'master'
6
+ changed_files = `git diff --name-only master origin/master`.split($RS)
7
+ else
8
+ changed_files = `git diff --name-only master..#{branch}`.split($RS)
9
+ end
10
+
11
+ changed_files -= %w(Gemfile Gemfile.lock)
12
+ changed_files.select! { |f| f.ends_with? '.rb' }
13
+
14
+ if changed_files.none?
15
+ task.patterns = %w(*.!)
16
+ else
17
+ task.patterns = changed_files
18
+ end
19
+
20
+ task.fail_on_error = false
21
+ end
@@ -0,0 +1,7 @@
1
+ module TdCritic
2
+ class Railtie < Rails::Railtie
3
+ rake_tasks do
4
+ load 'tasks/rubocop.rake' if Rails.env.development?
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ module TdCritic
2
+ VERSION = '0.1.0'
3
+ end
data/lib/td_critic.rb ADDED
@@ -0,0 +1,2 @@
1
+ require 'td_critic/version'
2
+ require 'td_critic/railtie' if defined?(Rails)
data/rubocop.yml ADDED
@@ -0,0 +1,20 @@
1
+ AllCops:
2
+ RunRailsCops: true
3
+ Exclude:
4
+ - 'bin/**/*'
5
+ - '**/Rakefile'
6
+ - 'Gemfile.lock'
7
+ - 'db/**/*'
8
+ - 'assets/node_modules/**/*'
9
+ - 'vendor/**/*'
10
+
11
+ Metrics/LineLength:
12
+ Max: 99
13
+
14
+ Style/Documentation:
15
+ Enabled: false
16
+
17
+ Lint/UnusedBlockArgument:
18
+ Enabled: false
19
+
20
+ require: rubocop-rspec
data/td_critic.gemspec ADDED
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'td_critic/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'td_critic'
8
+ spec.version = TdCritic::VERSION
9
+ spec.authors = ['Dash Boys']
10
+ spec.email = ['developer@td-berlin.com']
11
+
12
+ spec.summary = 'TD Critic is a gem that specializes in judging' \
13
+ ' your coding style.'
14
+ spec.description = 'TD Critic uses rubocop to check your code based' \
15
+ ' on the Ruby Style Guide.'
16
+ spec.homepage = 'https://www.github.com/td-berlin/td_critic'
17
+ spec.license = 'MIT'
18
+
19
+ spec.files = `git ls-files -z`.split("\x0")
20
+ spec.executables = []
21
+ spec.require_paths = ['lib']
22
+
23
+ spec.add_dependency 'rubocop', '~> 0.35'
24
+ spec.add_dependency 'rubocop-rspec', '~> 1.3'
25
+
26
+ spec.add_development_dependency 'bundler', '~> 1.10'
27
+ spec.add_development_dependency 'rake', '~> 10.0'
28
+ end
metadata ADDED
@@ -0,0 +1,113 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: td_critic
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Dash Boys
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-11-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rubocop
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.35'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.35'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop-rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
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
+ description: TD Critic uses rubocop to check your code based on the Ruby Style Guide.
70
+ email:
71
+ - developer@td-berlin.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".rubocop.yml"
78
+ - ".travis.yml"
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - lib/tasks/rubocop.rake
84
+ - lib/td_critic.rb
85
+ - lib/td_critic/railtie.rb
86
+ - lib/td_critic/version.rb
87
+ - rubocop.yml
88
+ - td_critic.gemspec
89
+ homepage: https://www.github.com/td-berlin/td_critic
90
+ licenses:
91
+ - MIT
92
+ metadata: {}
93
+ post_install_message:
94
+ rdoc_options: []
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ requirements: []
108
+ rubyforge_project:
109
+ rubygems_version: 2.2.2
110
+ signing_key:
111
+ specification_version: 4
112
+ summary: TD Critic is a gem that specializes in judging your coding style.
113
+ test_files: []