camaleon_cms 0.1.8 → 0.1.9

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: 5830fa03ce317041674944ce490df0efda85a49a
4
- data.tar.gz: 752e2b694adf04b736391ebbed33d66bb8045438
3
+ metadata.gz: 1d114547f428656d17fdf58ce3a7d1096a01e413
4
+ data.tar.gz: 3b994b5712f74b98f58942d1fa7de814a042c8ab
5
5
  SHA512:
6
- metadata.gz: c34446bf08bf3670f2226c111f8bec2f38a921ce453d055999f0e7d685a888e7c0f61db948f16181178a22f2d57901fc2686d3f27a0cc255e1fc692bd2c1bce6
7
- data.tar.gz: 1347c27ddf41316c23f545ed8f287bbc92ac06e24cce339f19cab6234adc554d692a522c4235341a51c8e7f791fd7aa830937b91a538efa412c410614608bdff
6
+ metadata.gz: 1a8b1bad326b7d06e0051a93b2962c98f0e0ee8e0ac0b7d41950c580891e11948f0cb94e09d6adbcab52c4024a604f1d951b7f9d89208fb73cfe613e436fa969
7
+ data.tar.gz: ad8f732b2820f70fc2e994eb8499d2502243c014d7eee187874166954b1b04d7d693449f8ba57e6a8f7751c16b0d8e5327ab2b1f35a701eb17483db32b6d86b7
@@ -6,22 +6,31 @@
6
6
  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
7
  See the GNU Affero General Public License (GPLv3) for more details.
8
8
  =end
9
- require 'rufus-scheduler'
10
- $scheduler = Rufus::Scheduler.singleton
11
- $scheduler.cron '00 05 * * *' do
12
- system("rake camaleon_cms:sitemap")
13
- end
14
- # cronjob for hook by site
15
9
  begin
16
- Site.all.each do |site|
17
- # hooks
18
- c = CamaleonController.new
19
- c.instance_eval do
20
- @current_site = site
21
- @_hooks_skip = []
10
+ require 'rufus-scheduler'
11
+ loaded_rufus = true
12
+ rescue LoadError
13
+ loaded_rufus = false
14
+ end
15
+
16
+ if loaded_rufus
17
+ $scheduler = Rufus::Scheduler.singleton
18
+ $scheduler.cron '00 05 * * *' do
19
+ system("rake camaleon_cms:sitemap")
20
+ end
21
+
22
+ # run all custom cron jobs
23
+ begin
24
+ Site.all.each do |site|
25
+ # hooks
26
+ c = CamaleonController.new
27
+ c.instance_eval do
28
+ @current_site = site
29
+ @_hooks_skip = []
30
+ end
31
+ r = {site: site, eval: nil}; c.hooks_run("cron", r)
32
+ r[:eval].call(r) if r[:eval].present? # evaluate the cron job created by plugin or theme
22
33
  end
23
- r = {site: site, eval: nil}; c.hooks_run("cron", r)
24
- r[:eval].call(r) if r[:eval].present? # evaluate the cron job created by plugin or theme
34
+ rescue #ActiveRecord::RecordNotFound # skipping pending migrations
25
35
  end
26
- rescue ActiveRecord::RecordNotFound # skipping sites not found
27
36
  end
@@ -1,5 +1,4 @@
1
1
  $camaleon_engine_dir = File.expand_path("../../../", __FILE__)
2
- require File.join($camaleon_engine_dir, "lib", "generators", "camaleon_cms", "install_template", "plugin_routes").to_s
3
2
  Dir[File.join($camaleon_engine_dir, "lib", "ext", "**", "*.rb")].each{ |f| require f }
4
3
  module CamaleonCms
5
4
  class Engine < ::Rails::Engine
@@ -14,33 +13,38 @@ module CamaleonCms
14
13
  end
15
14
 
16
15
  initializer :append_migrations do |app|
