redisearch-rails 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80ed5e878885bad58d57c08681958ebc92d7b22b94b521e4ec557ba413b2e803
4
- data.tar.gz: 96a9a50acea570e90cf15ab24440523f1068c98247ab5227b9de09b89b014578
3
+ metadata.gz: '08ae96ed9f5d7036aad94a3963da45cec27e49590fedefbed55a60bd499f488b'
4
+ data.tar.gz: 2edcd21c9630847d45069fb0c4c5bc72c38bb1adc06aa2ee4a6744d277380b8d
5
5
  SHA512:
6
- metadata.gz: b5360060c9f62658e24d83c5f2f867b2240686872b961d8cee58b58801b50c3d23e06631a46a762a5b1b96dd0ab3ace6b05f99c2c35b0314cc6f7cb52b7847fb
7
- data.tar.gz: 2ca94e58f7dc8747df3690b954b13b70b3ee21c9ed71ca4dd2fe9728edb35ee28801efd2c9b74bceb074c881e2bf07f22eea4289b9189f14cf107ded67b29fa4
6
+ metadata.gz: 45aba119df5a95c0f5be05163ea13ed160e7f5a855100f76ad831019a42d3abd67e651f7070da40895a3769b36c21498aba810ba9145e017e5f16b6a4671f670
7
+ data.tar.gz: 30ebd3627d3efebc36d191ae04edada8115d946db74f1111f16dc56ef6b779763187908b351e6ca8d2412bf92ad275cc2a6be0c838a919b1e6a43b729a27a562
data/.gitignore CHANGED
@@ -1,64 +1,12 @@
1
- *.gem
2
- *.rbc
3
- /.config
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
4
  /coverage/
5
- /InstalledFiles
5
+ /doc/
6
6
  /pkg/
7
7
  /spec/reports/
8
- /spec/examples.txt
9
- /test/tmp/
10
- /test/version_tmp/
11
8
  /tmp/
12
9
 
13
- # Used by dotenv library to load environment variables.
14
- # .env
15
-
16
- # Ignore Byebug command history file.
17
- .byebug_history
18
-
19
- ## Specific to RubyMotion:
20
- .dat*
21
- .repl_history
22
- build/
23
- *.bridgesupport
24
- build-iPhoneOS/
25
- build-iPhoneSimulator/
26
-
27
- ## Specific to RubyMotion (use of CocoaPods):
28
- #
29
- # We recommend against adding the Pods directory to your .gitignore. However
30
- # you should judge for yourself, the pros and cons are mentioned at:
31
- # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
32
- #
33
- # vendor/Pods/
34
-
35
- ## Documentation cache and generated files:
36
- /.yardoc/
37
- /_yardoc/
38
- /doc/
39
- /rdoc/
40
-
41
- ## Environment normalization:
42
- /.bundle/
43
- /vendor/bundle
44
- /lib/bundler/man/
45
-
46
- # for a library or gem, you might want to ignore these files since the code is
47
- # intended to run in multiple environments; otherwise, check them in:
48
- # Gemfile.lock
49
- # .ruby-version
50
- # .ruby-gemset
51
-
52
- # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
53
- .rvmrc
54
-
55
- # Used by RuboCop. Remote config files pulled in from inherit_from directive.
56
- # .rubocop-https?--*
57
-
58
- *.gem
59
- .bundle
10
+ # rspec failure tracking
11
+ .rspec_status
60
12
  Gemfile.lock
