rare_map 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/rare_map/schema_parser.rb +5 -5
- data/lib/rare_map/version.rb +1 -1
- data/test/rare_map_test.rb +13 -0
- data/test/schema.rb +190 -0
- metadata +10 -28
- data/test/test_rare_map.rb +0 -7
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2b42e9add88b2cc752f354b6f87f2f30763fd729
|
4
|
+
data.tar.gz: 41998e37c66fa7f18608def180d6b90300bd356c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 23bfd594a927457fd953cf7ec1afee71d40e255b2780331b86f7cde23c7c2097129704f0367bf352693c63889dab4a1ccaadf28fcd83dddf434610c061477ed0
|
7
|
+
data.tar.gz: d97df7d53a08ad1ba86b7abafc5309e9059bdedd4a2a8c3aa257219a17b7819a7fa453944c80e0504a6d5ce3f9b1ed9456ff92be61b2ad32f6ec5e26d7edcec2
|
@@ -9,16 +9,16 @@ module RareMap
|
|
9
9
|
case line.strip!
|
10
10
|
when /^create_table/
|
11
11
|
name = line.match(/create_table\s+['"]([^'"]+)['"]/)[1]
|
12
|
-
id = line.match(
|
13
|
-
pk = line.match(
|
14
|
-
primary_key = pk[
|
12
|
+
id = line.match(/(:id\s*=>|id:)\s*false/) ? false : true
|
13
|
+
pk = line.match(/(:primary_key\s*=>|primary_key:)\s*['"](.+)['"]/)
|
14
|
+
primary_key = pk[2] if pk
|
15
15
|
tables << Table.new(name, :id => id, :primary_key => primary_key)
|
16
16
|
when /^t\./
|
17
17
|
name = line.match(/t\.\w+\s+['"]([^'"]+)['"]/)[1]
|
18
18
|
type = line.match(/t\.(\w+)\s+/)[1]
|
19
19
|
tables.last.columns << Column.new(name, type)
|
20
|
-
when /^add_index\s+.*\[\s*['"]([^'"]+)['"]\s*\]
|
21
|
-
unique_column = line.match(/add_index\s+.*\[\s*['"]([^'"]+)['"]\s*\]
|
20
|
+
when /^add_index\s+.*\[\s*['"]([^'"]+)['"]\s*\].*(:unique\s*=>|unique:)\s*true/
|
21
|
+
unique_column = line.match(/add_index\s+.*\[\s*['"]([^'"]+)['"]\s*\].*(:unique\s*=>|unique:)\s*true/)[1]
|
22
22
|
column = tables.last.columns.find { |col| col.name == unique_column }
|
23
23
|
column.unique = true
|
24
24
|
end
|
data/lib/rare_map/version.rb
CHANGED
data/test/schema.rb
ADDED
@@ -0,0 +1,190 @@
|
|
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: 0) do
|
15
|
+
|
16
|
+
create_table "access_log", force: true do |t|
|
17
|
+
t.string "url", limit: 100, null: false
|
18
|
+
t.string "user_agent", limit: 100
|
19
|
+
t.string "ip", limit: 64
|
20
|
+
t.integer "user_id"
|
21
|
+
t.datetime "date", null: false
|
22
|
+
end
|
23
|
+
|
24
|
+
create_table "admin_audit_log", force: true do |t|
|
25
|
+
t.integer "admin_id", null: false
|
26
|
+
t.string "event", null: false
|
27
|
+
t.string "object_reference"
|
28
|
+
t.integer "object_id"
|
29
|
+
t.datetime "event_timestamp", null: false
|
30
|
+
end
|
31
|
+
|
32
|
+
create_table "admin_previous_passwords", primary_key: "previous_passwords_id", force: true do |t|
|
33
|
+
t.integer "user_id", null: false
|
34
|
+
t.string "previous_password", null: false
|
35
|
+
t.datetime "date", null: false
|
36
|
+
end
|
37
|
+
|
38
|
+
create_table "app_user", force: true do |t|
|
39
|
+
t.boolean "account_expired", null: false
|
40
|
+
t.boolean "account_locked", null: false
|
41
|
+
t.string "address", limit: 150
|
42
|
+
t.string "city", limit: 50
|
43
|
+
t.string "country", limit: 100
|
44
|
+
t.string "postal_code", limit: 15
|
45
|
+
t.string "province", limit: 100
|
46
|
+
t.boolean "credentials_expired", null: false
|
47
|
+
t.string "email", null: false
|
48
|
+
t.boolean "account_enabled"
|
49
|
+
t.string "first_name", limit: 50, null: false
|
50
|
+
t.string "last_name", limit: 50, null: false
|
51
|
+
t.string "password", null: false
|
52
|
+
t.string "password_hint"
|
53
|
+
t.string "phone_number"
|
54
|
+
t.string "username", limit: 50, null: false
|
55
|
+
t.integer "version"
|
56
|
+
t.string "website"
|
57
|
+
t.datetime "last_pass_update_date", null: false
|
58
|
+
t.integer "num_incorrect_pw", default: 0, null: false
|
59
|
+
t.datetime "lockout_start"
|
60
|
+
t.string "nih_username", limit: 50
|
61
|
+
end
|
62
|
+
|
63
|
+
add_index "app_user", ["email"], name: "app_user_email_uq", unique: true, using: :btree
|
64
|
+
add_index "app_user", ["username"], name: "app_user_username_uq", unique: true, using: :btree
|
65
|
+
|
66
|
+
create_table "audit_log_guid", force: true do |t|
|
67
|
+
t.integer "user_id"
|
68
|
+
t.string "event"
|
69
|
+
t.datetime "event_date"
|
70
|
+
t.string "success", limit: 1
|
71
|
+
end
|
72
|
+
|
73
|
+
create_table "guidmeta", id: false, force: true do |t|
|
74
|
+
t.string "database_version", limit: 10
|
75
|
+
t.string "application_version", limit: 10
|
76
|
+
t.datetime "database_version_update_dt"
|
77
|
+
end
|
78
|
+
|
79
|
+
create_table "invalid_guid_map", primary_key: "invalid_guid_map_id", force: true do |t|
|
80
|
+
t.string "invalid_guid", limit: 25, null: false
|
81
|
+
t.integer "creator_id", null: false
|
82
|
+
t.datetime "date_created", null: false
|
83
|
+
t.integer "updater_id"
|
84
|
+
t.datetime "date_updated"
|
85
|
+
t.integer "referred_subject_id"
|
86
|
+
end
|
87
|
+
|
88
|
+
add_index "invalid_guid_map", ["invalid_guid"], name: "invalid_guid_uq", unique: true, using: :btree
|
89
|
+
|
90
|
+
create_table "organization", primary_key: "org_id", force: true do |t|
|
91
|
+
t.string "name", null: false
|
92
|
+
t.string "full_name", limit: 500
|
93
|
+
t.string "description"
|
94
|
+
t.string "end_point_reference"
|
95
|
+
t.datetime "date_created", null: false
|
96
|
+
t.integer "creator_id"
|
97
|
+
t.datetime "date_updated"
|
98
|
+
t.integer "updater_id"
|
99
|
+
t.boolean "deleted", default: false, null: false
|
100
|
+
end
|
101
|
+
|
102
|
+
add_index "organization", ["name"], name: "organization_uq", unique: true, using: :btree
|
103
|
+
|
104
|
+
create_table "previous_passwords", primary_key: "previous_passwords_id", force: true do |t|
|
105
|
+
t.integer "user_map_id", null: false
|
106
|
+
t.string "previous_password", null: false
|
107
|
+
t.datetime "date", null: false
|
108
|
+
end
|
109
|
+
|
110
|
+
create_table "role", id: false, force: true do |t|
|
111
|
+
t.integer "id", null: false
|
112
|
+
t.string "description", limit: 64
|
113
|
+
t.string "name", limit: 20
|
114
|
+
end
|
115
|
+
|
116
|
+
create_table "site", primary_key: "site_id", force: true do |t|
|
117
|
+
t.string "user_name", limit: 64, null: false
|
118
|
+
t.string "site_password", null: false
|
119
|
+
t.string "email_address", limit: 128
|
120
|
+
t.string "phone_number", limit: 64
|
121
|
+
t.integer "creator_id"
|
122
|
+
t.datetime "date_created", null: false
|
123
|
+
t.integer "updater_id"
|
124
|
+
t.datetime "date_updated"
|
125
|
+
t.integer "org_id", null: false
|
126
|
+
t.boolean "deleted", default: false, null: false
|
127
|
+
end
|
128
|
+
|
129
|
+
add_index "site", ["user_name"], name: "user_account_user_name_key", unique: true, using: :btree
|
130
|
+
|
131
|
+
create_table "siteuser", primary_key: "user_map_id", force: true do |t|
|
132
|
+
t.integer "site_id", null: false
|
133
|
+
t.string "user_id", limit: 25, null: false
|
134
|
+
t.datetime "date_created", null: false
|
135
|
+
t.string "last_name", limit: 64
|
136
|
+
t.string "first_name", limit: 64
|
137
|
+
t.string "email_address", limit: 128
|
138
|
+
t.string "phone_number", limit: 64
|
139
|
+
t.string "user_name", limit: 64
|
140
|
+
t.string "user_password"
|
141
|
+
t.integer "creator_id"
|
142
|
+
t.datetime "date_updated"
|
143
|
+
t.integer "updater_id"
|
144
|
+
t.boolean "deleted", default: false, null: false
|
145
|
+
t.integer "num_incorrect_pw", default: 0, null: false
|
146
|
+
t.datetime "lockout_start"
|
147
|
+
t.datetime "last_pass_update_date", null: false
|
148
|
+
t.string "nih_username", limit: 50
|
149
|
+
end
|
150
|
+
|
151
|
+
create_table "subject", primary_key: "subject_id", force: true do |t|
|
152
|
+
t.string "guid", limit: 25, null: false
|
153
|
+
t.integer "subject_type", null: false
|
154
|
+
t.binary "hashcode1"
|
155
|
+
t.binary "hashcode2"
|
156
|
+
t.binary "hashcode3"
|
157
|
+
t.integer "creator_id", null: false
|
158
|
+
t.datetime "date_created", null: false
|
159
|
+
t.datetime "date_updated"
|
160
|
+
t.integer "status", default: 2, null: false
|
161
|
+
t.integer "updater_id"
|
162
|
+
t.integer "creator_user_id", null: false
|
163
|
+
t.integer "updater_user_id"
|
164
|
+
end
|
165
|
+
|
166
|
+
create_table "subject_merging_map", primary_key: "subject_merging_map_id", force: true do |t|
|
167
|
+
t.integer "referring_subject_id", null: false
|
168
|
+
t.integer "referred_subject_id", null: false
|
169
|
+
t.integer "creator_id", null: false
|
170
|
+
t.datetime "date_created", null: false
|
171
|
+
t.integer "updater_id"
|
172
|
+
t.datetime "date_updated"
|
173
|
+
end
|
174
|
+
|
175
|
+
create_table "subject_request", primary_key: "subject_request_id", force: true do |t|
|
176
|
+
t.integer "subject_id"
|
177
|
+
t.integer "requestor_id", null: false
|
178
|
+
t.datetime "date_requested", null: false
|
179
|
+
t.integer "notification_status", null: false
|
180
|
+
t.integer "updater_id"
|
181
|
+
t.datetime "date_updated"
|
182
|
+
t.integer "creator_user_id", null: false
|
183
|
+
end
|
184
|
+
|
185
|
+
create_table "user_role", id: false, force: true do |t|
|
186
|
+
t.integer "user_id", null: false
|
187
|
+
t.integer "role_id", null: false
|
188
|
+
end
|
189
|
+
|
190
|
+
end
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rare_map
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
5
|
-
prerelease:
|
4
|
+
version: 2.0.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Wei-Ming Wu
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-08-16 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: activerecord
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: activesupport
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: shoulda
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ~>
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ~>
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: rdoc
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ~>
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ~>
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -78,7 +69,6 @@ dependencies:
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: bundler
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
73
|
- - ~>
|
84
74
|
- !ruby/object:Gem::Version
|
@@ -86,7 +76,6 @@ dependencies:
|
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
80
|
- - ~>
|
92
81
|
- !ruby/object:Gem::Version
|
@@ -94,7 +83,6 @@ dependencies:
|
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: rake
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
87
|
- - '>='
|
100
88
|
- !ruby/object:Gem::Version
|
@@ -102,7 +90,6 @@ dependencies:
|
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
94
|
- - '>='
|
108
95
|
- !ruby/object:Gem::Version
|
@@ -127,39 +114,34 @@ files:
|
|
127
114
|
- Rakefile
|
128
115
|
- README.rdoc
|
129
116
|
- test/helper.rb
|
130
|
-
- test/
|
117
|
+
- test/rare_map_test.rb
|
118
|
+
- test/schema.rb
|
131
119
|
- bin/raremap
|
132
120
|
homepage: http://github.com/wnameless/rare_map
|
133
121
|
licenses:
|
134
122
|
- Apache License, Version 2.0
|
123
|
+
metadata: {}
|
135
124
|
post_install_message:
|
136
125
|
rdoc_options: []
|
137
126
|
require_paths:
|
138
127
|
- lib
|
139
128
|
required_ruby_version: !ruby/object:Gem::Requirement
|
140
|
-
none: false
|
141
129
|
requirements:
|
142
130
|
- - '>='
|
143
131
|
- !ruby/object:Gem::Version
|
144
132
|
version: '0'
|
145
|
-
segments:
|
146
|
-
- 0
|
147
|
-
hash: -1418084712865183312
|
148
133
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
|
-
none: false
|
150
134
|
requirements:
|
151
135
|
- - '>='
|
152
136
|
- !ruby/object:Gem::Version
|
153
137
|
version: '0'
|
154
|
-
segments:
|
155
|
-
- 0
|
156
|
-
hash: -1418084712865183312
|
157
138
|
requirements: []
|
158
139
|
rubyforge_project:
|
159
|
-
rubygems_version:
|
140
|
+
rubygems_version: 2.0.5
|
160
141
|
signing_key:
|
161
|
-
specification_version:
|
162
|
-
summary: rare_map-2.0.
|
142
|
+
specification_version: 4
|
143
|
+
summary: rare_map-2.0.3
|
163
144
|
test_files:
|
164
145
|
- test/helper.rb
|
165
|
-
- test/
|
146
|
+
- test/rare_map_test.rb
|
147
|
+
- test/schema.rb
|