radiant-fabulator-extension 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt ADDED
@@ -0,0 +1,27 @@
1
+ === 0.0.4 2010-09-07
2
+
3
+ * 1 major enhancement:
4
+ * New Fabulator pages should save without requiring a blank page first
5
+
6
+ * 1 minor enhancement:
7
+ * Bumped required version of Fabulator to 0.0.7
8
+
9
+ === 0.0.3 2010-08-17
10
+
11
+ * 2 minor enhancement:
12
+ * Fix truth logic for choose:when radiant tag
13
+ * Add 'as' attribute for for-each radiant tag - aliases the current
14
+ topic with the variable named by the 'as' attribute
15
+ * The form radiant tag now correctly communicates to the template engine
16
+ the path to the base node for adding default values to a form
17
+
18
+ === 0.0.2 2010-08-10
19
+
20
+ * 1 major enhancement:
21
+ * Cleanup a few things that came up in a clean install
22
+
23
+ === 0.0.1 2010-02-23
24
+
25
+ * 1 major enhancement:
26
+ * Initial release
27
+
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ begin
7
7
  gem.email = "jgsmith@tamu.edu"
8
8
  gem.homepage = "http://github.com/jgsmith/radiant-fabulator"
9
9
  gem.authors = ["James Smith"]
10
- gem.add_dependency('fabulator', '>= 0.0.4')
10
+ gem.add_dependency('fabulator', '>= 0.0.7')
11
11
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
12
12
  end
13
13
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -21,19 +21,11 @@ class FabulatorPage < Page
21
21
  end
22
22
 
23
23
  def find_by_url(url, live = true, clean = false)
24
- #Rails.logger.info("find_by_url(#{url}, #{live}, #{clean})")
25
- #Rails.logger.info("invoking super")
26
24
  p = super
27
- #Rails.logger.info("returning from super")
28
- #Rails.logger.info("Found #{p}")
29
25
  return p if !p.nil? && !p.is_a?(FileNotFoundPage)
30
- #Rails.logger.info("Seeing if we have a resource")
31
26
 
32
27
  url = clean_url(url) if clean
