trusty-cms 3.0.8 → 3.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +37 -37
- data/INSTALL.md +13 -8
- data/README.md +33 -63
- data/app/models/page.rb +1 -1
- data/coverage/index.html +1 -1
- data/lib/generators/generator_base_extension.rb +4 -2
- data/lib/trusty_cms/admin_ui.rb +1 -1
- data/lib/trusty_cms/extension.rb +1 -12
- data/lib/trusty_cms.rb +1 -1
- data/spec/dummy/log/test.log +22595 -0
- data/spec/dummy/tmp/cache/747/A70/TrustyCms%3A%3AConfig +0 -0
- data/spec/dummy/tmp/cache/85C/FA0/TrustyCms.cache_mtime +0 -0
- data/trusty_cms.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ccd0b6b41ce1e02420af580c501c2a581985f3d
|
4
|
+
data.tar.gz: 3c10ca1244abaa09b83ec6756560f8860357a146
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 174cb8782f0707ee753e0c02ae4020e47f034e8d840d90b9eb41a8a8a1e134fe9ef23e2f5f2c12945cb93b8237d932b3c9243c028f4acb96edebf1167ee9a322
|
7
|
+
data.tar.gz: 3e6700961794fa3c92d948a71effb78d9918248b6f2c390a7745629886888f9d99a2121119498ea7c7d6ec4d61add41448e2a095dcae8953d0ef3c8958e17cff
|
data/Gemfile.lock
CHANGED
@@ -8,7 +8,7 @@ GIT
|
|
8
8
|
PATH
|
9
9
|
remote: .
|
10
10
|
specs:
|
11
|
-
trusty-cms (3.0.
|
11
|
+
trusty-cms (3.0.9)
|
12
12
|
RedCloth (~> 4.3.2)
|
13
13
|
acts_as_tree (~> 2.6.1)
|
14
14
|
bundler (~> 1.7)
|
@@ -24,7 +24,7 @@ PATH
|
|
24
24
|
rack (~> 2.0.1)
|
25
25
|
rack-cache (~> 1.7)
|
26
26
|
radius (~> 0.7)
|
27
|
-
rails (~> 5.0.
|
27
|
+
rails (~> 5.0.1)
|
28
28
|
rake (< 11.0)
|
29
29
|
rdoc (~> 5.1)
|
30
30
|
roadie-rails (~> 1.2.1)
|
@@ -39,39 +39,39 @@ GEM
|
|
39
39
|
remote: https://rubygems.org/
|
40
40
|
specs:
|
41
41
|
RedCloth (4.3.2)
|
42
|
-
actioncable (5.0.
|
43
|
-
actionpack (= 5.0.
|
42
|
+
actioncable (5.0.5)
|
43
|
+
actionpack (= 5.0.5)
|
44
44
|
nio4r (>= 1.2, < 3.0)
|
45
45
|
websocket-driver (~> 0.6.1)
|
46
|
-
actionmailer (5.0.
|
47
|
-
actionpack (= 5.0.
|
48
|
-
actionview (= 5.0.
|
49
|
-
activejob (= 5.0.
|
46
|
+
actionmailer (5.0.5)
|
47
|
+
actionpack (= 5.0.5)
|
48
|
+
actionview (= 5.0.5)
|
49
|
+
activejob (= 5.0.5)
|
50
50
|
mail (~> 2.5, >= 2.5.4)
|
51
51
|
rails-dom-testing (~> 2.0)
|
52
|
-
actionpack (5.0.
|
53
|
-
actionview (= 5.0.
|
54
|
-
activesupport (= 5.0.
|
52
|
+
actionpack (5.0.5)
|
53
|
+
actionview (= 5.0.5)
|
54
|
+
activesupport (= 5.0.5)
|
55
55
|
rack (~> 2.0)
|
56
56
|
rack-test (~> 0.6.3)
|
57
57
|
rails-dom-testing (~> 2.0)
|
58
58
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
59
|
-
actionview (5.0.
|
60
|
-
activesupport (= 5.0.
|
59
|
+
actionview (5.0.5)
|
60
|
+
activesupport (= 5.0.5)
|
61
61
|
builder (~> 3.1)
|
62
62
|
erubis (~> 2.7.0)
|
63
63
|
rails-dom-testing (~> 2.0)
|
64
64
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
65
|
-
activejob (5.0.
|
66
|
-
activesupport (= 5.0.
|
65
|
+
activejob (5.0.5)
|
66
|
+
activesupport (= 5.0.5)
|
67
67
|
globalid (>= 0.3.6)
|
68
|
-
activemodel (5.0.
|
69
|
-
activesupport (= 5.0.
|
70
|
-
activerecord (5.0.
|
71
|
-
activemodel (= 5.0.
|
72
|
-
activesupport (= 5.0.
|
68
|
+
activemodel (5.0.5)
|
69
|
+
activesupport (= 5.0.5)
|
70
|
+
activerecord (5.0.5)
|
71
|
+
activemodel (= 5.0.5)
|
72
|
+
activesupport (= 5.0.5)
|
73
73
|
arel (~> 7.0)
|
74
|
-
activesupport (5.0.
|
74
|
+
activesupport (5.0.5)
|
75
75
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
76
76
|
i18n (~> 0.7)
|
77
77
|
minitest (~> 5.1)
|
@@ -135,7 +135,7 @@ GEM
|
|
135
135
|
ffi (1.9.18)
|
136
136
|
globalid (0.4.0)
|
137
137
|
activesupport (>= 4.2.0)
|
138
|
-
haml (5.0.
|
138
|
+
haml (5.0.2)
|
139
139
|
temple (>= 0.8.0)
|
140
140
|
tilt
|
141
141
|
haml-rails (1.0.0)
|
@@ -168,7 +168,7 @@ GEM
|
|
168
168
|
mime-types-data (~> 3.2015)
|
169
169
|
mime-types-data (3.2016.0521)
|
170
170
|
mini_portile2 (2.2.0)
|
171
|
-
minitest (5.10.
|
171
|
+
minitest (5.10.3)
|
172
172
|
multi_json (1.12.1)
|
173
173
|
mysql2 (0.4.8)
|
174
174
|
nio4r (2.1.0)
|
@@ -195,26 +195,26 @@ GEM
|
|
195
195
|
rack-test (0.6.3)
|
196
196
|
rack (>= 1.0)
|
197
197
|
radius (0.7.4)
|
198
|
-
rails (5.0.
|
199
|
-
actioncable (= 5.0.
|
200
|
-
actionmailer (= 5.0.
|
201
|
-
actionpack (= 5.0.
|
202
|
-
actionview (= 5.0.
|
203
|
-
activejob (= 5.0.
|
204
|
-
activemodel (= 5.0.
|
205
|
-
activerecord (= 5.0.
|
206
|
-
activesupport (= 5.0.
|
207
|
-
bundler (>= 1.3.0
|
208
|
-
railties (= 5.0.
|
198
|
+
rails (5.0.5)
|
199
|
+
actioncable (= 5.0.5)
|
200
|
+
actionmailer (= 5.0.5)
|
201
|
+
actionpack (= 5.0.5)
|
202
|
+
actionview (= 5.0.5)
|
203
|
+
activejob (= 5.0.5)
|
204
|
+
activemodel (= 5.0.5)
|
205
|
+
activerecord (= 5.0.5)
|
206
|
+
activesupport (= 5.0.5)
|
207
|
+
bundler (>= 1.3.0)
|
208
|
+
railties (= 5.0.5)
|
209
209
|
sprockets-rails (>= 2.0.0)
|
210
210
|
rails-dom-testing (2.0.3)
|
211
211
|
activesupport (>= 4.2.0)
|
212
212
|
nokogiri (>= 1.6)
|
213
213
|
rails-html-sanitizer (1.0.3)
|
214
214
|
loofah (~> 2.0)
|
215
|
-
railties (5.0.
|
216
|
-
actionpack (= 5.0.
|
217
|
-
activesupport (= 5.0.
|
215
|
+
railties (5.0.5)
|
216
|
+
actionpack (= 5.0.5)
|
217
|
+
activesupport (= 5.0.5)
|
218
218
|
method_source
|
219
219
|
rake (>= 0.8.7)
|
220
220
|
thor (>= 0.18.1, < 2.0)
|
data/INSTALL.md
CHANGED
@@ -2,17 +2,22 @@
|
|
2
2
|
|
3
3
|
From within the directory containing your TrustyCMS instance:
|
4
4
|
|
5
|
-
1. Create a new Rails
|
5
|
+
1. Create a new Rails 5.0 application (i.e. `rails new [project_name]`)
|
6
6
|
|
7
|
-
2.
|
8
|
-
- gem
|
9
|
-
- gem "mysql2"
|
7
|
+
2. Add the following gems to your Gemfile:
|
8
|
+
- gem 'trusty-cms'
|
10
9
|
- gem 'rails-observers'
|
11
|
-
- gem 'protected_attributes'
|
12
10
|
|
13
|
-
3.
|
11
|
+
3. Add any additional CMS dependencies. TrustyCMS currently supports:
|
14
12
|
|
15
|
-
|
13
|
+
* gem 'trusty-clipped-extension'
|
14
|
+
* gem 'trusty-snippets-extension'
|
15
|
+
* gem 'trusty-layouts-extension'
|
16
|
+
* gem 'trusty-multi-site-extension'
|
17
|
+
|
18
|
+
4. Run `bundle install`
|
19
|
+
|
20
|
+
5. Run the Trusty CMS generator to get the project into shape: `rails g trusty_cms [project_name]`.
|
16
21
|
- This will ask you if you want to replace a number of existing files (like application.rb); reply Y to all.
|
17
22
|
|
18
|
-
|
23
|
+
6. Run `bundle exec rake db:setup`, then `bundle exec rake db:bootstrap`.
|
data/README.md
CHANGED
@@ -2,121 +2,91 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/trusty-cms.svg)](http://badge.fury.io/rb/trusty-cms)
|
4
4
|
|
5
|
-
|
5
|
+
TrustyCMS is a branch of Radiant CMS. Its goal is to pull the Radiant framework into Rails 5 with minimal changes to its infrastructure.
|
6
6
|
|
7
|
-
|
7
|
+
TrustyCMS is a no-fluff, open source content management system designed for
|
8
8
|
small teams. It is similar to Textpattern or MovableType, but is a general
|
9
|
-
purpose content management system (not just a blogging engine).
|
9
|
+
purpose content management system (not just a blogging engine). TrustyCMS is a
|
10
|
+
Rails engine and is built to be installed into an existing Rails 5 application as a gem.
|
10
11
|
|
11
|
-
[![Build Status](https://secure.travis-ci.org/pgharts/trusty-cms.png?branch=master)](https://travis-ci.org/pgharts/trusty-cms/)
|
12
|
+
TravisCI: [![Build Status](https://secure.travis-ci.org/pgharts/trusty-cms.png?branch=master)](https://travis-ci.org/pgharts/trusty-cms/)
|
12
13
|
|
13
|
-
|
14
|
+
CodeClimate: [![Code Climate](https://codeclimate.com/github/codeclimate/codeclimate/badges/gpa.svg)](https://codeclimate.com/github/codeclimate/codeclimate)
|
14
15
|
|
15
|
-
|
16
|
-
TrustyCms features:
|
16
|
+
TrustyCMS features:
|
17
17
|
|
18
18
|
* An elegant user interface
|
19
|
-
* The ability to arrange pages in a hierarchy
|
19
|
+
* The ability to arrange pages in a hierarchy with drag and drop
|
20
20
|
* Flexible templating with layouts, snippets, page parts, and a custom tagging
|
21
|
-
language
|
21
|
+
language
|
22
22
|
* A simple user management/permissions system
|
23
23
|
* Support for Markdown and Textile as well as traditional HTML (it's easy to
|
24
24
|
create other filters)
|
25
25
|
* An advanced plugin system
|
26
|
+
* Social sharing buttons
|
26
27
|
* Operates in two modes: dev and production depending on the URL
|
27
28
|
* A caching system which expires pages every 5 minutes
|
28
|
-
* Built using Ruby on Rails
|
29
|
-
* And much more...
|
29
|
+
* Built using Ruby on Rails (version 5)
|
30
30
|
|
31
31
|
## License
|
32
32
|
|
33
|
-
|
33
|
+
TrustyCMS is released under the MIT license. The Radiant portions of the
|
34
34
|
codebase are copyright (c) John W. Long and Sean Cribbs; anything after the
|
35
35
|
fork is copyright (c) Pittsburgh Cultural Trust. A copy of the MIT license can
|
36
36
|
be found in the LICENSE file.
|
37
37
|
|
38
38
|
## Installation and Setup for Use
|
39
39
|
|
40
|
-
|
41
|
-
configure and run it the way you would a normal
|
40
|
+
TrustyCMS is a traditional Ruby on Rails engine, meaning that you can
|
41
|
+
configure and run it the way you would a normal gem, like [Devise](https://github.com/plataformatec/devise).
|
42
42
|
|
43
|
-
See the INSTALL file for more
|
43
|
+
See the INSTALL.md file for more instructions.
|
44
44
|
|
45
|
-
### Installation and Setup for Contributing to
|
45
|
+
### Installation and Setup for Contributing to TrustyCMS
|
46
46
|
|
47
|
-
####
|
47
|
+
#### Setup
|
48
48
|
|
49
49
|
Prerequisites:
|
50
50
|
|
51
|
-
* A Github account and Git ([Github has some really good
|
51
|
+
* A Github account and Git ([Github has some really good instructions](https://help.github.com/articles/set-up-git))
|
52
|
+
* Ruby 2.2.0 or higher
|
53
|
+
* A Rails application (currently supports version 5.0)
|
54
|
+
* Bundler
|
55
|
+
* MySQL
|
56
|
+
* [PhantomJS >= 1.8.1](https://github.com/teampoltergeist/poltergeist/tree/v1.5.0#installing-phantomjs)
|
52
57
|
|
53
58
|
Steps:
|
54
59
|
|
55
|
-
1. Fork this repository to your
|
60
|
+
1. Fork this repository to your Github account.
|
56
61
|
1. Clone your fork to your machine.
|
57
62
|
1. `cd` into the directory you just cloned into.
|
63
|
+
1. Follow the INSTALL.md instructions to setup an empty app with TrustyCMS installed. To modify TrustyCMS,
|
64
|
+
point your dependency to the local path of your fork.
|
58
65
|
|
59
|
-
|
60
|
-
|
61
|
-
To get a development environment up and running quickly, we have a vagrant box with the dependencies you'll need! Just follow these steps:
|
62
|
-
|
63
|
-
1. Download and install [Vagrant](http://www.vagrantup.com/)
|
64
|
-
1. Download and install [Virtualbox](https://www.virtualbox.org/)
|
65
|
-
1. Download [this box](https://dl.dropboxusercontent.com/u/27379052/trusty-cms.box) into the directory with your code and make sure the file is named "trusty-cms.box".
|
66
|
-
1. Run `vagrant up` to start the virutal environment
|
67
|
-
1. Run `vagrant ssh` to ssh into the virtual environment
|
68
|
-
1. `cd /vagrant` to get to the directory with the rails code that's shared with your computer.
|
66
|
+
gem 'trusty-cms', path: '../trusty-cms'
|
69
67
|
|
70
|
-
|
71
|
-
machine. The files are shared into the `/vagrant` directory in the virtual
|
72
|
-
machine.
|
73
|
-
|
74
|
-
When you're done using the vagrant environment, you can run `vagrant destroy`
|
75
|
-
to stop the vm and remove all guest hard disks. Next time you want to use it,
|
76
|
-
just start from the `vagrant up` step again!
|
77
|
-
|
78
|
-
#### Part B, the native install way to set up
|
79
|
-
|
80
|
-
Prerequisites:
|
81
|
-
|
82
|
-
* Ruby 2.2.0
|
83
|
-
* The bundler gem
|
84
|
-
* Mysql
|
85
|
-
* [PhantomJS >= 1.8.1](https://github.com/teampoltergeist/poltergeist/tree/v1.5.0#installing-phantomjs)
|
86
|
-
|
87
|
-
1. Install the gems with bundler: `bundle`
|
88
|
-
|
89
|
-
#### Part C of setup, common to both kinds of installations
|
90
|
-
|
91
|
-
1. Create a database configuration: `cp config/database.mysql.yml config/database.yml`. You probably don't need to make any further changes.
|
92
|
-
1. Set up your databases:
|
68
|
+
1. Set up your databases in your Rails application:
|
93
69
|
|
94
70
|
bundle exec rake db:create
|
95
71
|
bundle exec rake db:migrate
|
96
|
-
bundle exec rake db:migrate:extensions
|
97
|
-
bundle exec rake db:test:prepare
|
98
72
|
|
99
73
|
1. Run the tests to make sure they pass (If they don't, file a bug!):
|
100
74
|
|
101
75
|
rspec
|
102
76
|
|
103
|
-
1. Run `rails s` to start the server. Visit the site in your browser at http://localhost:3000.
|
104
|
-
|
105
77
|
When you're ready to make a change:
|
106
78
|
|
107
79
|
1. Add the pgharts fork as a git remote called "upstream": `git remote add upstream https://github.com/pgharts/trusty-cms.git` so that you can keep up with changes that other people make.
|
108
|
-
1. Fetch the remote you just added: `git fetch upstream
|
109
|
-
1. Start a new branch for the change you're going to make. Name it something having to do with the changes, like "fix-queries" if you are going to try to fix some queries. Base this branch on `upstream/master` by running `git checkout -b fix-queries upstream/master
|
80
|
+
1. Fetch the remote you just added: `git fetch upstream`.
|
81
|
+
1. Start a new branch for the change you're going to make. Name it something having to do with the changes, like "fix-queries" if you are going to try to fix some queries. Base this branch on `upstream/master` by running `git checkout -b fix-queries upstream/master`.
|
110
82
|
1. Make your changes and commit them. Please include tests!
|
111
83
|
1. Run the tests and make sure they pass.
|
112
|
-
1. Push your changes to your github fork: `git push origin fix-queries
|
113
|
-
1. Send a pull request to the pgharts fork
|
114
|
-
1. High five the nearest person!
|
115
|
-
|
84
|
+
1. Push your changes to your github fork: `git push origin fix-queries`.
|
85
|
+
1. Send a pull request to the pgharts fork.
|
116
86
|
|
117
87
|
## Support
|
118
88
|
|
119
|
-
|
89
|
+
All of the development for TrustyCMS happens on Github:
|
120
90
|
|
121
91
|
https://github.com/pgharts/trusty-cms
|
122
92
|
|
data/app/models/page.rb
CHANGED
@@ -282,7 +282,7 @@ class Page < ActiveRecord::Base
|
|
282
282
|
$1.camelize.constantize if page =~ %r{/([^/]+)\.rb}
|
283
283
|
end
|
284
284
|
end
|
285
|
-
if ActiveRecord::Base.connection.
|
285
|
+
if ActiveRecord::Base.connection.data_sources.include?('pages') && Page.column_names.include?('class_name') # Assume that we have bootstrapped
|
286
286
|
Page.connection.select_values("SELECT DISTINCT class_name FROM pages WHERE class_name <> '' AND class_name IS NOT NULL").each do |p|
|
287
287
|
begin
|
288
288
|
p.constantize
|
data/coverage/index.html
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
<img src="./assets/0.10.1/loading.gif" alt="loading"/>
|
15
15
|
</div>
|
16
16
|
<div id="wrapper" style="display:none;">
|
17
|
-
<div class="timestamp">Generated <abbr class="timeago" title="2017-
|
17
|
+
<div class="timestamp">Generated <abbr class="timeago" title="2017-08-07T14:39:52-04:00">2017-08-07T14:39:52-04:00</abbr></div>
|
18
18
|
<ul class="group_tabs"></ul>
|
19
19
|
|
20
20
|
<div id="content">
|
@@ -2,8 +2,9 @@ require 'rails_generator'
|
|
2
2
|
module TrustyCms
|
3
3
|
module GeneratorBaseExtension
|
4
4
|
def self.included(base)
|
5
|
-
base.class_eval
|
6
|
-
|
5
|
+
base.class_eval {
|
6
|
+
alias_method :existing_migrations_without_extensions, :existing_migrations
|
7
|
+
alias_method :existing_migrations, :existing_migrations_with_extensions
|
7
8
|
}
|
8
9
|
end
|
9
10
|
|
@@ -13,4 +14,5 @@ module TrustyCms
|
|
13
14
|
|
14
15
|
end
|
15
16
|
end
|
17
|
+
|
16
18
|
Rails::Generator::Commands::Base.class_eval { include TrustyCms::GeneratorBaseExtension }
|
data/lib/trusty_cms/admin_ui.rb
CHANGED
data/lib/trusty_cms/extension.rb
CHANGED
@@ -107,14 +107,11 @@ module TrustyCms
|
|
107
107
|
|
108
108
|
def activate_extension
|
109
109
|
return if instance.active?
|
110
|
-
instance.
|
110
|
+
instance.activate_extension if instance.respond_to? :activate
|
111
111
|
Dir["#{Rails.root}/config/routes/**/*.rb"].each do |route_file|
|
112
|
-
#config.paths["config/routes"] << route_file if instance.routed?
|
113
112
|
end
|
114
|
-
#TrustyCms::Application.reload_routes!
|
115
113
|
instance.active = true
|
116
114
|
end
|
117
|
-
alias :activate :activate_extension
|
118
115
|
|
119
116
|
def deactivate_extension
|
120
117
|
return unless instance.active?
|
@@ -131,14 +128,6 @@ module TrustyCms
|
|
131
128
|
instance.migrates_from[extension_name] = until_migration
|
132
129
|
end
|
133
130
|
|
134
|
-
# Expose the configuration object for init hooks
|
135
|
-
# class MyExtension < ActiveRecord::Base
|
136
|
-
# extension_config do |config|
|
137
|
-
# config.after_initialize do
|
138
|
-
# run_something
|
139
|
-
# end
|
140
|
-
# end
|
141
|
-
# end
|
142
131
|
def extension_config(&block)
|
143
132
|
yield Rails.configuration
|
144
133
|
end
|