dm-is-select 0.0.9 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. data/.gitignore +36 -12
  2. data/Gemfile +23 -0
  3. data/Guardfile +13 -0
  4. data/{LICENSE → LICENSE.txt} +1 -1
  5. data/README.rdoc +32 -7
  6. data/Rakefile +33 -69
  7. data/VERSION +1 -1
  8. data/dm-is-select.gemspec +94 -44
  9. data/docs/apple-touch-icon.png +0 -0
  10. data/docs/classes/DataMapper.html +81 -0
  11. data/docs/classes/DataMapper/Is.html +81 -0
  12. data/docs/classes/DataMapper/Is/Select.html +205 -0
  13. data/docs/classes/DataMapper/Is/Select/ClassMethods.html +258 -0
  14. data/docs/created.rid +4 -0
  15. data/docs/css/github.css +129 -0
  16. data/docs/css/main.css +333 -0
  17. data/docs/css/panel.css +384 -0
  18. data/docs/css/reset.css +48 -0
  19. data/docs/favicon.ico +0 -0
  20. data/docs/files/README_rdoc.html +272 -0
  21. data/docs/files/lib/dm-is-select_rb.html +88 -0
  22. data/docs/files/lib/is/select_rb.html +94 -0
  23. data/docs/i/arrows.png +0 -0
  24. data/docs/i/results_bg.png +0 -0
  25. data/docs/i/tree_bg.png +0 -0
  26. data/docs/index.html +13 -0
  27. data/docs/js/highlight.pack.js +1 -0
  28. data/docs/js/jquery-1.3.2.min.js +19 -0
  29. data/docs/js/jquery-effect.js +593 -0
  30. data/docs/js/main.js +24 -0
  31. data/docs/js/navigation.js +142 -0
  32. data/docs/js/search_index.js +1 -0
  33. data/docs/js/searchdoc.js +449 -0
  34. data/docs/js/searcher.js +228 -0
  35. data/docs/panel/index.html +73 -0
  36. data/docs/panel/links.html +12 -0
  37. data/docs/panel/tree.js +1 -0
  38. data/lib/dm-is-select.rb +5 -11
  39. data/lib/{dm-is-select/is → is}/select.rb +12 -10
  40. data/spec/{integration/select_spec.rb → dm-is-select_spec.rb} +25 -13
  41. data/spec/spec_helper.rb +10 -8
  42. metadata +278 -94
  43. data/History.rdoc +0 -24
  44. data/TODO +0 -0
  45. data/lib/dm-is-select/is/version.rb +0 -7
data/.gitignore CHANGED
@@ -1,16 +1,40 @@
1
- ## OS STUFF
2
- .DS_Store
3
-
4
- ## TM SPECIFIC
5
- *.tmproj
6
- tmtags
7
-
8
- ## PROJECT::GENERAL
9
- *.sw?
10
- coverage
1
+ # rdoc generated
11
2
  rdoc
3
+
4
+ # jeweler generated
12
5
  pkg
13
- doc
14
6
 
15
- ## PROJECT::SPECIFIC
7
+ # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
8
+ #
9
+ # * Create a file at ~/.gitignore
10
+ # * Include files you want ignored
11
+ # * Run: git config --global core.excludesfile ~/.gitignore
12
+ #
13
+ # After doing this, these files will be ignored in all your git projects,
14
+ # saving you from having to 'pollute' every project you touch with them
15
+ #
16
+ # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
17
+ #
18
+ # For MacOS:
19
+ #
20
+ #.DS_Store
21
+
22
+ # For TextMate
23
+ #*.tmproj
24
+ #tmtags
25
+
26
+ # For emacs:
27
+ #*~
28
+ #\#*
29
+ #.\#*
30
+
31
+ # For vim:
32
+ #*.swp
33
+
34
+ # For redcar:
35
+ #.redcar
36
+
37
+ # For rubinius:
38
+ #*.rbc
16
39
 
