enum_column 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/.gitignore +4 -6
  2. data/Gemfile +4 -0
  3. data/Rakefile +2 -56
  4. data/enum_column.gemspec +13 -103
  5. data/lib/{enum → enum_column}/active_record_helper.rb +0 -0
  6. data/lib/{enum → enum_column}/enum_adapter.rb +0 -0
  7. data/lib/{enum → enum_column}/mysql_adapter.rb +0 -0
  8. data/lib/{enum → enum_column}/postgresql_adapter.rb +0 -0
  9. data/lib/{enum → enum_column}/quoting.rb +0 -0
  10. data/lib/{enum → enum_column}/schema_definitions.rb +0 -0
  11. data/lib/{enum → enum_column}/schema_statements.rb +0 -0
  12. data/lib/{enum → enum_column}/sqlite3_adapter.rb +0 -0
  13. data/lib/{enum → enum_column}/validations.rb +0 -0
  14. data/lib/enum_column/version.rb +3 -0
  15. data/lib/enum_column.rb +9 -9
  16. metadata +29 -93
  17. data/LICENSE +0 -20
  18. data/VERSION +0 -1
  19. data/readme +0 -18
  20. data/test/db/schema.rb +0 -28
  21. data/test/enum_mysql_test.rb +0 -220
  22. data/test/fixtures/db_definitions/mysql.drop.sql +0 -32
  23. data/test/fixtures/db_definitions/mysql.sql +0 -244
  24. data/test/fixtures/enumeration.rb +0 -20
  25. data/test/mock_app/.gitignore +0 -3
  26. data/test/mock_app/README +0 -243
  27. data/test/mock_app/Rakefile +0 -10
  28. data/test/mock_app/app/controllers/application_controller.rb +0 -10
  29. data/test/mock_app/app/controllers/contents_controller.rb +0 -85
  30. data/test/mock_app/app/models/content.rb +0 -2
  31. data/test/mock_app/config/boot.rb +0 -110
  32. data/test/mock_app/config/database.yml +0 -5
  33. data/test/mock_app/config/environment.rb +0 -41
  34. data/test/mock_app/config/environments/development.rb +0 -17
  35. data/test/mock_app/config/environments/production.rb +0 -28
  36. data/test/mock_app/config/environments/test.rb +0 -28
  37. data/test/mock_app/config/initializers/backtrace_silencers.rb +0 -7
  38. data/test/mock_app/config/initializers/inflections.rb +0 -10
  39. data/test/mock_app/config/initializers/mime_types.rb +0 -5
  40. data/test/mock_app/config/initializers/new_rails_defaults.rb +0 -19
  41. data/test/mock_app/config/initializers/session_store.rb +0 -15
  42. data/test/mock_app/config/locales/en.yml +0 -5
  43. data/test/mock_app/config/routes.rb +0 -45
  44. data/test/mock_app/config/sitemap.rb +0 -13
  45. data/test/mock_app/db/migrate/20090826121911_create_contents.rb +0 -12
  46. data/test/mock_app/db/schema.rb +0 -20
  47. data/test/mock_app/db/test.sqlite3 +0 -0
  48. data/test/mock_app/public/index.html +0 -275
  49. data/test/mock_app/script/console +0 -3
  50. data/test/test_helper.rb +0 -21
