rails_cve 0.0.2 → 0.0.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
  SHA1:
3
- metadata.gz: ee33e9208ca227aaa6caceead83033303a54fc79
4
- data.tar.gz: c3631d55f3581dc8998df794fe81541b08796c26
3
+ metadata.gz: 1c029756d626fb174a6de2f71dfdaff1f81d25bd
4
+ data.tar.gz: 4f5f4919e99684fdeb384d65db5717c74f686319
5
5
  SHA512:
6
- metadata.gz: 73903c5d2356ad202bdd45dbdb5c76ab879ee380e8255bd2dca97f97dab7e45c97b099a06a22143b52582fd44459e750745bb030d09717b653428ff2015cc2d4
7
- data.tar.gz: 1dd6b542fb355d3a06d3b97051efc1ee9168c02dd7f4bf259719bcb9ea821912d71eb0f109e0fbabf86dcba1d5a9e17eaace7848fce185cdade3865dfdef0354
6
+ metadata.gz: 5d4f17f1c5c038c3f2a04cb161febdb7b15fff2f9429d334a0d04e93c6f297c1f9ee9bb10bd5f653a8f3b1287e4c30bb9edc60f8cfda4454df46cba2ad08670a
7
+ data.tar.gz: 43a59a3228c7c6bd8c57f121900b6d2f8c06f4c338da2402971bbafa6ff922872024d508761334997276f2c9766ede125dd934d869630b434cc4fd436517b2b1
data/CHANGELOG.md ADDED
@@ -0,0 +1,20 @@
1
+ ### 0.0.3 (2014-04-28)
2
+
3
+ * enhancements
4
+ * change `to_tsvector` to use "simple" dictionary, to avoid unwanted stemming
5
+
6
+ * bug fixes
7
+ * RailsCVE now does not append its migrations to the app's migrations.
8
+
9
+ You'll need to copy the migrations initially (as mentioned in the README.md),
10
+ otherwise, a `rake db:migrate` would *always* execute the RailsCVE migrations,
11
+ which in turn will fail ("table rails_cve_entries already exists").
12
+
13
+ ### 0.0.2 (2014-04-08)
14
+
15
+ * enhancements
16
+ * added better text search queries
17
+
18
+ ### 0.0.1 (2014-04-08)
19
+
20
+ * initial release
data/README.md CHANGED
@@ -93,6 +93,7 @@ gem 'rails-cve'
93
93
  Then install and run the migrations via
94
94
 
95
95
  ```
96
+ rake rails_cve:install:migrations
96
97
  rake db:migrate
97
98
  ```
98
99
 
@@ -1,8 +1,8 @@
1
1
  module RailsCVE::Entry::Search
2
2
  extend ActiveSupport::Concern
3
3
 
4
- TS_QUERY = "to_tsvector('english', description) @@ plainto_tsquery(%{q})"
5
- TS_RANK = "ts_rank(to_tsvector(description), plainto_tsquery(%{q}))"
4
+ TS_QUERY = "to_tsvector('simple', description) @@ plainto_tsquery(%{q})"
5
+ TS_RANK = "ts_rank(to_tsvector('simple', description), plainto_tsquery(%{q}))"
6
6
 
7
7
  included do