40
+ /Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,23 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ gem 'activesupport', '~>3.2.7'
4
+ gem "data_mapper", '1.2.0'
5
+ gem 'dm-is-tree', '1.2.0'
6
+
7
+ # Add dependencies to develop your gem here.
8
+ # Include everything needed to run rake, tests, features, etc.
9
+ group :development do
10
+ gem "rspec", "~> 2.12.0"
11
+ gem "rdoc", "~> 3.12.2"
12
+ gem "sdoc", "~> 0.3.16"
13
+ gem "bundler", "~> 1.2.1"
14
+ gem "jeweler", "~> 1.8.4"
15
+
16
+ gem 'dm-mysql-adapter', '1.2.0'
17
+ gem 'dm-sqlite-adapter', '1.2.0'
18
+
19
+ gem 'growl'
20
+ gem 'rb-fsevent', '~> 0.9'
21
+ gem 'guard'
22
+ gem 'guard-rspec'
23
+ end
@@ -0,0 +1,13 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+
5
+ notification :growl
6
+
7
+ # guard 'rspec', :version => 2 do
8
+ guard 'rspec', :cli => "--color --format d " do
9
+ watch(%r{^spec/.+_spec\.rb$})
10
+ watch(%r{^lib/(.+)\.rb$}) { "spec" }
11
+ watch('spec/spec_helper.rb') { "spec" }
12
+
13
+ end
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 mats
1
+ Copyright (c) 2013 Kematzy
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
@@ -5,16 +5,22 @@ A DataMapper plugin that makes getting the <tt><select></tt> options from a Mode
5
5
 
6
6
  == Installation
7
7
 
8
- # Add Gemcutter to your RubyGems sources
9
- $ gem sources -a http://gemcutter.com
10
-
11
8
  $ gem install dm-is-select
12
9
 
10
+
11
+ Or add the gem to your Gemfile, and then run <tt>bundle install</tt>.
12
+
13
+ gem 'dm-is-select', 'CURRENT_VERSION_NUMBER'
14
+
15
+
13
16
  === Dependencies
14
17
 
15
18
  The plugin depends upon the following:
16
19
 
17
- * dm-core ( >= 1.0.0)
20
+ * dm-mysql-adapter OR dm-sqlite3-adapter ( >= 1.2.0)
21
+ * data_mapper ( >= 1.2.0)
22
+ * dm-is-tree ( >= 1.2.0)
23
+ * activesupport (>= 3.2.7) - methods => Hash#except and Hash#slice
18
24
 
19
25
 
20
26
  == Getting Started
@@ -148,7 +154,7 @@ OK, I admit it, not the most impressive DM plugin there is, but hey, it sure hel
148
154
 
149
155
  == RTFM
150
156
 
151
- For a better understanding of this gem/plugin, make sure you study the '<tt>dm-is-select/spec/integration/select_spec.rb</tt>' file.
157
+ For a better understanding of this gem/plugin, make sure you study the '<tt>dm-is-select/spec/dm-is-select_spec.rb</tt>' file.
152
158
 
153
159
 
154
160
  == Errors / Bugs
@@ -156,10 +162,29 @@ For a better understanding of this gem/plugin, make sure you study the '<tt>dm-i
156
162
  If something is not behaving intuitively, it is a bug, and should be reported.
157
163
  Report it here: http://github.com/kematzy/dm-is-select/issues
158
164
 
159
- == Credits
160
165
 
161
- Copyright (c) 2009-07-12 Kematzy [ kematzy gmail com ]
166
+ == Contributing to dm-is-select
167
+
168
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
169
+
170
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
171
+
172
+ * Fork the project.
173
+
174
+ * Start a feature/bugfix branch.
175
+
176
+ * Commit and push until you are happy with your contribution.
177
+
178
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
179
+
180
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
181
+
182
+
183
+ == Copyright
184
+
185
+ Copyright (c) 2009 - 2013 Kematzy.
162
186
 
163
187
  == Licence
164
188
 
165
189
  Released under the MIT license.
190
+
data/Rakefile CHANGED
@@ -1,65 +1,46 @@
1
1
  require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
2
10
  require 'rake'
3
11
 
