desert 0.5.0 → 0.5.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.
data/Rakefile CHANGED
@@ -20,6 +20,7 @@ def run_suite
20
20
  end
21
21
 
22
22
  begin
23
+ gem "pivotal-jeweler"
23
24
  require 'jeweler'
24
25
  Jeweler::Tasks.new do |s|
25
26
  s.name = "desert"
@@ -27,7 +28,7 @@ begin
27
28
  s.email = "opensource@pivotallabs.com"
28
29
  s.homepage = "http://pivotallabs.com"
29
30
  s.description = "Desert is a component framework for Rails that allows your plugins to be packaged as mini Rails apps."
30
- s.authors = ["Pivotal Labs", "Brian Takita", "Parker Thompson", "Adam Milligan"]
31
+ s.authors = ["Pivotal Labs", "Brian Takita", "Parker Thompson", "Adam Milligan, Joe Moore"]
31
32
  s.files = FileList[
32
33
  '[A-Z]*',
33
34
  '*.rb',
@@ -49,7 +50,7 @@ end
49
50
  desc "Install dependencies to run the build. This task uses Git."
50
51
  task :install_dependencies do
51
52
  require "lib/desert/supported_rails_versions"
52
- system("git clone git://github.com/rails/rails.git spec/rails_root/vendor/rails_versions/edge")
53
+ system("git clone git://github.com/rails/rails.git /Users/pivotal/workspace/desert/spec/rails_root/vendor/rails_versions/edge")
53
54
  Dir.chdir("spec/rails_root/vendor/rails_versions/edge") do
54
55
  begin
55
56
  Desert::SUPPORTED_RAILS_VERSIONS.each do |version, data|
@@ -1,4 +1,2 @@
1
1
  ---
2
- :minor: 5
3
- :patch: 0
4
- :major: 0
2
+ :version: 0.5.2
@@ -30,6 +30,7 @@ module Desert
30
30
  paths << File.join(component_root, 'app','models')
31
31
  paths << File.join(component_root, 'app','controllers')
32
32
  paths << File.join(component_root, 'app','helpers')
33
+ paths << File.join(component_root, 'app','sweepers')
33
34
  paths << File.join(component_root, 'lib')
34
35
  end
35
36
  dependencies.load_paths.reverse.each do |path|
@@ -3,7 +3,10 @@ ActiveRecord::ConnectionAdapters::SchemaStatements.module_eval do
3
3
  initialize_schema_migrations_table_without_plugins
4
4
 
5
5
  begin
6
- execute "CREATE TABLE #{Desert::PluginMigrations::Migrator.schema_migrations_table_name} (plugin_name #{type_to_sql(:string)}, version #{type_to_sql(:string)})"
6
+ smt = Desert::PluginMigrations::Migrator.schema_migrations_table_name
7
+ unless ActiveRecord::Base.connection.tables.include?(smt)
8
+ execute "CREATE TABLE #{smt} (plugin_name #{type_to_sql(:string)}, version #{type_to_sql(:string)})"
9
+ end
7
10
  plugins_and_versions = select_all("SELECT plugin_name, version from #{Desert::PluginMigrations::Migrator.schema_info_table_name}")
8
11
  plugins_and_versions.each do |plugin_data|
9
12
  plugin_name, version = plugin_data["plugin_name"], plugin_data["version"]
@@ -30,4 +33,4 @@ ActiveRecord::ConnectionAdapters::SchemaStatements.module_eval do
30
33
  end
31
34
  end
32
35
  alias_method_chain :initialize_schema_migrations_table, :plugins
33
- end
36
+ end
@@ -4,7 +4,10 @@ if Desert::VersionChecker.rails_version_is_below_1990?
4
4
  require "#{dir}/plugin_templates/1.2.0/action_mailer"
5
5
  elsif Desert::VersionChecker.rails_version_is_below_rc2?
6
6
  require "#{dir}/plugin_templates/1.99.0/action_mailer"
7
- else
7
+ elsif Desert::VersionChecker.rails_version_is_below_220?
8
8
  require "#{dir}/plugin_templates/2.0.0/action_mailer"
9
+ else
10
+ require "#{dir}/plugin_templates/2.2.0/action_mailer"
9
11
  end
12
+
10
13
  require "#{dir}/plugin_templates/action_view"
@@ -20,4 +20,4 @@ module ActionMailer #:nodoc
20
20
  end
21
21
  end
22
22
  end
23
- end
23
+ end
@@ -1,8 +1,11 @@
1
1
  module ActionView #:nodoc:
2
2
  class TemplateFinder #:nodoc:
3
3
  def initialize_with_desert_plugins(*args)
4
- initialize_without_desert_plugins *args
5
-
4
+ begin
5
+ initialize_without_desert_plugins *args
6
+ rescue ActionView::TemplateFinder::InvalidViewPath
7
+ # Desert will add the missing paths next
8
+ end
6
9
  Desert::Manager.plugins.reverse.each do |plugin|
7
10
  append_view_path plugin.templates_path
8
11
  end
@@ -0,0 +1,23 @@
1
+ module ActionMailer #:nodoc
2
+ class Base #:nodoc:
3
+ private
4
+ def template_path_with_plugin_routing
5
+ template_paths = [template_path_without_plugin_routing]
6
+ Desert::Manager.plugins.reverse.each do |plugin|
7
+ template_paths << "#{plugin.templates_path}/#{mailer_name}"
8
+ end
9
+ "{#{template_paths * ','}}"
10
+ end
11
+ alias_method_chain :template_path, :plugin_routing
12
+
13
+ def initialize_template_class(assigns)
14
+ self.view_paths = Dir[template_path].collect do |path|
15
+ File.dirname(path)
16
+ end if self.view_paths.empty?
17
+ returning(template = ActionView::Base.new(view_paths, assigns, self)) do
18
+ template.extend ApplicationHelper
19
+ template.extend self.class.master_helper_module
20
+ end
21
+ end
22
+ end
23
+ end
@@ -10,7 +10,7 @@ else
10
10
  require "#{dir}/2.0.2/action_view"
11
11
  end
12
12
  elsif ActionView.const_defined?(:PathSet)
13
- require "#{dir}/edge/action_view"
13
+ require "#{dir}/2.2.0/action_view"
14
14
  else
15
15
  require "#{dir}/1.2.0/action_view"
16
16
  end
@@ -21,6 +21,14 @@ module Desert
21
21
  def rails_version_is_1991?
22
22
  current_rails_version_matches?('=1.99.1')
23
23
  end
24
+
25
+ def rails_version_is_below_220?
26
+ current_rails_version_matches?('<2.2.0')
27
+ end
28
+
29
+ def rails_version_is_below_230?
30
+ current_rails_version_matches?('<2.3.0')
31
+ end
24
32
  end
25
33
  end
26
34
  end
metadata CHANGED
@@ -1,18 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: desert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pivotal Labs
8
8
  - Brian Takita
9
9
  - Parker Thompson
10
- - Adam Milligan
10
+ - Adam Milligan, Joe Moore
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2009-04-08 00:00:00 -07:00
15
+ date: 2009-08-26 00:00:00 -07:00
16
16
  default_executable:
17
17
  dependencies: []
18
18
 
@@ -55,9 +55,10 @@ files:
55
55
  - lib/desert/plugin_templates/2.0.0/action_mailer.rb
56
56
  - lib/desert/plugin_templates/2.0.2/action_view.rb
57
57
  - lib/desert/plugin_templates/2.1.0/action_view.rb
58
+ - lib/desert/plugin_templates/2.2.0/action_mailer.rb
59
+ - lib/desert/plugin_templates/2.2.0/action_view.rb
58
60
  - lib/desert/plugin_templates/action_controller.rb
59
61
  - lib/desert/plugin_templates/action_view.rb
60
- - lib/desert/plugin_templates/edge/action_view.rb
61
62
  - lib/desert/rails.rb
62
63
  - lib/desert/rails/1.2.0/initializer.rb
63
64
  - lib/desert/rails/2.0.0/plugin.rb
@@ -71,6 +72,8 @@ files:
71
72
  - lib/desert/version_checker.rb
72
73
  has_rdoc: true
73
74
  homepage: http://pivotallabs.com
75
+ licenses: []
76
+
74
77
  post_install_message:
75
78
  rdoc_options:
76
79
  - --main
@@ -94,9 +97,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
97
  requirements: []
95
98
 
96
99
  rubyforge_project: desert
97
- rubygems_version: 1.3.1
100
+ rubygems_version: 1.3.5
98
101
  signing_key:
99
- specification_version: 2
102
+ specification_version: 3
100
103
  summary: Desert is a component framework for Rails that allows your plugins to be packaged as mini Rails apps.
101
104
  test_files: []
102
105