8
8
  scope :search_ranked, ->(query){
@@ -19,7 +19,7 @@ class CreateRailsCveEntries < ActiveRecord::Migration
19
19
  CREATE INDEX
20
20
  cve_entry_text_search ON rails_cve_entries
21
21
  USING
22
- gin(to_tsvector('english', description))
22
+ gin(to_tsvector('simple', description))
23
23
  SQL
24
24
  end
25
25
 
@@ -1,13 +1,5 @@
1
1
  module RailsCVE
2
2
  class Engine < ::Rails::Engine
3
3
  isolate_namespace RailsCVE
4
-
5
- initializer :append_migrations do |app|
6
- unless app.root.to_s.match root.to_s
7
- config.paths["db/migrate"].expanded.each do |expanded_path|
8
- app.config.paths["db/migrate"] << expanded_path
9
- end
10
- end
11
- end
12
4
  end
13
5
  end
@@ -1,3 +1,3 @@
1
1
  module RailsCVE
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -23,6 +23,8 @@ module Dummy
23
23
  # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
24
24
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
25
25
  # config.i18n.default_locale = :de
26
+
27
+ config.active_record.schema_format = :sql
26
28
  end
27
29
  end
28
30
 
@@ -0,0 +1,127 @@
1
+ --
2
+ -- PostgreSQL database dump
3
+ --
4
+
5
+ SET statement_timeout = 0;
6
+ SET client_encoding = 'UTF8';
7
+ SET standard_conforming_strings = on;
8
+ SET check_function_bodies = false;
9
+ SET client_min_messages = warning;
10
+
11
+ --
12
+ -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
13
+ --
14
+
15
+ CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
16
+
17
+
18
+ --
19
+ -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
20
+ --
21
+
22
+ COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
23
+
24
+
25
+ --
26
+ -- Name: hstore; Type: EXTENSION; Schema: -; Owner: -
27
+ --
28
+
29
+ CREATE EXTENSION IF NOT EXISTS hstore WITH SCHEMA public;
30
+
31
+
32
+ --
33
+ -- Name: EXTENSION hstore; Type: COMMENT; Schema: -; Owner: -
34
+ --
35
+
36
+ COMMENT ON EXTENSION hstore IS 'data type for storing sets of (key, value) pairs';
37
+
38
+
39
+ SET search_path = public, pg_catalog;
40
+
41
+ SET default_tablespace = '';
42
+
43
+ SET default_with_oids = false;
44
+
45
+ --
46
+ -- Name: rails_cve_entries; Type: TABLE; Schema: public; Owner: -; Tablespace:
47
+ --
48
+
49
+ CREATE TABLE rails_cve_entries (
50
+ id integer NOT NULL,
51
+ name character varying(255) NOT NULL,
52
+ description text,
53
+ "references" character varying(1024)[]
54
+ );
55
+
56
+
57
+ --
58
+ -- Name: rails_cve_entries_id_seq; Type: SEQUENCE; Schema: public; Owner: -
59
+ --
60
+
61
+ CREATE SEQUENCE rails_cve_entries_id_seq
62
+ START WITH 1
63
+ INCREMENT BY 1
64
+ NO MINVALUE
65
+ NO MAXVALUE
66
+ CACHE 1;
67
+
68
+
69
+ --
70
+ -- Name: rails_cve_entries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
71
+ --
72
+
73
+ ALTER SEQUENCE rails_cve_entries_id_seq OWNED BY rails_cve_entries.id;
74
+
75
+
76
+ --
77
+ -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace:
78
+ --
79
+
80
+ CREATE TABLE schema_migrations (
81
+ version character varying(255) NOT NULL
82
+ );
83
+
84
+
85
+ --
86
+ -- Name: id; Type: DEFAULT; Schema: public; Owner: -
87
+ --
88
+
89
+ ALTER TABLE ONLY rails_cve_entries ALTER COLUMN id SET DEFAULT nextval('rails_cve_entries_id_seq'::regclass);
90
+
91
+
92
+ --
93
+ -- Name: rails_cve_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
94
+ --
95
+
96
+ ALTER TABLE ONLY rails_cve_entries
97
+ ADD CONSTRAINT rails_cve_entries_pkey PRIMARY KEY (id);
98
+
99
+
100
+ --
101
+ -- Name: cve_entry_text_search; Type: INDEX; Schema: public; Owner: -; Tablespace:
102
+ --
103
+
104
+ CREATE INDEX cve_entry_text_search ON rails_cve_entries USING gin (to_tsvector('simple'::regconfig, description));
105
+
106
+
107
+ --
108
+ -- Name: index_rails_cve_entries_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace:
109
+ --
110
+
111
+ CREATE UNIQUE INDEX index_rails_cve_entries_on_name ON rails_cve_entries USING btree (name);
112
+
113
+
114
+ --
115
+ -- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace:
116
+ --
117
+
118
+ CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version);
119
+
120
+
121
+ --
122
+ -- PostgreSQL database dump complete
123
+ --
124
+
125
+ SET search_path TO "$user",public;
126
+
127
+ INSERT INTO schema_migrations (version) VALUES ('20140402144115');
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_cve
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Menke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-08 00:00:00.000000000 Z
11
+ date: 2014-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -130,6 +130,7 @@ extra_rdoc_files: []
130
130
  files:
131
131
  - ".gitignore"
132
132
  - ".travis.yml"
133
+ - CHANGELOG.md
133
134
  - Gemfile
134
135
  - MIT-LICENSE
135
136
  - README.md
@@ -173,7 +174,7 @@ files:
173
174
  - test/dummy/config/initializers/wrap_parameters.rb
174
175
  - test/dummy/config/locales/en.yml
175
176
  - test/dummy/config/routes.rb
176
- - test/dummy/db/schema.rb
177
+ - test/dummy/db/structure.sql
177
178
  - test/dummy/public/404.html
178
179
  - test/dummy/public/422.html
179
180
  - test/dummy/public/500.html
@@ -235,7 +236,7 @@ test_files:
235
236
  - test/dummy/config/initializers/wrap_parameters.rb
236
237
  - test/dummy/config/locales/en.yml
237
238
  - test/dummy/config/routes.rb
238
- - test/dummy/db/schema.rb
239
+ - test/dummy/db/structure.sql
239
240
  - test/dummy/public/404.html
240
241
  - test/dummy/public/422.html
241
242
  - test/dummy/public/500.html
@@ -1,28 +0,0 @@
1
- # encoding: UTF-8
2
- # This file is auto-generated from the current state of the database. Instead
3
- # of editing this file, please use the migrations feature of Active Record to
4
- # incrementally modify your database, and then regenerate this schema definition.
5
- #
6
- # Note that this schema.rb definition is the authoritative source for your
7
- # database schema. If you need to create the application database on another
8
- # system, you should be using db:schema:load, not running all the migrations
9
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
- # you'll amass, the slower it'll run and the greater likelihood for issues).
11
- #
12
- # It's strongly recommended that you check this file into your version control system.
13
-
14
- ActiveRecord::Schema.define(version: 20140402144115) do
15
-
16
- # These are extensions that must be enabled in order to support this database
17
- enable_extension "plpgsql"
18
- enable_extension "hstore"
19
-
20
- create_table "rails_cve_entries", force: true do |t|
21
- t.string "name", null: false
22
- t.text "description"
23
- t.string "references", limit: 1024, array: true
24
- end
25
-
26
- add_index "rails_cve_entries", ["name"], name: "index_rails_cve_entries_on_name", unique: true, using: :btree
27
-
28
- end