dm-optlock 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -1
- data/Manifest.txt +6 -8
- data/README.rdoc +48 -0
- data/Rakefile +20 -3
- data/lib/dm-optlock.rb +21 -17
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/spec/dm-optlock_spec.rb +71 -0
- data/spec/spec.opts +1 -2
- data/spec/spec_helper.rb +12 -6
- data/tasks/rspec.rake +21 -0
- metadata +18 -19
- data/config/hoe.rb +0 -73
- data/config/requirements.rb +0 -15
- data/lib/dm-optlock/version.rb +0 -11
- data/setup.rb +0 -1585
- data/spec/integration/optlock_spec.rb +0 -35
- data/tasks/deployment.rake +0 -34
- data/tasks/environment.rake +0 -7
- data/tasks/spec.rake +0 -19
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'pathname'
|
2
|
-
require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
|
3
|
-
|
4
|
-
if HAS_SQLITE3 || HAS_MYSQL || HAS_POSTGRES
|
5
|
-
describe 'DataMapper::OptLock' do
|
6
|
-
before :all do
|
7
|
-
class Thing
|
8
|
-
include DataMapper::Resource
|
9
|
-
property :id, Integer, :serial => true
|
10
|
-
property :name, String
|
11
|
-
property :row_version, Integer, :default => 0
|
12
|
-
|
13
|
-
set_locking_column :row_version
|
14
|
-
|
15
|
-
auto_migrate!(:default)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
after do
|
20
|
-
repository(:default).adapter.execute('DELETE from things');
|
21
|
-
end
|
22
|
-
|
23
|
-
it "shouldn't save second" do
|
24
|
-
t = Thing.new(:name => 'Banana')
|
25
|
-
t.save
|
26
|
-
tA = Thing.first
|
27
|
-
tB = Thing.first
|
28
|
-
tA.name = 'Apple'
|
29
|
-
tB.name = 'Pineapple'
|
30
|
-
tA.save.should be_true
|
31
|
-
lambda { tB.save.should }.should raise_error(DataMapper::StaleObjectError)
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
end
|
data/tasks/deployment.rake
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
desc 'Release the website and new gem version'
|
2
|
-
task :deploy => [:check_version, :release] do
|
3
|
-
puts "Remember to create SVN tag:"
|
4
|
-
puts "svn copy svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/trunk " +
|
5
|
-
"svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
|
6
|
-
puts "Suggested comment:"
|
7
|
-
puts "Tagging release #{CHANGES}"
|
8
|
-
end
|
9
|
-
|
10
|
-
desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
|
11
|
-
task :local_deploy => [:install_gem]
|
12
|
-
|
13
|
-
task :check_version do
|
14
|
-
unless ENV['VERSION']
|
15
|
-
puts 'Must pass a VERSION=x.y.z release version'
|
16
|
-
exit
|
17
|
-
end
|
18
|
-
unless ENV['VERSION'] == VERS
|
19
|
-
puts "Please update your version.rb to match the release version, currently #{VERS}"
|
20
|
-
exit
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
desc 'Install the package as a gem, without generating documentation(ri/rdoc)'
|
25
|
-
task :install_gem_no_doc => [:clean, :package] do
|
26
|
-
sh "#{'sudo ' unless Hoe::WINDOZE }gem install pkg/*.gem --no-rdoc --no-ri"
|
27
|
-
end
|
28
|
-
|
29
|
-
namespace :manifest do
|
30
|
-
desc 'Recreate Manifest.txt to include ALL files'
|
31
|
-
task :refresh do
|
32
|
-
`rake check_manifest | patch -p0 > Manifest.txt`
|
33
|
-
end
|
34
|
-
end
|
data/tasks/environment.rake
DELETED
data/tasks/spec.rake
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'spec'
|
3
|
-
require 'spec/rake/spectask'
|
4
|
-
require 'pathname'
|
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.spec_files = Pathname.glob(Pathname.new(__FILE__).dirname + '../spec/**/*_spec.rb')
|
10
|
-
|
11
|
-
begin
|
12
|
-
t.rcov = ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true
|
13
|
-
t.rcov_opts << '--exclude' << 'spec'
|
14
|
-
t.rcov_opts << '--text-summary'
|
15
|
-
t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
|
16
|
-
rescue Exception
|
17
|
-
# rcov not installed
|
18
|
-
end
|
19
|
-
end
|