data/.gitignore CHANGED
@@ -1,6 +1,4 @@
1
- *.sw?
2
- .DS_Store
3
- coverage
4
- rdoc
5
- pkg
6
-
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in enum_column.gemspec
4
+ gemspec
data/Rakefile CHANGED
@@ -1,56 +1,2 @@
1
- require 'rubygems'
2
- require 'rake'
3
-
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "enum_column"
8
- gem.summary = %Q{Ruby on Rails Enumerated Column Constraints}
9
- gem.description = %Q{Ruby on Rails Enumerated Column Constraints}
10
- gem.email = "stephan.kaag@gmail.com"
11
- gem.homepage = "http://github.com/stephankaag/enum_column"
12
- gem.authors = ["Stephan Kaag"]
13
- gem.add_development_dependency "thoughtbot-shoulda"
14
- end
15
- Jeweler::GemcutterTasks.new
16
- rescue LoadError
17
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
18
- end
19
-
20
- require 'rake/testtask'
21
- Rake::TestTask.new(:test) do |test|
22
- test.libs << 'lib' << 'test'
23
- test.pattern = 'test/**/*_test.rb'
24
- test.verbose = true
25
- end
26
-
27
- begin
28
- require 'rcov/rcovtask'
29
- Rcov::RcovTask.new do |test|
30
- test.libs << 'test'
31
- test.pattern = 'test/**/*_test.rb'
32
- test.verbose = true
33
- end
34
- rescue LoadError
35
- task :rcov do
36
- abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
37
- end
38
- end
39
-
40
- task :test => :check_dependencies
41
-
42
- task :default => :test
43
-
44
- require 'rake/rdoctask'
45
- Rake::RDocTask.new do |rdoc|
46
- if File.exist?('VERSION')
47
- version = File.read('VERSION')
48
- else
49
- version = ""
50
- end
51
-
52
- rdoc.rdoc_dir = 'rdoc'
53
- rdoc.title = "enum_column #{version}"
54
- rdoc.rdoc_files.include('README*')
55
- rdoc.rdoc_files.include('lib/**/*.rb')
56
- end
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
data/enum_column.gemspec CHANGED
@@ -1,109 +1,19 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
1
  # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "enum_column/version"
5
4
 
6
5
  Gem::Specification.new do |s|
