clairvoyance 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e4f8d157f529fa4ea1c04bc0f25b55c7ff7a1578
4
+ data.tar.gz: 7ccf558a65773c87826ea2f2eca95d17e89a81e3
5
+ SHA512:
6
+ metadata.gz: d2196458d520f3b2ef911cb1bcfd8b43c4766a168337fff932eb74666f23e8a36ed4465591d89ba5146c6cfd325f5bce8a5f2d4f84f48fd7b87058f387bcf7f9
7
+ data.tar.gz: ee711440762f775c549198ff06d197823d05a0c20eb00b7e7e6ccce0d324d9f8eaa528429baac513a8289d284323d7e0517de5a9747515efe2f351178a135fa0
data/.codeclimate.yml ADDED
@@ -0,0 +1,16 @@
1
+ ---
2
+ engines:
3
+ duplication:
4
+ enabled: true
5
+ config:
6
+ languages:
7
+ - ruby
8
+ fixme:
9
+ enabled: true
10
+ rubocop:
11
+ enabled: true
12
+ ratings:
13
+ paths:
14
+ - "**.rb"
15
+ exclude_paths:
16
+ - spec/
data/.gitignore ADDED
@@ -0,0 +1,52 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ # Used by dotenv library to load environment variables.
14
+ # .env
15
+
16
+ ## Specific to RubyMotion:
17
+ .dat*
18
+ .repl_history
19
+ build/
20
+ *.bridgesupport
21
+ build-iPhoneOS/
22
+ build-iPhoneSimulator/
23
+
24
+ ## Specific to RubyMotion (use of CocoaPods):
25
+ #
26
+ # We recommend against adding the Pods directory to your .gitignore. However
27
+ # you should judge for yourself, the pros and cons are mentioned at:
28
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
29
+ #
30
+ # vendor/Pods/
31
+
32
+ ## Documentation cache and generated files:
33
+ /.yardoc/
34
+ /_yardoc/
35
+ /doc/
36
+ /rdoc/
37
+
38
+ ## Environment normalization:
39
+ /.bundle/
40
+ /vendor/bundle
41
+ /lib/bundler/man/
42
+
43
+ # for a library or gem, you might want to ignore these files since the code is
44
+ # intended to run in multiple environments; otherwise, check them in:
45
+ # Gemfile.lock
46
+ # .ruby-version
47
+ # .ruby-gemset
48
+
49
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
+ .rvmrc
51
+ .rspec_status
52
+ .idea
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --order rand
data/.rubocop.yml ADDED
@@ -0,0 +1,11 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.4
3
+ DisplayCopNames: true
4
+ Exclude:
5
+ - 'spec/dummy/**/*'
6
+
7
+ Style/StringLiterals:
8
+ Enabled: false
9
+
10
+ Metrics/LineLength:
11
+ Max: 100
data/.travis.yml ADDED
@@ -0,0 +1,16 @@
1
+ sudo: false
2
+ language: ruby
3
+ env:
4
+ global:
5
+ - CC_TEST_REPORTER_ID=52f289e0cf6b23ae24b930ae8a00e512a022d1b85727cc62de4e2c30bbcaecb4
6
+ rvm:
7
+ - 2.4.2
8
+ before_install:
9
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
10
+ - chmod +x ./cc-test-reporter
11
+ - ./cc-test-reporter before-build
12
+ - gem install bundler
13
+ script:
14
+ - bundle exec rspec
15
+ after_script:
16
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at marcelo.perini.veloso@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ platforms :ruby do
6
+ gem 'sqlite3'
7
+ end
8
+
9
+ gem 'rails', '~> 5.0'
data/Gemfile.lock ADDED
@@ -0,0 +1,189 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ clairvoyance (0.0.0)
5
+ actionpack (~> 5.0)
6
+ activesupport (~> 5.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actioncable (5.1.4)
12
+ actionpack (= 5.1.4)
13
+ nio4r (~> 2.0)
14
+ websocket-driver (~> 0.6.1)
15
+ actionmailer (5.1.4)
16
+ actionpack (= 5.1.4)
17
+ actionview (= 5.1.4)
18
+ activejob (= 5.1.4)
19
+ mail (~> 2.5, >= 2.5.4)
20
+ rails-dom-testing (~> 2.0)
21
+ actionpack (5.1.4)
22
+ actionview (= 5.1.4)
23
+ activesupport (= 5.1.4)
24
+ rack (~> 2.0)
25
+ rack-test (>= 0.6.3)
26
+ rails-dom-testing (~> 2.0)
27
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
28
+ actionview (5.1.4)
29
+ activesupport (= 5.1.4)
30
+ builder (~> 3.1)
31
+ erubi (~> 1.4)
32
+ rails-dom-testing (~> 2.0)
33
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
34
+ activejob (5.1.4)
35
+ activesupport (= 5.1.4)
36
+ globalid (>= 0.3.6)
37
+ activemodel (5.1.4)
38
+ activesupport (= 5.1.4)
39
+ activerecord (5.1.4)
40
+ activemodel (= 5.1.4)
41
+ activesupport (= 5.1.4)
42
+ arel (~> 8.0)
43
+ activesupport (5.1.4)
44
+ concurrent-ruby (~> 1.0, >= 1.0.2)
45
+ i18n (~> 0.7)
46
+ minitest (~> 5.1)
47
+ tzinfo (~> 1.1)
48
+ addressable (2.5.2)
49
+ public_suffix (>= 2.0.2, < 4.0)
50
+ ammeter (1.1.4)
51
+ activesupport (>= 3.0)
52
+ railties (>= 3.0)
53
+ rspec-rails (>= 2.2)
54
+ arel (8.0.0)
55
+ ast (2.4.0)
56
+ builder (3.2.3)
57
+ capybara (2.18.0)
58
+ addressable
59
+ mini_mime (>= 0.1.3)
60
+ nokogiri (>= 1.3.3)
61
+ rack (>= 1.0.0)
62
+ rack-test (>= 0.5.4)
63
+ xpath (>= 2.0, < 4.0)
64
+ concurrent-ruby (1.0.5)
65
+ crass (1.0.3)
66
+ diff-lcs (1.3)
67
+ docile (1.3.0)
68
+ erubi (1.7.0)
69
+ globalid (0.4.1)
70
+ activesupport (>= 4.2.0)
71
+ i18n (0.9.1)
72
+ concurrent-ruby (~> 1.0)
73
+ json (2.1.0)
74
+ loofah (2.1.1)
75
+ crass (~> 1.0.2)
76
+ nokogiri (>= 1.5.9)
77
+ mail (2.7.0)
78
+ mini_mime (>= 0.1.1)
79
+ method_source (0.9.0)
80
+ mini_mime (1.0.0)
81
+ mini_portile2 (2.3.0)
82
+ minitest (5.11.1)
83
+ nio4r (2.2.0)
84
+ nokogiri (1.8.1)
85
+ mini_portile2 (~> 2.3.0)
86
+ parallel (1.12.1)
87
+ parser (2.5.0.5)
88
+ ast (~> 2.4.0)
89
+ powerpack (0.1.1)
90
+ public_suffix (3.0.2)
91
+ rack (2.0.3)
92
+ rack-test (0.8.2)
93
+ rack (>= 1.0, < 3)
94
+ rails (5.1.4)
95
+ actioncable (= 5.1.4)
96
+ actionmailer (= 5.1.4)
97
+ actionpack (= 5.1.4)
98
+ actionview (= 5.1.4)
99
+ activejob (= 5.1.4)
100
+ activemodel (= 5.1.4)
101
+ activerecord (= 5.1.4)
102
+ activesupport (= 5.1.4)
103
+ bundler (>= 1.3.0)
104
+ railties (= 5.1.4)
105
+ sprockets-rails (>= 2.0.0)
106
+ rails-dom-testing (2.0.3)
107
+ activesupport (>= 4.2.0)
108
+ nokogiri (>= 1.6)
109
+ rails-html-sanitizer (1.0.3)
110
+ loofah (~> 2.0)
111
+ railties (5.1.4)
112
+ actionpack (= 5.1.4)
113
+ activesupport (= 5.1.4)
114
+ method_source
115
+ rake (>= 0.8.7)
116
+ thor (>= 0.18.1, < 2.0)
117
+ rainbow (3.0.0)
118
+ rake (10.5.0)
119
+ rspec (3.7.0)
120
+ rspec-core (~> 3.7.0)
121
+ rspec-expectations (~> 3.7.0)
122
+ rspec-mocks (~> 3.7.0)
123
+ rspec-core (3.7.0)
124
+ rspec-support (~> 3.7.0)
125
+ rspec-expectations (3.7.0)
126
+ diff-lcs (>= 1.2.0, < 2.0)
127
+ rspec-support (~> 3.7.0)
128
+ rspec-mocks (3.7.0)
129
+ diff-lcs (>= 1.2.0, < 2.0)
130
+ rspec-support (~> 3.7.0)
131
+ rspec-rails (3.7.2)
132
+ actionpack (>= 3.0)
133
+ activesupport (>= 3.0)
134
+ railties (>= 3.0)
135
+ rspec-core (~> 3.7.0)
136
+ rspec-expectations (~> 3.7.0)
137
+ rspec-mocks (~> 3.7.0)
138
+ rspec-support (~> 3.7.0)
139
+ rspec-support (3.7.0)
140
+ rubocop (0.54.0)
141
+ parallel (~> 1.10)
142
+ parser (>= 2.5)
143
+ powerpack (~> 0.1)
144
+ rainbow (>= 2.2.2, < 4.0)
145
+ ruby-progressbar (~> 1.7)
146
+ unicode-display_width (~> 1.0, >= 1.0.1)
147
+ ruby-progressbar (1.9.0)
148
+ simplecov (0.16.1)
149
+ docile (~> 1.1)
150
+ json (>= 1.8, < 3)
151
+ simplecov-html (~> 0.10.0)
152
+ simplecov-html (0.10.2)
153
+ sprockets (3.7.1)
154
+ concurrent-ruby (~> 1.0)
155
+ rack (> 1, < 3)
156
+ sprockets-rails (3.2.1)
157
+ actionpack (>= 4.0)
158
+ activesupport (>= 4.0)
159
+ sprockets (>= 3.0.0)
160
+ sqlite3 (1.3.13)
161
+ thor (0.20.0)
162
+ thread_safe (0.3.6)
163
+ tzinfo (1.2.4)
164
+ thread_safe (~> 0.1)
165
+ unicode-display_width (1.3.0)
166
+ websocket-driver (0.6.5)
167
+ websocket-extensions (>= 0.1.0)
168
+ websocket-extensions (0.1.3)
169
+ xpath (3.0.0)
170
+ nokogiri (~> 1.8)
171
+
172
+ PLATFORMS
173
+ ruby
174
+
175
+ DEPENDENCIES
176
+ ammeter (~> 1.1, >= 1.1.4)
177
+ bundler (~> 1.14)
178
+ capybara (~> 2.18)
179
+ clairvoyance!
180
+ rails (~> 5.0)
181
+ rake (~> 10.0)
182
+ rspec (~> 3.0)
183
+ rspec-rails (~> 3.7, >= 3.7.2)
184
+ rubocop (~> 0.54.0)
185
+ simplecov (~> 0.16.1)
186
+ sqlite3
187
+
188
+ BUNDLED WITH
189
+ 1.16.1
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 Marcelo Perini Veloso
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/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Marcelo Perini Veloso
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,46 @@
1
+ # Clairvoyance
2
+
3
+ [![Build Status](https://travis-ci.org/marceloperini/clairvoyance.svg?branch=master)](https://travis-ci.org/marceloperini/clairvoyance)
4
+ [![Maintainability](https://api.codeclimate.com/v1/badges/4230f269e5249ba001ea/maintainability)](https://codeclimate.com/github/marceloperini/clairvoyance/maintainability)
5
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/4230f269e5249ba001ea/test_coverage)](https://codeclimate.com/github/marceloperini/clairvoyance/test_coverage)
6
+
7
+ Clairvoyance your controllers searches
8
+
9
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/clairvoyance`. To experiment with that code, run `bin/console` for an interactive prompt.
10
+
11
+ TODO: Delete this and the text above, and describe your gem
12
+
13
+ ## Installation
14
+
15
+ Add this line to your application's Gemfile:
16
+
17
+ ```ruby
18
+ gem 'clairvoyance'
19
+ ```
20
+
21
+ And then execute:
22
+
23
+ $ bundle
24
+
25
+ Or install it yourself as:
26
+
27
+ $ gem install clairvoyance
28
+
29
+ ## Usage
30
+
31
+ TODO: Write usage instructions here
32
+
33
+ ## Development
34
+
35
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
36
+
37
+ 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`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
38
+
39
+ ## Contributing
40
+
41
+ Bug reports and pull requests are welcome on GitHub at https://github.com/marceloperini/clairvoyance. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
42
+
43
+
44
+ ## License
45
+
46
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "clairvoyance"
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(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,45 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'clairvoyance/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'clairvoyance'
7
+ spec.version = Clairvoyance::VERSION
8
+ spec.authors = ['Marcelo Perini Veloso']
9
+ spec.email = ['marcelo.perini.veloso@gmail.com']
10
+
11
+ spec.summary = 'Clairvoyance your controllers searches'
12
+ spec.description = 'Generate finders files to your controllers searches'
13
+ spec.homepage = 'https://github.com/marceloperini/clairvoyance'
14
+ spec.license = 'MIT'
15
+
16
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the
17
+ # 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing
19
+ # to any host.
20
+ # if spec.respond_to?(:metadata)
21
+ # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
22
+ # else
23
+ # raise 'RubyGems 2.0 or newer is required to protect against ' \
24
+ # 'public gem pushes.'
25
+ # end
26
+
27
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
28
+ f.match(%r{^(test|spec|features)/})
29
+ end
30
+
31
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
+ spec.require_paths = ['lib']
33
+
34
+ spec.add_dependency 'activesupport', '~> 5.0'
35
+ spec.add_dependency 'actionpack', '~> 5.0'
36
+
37
+ spec.add_development_dependency 'bundler', '~> 1.14'
38
+ spec.add_development_dependency 'ammeter', '~> 1.1', '>= 1.1.4'
39
+ spec.add_development_dependency 'rake', '~> 10.0'
40
+ spec.add_development_dependency 'rspec', '~> 3.0'
41
+ spec.add_development_dependency 'rspec-rails', '~> 3.7', '>= 3.7.2'
42
+ spec.add_development_dependency 'capybara', '~> 2.18'
43
+ spec.add_development_dependency 'rubocop', '~> 0.54.0'
44
+ spec.add_development_dependency 'simplecov', '~> 0.16.1'
45
+ end
@@ -0,0 +1,6 @@
1
+ require 'clairvoyance/version'
2
+ require 'clairvoyance/configuration'
3
+ # require 'generators/rails/finder_generator'
4
+
5
+ module Clairvoyance
6
+ end
@@ -0,0 +1,4 @@
1
+ module Clairvoyance
2
+ module Configuration
3
+ end
4
+ end
@@ -0,0 +1,3 @@
1
+ module Clairvoyance
2
+ VERSION = "0.0.0"
3
+ end
@@ -0,0 +1,14 @@
1
+ module Clairvoyance
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+ source_root File.expand_path('templates', __dir__)
5
+
6
+ desc 'Creates an ApplicationFinder, if none exists.'
7
+
8
+ def create_application_finder
9
+ file = 'application_finder.rb'
10
+ copy_file file, "app/finders/#{file}"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationFinder < Clairvoyance::Finder
2
+
3
+ end
@@ -0,0 +1,17 @@
1
+ require "rails/generators"
2
+ require "rails/generators/rails/controller/controller_generator"
3
+ require "rails/generators/rails/scaffold_controller/scaffold_controller_generator"
4
+
5
+ module Rails
6
+ module Generators
7
+ class ControllerGenerator
8
+ hook_for :finder, type: :boolena, default: true do |generator|
9
+ invoke generator, [name.singularize]
10
+ end
11
+ end
12
+
13
+ class ScaffoldControllerGenerator
14
+ hook_for :decorator, type: :boolean, default: true
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,29 @@
1
+ module Rails
2
+ module Generators
3
+ class FinderGenerator < NamedBase
4
+ source_root File.expand_path('templates', __dir__)
5
+ check_class_collision suffix: 'Finder'
6
+
7
+ class_option :parent, type: :string, desc: "The parent class for the generated finder"
8
+
9
+ def create_finder_file
10
+ template 'finder.rb', File.join('app/finders', class_path, "#{file_name}_finder.rb")
11
+ end
12
+
13
+ hook_for :test_framework
14
+
15
+ private
16
+
17
+ def parent_class_name
18
+ options.fetch('parent') do
19
+ begin
20
+ require 'application_finder'
21
+ ApplicationFinder
22
+ rescue LoadError
23
+ 'Clairvoyance::Finder'
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,9 @@
1
+ <%- module_namespacing do -%>
2
+ <%- if parent_class_name.present? -%>
3
+ class <%= class_name %>Finder < <%= parent_class_name %>
4
+ <%- else -%>
5
+ class <%= class_name %>
6
+ <%- end -%>
7
+
8
+ end
9
+ <% end -%>
@@ -0,0 +1,11 @@
1
+ module Rspec
2
+ module Generators
3
+ class FinderGenerator < ::Rails::Generators::NamedBase
4
+ source_root File.expand_path('templates', __dir__)
5
+
6
+ def create_spec_file
7
+ template 'finder_spec.rb', File.join('spec/finders', class_path, "#{singular_name}_finder_spec.rb")
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,4 @@
1
+ require 'rails_helper'
2
+
3
+ RSpec.describe <%= class_name %>Finder do
4
+ end
metadata ADDED
@@ -0,0 +1,221 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: clairvoyance
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Marcelo Perini Veloso
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-03-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: actionpack
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '5.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '5.0'
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.14'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.14'
55
+ - !ruby/object:Gem::Dependency
56
+ name: ammeter
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.1'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 1.1.4
65
+ type: :development
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '1.1'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 1.1.4
75
+ - !ruby/object:Gem::Dependency
76
+ name: rake
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '10.0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '10.0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: rspec
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '3.0'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '3.0'
103
+ - !ruby/object:Gem::Dependency
104
+ name: rspec-rails
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '3.7'
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: 3.7.2
113
+ type: :development
114
+ prerelease: false
115
+ version_requirements: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - "~>"
118
+ - !ruby/object:Gem::Version
119
+ version: '3.7'
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: 3.7.2
123
+ - !ruby/object:Gem::Dependency
124
+ name: capybara
125
+ requirement: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - "~>"
128
+ - !ruby/object:Gem::Version
129
+ version: '2.18'
130
+ type: :development
131
+ prerelease: false
132
+ version_requirements: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - "~>"
135
+ - !ruby/object:Gem::Version
136
+ version: '2.18'
137
+ - !ruby/object:Gem::Dependency
138
+ name: rubocop
139
+ requirement: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - "~>"
142
+ - !ruby/object:Gem::Version
143
+ version: 0.54.0
144
+ type: :development
145
+ prerelease: false
146
+ version_requirements: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - "~>"
149
+ - !ruby/object:Gem::Version
150
+ version: 0.54.0
151
+ - !ruby/object:Gem::Dependency
152
+ name: simplecov
153
+ requirement: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - "~>"
156
+ - !ruby/object:Gem::Version
157
+ version: 0.16.1
158
+ type: :development
159
+ prerelease: false
160
+ version_requirements: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - "~>"
163
+ - !ruby/object:Gem::Version
164
+ version: 0.16.1
165
+ description: Generate finders files to your controllers searches
166
+ email:
167
+ - marcelo.perini.veloso@gmail.com
168
+ executables: []
169
+ extensions: []
170
+ extra_rdoc_files: []
171
+ files:
172
+ - ".codeclimate.yml"
173
+ - ".gitignore"
174
+ - ".rspec"
175
+ - ".rubocop.yml"
176
+ - ".travis.yml"
177
+ - CODE_OF_CONDUCT.md
178
+ - Gemfile
179
+ - Gemfile.lock
180
+ - LICENSE
181
+ - LICENSE.txt
182
+ - README.md
183
+ - Rakefile
184
+ - bin/console
185
+ - bin/setup
186
+ - clairvoyance.gemspec
187
+ - lib/clairvoyance.rb
188
+ - lib/clairvoyance/configuration.rb
189
+ - lib/clairvoyance/version.rb
190
+ - lib/generators/clairvoyance/install_generator.rb
191
+ - lib/generators/clairvoyance/templates/application_finder.rb
192
+ - lib/generators/controller_override.rb
193
+ - lib/generators/rails/finder_generator.rb
194
+ - lib/generators/rails/templates/finder.rb
195
+ - lib/generators/rspec/finder_generator.rb
196
+ - lib/generators/rspec/templates/finder_spec.rb
197
+ homepage: https://github.com/marceloperini/clairvoyance
198
+ licenses:
199
+ - MIT
200
+ metadata: {}
201
+ post_install_message:
202
+ rdoc_options: []
203
+ require_paths:
204
+ - lib
205
+ required_ruby_version: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - ">="
208
+ - !ruby/object:Gem::Version
209
+ version: '0'
210
+ required_rubygems_version: !ruby/object:Gem::Requirement
211
+ requirements:
212
+ - - ">="
213
+ - !ruby/object:Gem::Version
214
+ version: '0'
215
+ requirements: []
216
+ rubyforge_project:
217
+ rubygems_version: 2.6.14
218
+ signing_key:
219
+ specification_version: 4
220
+ summary: Clairvoyance your controllers searches
221
+ test_files: []