rid-core 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.2.0
data/lib/rid/app.rb CHANGED
@@ -14,7 +14,7 @@ module Rid
14
14
  #
15
15
  def initialize(options = OpenStruct.new)
16
16
  @root = options.root
17
- @root ||= Dir.pwd
17
+ @root ||= find_root
18
18
  @root = Pathname.new(@root)
19
19
 
20
20
  @db_url = options.database
@@ -45,5 +45,19 @@ module Rid
45
45
  File.read(filename).strip
46
46
  rescue Errno::ENOENT
47
47
  end
48
+
49
+ # from Rails:
50
+ # Returns application root.
51
+ # traverses the directory to top,
52
+ # until it finds app config file.
53
+ def find_root
54
+ cwd = Dir.pwd
55
+ return cwd if File.exists?(File.join(cwd, '_database'))
56
+ Dir.chdir('..') do
57
+ find_root unless cwd == Dir.pwd
58
+ end
59
+ rescue SystemCallError
60
+ # could not chdir, no problem just return
61
+ end
48
62
  end
49
63
  end
@@ -9,7 +9,7 @@ module Rid
9
9
  ".manifest" => "text/cache-manifest",
10
10
  ".png" => "image/png",
11
11
  ".gif" => "image/gif",
12
- ".ico" => "image/ico",
12
+ ".ico" => "image/x-icon",
13
13
  }
14
14
 
15
15
 
data/rid-core.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rid-core}
8
- s.version = "1.1.0"
8
+ s.version = "1.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Johannes J. Schmidt"]
12
- s.date = %q{2010-09-18}
12
+ s.date = %q{2010-10-05}
13
13
  s.default_executable = %q{rid}
14
14
  s.description = %q{Rid is a toolkit to relax in web development. Based on CouchDB you get a distributed, high scaling web application infrastructure with Rid. This is the Rid core.}
15
15
  s.email = %q{schmidt@netzmerk.com}
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rid-core
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 1.1.0
10
+ version: 1.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Johannes J. Schmidt
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-18 00:00:00 +02:00
18
+ date: 2010-10-05 00:00:00 +02:00
19
19
  default_executable: rid
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency