source_finder 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.rubocop.yml +32 -0
- data/.ruby-version +1 -0
- data/.travis.yml +9 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +10 -0
- data/Rakefile +5 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/circle.yml +6 -0
- data/coverage/.last_run.json +1 -0
- data/lib/source_finder/source_file_globber.rb +67 -0
- data/lib/source_finder/version.rb +4 -0
- data/lib/source_finder.rb +5 -0
- data/lib/tasks/ci.rake +1 -0
- data/lib/tasks/clear_metrics.rake +5 -0
- data/lib/tasks/default.rake +1 -0
- data/lib/tasks/feature.rake +7 -0
- data/lib/tasks/localtest.rake +1 -0
- data/lib/tasks/quality.rake +6 -0
- data/lib/tasks/spec.rake +7 -0
- data/metrics/bigfiles_high_water_mark +1 -0
- data/metrics/brakeman_high_water_mark +1 -0
- data/metrics/cane_high_water_mark +1 -0
- data/metrics/flay_high_water_mark +1 -0
- data/metrics/flog_high_water_mark +1 -0
- data/metrics/punchlist_high_water_mark +1 -0
- data/metrics/rubocop_high_water_mark +1 -0
- data/source_finder.gemspec +29 -0
- metadata +145 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: baf95ccd1d9c73a477fcc9fb336ca869c6bd3af4
|
4
|
+
data.tar.gz: fc674fa35fa9d2ad4628df5fdf5b6892c4c21738
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 912857f1347028dc410fb261f500c6afce4ade35bd8ed3a7f9d3d33a574e6a776c85d55667f9fd664e82795417b75a2425faa83b7d692084f488caa39caed558
|
7
|
+
data.tar.gz: ce1dacfdc35223cddec9bac55b0a8e6ea070454be61550ac3408315db90f866d7411bbfeb94fe3418eb4b5c61ed43d3bcb9bdc2d5ea0a4ce216eae3cef0406be
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# I like trailing commas in maps. They let me insert new elements and
|
2
|
+
# see them as one line in a diff, not two.
|
3
|
+
TrailingComma:
|
4
|
+
Enabled: false
|
5
|
+
|
6
|
+
# I use keyword arguments for a poor man's dependency injection to cut
|
7
|
+
# down on the magic in my tests.
|
8
|
+
ParameterLists:
|
9
|
+
CountKeywordArgs: false
|
10
|
+
|
11
|
+
# If i'm using one function name and returning the contents of an
|
12
|
+
# attribute, that's OK. The alternative would be this, which I find
|
13
|
+
# confusing and often not really what I mean:
|
14
|
+
#
|
15
|
+
# attr_reader :something_else
|
16
|
+
# alias_method :something, :something_else
|
17
|
+
TrivialAccessors:
|
18
|
+
ExactNameMatch: true
|
19
|
+
|
20
|
+
#
|
21
|
+
# Add 'XXX' to the standard list
|
22
|
+
#
|
23
|
+
Style/CommentAnnotation:
|
24
|
+
Keywords:
|
25
|
+
- "TOD\
|
26
|
+
O"
|
27
|
+
- FIXME
|
28
|
+
- OPTIMIZE
|
29
|
+
- HACK
|
30
|
+
- REVIEW
|
31
|
+
- "XX\
|
32
|
+
X"
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.0.0
|
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Vince Broz
|
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
|
13
|
+
all 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
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
## SourceFinder
|
2
|
+
|
3
|
+
[![Circle CI](https://circleci.com/gh/apiology/source_finder.svg?style=svg)](https://circleci.com/gh/apiology/source_finder)
|
4
|
+
|
5
|
+
[![Build Status](https://travis-ci.org/apiology/source_finder.svg)](https://travis-ci.org/apiology/source_finder)
|
6
|
+
|
7
|
+
SourceFinder's job is to find source files in your project in a configurable way
|
8
|
+
--useful for things like static analysis quality tools.
|
9
|
+
|
10
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "source_finder"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/circle.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"result":{"covered_percent": 0.00}}
|
@@ -0,0 +1,67 @@
|
|
1
|
+
module SourceFinder
|
2
|
+
# Give configuration, finds source file locations by using an
|
3
|
+
# inclusion and exclusion glob
|
4
|
+
class SourceFileGlobber
|
5
|
+
# See README.md for documentation on these configuration parameters.
|
6
|
+
|
7
|
+
attr_accessor :ruby_dirs, :source_dirs, :extra_files, :extra_ruby_files,
|
8
|
+
:ruby_file_extensions, :source_file_extensions, :exclude_files
|
9
|
+
|
10
|
+
def ruby_dirs
|
11
|
+
@ruby_dirs ||= %w(src app lib test spec feature)
|
12
|
+
end
|
13
|
+
|
14
|
+
def source_dirs
|
15
|
+
@source_dirs ||= ruby_dirs.clone
|
16
|
+
end
|
17
|
+
|
18
|
+
def extra_files
|
19
|
+
@extra_files ||= extra_ruby_files.clone.concat(%w(Dockerfile))
|
20
|
+
end
|
21
|
+
|
22
|
+
def extra_ruby_files
|
23
|
+
@extra_ruby_files ||= %w(Rakefile)
|
24
|
+
end
|
25
|
+
|
26
|
+
def exclude_files
|
27
|
+
@exclude_files ||= []
|
28
|
+
end
|
29
|
+
|
30
|
+
def source_file_extensions
|
31
|
+
@source_file_extensions ||=
|
32
|
+
"#{ruby_file_extensions},swift,cpp,c,java,py,clj,cljs,scala,js," \
|
33
|
+
'yml,sh,json'
|
34
|
+
end
|
35
|
+
|
36
|
+
def source_files_glob(extra_source_files = extra_files,
|
37
|
+
dirs = source_dirs,
|
38
|
+
extensions = source_file_extensions)
|
39
|
+
"{#{extra_source_files.join(',')}," \
|
40
|
+
"{*,.*}.{#{extensions}}," +
|
41
|
+
File.join("{#{dirs.join(',')}}",
|
42
|
+
'**',
|
43
|
+
"{*,.*}.{#{extensions}}") +
|
44
|
+
'}'
|
45
|
+
end
|
46
|
+
|
47
|
+
def source_files_exclude_glob
|
48
|
+
"{#{exclude_files.join(', ')}}"
|
49
|
+
end
|
50
|
+
|
51
|
+
def ruby_file_extensions
|
52
|
+
@ruby_file_extensions ||= 'rb,rake,gemspec'
|
53
|
+
end
|
54
|
+
|
55
|
+
def ruby_files_glob
|
56
|
+
source_files_glob(extra_ruby_files, ruby_dirs, ruby_file_extensions)
|
57
|
+
end
|
58
|
+
|
59
|
+
def ruby_files
|
60
|
+
(@globber.glob(ruby_files_glob) - exclude_files).join(' ')
|
61
|
+
end
|
62
|
+
|
63
|
+
def initialize(globber: fail)
|
64
|
+
@globber = globber
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
data/lib/tasks/ci.rake
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
task ci: :localtest
|
@@ -0,0 +1 @@
|
|
1
|
+
task default: :localtest
|
@@ -0,0 +1 @@
|
|
1
|
+
task localtest: [:clear_metrics, :spec, :quality]
|
data/lib/tasks/spec.rake
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
300
|
@@ -0,0 +1 @@
|
|
1
|
+
0
|
@@ -0,0 +1 @@
|
|
1
|
+
0
|
@@ -0,0 +1 @@
|
|
1
|
+
0
|
@@ -0,0 +1 @@
|
|
1
|
+
0
|
@@ -0,0 +1 @@
|
|
1
|
+
1
|
@@ -0,0 +1 @@
|
|
1
|
+
2
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'source_finder/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'source_finder'
|
8
|
+
spec.version = SourceFinder::VERSION
|
9
|
+
spec.authors = ['Vince Broz']
|
10
|
+
spec.email = ['vince@broz.cc']
|
11
|
+
|
12
|
+
spec.summary = 'SourceFinder finds source and documentation files ' \
|
13
|
+
'within a project.'
|
14
|
+
spec.homepage = 'https://github.com/apiology/source_finder'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = 'exe'
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ['lib']
|
23
|
+
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.10'
|
25
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
26
|
+
spec.add_development_dependency 'quality'
|
27
|
+
spec.add_development_dependency 'rspec'
|
28
|
+
spec.add_development_dependency 'simplecov'
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,145 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: source_finder
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Vince Broz
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-09-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.10'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: quality
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description:
|
84
|
+
email:
|
85
|
+
- vince@broz.cc
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- .gitignore
|
91
|
+
- .rubocop.yml
|
92
|
+
- .ruby-version
|
93
|
+
- .travis.yml
|
94
|
+
- CODE_OF_CONDUCT.md
|
95
|
+
- Gemfile
|
96
|
+
- LICENSE.txt
|
97
|
+
- README.md
|
98
|
+
- Rakefile
|
99
|
+
- bin/console
|
100
|
+
- bin/setup
|
101
|
+
- circle.yml
|
102
|
+
- coverage/.last_run.json
|
103
|
+
- lib/source_finder.rb
|
104
|
+
- lib/source_finder/source_file_globber.rb
|
105
|
+
- lib/source_finder/version.rb
|
106
|
+
- lib/tasks/ci.rake
|
107
|
+
- lib/tasks/clear_metrics.rake
|
108
|
+
- lib/tasks/default.rake
|
109
|
+
- lib/tasks/feature.rake
|
110
|
+
- lib/tasks/localtest.rake
|
111
|
+
- lib/tasks/quality.rake
|
112
|
+
- lib/tasks/spec.rake
|
113
|
+
- metrics/bigfiles_high_water_mark
|
114
|
+
- metrics/brakeman_high_water_mark
|
115
|
+
- metrics/cane_high_water_mark
|
116
|
+
- metrics/flay_high_water_mark
|
117
|
+
- metrics/flog_high_water_mark
|
118
|
+
- metrics/punchlist_high_water_mark
|
119
|
+
- metrics/rubocop_high_water_mark
|
120
|
+
- source_finder.gemspec
|
121
|
+
homepage: https://github.com/apiology/source_finder
|
122
|
+
licenses:
|
123
|
+
- MIT
|
124
|
+
metadata: {}
|
125
|
+
post_install_message:
|
126
|
+
rdoc_options: []
|
127
|
+
require_paths:
|
128
|
+
- lib
|
129
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - '>='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
requirements: []
|
140
|
+
rubyforge_project:
|
141
|
+
rubygems_version: 2.4.6
|
142
|
+
signing_key:
|
143
|
+
specification_version: 4
|
144
|
+
summary: SourceFinder finds source and documentation files within a project.
|
145
|
+
test_files: []
|