4
- begin
5
- require 'jeweler'
6
-
7
- Jeweler::Tasks.new do |gem|
8
- gem.name = "dm-is-select"
9
- # gem.version = IO.read('VERSION')
10
- gem.summary = %Q{A DataMapper plugin that makes getting the <tt>select</tt> options from a Model easier.}
11
- gem.description = gem.summary
12
- gem.email = "kematzy@gmail.com"
13
- gem.homepage = "http://github.com/kematzy/dm-is-select"
14
- gem.authors = ["kematzy"]
15
- gem.extra_rdoc_files = %w[ README.rdoc LICENSE TODO History.rdoc ]
16
- gem.add_dependency 'dm-core', '~> 1.0.0'
17
- gem.add_development_dependency 'rspec', '~> 1.3'
18
- gem.add_development_dependency 'dm-migrations', '~> 1.0.0'
19
- gem.add_development_dependency 'dm-validations', '~> 1.0.0'
20
- end
21
-
22
- Jeweler::GemcutterTasks.new
23
-
24
- rescue LoadError
25
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
12
+ require 'jeweler'
13
+ Jeweler::Tasks.new do |gem|
14
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
15
+ gem.name = "dm-is-select"
16
+ gem.homepage = "http://github.com/kematzy/dm-is-select"
17
+ gem.license = "MIT"
18
+ gem.summary = %Q{A DataMapper plugin that makes getting the <tt>select</tt> options from a Model easier.}
19
+ gem.description = %Q{A DataMapper plugin that makes getting the <tt>select</tt> options from a Model easier.}
20
+ gem.email = "kematzy@gmail.com"
21
+ gem.authors = ["kematzy"]
22
+ gem.extra_rdoc_files = %w[ README.rdoc LICENSE TODO History.rdoc ]
23
+ gem.files = `git ls-files`.split($\)
24
+ # dependencies defined in Gemfile
26
25
  end
26
+ Jeweler::RubygemsDotOrgTasks.new
27
27
 
28
- require 'spec/rake/spectask'
29
- Spec::Rake::SpecTask.new(:spec) do |spec|
30
- spec.libs << 'lib' << 'spec'
31
- spec.spec_opts = ["--color", "--format", "nested", "--require", "spec/spec_helper.rb"]
32
- spec.spec_files = FileList['spec/**/*_spec.rb']
28
+ require 'rspec/core'
29
+ require 'rspec/core/rake_task'
30
+ RSpec::Core::RakeTask.new(:spec) do |spec|
31
+ spec.pattern = FileList['spec/**/*_spec.rb']
33
32
  end
34
33
 
35
- Spec::Rake::SpecTask.new(:rcov) do |spec|
36
- spec.libs << 'lib' << 'spec'
34
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
37
35
  spec.pattern = 'spec/**/*_spec.rb'
38
36
  spec.rcov = true
39
37
  end
40
38
 
41
- namespace :spec do
42
-
43
- desc "Run all specifications verbosely"
44
- Spec::Rake::SpecTask.new(:verbose) do |t|
45
- t.libs << "lib"
46
- t.spec_opts = ["--color", "--format", "specdoc", "--require", "spec/spec_helper.rb"]
47
- end
48
-
49
- desc "Run specific spec verbosely (SPEC=/path/2/file)"
50
- Spec::Rake::SpecTask.new(:select) do |t|
51
- t.libs << "lib"
52
- t.spec_files = [ENV["SPEC"]]
53
- t.spec_opts = ["--color", "--format", "specdoc", "--require", "spec/spec_helper.rb"]
54
- end
55
-
56
- end
57
-
58
39
  task :default => :spec
59
40
 
60
- require 'rake/rdoctask'
41
+ require 'rdoc/task'
61
42
  Rake::RDocTask.new do |rdoc|
62
- version = File.exist?('VERSION') ? IO.read('VERSION').chomp : "[Unknown]"
43
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
63
44
 
64
45
  rdoc.rdoc_dir = 'rdoc'
65
46
  rdoc.title = "dm-is-select #{version}"
@@ -67,29 +48,12 @@ Rake::RDocTask.new do |rdoc|
67
48
  rdoc.rdoc_files.include('lib/**/*.rb')
68
49
  end
69
50
 
70
-
71
-
72
- desc 'Build the rdoc HTML Files'
51
+ desc 'Build the *sdoc* HTML files'
73
52
  task :docs do
74
53
  version = File.exist?('VERSION') ? IO.read('VERSION').chomp : "[Unknown]"
75
54
 
76
- sh "sdoc -N --title 'DM::Is::Select v#{version}' lib/dm-is-select README.rdoc"
55
+ sh "sdoc -N --title 'DM::Is::Select v#{version}' --exclude spec --O '#{Dir.pwd}/docs' lib/ README.rdoc"
77
56
  end
78
57
 
