Skip to content

Commit 2efa537

Browse files
committed
ruby 2.1.2 and no rails 3.0.
1 parent 28dfeb9 commit 2efa537

File tree

11 files changed

+25
-52
lines changed

11 files changed

+25
-52
lines changed

.travis.yml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,15 @@
11
language: ruby
22
rvm:
3-
- 2.0.0
3+
- 2.1.2
44
- 1.9.3
5-
# - jruby-19mode
6-
# - rbx-19mode
75

86
gemfile:
97
- ci/Gemfile.rails-4.1.x
108
- ci/Gemfile.rails-4.0.x
119
- ci/Gemfile.rails-3.2.x
12-
- ci/Gemfile.rails-3.1.x
1310

1411
env:
1512
- DB=sqlite
1613
- DB=mysql
1714
- DB=postgresql
1815
script: WITH_ADVISORY_LOCK_PREFIX=$TRAVIS_JOB_ID bundle exec rake --trace all_spec_flavors
19-
20-
matrix:
21-
exclude:
22-
- rvm: 2.0.0
23-
gemfile: ci/Gemfile.rails-3.1.x
24-
env: DB=sqlite
25-
- rvm: 2.0.0
26-
gemfile: ci/Gemfile.rails-3.1.x
27-
env: DB=mysql
28-
- rvm: 2.0.0
29-
gemfile: ci/Gemfile.rails-3.1.x
30-
env: DB=postgresql
31-
- rvm: 2.0.0
32-
gemfile: ci/Gemfile.rails-3.2.x
33-
env: DB=sqlite
34-
- rvm: 2.0.0
35-
gemfile: ci/Gemfile.rails-3.2.x
36-
env: DB=mysql
37-
- rvm: 2.0.0
38-
gemfile: ci/Gemfile.rails-3.2.x
39-
env: DB=postgresql

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
### 4.5.0
4+
5+
* Added Travis builds for Rails 4.1.1 and Ruby 2.1.2
6+
* Dropped support for Rails 3.1.
7+
* [PR94]
8+
39
### 4.4.0
410

511
* Added ```.self_and_descendant_ids``` and ```.self_and_ancestors_ids``` from [PR92](https://github.com/mceachen/closure_tree/pull/92).

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,10 @@ database with multiple threads, and don't provide an alternative mutex.
437437

438438
## FAQ
439439

440+
### Does this work well with ```#default_scope```?
441+
442+
No. Please see [issue 86](https://github.com/mceachen/closure_tree/issues/86) for details.
443+
440444
### Does this gem support multiple parents?
441445

442446
No. This gem's API is based on the assumption that each node has either 0 or 1 parent.
@@ -484,15 +488,13 @@ end
484488

485489
Closure tree is [tested under every valid combination](http://travis-ci.org/#!/mceachen/closure_tree) of
486490

487-
* Ruby 1.9.3 and Ruby 2.0.0
488-
* The latest Rails 3.1, 3.2, 4.0, and 4.1 branches, and
491+
* Ruby 1.9.3 and Ruby 2.1.2
492+
* The latest Rails 3.2, 4.0, and 4.1 branches, and
489493
* MySQL and PostgreSQL. SQLite works in a single-threaded environment.
490494

491495
Assuming you're using [rbenv](https://github.com/sstephenson/rbenv), you can use ```tests.sh``` to
492496
run the test matrix locally.
493497

494-
Parallelism is not tested with Rails 3.1.x due to this [known issue](https://github.com/rails/rails/issues/7538).
495-
496498
## Change log
497499

498500
See https://github.com/mceachen/closure_tree/blob/master/CHANGELOG.md

ci/Gemfile.rails-3.1.x

Lines changed: 0 additions & 6 deletions
This file was deleted.

closure_tree.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ Gem::Specification.new do |gem|
2323
gem.add_development_dependency 'rspec'
2424
gem.add_development_dependency 'rspec-instafail'
2525
# gem.add_development_dependency 'rspec', '~> 2.13.0' # <- Rubymine can't handle 2.14.x
26-
gem.add_development_dependency 'fuubar'
2726
gem.add_development_dependency 'rspec-rails' # FIXME: for rspec-rails and rspec fixture support
2827
gem.add_development_dependency 'mysql2'
2928
gem.add_development_dependency 'pg'
3029
gem.add_development_dependency 'sqlite3'
3130
gem.add_development_dependency 'uuidtools'
3231
gem.add_development_dependency 'database_cleaner'
32+
gem.add_development_dependency 'foreigner'
3333

3434
# gem.add_development_dependency 'ruby-prof' # <- don't need this normally.
3535
# TODO: gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby

lib/closure_tree/support.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,7 @@ def remove_prefix_and_suffix(table_name)
103103
end
104104

105105
def ids_from(scope)
106-
if scope.respond_to? :pluck
107-
scope.pluck(model_class.primary_key)
108-
else
109-
scope.select(model_class.primary_key).map { |ea| ea._ct_id }
110-
end
106+
scope.pluck(model_class.primary_key)
111107
end
112108

113109
def with_advisory_lock(&block)

lib/closure_tree/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module ClosureTree
2-
VERSION = Gem::Version.new('4.4.0') unless defined?(::ClosureTree::VERSION)
2+
VERSION = Gem::Version.new('4.5.0') unless defined?(::ClosureTree::VERSION)
33
end

spec/parallel_prepend_sibling_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,4 @@ def run_workers
3939
Label.all.select { |ea| ea.root? }.should == [@target.parent]
4040
end
4141

42-
# SQLite doesn't like parallelism, and Rails 3.0 and 3.1 have known threading issues. SKIP.
43-
end if ((ENV["DB"] != "sqlite") && (ActiveRecord::VERSION::STRING =~ /^3.2/))
42+
end unless parallelism_is_broken

spec/parallel_spec.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
require 'spec_helper'
22

3-
parallelism_is_broken = begin
4-
# Rails < 3.2 has known bugs with parallelism
5-
(ActiveRecord::VERSION::MAJOR <= 3 && ActiveRecord::VERSION::MINOR < 2) ||
6-
# SQLite doesn't support parallel writes
7-
ENV["DB"] =~ /sqlite/
8-
end
93

104
class DbThread
115
def initialize(&block)

spec/spec_helper.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def recreate_db
4545
ActiveRecord::Base.connection.reconnect!
4646
end
4747

48-
ActiveRecord::Base.establish_connection(ENV["DB"])
48+
ActiveRecord::Base.establish_connection(ENV["DB"].to_sym)
4949

5050
ActiveRecord::Migration.verbose = false
5151
if ENV['NONUKES']
@@ -101,3 +101,9 @@ def log_with_query_append(query, *args, &block)
101101
FileUtils.remove_entry_secure ENV['FLOCK_DIR']
102102
end
103103
end
104+
105+
parallelism_is_broken = begin
106+
# SQLite doesn't support parallel writes
107+
ENV["DB"] =~ /sqlite/
108+
end
109+

0 commit comments

Comments
 (0)