61
- pkg/*
62
- coverage/*
63
- .DS_Store
64
- .byebug_history
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.6.1
7
+ before_install: gem install bundler -v 1.17.2
@@ -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 pbeckmann@ticketplus.cl. 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,14 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in redisearch-rails.gemspec
6
+ gemspec
7
+
8
+ # Hinting at development dependencies
9
+ # Prevents bundler from taking a long-time to resolve
10
+ group :development, :test do
11
+ gem 'sqlite3', '~> 1.3.8', :platforms => :ruby
12
+ gem 'pry'
13
+ gem 'rspec'
14
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Patricio Beckmann
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 CHANGED
@@ -1 +1,43 @@
1
- # redisearch-rails
1
+ # Redisearch::Rails
2
+
3
+ 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/redisearch/rails`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'redisearch-rails'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install redisearch-rails
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ 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.
30
+
31
+ 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).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/pbeckmann/redisearch-rails. 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.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the Redisearch::Rails project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/pbeckmann/redisearch-rails/blob/master/CODE_OF_CONDUCT.md).
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 "redisearch-rails"
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
@@ -2,6 +2,8 @@ require 'redisearch-rails/configuration'
2
2
 
3
3
  require "active_support/lazy_load_hooks"
4
4
 
5
+ require 'redi_searcher'
6
+
5
7
  module RediSearch
6
8
  autoload :RediSearchable, 'redisearch-rails/redisearchable'
7
9
 
@@ -23,6 +25,6 @@ module RediSearch
23
25
  end
24
26
  end
25
27
 
26
- ActiveSupport.on_load(:active_record) do
28
+ ActiveSupport.on_load(:active_record) do
27
29
  include RediSearch::RediSearchable
28
30
  end
@@ -1,5 +1,9 @@
1
1
  module RediSearch
2
2
  class Configuration
3
3
  attr_accessor :redis_config
4
+
5
+ def initialize
6
+ @redis_config = {}
7
+ end
4
8
  end
5
9
  end
@@ -26,6 +26,10 @@ module RediSearch
26
26
  self.find(result)
27
27
  end
28
28
 
29
+ def redisearch_count
30
+ redisearch_index.search('*').shift
31
+ end
32
+
29
33
  # Reindex all
30
34
  def reindex(recreate: false, only: [], **options)
31
35
  index = redisearch_index
@@ -40,6 +44,7 @@ module RediSearch
40
44
  end
41
45
  end
42
46
  end
47
+ true
43
48
  end
44
49
  end
45
50
  end
@@ -1,3 +1,3 @@
1
1
  module RediSearch
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
@@ -1,25 +1,34 @@
1
1
  # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
4
  require "redisearch-rails/version"
4
5
 
5
- Gem::Specification.new do |s|
6
- s.name = "redisearch-rails"
7
- s.version = RediSearch::VERSION
8
- s.platform = Gem::Platform::RUBY
9
- s.authors = ["Patricio Beckmann"]
10
- s.email = ["pato.beckmann@gmail.com"]
11
- s.homepage = "https://github.com/Ticketplus/redisearch-rails"
12
- s.summary = %q{RediSearch on Rails}
13
- s.description = %q{'Index and search Rails models on redisearch'}
14
- s.required_ruby_version = '>= 2.3'
15
- s.license = 'MIT'
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "redisearch-rails"
8
+ spec.version = RediSearch::VERSION
9
+ spec.authors = ["Patricio Beckmann"]
10
+ spec.email = ["pato.beckmann@gmail.com"]
16
11
 
17
- s.add_dependency 'activerecord', '~> 4.2'
18
- s.add_dependency 'activesupport', '~> 4.2'
12
+ spec.summary = %q{RediSearch on Rails}
13
+ spec.description = %q{'Index and search Rails models on redisearch'}
14
+ spec.homepage = "https://github.com/Ticketplus/redisearch-rails"
15
+ spec.required_ruby_version = '>= 2.3'
16
+ spec.license = "MIT"
19
17
 
20
- s.add_dependency "redi_searcher", '~> 0.1', '>= 0.1.1'
18
+ # Specify which files should be added to the gem when it is released.
19
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
21
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
+ end
23
+ spec.bindir = "exe"
24
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
+ spec.require_paths = ["lib"]
21
26
 
22
- s.files = `git ls-files`.split("\n").reject { |f| f.match(%r{^(spec/)}) }
27
+ spec.add_dependency 'activerecord', '~> 4.2'
28
+ spec.add_dependency 'activesupport', '~> 4.2'
29
+ spec.add_dependency 'redi_searcher', '~> 0.1', '>= 0.1.3'
23
30
 
24
- s.require_paths = ["lib"]
31
+ spec.add_development_dependency "bundler", "~> 1.17"
32
+ spec.add_development_dependency "rake", "~> 10.0"
33
+ spec.add_development_dependency "rspec", "~> 3.0"
25
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redisearch-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patricio Beckmann
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-26 00:00:00.000000000 Z
11
+ date: 2020-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -47,7 +47,7 @@ dependencies:
47
47
  version: '0.1'
48
48
  - - ">="
49
49
  - !ruby/object:Gem::Version
50
- version: 0.1.1
50
+ version: 0.1.3
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
@@ -57,7 +57,49 @@ dependencies:
57
57
  version: '0.1'
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: 0.1.1
60
+ version: 0.1.3
61
+ - !ruby/object:Gem::Dependency
62
+ name: bundler
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '1.17'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '1.17'
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'
61
103
  description: "'Index and search Rails models on redisearch'"
62
104
  email:
63
105
  - pato.beckmann@gmail.com
@@ -66,8 +108,16 @@ extensions: []
66
108
  extra_rdoc_files: []
67
109
  files:
68
110
  - ".gitignore"
111
+ - ".rspec"
112
+ - ".travis.yml"
113
+ - CODE_OF_CONDUCT.md
114
+ - Gemfile
69
115
  - LICENSE
116
+ - LICENSE.txt
70
117
  - README.md
118
+ - Rakefile
119
+ - bin/console
120
+ - bin/setup
71
121
  - lib/redisearch-rails.rb
72
122
  - lib/redisearch-rails/configuration.rb
73
123
  - lib/redisearch-rails/redisearchable.rb