7
- s.name = %q{enum_column}
8
- s.version = "0.1.1"
6
+ s.name = "enum_column"
7
+ s.version = EnumColumn::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Stephan Kaag"]
10
+ s.email = ["stephan.kaag@holder.nl"]
11
+ s.homepage = ""
12
+ s.summary = "Ruby on Rails Enumerated Column Constraints"
13
+ s.description = "Ruby on Rails Enumerated Column Constraints. Rails 2 only at the moment."
9
14
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Stephan Kaag"]
12
- s.date = %q{2010-05-26}
13
- s.description = %q{Ruby on Rails Enumerated Column Constraints}
14
- s.email = %q{stephan.kaag@gmail.com}
15
- s.extra_rdoc_files = [
16
- "LICENSE"
17
- ]
18
- s.files = [
19
- ".gitignore",
20
- "LICENSE",
21
- "Rakefile",
22
- "VERSION",
23
- "enum_column.gemspec",
24
- "lib/enum/active_record_helper.rb",
25
- "lib/enum/enum_adapter.rb",
26
- "lib/enum/mysql_adapter.rb",
27
- "lib/enum/postgresql_adapter.rb",
28
- "lib/enum/quoting.rb",
29
- "lib/enum/schema_definitions.rb",
30
- "lib/enum/schema_statements.rb",
31
- "lib/enum/sqlite3_adapter.rb",
32
- "lib/enum/validations.rb",
33
- "lib/enum_column.rb",
34
- "readme",
35
- "test/db/schema.rb",
36
- "test/enum_mysql_test.rb",
37
- "test/fixtures/db_definitions/mysql.drop.sql",
38
- "test/fixtures/db_definitions/mysql.sql",
39
- "test/fixtures/enumeration.rb",
40
- "test/mock_app/.gitignore",
41
- "test/mock_app/README",
42
- "test/mock_app/Rakefile",
43
- "test/mock_app/app/controllers/application_controller.rb",
44
- "test/mock_app/app/controllers/contents_controller.rb",
45
- "test/mock_app/app/models/content.rb",
46
- "test/mock_app/config/boot.rb",
47
- "test/mock_app/config/database.yml",
48
- "test/mock_app/config/environment.rb",
49
- "test/mock_app/config/environments/development.rb",
50
- "test/mock_app/config/environments/production.rb",
51
- "test/mock_app/config/environments/test.rb",
52
- "test/mock_app/config/initializers/backtrace_silencers.rb",
53
- "test/mock_app/config/initializers/inflections.rb",
54
- "test/mock_app/config/initializers/mime_types.rb",
55
- "test/mock_app/config/initializers/new_rails_defaults.rb",
56
- "test/mock_app/config/initializers/session_store.rb",
57
- "test/mock_app/config/locales/en.yml",
58
- "test/mock_app/config/routes.rb",
59
- "test/mock_app/config/sitemap.rb",
60
- "test/mock_app/db/migrate/20090826121911_create_contents.rb",
61
- "test/mock_app/db/schema.rb",
62
- "test/mock_app/db/test.sqlite3",
63
- "test/mock_app/public/index.html",
64
- "test/mock_app/script/console",
65
- "test/test_helper.rb"
66
- ]
67
- s.homepage = %q{http://github.com/stephankaag/enum_column}
68
- s.rdoc_options = ["--charset=UTF-8"]
15
+ s.files = `git ls-files`.split("\n")
16
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
69
18
  s.require_paths = ["lib"]
70
- s.rubygems_version = %q{1.3.7}
71
- s.summary = %q{Ruby on Rails Enumerated Column Constraints}
72
- s.test_files = [
73
- "test/db/schema.rb",
74
- "test/enum_mysql_test.rb",
75
- "test/fixtures/enumeration.rb",
76
- "test/mock_app/app/controllers/application_controller.rb",
77
- "test/mock_app/app/controllers/contents_controller.rb",
78
- "test/mock_app/app/models/content.rb",
79
- "test/mock_app/config/boot.rb",
80
- "test/mock_app/config/environment.rb",
81
- "test/mock_app/config/environments/development.rb",
82
- "test/mock_app/config/environments/production.rb",
83
- "test/mock_app/config/environments/test.rb",
84
- "test/mock_app/config/initializers/backtrace_silencers.rb",
85
- "test/mock_app/config/initializers/inflections.rb",
86
- "test/mock_app/config/initializers/mime_types.rb",
87
- "test/mock_app/config/initializers/new_rails_defaults.rb",
88
- "test/mock_app/config/initializers/session_store.rb",
89
- "test/mock_app/config/routes.rb",
90
- "test/mock_app/config/sitemap.rb",
91
- "test/mock_app/db/migrate/20090826121911_create_contents.rb",
92
- "test/mock_app/db/schema.rb",
93
- "test/test_helper.rb"
94
- ]
95
-
96
- if s.respond_to? :specification_version then
97
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
98
- s.specification_version = 3
99
-
100
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
101
- s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
102
- else
103
- s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
104
- end
105
- else
106
- s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
107
- end
108
19
  end
109
-
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+ module EnumColumn
2
+ VERSION = "0.1.2"
3
+ end
data/lib/enum_column.rb CHANGED
@@ -1,9 +1,9 @@
1
- require 'enum/enum_adapter'
2
- require 'enum/mysql_adapter' if defined? ActiveRecord::ConnectionAdapters::MysqlAdapter
3
- require 'enum/postgresql_adapter' if defined? ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
4
- require 'enum/sqlite3_adapter' if defined? ActiveRecord::ConnectionAdapters::SQLite3Adapter
5
- require 'enum/schema_statements'
6
- require 'enum/schema_definitions'
7
- require 'enum/quoting'
8
- require 'enum/validations'
9
- require 'enum/active_record_helper'
1
+ require 'enum_column/enum_adapter'
2
+ require 'enum_column/mysql_adapter' if defined? ActiveRecord::ConnectionAdapters::MysqlAdapter
3
+ require 'enum_column/postgresql_adapter' if defined? ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
4
+ require 'enum_column/sqlite3_adapter' if defined? ActiveRecord::ConnectionAdapters::SQLite3Adapter
5
+ require 'enum_column/schema_statements'
6
+ require 'enum_column/schema_definitions'
7
+ require 'enum_column/quoting'
8
+ require 'enum_column/validations'
9
+ require 'enum_column/active_record_helper'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enum_column
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
5
- prerelease: false
4
+ hash: 31
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Stephan Kaag
@@ -15,86 +15,42 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-05-26 00:00:00 +02:00
18
+ date: 2011-03-03 00:00:00 +01:00
19
19
  default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: thoughtbot-shoulda
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
33
- type: :development
34
- version_requirements: *id001
35
- description: Ruby on Rails Enumerated Column Constraints
36
- email: stephan.kaag@gmail.com
20
+ dependencies: []
21
+
22
+ description: Ruby on Rails Enumerated Column Constraints. Rails 2 only at the moment.
23
+ email:
24
+ - stephan.kaag@holder.nl
37
25
  executables: []
38
26
 
39
27
  extensions: []
40
28
 
41
- extra_rdoc_files:
42
- - LICENSE
29
+ extra_rdoc_files: []
30
+
43
31
  files:
44
32
  - .gitignore
45
- - LICENSE
33
+ - Gemfile
46
34
  - Rakefile
47
- - VERSION
48
35
  - enum_column.gemspec
49
- - lib/enum/active_record_helper.rb
50
- - lib/enum/enum_adapter.rb
51
- - lib/enum/mysql_adapter.rb
52
- - lib/enum/postgresql_adapter.rb
53
- - lib/enum/quoting.rb
54
- - lib/enum/schema_definitions.rb
55
- - lib/enum/schema_statements.rb
56
- - lib/enum/sqlite3_adapter.rb
57
- - lib/enum/validations.rb
58
36
  - lib/enum_column.rb
59
- - readme
60
- - test/db/schema.rb
61
- - test/enum_mysql_test.rb
62
- - test/fixtures/db_definitions/mysql.drop.sql
63
- - test/fixtures/db_definitions/mysql.sql
64
- - test/fixtures/enumeration.rb
65
- - test/mock_app/.gitignore
66
- - test/mock_app/README
67
- - test/mock_app/Rakefile
68
- - test/mock_app/app/controllers/application_controller.rb
69
- - test/mock_app/app/controllers/contents_controller.rb
70
- - test/mock_app/app/models/content.rb
71
- - test/mock_app/config/boot.rb
72
- - test/mock_app/config/database.yml
73
- - test/mock_app/config/environment.rb
74
- - test/mock_app/config/environments/development.rb
75
- - test/mock_app/config/environments/production.rb
76
- - test/mock_app/config/environments/test.rb
77
- - test/mock_app/config/initializers/backtrace_silencers.rb
78
- - test/mock_app/config/initializers/inflections.rb
79
- - test/mock_app/config/initializers/mime_types.rb
80
- - test/mock_app/config/initializers/new_rails_defaults.rb
81
- - test/mock_app/config/initializers/session_store.rb
82
- - test/mock_app/config/locales/en.yml
83
- - test/mock_app/config/routes.rb
84
- - test/mock_app/config/sitemap.rb
85
- - test/mock_app/db/migrate/20090826121911_create_contents.rb
86
- - test/mock_app/db/schema.rb
87
- - test/mock_app/db/test.sqlite3
88
- - test/mock_app/public/index.html
89
- - test/mock_app/script/console
90
- - test/test_helper.rb
37
+ - lib/enum_column/active_record_helper.rb
38
+ - lib/enum_column/enum_adapter.rb
39
+ - lib/enum_column/mysql_adapter.rb
40
+ - lib/enum_column/postgresql_adapter.rb
41
+ - lib/enum_column/quoting.rb
42
+ - lib/enum_column/schema_definitions.rb
43
+ - lib/enum_column/schema_statements.rb
44
+ - lib/enum_column/sqlite3_adapter.rb
45
+ - lib/enum_column/validations.rb
46
+ - lib/enum_column/version.rb
91
47
  has_rdoc: true
92
- homepage: http://github.com/stephankaag/enum_column
48
+ homepage: ""
93
49
  licenses: []
94
50
 
95
51
  post_install_message:
96
- rdoc_options:
97
- - --charset=UTF-8
52
+ rdoc_options: []
53
+
98
54
  require_paths:
99
55
  - lib
100
56
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -118,29 +74,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
74
  requirements: []
119
75
 
120
76
  rubyforge_project:
121
- rubygems_version: 1.3.7
77
+ rubygems_version: 1.5.0
122
78
  signing_key:
123
79
  specification_version: 3
124
80
  summary: Ruby on Rails Enumerated Column Constraints
125
- test_files:
126
- - test/db/schema.rb
127
- - test/enum_mysql_test.rb
128
- - test/fixtures/enumeration.rb
129
- - test/mock_app/app/controllers/application_controller.rb
130
- - test/mock_app/app/controllers/contents_controller.rb
131
- - test/mock_app/app/models/content.rb
132
- - test/mock_app/config/boot.rb
133
- - test/mock_app/config/environment.rb
134
- - test/mock_app/config/environments/development.rb
135
- - test/mock_app/config/environments/production.rb
136
- - test/mock_app/config/environments/test.rb
137
- - test/mock_app/config/initializers/backtrace_silencers.rb
138
- - test/mock_app/config/initializers/inflections.rb
139
- - test/mock_app/config/initializers/mime_types.rb
140
- - test/mock_app/config/initializers/new_rails_defaults.rb
141
- - test/mock_app/config/initializers/session_store.rb
142
- - test/mock_app/config/routes.rb
143
- - test/mock_app/config/sitemap.rb
144
- - test/mock_app/db/migrate/20090826121911_create_contents.rb
145
- - test/mock_app/db/schema.rb
146
- - test/test_helper.rb
81
+ test_files: []
82
+
data/LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright (c) 2009 Stephan Kaag
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.1.1
data/readme DELETED
@@ -1,18 +0,0 @@
1
- = enum_column
2
-
3
- Gemified fork of http://github.com/adamsalter/enum_column-plugin
4
-
5
- == Note on Patches/Pull Requests
6
-
7
- * Fork the project.
8
- * Make your feature addition or bug fix.
9
- * Add tests for it. This is important so I don't break it in a
10
- future version unintentionally.
11
- * Commit, do not mess with rakefile, version, or history.
12
- (if you want to have your own version, that is fine but
13
- bump version in a commit by itself I can ignore when I pull)
14
- * Send me a pull request. Bonus points for topic branches.
15
-
16
- == Copyright
17
-
18
- Copyright (c) 2009 Stephan Kaag. See LICENSE for details.
data/test/db/schema.rb DELETED
@@ -1,28 +0,0 @@
1
-
2
- ActiveRecord::Schema.define do
3
- create_table :enumerations, :force => true do |t|
4
- t.column :severity, :enum, :limit => [:low, :medium, :high, :critical],
5
- :default => :medium
6
- t.column :color, :enum, :limit => [:red, :blue, :green, :yellow]
7
- t.column :string_field, :string, :limit => 8, :null => false
8
- t.column :int_field, :integer
9
- end
10
-
11
-
12
- create_table :basic_enums, :force => true do |t|
13
- t.column :value, :enum, :limit => [:good, :working]
14
- end
15
-
16
- create_table :basic_default_enums, :force => true do |t|
17
- t.column :value, :enum, :limit => [:good, :working],:default => :working
18
- end
19
-
20
- create_table :nonnull_enums, :force => true do |t|
21
- t.column :value, :enum, :limit => [:good, :working],:null => false
22
- end
23
-
24
- create_table :nonnull_default_enums, :force => true do |t|
25
- t.column :value, :enum, :limit => [:good, :working],:null => false,:default => :working
26
- end
27
-
28
- end