dm-is-list 0.9.11 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +46 -0
- data/Manifest.txt +2 -2
- data/README.rdoc +220 -0
- data/Rakefile +2 -3
- data/lib/dm-is-list/is/list.rb +493 -78
- data/lib/dm-is-list/is/version.rb +1 -1
- data/lib/dm-is-list.rb +1 -9
- data/spec/integration/list_spec.rb +981 -140
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +11 -8
- data/tasks/install.rb +1 -1
- data/tasks/spec.rb +4 -4
- metadata +14 -31
- data/History.txt +0 -17
- data/README.txt +0 -57
data/spec/spec.opts
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,16 +1,19 @@
|
|
1
|
-
require 'pathname'
|
2
1
|
require 'rubygems'
|
3
2
|
|
4
|
-
|
5
|
-
|
3
|
+
# use local dm-core if running from a typical dev checkout.
|
4
|
+
lib = File.join('..', '..', 'dm-core', 'lib')
|
5
|
+
$LOAD_PATH.unshift(lib) if File.directory?(lib)
|
6
|
+
require 'dm-core'
|
6
7
|
|
7
|
-
|
8
|
+
# use local dm-adjust if running from a typical dev checkout.
|
9
|
+
lib = File.join('..', 'dm-adjust', 'lib')
|
10
|
+
$LOAD_PATH.unshift(lib) if File.directory?(lib)
|
11
|
+
require 'dm-adjust'
|
8
12
|
|
9
|
-
#
|
10
|
-
lib
|
11
|
-
$LOAD_PATH.unshift(lib) if lib.directory?
|
13
|
+
# Support running specs with 'rake spec' and 'spec'
|
14
|
+
$LOAD_PATH.unshift('lib') unless $LOAD_PATH.include?('lib')
|
12
15
|
|
13
|
-
require
|
16
|
+
require 'dm-is-list'
|
14
17
|
|
15
18
|
def load_driver(name, default_uri)
|
16
19
|
return false if ENV['ADAPTER'] != name.to_s
|
data/tasks/install.rb
CHANGED
@@ -4,7 +4,7 @@ end
|
|
4
4
|
|
5
5
|
desc "Install #{GEM_NAME} #{GEM_VERSION}"
|
6
6
|
task :install => [ :package ] do
|
7
|
-
sudo_gem "install
|
7
|
+
sudo_gem "install pkg/#{GEM_NAME}-#{GEM_VERSION} --no-update-sources"
|
8
8
|
end
|
9
9
|
|
10
10
|
desc "Uninstall #{GEM_NAME} #{GEM_VERSION}"
|
data/tasks/spec.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
begin
|
2
|
-
gem 'rspec', '~>1.2'
|
3
|
-
require 'spec'
|
4
2
|
require 'spec/rake/spectask'
|
5
3
|
|
6
4
|
task :default => [ :spec ]
|
@@ -8,16 +6,18 @@ begin
|
|
8
6
|
desc 'Run specifications'
|
9
7
|
Spec::Rake::SpecTask.new(:spec) do |t|
|
10
8
|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
|
11
|
-
t.
|
9
|
+
t.libs << 'lib' << 'spec' # needed for CI rake spec task, duplicated in spec_helper
|
12
10
|
|
13
11
|
begin
|
14
|
-
|
12
|
+
require 'rcov'
|
15
13
|
t.rcov = JRUBY ? false : (ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true)
|
16
14
|
t.rcov_opts << '--exclude' << 'spec'
|
17
15
|
t.rcov_opts << '--text-summary'
|
18
16
|
t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
|
19
17
|
rescue LoadError
|
20
18
|
# rcov not installed
|
19
|
+
rescue SyntaxError
|
20
|
+
# rcov syntax invalid
|
21
21
|
end
|
22
22
|
end
|
23
23
|
rescue LoadError
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-is-list
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sindre Aarsaether
|
@@ -9,29 +9,10 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-09-16 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
16
|
-
name: dm-core
|
17
|
-
type: :runtime
|
18
|
-
version_requirement:
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
20
|
-
requirements:
|
21
|
-
- - "="
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 0.9.11
|
24
|
-
version:
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: dm-adjust
|
27
|
-
type: :runtime
|
28
|
-
version_requirement:
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 0.9.11
|
34
|
-
version:
|
14
|
+
dependencies: []
|
15
|
+
|
35
16
|
description: DataMapper plugin for creating and organizing lists
|
36
17
|
email:
|
37
18
|
- sindre [a] identu [d] no
|
@@ -40,15 +21,15 @@ executables: []
|
|
40
21
|
extensions: []
|
41
22
|
|
42
23
|
extra_rdoc_files:
|
43
|
-
- README.
|
24
|
+
- README.rdoc
|
44
25
|
- LICENSE
|
45
26
|
- TODO
|
46
|
-
- History.
|
27
|
+
- History.rdoc
|
47
28
|
files:
|
48
|
-
- History.
|
29
|
+
- History.rdoc
|
49
30
|
- LICENSE
|
50
31
|
- Manifest.txt
|
51
|
-
- README.
|
32
|
+
- README.rdoc
|
52
33
|
- Rakefile
|
53
34
|
- TODO
|
54
35
|
- lib/dm-is-list.rb
|
@@ -60,11 +41,13 @@ files:
|
|
60
41
|
- tasks/install.rb
|
61
42
|
- tasks/spec.rb
|
62
43
|
has_rdoc: true
|
63
|
-
homepage: http://github.com/
|
44
|
+
homepage: http://github.com/datamapper/dm-more/tree/master/dm-is-list
|
45
|
+
licenses: []
|
46
|
+
|
64
47
|
post_install_message:
|
65
48
|
rdoc_options:
|
66
49
|
- --main
|
67
|
-
- README.
|
50
|
+
- README.rdoc
|
68
51
|
require_paths:
|
69
52
|
- lib
|
70
53
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -82,9 +65,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
65
|
requirements: []
|
83
66
|
|
84
67
|
rubyforge_project: datamapper
|
85
|
-
rubygems_version: 1.3.
|
68
|
+
rubygems_version: 1.3.5
|
86
69
|
signing_key:
|
87
|
-
specification_version:
|
70
|
+
specification_version: 3
|
88
71
|
summary: DataMapper plugin for creating and organizing lists
|
89
72
|
test_files: []
|
90
73
|
|
data/History.txt
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
=== 0.9.11 / 2009-03-29
|
2
|
-
|
3
|
-
* No changes this version
|
4
|
-
|
5
|
-
=== 0.9.10 / 2009-01-19
|
6
|
-
|
7
|
-
* No changes this version
|
8
|
-
|
9
|
-
=== 0.9.9 / 2009-01-04
|
10
|
-
|
11
|
-
* No changes this version
|
12
|
-
|
13
|
-
=== 0.9.8 / 2008-12-07
|
14
|
-
|
15
|
-
* 1 bug fix:
|
16
|
-
|
17
|
-
* Applied patch to fix bug with manual positioning [#672 state:resolved]
|
data/README.txt
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
= dm-is-list
|
2
|
-
|
3
|
-
DataMapper plugin for creating and organizing lists.
|
4
|
-
|
5
|
-
== Installation
|
6
|
-
|
7
|
-
Download dm-more and install dm-is-list. Remember to require it in your app.
|
8
|
-
|
9
|
-
== Getting started
|
10
|
-
|
11
|
-
Lets say we have a user-class, and we want to give users the possibility of
|
12
|
-
having their own todo-lists
|
13
|
-
|
14
|
-
class Todo
|
15
|
-
include DataMapper::Resource
|
16
|
-
|
17
|
-
property :id, Serial
|
18
|
-
property :title, String
|
19
|
-
property :done, DateTime
|
20
|
-
|
21
|
-
belongs_to :user
|
22
|
-
|
23
|
-
# here we define that this should be a list, scoped on :user_id
|
24
|
-
is :list, :scope => [:user_id]
|
25
|
-
end
|
26
|
-
|
27
|
-
You can now move objects around like this:
|
28
|
-
|
29
|
-
item = Todo.get(1)
|
30
|
-
other = Todo.get(2)
|
31
|
-
|
32
|
-
item.move(:highest) # moves to top of list
|
33
|
-
item.move(:lowest) # moves to bottom of list
|
34
|
-
item.move(:up) # moves one up (:higher and :up is the same)
|
35
|
-
item.move(:down) # moves one up (:lower and :down is the same)
|
36
|
-
item.move(:to => position) # moves item to a specific position
|
37
|
-
item.move(:above => other) # moves item above the other item.*
|
38
|
-
item.move(:below => other) # moves item above the other item.*
|
39
|
-
|
40
|
-
* won't move if the other item is in another scope. (should this be allowed?)
|
41
|
-
|
42
|
-
The list will try to act as intelligently as possible. If you set the position
|
43
|
-
manually, and then save, the list will reorganize itself to correctly:
|
44
|
-
|
45
|
-
item.position = 3 # setting position manually
|
46
|
-
item.save # the list will now move the item correctly, and updating others
|
47
|
-
|
48
|
-
If you move items between scopes, the list will also try to do what you most
|
49
|
-
likely want to do:
|
50
|
-
|
51
|
-
item.user_id # => 1
|
52
|
-
item.user_id = 2 # giving this item to another user
|
53
|
-
item.save # the list will now have detached item from old list, and inserted
|
54
|
-
# at the bottom of the new (user 2) list.
|
55
|
-
|
56
|
-
If something is not behaving intuitively, it is a bug, and should be reported.
|
57
|
-
Report it here: http://wm.lighthouseapp.com/projects/4819-datamapper/overview
|