trinidad_sandbox_extension 0.4.1 → 0.4.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/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.4.2 (2010-12-21)
2
+
3
+ * Fix application name when the context path is an empty string
4
+
1
5
  == 0.4.1 (2010-11-05)
2
6
 
3
7
  * Add redeploy button
data/Rakefile CHANGED
@@ -81,14 +81,11 @@ end
81
81
 
82
82
  task :default => :spec
83
83
 
84
- require 'spec/rake/spectask'
85
- Spec::Rake::SpecTask.new(:spec) do |spec|
86
- spec.libs << 'lib' << 'spec'
87
- spec.spec_opts = ['--options', 'spec/spec.opts']
88
- spec.spec_files = FileList['spec/**/*_spec.rb']
89
- end
90
-
84
+ require 'rspec/core/rake_task'
91
85
 
86
+ RSpec::Core::RakeTask.new(:spec) do |spec|
87
+ spec.rspec_opts = ['--colour', "--format documentation"]
88
+ end
92
89
 
93
90
  #############################################################################
94
91
  #
@@ -6,7 +6,7 @@ require File.expand_path('../../trinidad-libs/trinidad-sandbox-extension', __FIL
6
6
  module Trinidad
7
7
  module Extensions
8
8
  class SandboxServerExtension < ServerExtension
9
- VERSION = '0.4.1'
9
+ VERSION = '0.4.2'
10
10
 
11
11
  def configure(tomcat)
12
12
  opts = prepare_options
@@ -16,8 +16,11 @@ module Trinidad
16
16
  end
17
17
 
18
18
  def self.find(name)
19
- name = '/' + name unless name[0..1] == '/'
20
- path = CGI.unescape(name)
19
+ escaped_name = ''
20
+ unless name == 'default'
21
+ escaped_name = '/' + name unless name[0..1] == '/'
22
+ end
23
+ path = CGI.unescape(escaped_name)
21
24
  context = host.findChild(path)
22
25
  ApplicationContext.new(context) if context
23
26
  end
@@ -30,6 +33,14 @@ module Trinidad
30
33
  @slug ||= CGI.escape(name.sub('/', ''))
31
34
  end
32
35
 
36
+ def name
37
+ @name ||= super.empty? ? 'default' : super
38
+ end
39
+
40
+ def path
41
+ @path ||= super.empty? ? '/' : super
42
+ end
43
+
33
44
  def self_path
34
45
  @self_path ||= "#{ApplicationContext.sandbox_context.path}/apps/#{slug}"
35
46
  end
@@ -1,6 +1,8 @@
1
1
  %application
2
2
  %name= app.name
3
+ %path= app.path
3
4
  %available= app.available
5
+ %link(rel = "edit" href = "#{app.self_path}.xml")
4
6
  - app.actions.each do |action|
5
7
  %link(rel = "#{action[:rel]}" href = "#{action[:href]}.xml")
6
8
  - if app.parameters
data/spec/spec_helper.rb CHANGED
@@ -1,9 +1,9 @@
1
1
  begin
2
- require 'spec'
2
+ require 'rspec'
3
3
  rescue LoadError
4
4
  require 'rubygems'
5
5
  gem 'rspec'
6
- require 'spec'
6
+ require 'rspec'
7
7
  end
8
8
 
9
9
  $:.unshift(File.dirname(__FILE__) + '/../lib')
@@ -12,6 +12,6 @@ require 'java'
12
12
  require 'trinidad_sandbox_extension'
13
13
  require 'mocha'
14
14
 
15
- Spec::Runner.configure do |config|
15
+ RSpec.configure do |config|
16
16
  config.mock_with :mocha
17
17
  end
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'trinidad_sandbox_extension'
16
- s.version = '0.4.1'
17
- s.date = '2010-11-05'
16
+ s.version = '0.4.2'
17
+ s.date = '2010-12-21'
18
18
  s.rubyforge_project = 'trinidad_sandbox_extension'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -47,7 +47,7 @@ Gem::Specification.new do |s|
47
47
 
48
48
  ## List your development dependencies here. Development dependencies are
49
49
  ## those that are only needed during development
50
- s.add_development_dependency('rspec')
50
+ s.add_development_dependency('rspec', '>=2.2')
51
51
  s.add_development_dependency('mocha')
52
52
 
53
53
  ## Leave this section as-is. It will be automatically generated from the
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 1
9
- version: 0.4.1
8
+ - 2
9
+ version: 0.4.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - David Calavera
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-11-05 00:00:00 -07:00
17
+ date: 2010-12-21 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -99,8 +99,9 @@ dependencies:
99
99
  - - ">="
100
100
  - !ruby/object:Gem::Version
101
101
  segments:
102
- - 0
103
- version: "0"
102
+ - 2
103
+ - 2
104
+ version: "2.2"
104
105
  type: :development
105
106
  version_requirements: *id007
106
107
  - !ruby/object:Gem::Dependency