79
- namespace :docs do
80
-
81
- desc 'Remove rdoc products'
82
- task :remove => [:clobber_rdoc] do
83
- sh "rm -rf doc"
84
- end
85
-
86
- desc 'Force a rebuild of the RDOC files'
87
- task :rebuild => [:docs]
88
-
89
- desc 'Build docs, and open in browser for viewing (specify BROWSER)'
90
- task :open => [:docs] do
91
- browser = ENV["BROWSER"] || "safari"
92
- sh "open -a #{browser} doc/index.html"
93
- end
94
-
95
- end
58
+ # encoding: utf-8
59
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.9
1
+ 1.2.0
@@ -1,68 +1,118 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
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
- s.name = %q{dm-is-select}
8
- s.version = "0.0.9"
7
+ s.name = "dm-is-select"
8
+ s.version = "1.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["kematzy"]
12
- s.date = %q{2010-06-09}
13
- s.description = %q{A DataMapper plugin that makes getting the <tt>select</tt> options from a Model easier.}
14
- s.email = %q{kematzy@gmail.com}
12
+ s.date = "2013-03-10"
13
+ s.description = "A DataMapper plugin that makes getting the <tt>select</tt> options from a Model easier."
14
+ s.email = "kematzy@gmail.com"
15
15
  s.extra_rdoc_files = [
16
- "History.rdoc",
17
- "LICENSE",
18
- "README.rdoc",
19
- "TODO"
16
+ "README.rdoc"
20
17
  ]
21
18
  s.files = [
22
19
  ".gitignore",
23
- "History.rdoc",
24
- "LICENSE",
25
- "README.rdoc",
26
- "Rakefile",
27
- "TODO",
28
- "VERSION",
29
- "dm-is-select.gemspec",
30
- "lib/dm-is-select.rb",
31
- "lib/dm-is-select/is/select.rb",
32
- "lib/dm-is-select/is/version.rb",
33
- "spec/integration/select_spec.rb",
34
- "spec/spec_helper.rb"
20
+ "Gemfile",
21
+ "Guardfile",
22
+ "LICENSE.txt",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "dm-is-select.gemspec",
27
+ "docs/apple-touch-icon.png",
28
+ "docs/classes/DataMapper.html",
29
+ "docs/classes/DataMapper/Is.html",
30
+ "docs/classes/DataMapper/Is/Select.html",
31
+ "docs/classes/DataMapper/Is/Select/ClassMethods.html",
32
+ "docs/created.rid",
33
+ "docs/css/github.css",
34
+ "docs/css/main.css",
35
+ "docs/css/panel.css",
36
+ "docs/css/reset.css",
37
+ "docs/favicon.ico",
38
+ "docs/files/README_rdoc.html",
39
+ "docs/files/lib/dm-is-select_rb.html",
40
+ "docs/files/lib/is/select_rb.html",
41
+ "docs/i/arrows.png",
42
+ "docs/i/results_bg.png",
43
+ "docs/i/tree_bg.png",
44
+ "docs/index.html",
45
+ "docs/js/highlight.pack.js",
46
+ "docs/js/jquery-1.3.2.min.js",
47
+ "docs/js/jquery-effect.js",
48
+ "docs/js/main.js",
49
+ "docs/js/navigation.js",
50
+ "docs/js/search_index.js",
51
+ "docs/js/searchdoc.js",
52
+ "docs/js/searcher.js",
53
+ "docs/panel/index.html",
54
+ "docs/panel/links.html",
55
+ "docs/panel/tree.js",
56
+ "lib/dm-is-select.rb",
57
+ "lib/is/select.rb",
58
+ "spec/dm-is-select_spec.rb",
59
+ "spec/spec_helper.rb"
35
60
  ]
