regulate 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile.lock +6 -1
- data/LICENSE +1 -1
- data/README.md +78 -2
- data/app/controllers/regulate/admin/pages_controller.rb +23 -0
- data/app/views/regulate/admin/pages/_form.html.erb +11 -4
- data/app/views/regulate/admin/pages/index.html.erb +11 -2
- data/lib/generators/regulate/{install_generator.rb → mount_up_generator.rb} +2 -17
- data/lib/generators/regulate/{views_generator.rb → strap_generator.rb} +16 -7
- data/lib/generators/templates/regulate.rb +19 -0
- data/lib/generators/templates/regulate.yml +2 -2
- data/lib/generators/templates/regulate_admin.js +167 -0
- data/lib/regulate.rb +7 -0
- data/lib/regulate/engine.rb +2 -2
- data/lib/regulate/git.rb +0 -3
- data/lib/regulate/git/interface.rb +1 -1
- data/lib/regulate/git/model/base.rb +54 -29
- data/lib/regulate/version.rb +1 -1
- data/public/javascripts/regulate_admin.js +1 -1
- data/public/javascripts/regulate_index.js +32 -0
- data/regulate.gemspec +1 -0
- data/test/dummy/app/controllers/application_controller.rb +6 -0
- data/test/dummy/app/models/user.rb +20 -0
- data/test/dummy/config/initializers/regulate.rb +14 -0
- data/test/generators/mount_up_generator_test.rb +15 -0
- data/test/generators/strap_generator_test.rb +22 -0
- data/test/models/regulate_git_model_base_test.rb +176 -7
- data/test/{git_test.rb → regulate_git_interface_test.rb} +2 -2
- metadata +44 -28
- data/lib/generators/templates/regulate.css +0 -2
- data/lib/generators/templates/regulate.js +0 -44
- data/test/tmp/config/initializers/regulate.rb +0 -12
- data/test/tmp/config/regulate.yml +0 -10
- data/test/tmp/public/javascripts/regulate.js +0 -49
- data/test/tmp/public/stylesheets/regulate.css +0 -3
@@ -16,7 +16,7 @@ class Regulate::Git::InterfaceTest < ActiveSupport::TestCase
|
|
16
16
|
:commit_message => 'Creating Git Resource',
|
17
17
|
:author_name => 'Collin',
|
18
18
|
:author_email => 'collin@quickleft.com',
|
19
|
-
:attributes => "{
|
19
|
+
:attributes => "{ \"title\" : \"test #{get_iterator}\" }",
|
20
20
|
:rendered => "<h1>Test #{get_iterator}</h1>"
|
21
21
|
}
|
22
22
|
@commit_sha = Regulate::Git::Interface.save(@commit_data)
|
@@ -68,7 +68,7 @@ class Regulate::Git::InterfaceTest < ActiveSupport::TestCase
|
|
68
68
|
:commit_message => 'Updating Git Resource',
|
69
69
|
:author_name => 'Collin',
|
70
70
|
:author_email => 'collin@quickleft.com',
|
71
|
-
:attributes => "{
|
71
|
+
:attributes => "{ \"title\" : \"1234567\" }"
|
72
72
|
})
|
73
73
|
new_commit_sha = Regulate::Git::Interface.save(new_commit_data)
|
74
74
|
assert_equal @commit_data[:attributes] , Regulate::Git::Interface.find_by_version(@commit_data[:id],@commit_sha)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: regulate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
- 0
|
9
8
|
- 1
|
10
|
-
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Collin Schaafsma
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-01-
|
19
|
+
date: 2011-01-12 00:00:00 -07:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -52,9 +52,25 @@ dependencies:
|
|
52
52
|
type: :runtime
|
53
53
|
version_requirements: *id002
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
|
-
name:
|
55
|
+
name: abstract_auth
|
56
56
|
prerelease: false
|
57
57
|
requirement: &id003 !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
hash: 27
|
63
|
+
segments:
|
64
|
+
- 0
|
65
|
+
- 1
|
66
|
+
- 0
|
67
|
+
version: 0.1.0
|
68
|
+
type: :runtime
|
69
|
+
version_requirements: *id003
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: bluecloth
|
72
|
+
prerelease: false
|
73
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
58
74
|
none: false
|
59
75
|
requirements:
|
60
76
|
- - ~>
|
@@ -66,11 +82,11 @@ dependencies:
|
|
66
82
|
- 9
|
67
83
|
version: 2.0.9
|
68
84
|
type: :development
|
69
|
-
version_requirements: *
|
85
|
+
version_requirements: *id004
|
70
86
|
- !ruby/object:Gem::Dependency
|
71
87
|
name: bundler
|
72
88
|
prerelease: false
|
73
|
-
requirement: &
|
89
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
74
90
|
none: false
|
75
91
|
requirements:
|
76
92
|
- - ~>
|
@@ -82,11 +98,11 @@ dependencies:
|
|
82
98
|
- 0
|
83
99
|
version: 1.0.0
|
84
100
|
type: :development
|
85
|
-
version_requirements: *
|
101
|
+
version_requirements: *id005
|
86
102
|
- !ruby/object:Gem::Dependency
|
87
103
|
name: capybara
|
88
104
|
prerelease: false
|
89
|
-
requirement: &
|
105
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
90
106
|
none: false
|
91
107
|
requirements:
|
92
108
|
- - ~>
|
@@ -98,11 +114,11 @@ dependencies:
|
|
98
114
|
- 0
|
99
115
|
version: 0.4.0
|
100
116
|
type: :development
|
101
|
-
version_requirements: *
|
117
|
+
version_requirements: *id006
|
102
118
|
- !ruby/object:Gem::Dependency
|
103
119
|
name: sqlite3-ruby
|
104
120
|
prerelease: false
|
105
|
-
requirement: &
|
121
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
106
122
|
none: false
|
107
123
|
requirements:
|
108
124
|
- - ~>
|
@@ -114,11 +130,11 @@ dependencies:
|
|
114
130
|
- 2
|
115
131
|
version: 1.3.2
|
116
132
|
type: :development
|
117
|
-
version_requirements: *
|
133
|
+
version_requirements: *id007
|
118
134
|
- !ruby/object:Gem::Dependency
|
119
135
|
name: yard
|
120
136
|
prerelease: false
|
121
|
-
requirement: &
|
137
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
122
138
|
none: false
|
123
139
|
requirements:
|
124
140
|
- - ~>
|
@@ -130,7 +146,7 @@ dependencies:
|
|
130
146
|
- 4
|
131
147
|
version: 0.6.4
|
132
148
|
type: :development
|
133
|
-
version_requirements: *
|
149
|
+
version_requirements: *id008
|
134
150
|
description: The CMS we always wanted.
|
135
151
|
email:
|
136
152
|
- collin@quickleft.com
|
@@ -162,12 +178,11 @@ files:
|
|
162
178
|
- config/routes.rb
|
163
179
|
- docs/docco.css
|
164
180
|
- docs/regulate_admin.html
|
165
|
-
- lib/generators/regulate/
|
166
|
-
- lib/generators/regulate/
|
167
|
-
- lib/generators/templates/regulate.css
|
168
|
-
- lib/generators/templates/regulate.js
|
181
|
+
- lib/generators/regulate/mount_up_generator.rb
|
182
|
+
- lib/generators/regulate/strap_generator.rb
|
169
183
|
- lib/generators/templates/regulate.rb
|
170
184
|
- lib/generators/templates/regulate.yml
|
185
|
+
- lib/generators/templates/regulate_admin.js
|
171
186
|
- lib/regulate.rb
|
172
187
|
- lib/regulate/engine.rb
|
173
188
|
- lib/regulate/git.rb
|
@@ -178,10 +193,12 @@ files:
|
|
178
193
|
- lib/regulate/version.rb
|
179
194
|
- public/javascripts/jquery.min.js
|
180
195
|
- public/javascripts/regulate_admin.js
|
196
|
+
- public/javascripts/regulate_index.js
|
181
197
|
- regulate.gemspec
|
182
198
|
- test/dummy/Rakefile
|
183
199
|
- test/dummy/app/controllers/application_controller.rb
|
184
200
|
- test/dummy/app/helpers/application_helper.rb
|
201
|
+
- test/dummy/app/models/user.rb
|
185
202
|
- test/dummy/app/views/layouts/application.html.erb
|
186
203
|
- test/dummy/config.ru
|
187
204
|
- test/dummy/config/application.rb
|
@@ -194,6 +211,7 @@ files:
|
|
194
211
|
- test/dummy/config/initializers/backtrace_silencers.rb
|
195
212
|
- test/dummy/config/initializers/inflections.rb
|
196
213
|
- test/dummy/config/initializers/mime_types.rb
|
214
|
+
- test/dummy/config/initializers/regulate.rb
|
197
215
|
- test/dummy/config/initializers/secret_token.rb
|
198
216
|
- test/dummy/config/initializers/session_store.rb
|
199
217
|
- test/dummy/config/locales/en.yml
|
@@ -214,19 +232,17 @@ files:
|
|
214
232
|
- test/dummy/public/javascripts/rails.js
|
215
233
|
- test/dummy/public/stylesheets/.gitkeep
|
216
234
|
- test/dummy/script/rails
|
217
|
-
- test/
|
235
|
+
- test/generators/mount_up_generator_test.rb
|
236
|
+
- test/generators/strap_generator_test.rb
|
218
237
|
- test/integration/navigation_test.rb
|
219
238
|
- test/models/regulate_git_model_base_lint_test.rb
|
220
239
|
- test/models/regulate_git_model_base_test.rb
|
221
240
|
- test/models/regulate_page_test.rb
|
241
|
+
- test/regulate_git_interface_test.rb
|
222
242
|
- test/regulate_test.rb
|
223
243
|
- test/routing_test.rb
|
224
244
|
- test/support/integration_case.rb
|
225
245
|
- test/test_helper.rb
|
226
|
-
- test/tmp/config/initializers/regulate.rb
|
227
|
-
- test/tmp/config/regulate.yml
|
228
|
-
- test/tmp/public/javascripts/regulate.js
|
229
|
-
- test/tmp/public/stylesheets/regulate.css
|
230
246
|
has_rdoc: true
|
231
247
|
homepage: ""
|
232
248
|
licenses: []
|
@@ -265,6 +281,7 @@ test_files:
|
|
265
281
|
- test/dummy/Rakefile
|
266
282
|
- test/dummy/app/controllers/application_controller.rb
|
267
283
|
- test/dummy/app/helpers/application_helper.rb
|
284
|
+
- test/dummy/app/models/user.rb
|
268
285
|
- test/dummy/app/views/layouts/application.html.erb
|
269
286
|
- test/dummy/config.ru
|
270
287
|
- test/dummy/config/application.rb
|
@@ -277,6 +294,7 @@ test_files:
|
|
277
294
|
- test/dummy/config/initializers/backtrace_silencers.rb
|
278
295
|
- test/dummy/config/initializers/inflections.rb
|
279
296
|
- test/dummy/config/initializers/mime_types.rb
|
297
|
+
- test/dummy/config/initializers/regulate.rb
|
280
298
|
- test/dummy/config/initializers/secret_token.rb
|
281
299
|
- test/dummy/config/initializers/session_store.rb
|
282
300
|
- test/dummy/config/locales/en.yml
|
@@ -297,16 +315,14 @@ test_files:
|
|
297
315
|
- test/dummy/public/javascripts/rails.js
|
298
316
|
- test/dummy/public/stylesheets/.gitkeep
|
299
317
|
- test/dummy/script/rails
|
300
|
-
- test/
|
318
|
+
- test/generators/mount_up_generator_test.rb
|
319
|
+
- test/generators/strap_generator_test.rb
|
301
320
|
- test/integration/navigation_test.rb
|
302
321
|
- test/models/regulate_git_model_base_lint_test.rb
|
303
322
|
- test/models/regulate_git_model_base_test.rb
|
304
323
|
- test/models/regulate_page_test.rb
|
324
|
+
- test/regulate_git_interface_test.rb
|
305
325
|
- test/regulate_test.rb
|
306
326
|
- test/routing_test.rb
|
307
327
|
- test/support/integration_case.rb
|
308
328
|
- test/test_helper.rb
|
309
|
-
- test/tmp/config/initializers/regulate.rb
|
310
|
-
- test/tmp/config/regulate.yml
|
311
|
-
- test/tmp/public/javascripts/regulate.js
|
312
|
-
- test/tmp/public/stylesheets/regulate.css
|
@@ -1,44 +0,0 @@
|
|
1
|
-
(function($){
|
2
|
-
var Regulate = window.Regulate || Regulate || {};
|
3
|
-
|
4
|
-
Regulate = {
|
5
|
-
init: function Regulate_init(){
|
6
|
-
// some code that needs to be executed after doc ready
|
7
|
-
Regulate.bindEvents();
|
8
|
-
},
|
9
|
-
bindEvents: function Regulate_liveEvents(){
|
10
|
-
// more globally bound events
|
11
|
-
},
|
12
|
-
helpers: function Regulate_helpers(){
|
13
|
-
// helper for searching through arrays
|
14
|
-
Regulate.helpers.arraySearch = function(a){
|
15
|
-
var o = {};
|
16
|
-
for(var i=0;i<a.length;i++){
|
17
|
-
o[a[i]]='';
|
18
|
-
}
|
19
|
-
return o;
|
20
|
-
};
|
21
|
-
//j. resigs array remove overload
|
22
|
-
Array.prototype.remove = function(from, to) {
|
23
|
-
var rest = this.slice((to || from) + 1 || this.length);
|
24
|
-
this.length = from < 0 ? this.length + from : from;
|
25
|
-
return this.push.apply(this, rest);
|
26
|
-
};
|
27
|
-
// duck punch Array.indexOf into IE browsers
|
28
|
-
if(!Array.indexOf){
|
29
|
-
Array.prototype.indexOf = function(obj){
|
30
|
-
for(var i=0; i<this.length; i++){
|
31
|
-
if(this[i]==obj){
|
32
|
-
return i;
|
33
|
-
}
|
34
|
-
}
|
35
|
-
return -1;
|
36
|
-
};
|
37
|
-
}
|
38
|
-
}
|
39
|
-
};
|
40
|
-
|
41
|
-
window.Regulate = Regulate;
|
42
|
-
$(document).ready(Regulate.init);
|
43
|
-
|
44
|
-
})(jQuery);
|
@@ -1,12 +0,0 @@
|
|
1
|
-
Regulate.setup do |config|
|
2
|
-
# Role that allows a user to edit pages, default is :editor
|
3
|
-
# config.editor_role = :editor
|
4
|
-
|
5
|
-
# Role that allows a user to manage pages and define what parts are editable, default is :admin
|
6
|
-
# config.admin_role = :admin
|
7
|
-
|
8
|
-
#YAML.load_file(File.join(Rails.root, "config", "regulate.yml"))[Rails.env]
|
9
|
-
#config.
|
10
|
-
end
|
11
|
-
|
12
|
-
# Make sure we have a git repo all setup based on our environment
|
@@ -1,49 +0,0 @@
|
|
1
|
-
(function($){
|
2
|
-
var Regulate = Regulate || {};
|
3
|
-
|
4
|
-
Regulate = {
|
5
|
-
init: function QL_init(){
|
6
|
-
// some code that needs to be executed after doc ready
|
7
|
-
QL.bindEvents();
|
8
|
-
},
|
9
|
-
bindEvents: function QL_liveEvents(){
|
10
|
-
$('a[rel*=external]').live('click',function(){
|
11
|
-
window.open(this.href);
|
12
|
-
return false;
|
13
|
-
});
|
14
|
-
|
15
|
-
// more globally bound events
|
16
|
-
},
|
17
|
-
helpers: function QL_helpers(){
|
18
|
-
// helper for searching through arrays
|
19
|
-
QL.helpers.arraySearch = function(a){
|
20
|
-
var o = {};
|
21
|
-
for(var i=0;i<a.length;i++){
|
22
|
-
o[a[i]]='';
|
23
|
-
}
|
24
|
-
return o;
|
25
|
-
};
|
26
|
-
//j. resigs array remove overload
|
27
|
-
Array.prototype.remove = function(from, to) {
|
28
|
-
var rest = this.slice((to || from) + 1 || this.length);
|
29
|
-
this.length = from < 0 ? this.length + from : from;
|
30
|
-
return this.push.apply(this, rest);
|
31
|
-
};
|
32
|
-
// duck punch Array.indexOf into IE browsers
|
33
|
-
if(!Array.indexOf){
|
34
|
-
Array.prototype.indexOf = function(obj){
|
35
|
-
for(var i=0; i<this.length; i++){
|
36
|
-
if(this[i]==obj){
|
37
|
-
return i;
|
38
|
-
}
|
39
|
-
}
|
40
|
-
return -1;
|
41
|
-
}
|
42
|
-
}
|
43
|
-
}
|
44
|
-
};
|
45
|
-
|
46
|
-
window.Regulate = Regulate;
|
47
|
-
$(document).ready(Regulate.init);
|
48
|
-
|
49
|
-
})(jQuery);
|