dm-aggregates 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2008 Foy Savas
1
+ Copyright (c) 2009 Foy Savas
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -1,24 +1,29 @@
1
- require 'pathname'
1
+ require 'rubygems'
2
+ require 'rake'
2
3
 
3
- ROOT = Pathname(__FILE__).dirname.expand_path
4
- JRUBY = RUBY_PLATFORM =~ /java/
5
- WINDOWS = Gem.win_platform?
6
- SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
4
+ begin
5
+ gem 'jeweler', '~> 1.4'
6
+ require 'jeweler'
7
7
 
8
- require ROOT + 'lib/dm-aggregates/version'
8
+ Jeweler::Tasks.new do |gem|
9
+ gem.name = 'dm-aggregates'
10
+ gem.summary = 'DataMapper plugin providing support for aggregates on collections'
11
+ gem.description = gem.summary
12
+ gem.email = 'foysavas [a] gmail [d] com'
13
+ gem.homepage = 'http://github.com/datamapper/dm-more/tree/master/%s' % gem.name
14
+ gem.authors = [ 'Foy Savas' ]
9
15
 
10
- AUTHOR = 'Foy Savas'
11
- EMAIL = 'foysavas [a] gmail [d] com'
12
- GEM_NAME = 'dm-aggregates'
13
- GEM_VERSION = DataMapper::Aggregates::VERSION
14
- GEM_DEPENDENCIES = [['dm-core', GEM_VERSION]]
15
- GEM_CLEAN = %w[ log pkg coverage ]
16
- GEM_EXTRAS = { :has_rdoc => true, :extra_rdoc_files => %w[ README.rdoc LICENSE TODO History.rdoc ] }
16
+ gem.rubyforge_project = 'datamapper'
17
17
 
18
- PROJECT_NAME = 'datamapper'
19
- PROJECT_URL = "http://github.com/datamapper/dm-more/tree/master/#{GEM_NAME}"
20
- PROJECT_DESCRIPTION = PROJECT_SUMMARY = 'DataMapper plugin providing support for aggregates, functions on collections and datasets'
18
+ gem.add_dependency 'dm-core', '~> 0.10.2'
21
19
 
22
- [ ROOT, ROOT.parent ].each do |dir|
23
- Pathname.glob(dir.join('tasks/**/*.rb').to_s).each { |f| require f }
20
+ gem.add_development_dependency 'rspec', '~> 1.2.9'
21
+ gem.add_development_dependency 'yard', '~> 0.4.0'
22
+ end
23
+
24
+ Jeweler::GemcutterTasks.new
25
+
26
+ FileList['tasks/**/*.rake'].each { |task| import task }
27
+ rescue LoadError
28
+ puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler'
24
29
  end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.10.2
@@ -0,0 +1,71 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{dm-aggregates}
8
+ s.version = "0.10.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Foy Savas"]
12
+ s.date = %q{2009-12-11}
13
+ s.description = %q{DataMapper plugin providing support for aggregates on collections}
14
+ s.email = %q{foysavas [a] gmail [d] com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ "LICENSE",
21
+ "README.rdoc",
22
+ "Rakefile",
23
+ "VERSION",
24
+ "dm-aggregates.gemspec",
25
+ "lib/dm-aggregates.rb",
26
+ "lib/dm-aggregates/adapters/data_objects_adapter.rb",
27
+ "lib/dm-aggregates/aggregate_functions.rb",
28
+ "lib/dm-aggregates/collection.rb",
29
+ "lib/dm-aggregates/core_ext/symbol.rb",
30
+ "lib/dm-aggregates/model.rb",
31
+ "lib/dm-aggregates/query.rb",
32
+ "lib/dm-aggregates/repository.rb",
33
+ "spec/public/collection_spec.rb",
34
+ "spec/public/model_spec.rb",
35
+ "spec/public/shared/aggregate_shared_spec.rb",
36
+ "spec/rcov.opts",
37
+ "spec/spec.opts",
38
+ "spec/spec_helper.rb",
39
+ "tasks/ci.rake",
40
+ "tasks/metrics.rake",
41
+ "tasks/spec.rake",
42
+ "tasks/yard.rake",
43
+ "tasks/yardstick.rake"
44
+ ]
45
+ s.homepage = %q{http://github.com/datamapper/dm-more/tree/master/dm-aggregates}
46
+ s.rdoc_options = ["--charset=UTF-8"]
47
+ s.require_paths = ["lib"]
48
+ s.rubyforge_project = %q{datamapper}
49
+ s.rubygems_version = %q{1.3.5}
50
+ s.summary = %q{DataMapper plugin providing support for aggregates on collections}
51
+
52
+ if s.respond_to? :specification_version then
53
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
54
+ s.specification_version = 3
55
+
56
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
57
+ s.add_runtime_dependency(%q<dm-core>, ["~> 0.10.2"])
58
+ s.add_development_dependency(%q<rspec>, ["~> 1.2.9"])
59
+ s.add_development_dependency(%q<yard>, ["~> 0.4.0"])
60
+ else
61
+ s.add_dependency(%q<dm-core>, ["~> 0.10.2"])
62
+ s.add_dependency(%q<rspec>, ["~> 1.2.9"])
63
+ s.add_dependency(%q<yard>, ["~> 0.4.0"])
64
+ end
65
+ else
66
+ s.add_dependency(%q<dm-core>, ["~> 0.10.2"])
67
+ s.add_dependency(%q<rspec>, ["~> 1.2.9"])
68
+ s.add_dependency(%q<yard>, ["~> 0.4.0"])
69
+ end
70
+ end
71
+
@@ -5,7 +5,6 @@ require 'dm-aggregates/core_ext/symbol'
5
5
  require 'dm-aggregates/model'
6
6
  require 'dm-aggregates/query'
7
7
  require 'dm-aggregates/repository'
8
- require 'dm-aggregates/version'
9
8
 
10
9
  module DataMapper
11
10
  class Repository
@@ -72,24 +72,24 @@ module DataMapper
72
72
  RUBY
73
73
  end
74
74
 
75
- def property_to_column_name_with_operator(property, qualify)
75
+ def property_to_column_name_with_operator(property, qualify, qualifier = nil)
76
76
  case property
77
77
  when DataMapper::Query::Operator
78
- aggregate_field_statement(property.operator, property.target, qualify)
78
+ aggregate_field_statement(property.operator, property.target, qualify, qualifier)
79
79
 
80
80
  when Property, DataMapper::Query::Path
81
- property_to_column_name_without_operator(property, qualify)
81
+ property_to_column_name_without_operator(property, qualify, qualifier)
82
82
 
83
83
  else
84
84
  raise ArgumentError, "+property+ must be a DataMapper::Query::Operator, a DataMapper::Property or a Query::Path, but was a #{property.class} (#{property.inspect})"
85
85
  end
86
86
  end
87
87
 
88
- def aggregate_field_statement(aggregate_function, property, qualify)
88
+ def aggregate_field_statement(aggregate_function, property, qualify, qualifier)
89
89
  column_name = if aggregate_function == :count && property == :all
90
90
  '*'
91
91
  else
92
- property_to_column_name(property, qualify)
92
+ property_to_column_name(property, qualify, qualifier)
93
93
  end
94
94
 
95
95
  function_name = case aggregate_function
@@ -1,6 +1,8 @@
1
1
  module DataMapper
2
2
  module Aggregates
3
3
  module Functions
4
+ include Extlib::Assertions
5
+
4
6
  # Count results (given the conditions)
5
7
  #
6
8
  # @example the count of all friends
@@ -35,7 +37,7 @@ module DataMapper
35
37
  assert_kind_of 'property', property_by_name(property_name), Property
36
38
  end
37
39
 
38
- aggregate(query.merge(:fields => [ property_name ? property_name.count : :all.count ]))
40
+ aggregate(query.merge(:fields => [ property_name ? property_name.count : :all.count ])).to_i
39
41
  end
40
42
 
41
43
  # Get the lowest value of a property
@@ -174,7 +176,8 @@ module DataMapper
174
176
  raise ArgumentError, 'property name must not be nil'
175
177
  end
176
178
 
177
- type = property_by_name(name).type
179
+ property = property_by_name(name)
180
+ type = property.custom? ? property.primitive : property.type
178
181
 
179
182
  unless types.include?(type)
180
183
  raise ArgumentError, "#{name} must be #{types * ' or '}, but was #{type}"
@@ -15,7 +15,7 @@ module DataMapper
15
15
  operators.each do |operator|
16
16
  target = operator.target
17
17
 
18
- unless target == :all || target.kind_of?(Property) && target.model == model && @properties.include?(target)
18
+ unless target == :all || @properties.include?(target)
19
19
  raise ArgumentError, "+options[:fields]+ entry #{target.inspect} does not map to a property in #{model}"
20
20
  end
21
21
  end
@@ -2,6 +2,7 @@ module DataMapper
2
2
  module Aggregates
3
3
  module Repository
4
4
  def aggregate(query)
5
+ return [] unless query.valid?
5
6
  adapter.aggregate(query)
6
7
  end
7
8
  end
@@ -10,5 +10,97 @@ if HAS_SQLITE3 || HAS_MYSQL || HAS_POSTGRES
10
10
  end
11
11
 
12
12
  it_should_behave_like 'An Aggregatable Class'
13
+
14
+ describe 'ignore invalid query' do
15
+ before :all do
16
+ @dragons = @dragons.all(:id => [])
17
+ end
18
+
19
+ [ :size, :count ].each do |method|
20
+ describe "##{method}" do
21
+ it 'should return 0' do
22
+ @dragons.send(method).should == 0
23
+ end
24
+ end
25
+ end
26
+
27
+ describe '#min' do
28
+ it 'should return nil' do
29
+ @dragons.min(:id).should == nil
30
+ end
31
+ end
32
+
33
+ describe '#max' do
34
+ it 'should return nil' do
35
+ @dragons.max(:id).should == nil
36
+ end
37
+ end
38
+
39
+ describe '#avg' do
40
+ it 'should return nil' do
41
+ @dragons.avg(:id).should == nil
42
+ end
43
+ end
44
+
45
+ describe '#sum' do
46
+ it 'should return nil' do
47
+ @dragons.sum(:id).should == nil
48
+ end
49
+ end
50
+
51
+ describe '#aggregate' do
52
+ it 'should return nil' do
53
+ @dragons.aggregate(:id).should == []
54
+ end
55
+ end
56
+ end
57
+
58
+ describe 'with collections created with Set operations' do
59
+ before do
60
+ @collection = @dragons.all(:name => 'George') | @dragons.all(:name => 'Puff')
61
+ end
62
+
63
+ describe '#size' do
64
+ subject { @collection.size }
65
+
66
+ it { should == 2 }
67
+ end
68
+
69
+ describe '#count' do
70
+ subject { @collection.count }
71
+
72
+ it { should == 2 }
73
+ end
74
+
75
+ describe '#min' do
76
+ subject { @collection.min(:toes_on_claw) }
77
+
78
+ it { should == 3 }
79
+ end
80
+
81
+ describe '#max' do
82
+ subject { @collection.max(:toes_on_claw) }
83
+
84
+ it { should == 4 }
85
+ end
86
+
87
+ describe '#avg' do
88
+ subject { @collection.avg(:toes_on_claw) }
89
+
90
+ it { should == 3.5 }
91
+ end
92
+
93
+ describe '#sum' do
94
+ subject { @collection.sum(:toes_on_claw) }
95
+
96
+ it { should == 7 }
97
+ end
98
+
99
+ describe '#aggregate' do
100
+ subject { @collection.aggregate(:all.count, :name.count, :toes_on_claw.min, :toes_on_claw.max, :toes_on_claw.avg, :toes_on_claw.sum)}
101
+
102
+ it { should == [ 2, 2, 3, 4, 3.5, 7 ] }
103
+ end
104
+ end
13
105
  end
14
106
  end
@@ -19,7 +19,7 @@ shared_examples_for 'It Has Setup Resources' do
19
19
  property :birth_on, Date
20
20
  property :birth_time, Time
21
21
 
22
- belongs_to :knight, :nullable => true
22
+ belongs_to :knight, :required => false
23
23
  end
24
24
 
25
25
  # A more complex example, with BigDecimal and Float properties
@@ -29,7 +29,7 @@ shared_examples_for 'It Has Setup Resources' do
29
29
  include DataMapper::Resource
30
30
 
31
31
  property :id, Serial
32
- property :name, String, :nullable => false
32
+ property :name, String, :required => true
33
33
  property :population, Integer
34
34
  property :birth_rate, Float, :precision => 4, :scale => 2
35
35
  property :gold_reserve_tonnes, Float, :precision => 6, :scale => 2
@@ -38,9 +38,9 @@ shared_examples_for 'It Has Setup Resources' do
38
38
 
39
39
  DataMapper.auto_migrate!
40
40
 
41
- @birth_at = DateTime.now
42
- @birth_on = Date.parse(@birth_at.to_s)
43
- @birth_time = Time.parse(@birth_at.to_s)
41
+ @birth_time = Time.now
42
+ @birth_at = @birth_time.to_datetime
43
+ @birth_on = @birth_time.send(:to_date)
44
44
 
45
45
  @chuck = Knight.create(:name => 'Chuck')
46
46
  @larry = Knight.create(:name => 'Larry')
@@ -146,7 +146,7 @@ shared_examples_for 'An Aggregatable Class' do
146
146
 
147
147
  it 'should provide the lowest value of a Date property' do
148
148
  @dragons.min(:birth_on).should be_kind_of(Date)
149
- @dragons.min(:birth_on).to_s.should == @birth_on.to_s
149
+ @dragons.min(:birth_on).should == @birth_on
150
150
  end
151
151
 
152
152
  it 'should provide the lowest value of a Time property' do
@@ -191,7 +191,7 @@ shared_examples_for 'An Aggregatable Class' do
191
191
 
192
192
  it 'should provide the highest value of a Date property' do
193
193
  @dragons.min(:birth_on).should be_kind_of(Date)
194
- @dragons.min(:birth_on).to_s.should == @birth_on.to_s
194
+ @dragons.min(:birth_on).should == @birth_on
195
195
  end
196
196
 
197
197
  it 'should provide the highest value of a Time property' do
@@ -0,0 +1,6 @@
1
+ --exclude "spec"
2
+ --sort coverage
3
+ --callsites
4
+ --xrefs
5
+ --profile
6
+ --text-summary
@@ -1,2 +1,4 @@
1
1
  --colour
2
2
  --loadby random
3
+ --format profile
4
+ --backtrace
@@ -0,0 +1 @@
1
+ task :ci => [ :verify_measurements, 'metrics:all' ]
@@ -0,0 +1,36 @@
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
@@ -0,0 +1,41 @@
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 :spec => :check_dependencies
39
+ task :rcov => :check_dependencies
40
+
41
+ task :default => :spec
@@ -0,0 +1,9 @@
1
+ begin
2
+ require 'yard'
3
+
4
+ YARD::Rake::YardocTask.new
5
+ rescue LoadError
6
+ task :yard do
7
+ abort 'YARD is not available. In order to run yard, you must: gem install yard'
8
+ end
9
+ end
@@ -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 CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dm-aggregates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foy Savas
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-30 00:00:00 -07:00
12
+ date: 2009-12-11 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -18,29 +18,45 @@ dependencies:
18
18
  version_requirement:
19
19
  version_requirements: !ruby/object:Gem::Requirement
20
20
  requirements:
21
- - - "="
21
+ - - ~>
22
22
  - !ruby/object:Gem::Version
23
- version: 0.10.1
23
+ version: 0.10.2
24
24
  version:
25
- description: DataMapper plugin providing support for aggregates, functions on collections and datasets
26
- email:
27
- - foysavas [a] gmail [d] com
25
+ - !ruby/object:Gem::Dependency
26
+ name: rspec
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 1.2.9
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: yard
37
+ type: :development
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: 0.4.0
44
+ version:
45
+ description: DataMapper plugin providing support for aggregates on collections
46
+ email: foysavas [a] gmail [d] com
28
47
  executables: []
29
48
 
30
49
  extensions: []
31
50
 
32
51
  extra_rdoc_files:
33
- - README.rdoc
34
52
  - LICENSE
35
- - TODO
36
- - History.rdoc
53
+ - README.rdoc
37
54
  files:
38
- - History.rdoc
39
55
  - LICENSE
40
- - Manifest.txt
41
56
  - README.rdoc
42
57
  - Rakefile
43
- - TODO
58
+ - VERSION
59
+ - dm-aggregates.gemspec
44
60
  - lib/dm-aggregates.rb
45
61
  - lib/dm-aggregates/adapters/data_objects_adapter.rb
46
62
  - lib/dm-aggregates/aggregate_functions.rb
@@ -49,22 +65,24 @@ files:
49
65
  - lib/dm-aggregates/model.rb
50
66
  - lib/dm-aggregates/query.rb
51
67
  - lib/dm-aggregates/repository.rb
52
- - lib/dm-aggregates/version.rb
53
68
  - spec/public/collection_spec.rb
54
69
  - spec/public/model_spec.rb
55
70
  - spec/public/shared/aggregate_shared_spec.rb
71
+ - spec/rcov.opts
56
72
  - spec/spec.opts
57
73
  - spec/spec_helper.rb
58
- - tasks/install.rb
59
- - tasks/spec.rb
74
+ - tasks/ci.rake
75
+ - tasks/metrics.rake
76
+ - tasks/spec.rake
77
+ - tasks/yard.rake
78
+ - tasks/yardstick.rake
60
79
  has_rdoc: true
61
80
  homepage: http://github.com/datamapper/dm-more/tree/master/dm-aggregates
62
81
  licenses: []
63
82
 
64
83
  post_install_message:
65
84
  rdoc_options:
66
- - --main
67
- - README.rdoc
85
+ - --charset=UTF-8
68
86
  require_paths:
69
87
  - lib
70
88
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -85,6 +103,6 @@ rubyforge_project: datamapper
85
103
  rubygems_version: 1.3.5
86
104
  signing_key:
87
105
  specification_version: 3
88
- summary: DataMapper plugin providing support for aggregates, functions on collections and datasets
106
+ summary: DataMapper plugin providing support for aggregates on collections
89
107
  test_files: []
90
108
 
@@ -1,29 +0,0 @@
1
- === 0.10.1 / 2009-09-30
2
-
3
- * No changes this version
4
-
5
- === 0.10.0 / 2009-09-15
6
-
7
- * Updated to work with dm-core 0.10.0
8
-
9
- === 0.9.11 / 2009-03-29
10
-
11
- * No changes this version
12
-
13
- === 0.9.10 / 2009-01-19
14
-
15
- * No changes this version
16
-
17
- === 0.9.9 / 2009-01-04
18
-
19
- * 2 bug fixes:
20
-
21
- * Removed count optimization for Model#size
22
- * Removed count optimization for Collection#size
23
-
24
- === 0.9.8 / 2008-12-07
25
-
26
- * 2 minor enhancements:
27
-
28
- * Collection#size now uses #count if unloaded
29
- * Added Model#size, which defers to #count
@@ -1,22 +0,0 @@
1
- History.rdoc
2
- LICENSE
3
- Manifest.txt
4
- README.rdoc
5
- Rakefile
6
- TODO
7
- lib/dm-aggregates.rb
8
- lib/dm-aggregates/adapters/data_objects_adapter.rb
9
- lib/dm-aggregates/aggregate_functions.rb
10
- lib/dm-aggregates/collection.rb
11
- lib/dm-aggregates/core_ext/symbol.rb
12
- lib/dm-aggregates/model.rb
13
- lib/dm-aggregates/query.rb
14
- lib/dm-aggregates/repository.rb
15
- lib/dm-aggregates/version.rb
16
- spec/public/collection_spec.rb
17
- spec/public/model_spec.rb
18
- spec/public/shared/aggregate_shared_spec.rb
19
- spec/spec.opts
20
- spec/spec_helper.rb
21
- tasks/install.rb
22
- tasks/spec.rb
data/TODO DELETED
File without changes
@@ -1,5 +0,0 @@
1
- module DataMapper
2
- module Aggregates
3
- VERSION = '0.10.1'.freeze
4
- end
5
- end
@@ -1,13 +0,0 @@
1
- def sudo_gem(cmd)
2
- sh "#{SUDO} #{RUBY} -S gem #{cmd}", :verbose => false
3
- end
4
-
5
- desc "Install #{GEM_NAME} #{GEM_VERSION}"
6
- task :install => [ :package ] do
7
- sudo_gem "install pkg/#{GEM_NAME}-#{GEM_VERSION} --no-update-sources"
8
- end
9
-
10
- desc "Uninstall #{GEM_NAME} #{GEM_VERSION}"
11
- task :uninstall => [ :clobber ] do
12
- sudo_gem "uninstall #{GEM_NAME} -v#{GEM_VERSION} -Ix"
13
- end
@@ -1,25 +0,0 @@
1
- begin
2
- require 'spec/rake/spectask'
3
-
4
- task :default => [ :spec ]
5
-
6
- desc 'Run specifications'
7
- Spec::Rake::SpecTask.new(:spec) do |t|
8
- t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
9
- t.libs << 'lib' << 'spec' # needed for CI rake spec task, duplicated in spec_helper
10
-
11
- begin
12
- require 'rcov'
13
- t.rcov = JRUBY ? false : (ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true)
14
- t.rcov_opts << '--exclude' << 'spec'
15
- t.rcov_opts << '--text-summary'
16
- t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
17
- rescue LoadError
18
- # rcov not installed
19
- rescue SyntaxError
20
- # rcov syntax invalid
21
- end
22
- end
23
- rescue LoadError
24
- # rspec not installed
25
- end