locomotive_cms 0.0.2 → 0.0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/helpers/admin/base_helper.rb +2 -0
- data/lib/generators/locomotive/assets/assets_generator.rb +16 -0
- data/lib/generators/locomotive/install/install_generator.rb +13 -0
- data/lib/generators/locomotive/install/templates/locomotive.rb +12 -0
- data/lib/locomotive/engine.rb +6 -0
- metadata +5 -2
- data/lib/generators/locomotive_generator.rb +0 -14
@@ -0,0 +1,16 @@
|
|
1
|
+
module Locomotive
|
2
|
+
class AssetsGenerator < Rails::Generators::Base
|
3
|
+
|
4
|
+
def self.source_root
|
5
|
+
puts "(before) source_root = #{@_locomotive_source_root}"
|
6
|
+
@_locomotive_source_root ||= File.expand_path("../../../../../", __FILE__)
|
7
|
+
puts "(after) source_root = #{@_locomotive_source_root}"
|
8
|
+
@_locomotive_source_root
|
9
|
+
end
|
10
|
+
|
11
|
+
def copy_public_files
|
12
|
+
directory "public", "public", :recursive => true
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Locomotive
|
2
|
+
class InstallGenerator < Rails::Generators::Base
|
3
|
+
|
4
|
+
def self.source_root
|
5
|
+
@_locomotive_source_root ||= File.expand_path("../templates", __FILE__)
|
6
|
+
end
|
7
|
+
|
8
|
+
def copy_initializer
|
9
|
+
template "locomotive.rb", "config/initializers/locomotive.rb"
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Locomotive.configure do |config|
|
2
|
+
# if not defined, locomotive will use example.com as main domain name. Remove prefix www from your domain name.
|
3
|
+
# Ex:
|
4
|
+
# config.default_domain = Rails.env.production? ? 'mydomain.com' : 'example.com'
|
5
|
+
config.default_domain = 'mydomain.com'
|
6
|
+
|
7
|
+
# configure how many items we display in sub menu in the "Contents" section.
|
8
|
+
config.lastest_items_nb = 5
|
9
|
+
|
10
|
+
# tell if logs are enabled. Useful for debug purpose.
|
11
|
+
config.enable_logs = true
|
12
|
+
end
|
data/lib/locomotive/engine.rb
CHANGED
@@ -9,12 +9,18 @@ require 'mongoid_acts_as_tree'
|
|
9
9
|
|
10
10
|
require File.dirname(__FILE__) + '/../../vendor/plugins/custom_fields/init.rb'
|
11
11
|
|
12
|
+
ActiveSupport.on_load(:action_view) {
|
13
|
+
Rails.logger.info "ActiveSupport.on_load(:action_view) / #{ActionController::Base.helpers_path.inspect}"
|
14
|
+
}
|
15
|
+
|
12
16
|
module Locomotive
|
13
17
|
class Engine < Rails::Engine
|
14
18
|
|
15
19
|
initializer "locomotive.add_helpers" do |app|
|
20
|
+
puts "locomotive.add_helpers"
|
16
21
|
path = [*ActionController::Base.helpers_path] << File.dirname(__FILE__) + "/../../app/helpers"
|
17
22
|
ActionController::Base.helpers_path = path
|
23
|
+
Rails.logger.info "locomotive.add_helpers / #{ActionController::Base.helpers_path.inspect}"
|
18
24
|
end
|
19
25
|
|
20
26
|
end
|
metadata
CHANGED
@@ -6,7 +6,8 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 0
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
|
9
|
+
- 1
|
10
|
+
version: 0.0.2.1
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Didier Lafforgue
|
@@ -389,7 +390,9 @@ files:
|
|
389
390
|
- config/mongoid.yml
|
390
391
|
- config/routes.rb
|
391
392
|
- lib/core_ext.rb
|
392
|
-
- lib/generators/
|
393
|
+
- lib/generators/locomotive/assets/assets_generator.rb
|
394
|
+
- lib/generators/locomotive/install/install_generator.rb
|
395
|
+
- lib/generators/locomotive/install/templates/locomotive.rb
|
393
396
|
- lib/locomotive.rb
|
394
397
|
- lib/locomotive/configuration.rb
|
395
398
|
- lib/locomotive/devise/sessions_controller.rb
|
@@ -1,14 +0,0 @@
|
|
1
|
-
class LocomotiveGenerator < Rails::Generators::Base
|
2
|
-
class_option :update, :type => :boolean, :default => false,
|
3
|
-
:desc => "Just update public files, do not create seed"
|
4
|
-
|
5
|
-
def self.source_root
|
6
|
-
@_locomotive_source_root ||= File.dirname(__FILE__)
|
7
|
-
end
|
8
|
-
|
9
|
-
def copy_public_files
|
10
|
-
directory "../../public", "public", :recursive => true
|
11
|
-
exit(0) if options.update?
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|