17
- engine_dir = File.expand_path("../../../", __FILE__)
18
- app.config.i18n.load_path += Dir[File.join($camaleon_engine_dir, 'config', 'locales', '**', '*.{rb,yml}')]
19
- app.config.i18n.enforce_available_locales = false
20
- PluginRoutes.all_apps.each{ |info| app.config.i18n.load_path += Dir[File.join(info["path"], "config", "locales", '*.{rb,yml}')] }
16
+ unless defined?(PluginRoutes)
17
+ require File.join($camaleon_engine_dir, "lib", "generators", "camaleon_cms", "install_template", "plugin_routes").to_s
18
+ Rails.logger.info "Please copy plugin_routes.rb file in lib/"
19
+ else
20
+ engine_dir = File.expand_path("../../../", __FILE__)
21
+ app.config.i18n.load_path += Dir[File.join($camaleon_engine_dir, 'config', 'locales', '**', '*.{rb,yml}')]
22
+ app.config.i18n.enforce_available_locales = false
23
+ PluginRoutes.all_apps.each{ |info| app.config.i18n.load_path += Dir[File.join(info["path"], "config", "locales", '*.{rb,yml}')] }
21
24
 
22
- # assets
23
- app.config.assets.paths << Rails.root.join("app", "apps")
24
- app.config.assets.paths << Rails.root.join('app', 'assets', 'fonts')
25
- app.config.assets.paths << File.join($camaleon_engine_dir, "app", "apps")
26
- app.config.assets.paths << File.join($camaleon_engine_dir, 'app', 'assets', 'fonts')
27
- app.config.encoding = "utf-8"
25
+ # assets
26
+ app.config.assets.paths << Rails.root.join("app", "apps")
27
+ app.config.assets.paths << Rails.root.join('app', 'assets', 'fonts')
28
+ app.config.assets.paths << File.join($camaleon_engine_dir, "app", "apps")
29
+ app.config.assets.paths << File.join($camaleon_engine_dir, 'app', 'assets', 'fonts')
30
+ app.config.encoding = "utf-8"
28
31
 
29
- #multiple route files
30
- app.routes_reloader.paths.push(File.join(engine_dir, "config", "routes", "admin.rb"))
31
- app.routes_reloader.paths.push(File.join(engine_dir, "config", "routes", "frontend.rb"))
32
- # Dir[File.join(engine_dir, "config", "routes", "*.rb")].each{|r| app.routes_reloader.paths.unshift(r) }
32
+ #multiple route files
33
+ app.routes_reloader.paths.push(File.join(engine_dir, "config", "routes", "admin.rb"))
34
+ app.routes_reloader.paths.push(File.join(engine_dir, "config", "routes", "frontend.rb"))
35
+ # Dir[File.join(engine_dir, "config", "routes", "*.rb")].each{|r| app.routes_reloader.paths.unshift(r) }
33
36
 
34
- # extra configuration for plugins
35
- app.config.autoload_paths += %W{#{app.config.root}/app/apps/**/}
36
- PluginRoutes.all_plugins.each{ |plugin| app.config.paths["db/migrate"] << File.join(plugin["path"], "migrate") if Dir.exist?(File.join(plugin["path"], "migrate")) }
37
+ # extra configuration for plugins
38
+ app.config.autoload_paths += %W{#{app.config.root}/app/apps/**/}
39
+ PluginRoutes.all_plugins.each{ |plugin| app.config.paths["db/migrate"] << File.join(plugin["path"], "migrate") if Dir.exist?(File.join(plugin["path"], "migrate")) }
37
40
 
38
- # migrations checking
39
- unless app.root.to_s.match root.to_s
40
- config.paths["db/migrate"].expanded.each do |expanded_path|
41
- app.config.paths["db/migrate"] << expanded_path
41
+ # migrations checking
42
+ unless app.root.to_s.match root.to_s
43
+ config.paths["db/migrate"].expanded.each do |expanded_path|
44
+ app.config.paths["db/migrate"] << expanded_path
45
+ end
42
46
  end
43
47
  end
44
48
  end
45
49
  end
46
- end
50
+ end
@@ -1,3 +1,3 @@
1
1
  module CamaleonCms
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: camaleon_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owen Peredo Diaz