merb_datamapper 1.1.0.pre → 1.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ begin
14
14
 
15
15
  Jeweler::Tasks.new do |gemspec|
16
16
 
17
- gemspec.version = Merb::DataMapper::VERSION
17
+ gemspec.version = Merb::DataMapper::VERSION.dup
18
18
 
19
19
  gemspec.name = "merb_datamapper"
20
20
  gemspec.description = "Merb plugin that provides support for datamapper"
@@ -1,102 +1,100 @@
1
- if defined?(Merb::Plugins)
1
+ require "merb-core"
2
2
 
3
- require 'dm-core'
4
- require 'merb_datamapper/connection'
3
+ require "dm-core"
4
+ require "merb_datamapper/connection"
5
5
 
6
- Merb::Plugins.add_rakefiles "merb_datamapper" / "merbtasks"
6
+ Merb::Plugins.add_rakefiles "merb_datamapper" / "merbtasks"
7
7
 
8
- # conditionally assign things, so as not to override previously set options.
9
- # This is most relevent for :use_repository_block, which is used later in this file.
10
- unless Merb::Plugins.config[:merb_datamapper].has_key?(:use_repository_block)
11
- Merb::Plugins.config[:merb_datamapper][:use_repository_block] = true
12
- end
8
+ # conditionally assign things, so as not to override previously set options.
9
+ # This is most relevent for :use_repository_block, which is used later in this file.
10
+ unless Merb::Plugins.config[:merb_datamapper].has_key?(:use_repository_block)
11
+ Merb::Plugins.config[:merb_datamapper][:use_repository_block] = true
12
+ end
13
13
 
14
- unless Merb::Plugins.config[:merb_datamapper].has_key?(:session_storage_name)
15
- Merb::Plugins.config[:merb_datamapper][:session_storage_name] = 'sessions'
16
- end
14
+ unless Merb::Plugins.config[:merb_datamapper].has_key?(:session_storage_name)
15
+ Merb::Plugins.config[:merb_datamapper][:session_storage_name] = 'sessions'
16
+ end
17
17
 
18
- unless Merb::Plugins.config[:merb_datamapper].has_key?(:session_repository_name)
19
- Merb::Plugins.config[:merb_datamapper][:session_repository_name] = :default
20
- end
18
+ unless Merb::Plugins.config[:merb_datamapper].has_key?(:session_repository_name)
19
+ Merb::Plugins.config[:merb_datamapper][:session_repository_name] = :default
20
+ end
21
21
 
22
- module DataMapper
23
- module Resource
22
+ module DataMapper
23
+ module Resource
24
24
 
25
- # actionorm compliance
26
- alias new_record? new?
25
+ # actionorm compliance
26
+ alias new_record? new?
27
27
 
28
- end
29
28
  end
29
+ end
30
30
 
31
- class Merb::Orms::DataMapper::Connect < Merb::BootLoader
32
- after BeforeAppLoads
33
-
34
- def self.run
35
- Merb.logger.verbose! "Merb::Orms::DataMapper::Connect block."
36
-
37
- # check for the presence of database.yml
38
- if File.file?(Merb.dir_for(:config) / "database.yml")
39
- # if we have it, connect
40
- Merb::Orms::DataMapper.connect
41
- else
42
- # assume we'll be told at some point
43
- Merb.logger.info "No database.yml file found in #{Merb.dir_for(:config)}, assuming database connection(s) established in the environment file in #{Merb.dir_for(:config)}/environments"
44
- end
31
+ class Merb::Orms::DataMapper::Connect < Merb::BootLoader
32
+ after BeforeAppLoads
45
33
 
46
- # if we use a datamapper session store, require it.
47
- Merb.logger.verbose! "Checking if we need to use DataMapper sessions"
48
- if Merb::Config.session_store == 'datamapper'
49
- Merb.logger.verbose! "Using DataMapper sessions"
50
- require 'merb_datamapper/data_mapper_session'
51
- end
34
+ def self.run
35
+ Merb.logger.verbose! "Merb::Orms::DataMapper::Connect block."
52
36
 
