code_inspector 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: 3506a8911b603cf7c0898b6b5489e647ff0bde4a
4
+ data.tar.gz: 79113e53138cf3dbd8726a2e2b98d13393cdf771
5
+ SHA512:
6
+ metadata.gz: ddd32471dc3f11c9e8bd2207259cb191cc498971f86e7906c0fd45061c84d2d558f99610ab2f3a245485b800a098e3303f105ffe73fc7fcb3004f5874c69c8d8
7
+ data.tar.gz: cc6b1941ca31985e68ea782d03c51ccecd8baf8ae525c9dafd010e9e8f7d8d7a7ec135188fbcd132d21ddd8612ccfb06f6f3db911fdc1b4ea47878d14d9dfab0
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ .tags
11
+ .tags_sorted_by_file
12
+ .gemtags
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in code_inspector.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Monde Sistemas
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.
22
+
data/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # Code Inspector
2
+
3
+ Provides a centralized way to inspect your ruby, javascript and css code.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem "code_inspector", require: false, group: :test
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install code_inspector
20
+
21
+ ## Usage
22
+
23
+ To inspect all your code and generate the reports use:
24
+
25
+ inspect
26
+
27
+
28
+ ## Development
29
+
30
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
31
+
32
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
33
+
34
+ ## Contributing
35
+
36
+ 1. Fork it ( https://github.com/[my-github-username]/code_inspector/fork )
37
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
38
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
39
+ 4. Push to the branch (`git push origin my-new-feature`)
40
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/inspect ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'code_inspector'
4
+
5
+ exit CodeInspector::Base.new.inspect(ARGV)
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,32 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "code_inspector/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "code_inspector"
8
+ spec.version = CodeInspector::VERSION
9
+ spec.authors = ["Marcelo J. Both", "Roberto C. Schneiders"]
10
+ spec.email = ["marcelo.both@gmail.com", "roberto.schneiders@gmail.com"]
11
+
12
+ spec.summary = "Provides a centralized way to inspect your ruby, javascript and css code."
13
+ spec.description = "Centralizes the configuration of code inspectors like Rubocop, Rubycritic,
14
+ JS-lint and SCSS-lint."
15
+ spec.homepage = "https://github.com/monde-sistemas/code_inspector"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+
21
+ spec.bindir = "bin"
22
+ spec.executables = ["inspect"]
23
+ spec.require_paths = ["lib"]
24
+
25
+ spec.add_dependency "rubocop"
26
+
27
+ spec.add_development_dependency "bundler", "~> 1.8"
28
+ spec.add_development_dependency "rake", "~> 10.0"
29
+ spec.add_development_dependency "pry-meta"
30
+ spec.add_development_dependency "rspec"
31
+ spec.add_development_dependency "simplecov"
32
+ end
@@ -0,0 +1,17 @@
1
+ AllCops:
2
+ Exclude:
3
+ - bin/**/*
4
+ - db/**/*
5
+ - tmp/**/*
6
+ - vendor/**/*
7
+ - log/**/*
8
+ RunRailsCops: true
9
+ DisplayCopNames: true
10
+ DisplayStyleGuide: true
11
+ StyleGuideCopsOnly: true
12
+
13
+ Style/StringLiterals:
14
+ EnforcedStyle: double_quotes
15
+
16
+ Metrics/LineLength:
17
+ Max: 100
@@ -0,0 +1,6 @@
1
+ require "code_inspector/version"
2
+ require "code_inspector/cli"
3
+
4
+ module CodeInspector
5
+ # Your code goes here...
6
+ end
@@ -0,0 +1,9 @@
1
+ require_relative "inspectors/rubocop"
2
+
3
+ module CodeInspector
4
+ class Base
5
+ def inspect(_args)
6
+ CodeInspector::Rubocop.inspect
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,37 @@
1
+ require "rubocop"
2
+
3
+ module CodeInspector
4
+ class Rubocop
5
+ PROJECT_CONFIG_FILE = ".rubocop.yml"
6
+ CODE_INSPECTOR_HOME = File.realpath(File.join(File.dirname(__FILE__), "..", "..", ".."))
7
+ DEFAULT_FILE = File.join(CODE_INSPECTOR_HOME, "config", "rubocop.yml") #
8
+
9
+ def self.inspect
10
+ cli = RuboCop::CLI.new
11
+ cli.run options
12
+ end
13
+
14
+ def self.options
15
+ config_file_options + fail_fast_options
16
+ end
17
+
18
+ def self.fail_fast_options
19
+ ENV["CI"] ? ["-F"] : []
20
+ end
21
+
22
+ def self.config_file_options
23
+ project_has_specific_config? ? options_for(:specific) : options_for(:default)
24
+ end
25
+
26
+ def self.project_has_specific_config?
27
+ File.exists? PROJECT_CONFIG_FILE
28
+ end
29
+
30
+ def self.options_for(config)
31
+ case config
32
+ when :default then ["-c", DEFAULT_FILE]
33
+ when :specific then []
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,3 @@
1
+ module CodeInspector
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,146 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: code_inspector
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Marcelo J. Both
8
+ - Roberto C. Schneiders
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2015-09-08 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rubocop
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: bundler
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '1.8'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '1.8'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rake
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '10.0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '10.0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: pry-meta
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: rspec
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: simplecov
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ description: |-
99
+ Centralizes the configuration of code inspectors like Rubocop, Rubycritic,
100
+ JS-lint and SCSS-lint.
101
+ email:
102
+ - marcelo.both@gmail.com
103
+ - roberto.schneiders@gmail.com
104
+ executables:
105
+ - inspect
106
+ extensions: []
107
+ extra_rdoc_files: []
108
+ files:
109
+ - ".gitignore"
110
+ - ".rspec"
111
+ - Gemfile
112
+ - LICENSE
113
+ - README.md
114
+ - Rakefile
115
+ - bin/inspect
116
+ - bin/setup
117
+ - code_inspector.gemspec
118
+ - config/rubocop.yml
119
+ - lib/code_inspector.rb
120
+ - lib/code_inspector/cli.rb
121
+ - lib/code_inspector/inspectors/rubocop.rb
122
+ - lib/code_inspector/version.rb
123
+ homepage: https://github.com/monde-sistemas/code_inspector
124
+ licenses: []
125
+ metadata: {}
126
+ post_install_message:
127
+ rdoc_options: []
128
+ require_paths:
129
+ - lib
130
+ required_ruby_version: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
135
+ required_rubygems_version: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
140
+ requirements: []
141
+ rubyforge_project:
142
+ rubygems_version: 2.4.8
143
+ signing_key:
144
+ specification_version: 4
145
+ summary: Provides a centralized way to inspect your ruby, javascript and css code.
146
+ test_files: []