camaleon_cms 0.0.2 → 0.1.2
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.
Potentially problematic release.
This version of camaleon_cms might be problematic. Click here for more details.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f649347d40328e102bf97f667dc9a92a4249da23
|
4
|
+
data.tar.gz: d7b11f5924ce4af26805d9100522b352f2fc536d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc798d85dae6d7c2d73c39193990920f491f23c9652d885c81977b943ced6ead22ec380e584c49643aa3e3f56058f5f1c1f1db9d3e19c9caf814f07ded986197
|
7
|
+
data.tar.gz: 23f2520908e6f8799424849ac178e1a47d2a5684d5eddad644924abd9b49b19c697de2d2df6dfcd634aeb1e7ed044fca1c438273f2414027cadbf852f963c105
|
data/lib/Gemfile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
##################### CUSTOM GEMS ######################
|
3
|
+
gem 'protected_attributes' # used for dynamic attributes (newer versions will be deprecated)
|
4
|
+
gem 'bcrypt' # rails password security
|
5
|
+
gem 'mini_magick' # image library (resize, crop, captcha, ..)
|
6
|
+
gem 'will_paginate' # list pagination
|
7
|
+
gem 'will_paginate-bootstrap' # list pagination for bootstrap
|
8
|
+
|
9
|
+
# others
|
10
|
+
gem 'el_finder' # media manager
|
11
|
+
gem 'cancancan', '~> 1.10' # user permissions
|
12
|
+
gem 'meta-tags' # seo meta tags generatos
|
13
|
+
gem 'draper', '~> 1.3' # decorators
|
14
|
+
|
15
|
+
gem 'rufus-scheduler', '~> 3.1.1' # crontab
|
16
|
+
gem "dynamic_sitemaps" # sitemaps
|
17
|
+
gem 'actionpack-page_caching' # page caching
|
18
|
+
gem 'mobu' # mobile detect
|
19
|
+
|
20
|
+
# fix for windows users
|
21
|
+
group :development do
|
22
|
+
gem 'thin', platforms: [:mingw, :mswin]
|
23
|
+
gem 'tzinfo-data', platforms: [:mingw, :mswin]
|
24
|
+
end
|
25
|
+
##################### END CUSTOM GEMS ######################
|
data/lib/camaleon_cms/version.rb
CHANGED
@@ -9,7 +9,7 @@ module CamaleonCms
|
|
9
9
|
def create_initializer_file
|
10
10
|
copy_file "system.json", "config/system.json"
|
11
11
|
copy_file "plugin_routes.rb", "lib/plugin_routes.rb"
|
12
|
-
copy_file "
|
12
|
+
# copy_file "Gemfile", "lib/Gemfile_camaleon"
|
13
13
|
directory("apps", "app/apps")
|
14
14
|
append_to_file 'Gemfile' do
|
15
15
|
"\n\n#################### Camaleon CMS include all gems for plugins and themes #################### \nrequire './lib/plugin_routes' \ninstance_eval(PluginRoutes.draw_gems)"
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'json'
|
2
|
-
require 'active_support/core_ext/hash/indifferent_access'
|
3
2
|
class PluginRoutes
|
4
3
|
@@_vars = []
|
5
4
|
# load plugin routes if it is enabled
|
@@ -65,29 +64,32 @@ class PluginRoutes
|
|
65
64
|
|
66
65
|
# return plugin information
|
67
66
|
def self.plugin_info(plugin_key)
|
68
|
-
self.all_plugins.each{|p| return p if p[
|
67
|
+
self.all_plugins.each{|p| return p if p["key"] == plugin_key }
|
69
68
|
nil
|
70
69
|
end
|
71
70
|
|
72
71
|
# return theme information
|
73
72
|
# if theme_name is nil, the use current site theme
|
74
73
|
def self.theme_info(theme_name)
|
75
|
-
self.all_themes.each{|p| return p if p[
|
74
|
+
self.all_themes.each{|p| return p if p["key"] == theme_name }
|
76
75
|
nil
|
77
76
|
end
|
78
77
|
|
79
78
|
# return system information
|
80
79
|
def self.system_info
|
80
|
+
camaleon_gem = get_gem('camaleon_cms')
|
81
|
+
return {} if !camaleon_gem
|
81
82
|
r = cache_variable("system_info"); return r unless r.nil?
|
82
83
|
res = {}
|
83
|
-
res = JSON.parse(File.read(File.join(
|
84
|
+
res = JSON.parse(File.read(File.join(camaleon_gem.gem_dir, "config", "system.json")))
|
85
|
+
res = res.with_indifferent_access rescue res
|
84
86
|
return cache_variable("system_info", res) unless File.exist?(system_file = File.join(apps_dir, "..", '..', "config", "system.json"))
|
85
87
|
res = res.merge(JSON.parse(File.read(system_file)).with_indifferent_access).with_indifferent_access
|
86
88
|
res["key"] = "system"
|
87
89
|
res["path"] = ''
|
88
90
|
res["kind"] = "system"
|
89
|
-
res[
|
90
|
-
res[
|
91
|
+
res["hooks"] = {} unless res["hooks"].present?
|
92
|
+
res["hooks"]["on_notification"] = (res["hooks"]["on_notification"] || []) + ["admin_system_notifications"]
|
91
93
|
cache_variable("system_info", res)
|
92
94
|
end
|
93
95
|
|
@@ -117,7 +119,7 @@ class PluginRoutes
|
|
117
119
|
all_plugins.each do |plugin|
|
118
120
|
res << plugin if enabled_ps.include?(plugin["key"])
|
119
121
|
end
|
120
|
-
res = res.sort_by{|e| e[
|
122
|
+
res = res.sort_by{|e| e["position"] || 10 }
|
121
123
|
cache_variable("enable_plugins_site_#{site.id}", res)
|
122
124
|
end
|
123
125
|
|
@@ -224,11 +226,11 @@ class PluginRoutes
|
|
224
226
|
def self.draw_gems
|
225
227
|
res = []
|
226
228
|
# recovering gem dependencies
|
227
|
-
if camaleon_gem = get_gem('
|
228
|
-
res << File.read(File.join(camaleon_gem.gem_dir, "Gemfile")).gsub("source 'https://rubygems.org'", "")
|
229
|
+
if camaleon_gem = get_gem('camaleon_cms')
|
230
|
+
res << File.read(File.join(camaleon_gem.gem_dir, "lib", "Gemfile")).gsub("source 'https://rubygems.org'", "")
|
229
231
|
else
|
230
|
-
|
231
|
-
|
232
|
+
puts "You need to install camaleon_cms gem."
|
233
|
+
return ""
|
232
234
|
end
|
233
235
|
(self.all_themes + self.all_plugins).each do |item|
|
234
236
|
f = File.join(item["path"], "config", "Gemfile")
|
@@ -246,14 +248,17 @@ class PluginRoutes
|
|
246
248
|
|
247
249
|
# return all plugins located in cms and in this project
|
248
250
|
def self.all_plugins
|
251
|
+
camaleon_gem = get_gem('camaleon_cms')
|
252
|
+
return [] if !camaleon_gem
|
249
253
|
r = cache_variable("all_plugins"); return r unless (r.nil? || r == [])
|
250
254
|
res = []
|
251
255
|
entries = [".", ".."]
|
252
|
-
(Dir["#{apps_dir}/plugins/*"] +
|
256
|
+
(Dir["#{apps_dir}/plugins/*"] + Dir["#{camaleon_gem.gem_dir}/app/apps/plugins/*"]).each do |path|
|
253
257
|
entry = path.split("/").last
|
254
258
|
config = File.join(path, "config", "config.json")
|
255
259
|
next if entries.include?(entry) || !File.directory?(path) || !File.exist?(config)
|
256
|
-
p = JSON.parse(File.read(config))
|
260
|
+
p = JSON.parse(File.read(config))
|
261
|
+
p = p.with_indifferent_access rescue p
|
257
262
|
p["key"] = entry
|
258
263
|
p["path"] = path
|
259
264
|
p["kind"] = "plugin"
|
@@ -265,14 +270,17 @@ class PluginRoutes
|
|
265
270
|
|
266
271
|
# return an array of all themes installed for all sites
|
267
272
|
def self.all_themes
|
273
|
+
camaleon_gem = get_gem('camaleon_cms')
|
274
|
+
return [] if !camaleon_gem
|
268
275
|
r = cache_variable("all_themes"); return r unless (r.nil? || r == [])
|
269
276
|
res = []
|
270
277
|
entries = [".", ".."]
|
271
|
-
(Dir["#{apps_dir}/themes/*"] +
|
278
|
+
(Dir["#{apps_dir}/themes/*"] + Dir["#{camaleon_gem.gem_dir}/app/apps/themes/*"]).each do |path|
|
272
279
|
entry = path.split("/").last
|
273
280
|
config = File.join(path, "config", "config.json")
|
274
281
|
next if entries.include?(entry) || !File.directory?(path) || !File.exist?(config)
|
275
|
-
p = JSON.parse(File.read(config))
|
282
|
+
p = JSON.parse(File.read(config))
|
283
|
+
p = p.with_indifferent_access rescue p
|
276
284
|
p["key"] = entry
|
277
285
|
p["path"] = path
|
278
286
|
p["kind"] = "theme"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: camaleon_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Owen Peredo Diaz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Camaleon CMS is a dynamic and advanced content management system based
|
14
14
|
on Ruby on Rails 4 as an alternative to Wordpress.
|
@@ -611,6 +611,7 @@ files:
|
|
611
611
|
- config/sitemap.rb
|
612
612
|
- config/system.json
|
613
613
|
- db/migrate/20150611161134_post_table_into_utf8.rb
|
614
|
+
- lib/Gemfile
|
614
615
|
- lib/ca-bundle.crt
|
615
616
|
- lib/camaleon_cms.rb
|
616
617
|
- lib/camaleon_cms/engine.rb
|