active_metadata 0.5.2 → 0.6.0
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.
- data/README.md +4 -0
- data/Rakefile +31 -0
- data/app/assets/javascripts/active_metadata/application.js +15 -0
- data/app/assets/stylesheets/active_metadata/application.css +13 -0
- data/app/controllers/active_metadata/application_controller.rb +4 -0
- data/app/controllers/active_metadata/attachments_controller.rb +4 -6
- data/app/controllers/active_metadata/notes_controller.rb +7 -10
- data/app/controllers/active_metadata/stream_controller.rb +12 -0
- data/app/helpers/active_metadata/application_helper.rb +4 -0
- data/app/helpers/active_metadata/stream_helper.rb +14 -0
- data/app/models/active_metadata/attachment.rb +26 -0
- data/app/models/active_metadata/history.rb +4 -0
- data/app/models/active_metadata/note.rb +4 -0
- data/app/models/active_metadata/watcher.rb +6 -0
- data/app/views/active_metadata/attachments/_attachment.html.erb +7 -0
- data/app/views/active_metadata/attachments/index.html.erb +2 -10
- data/app/views/active_metadata/notes/_note.html.erb +7 -0
- data/app/views/active_metadata/notes/index.html.erb +1 -9
- data/app/views/active_metadata/stream/_element.html.erb +1 -0
- data/app/views/active_metadata/stream/index.html.erb +3 -0
- data/app/views/layouts/active_metadata/application.html.erb +11 -0
- data/config/active_metadata.yml +6 -0
- data/config/cucumber.yml +8 -0
- data/config/database.yml +4 -2
- data/config/routes.rb +25 -26
- data/db/migrate/02_active_metadata_migrations.rb +24 -24
- data/features/{watchlist/add_a_user_to_a_watcher.feature → add_a_user_to_a_watcher.feature} +0 -0
- data/features/support/env.rb +8 -0
- data/features/supports/file.txt +0 -1
- data/features/supports/updated_file.txt +0 -1
- data/features/{watchlist/trigger_alert_on_modify.feature → trigger_alert_on_modify.feature} +0 -0
- data/lib/active_metadata/base.rb +3 -1
- data/lib/active_metadata/engine.rb +11 -0
- data/lib/active_metadata/helpers.rb +15 -1
- data/lib/active_metadata/persistence/{active_record/attachment.rb → attachment.rb} +10 -10
- data/lib/active_metadata/persistence/{active_record/history.rb → history.rb} +4 -4
- data/lib/active_metadata/persistence/{active_record/note.rb → note.rb} +8 -8
- data/lib/active_metadata/persistence/persistence.rb +14 -4
- data/lib/active_metadata/persistence/{active_record/watcher.rb → watcher.rb} +5 -5
- data/lib/active_metadata/streamable.rb +25 -0
- data/lib/active_metadata/version.rb +1 -1
- data/lib/active_metadata.rb +3 -3
- data/lib/{rake/ci.rb → tasks/active_metadata_tasks.rake} +27 -6
- data/lib/tasks/cucumber.rake +65 -0
- data/spec/active_metadata_yml.rb +25 -0
- data/spec/controllers/active_metadata/attachments_controller_spec.rb +40 -0
- data/spec/controllers/active_metadata/notes_controller_spec.rb +41 -0
- data/spec/controllers/active_metadata/stream_controller_spec.rb +46 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/{config/application.rb → spec/dummy/app/mailers/.gitkeep} +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config/application.rb +56 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +106 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/helpers/active_metadata/stream_helpers_spec.rb +23 -0
- data/spec/routing/active_metadata/stream_controller_routing_spec.rb +17 -0
- data/spec/spec_helper.rb +18 -31
- data/spec/streamable_spec.rb +120 -0
- data/spec/support/document.rb +0 -1
- data/spec/support/pdf_test_1.pdf +0 -0
- data/spec/support/section.rb +0 -1
- data/spec/support/user.rb +0 -2
- data/spec/views/active_metadata/stream/index.html.erb_spec.rb +5 -0
- metadata +165 -73
- data/app/helpers/application_helper.rb +0 -2
- data/config/initializers/inflections.rb +0 -7
- data/config/mongoid.yml +0 -28
- data/db/test.sqlite3 +0 -0
- data/features/supports/initializer.rb +0 -1
- data/lib/active_metadata/persistence/active_record.rb +0 -26
- data/lib/application_controller.rb +0 -28
- data/lib/application_helper.rb +0 -7
- data/lib/engine.rb +0 -29
- data/lib/model/active_record/attachment.rb +0 -22
- data/lib/model/active_record/history.rb +0 -2
- data/lib/model/active_record/note.rb +0 -2
- data/lib/model/active_record/watcher.rb +0 -4
- data/lib/rails/railties/tasks.rake +0 -16
- data/lib/rake/active_record_tasks.rb +0 -77
- data/lib/templates/active_metadata.yml +0 -17
- data/lib/templates/active_metadata_migrations +0 -71
- data/lib/templates/mongoid.yml +0 -20
- data/spec/benchmark_spec.rb +0 -35
- data/spec/controllers/metadata_controller_spec.rb +0 -14
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: active_metadata
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -10,22 +10,22 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2012-01-31 00:00:00.000000000Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
|
-
name:
|
|
17
|
-
requirement: &
|
|
16
|
+
name: rails
|
|
17
|
+
requirement: &70360117603300 !ruby/object:Gem::Requirement
|
|
18
18
|
none: false
|
|
19
19
|
requirements:
|
|
20
|
-
- -
|
|
20
|
+
- - ~>
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version:
|
|
23
|
-
type: :
|
|
22
|
+
version: 3.2.0
|
|
23
|
+
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
|
-
version_requirements: *
|
|
25
|
+
version_requirements: *70360117603300
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: sqlite3
|
|
28
|
-
requirement: &
|
|
28
|
+
requirement: &70360117601320 !ruby/object:Gem::Requirement
|
|
29
29
|
none: false
|
|
30
30
|
requirements:
|
|
31
31
|
- - ! '>='
|
|
@@ -33,10 +33,10 @@ dependencies:
|
|
|
33
33
|
version: '0'
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
|
-
version_requirements: *
|
|
36
|
+
version_requirements: *70360117601320
|
|
37
37
|
- !ruby/object:Gem::Dependency
|
|
38
|
-
name:
|
|
39
|
-
requirement: &
|
|
38
|
+
name: rspec-rails
|
|
39
|
+
requirement: &70360117599340 !ruby/object:Gem::Requirement
|
|
40
40
|
none: false
|
|
41
41
|
requirements:
|
|
42
42
|
- - ! '>='
|
|
@@ -44,10 +44,10 @@ dependencies:
|
|
|
44
44
|
version: '0'
|
|
45
45
|
type: :development
|
|
46
46
|
prerelease: false
|
|
47
|
-
version_requirements: *
|
|
47
|
+
version_requirements: *70360117599340
|
|
48
48
|
- !ruby/object:Gem::Dependency
|
|
49
|
-
name:
|
|
50
|
-
requirement: &
|
|
49
|
+
name: sqlite3
|
|
50
|
+
requirement: &70360117596380 !ruby/object:Gem::Requirement
|
|
51
51
|
none: false
|
|
52
52
|
requirements:
|
|
53
53
|
- - ! '>='
|
|
@@ -55,10 +55,10 @@ dependencies:
|
|
|
55
55
|
version: '0'
|
|
56
56
|
type: :development
|
|
57
57
|
prerelease: false
|
|
58
|
-
version_requirements: *
|
|
58
|
+
version_requirements: *70360117596380
|
|
59
59
|
- !ruby/object:Gem::Dependency
|
|
60
|
-
name:
|
|
61
|
-
requirement: &
|
|
60
|
+
name: sqlite3-ruby
|
|
61
|
+
requirement: &70360117594700 !ruby/object:Gem::Requirement
|
|
62
62
|
none: false
|
|
63
63
|
requirements:
|
|
64
64
|
- - ! '>='
|
|
@@ -66,32 +66,32 @@ dependencies:
|
|
|
66
66
|
version: '0'
|
|
67
67
|
type: :development
|
|
68
68
|
prerelease: false
|
|
69
|
-
version_requirements: *
|
|
69
|
+
version_requirements: *70360117594700
|
|
70
70
|
- !ruby/object:Gem::Dependency
|
|
71
|
-
name: rails
|
|
72
|
-
requirement: &
|
|
71
|
+
name: cucumber-rails
|
|
72
|
+
requirement: &70360117592940 !ruby/object:Gem::Requirement
|
|
73
73
|
none: false
|
|
74
74
|
requirements:
|
|
75
|
-
- - ! '
|
|
75
|
+
- - ! '>='
|
|
76
76
|
- !ruby/object:Gem::Version
|
|
77
|
-
version:
|
|
78
|
-
type: :
|
|
77
|
+
version: '0'
|
|
78
|
+
type: :development
|
|
79
79
|
prerelease: false
|
|
80
|
-
version_requirements: *
|
|
80
|
+
version_requirements: *70360117592940
|
|
81
81
|
- !ruby/object:Gem::Dependency
|
|
82
|
-
name:
|
|
83
|
-
requirement: &
|
|
82
|
+
name: ci_reporter
|
|
83
|
+
requirement: &70360117583120 !ruby/object:Gem::Requirement
|
|
84
84
|
none: false
|
|
85
85
|
requirements:
|
|
86
|
-
- - ! '
|
|
86
|
+
- - ! '>='
|
|
87
87
|
- !ruby/object:Gem::Version
|
|
88
|
-
version:
|
|
89
|
-
type: :
|
|
88
|
+
version: '0'
|
|
89
|
+
type: :development
|
|
90
90
|
prerelease: false
|
|
91
|
-
version_requirements: *
|
|
91
|
+
version_requirements: *70360117583120
|
|
92
92
|
- !ruby/object:Gem::Dependency
|
|
93
93
|
name: paperclip
|
|
94
|
-
requirement: &
|
|
94
|
+
requirement: &70360117579780 !ruby/object:Gem::Requirement
|
|
95
95
|
none: false
|
|
96
96
|
requirements:
|
|
97
97
|
- - ! '>='
|
|
@@ -99,7 +99,7 @@ dependencies:
|
|
|
99
99
|
version: '0'
|
|
100
100
|
type: :runtime
|
|
101
101
|
prerelease: false
|
|
102
|
-
version_requirements: *
|
|
102
|
+
version_requirements: *70360117579780
|
|
103
103
|
description: First implementation will write metadata on mongodb
|
|
104
104
|
email:
|
|
105
105
|
- acampolonghi@gmail.com
|
|
@@ -108,74 +108,119 @@ executables: []
|
|
|
108
108
|
extensions: []
|
|
109
109
|
extra_rdoc_files: []
|
|
110
110
|
files:
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
- lib/active_metadata/persistence/active_record/attachment.rb
|
|
115
|
-
- lib/active_metadata/persistence/active_record/history.rb
|
|
116
|
-
- lib/active_metadata/persistence/active_record/note.rb
|
|
117
|
-
- lib/active_metadata/persistence/active_record/watcher.rb
|
|
118
|
-
- lib/active_metadata/persistence/active_record.rb
|
|
119
|
-
- lib/active_metadata/persistence/persistence.rb
|
|
120
|
-
- lib/active_metadata/version.rb
|
|
121
|
-
- lib/active_metadata.rb
|
|
122
|
-
- lib/application_controller.rb
|
|
123
|
-
- lib/application_helper.rb
|
|
124
|
-
- lib/engine.rb
|
|
125
|
-
- lib/model/active_record/attachment.rb
|
|
126
|
-
- lib/model/active_record/history.rb
|
|
127
|
-
- lib/model/active_record/note.rb
|
|
128
|
-
- lib/model/active_record/watcher.rb
|
|
129
|
-
- lib/rails/railties/tasks.rake
|
|
130
|
-
- lib/rake/active_record_tasks.rb
|
|
131
|
-
- lib/rake/ci.rb
|
|
132
|
-
- lib/templates/active_metadata.yml
|
|
133
|
-
- lib/templates/active_metadata_migrations
|
|
134
|
-
- lib/templates/mongoid.yml
|
|
111
|
+
- app/assets/javascripts/active_metadata/application.js
|
|
112
|
+
- app/assets/stylesheets/active_metadata/application.css
|
|
113
|
+
- app/controllers/active_metadata/application_controller.rb
|
|
135
114
|
- app/controllers/active_metadata/attachments_controller.rb
|
|
136
115
|
- app/controllers/active_metadata/histories_controller.rb
|
|
137
116
|
- app/controllers/active_metadata/notes_controller.rb
|
|
117
|
+
- app/controllers/active_metadata/stream_controller.rb
|
|
138
118
|
- app/controllers/active_metadata/watchers_controller.rb
|
|
139
|
-
- app/helpers/application_helper.rb
|
|
119
|
+
- app/helpers/active_metadata/application_helper.rb
|
|
120
|
+
- app/helpers/active_metadata/stream_helper.rb
|
|
121
|
+
- app/models/active_metadata/attachment.rb
|
|
122
|
+
- app/models/active_metadata/history.rb
|
|
123
|
+
- app/models/active_metadata/note.rb
|
|
124
|
+
- app/models/active_metadata/watcher.rb
|
|
125
|
+
- app/views/active_metadata/attachments/_attachment.html.erb
|
|
140
126
|
- app/views/active_metadata/attachments/index.html.erb
|
|
141
127
|
- app/views/active_metadata/histories/index.html.erb
|
|
142
128
|
- app/views/active_metadata/notes/_form.html.erb
|
|
129
|
+
- app/views/active_metadata/notes/_note.html.erb
|
|
143
130
|
- app/views/active_metadata/notes/edit.html.erb
|
|
144
131
|
- app/views/active_metadata/notes/index.html.erb
|
|
145
132
|
- app/views/active_metadata/notes/index.js.erb
|
|
146
133
|
- app/views/active_metadata/notes/show.html.erb
|
|
134
|
+
- app/views/active_metadata/stream/_element.html.erb
|
|
135
|
+
- app/views/active_metadata/stream/index.html.erb
|
|
147
136
|
- app/views/active_metadata/watchers/create.js.erb
|
|
148
137
|
- app/views/active_metadata/watchers/destroy.js.erb
|
|
149
138
|
- app/views/active_metadata/watchers/index.html.erb
|
|
139
|
+
- app/views/layouts/active_metadata/application.html.erb
|
|
150
140
|
- config/active_metadata.yml
|
|
151
|
-
- config/
|
|
141
|
+
- config/cucumber.yml
|
|
152
142
|
- config/database.yml
|
|
153
|
-
- config/initializers/inflections.rb
|
|
154
|
-
- config/mongoid.yml
|
|
155
143
|
- config/routes.rb
|
|
156
144
|
- db/migrate/01_create_test_resources.rb
|
|
157
145
|
- db/migrate/02_active_metadata_migrations.rb
|
|
158
|
-
-
|
|
146
|
+
- lib/active_metadata/base.rb
|
|
147
|
+
- lib/active_metadata/engine.rb
|
|
148
|
+
- lib/active_metadata/form_helper.rb
|
|
149
|
+
- lib/active_metadata/helpers.rb
|
|
150
|
+
- lib/active_metadata/persistence/attachment.rb
|
|
151
|
+
- lib/active_metadata/persistence/history.rb
|
|
152
|
+
- lib/active_metadata/persistence/note.rb
|
|
153
|
+
- lib/active_metadata/persistence/persistence.rb
|
|
154
|
+
- lib/active_metadata/persistence/watcher.rb
|
|
155
|
+
- lib/active_metadata/streamable.rb
|
|
156
|
+
- lib/active_metadata/version.rb
|
|
157
|
+
- lib/active_metadata.rb
|
|
158
|
+
- lib/tasks/active_metadata_tasks.rake
|
|
159
|
+
- lib/tasks/cucumber.rake
|
|
160
|
+
- Rakefile
|
|
161
|
+
- README.md
|
|
162
|
+
- features/add_a_user_to_a_watcher.feature
|
|
159
163
|
- features/step_definitions/add_a_user_to_a_watcher_steps.rb
|
|
160
164
|
- features/step_definitions/trigger_alert_on_modify_steps.rb
|
|
165
|
+
- features/support/env.rb
|
|
161
166
|
- features/supports/file.txt
|
|
162
|
-
- features/supports/initializer.rb
|
|
163
167
|
- features/supports/updated_file.txt
|
|
164
|
-
- features/
|
|
165
|
-
- features/watchlist/trigger_alert_on_modify.feature
|
|
168
|
+
- features/trigger_alert_on_modify.feature
|
|
166
169
|
- spec/active_metadata_spec.rb
|
|
170
|
+
- spec/active_metadata_yml.rb
|
|
167
171
|
- spec/attachments_spec.rb
|
|
168
|
-
- spec/benchmark_spec.rb
|
|
169
172
|
- spec/concurrency_spec.rb
|
|
170
|
-
- spec/controllers/
|
|
173
|
+
- spec/controllers/active_metadata/attachments_controller_spec.rb
|
|
174
|
+
- spec/controllers/active_metadata/notes_controller_spec.rb
|
|
175
|
+
- spec/controllers/active_metadata/stream_controller_spec.rb
|
|
176
|
+
- spec/dummy/README.rdoc
|
|
177
|
+
- spec/dummy/Rakefile
|
|
178
|
+
- spec/dummy/app/assets/javascripts/application.js
|
|
179
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
|
180
|
+
- spec/dummy/app/controllers/application_controller.rb
|
|
181
|
+
- spec/dummy/app/helpers/application_helper.rb
|
|
182
|
+
- spec/dummy/app/mailers/.gitkeep
|
|
183
|
+
- spec/dummy/app/models/.gitkeep
|
|
184
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
|
185
|
+
- spec/dummy/config.ru
|
|
186
|
+
- spec/dummy/config/application.rb
|
|
187
|
+
- spec/dummy/config/boot.rb
|
|
188
|
+
- spec/dummy/config/database.yml
|
|
189
|
+
- spec/dummy/config/environment.rb
|
|
190
|
+
- spec/dummy/config/environments/development.rb
|
|
191
|
+
- spec/dummy/config/environments/production.rb
|
|
192
|
+
- spec/dummy/config/environments/test.rb
|
|
193
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
|
194
|
+
- spec/dummy/config/initializers/inflections.rb
|
|
195
|
+
- spec/dummy/config/initializers/mime_types.rb
|
|
196
|
+
- spec/dummy/config/initializers/secret_token.rb
|
|
197
|
+
- spec/dummy/config/initializers/session_store.rb
|
|
198
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
|
199
|
+
- spec/dummy/config/locales/en.yml
|
|
200
|
+
- spec/dummy/config/routes.rb
|
|
201
|
+
- spec/dummy/db/development.sqlite3
|
|
202
|
+
- spec/dummy/db/schema.rb
|
|
203
|
+
- spec/dummy/db/test.sqlite3
|
|
204
|
+
- spec/dummy/lib/assets/.gitkeep
|
|
205
|
+
- spec/dummy/log/.gitkeep
|
|
206
|
+
- spec/dummy/public/404.html
|
|
207
|
+
- spec/dummy/public/422.html
|
|
208
|
+
- spec/dummy/public/500.html
|
|
209
|
+
- spec/dummy/public/favicon.ico
|
|
210
|
+
- spec/dummy/script/rails
|
|
211
|
+
- spec/helpers/active_metadata/stream_helpers_spec.rb
|
|
171
212
|
- spec/notes_spec.rb
|
|
213
|
+
- spec/routing/active_metadata/stream_controller_routing_spec.rb
|
|
172
214
|
- spec/spec_helper.rb
|
|
215
|
+
- spec/streamable_spec.rb
|
|
173
216
|
- spec/support/document.rb
|
|
174
217
|
- spec/support/pdf_test.pdf
|
|
218
|
+
- spec/support/pdf_test_1.pdf
|
|
175
219
|
- spec/support/pdf_test_2.pdf
|
|
176
220
|
- spec/support/section.rb
|
|
177
221
|
- spec/support/user.rb
|
|
178
222
|
- spec/support/watcher_notifier.rb
|
|
223
|
+
- spec/views/active_metadata/stream/index.html.erb_spec.rb
|
|
179
224
|
homepage: ''
|
|
180
225
|
licenses: []
|
|
181
226
|
post_install_message:
|
|
@@ -188,12 +233,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
188
233
|
- - ! '>='
|
|
189
234
|
- !ruby/object:Gem::Version
|
|
190
235
|
version: '0'
|
|
236
|
+
segments:
|
|
237
|
+
- 0
|
|
238
|
+
hash: -1409272782456007741
|
|
191
239
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
240
|
none: false
|
|
193
241
|
requirements:
|
|
194
242
|
- - ! '>='
|
|
195
243
|
- !ruby/object:Gem::Version
|
|
196
244
|
version: '0'
|
|
245
|
+
segments:
|
|
246
|
+
- 0
|
|
247
|
+
hash: -1409272782456007741
|
|
197
248
|
requirements: []
|
|
198
249
|
rubyforge_project: active_metadata
|
|
199
250
|
rubygems_version: 1.8.10
|
|
@@ -201,24 +252,65 @@ signing_key:
|
|
|
201
252
|
specification_version: 3
|
|
202
253
|
summary: Add metadata to fields in an active record model
|
|
203
254
|
test_files:
|
|
255
|
+
- features/add_a_user_to_a_watcher.feature
|
|
204
256
|
- features/step_definitions/add_a_user_to_a_watcher_steps.rb
|
|
205
257
|
- features/step_definitions/trigger_alert_on_modify_steps.rb
|
|
258
|
+
- features/support/env.rb
|
|
206
259
|
- features/supports/file.txt
|
|
207
|
-
- features/supports/initializer.rb
|
|
208
260
|
- features/supports/updated_file.txt
|
|
209
|
-
- features/
|
|
210
|
-
- features/watchlist/trigger_alert_on_modify.feature
|
|
261
|
+
- features/trigger_alert_on_modify.feature
|
|
211
262
|
- spec/active_metadata_spec.rb
|
|
263
|
+
- spec/active_metadata_yml.rb
|
|
212
264
|
- spec/attachments_spec.rb
|
|
213
|
-
- spec/benchmark_spec.rb
|
|
214
265
|
- spec/concurrency_spec.rb
|
|
215
|
-
- spec/controllers/
|
|
266
|
+
- spec/controllers/active_metadata/attachments_controller_spec.rb
|
|
267
|
+
- spec/controllers/active_metadata/notes_controller_spec.rb
|
|
268
|
+
- spec/controllers/active_metadata/stream_controller_spec.rb
|
|
269
|
+
- spec/dummy/README.rdoc
|
|
270
|
+
- spec/dummy/Rakefile
|
|
271
|
+
- spec/dummy/app/assets/javascripts/application.js
|
|
272
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
|
273
|
+
- spec/dummy/app/controllers/application_controller.rb
|
|
274
|
+
- spec/dummy/app/helpers/application_helper.rb
|
|
275
|
+
- spec/dummy/app/mailers/.gitkeep
|
|
276
|
+
- spec/dummy/app/models/.gitkeep
|
|
277
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
|
278
|
+
- spec/dummy/config.ru
|
|
279
|
+
- spec/dummy/config/application.rb
|
|
280
|
+
- spec/dummy/config/boot.rb
|
|
281
|
+
- spec/dummy/config/database.yml
|
|
282
|
+
- spec/dummy/config/environment.rb
|
|
283
|
+
- spec/dummy/config/environments/development.rb
|
|
284
|
+
- spec/dummy/config/environments/production.rb
|
|
285
|
+
- spec/dummy/config/environments/test.rb
|
|
286
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
|
287
|
+
- spec/dummy/config/initializers/inflections.rb
|
|
288
|
+
- spec/dummy/config/initializers/mime_types.rb
|
|
289
|
+
- spec/dummy/config/initializers/secret_token.rb
|
|
290
|
+
- spec/dummy/config/initializers/session_store.rb
|
|
291
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
|
292
|
+
- spec/dummy/config/locales/en.yml
|
|
293
|
+
- spec/dummy/config/routes.rb
|
|
294
|
+
- spec/dummy/db/development.sqlite3
|
|
295
|
+
- spec/dummy/db/schema.rb
|
|
296
|
+
- spec/dummy/db/test.sqlite3
|
|
297
|
+
- spec/dummy/lib/assets/.gitkeep
|
|
298
|
+
- spec/dummy/log/.gitkeep
|
|
299
|
+
- spec/dummy/public/404.html
|
|
300
|
+
- spec/dummy/public/422.html
|
|
301
|
+
- spec/dummy/public/500.html
|
|
302
|
+
- spec/dummy/public/favicon.ico
|
|
303
|
+
- spec/dummy/script/rails
|
|
304
|
+
- spec/helpers/active_metadata/stream_helpers_spec.rb
|
|
216
305
|
- spec/notes_spec.rb
|
|
306
|
+
- spec/routing/active_metadata/stream_controller_routing_spec.rb
|
|
217
307
|
- spec/spec_helper.rb
|
|
308
|
+
- spec/streamable_spec.rb
|
|
218
309
|
- spec/support/document.rb
|
|
219
310
|
- spec/support/pdf_test.pdf
|
|
311
|
+
- spec/support/pdf_test_1.pdf
|
|
220
312
|
- spec/support/pdf_test_2.pdf
|
|
221
313
|
- spec/support/section.rb
|
|
222
314
|
- spec/support/user.rb
|
|
223
315
|
- spec/support/watcher_notifier.rb
|
|
224
|
-
|
|
316
|
+
- spec/views/active_metadata/stream/index.html.erb_spec.rb
|
data/config/mongoid.yml
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
development:
|
|
2
|
-
host: localhost
|
|
3
|
-
database: metadata_d
|
|
4
|
-
max_retries_on_connection_failure: 50
|
|
5
|
-
|
|
6
|
-
test:
|
|
7
|
-
hosts:
|
|
8
|
-
- - localhost
|
|
9
|
-
- 27017
|
|
10
|
-
- - localhost
|
|
11
|
-
- 27018
|
|
12
|
-
- - localhost
|
|
13
|
-
- 27019
|
|
14
|
-
database: metadata_t
|
|
15
|
-
max_retries_on_connection_failure: 50
|
|
16
|
-
|
|
17
|
-
# set these environment variables on your prod server
|
|
18
|
-
production:
|
|
19
|
-
host: <%= ENV['MONGOID_HOST'] %>
|
|
20
|
-
port: <%= ENV['MONGOID_PORT'] %>
|
|
21
|
-
username: <%= ENV['MONGOID_USERNAME'] %>
|
|
22
|
-
password: <%= ENV['MONGOID_PASSWORD'] %>
|
|
23
|
-
database: <%= ENV['MONGOID_DATABASE'] %>
|
|
24
|
-
# slaves:
|
|
25
|
-
# - host: slave1.local
|
|
26
|
-
# port: 27018
|
|
27
|
-
# - host: slave2.local
|
|
28
|
-
# port: 27019
|
data/db/test.sqlite3
DELETED
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require "#{File.dirname(__FILE__)}/../../spec/spec_helper.rb"
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
module ActiveMetadata::Persistence::ActiveRecord
|
|
2
|
-
|
|
3
|
-
require "model/active_record/note"
|
|
4
|
-
require "model/active_record/history"
|
|
5
|
-
require "model/active_record/watcher"
|
|
6
|
-
require "model/active_record/attachment"
|
|
7
|
-
|
|
8
|
-
require "active_metadata/persistence/active_record/note"
|
|
9
|
-
require "active_metadata/persistence/active_record/history"
|
|
10
|
-
require "active_metadata/persistence/active_record/watcher"
|
|
11
|
-
require "active_metadata/persistence/active_record/attachment"
|
|
12
|
-
|
|
13
|
-
def self.included(receiver)
|
|
14
|
-
receiver.send :include, InstanceMethods
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
module InstanceMethods
|
|
18
|
-
|
|
19
|
-
include ActiveMetadata::Persistence::ActiveRecord::Note
|
|
20
|
-
include ActiveMetadata::Persistence::ActiveRecord::History
|
|
21
|
-
include ActiveMetadata::Persistence::ActiveRecord::Watcher
|
|
22
|
-
include ActiveMetadata::Persistence::ActiveRecord::Attachment
|
|
23
|
-
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# module ActiveMetadata
|
|
2
|
-
# ## Define ControllerMethods
|
|
3
|
-
# module Controller
|
|
4
|
-
# ## this one manages the usual self.included, klass_eval stuff
|
|
5
|
-
# extend ActiveSupport::Concern
|
|
6
|
-
#
|
|
7
|
-
# included do
|
|
8
|
-
# before_filter :test_controller_instance_method
|
|
9
|
-
# end
|
|
10
|
-
#
|
|
11
|
-
# module InstanceMethods
|
|
12
|
-
# def test_controller_instance_method
|
|
13
|
-
# puts "###### This text is coming from an application_controller before_filter that is being declared and triggered from inside the engine. This before_filter is automatically integrated in when the engine is installed into an app. Look inside lib/application_controller.rb to find it. ######"
|
|
14
|
-
# end
|
|
15
|
-
#
|
|
16
|
-
# # This method is available inside application_controller but it is not being
|
|
17
|
-
# # automatically executed. Notice the before_filter line above that is automatically
|
|
18
|
-
# # executing the first method.
|
|
19
|
-
# def second_controller_instance_method
|
|
20
|
-
# puts "###### This method is not automatically run inside application_controller, but it is available inside application_controller. To see this example add 'before_filter :second_controller_instance_method' at the top of your app's application_controller.rb ######"
|
|
21
|
-
# end
|
|
22
|
-
# end
|
|
23
|
-
# end
|
|
24
|
-
# end
|
|
25
|
-
#
|
|
26
|
-
# ::ActionController::Base.send :include, ActiveMetadata::Controller
|
|
27
|
-
#
|
|
28
|
-
#
|
data/lib/application_helper.rb
DELETED
data/lib/engine.rb
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
require 'active_metadata'
|
|
2
|
-
require 'rails'
|
|
3
|
-
require 'action_controller'
|
|
4
|
-
require 'application_helper'
|
|
5
|
-
|
|
6
|
-
module ActiveMetadata
|
|
7
|
-
class Engine < Rails::Engine
|
|
8
|
-
|
|
9
|
-
# Config defaults
|
|
10
|
-
config.mount_at = '/'
|
|
11
|
-
|
|
12
|
-
# Load rake tasks
|
|
13
|
-
rake_tasks do
|
|
14
|
-
load File.join(File.dirname(__FILE__), 'rails/railties/tasks.rake')
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
# Check the gem config
|
|
18
|
-
initializer "check config" do |app|
|
|
19
|
-
|
|
20
|
-
# make sure mount_at ends with trailing slash
|
|
21
|
-
config.mount_at += '/' unless config.mount_at.last == '/'
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
initializer "static assets" do |app|
|
|
25
|
-
app.middleware.use ::ActionDispatch::Static, "#{root}/public"
|
|
26
|
-
config.generators.orm = :active_record
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
class Attachment < ActiveRecord::Base
|
|
2
|
-
|
|
3
|
-
include ::Paperclip
|
|
4
|
-
include ::Paperclip::Glue
|
|
5
|
-
|
|
6
|
-
has_attached_file :attach,
|
|
7
|
-
:path => "#{ActiveMetadata::CONFIG['attachment_base_path']}/:document_class/:document_id/:label/:id/:basename.:extension",
|
|
8
|
-
:url => "#{ActiveMetadata::CONFIG['attachment_base_url']}/:document_class/:document_id/:label/:id/"
|
|
9
|
-
|
|
10
|
-
Paperclip.interpolates :document_id do |attachment,style|
|
|
11
|
-
attachment.instance.document_id
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
Paperclip.interpolates :label do |attachment,style|
|
|
15
|
-
attachment.instance.label
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
Paperclip.interpolates :document_class do |attachment,style|
|
|
19
|
-
attachment.instance.document_class
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
namespace :active_metadata do
|
|
2
|
-
|
|
3
|
-
desc "Install the active_metadata gem requirements file ***TASK IS ON ALPHA STAGE***"
|
|
4
|
-
task :install do
|
|
5
|
-
|
|
6
|
-
FileUtils.cp File.expand_path('../../templates/active_metadata.yml',__FILE__), File.expand_path('config/')
|
|
7
|
-
puts "Installed active_metadata.yml"
|
|
8
|
-
|
|
9
|
-
puts "Copying migrations"
|
|
10
|
-
ts = Time.now.utc.strftime('%Y%m%d%H%M%S')
|
|
11
|
-
FileUtils.cp File.expand_path('../../../db/migrate/02_active_metadata_migrations.rb',__FILE__), File.expand_path("db/migrate/#{ts}_active_metadata_migrations.rb")
|
|
12
|
-
puts "run rake db:migrate to complete the gem installation"
|
|
13
|
-
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
end
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
require 'yaml'
|
|
2
|
-
require 'logger'
|
|
3
|
-
require 'active_record'
|
|
4
|
-
|
|
5
|
-
namespace :db do
|
|
6
|
-
def create_database config
|
|
7
|
-
options = {:charset => 'utf8', :collation => 'utf8_unicode_ci'}
|
|
8
|
-
|
|
9
|
-
create_db = lambda do |config|
|
|
10
|
-
ActiveRecord::Base.establish_connection config.merge('database' => nil)
|
|
11
|
-
ActiveRecord::Base.connection.create_database config['database'], options
|
|
12
|
-
ActiveRecord::Base.establish_connection config
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
begin
|
|
16
|
-
create_db.call config
|
|
17
|
-
rescue Mysql::Error => sqlerr
|
|
18
|
-
if sqlerr.errno == 1405
|
|
19
|
-
print "#{sqlerr.error}. \nPlease provide the root password for your mysql installation\n>"
|
|
20
|
-
root_password = $stdin.gets.strip
|
|
21
|
-
|
|
22
|
-
grant_statement = <<-SQL
|
|
23
|
-
GRANT ALL PRIVILEGES ON #{config['database']}.*
|
|
24
|
-
TO '#{config['username']}'@'localhost'
|
|
25
|
-
IDENTIFIED BY '#{config['password']}' WITH GRANT OPTION;
|
|
26
|
-
SQL
|
|
27
|
-
|
|
28
|
-
create_db.call config.merge('database' => nil, 'username' => 'root', 'password' => root_password)
|
|
29
|
-
else
|
|
30
|
-
$stderr.puts sqlerr.error
|
|
31
|
-
$stderr.puts "Couldn't create database for #{config.inspect}, charset: utf8, collation: utf8_unicode_ci"
|
|
32
|
-
$stderr.puts "(if you set the charset manually, make sure you have a matching collation)" if config['charset']
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
task :environment do
|
|
38
|
-
DATABASE_ENV = ENV['DATABASE_ENV'] || 'development'
|
|
39
|
-
MIGRATIONS_DIR = ENV['MIGRATIONS_DIR'] || 'db/migrate'
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
task :configuration => :environment do
|
|
43
|
-
@config = YAML.load_file('config/database.yml')[DATABASE_ENV]
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
task :configure_connection => :configuration do
|
|
47
|
-
ActiveRecord::Base.establish_connection @config
|
|
48
|
-
ActiveRecord::Base.logger = Logger.new STDOUT if @config['logger']
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
desc 'Create the database from config/database.yml for the current DATABASE_ENV'
|
|
52
|
-
task :create => :configure_connection do
|
|
53
|
-
create_database @config
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
desc 'Drops the database for the current DATABASE_ENV'
|
|
57
|
-
task :drop => :configure_connection do
|
|
58
|
-
ActiveRecord::Base.connection.drop_database @config['database']
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
desc 'Migrate the database (options: VERSION=x, VERBOSE=false).'
|
|
62
|
-
task :migrate => :configure_connection do
|
|
63
|
-
ActiveRecord::Migration.verbose = true
|
|
64
|
-
ActiveRecord::Migrator.migrate MIGRATIONS_DIR, ENV['VERSION'] ? ENV['VERSION'].to_i : nil
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
desc 'Rolls the schema back to the previous version (specify steps w/ STEP=n).'
|
|
68
|
-
task :rollback => :configure_connection do
|
|
69
|
-
step = ENV['STEP'] ? ENV['STEP'].to_i : 1
|
|
70
|
-
ActiveRecord::Migrator.rollback MIGRATIONS_DIR, step
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
desc "Retrieves the current schema version number"
|
|
74
|
-
task :version => :configure_connection do
|
|
75
|
-
puts "Current version: #{ActiveRecord::Migrator.current_version}"
|
|
76
|
-
end
|
|
77
|
-
end
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
development:
|
|
2
|
-
persists_with: "active_record"
|
|
3
|
-
history_skip_fields:
|
|
4
|
-
- 'id'
|
|
5
|
-
- 'created_at'
|
|
6
|
-
- 'updated_at'
|
|
7
|
-
attachment_base_path: "public/system/metadata_attachments"
|
|
8
|
-
attachment_base_url: "/system/metadata_attachments"
|
|
9
|
-
|
|
10
|
-
test:
|
|
11
|
-
persists_with: "active_record"
|
|
12
|
-
history_skip_fields:
|
|
13
|
-
- 'id'
|
|
14
|
-
- 'created_at'
|
|
15
|
-
- 'updated_at'
|
|
16
|
-
attachment_base_path: "public/system/metadata_attachments"
|
|
17
|
-
attachment_base_url: "/system/metadata_attachments"
|