tpitale-dm-active_model 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +5 -0
- data/.gitignore +34 -0
- data/CHANGELOG +76 -0
- data/Gemfile +35 -0
- data/LICENSE +20 -0
- data/README.rdoc +18 -0
- data/Rakefile +4 -0
- data/TODO +0 -0
- data/dm-active_model.gemspec +25 -0
- data/lib/dm-active_model.rb +60 -0
- data/lib/dm-active_model/version.rb +5 -0
- data/spec/amo_interface_compliance_spec.rb +45 -0
- data/spec/amo_validation_compliance_spec.rb +13 -0
- data/spec/dm-active_model_spec.rb +37 -0
- data/spec/lib/amo_lint_extensions.rb +30 -0
- data/spec/rcov.opts +6 -0
- data/spec/spec.opts +2 -0
- data/tasks/changelog.rake +20 -0
- data/tasks/spec.rake +38 -0
- data/tasks/yard.rake +9 -0
- data/tasks/yardstick.rake +19 -0
- metadata +148 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7238d2d2f16dd5d2352882cf42e350dfba90d2f3
|
4
|
+
data.tar.gz: de0391981f16cc758900b79b3ab704d7133d2379
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d6c83c3f446f33853e24d09f6d0473aa29fd83201f7b53fa90f10fb6043400229f3f98357511cdd9abe5aa1171aba571fb6218f2426ca9d51cf174f933fd689f
|
7
|
+
data.tar.gz: 8e212a737e06ca5f4cd0a481f7ae1c5fb887f2dd82adf1432bcb295d46a23539b4a8c66f6f179f1b0eb1c54d11b060c65075ee1379004c5a4bad724526588da0
|
data/.document
ADDED
data/.gitignore
ADDED
@@ -0,0 +1,34 @@
|
|
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
|
data/CHANGELOG
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
[fb2fe87 | Sun Dec 20 19:59:22 UTC 2009] snusnu <gamsnjaga@gmail.com>
|
2
|
+
|
3
|
+
* Thx to jeweler this is now a gem
|
4
|
+
|
5
|
+
[53df775 | Thu Sep 24 03:06:19 UTC 2009] snusnu <gamsnjaga@gmail.com>
|
6
|
+
|
7
|
+
* All lint and rails_compliance specs pass.
|
8
|
+
|
9
|
+
[64c47dc | Thu Sep 24 02:53:17 UTC 2009] snusnu <gamsnjaga@gmail.com>
|
10
|
+
|
11
|
+
* Simplified #errors default implementation
|
12
|
+
|
13
|
+
[03beebe | Thu Sep 24 02:29:53 UTC 2009] snusnu <gamsnjaga@gmail.com>
|
14
|
+
|
15
|
+
* Only rely on active_model/lint for amo compliance specs
|
16
|
+
|
17
|
+
[f45713a | Thu Sep 24 02:29:33 UTC 2009] snusnu <gamsnjaga@gmail.com>
|
18
|
+
|
19
|
+
* Refactored rails_compliance_spec a bit
|
20
|
+
|
21
|
+
[755a48c | Thu Sep 24 02:20:57 UTC 2009] snusnu <gamsnjaga@gmail.com>
|
22
|
+
|
23
|
+
* Make it easy to move rails compliance specs to rails_datamapper
|
24
|
+
|
25
|
+
active_model/lint itself isn't really strict about what exact
|
26
|
+
String it gets back from either of the following methods that
|
27
|
+
are supported by the object returned from #class.model_name
|
28
|
+
|
29
|
+
#singular
|
30
|
+
#plural
|
31
|
+
#element
|
32
|
+
#human
|
33
|
+
#collection
|
34
|
+
#partial_path
|
35
|
+
|
36
|
+
All lint cares about, is that these methods return Strings
|
37
|
+
|
38
|
+
Therefore it's probably best to push specs that test for
|
39
|
+
rails's own implementation of those active_model strings
|
40
|
+
down to something like rails_datamapper.
|
41
|
+
|
42
|
+
Currently the rails compliance specs for #collection and
|
43
|
+
#partial_path fail. Need to investigate this.
|
44
|
+
|
45
|
+
[31d28fd | Thu Sep 24 00:23:40 UTC 2009] snusnu <gamsnjaga@gmail.com>
|
46
|
+
|
47
|
+
* All specs pass, changed dm-core dependency to '~>0.10'
|
48
|
+
|
49
|
+
[5cb1320 | Wed Sep 23 23:27:42 UTC 2009] snusnu <gamsnjaga@gmail.com>
|
50
|
+
|
51
|
+
* Also run active_model/lint when running the specsuite
|
52
|
+
|
53
|
+
Currently, if dm-validations are not required, all specs
|
54
|
+
pass. If dm-validations are required, 1 spec fails because
|
55
|
+
DataMapper::Validate::ValidationErrors seems to implement
|
56
|
+
#[](field) in an incompatible way. This will need more
|
57
|
+
investigation.
|
58
|
+
|
59
|
+
If this can be fixed upstream, all specs should pass
|
60
|
+
|
61
|
+
[4b1ccd0 | Wed Sep 23 22:37:59 UTC 2009] snusnu <gamsnjaga@gmail.com>
|
62
|
+
|
63
|
+
* Added implementation and initial specs
|
64
|
+
|
65
|
+
The final goal is to rely solely on active_model/lint.rb
|
66
|
+
to perform the compliance tests. However, lint.rb still
|
67
|
+
needs to be updated to cover the intended behavior more
|
68
|
+
precisely.
|
69
|
+
|
70
|
+
Nevertheless, next step is to include active_model as a
|
71
|
+
development dependency and run both lint.rb and our own
|
72
|
+
specs for the time being.
|
73
|
+
|
74
|
+
[2eb914c | Wed Sep 23 18:23:27 UTC 2009] snusnu <gamsnjaga@gmail.com>
|
75
|
+
|
76
|
+
* Initial commit to dm-active_model.
|
data/Gemfile
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
gemspec
|
6
|
+
|
7
|
+
SOURCE = ENV.fetch('SOURCE', :git).to_sym
|
8
|
+
REPO_POSTFIX = SOURCE == :path ? '' : '.git'
|
9
|
+
DATAMAPPER = SOURCE == :path ? Pathname(__FILE__).dirname.parent : 'http://github.com/datamapper'
|
10
|
+
DM_VERSION = '~> 1.2.0'
|
11
|
+
RAILS_VERSION = [ '>= 3.0', '< 5.0' ]
|
12
|
+
CURRENT_BRANCH = ENV.fetch('GIT_BRANCH', 'master')
|
13
|
+
|
14
|
+
gem 'dm-core', DM_VERSION #, SOURCE => "#{DATAMAPPER}/dm-core#{REPO_POSTFIX}", :branch => CURRENT_BRANCH
|
15
|
+
gem 'activemodel', RAILS_VERSION, :require => nil
|
16
|
+
|
17
|
+
group :development do
|
18
|
+
gem 'dm-validations', DM_VERSION #, SOURCE => "#{DATAMAPPER}/dm-validations#{REPO_POSTFIX}", :branch => CURRENT_BRANCH
|
19
|
+
|
20
|
+
gem 'jeweler', '~> 1.6.4'
|
21
|
+
gem 'rake', '~> 0.9.2'
|
22
|
+
gem 'rspec', '~> 1.3.2'
|
23
|
+
gem 'test-unit', '= 1.2.3'
|
24
|
+
end
|
25
|
+
|
26
|
+
group :datamapper do
|
27
|
+
|
28
|
+
plugins = ENV['PLUGINS'] || ENV['PLUGIN']
|
29
|
+
plugins = plugins.to_s.tr(',', ' ').split.uniq
|
30
|
+
|
31
|
+
plugins.each do |plugin|
|
32
|
+
gem plugin, DM_VERSION #, SOURCE => "#{DATAMAPPER}/#{plugin}#{REPO_POSTFIX}", :branch => CURRENT_BRANCH
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Martin Gamsjaeger (snusnu)
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
= dm-active_model
|
2
|
+
|
3
|
+
This plugin makes datamapper compliant with active_model conventions and thus compatible with rails3.
|
4
|
+
|
5
|
+
== Note on Patches/Pull Requests
|
6
|
+
|
7
|
+
* Fork the project.
|
8
|
+
* Make your feature addition or bug fix.
|
9
|
+
* Add tests for it. This is important so I don't break it in a
|
10
|
+
future version unintentionally.
|
11
|
+
* Commit, do not mess with rakefile, version, or history.
|
12
|
+
(if you want to have your own version, that is fine but
|
13
|
+
bump version in a commit by itself I can ignore when I pull)
|
14
|
+
* Send me a pull request. Bonus points for topic branches.
|
15
|
+
|
16
|
+
== Copyright
|
17
|
+
|
18
|
+
Copyright (c) 2011 Martin Gamsjaeger (snusnu). See LICENSE for details.
|
data/Rakefile
ADDED
data/TODO
ADDED
File without changes
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/dm-active_model/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = [ "Martin Gamsjaeger (snusnu)" ]
|
6
|
+
gem.email = [ "gamsnjaga [a] gmail [d] com" ]
|
7
|
+
gem.summary = "active_model compliance for datamapper"
|
8
|
+
gem.description = 'A datamapper plugin for active_model compliance and thus rails 3 compatibility.'
|
9
|
+
gem.homepage = "http://datamapper.org"
|
10
|
+
|
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]
|
14
|
+
|
15
|
+
gem.name = "tpitale-dm-active_model"
|
16
|
+
gem.require_paths = [ "lib" ]
|
17
|
+
gem.version = DataMapper::ActiveModel::VERSION
|
18
|
+
|
19
|
+
gem.add_runtime_dependency('dm-core', '~> 1.2', '>= 1.2.0')
|
20
|
+
gem.add_runtime_dependency('activemodel', '>= 3.0', '< 5.0')
|
21
|
+
|
22
|
+
gem.add_development_dependency('rake', '~> 0.9.2')
|
23
|
+
gem.add_development_dependency('rspec', '~> 1.3.2')
|
24
|
+
gem.add_development_dependency('test-unit', '= 1.2.3')
|
25
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'dm-core'
|
2
|
+
require 'active_support/core_ext/module/delegation' # needed by active_model/naming
|
3
|
+
require 'active_support/concern' # needed by active_model/conversion
|
4
|
+
require 'active_model/naming'
|
5
|
+
require 'active_model/conversion'
|
6
|
+
|
7
|
+
module DataMapper
|
8
|
+
module ActiveModel
|
9
|
+
|
10
|
+
module InstanceMethods
|
11
|
+
include ::ActiveModel::Conversion
|
12
|
+
|
13
|
+
def to_model
|
14
|
+
self
|
15
|
+
end
|
16
|
+
|
17
|
+
def persisted?
|
18
|
+
saved?
|
19
|
+
end
|
20
|
+
|
21
|
+
def to_key
|
22
|
+
key
|
23
|
+
end
|
24
|
+
|
25
|
+
def to_param
|
26
|
+
return nil if key.nil?
|
27
|
+
if key.length > 1
|
28
|
+
raise "You need to implement #to_param yourself to support this key: #{self.class.key.inspect}"
|
29
|
+
else
|
30
|
+
self.key.first.to_s
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# Define the minimum requirements if the resource
|
35
|
+
# has no concept of validation baked in, which
|
36
|
+
# happens if dm-validations is not required.
|
37
|
+
unless respond_to?(:validatable?)
|
38
|
+
|
39
|
+
def valid?
|
40
|
+
true
|
41
|
+
end
|
42
|
+
|
43
|
+
def errors
|
44
|
+
obj = Object.new
|
45
|
+
def obj.[](key) [] end
|
46
|
+
def obj.full_messages() [] end
|
47
|
+
obj
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
Model.append_extensions(::ActiveModel::Naming)
|
57
|
+
Model.append_extensions(::ActiveModel::Conversion::ClassMethods)
|
58
|
+
Model.append_inclusions(ActiveModel::InstanceMethods)
|
59
|
+
|
60
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'spec/test/unit'
|
2
|
+
require 'active_support/core_ext/object/blank' # needed by active_model/lint
|
3
|
+
require 'active_model/lint'
|
4
|
+
require 'active_support/core_ext/string'
|
5
|
+
|
6
|
+
# This must be kept in sync with active_model/lint tests
|
7
|
+
# at least for as long as
|
8
|
+
#
|
9
|
+
# http://rspec.lighthouseapp.com/projects/5645/tickets/900
|
10
|
+
#
|
11
|
+
# isn't resolved in some way (probably with rspec2)
|
12
|
+
|
13
|
+
share_examples_for 'an active_model compliant object' do
|
14
|
+
|
15
|
+
include ActiveModel::Lint::Tests
|
16
|
+
|
17
|
+
it 'must implement the #to_key interface' do
|
18
|
+
test_to_key
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'must implement the #to_param interface' do
|
22
|
+
test_to_param
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'must implement the #to_partial_path interface' do
|
26
|
+
test_to_partial_path if respond_to?(:test_to_partial_path)
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'must implement the #valid? interface' do
|
30
|
+
test_valid? if respond_to?(:test_valid?)
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'must implement the #persisted? interface' do
|
34
|
+
test_persisted?
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'must implement the .model_name interface' do
|
38
|
+
test_model_naming
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'must implement the #errors interface' do
|
42
|
+
test_errors_aref
|
43
|
+
test_errors_full_messages if respond_to?(:test_errors_full_messages)
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec/test/unit'
|
2
|
+
require 'lib/amo_lint_extensions'
|
3
|
+
|
4
|
+
share_examples_for 'an active_model/validations compliant object' do
|
5
|
+
|
6
|
+
include ActiveModel::Lint::Tests::Validations
|
7
|
+
|
8
|
+
ActiveModel::Lint::Tests::Validations::VALIDATION_METHODS.each do |validation_method|
|
9
|
+
it "must implement the .#{validation_method} interface" do
|
10
|
+
send("test_#{validation_method}")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'dm-core'
|
2
|
+
require 'dm-active_model'
|
3
|
+
|
4
|
+
require 'amo_interface_compliance_spec'
|
5
|
+
|
6
|
+
if ENV['DM_VALIDATIONS'] || ENV['AMO_VALIDATIONS']
|
7
|
+
require 'dm-validations'
|
8
|
+
require 'amo_validation_compliance_spec'
|
9
|
+
end
|
10
|
+
|
11
|
+
describe 'An active_model compliant DataMapper::Resource' do
|
12
|
+
|
13
|
+
before :all do
|
14
|
+
|
15
|
+
module ::ComplianceTest
|
16
|
+
class ProfileInfo
|
17
|
+
include DataMapper::Resource
|
18
|
+
extend ActiveModel::Naming
|
19
|
+
property :id, Serial
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
DataMapper.setup(:default, { :adapter => :in_memory })
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
before :each do
|
28
|
+
@model = ComplianceTest::ProfileInfo.new.to_model
|
29
|
+
end
|
30
|
+
|
31
|
+
it_should_behave_like 'an active_model compliant object'
|
32
|
+
|
33
|
+
if ENV['AMO_VALIDATIONS'] == 'true'
|
34
|
+
it_should_behave_like 'an active_model/validations compliant object'
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module ActiveModel
|
2
|
+
module Lint
|
3
|
+
module Tests
|
4
|
+
module Validations
|
5
|
+
|
6
|
+
VALIDATION_METHODS = %w[
|
7
|
+
validate
|
8
|
+
validates
|
9
|
+
validates_each
|
10
|
+
validates_with
|
11
|
+
validates_acceptance_of
|
12
|
+
validates_confirmation_of
|
13
|
+
validates_exclusion_of
|
14
|
+
validates_format_of
|
15
|
+
validates_inclusion_of
|
16
|
+
validates_length_of
|
17
|
+
validates_numericality_of
|
18
|
+
validates_presence_of
|
19
|
+
]
|
20
|
+
|
21
|
+
VALIDATION_METHODS.each do |validation_method|
|
22
|
+
define_method "test_#{validation_method}" do
|
23
|
+
assert model.class.respond_to?(validation_method)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/spec/rcov.opts
ADDED
data/spec/spec.opts
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'time'
|
2
|
+
|
3
|
+
desc 'update changelog'
|
4
|
+
task :changelog do
|
5
|
+
File.open('CHANGELOG', 'w+') do |changelog|
|
6
|
+
`git log -z --abbrev-commit`.split("\0").each do |commit|
|
7
|
+
next if commit =~ /^Merge: \d*/
|
8
|
+
ref, author, time, _, title, _, message = commit.split("\n", 7)
|
9
|
+
ref = ref[/commit ([0-9a-f]+)/, 1]
|
10
|
+
author = author[/Author: (.*)/, 1].strip
|
11
|
+
time = Time.parse(time[/Date: (.*)/, 1]).utc
|
12
|
+
title.strip!
|
13
|
+
|
14
|
+
changelog.puts "[#{ref} | #{time}] #{author}"
|
15
|
+
changelog.puts '', " * #{title}"
|
16
|
+
changelog.puts '', message.rstrip if message
|
17
|
+
changelog.puts
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/tasks/spec.rake
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
spec_defaults = lambda do |spec|
|
2
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
3
|
+
spec.libs << 'lib' << 'spec'
|
4
|
+
spec.spec_opts << '--options' << 'spec/spec.opts'
|
5
|
+
end
|
6
|
+
|
7
|
+
begin
|
8
|
+
require 'spec/rake/spectask'
|
9
|
+
|
10
|
+
Spec::Rake::SpecTask.new(:spec, &spec_defaults)
|
11
|
+
rescue LoadError
|
12
|
+
task :spec do
|
13
|
+
abort 'rspec is not available. In order to run spec, you must: gem install rspec'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
begin
|
18
|
+
require 'rcov'
|
19
|
+
require 'spec/rake/verify_rcov'
|
20
|
+
|
21
|
+
Spec::Rake::SpecTask.new(:rcov) do |rcov|
|
22
|
+
spec_defaults.call(rcov)
|
23
|
+
rcov.rcov = true
|
24
|
+
rcov.rcov_opts = File.read('spec/rcov.opts').split(/\s+/)
|
25
|
+
end
|
26
|
+
|
27
|
+
RCov::VerifyTask.new(:verify_rcov => :rcov) do |rcov|
|
28
|
+
rcov.threshold = 100
|
29
|
+
end
|
30
|
+
rescue LoadError
|
31
|
+
%w[ rcov verify_rcov ].each do |name|
|
32
|
+
task name do
|
33
|
+
abort "rcov is not available. In order to run #{name}, you must: gem install rcov"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
task :default => :spec
|
data/tasks/yard.rake
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
begin
|
2
|
+
require 'pathname'
|
3
|
+
require 'yardstick/rake/measurement'
|
4
|
+
require 'yardstick/rake/verify'
|
5
|
+
|
6
|
+
# yardstick_measure task
|
7
|
+
Yardstick::Rake::Measurement.new
|
8
|
+
|
9
|
+
# verify_measurements task
|
10
|
+
Yardstick::Rake::Verify.new do |verify|
|
11
|
+
verify.threshold = 100
|
12
|
+
end
|
13
|
+
rescue LoadError
|
14
|
+
%w[ yardstick_measure verify_measurements ].each do |name|
|
15
|
+
task name.to_s do
|
16
|
+
abort "Yardstick is not available. In order to run #{name}, you must: gem install yardstick"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tpitale-dm-active_model
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.3.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Martin Gamsjaeger (snusnu)
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-12-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: dm-core
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.2'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.2.0
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.2'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.2.0
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: activemodel
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '3.0'
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '5.0'
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '3.0'
|
50
|
+
- - "<"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '5.0'
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: rake
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 0.9.2
|
60
|
+
type: :development
|
61
|
+
prerelease: false
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - "~>"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 0.9.2
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: rspec
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - "~>"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: 1.3.2
|
74
|
+
type: :development
|
75
|
+
prerelease: false
|
76
|
+
version_requirements: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - "~>"
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: 1.3.2
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: test-unit
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - '='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: 1.2.3
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - '='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 1.2.3
|
95
|
+
description: A datamapper plugin for active_model compliance and thus rails 3 compatibility.
|
96
|
+
email:
|
97
|
+
- gamsnjaga [a] gmail [d] com
|
98
|
+
executables: []
|
99
|
+
extensions: []
|
100
|
+
extra_rdoc_files:
|
101
|
+
- LICENSE
|
102
|
+
- README.rdoc
|
103
|
+
files:
|
104
|
+
- ".document"
|
105
|
+
- ".gitignore"
|
106
|
+
- CHANGELOG
|
107
|
+
- Gemfile
|
108
|
+
- LICENSE
|
109
|
+
- README.rdoc
|
110
|
+
- Rakefile
|
111
|
+
- TODO
|
112
|
+
- dm-active_model.gemspec
|
113
|
+
- lib/dm-active_model.rb
|
114
|
+
- lib/dm-active_model/version.rb
|
115
|
+
- spec/amo_interface_compliance_spec.rb
|
116
|
+
- spec/amo_validation_compliance_spec.rb
|
117
|
+
- spec/dm-active_model_spec.rb
|
118
|
+
- spec/lib/amo_lint_extensions.rb
|
119
|
+
- spec/rcov.opts
|
120
|
+
- spec/spec.opts
|
121
|
+
- tasks/changelog.rake
|
122
|
+
- tasks/spec.rake
|
123
|
+
- tasks/yard.rake
|
124
|
+
- tasks/yardstick.rake
|
125
|
+
homepage: http://datamapper.org
|
126
|
+
licenses: []
|
127
|
+
metadata: {}
|
128
|
+
post_install_message:
|
129
|
+
rdoc_options: []
|
130
|
+
require_paths:
|
131
|
+
- lib
|
132
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- - ">="
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '0'
|
137
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
|
+
requirements:
|
139
|
+
- - ">="
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
requirements: []
|
143
|
+
rubyforge_project:
|
144
|
+
rubygems_version: 2.2.2
|
145
|
+
signing_key:
|
146
|
+
specification_version: 4
|
147
|
+
summary: active_model compliance for datamapper
|
148
|
+
test_files: []
|