33
- #Rails.logger.info("Our url: #{self.url}")
34
- #Rails.logger.info("Target url: #{url}")
35
28
  if url =~ %r{^#{ self.url }([-_0-9a-zA-Z]+)/?$}
36
- #Rails.logger.info("resource: #{$1}")
37
29
  self.resource_ln = $1
38
30
  return self
39
31
  else
@@ -42,12 +34,10 @@ class FabulatorPage < Page
42
34
  end
43
35
 
44
36
  def url
45
- #Rails.logger.info("Getting url")
46
37
  u = super
47
38
  if !self.resource_ln.nil?
48
39
  u = u + '/' + self.resource_ln
49
40
  end
50
- #Rails.logger.info("Returning '#{u}' as url")
51
41
  u
52
42
  end
53
43
 
@@ -28,9 +28,11 @@ class FabulatorExtension < Radiant::Extension
28
28
  end
29
29
 
30
30
  PagePart.class_eval do
31
- validates_each :content do |record, attr, value|
32
- record.compile_xml
33
- end
31
+ after_save :compile_xml
32
+
33
+ # validates_each :content do |record, attr, value|
34
+ # record.compile_xml
35
+ # end
34
36
 
35
37
  def compile_xml
36
38
  if self.page.class_name == 'FabulatorPage' &&
@@ -40,12 +42,13 @@ class FabulatorExtension < Radiant::Extension
40
42
  self.page.compiled_xml = nil
41
43
  else
42
44
  # compile
43
- #isa = Fabulator::ActionLib.get_local_attr(doc.root, Fabulator::FAB_NS, 'is-a')
45
+ #isa = Fabulator::TagLib.get_local_attr(doc.root, Fabulator::FAB_NS, 'is-a')
44
46
  isa = nil
45
47
  sm = nil
46
48
  if isa.nil?
47
49
  begin
48
- sm = Fabulator::Core::StateMachine.new.compile_xml(self.content)
50
+ sm = Fabulator::Core::StateMachine.new
51
+ sm.compile_xml(self.content)
49
52
  rescue => e
50
53
  self.errors.add(:content, "Compiling the XML application resulted in the following error: #{e}")
51
54
  end
@@ -1,4 +1,4 @@
1
- require 'fabulator/action_lib'
1
+ require 'fabulator/tag_lib'
2
2
  #require 'fabulator/radiant/actions/require_auth'
3
3
 
4
4
  module Fabulator
@@ -9,10 +9,9 @@ module Fabulator
9
9
 
10
10
  module Radiant
11
11
  module Actions
12
- class Lib
13
- include Fabulator::ActionLib
12
+ class Lib < Fabulator::TagLib
14
13
 
15
- register_namespace RADIANT_NS
14
+ namespace RADIANT_NS
16
15
 
17
16
  #action 'require-auth', Fabulator::Radiant::Actions::RequireAuth
18
17
 
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: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
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-08-17 00:00:00 +00:00
18
+ date: 2010-09-07 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -26,12 +26,12 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- hash: 23
29
+ hash: 17
30
30
  segments:
31
31
  - 0
32
32
  - 0
33
- - 4
34
- version: 0.0.4
33
+ - 7
34
+ version: 0.0.7
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
37
  description: Creates a Fabulator page type allowing applications to be built using the fabulator engine.
@@ -44,17 +44,16 @@ extra_rdoc_files:
44
44
  - README.rdoc
45
45
  files:
46
46
  - COPYING.markdown
47
+ - History.txt
47
48
  - README.rdoc
48
49
  - Rakefile
49
50
  - VERSION
50
- - app/models/fabulator_context.rb
51
51
  - app/models/fabulator_page.rb
52
52
  - db/migrate/001_add_fabulator_fields.rb
53
53
  - db/migrate/002_create_fabulator_contexts_table.rb
54
54
  - fabulator_extension.rb
55
55
  - lib/fabulator/radiant.rb
56
56
  - lib/fabulator/radiant/actions.rb
57
- - lib/fabulator/radiant/actions/require_auth.rb
58
57
  - lib/radiant-fabulator-extension.rb
59
58
  has_rdoc: true
60
59
  homepage: http://github.com/jgsmith/radiant-fabulator
@@ -1,36 +0,0 @@
1
- class FabulatorContext < ActiveRecord::Base
2
- #serialize :context
3
- belongs_to :page
4
- belongs_to :user
5
-
6
- def self.find_by_page(p)
7
- if p.request.session[:user_id].blank?
8
- c = self.first(:conditions => [
9
- 'page_id = ? AND session = ? AND (user_id IS NULL OR user_id=0)',
10
- p.id, p.request.session[:session_id]
11
- ] )
12
- else
13
- c = self.first(:conditions => [
14
- 'page_id = ? AND session = ? AND user_id = ?',
15
- p.id, p.request.session[:session_id], p.request.session[:user_id]
16
- ] )
17
- end
18
- if c.nil? && !p.request.session[:user_id].blank?
19
- c = self.first(:conditions => [
20
- 'page_id = ? AND session = ?',
21
- p.id, p.request.session[:session_id]
22
- ] )
23
- if !c.nil? && c.user.nil?
24
- c.update_attribute(:user_id, p.request.session[:user_id])
25
- end
26
- end
27
- p.fabulator_context = c.context unless c.nil?
28
- return c unless c.nil?
29
- self.new(
30
- :context => YAML::dump(p.fabulator_context),
31
- :page_id => p.id,
32
- :user_id => p.request.session[:user_id],
33
- :session => p.request.session[:session_id]
34
- )
35
- end
36
- end
@@ -1,9 +0,0 @@
1
- module Fabulator
2
- module Radiant
3
- module Actions
4
- class RequireAuth
5
-
6
- end
7
- end
8
- end
9
- end