radiant-fabulator-extension 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,12 @@
1
+ === 0.0.7 2010-10-28
2
+ * 1 major enhancement:
3
+ * Applications are no longer pre-compiled when pages are saved
4
+
5
+ * 2 minor enhancements:
6
+ * All namespaces declared with Fabulator.namespace() have a debug()
7
+ method that will call console.log() if it exists
8
+ * Updated README for rake tasks
9
+
1
10
  === 0.0.6 2010-10-26
2
11
  * 2 major enhancement:
3
12
  * Added fabulator:resources tag for radiant layouts to include needed
data/README.rdoc CHANGED
@@ -18,4 +18,13 @@ gems:
18
18
  You may also want to add some fabulator extensions.
19
19
  See http://github.com/jgsmith/
20
20
 
21
+ After installation, you will need to add the following to your site's
22
+ environment.rb:
23
+
24
+ config.gem 'radiant-fabulator-extension'
25
+
26
+ and the following to your site's Rakefile:
27
+
28
+ require 'tasks/fabulator_extension'
29
+
21
30
  [Radiant CMS]: http://www.radiantcms.org/
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.6
1
+ 0.0.7
@@ -42,6 +42,25 @@ class FabulatorPage < Page
42
42
  end
43
43
 
44
44
  def state_machine
45
+ return @state_machine unless @state_machine.nil?
46
+
47
+ begin
48
+ FabulatorLibrary.all.each do |library|
49
+ if library.compiled_xml.is_a?(Fabulator::Lib::Lib)
50
+ library.compiled_xml.register_library
51
+ end
52
+ end
53
+
54
+ compiler = Fabulator::Compiler.new
55
+ part = self.part(XML_PART_NAME)
56
+ @state_machine = compiler.compile(part.content)
57
+ rescue => e
58
+ Rails.logger.info("Compiling the XML application resulted in the following error: #{e}")
59
+ self.errors.add(:content, "Compiling the XML application resulted in the following error: #{e}")
60
+ end
61
+
62
+ return @state_machine
63
+
45
64
  if self.compiled_xml.nil? || self.compiled_xml == ''
46
65
  self.c_state_machine = nil
47
66
  else
@@ -5,7 +5,7 @@ require 'fabulator_tags'
5
5
  require_dependency "#{File.expand_path(File.dirname(__FILE__))}/app/models/fabulator_page"
6
6
 
7
7
  class FabulatorExtension < Radiant::Extension
8
- version "0.0.6"
8
+ version "0.0.7"
9
9
  description "Applications as documents"
10
10
  url "http://github.com/jgsmith/radiant-fabulator"
11
11
 
@@ -49,7 +49,7 @@ class FabulatorExtension < Radiant::Extension
49
49
  }
50
50
 
51
51
  PagePart.class_eval do
52
- after_save :compile_xml
52
+ #after_save :compile_xml
53
53
 
54
54
  def compile_xml
55
55
  if self.page.class_name == 'FabulatorPage' &&
@@ -0,0 +1,30 @@
1
+ namespace :radiant do
2
+ namespace :extensions do
3
+ namespace :fabulator do
4
+
5
+ desc "Runs the migration for the Fabulator extension"
6
+ task :migrate => :environment do
7
+ require 'radiant/extension_migrator'
8
+ if ENV["VERSION"]
9
+ FabulatorExtension.migrator.migrate(ENV["VERSION"].to_i)
10
+ Rake::Task['db:schema:dump'].invoke
11
+ else
12
+ FabulatorExtension.migrator.migrate
13
+ Rake::Task['db:schema:dump'].invoke
14
+ end
15
+ end
16
+
17
+ desc "Copies public assets of the Fabulator extenion to the instance public/ directory."
18
+ task :update => :environment do
19
+ is_svn_or_dir = proc { |path| path =~ /\.svn/ || File.directory?(path) }
20
+ Dir[FabulatorExtension.root + "/public/**/*"].reject(&is_svn_or_dir).each do |file|
21
+ path = file.sub(FabulatorExtension.root, '')
22
+ directory = File.dirname(path)
23
+ puts "Copying #{path}..."
24
+ mkdir_p RAILS_ROOT + directory, :verbose => false
25
+ cp file, RAILS_ROOT + path, :verbose => false
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -6,12 +6,22 @@ var Fabulator = Fabulator || { };
6
6
 
7
7
  (function($, Fabulator) {
8
8
 
9
+ if(window.console != undefined && window.console.log != undefined) {
10
+ Fabulator.debug = function() {
11
+ console.log(Array.prototype.slice.call(arguments));
12
+ };
13
+ }
14
+ else {
15
+ Fabulator.debug = function() { };
16
+ }
17
+
9
18
  var genericNamespacer = function(base, nom) {
10
19
  if(typeof(base[nom]) == "undefined") {
11
20
  base[nom] = { };
12
21
  base[nom].namespace = function(nom2) {
13
22
  return genericNamespacer(base[nom], nom2);
14
23
  };
24
+ base[nom].debug = Fabulator.debug;
15
25
  }
16
26
  return base[nom];
17
27
  };
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-fabulator-extension
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
10
- version: 0.0.6
9
+ - 7
10
+ version: 0.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - James Smith
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-26 00:00:00 +00:00
18
+ date: 2010-10-29 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -68,6 +68,7 @@ files:
68
68
  - lib/fabulator/radiant/actions/require_auth.rb
69
69
  - lib/fabulator_filter.rb
70
70
  - lib/radiant-fabulator-extension.rb
71
+ - lib/tasks/fabulator_extension.rb
71
72
  - lib/tasks/fabulator_extension_tasks.rake
72
73
  - public/javascripts/fabulator/InfusionAll.js
73
74
  - public/javascripts/fabulator/core.js