dm-types 1.0.2 → 1.1.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +29 -97
- data/LICENSE +1 -1
- data/Rakefile +2 -11
- data/VERSION +1 -1
- data/dm-types.gemspec +137 -129
- data/lib/dm-types/bcrypt_hash.rb +0 -5
- data/lib/dm-types/enum.rb +1 -1
- data/lib/dm-types/flag.rb +2 -2
- data/lib/dm-types/json.rb +1 -1
- data/lib/dm-types/paranoid/base.rb +20 -0
- data/spec/integration/ip_address_spec.rb +7 -7
- data/spec/spec_helper.rb +1 -3
- data/spec/unit/bcrypt_hash_spec.rb +1 -1
- data/spec/unit/flag_spec.rb +10 -0
- data/spec/unit/paranoid_boolean_spec.rb +1 -1
- data/spec/unit/paranoid_datetime_spec.rb +1 -1
- data/tasks/spec.rake +0 -3
- metadata +86 -69
- data/.gitignore +0 -37
- data/tasks/ci.rake +0 -1
- data/tasks/local_gemfile.rake +0 -16
- data/tasks/metrics.rake +0 -36
data/Gemfile
CHANGED
@@ -1,116 +1,48 @@
|
|
1
|
-
|
2
|
-
# recommended to create a local Gemfile and use this instead of the git
|
3
|
-
# sources. This will make sure that you are developing against your
|
4
|
-
# other local datamapper sources that you currently work on. Gemfile.local
|
5
|
-
# will behave identically to the standard Gemfile apart from the fact that
|
6
|
-
# it fetches the datamapper gems from local paths. This means that you can use
|
7
|
-
# the same environment variables, like ADAPTER(S) or PLUGIN(S) when running
|
8
|
-
# bundle commands. Gemfile.local is added to .gitignore, so you don't need to
|
9
|
-
# worry about accidentally checking local development paths into git.
|
10
|
-
# In order to create a local Gemfile, all you need to do is run:
|
11
|
-
#
|
12
|
-
# bundle exec rake local_gemfile
|
13
|
-
#
|
14
|
-
# This will give you a Gemfile.local file that points to your local clones of
|
15
|
-
# the various datamapper gems. It's assumed that all datamapper repo clones
|
16
|
-
# reside in the same directory. You can use the Gemfile.local like so for
|
17
|
-
# running any bundle command:
|
18
|
-
#
|
19
|
-
# BUNDLE_GEMFILE=Gemfile.local bundle foo
|
20
|
-
#
|
21
|
-
# You can also specify which adapter(s) should be part of the bundle by setting
|
22
|
-
# an environment variable. This of course also works when using the Gemfile.local
|
23
|
-
#
|
24
|
-
# bundle foo # dm-sqlite-adapter
|
25
|
-
# ADAPTER=mysql bundle foo # dm-mysql-adapter
|
26
|
-
# ADAPTERS=sqlite,mysql bundle foo # dm-sqlite-adapter and dm-mysql-adapter
|
27
|
-
#
|
28
|
-
# Of course you can also use the ADAPTER(S) variable when using the Gemfile.local
|
29
|
-
# and running specs against selected adapters.
|
30
|
-
#
|
31
|
-
# For easily working with adapters supported on your machine, it's recommended
|
32
|
-
# that you first install all adapters that you are planning to use or work on
|
33
|
-
# by doing something like
|
34
|
-
#
|
35
|
-
# ADAPTERS=sqlite,mysql,postgres bundle install
|
36
|
-
#
|
37
|
-
# This will clone the various repositories and make them available to bundler.
|
38
|
-
# Once you have them installed you can easily switch between adapters for the
|
39
|
-
# various development tasks. Running something like
|
40
|
-
#
|
41
|
-
# ADAPTER=mysql bundle exec rake spec
|
42
|
-
#
|
43
|
-
# will make sure that the dm-mysql-adapter is part of the bundle, and will be used
|
44
|
-
# when running the specs.
|
45
|
-
#
|
46
|
-
# You can also specify which plugin(s) should be part of the bundle by setting
|
47
|
-
# an environment variable. This also works when using the Gemfile.local
|
48
|
-
#
|
49
|
-
# bundle foo # dm-migrations
|
50
|
-
# PLUGINS=dm-validations bundle foo # dm-migrations and dm-validations
|
51
|
-
# PLUGINS=dm-validations,dm-types bundle foo # dm-migrations, dm-validations and dm-types
|
52
|
-
#
|
53
|
-
# Of course you can combine the PLUGIN(S) and ADAPTER(S) env vars to run specs
|
54
|
-
# for certain adapter/plugin combinations.
|
55
|
-
#
|
56
|
-
# Finally, to speed up running specs and other tasks, it's recommended to run
|
57
|
-
#
|
58
|
-
# bundle lock
|
59
|
-
#
|
60
|
-
# after running 'bundle install' for the first time. This will make 'bundle exec' run
|
61
|
-
# a lot faster compared to the unlocked version. With an unlocked bundle you would
|
62
|
-
# typically just run 'bundle install' from time to time to fetch the latest sources from
|
63
|
-
# upstream. When you locked your bundle, you need to run
|
64
|
-
#
|
65
|
-
# bundle install --relock
|
66
|
-
#
|
67
|
-
# to make sure to fetch the latest updates and then lock the bundle again. Gemfile.lock
|
68
|
-
# is added to the .gitignore file, so you don't need to worry about accidentally checking
|
69
|
-
# it into version control.
|
1
|
+
require 'pathname'
|
70
2
|
|
71
3
|
source 'http://rubygems.org'
|
72
4
|
|
73
|
-
|
74
|
-
|
5
|
+
SOURCE = ENV.fetch('SOURCE', :git).to_sym
|
6
|
+
REPO_POSTFIX = SOURCE == :path ? '' : '.git'
|
7
|
+
DATAMAPPER = SOURCE == :path ? Pathname(__FILE__).dirname.parent : 'http://github.com/datamapper'
|
8
|
+
DM_VERSION = '~> 1.1.0.rc1'
|
75
9
|
|
76
|
-
group :runtime do
|
10
|
+
group :runtime do
|
77
11
|
|
78
12
|
if ENV['EXTLIB']
|
79
|
-
gem 'extlib',
|
13
|
+
gem 'extlib', '~> 0.9.15', SOURCE => "#{DATAMAPPER}/extlib#{REPO_POSTFIX}", :require => nil
|
80
14
|
else
|
81
|
-
gem 'activesupport', '~> 3.0.
|
15
|
+
gem 'activesupport', '~> 3.0.4', :require => nil
|
16
|
+
gem 'i18n', '~> 0.5.0'
|
82
17
|
end
|
83
18
|
|
84
|
-
gem '
|
85
|
-
gem '
|
86
|
-
gem '
|
87
|
-
gem '
|
88
|
-
gem 'stringex',
|
19
|
+
gem 'bcrypt-ruby', '~> 2.1.4'
|
20
|
+
gem 'dm-core', DM_VERSION, SOURCE => "#{DATAMAPPER}/dm-core#{REPO_POSTFIX}"
|
21
|
+
gem 'fastercsv', '~> 1.5.3'
|
22
|
+
gem 'json', '~> 1.5.1'
|
23
|
+
gem 'stringex', '~> 1.1.0'
|
24
|
+
gem 'uuidtools', '~> 2.1.1'
|
89
25
|
|
90
26
|
end
|
91
27
|
|
92
|
-
group
|
93
|
-
|
94
|
-
gem 'dm-validations', DM_VERSION, :git => "#{DATAMAPPER}/dm-validations.git"
|
28
|
+
group :development do
|
95
29
|
|
30
|
+
gem 'dm-validations', DM_VERSION, SOURCE => "#{DATAMAPPER}/dm-validations#{REPO_POSTFIX}"
|
31
|
+
gem 'jeweler', '~> 1.5.2'
|
96
32
|
gem 'rake', '~> 0.8.7'
|
97
|
-
gem 'rspec', '~> 1.3
|
98
|
-
gem 'jeweler', '~> 1.4'
|
33
|
+
gem 'rspec', '~> 1.3.1'
|
99
34
|
|
100
35
|
end
|
101
36
|
|
102
|
-
group :quality do
|
37
|
+
group :quality do
|
103
38
|
|
104
|
-
gem '
|
105
|
-
gem '
|
106
|
-
gem '
|
107
|
-
gem 'roodi', '~> 2.1'
|
108
|
-
gem 'yard', '~> 0.5'
|
109
|
-
gem 'yardstick', '~> 0.1'
|
39
|
+
gem 'rcov', '~> 0.9.9', :platforms => :mri_18
|
40
|
+
gem 'yard', '~> 0.6'
|
41
|
+
gem 'yardstick', '~> 0.2'
|
110
42
|
|
111
43
|
end
|
112
44
|
|
113
|
-
group :datamapper do
|
45
|
+
group :datamapper do
|
114
46
|
|
115
47
|
adapters = ENV['ADAPTER'] || ENV['ADAPTERS']
|
116
48
|
adapters = adapters.to_s.tr(',', ' ').split.uniq - %w[ in_memory ]
|
@@ -120,27 +52,27 @@ group :datamapper do # We need this because we want to pin these dependencies to
|
|
120
52
|
|
121
53
|
if (do_adapters = DM_DO_ADAPTERS & adapters).any?
|
122
54
|
options = {}
|
123
|
-
options[:git] = "#{DATAMAPPER}/do
|
55
|
+
options[:git] = "#{DATAMAPPER}/do#{REPO_POSTFIX}" if ENV['DO_GIT'] == 'true'
|
124
56
|
|
125
|
-
gem 'data_objects',
|
57
|
+
gem 'data_objects', DO_VERSION, options.dup
|
126
58
|
|
127
59
|
do_adapters.each do |adapter|
|
128
60
|
adapter = 'sqlite3' if adapter == 'sqlite'
|
129
61
|
gem "do_#{adapter}", DO_VERSION, options.dup
|
130
62
|
end
|
131
63
|
|
132
|
-
gem 'dm-do-adapter', DM_VERSION,
|
64
|
+
gem 'dm-do-adapter', DM_VERSION, SOURCE => "#{DATAMAPPER}/dm-do-adapter#{REPO_POSTFIX}"
|
133
65
|
end
|
134
66
|
|
135
67
|
adapters.each do |adapter|
|
136
|
-
gem "dm-#{adapter}-adapter", DM_VERSION,
|
68
|
+
gem "dm-#{adapter}-adapter", DM_VERSION, SOURCE => "#{DATAMAPPER}/dm-#{adapter}-adapter#{REPO_POSTFIX}"
|
137
69
|
end
|
138
70
|
|
139
71
|
plugins = ENV['PLUGINS'] || ENV['PLUGIN']
|
140
72
|
plugins = plugins.to_s.tr(',', ' ').split.push('dm-migrations').uniq
|
141
73
|
|
142
74
|
plugins.each do |plugin|
|
143
|
-
gem plugin, DM_VERSION,
|
75
|
+
gem plugin, DM_VERSION, SOURCE => "#{DATAMAPPER}/#{plugin}#{REPO_POSTFIX}"
|
144
76
|
end
|
145
77
|
|
146
78
|
end
|
data/LICENSE
CHANGED
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
|
4
4
|
begin
|
5
|
-
gem 'jeweler', '~> 1.
|
5
|
+
gem 'jeweler', '~> 1.5.2'
|
6
6
|
require 'jeweler'
|
7
7
|
|
8
8
|
Jeweler::Tasks.new do |gem|
|
@@ -15,20 +15,11 @@ begin
|
|
15
15
|
gem.has_rdoc = 'yard'
|
16
16
|
|
17
17
|
gem.rubyforge_project = 'datamapper'
|
18
|
-
|
19
|
-
gem.add_dependency 'dm-core', '~> 1.0.2'
|
20
|
-
gem.add_dependency 'fastercsv', '~> 1.5.3'
|
21
|
-
gem.add_dependency 'json_pure', '~> 1.4'
|
22
|
-
gem.add_dependency 'uuidtools', '~> 2.1.1'
|
23
|
-
gem.add_dependency 'stringex', '~> 1.1.0'
|
24
|
-
|
25
|
-
gem.add_development_dependency 'rspec', '~> 1.3'
|
26
|
-
gem.add_development_dependency 'dm-validations', '~> 1.0.2'
|
27
18
|
end
|
28
19
|
|
29
20
|
Jeweler::GemcutterTasks.new
|
30
21
|
|
31
22
|
FileList['tasks/**/*.rake'].each { |task| import task }
|
32
23
|
rescue LoadError
|
33
|
-
puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler'
|
24
|
+
puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler -v 1.5.2'
|
34
25
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.1.0.rc1
|
data/dm-types.gemspec
CHANGED
@@ -1,168 +1,176 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{dm-types}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.1.0.rc1"
|
9
9
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Dan Kubb"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2011-02-28}
|
13
13
|
s.description = %q{DataMapper plugin providing extra data types}
|
14
14
|
s.email = %q{dan.kubb [a] gmail [d] com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
|
-
|
17
|
+
"README.rdoc"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
|
-
"
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
"tasks/metrics.rake",
|
87
|
-
"tasks/spec.rake",
|
88
|
-
"tasks/yard.rake",
|
89
|
-
"tasks/yardstick.rake"
|
20
|
+
"Gemfile",
|
21
|
+
"LICENSE",
|
22
|
+
"README.rdoc",
|
23
|
+
"Rakefile",
|
24
|
+
"VERSION",
|
25
|
+
"dm-types.gemspec",
|
26
|
+
"lib/dm-types.rb",
|
27
|
+
"lib/dm-types/bcrypt_hash.rb",
|
28
|
+
"lib/dm-types/comma_separated_list.rb",
|
29
|
+
"lib/dm-types/csv.rb",
|
30
|
+
"lib/dm-types/enum.rb",
|
31
|
+
"lib/dm-types/epoch_time.rb",
|
32
|
+
"lib/dm-types/file_path.rb",
|
33
|
+
"lib/dm-types/flag.rb",
|
34
|
+
"lib/dm-types/ip_address.rb",
|
35
|
+
"lib/dm-types/json.rb",
|
36
|
+
"lib/dm-types/paranoid/base.rb",
|
37
|
+
"lib/dm-types/paranoid_boolean.rb",
|
38
|
+
"lib/dm-types/paranoid_datetime.rb",
|
39
|
+
"lib/dm-types/regexp.rb",
|
40
|
+
"lib/dm-types/slug.rb",
|
41
|
+
"lib/dm-types/support/flags.rb",
|
42
|
+
"lib/dm-types/uri.rb",
|
43
|
+
"lib/dm-types/uuid.rb",
|
44
|
+
"lib/dm-types/yaml.rb",
|
45
|
+
"spec/fixtures/article.rb",
|
46
|
+
"spec/fixtures/bookmark.rb",
|
47
|
+
"spec/fixtures/invention.rb",
|
48
|
+
"spec/fixtures/network_node.rb",
|
49
|
+
"spec/fixtures/person.rb",
|
50
|
+
"spec/fixtures/software_package.rb",
|
51
|
+
"spec/fixtures/ticket.rb",
|
52
|
+
"spec/fixtures/tshirt.rb",
|
53
|
+
"spec/integration/bcrypt_hash_spec.rb",
|
54
|
+
"spec/integration/comma_separated_list_spec.rb",
|
55
|
+
"spec/integration/enum_spec.rb",
|
56
|
+
"spec/integration/file_path_spec.rb",
|
57
|
+
"spec/integration/flag_spec.rb",
|
58
|
+
"spec/integration/ip_address_spec.rb",
|
59
|
+
"spec/integration/json_spec.rb",
|
60
|
+
"spec/integration/slug_spec.rb",
|
61
|
+
"spec/integration/uri_spec.rb",
|
62
|
+
"spec/integration/uuid_spec.rb",
|
63
|
+
"spec/integration/yaml_spec.rb",
|
64
|
+
"spec/rcov.opts",
|
65
|
+
"spec/shared/flags_shared_spec.rb",
|
66
|
+
"spec/shared/identity_function_group.rb",
|
67
|
+
"spec/spec.opts",
|
68
|
+
"spec/spec_helper.rb",
|
69
|
+
"spec/unit/bcrypt_hash_spec.rb",
|
70
|
+
"spec/unit/csv_spec.rb",
|
71
|
+
"spec/unit/enum_spec.rb",
|
72
|
+
"spec/unit/epoch_time_spec.rb",
|
73
|
+
"spec/unit/file_path_spec.rb",
|
74
|
+
"spec/unit/flag_spec.rb",
|
75
|
+
"spec/unit/ip_address_spec.rb",
|
76
|
+
"spec/unit/json_spec.rb",
|
77
|
+
"spec/unit/paranoid_boolean_spec.rb",
|
78
|
+
"spec/unit/paranoid_datetime_spec.rb",
|
79
|
+
"spec/unit/regexp_spec.rb",
|
80
|
+
"spec/unit/uri_spec.rb",
|
81
|
+
"spec/unit/uuid_spec.rb",
|
82
|
+
"spec/unit/yaml_spec.rb",
|
83
|
+
"tasks/spec.rake",
|
84
|
+
"tasks/yard.rake",
|
85
|
+
"tasks/yardstick.rake"
|
90
86
|
]
|
91
|
-
s.has_rdoc = %q{yard}
|
92
87
|
s.homepage = %q{http://github.com/datamapper/dm-types}
|
93
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
94
88
|
s.require_paths = ["lib"]
|
95
89
|
s.rubyforge_project = %q{datamapper}
|
96
|
-
s.rubygems_version = %q{1.
|
90
|
+
s.rubygems_version = %q{1.5.2}
|
97
91
|
s.summary = %q{DataMapper plugin providing extra data types}
|
98
92
|
s.test_files = [
|
99
93
|
"spec/fixtures/article.rb",
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
94
|
+
"spec/fixtures/bookmark.rb",
|
95
|
+
"spec/fixtures/invention.rb",
|
96
|
+
"spec/fixtures/network_node.rb",
|
97
|
+
"spec/fixtures/person.rb",
|
98
|
+
"spec/fixtures/software_package.rb",
|
99
|
+
"spec/fixtures/ticket.rb",
|
100
|
+
"spec/fixtures/tshirt.rb",
|
101
|
+
"spec/integration/bcrypt_hash_spec.rb",
|
102
|
+
"spec/integration/comma_separated_list_spec.rb",
|
103
|
+
"spec/integration/enum_spec.rb",
|
104
|
+
"spec/integration/file_path_spec.rb",
|
105
|
+
"spec/integration/flag_spec.rb",
|
106
|
+
"spec/integration/ip_address_spec.rb",
|
107
|
+
"spec/integration/json_spec.rb",
|
108
|
+
"spec/integration/slug_spec.rb",
|
109
|
+
"spec/integration/uri_spec.rb",
|
110
|
+
"spec/integration/uuid_spec.rb",
|
111
|
+
"spec/integration/yaml_spec.rb",
|
112
|
+
"spec/shared/flags_shared_spec.rb",
|
113
|
+
"spec/shared/identity_function_group.rb",
|
114
|
+
"spec/spec_helper.rb",
|
115
|
+
"spec/unit/bcrypt_hash_spec.rb",
|
116
|
+
"spec/unit/csv_spec.rb",
|
117
|
+
"spec/unit/enum_spec.rb",
|
118
|
+
"spec/unit/epoch_time_spec.rb",
|
119
|
+
"spec/unit/file_path_spec.rb",
|
120
|
+
"spec/unit/flag_spec.rb",
|
121
|
+
"spec/unit/ip_address_spec.rb",
|
122
|
+
"spec/unit/json_spec.rb",
|
123
|
+
"spec/unit/paranoid_boolean_spec.rb",
|
124
|
+
"spec/unit/paranoid_datetime_spec.rb",
|
125
|
+
"spec/unit/regexp_spec.rb",
|
126
|
+
"spec/unit/uri_spec.rb",
|
127
|
+
"spec/unit/uuid_spec.rb",
|
128
|
+
"spec/unit/yaml_spec.rb"
|
135
129
|
]
|
136
130
|
|
137
131
|
if s.respond_to? :specification_version then
|
138
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
139
132
|
s.specification_version = 3
|
140
133
|
|
141
134
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
142
|
-
s.add_runtime_dependency(%q<
|
135
|
+
s.add_runtime_dependency(%q<activesupport>, ["~> 3.0.4"])
|
136
|
+
s.add_runtime_dependency(%q<i18n>, ["~> 0.5.0"])
|
137
|
+
s.add_runtime_dependency(%q<bcrypt-ruby>, ["~> 2.1.4"])
|
138
|
+
s.add_runtime_dependency(%q<dm-core>, ["~> 1.1.0.rc1"])
|
143
139
|
s.add_runtime_dependency(%q<fastercsv>, ["~> 1.5.3"])
|
144
|
-
s.add_runtime_dependency(%q<
|
145
|
-
s.add_runtime_dependency(%q<uuidtools>, ["~> 2.1.1"])
|
140
|
+
s.add_runtime_dependency(%q<json>, ["~> 1.5.1"])
|
146
141
|
s.add_runtime_dependency(%q<stringex>, ["~> 1.1.0"])
|
147
|
-
s.
|
148
|
-
s.add_development_dependency(%q<dm-validations>, ["~> 1.0.
|
142
|
+
s.add_runtime_dependency(%q<uuidtools>, ["~> 2.1.1"])
|
143
|
+
s.add_development_dependency(%q<dm-validations>, ["~> 1.1.0.rc1"])
|
144
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
145
|
+
s.add_development_dependency(%q<rake>, ["~> 0.8.7"])
|
146
|
+
s.add_development_dependency(%q<rspec>, ["~> 1.3.1"])
|
149
147
|
else
|
150
|
-
s.add_dependency(%q<
|
148
|
+
s.add_dependency(%q<activesupport>, ["~> 3.0.4"])
|
149
|
+
s.add_dependency(%q<i18n>, ["~> 0.5.0"])
|
150
|
+
s.add_dependency(%q<bcrypt-ruby>, ["~> 2.1.4"])
|
151
|
+
s.add_dependency(%q<dm-core>, ["~> 1.1.0.rc1"])
|
151
152
|
s.add_dependency(%q<fastercsv>, ["~> 1.5.3"])
|
152
|
-
s.add_dependency(%q<
|
153
|
-
s.add_dependency(%q<uuidtools>, ["~> 2.1.1"])
|
153
|
+
s.add_dependency(%q<json>, ["~> 1.5.1"])
|
154
154
|
s.add_dependency(%q<stringex>, ["~> 1.1.0"])
|
155
|
-
s.add_dependency(%q<
|
156
|
-
s.add_dependency(%q<dm-validations>, ["~> 1.0.
|
155
|
+
s.add_dependency(%q<uuidtools>, ["~> 2.1.1"])
|
156
|
+
s.add_dependency(%q<dm-validations>, ["~> 1.1.0.rc1"])
|
157
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
158
|
+
s.add_dependency(%q<rake>, ["~> 0.8.7"])
|
159
|
+
s.add_dependency(%q<rspec>, ["~> 1.3.1"])
|
157
160
|
end
|
158
161
|
else
|
159
|
-
s.add_dependency(%q<
|
162
|
+
s.add_dependency(%q<activesupport>, ["~> 3.0.4"])
|
163
|
+
s.add_dependency(%q<i18n>, ["~> 0.5.0"])
|
164
|
+
s.add_dependency(%q<bcrypt-ruby>, ["~> 2.1.4"])
|
165
|
+
s.add_dependency(%q<dm-core>, ["~> 1.1.0.rc1"])
|
160
166
|
s.add_dependency(%q<fastercsv>, ["~> 1.5.3"])
|
161
|
-
s.add_dependency(%q<
|
162
|
-
s.add_dependency(%q<uuidtools>, ["~> 2.1.1"])
|
167
|
+
s.add_dependency(%q<json>, ["~> 1.5.1"])
|
163
168
|
s.add_dependency(%q<stringex>, ["~> 1.1.0"])
|
164
|
-
s.add_dependency(%q<
|
165
|
-
s.add_dependency(%q<dm-validations>, ["~> 1.0.
|
169
|
+
s.add_dependency(%q<uuidtools>, ["~> 2.1.1"])
|
170
|
+
s.add_dependency(%q<dm-validations>, ["~> 1.1.0.rc1"])
|
171
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
172
|
+
s.add_dependency(%q<rake>, ["~> 0.8.7"])
|
173
|
+
s.add_dependency(%q<rspec>, ["~> 1.3.1"])
|
166
174
|
end
|
167
175
|
end
|
168
176
|
|
data/lib/dm-types/bcrypt_hash.rb
CHANGED
@@ -32,8 +32,3 @@ module DataMapper
|
|
32
32
|
end # class BCryptHash
|
33
33
|
end # class Property
|
34
34
|
end # module DataMapper
|
35
|
-
|
36
|
-
# The Bcrypt::Password#hash method returns a String and not an Integer,
|
37
|
-
# which is required by any ruby class that uses a Hash underneath. Removing
|
38
|
-
# this method does not cause any spec failures in Bcrypt::Password
|
39
|
-
BCrypt::Password.class_eval { remove_method :hash }
|
data/lib/dm-types/enum.rb
CHANGED
data/lib/dm-types/flag.rb
CHANGED
@@ -6,7 +6,7 @@ module DataMapper
|
|
6
6
|
class Flag < Integer
|
7
7
|
include Flags
|
8
8
|
|
9
|
-
def initialize(model, name, options = {}
|
9
|
+
def initialize(model, name, options = {})
|
10
10
|
super
|
11
11
|
|
12
12
|
@flag_map = {}
|
@@ -35,7 +35,7 @@ module DataMapper
|
|
35
35
|
|
36
36
|
def dump(value)
|
37
37
|
return if value.nil?
|
38
|
-
flags = Array(value).map { |flag| flag.to_sym }.flatten
|
38
|
+
flags = Array(value).map { |flag| flag.to_sym }.flatten.uniq
|
39
39
|
flag_map.invert.values_at(*flags).compact.inject(0) { |sum, i| sum += 1 << i }
|
40
40
|
end
|
41
41
|
|
data/lib/dm-types/json.rb
CHANGED
@@ -2,8 +2,18 @@ module DataMapper
|
|
2
2
|
module Types
|
3
3
|
module Paranoid
|
4
4
|
module Base
|
5
|
+
extend Chainable
|
6
|
+
|
5
7
|
def self.included(model)
|
6
8
|
model.extend ClassMethods
|
9
|
+
model.instance_variable_set(:@paranoid_properties, {})
|
10
|
+
end
|
11
|
+
|
12
|
+
chainable do
|
13
|
+
def inherited(model)
|
14
|
+
model.instance_variable_set(:@paranoid_properties, @paranoid_properties.dup)
|
15
|
+
super
|
16
|
+
end
|
7
17
|
end
|
8
18
|
|
9
19
|
def paranoid_destroy
|
@@ -32,6 +42,16 @@ module DataMapper
|
|
32
42
|
def with_deleted
|
33
43
|
with_exclusive_scope({}) { block_given? ? yield : all }
|
34
44
|
end
|
45
|
+
|
46
|
+
# @api private
|
47
|
+
def paranoid_properties
|
48
|
+
@paranoid_properties
|
49
|
+
end
|
50
|
+
|
51
|
+
# @api private
|
52
|
+
def set_paranoid_property(name, &block)
|
53
|
+
paranoid_properties[name] = block
|
54
|
+
end
|
35
55
|
end # module ClassMethods
|
36
56
|
end # module Paranoid
|
37
57
|
end # module Types
|
@@ -1,12 +1,14 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
Spec::Matchers.define :run_ipv4 do |model|
|
4
|
+
match do |model|
|
5
|
+
model.runs_ipv4?
|
6
6
|
end
|
7
|
+
end
|
7
8
|
|
8
|
-
|
9
|
-
|
9
|
+
Spec::Matchers.define :run_ipv6 do |model|
|
10
|
+
match do |model|
|
11
|
+
model.runs_ipv6?
|
10
12
|
end
|
11
13
|
end
|
12
14
|
|
@@ -24,8 +26,6 @@ try_spec do
|
|
24
26
|
)
|
25
27
|
end
|
26
28
|
|
27
|
-
include IPAddressMatchers
|
28
|
-
|
29
29
|
describe 'with IP address fe80::ab8:e8ff:fed7:f8c9' do
|
30
30
|
before :all do
|
31
31
|
@resource.ip_address = 'fe80::ab8:e8ff:fed7:f8c9'
|
data/spec/spec_helper.rb
CHANGED
@@ -5,7 +5,7 @@ require 'dm-types'
|
|
5
5
|
require 'dm-migrations'
|
6
6
|
require 'dm-validations'
|
7
7
|
|
8
|
-
Dir["#{Pathname(__FILE__).dirname.expand_path}/shared
|
8
|
+
Dir["#{Pathname(__FILE__).dirname.expand_path}/shared/*.rb"].each { |file| require file }
|
9
9
|
|
10
10
|
DataMapper::Spec.setup
|
11
11
|
|
@@ -20,8 +20,6 @@ DEPENDENCIES = {
|
|
20
20
|
def try_spec
|
21
21
|
begin
|
22
22
|
yield
|
23
|
-
rescue NameError
|
24
|
-
# do nothing
|
25
23
|
rescue LoadError => error
|
26
24
|
raise error unless lib = error.message.match(/\Ano such file to load -- (.+)\z/)[1]
|
27
25
|
|
data/spec/unit/flag_spec.rb
CHANGED
@@ -63,6 +63,16 @@ try_spec do
|
|
63
63
|
@result.should == 0
|
64
64
|
end
|
65
65
|
end
|
66
|
+
|
67
|
+
describe 'when argument contains duplicate flags' do
|
68
|
+
before :all do
|
69
|
+
@result = @flag.dump([ :second, :fourth, :second ])
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'behaves the same as if there were no duplicates' do
|
73
|
+
@result.should == @flag.dump([ :second, :fourth ])
|
74
|
+
end
|
75
|
+
end
|
66
76
|
end
|
67
77
|
|
68
78
|
describe '.load' do
|
data/tasks/spec.rake
CHANGED
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-types
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 1
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
version: 1.0.2
|
4
|
+
prerelease: 6
|
5
|
+
version: 1.1.0.rc1
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Dan Kubb
|
@@ -14,112 +10,141 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date:
|
13
|
+
date: 2011-02-28 00:00:00 -08:00
|
18
14
|
default_executable:
|
19
15
|
dependencies:
|
20
16
|
- !ruby/object:Gem::Dependency
|
21
|
-
name:
|
22
|
-
prerelease: false
|
17
|
+
name: activesupport
|
23
18
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
19
|
none: false
|
25
20
|
requirements:
|
26
21
|
- - ~>
|
27
22
|
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
- 1
|
30
|
-
- 0
|
31
|
-
- 2
|
32
|
-
version: 1.0.2
|
23
|
+
version: 3.0.4
|
33
24
|
type: :runtime
|
25
|
+
prerelease: false
|
34
26
|
version_requirements: *id001
|
35
27
|
- !ruby/object:Gem::Dependency
|
36
|
-
name:
|
37
|
-
prerelease: false
|
28
|
+
name: i18n
|
38
29
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
30
|
none: false
|
40
31
|
requirements:
|
41
32
|
- - ~>
|
42
33
|
- !ruby/object:Gem::Version
|
43
|
-
|
44
|
-
- 1
|
45
|
-
- 5
|
46
|
-
- 3
|
47
|
-
version: 1.5.3
|
34
|
+
version: 0.5.0
|
48
35
|
type: :runtime
|
36
|
+
prerelease: false
|
49
37
|
version_requirements: *id002
|
50
38
|
- !ruby/object:Gem::Dependency
|
51
|
-
name:
|
52
|
-
prerelease: false
|
39
|
+
name: bcrypt-ruby
|
53
40
|
requirement: &id003 !ruby/object:Gem::Requirement
|
54
41
|
none: false
|
55
42
|
requirements:
|
56
43
|
- - ~>
|
57
44
|
- !ruby/object:Gem::Version
|
58
|
-
|
59
|
-
- 1
|
60
|
-
- 4
|
61
|
-
version: "1.4"
|
45
|
+
version: 2.1.4
|
62
46
|
type: :runtime
|
47
|
+
prerelease: false
|
63
48
|
version_requirements: *id003
|
64
49
|
- !ruby/object:Gem::Dependency
|
65
|
-
name:
|
66
|
-
prerelease: false
|
50
|
+
name: dm-core
|
67
51
|
requirement: &id004 !ruby/object:Gem::Requirement
|
68
52
|
none: false
|
69
53
|
requirements:
|
70
54
|
- - ~>
|
71
55
|
- !ruby/object:Gem::Version
|
72
|
-
|
73
|
-
- 2
|
74
|
-
- 1
|
75
|
-
- 1
|
76
|
-
version: 2.1.1
|
56
|
+
version: 1.1.0.rc1
|
77
57
|
type: :runtime
|
58
|
+
prerelease: false
|
78
59
|
version_requirements: *id004
|
79
60
|
- !ruby/object:Gem::Dependency
|
80
|
-
name:
|
81
|
-
prerelease: false
|
61
|
+
name: fastercsv
|
82
62
|
requirement: &id005 !ruby/object:Gem::Requirement
|
83
63
|
none: false
|
84
64
|
requirements:
|
85
65
|
- - ~>
|
86
66
|
- !ruby/object:Gem::Version
|
87
|
-
|
88
|
-
- 1
|
89
|
-
- 1
|
90
|
-
- 0
|
91
|
-
version: 1.1.0
|
67
|
+
version: 1.5.3
|
92
68
|
type: :runtime
|
69
|
+
prerelease: false
|
93
70
|
version_requirements: *id005
|
94
71
|
- !ruby/object:Gem::Dependency
|
95
|
-
name:
|
96
|
-
prerelease: false
|
72
|
+
name: json
|
97
73
|
requirement: &id006 !ruby/object:Gem::Requirement
|
98
74
|
none: false
|
99
75
|
requirements:
|
100
76
|
- - ~>
|
101
77
|
- !ruby/object:Gem::Version
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
version: "1.3"
|
106
|
-
type: :development
|
78
|
+
version: 1.5.1
|
79
|
+
type: :runtime
|
80
|
+
prerelease: false
|
107
81
|
version_requirements: *id006
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: stringex
|
84
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 1.1.0
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: *id007
|
93
|
+
- !ruby/object:Gem::Dependency
|
94
|
+
name: uuidtools
|
95
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ~>
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: 2.1.1
|
101
|
+
type: :runtime
|
102
|
+
prerelease: false
|
103
|
+
version_requirements: *id008
|
108
104
|
- !ruby/object:Gem::Dependency
|
109
105
|
name: dm-validations
|
106
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
108
|
+
requirements:
|
109
|
+
- - ~>
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: 1.1.0.rc1
|
112
|
+
type: :development
|
110
113
|
prerelease: false
|
111
|
-
|
114
|
+
version_requirements: *id009
|
115
|
+
- !ruby/object:Gem::Dependency
|
116
|
+
name: jeweler
|
117
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
112
118
|
none: false
|
113
119
|
requirements:
|
114
120
|
- - ~>
|
115
121
|
- !ruby/object:Gem::Version
|
116
|
-
|
117
|
-
- 1
|
118
|
-
- 0
|
119
|
-
- 2
|
120
|
-
version: 1.0.2
|
122
|
+
version: 1.5.2
|
121
123
|
type: :development
|
122
|
-
|
124
|
+
prerelease: false
|
125
|
+
version_requirements: *id010
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: rake
|
128
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ~>
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: 0.8.7
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: *id011
|
137
|
+
- !ruby/object:Gem::Dependency
|
138
|
+
name: rspec
|
139
|
+
requirement: &id012 !ruby/object:Gem::Requirement
|
140
|
+
none: false
|
141
|
+
requirements:
|
142
|
+
- - ~>
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: 1.3.1
|
145
|
+
type: :development
|
146
|
+
prerelease: false
|
147
|
+
version_requirements: *id012
|
123
148
|
description: DataMapper plugin providing extra data types
|
124
149
|
email: dan.kubb [a] gmail [d] com
|
125
150
|
executables: []
|
@@ -130,7 +155,6 @@ extra_rdoc_files:
|
|
130
155
|
- LICENSE
|
131
156
|
- README.rdoc
|
132
157
|
files:
|
133
|
-
- .gitignore
|
134
158
|
- Gemfile
|
135
159
|
- LICENSE
|
136
160
|
- README.rdoc
|
@@ -194,19 +218,16 @@ files:
|
|
194
218
|
- spec/unit/uri_spec.rb
|
195
219
|
- spec/unit/uuid_spec.rb
|
196
220
|
- spec/unit/yaml_spec.rb
|
197
|
-
- tasks/ci.rake
|
198
|
-
- tasks/local_gemfile.rake
|
199
|
-
- tasks/metrics.rake
|
200
221
|
- tasks/spec.rake
|
201
222
|
- tasks/yard.rake
|
202
223
|
- tasks/yardstick.rake
|
203
|
-
has_rdoc:
|
224
|
+
has_rdoc: true
|
204
225
|
homepage: http://github.com/datamapper/dm-types
|
205
226
|
licenses: []
|
206
227
|
|
207
228
|
post_install_message:
|
208
|
-
rdoc_options:
|
209
|
-
|
229
|
+
rdoc_options: []
|
230
|
+
|
210
231
|
require_paths:
|
211
232
|
- lib
|
212
233
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -214,21 +235,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
214
235
|
requirements:
|
215
236
|
- - ">="
|
216
237
|
- !ruby/object:Gem::Version
|
217
|
-
segments:
|
218
|
-
- 0
|
219
238
|
version: "0"
|
220
239
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
221
240
|
none: false
|
222
241
|
requirements:
|
223
|
-
- - "
|
242
|
+
- - ">"
|
224
243
|
- !ruby/object:Gem::Version
|
225
|
-
|
226
|
-
- 0
|
227
|
-
version: "0"
|
244
|
+
version: 1.3.1
|
228
245
|
requirements: []
|
229
246
|
|
230
247
|
rubyforge_project: datamapper
|
231
|
-
rubygems_version: 1.
|
248
|
+
rubygems_version: 1.5.2
|
232
249
|
signing_key:
|
233
250
|
specification_version: 3
|
234
251
|
summary: DataMapper plugin providing extra data types
|
data/.gitignore
DELETED
@@ -1,37 +0,0 @@
|
|
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.local
|
33
|
-
Gemfile.lock
|
34
|
-
Gemfile.local.lock
|
35
|
-
|
36
|
-
## PROJECT::SPECIFIC
|
37
|
-
spec/db/
|
data/tasks/ci.rake
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
task :ci => [ :verify_measurements, 'metrics:all' ]
|
data/tasks/local_gemfile.rake
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
desc "Support bundling from local source code (allows BUNDLE_GEMFILE=Gemfile.local bundle foo)"
|
2
|
-
task :local_gemfile do |t|
|
3
|
-
|
4
|
-
root = Pathname(__FILE__).dirname.parent
|
5
|
-
datamapper = root.parent
|
6
|
-
|
7
|
-
root.join('Gemfile.local').open('w') do |f|
|
8
|
-
root.join('Gemfile').open.each do |line|
|
9
|
-
line.sub!(/DATAMAPPER = 'git:\/\/github.com\/datamapper'/, "DATAMAPPER = '#{datamapper}'")
|
10
|
-
line.sub!(/:git => \"#\{DATAMAPPER\}\/(.+?)(?:\.git)?\"/, ':path => "#{DATAMAPPER}/\1"')
|
11
|
-
line.sub!(/do_options\[:git\] = \"#\{DATAMAPPER\}\/(.+?)(?:\.git)?\"/, 'do_options[:path] = "#{DATAMAPPER}/\1"')
|
12
|
-
f.puts line
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
data/tasks/metrics.rake
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
require 'metric_fu'
|
3
|
-
rescue LoadError
|
4
|
-
namespace :metrics do
|
5
|
-
task :all do
|
6
|
-
abort 'metric_fu is not available. In order to run metrics:all, you must: gem install metric_fu'
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
begin
|
12
|
-
require 'reek/adapters/rake_task'
|
13
|
-
|
14
|
-
Reek::RakeTask.new do |t|
|
15
|
-
t.fail_on_error = true
|
16
|
-
t.verbose = false
|
17
|
-
t.source_files = 'lib/**/*.rb'
|
18
|
-
end
|
19
|
-
rescue LoadError
|
20
|
-
task :reek do
|
21
|
-
abort 'Reek is not available. In order to run reek, you must: gem install reek'
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
begin
|
26
|
-
require 'roodi'
|
27
|
-
require 'roodi_task'
|
28
|
-
|
29
|
-
RoodiTask.new do |t|
|
30
|
-
t.verbose = false
|
31
|
-
end
|
32
|
-
rescue LoadError
|
33
|
-
task :roodi do
|
34
|
-
abort 'Roodi is not available. In order to run roodi, you must: gem install roodi'
|
35
|
-
end
|
36
|
-
end
|