tpitale-dm-rails 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,35 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## Rubinius
17
+ *.rbc
18
+
19
+ ## PROJECT::GENERAL
20
+ *.gem
21
+ coverage
22
+ rdoc
23
+ pkg
24
+ tmp
25
+ doc
26
+ log
27
+ .yardoc
28
+ measurements
29
+
30
+ ## BUNDLER
31
+ .bundle
32
+ Gemfile.*
33
+
34
+ ## PROJECT::SPECIFIC
35
+ vendor
data/Gemfile CHANGED
@@ -1,13 +1,14 @@
1
1
  require 'pathname'
2
2
 
3
- source 'http://rubygems.org'
3
+ source :rubygems
4
+
5
+ gemspec
4
6
 
5
7
  SOURCE = ENV.fetch('SOURCE', :git).to_sym
6
8
  REPO_POSTFIX = SOURCE == :path ? '' : '.git'
7
9
  DATAMAPPER = SOURCE == :path ? Pathname(__FILE__).dirname.parent : 'http://github.com/datamapper'
8
- DM_VERSION = '~> 1.2.0'
10
+ DM_VERSION = '~> 1.3.0.beta'
9
11
  DO_VERSION = '~> 0.10.6'
10
- RAILS_VERSION = '~> 3.1.0'
11
12
  DM_DO_ADAPTERS = %w[ sqlite postgres mysql oracle sqlserver ]
12
13
  CURRENT_BRANCH = ENV.fetch('GIT_BRANCH', 'master')
13
14
 
@@ -15,18 +16,6 @@ CURRENT_BRANCH = ENV.fetch('GIT_BRANCH', 'master')
15
16
  gem 'dm-core', DM_VERSION, SOURCE => "#{DATAMAPPER}/dm-core#{REPO_POSTFIX}", :branch => CURRENT_BRANCH
16
17
  gem 'dm-active_model', DM_VERSION, SOURCE => "#{DATAMAPPER}/dm-active_model#{REPO_POSTFIX}", :branch => CURRENT_BRANCH
17
18
 
18
- # Rails dependencies
19
- gem 'actionpack', RAILS_VERSION, :require => 'action_pack'
20
- gem 'railties', RAILS_VERSION, :require => 'rails'
21
-
22
- group :development do
23
-
24
- gem 'jeweler', '~> 1.6.4'
25
- gem 'rake', '~> 0.9.2'
26
- gem 'rspec', '~> 1.3.2'
27
-
28
- end
29
-
30
19
  platforms :mri_18 do
31
20
  group :quality do
32
21
 