53
- # take advantage of the fact #id returns the key of the model, unless #id is a property
54
- Merb::Router.root_behavior = Merb::Router.root_behavior.identify(DataMapper::Resource => :id)
37
+ # check for the presence of database.yml
38
+ if File.file?(Merb.dir_for(:config) / "database.yml")
39
+ # if we have it, connect
40
+ Merb::Orms::DataMapper.connect
41
+ else
42
+ # assume we'll be told at some point
43
+ Merb.logger.info "No database.yml file found in #{Merb.dir_for(:config)}, assuming database connection(s) established in the environment file in #{Merb.dir_for(:config)}/environments"
44
+ end
55
45
 
56
- Merb.logger.verbose! "Merb::Orms::DataMapper::Connect complete"
46
+ # if we use a datamapper session store, require it.
47
+ Merb.logger.verbose! "Checking if we need to use DataMapper sessions"
48
+ if Merb::Config.session_store == 'datamapper'
49
+ Merb.logger.verbose! "Using DataMapper sessions"
50
+ require "merb_datamapper/data_mapper_session"
57
51
  end
58
- end
59
52
 
60
- class Merb::Orms::DataMapper::Associations < Merb::BootLoader
61
- after LoadClasses
53
+ # take advantage of the fact #id returns the key of the model, unless #id is a property
54
+ Merb::Router.root_behavior = Merb::Router.root_behavior.identify(DataMapper::Resource => :id)
62
55
 
63
- def self.run
56
+ Merb.logger.verbose! "Merb::Orms::DataMapper::Connect complete"
57
+ end
58
+ end
64
59
 
65
- Merb.logger.verbose! 'Merb::Orms::DataMapper::Associations - defining lazy relationship properties'
60
+ class Merb::Orms::DataMapper::Associations < Merb::BootLoader
61
+ after LoadClasses
66
62
 
67
- DataMapper::Model.descendants.each do |model|
68
- model.relationships.each_value { |r| r.child_key }
69
- end
63
+ def self.run
70
64
 
71
- Merb.logger.verbose! 'Merb::Orms::DataMapper::Associations - complete'
65
+ Merb.logger.verbose! 'Merb::Orms::DataMapper::Associations - defining lazy relationship properties'
72
66
 
67
+ DataMapper::Model.descendants.each do |model|
68
+ model.relationships.each_value { |r| r.child_key }
73
69
  end
70
+
71
+ Merb.logger.verbose! 'Merb::Orms::DataMapper::Associations - complete'
72
+
74
73
  end
74
+ end
75
75
 
76
- if Merb::Plugins.config[:merb_datamapper][:use_repository_block]
76
+ if Merb::Plugins.config[:merb_datamapper][:use_repository_block]
77
77
 
78
- class Merb::Orms::DataMapper::IdentityMapSupport < Merb::BootLoader
78
+ class Merb::Orms::DataMapper::IdentityMapSupport < Merb::BootLoader
79
79
 
80
- after RackUpApplication
80
+ after RackUpApplication
81
81
 
82
- def self.run
82
+ def self.run
83
83
 
84
- app = Merb::Config[:app]
85
- def app.call(env)
86
- DataMapper.repository do |r|
87
- Merb.logger.debug "In repository block #{r.name}"
88
- super
89
- end
84
+ app = Merb::Config[:app]
85
+ def app.call(env)
86
+ DataMapper.repository do |r|
87
+ Merb.logger.debug "In repository block #{r.name}"
88
+ super
90
89
  end
91
-
92
90
  end
93
- end
94
91
 
92
+ end
95
93
  end
96
94
 
97
- generators = File.join(File.dirname(__FILE__), 'generators')
98
- Merb.add_generators generators / 'data_mapper_model'
99
- Merb.add_generators generators / 'data_mapper_resource_controller'
100
- Merb.add_generators generators / 'data_mapper_migration'
101
-
102
95
  end