36
- s.homepage = %q{http://github.com/kematzy/dm-is-select}
37
- s.rdoc_options = ["--charset=UTF-8"]
61
+ s.homepage = "http://github.com/kematzy/dm-is-select"
62
+ s.licenses = ["MIT"]
38
63
  s.require_paths = ["lib"]
39
- s.rubygems_version = %q{1.3.6}
40
- s.summary = %q{A DataMapper plugin that makes getting the <tt>select</tt> options from a Model easier.}
41
- s.test_files = [
42
- "spec/integration/select_spec.rb",
43
- "spec/spec_helper.rb"
44
- ]
64
+ s.rubygems_version = "1.8.23"
65
+ s.summary = "A DataMapper plugin that makes getting the <tt>select</tt> options from a Model easier."
45
66
 
46
67
  if s.respond_to? :specification_version then
47
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
48
68
  s.specification_version = 3
49
69
 
50
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
51
- s.add_runtime_dependency(%q<dm-core>, ["~> 1.0.0"])
52
- s.add_development_dependency(%q<rspec>, ["~> 1.3"])
53
- s.add_development_dependency(%q<dm-migrations>, ["~> 1.0.0"])
54
- s.add_development_dependency(%q<dm-validations>, ["~> 1.0.0"])
70
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
71
+ s.add_runtime_dependency(%q<activesupport>, ["~> 3.2.7"])
72
+ s.add_runtime_dependency(%q<data_mapper>, ["= 1.2.0"])
73
+ s.add_runtime_dependency(%q<dm-is-tree>, ["= 1.2.0"])
74
+ s.add_development_dependency(%q<rspec>, ["~> 2.12.0"])
75
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12.2"])
76
+ s.add_development_dependency(%q<sdoc>, ["~> 0.3.16"])
77
+ s.add_development_dependency(%q<bundler>, ["~> 1.2.1"])
78
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
79
+ s.add_development_dependency(%q<dm-mysql-adapter>, ["= 1.2.0"])
80
+ s.add_development_dependency(%q<dm-sqlite-adapter>, ["= 1.2.0"])
81
+ s.add_development_dependency(%q<growl>, [">= 0"])
82
+ s.add_development_dependency(%q<rb-fsevent>, ["~> 0.9"])
83
+ s.add_development_dependency(%q<guard>, [">= 0"])
84
+ s.add_development_dependency(%q<guard-rspec>, [">= 0"])
55
85
  else
56
- s.add_dependency(%q<dm-core>, ["~> 1.0.0"])
57
- s.add_dependency(%q<rspec>, ["~> 1.3"])
58
- s.add_dependency(%q<dm-migrations>, ["~> 1.0.0"])
59
- s.add_dependency(%q<dm-validations>, ["~> 1.0.0"])
86
+ s.add_dependency(%q<activesupport>, ["~> 3.2.7"])
87
+ s.add_dependency(%q<data_mapper>, ["= 1.2.0"])
88
+ s.add_dependency(%q<dm-is-tree>, ["= 1.2.0"])
89
+ s.add_dependency(%q<rspec>, ["~> 2.12.0"])
90
+ s.add_dependency(%q<rdoc>, ["~> 3.12.2"])
91
+ s.add_dependency(%q<sdoc>, ["~> 0.3.16"])
92
+ s.add_dependency(%q<bundler>, ["~> 1.2.1"])
93
+ s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
94
+ s.add_dependency(%q<dm-mysql-adapter>, ["= 1.2.0"])
95
+ s.add_dependency(%q<dm-sqlite-adapter>, ["= 1.2.0"])
96
+ s.add_dependency(%q<growl>, [">= 0"])
97
+ s.add_dependency(%q<rb-fsevent>, ["~> 0.9"])
98
+ s.add_dependency(%q<guard>, [">= 0"])
99
+ s.add_dependency(%q<guard-rspec>, [">= 0"])
60
100
  end
61
101
  else
62
- s.add_dependency(%q<dm-core>, ["~> 1.0.0"])
63
- s.add_dependency(%q<rspec>, ["~> 1.3"])
64
- s.add_dependency(%q<dm-migrations>, ["~> 1.0.0"])
65
- s.add_dependency(%q<dm-validations>, ["~> 1.0.0"])
102
+ s.add_dependency(%q<activesupport>, ["~> 3.2.7"])
103
+ s.add_dependency(%q<data_mapper>, ["= 1.2.0"])
104
+ s.add_dependency(%q<dm-is-tree>, ["= 1.2.0"])
105
+ s.add_dependency(%q<rspec>, ["~> 2.12.0"])
106
+ s.add_dependency(%q<rdoc>, ["~> 3.12.2"])
107
+ s.add_dependency(%q<sdoc>, ["~> 0.3.16"])
108
+ s.add_dependency(%q<bundler>, ["~> 1.2.1"])
109
+ s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
110
+ s.add_dependency(%q<dm-mysql-adapter>, ["= 1.2.0"])
111
+ s.add_dependency(%q<dm-sqlite-adapter>, ["= 1.2.0"])
112
+ s.add_dependency(%q<growl>, [">= 0"])
113
+ s.add_dependency(%q<rb-fsevent>, ["~> 0.9"])
114
+ s.add_dependency(%q<guard>, [">= 0"])
115
+ s.add_dependency(%q<guard-rspec>, [">= 0"])
66
116
  end
67
117
  end
68
118