data/README.rdoc CHANGED
@@ -151,7 +151,7 @@ Using {bundler}[http://github.com/carlhuda/bundler] it's really easy to get an a
151
151
 
152
152
  DataMapper supports connecting to and working with multiple repositories easily. In order to be able to take full advantage of that feature in rails, you can configure as many repositories for your different environments as you wish. All you need to do is follow some simple naming conventions and you're good to go. Have a look at the #{adapter}_defaults declarations in the sample files below. That's the only convention you need to follow. Your default declarations should always end with "defaults". This is necessary for dm-rails to not confuse these with any of your environment declarations. In fact, dm-rails looks at the content of your database.yml and rejects every key that matches /defaults/. The remaining entries represent the repository configurations for the available environments.
153
153
 
154
- An example for setting up a single repository for every environment.
154
+ An example for setting up a single repository for every environment. This will setup an implicit 'default' repository.
155
155
 
156
156
  defaults: &defaults
157
157
  adapter: mysql
data/Rakefile CHANGED
@@ -1,27 +1,7 @@
1
1
  require 'rubygems'
2
2
  require 'rake'
3
3
 
4
- begin
5
- gem 'jeweler', '~> 1.6.4'
6
- require 'jeweler'
7
-
8
- Jeweler::Tasks.new do |gem|
9
- gem.name = 'dm-rails'
10
- gem.summary = 'Use DataMapper with Rails 3'
11
- gem.description = 'Integrate DataMapper with Rails 3'
12
- gem.email = 'gamsnjaga@gmail.com'
13
- gem.homepage = 'http://github.com/datamapper/%s' % gem.name
14
- gem.authors = [ 'Martin Gamsjaeger (snusnu)', 'Dan Kubb' ]
15
-
16
- gem.rubyforge_project = 'datamapper'
17
- end
18
-
19
- Jeweler::GemcutterTasks.new
20
-
21
- FileList['tasks/**/*.rake'].each { |task| import task }
22
- rescue LoadError
23
- puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler'
24
- end
4
+ FileList['tasks/**/*.rake'].each { |task| import task }
25
5
 
26
6
  require "spec/rake/spectask"
27
7
  Spec::Rake::SpecTask.new
data/dm-rails.gemspec CHANGED
@@ -1,94 +1,25 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
1
  # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/dm-rails/version', __FILE__)
5
3
 
6
- Gem::Specification.new do |s|
7
- s.name = "tpitale-dm-rails"
8
- s.version = "1.2.1"
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = [ 'Martin Gamsjaeger (snusnu)', 'Dan Kubb' ]
6
+ gem.email = [ 'gamsnjaga@gmail.com' ]
7
+ gem.summary = "Integrate DataMapper with Rails 3"
8
+ gem.description = gem.summary
9
+ gem.homepage = "http://datamapper.org"
9
10
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Martin Gamsjaeger (snusnu)", "Dan Kubb"]
12
- s.date = "2011-10-09"
13
- s.description = "Integrate DataMapper with Rails 3"
14
- s.email = "gamsnjaga@gmail.com"
15
- s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README.rdoc"
18
- ]
19
- s.files = [
20
- ".document",
21
- "Gemfile",
22
- "LICENSE",
23
- "README.rdoc",
24
- "Rakefile",
25
- "VERSION",
26
- "dm-rails.gemspec",
27
- "lib/dm-rails.rb",
28
- "lib/dm-rails/configuration.rb",
29
- "lib/dm-rails/mass_assignment_security.rb",
30
- "lib/dm-rails/middleware/identity_map.rb",
31
- "lib/dm-rails/multiparameter_attributes.rb",
32
- "lib/dm-rails/railtie.rb",
33
- "lib/dm-rails/railties/controller_runtime.rb",
34
- "lib/dm-rails/railties/database.rake",
35
- "lib/dm-rails/railties/i18n_support.rb",
36
- "lib/dm-rails/railties/log_listener.rb",
37
- "lib/dm-rails/railties/log_subscriber.rb",
38
- "lib/dm-rails/session_store.rb",
39
- "lib/dm-rails/setup.rb",
40
- "lib/dm-rails/storage.rb",
41
- "lib/generators/data_mapper.rb",
42
- "lib/generators/data_mapper/migration/migration_generator.rb",
43
- "lib/generators/data_mapper/migration/templates/migration.rb",
44
- "lib/generators/data_mapper/model/model_generator.rb",
45
- "lib/generators/data_mapper/model/templates/model.rb",
46
- "lib/generators/data_mapper/observer/observer_generator.rb",
47
- "lib/generators/data_mapper/observer/templates/observer.rb",
48
- "spec/models/fake.rb",
49
- "spec/models/topic.rb",
50
- "spec/spec.opts",
51
- "spec/spec_helper.rb",
52
- "spec/unit/mass_assignment_security_spec.rb",
53
- "spec/unit/multiparameter_attributes_spec.rb",
54
- "tasks/clean.rake",
55
- "tasks/yard.rake",
56
- "tasks/yardstick.rake"
57
- ]
58
- s.homepage = "http://github.com/datamapper/dm-rails"
59
- s.require_paths = ["lib"]
60
- s.rubyforge_project = "datamapper"
61
- s.rubygems_version = "1.8.11"
62
- s.summary = "Use DataMapper with Rails 3"
11
+ gem.files = `git ls-files`.split("\n")
12
+ gem.test_files = `git ls-files -- {spec}/*`.split("\n")
13
+ gem.extra_rdoc_files = %w[LICENSE README.rdoc]
63
14
 
64
- if s.respond_to? :specification_version then
65
- s.specification_version = 3
15
+ gem.name = "tpitale-dm-rails"
16
+ gem.require_paths = [ "lib" ]
17
+ gem.version = DataMapper::Rails::VERSION
66
18
 