96
+
97
+ generators = File.join(File.dirname(__FILE__), 'generators')
98
+ Merb.add_generators generators / 'data_mapper_model'
99
+ Merb.add_generators generators / 'data_mapper_resource_controller'
100
+ Merb.add_generators generators / 'data_mapper_migration'
@@ -1,6 +1,6 @@
1
1
  module Merb
2
2
  module DataMapper
3
- VERSION = '1.1.0.pre'.freeze
3
+ VERSION = '1.1.0.rc1'.freeze
4
4
  DM_VERSION_REQUIREMENT = '~> 0.10'.freeze
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: merb_datamapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.pre
4
+ prerelease: true
5
+ segments:
6
+ - 1
7
+ - 1
8
+ - 0
9
+ - rc1
10
+ version: 1.1.0.rc1
5
11
  platform: ruby
6
12
  authors:
7
13
  - Jason Toy
@@ -9,49 +15,64 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-01-23 00:00:00 +01:00
18
+ date: 2010-03-15 00:00:00 +00:00
13
19
  default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
22
  name: merb-core
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
20
25
  requirements:
21
26
  - - "="
22
27
  - !ruby/object:Gem::Version
28
+ segments:
29
+ - 1
30
+ - 1
31
+ - 0
32
+ - pre
23
33
  version: 1.1.0.pre
24
- version:
34
+ type: :runtime
35
+ version_requirements: *id001
25
36
  - !ruby/object:Gem::Dependency
26
37
  name: dm-core
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
30
40
  requirements:
31
41
  - - ~>
32
42
  - !ruby/object:Gem::Version
43
+ segments:
44
+ - 0
45
+ - 10
33
46
  version: "0.10"
34
- version:
47
+ type: :runtime
48
+ version_requirements: *id002
35
49
  - !ruby/object:Gem::Dependency
36
50
  name: dm-migrations
37
- type: :runtime
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
51
+ prerelease: false
52
+ requirement: &id003 !ruby/object:Gem::Requirement
40
53
  requirements:
41
54
  - - ~>
42
55
  - !ruby/object:Gem::Version
56
+ segments:
57
+ - 0
58
+ - 10
43
59
  version: "0.10"
44
- version:
60
+ type: :runtime
61
+ version_requirements: *id003
45
62
  - !ruby/object:Gem::Dependency
46
63
  name: rspec
47
- type: :development
48
- version_requirement:
49
- version_requirements: !ruby/object:Gem::Requirement
64
+ prerelease: false
65
+ requirement: &id004 !ruby/object:Gem::Requirement
50
66
  requirements:
51
67
  - - ">="
52
68
  - !ruby/object:Gem::Version
69
+ segments:
70
+ - 1
71
+ - 2
72
+ - 9
53
73
  version: 1.2.9
54
- version:
74
+ type: :development
75
+ version_requirements: *id004
55
76
  description: Merb plugin that provides support for datamapper
56
77
  email: jtoy@rubynow.com
57
78
  executables: []
@@ -107,18 +128,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
107
128
  requirements:
108
129
  - - ">="
109
130
  - !ruby/object:Gem::Version
131
+ segments:
132
+ - 0
110
133
  version: "0"
111
- version:
112
134
  required_rubygems_version: !ruby/object:Gem::Requirement
113
135
  requirements:
114
136
  - - ">"
115
137
  - !ruby/object:Gem::Version
138
+ segments:
139
+ - 1
140
+ - 3
141
+ - 1
116
142
  version: 1.3.1
117
- version:
118
143
  requirements: []
119
144
 
120
145
  rubyforge_project:
121
- rubygems_version: 1.3.5
146
+ rubygems_version: 1.3.6
122
147
  signing_key:
123
148
  specification_version: 3
124
149
  summary: Merb plugin that allows you to use datamapper with your merb app