67
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
68
- s.add_runtime_dependency(%q<dm-core>, ["~> 1.2.0"])
69
- s.add_runtime_dependency(%q<dm-active_model>, ["~> 1.2.0"])
70
- s.add_runtime_dependency(%q<actionpack>, ["~> 3.1.0"])
71
- s.add_runtime_dependency(%q<railties>, ["~> 3.1.0"])
72
- s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
73
- s.add_development_dependency(%q<rake>, ["~> 0.9.2"])
74
- s.add_development_dependency(%q<rspec>, ["~> 1.3.2"])
75
- else
76
- s.add_dependency(%q<dm-core>, ["~> 1.2.0"])
77
- s.add_dependency(%q<dm-active_model>, ["~> 1.2.0"])
78
- s.add_dependency(%q<actionpack>, ["~> 3.1.0"])
79
- s.add_dependency(%q<railties>, ["~> 3.1.0"])
80
- s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
81
- s.add_dependency(%q<rake>, ["~> 0.9.2"])
82
- s.add_dependency(%q<rspec>, ["~> 1.3.2"])
83
- end
84
- else
85
- s.add_dependency(%q<dm-core>, ["~> 1.2.0"])
86
- s.add_dependency(%q<dm-active_model>, ["~> 1.2.0"])
87
- s.add_dependency(%q<actionpack>, ["~> 3.1.0"])
88
- s.add_dependency(%q<railties>, ["~> 3.1.0"])
89
- s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
90
- s.add_dependency(%q<rake>, ["~> 0.9.2"])
91
- s.add_dependency(%q<rspec>, ["~> 1.3.2"])
92
- end
93
- end
19
+ gem.add_runtime_dependency('dm-active_model', '~> 1.2.1')
20
+ gem.add_runtime_dependency('actionpack', '~> 3.0')
21
+ gem.add_runtime_dependency('railties', '~> 3.0')
94
22
 
23
+ gem.add_development_dependency('rake', '~> 0.9.2')
24
+ gem.add_development_dependency('rspec', '~> 1.3.2')
25
+ end
@@ -24,7 +24,7 @@ module Rails
24
24
  environment, config = pair.first, pair.last
25
25
  repositories[environment] = begin
26
26
  c = config['repositories'] || {}
27
- c['default'] = config.except('repositories') if config.except('repositories')
27
+ c['default'] ||= config.except('repositories') if config.except('repositories')
28
28
  normalize_repository_config(c)
29
29
  end
30
30
  repositories
@@ -8,17 +8,17 @@ module ActiveModel
8
8
  # Provides a patched version of the Sanitizer used in Rails to handle property
9
9
  # and relationship objects as keys. There is no way to inject a custom sanitizer
10
10
  # without reimplementing the permission sets.
11
- module Sanitizer
11
+ Sanitizer.send(Sanitizer.is_a?(Module) ? :module_eval : :class_eval) do
12
12
  # Returns all attributes not denied by the authorizer.
13
13
  #
14
14
  # @param [Hash{Symbol,String,::DataMapper::Property,::DataMapper::Relationship=>Object}] attributes
15
15
  # Names and values of attributes to sanitize.
16
16
  # @return [Hash]
17
17
  # Sanitized hash of attributes.
18
- def sanitize(attributes)
18
+ def sanitize(attributes, authorizer = nil)
19
19
  sanitized_attributes = attributes.reject do |key, value|
20
20
  key_name = key.name rescue key
21
- deny?(key_name)
21
+ authorizer ? authorizer.deny?(key_name) : deny?(key_name)
22
22
  end
23
23
  debug_protected_attribute_removal(attributes, sanitized_attributes)
24
24
  sanitized_attributes
@@ -74,4 +74,4 @@ module Rails
74
74
  end
75
75
 
76
76
  end
77
- end
77
+ end
@@ -0,0 +1,5 @@
1
+ module DataMapper
2
+ module Rails
3
+ VERSION = '1.2.2'
4
+ end
5
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tpitale-dm-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,66 +10,59 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-10-09 00:00:00.000000000Z
13
+ date: 2012-10-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: dm-core
17
- requirement: &70167497981900 !ruby/object:Gem::Requirement
16
+ name: dm-active_model
17
+ requirement: !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
21
21
  - !ruby/object:Gem::Version
22
- version: 1.2.0
22
+ version: 1.2.1
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70167497981900
26
- - !ruby/object:Gem::Dependency
27
- name: dm-active_model
28
- requirement: &70167497981360 !ruby/object:Gem::Requirement
25
+ version_requirements: !ruby/object:Gem::Requirement
29
26
  none: false
30
27
  requirements:
31
28
  - - ~>
32
29
  - !ruby/object:Gem::Version
33
- version: 1.2.0
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: *70167497981360
30
+ version: 1.2.1
37
31
  - !ruby/object:Gem::Dependency
38
32
  name: actionpack
39
- requirement: &70167497980780 !ruby/object:Gem::Requirement
33
+ requirement: !ruby/object:Gem::Requirement
40
34
  none: false
41
35
  requirements:
42
36
  - - ~>
43
37
  - !ruby/object:Gem::Version
44
- version: 3.1.0
38
+ version: '3.0'
45
39
  type: :runtime
46
40
  prerelease: false
47
- version_requirements: *70167497980780
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: '3.0'
48
47
  - !ruby/object:Gem::Dependency
49
48
  name: railties
50
- requirement: &70167497980240 !ruby/object:Gem::Requirement
49
+ requirement: !ruby/object:Gem::Requirement
51
50
  none: false
52
51
  requirements:
53
52
  - - ~>
54
53
  - !ruby/object:Gem::Version
55
- version: 3.1.0
54
+ version: '3.0'
56
55
  type: :runtime
57
56
  prerelease: false
58
- version_requirements: *70167497980240
59
- - !ruby/object:Gem::Dependency
60
- name: jeweler
61
- requirement: &70167497979600 !ruby/object:Gem::Requirement
57
+ version_requirements: !ruby/object:Gem::Requirement
62
58
  none: false
63
59
  requirements:
64
60
  - - ~>
65
61
  - !ruby/object:Gem::Version
66
- version: 1.6.4
67
- type: :development
68
- prerelease: false
69
- version_requirements: *70167497979600
62
+ version: '3.0'
70
63
  - !ruby/object:Gem::Dependency
71
64
  name: rake
72
- requirement: &70167497979020 !ruby/object:Gem::Requirement
65
+ requirement: !ruby/object:Gem::Requirement
73
66
  none: false
74
67
  requirements:
75
68
  - - ~>
@@ -77,10 +70,15 @@ dependencies:
77
70
  version: 0.9.2
78
71
  type: :development
79
72
  prerelease: false
80
- version_requirements: *70167497979020
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ~>
77
+ - !ruby/object:Gem::Version
78
+ version: 0.9.2
81
79
  - !ruby/object:Gem::Dependency
82
80
  name: rspec
83
- requirement: &70167497978480 !ruby/object:Gem::Requirement
81
+ requirement: !ruby/object:Gem::Requirement
84
82
  none: false
85
83
  requirements:
86
84
  - - ~>
@@ -88,9 +86,15 @@ dependencies:
88
86
  version: 1.3.2
89
87
  type: :development
90
88
  prerelease: false
91
- version_requirements: *70167497978480
89
+ version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ~>
93
+ - !ruby/object:Gem::Version
94
+ version: 1.3.2
92
95
  description: Integrate DataMapper with Rails 3
93
- email: gamsnjaga@gmail.com
96
+ email:
97
+ - gamsnjaga@gmail.com
94
98
  executables: []
95
99
  extensions: []
96
100
  extra_rdoc_files:
@@ -98,11 +102,11 @@ extra_rdoc_files:
98
102
  - README.rdoc
99
103
  files:
100
104
  - .document
105
+ - .gitignore
101
106
  - Gemfile
102
107
  - LICENSE
103
108
  - README.rdoc
104
109
  - Rakefile
105
- - VERSION
106
110
  - dm-rails.gemspec
107
111
  - lib/dm-rails.rb
108
112
  - lib/dm-rails/configuration.rb
@@ -118,6 +122,7 @@ files:
118
122
  - lib/dm-rails/session_store.rb
119
123
  - lib/dm-rails/setup.rb
120
124
  - lib/dm-rails/storage.rb
125
+ - lib/dm-rails/version.rb
121
126
  - lib/generators/data_mapper.rb
122
127
  - lib/generators/data_mapper/migration/migration_generator.rb
123
128
  - lib/generators/data_mapper/migration/templates/migration.rb
@@ -134,7 +139,7 @@ files:
134
139
  - tasks/clean.rake
135
140
  - tasks/yard.rake
136
141
  - tasks/yardstick.rake
137
- homepage: http://github.com/datamapper/dm-rails
142
+ homepage: http://datamapper.org
138
143
  licenses: []
139
144
  post_install_message:
140
145
  rdoc_options: []
@@ -153,9 +158,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
158
  - !ruby/object:Gem::Version
154
159
  version: '0'
155
160
  requirements: []
156
- rubyforge_project: datamapper
157
- rubygems_version: 1.8.6
161
+ rubyforge_project:
162
+ rubygems_version: 1.8.23
158
163
  signing_key:
159
164
  specification_version: 3
160
- summary: Use DataMapper with Rails 3
165
+ summary: Integrate DataMapper with Rails 3
161
166
  test_files: []
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 1.2.1