has_many_booleans 0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +74 -0
- data/Rakefile +46 -0
- data/install.rb +4 -0
- data/lib/has_many_booleans.rb +335 -0
- data/lib/has_many_booleans/simple_bitset.rb +64 -0
- data/rails/init.rb +1 -0
- data/test/database.yml +6 -0
- data/test/debug.log +710 -0
- data/test/has_many_booleans_plugin.sqlite3 +0 -0
- data/test/has_many_booleans_test.rb +396 -0
- data/test/schema.rb +36 -0
- data/test/simple_bitset_test.rb +22 -0
- data/test/test_helper.rb +43 -0
- data/uninstall.rb +1 -0
- metadata +75 -0
data/test/test_helper.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'active_support'
|
3
|
+
require 'active_support/test_case'
|
4
|
+
|
5
|
+
# # #
|
6
|
+
# setup test environment
|
7
|
+
#
|
8
|
+
ENV['RAILS_ENV'] = 'test'
|
9
|
+
ENV['RAILS_ROOT'] ||= File.dirname(__FILE__) + '/../../../..'
|
10
|
+
|
11
|
+
require 'test/unit'
|
12
|
+
require File.expand_path(File.join(ENV['RAILS_ROOT'], 'config/environment.rb'))
|
13
|
+
|
14
|
+
def load_schema
|
15
|
+
config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
|
16
|
+
ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log")
|
17
|
+
db_adapter ||= begin
|
18
|
+
require 'sqlite'
|
19
|
+
'sqlite'
|
20
|
+
rescue MissingSourceFile
|
21
|
+
begin
|
22
|
+
require 'sqlite3'
|
23
|
+
'sqlite3'
|
24
|
+
rescue MissingSourceFile
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
if !db_adapter
|
29
|
+
raise "No DB Adapter selected.Please install Sqlite or Sqlite3."
|
30
|
+
end
|
31
|
+
|
32
|
+
ActiveRecord::Base.establish_connection(config[db_adapter])
|
33
|
+
load(File.dirname(__FILE__) + "/schema.rb")
|
34
|
+
require File.dirname(__FILE__) + '/../rails/init.rb'
|
35
|
+
end
|
36
|
+
|
37
|
+
# # #
|
38
|
+
# helpers
|
39
|
+
#
|
40
|
+
def assert_not boolean, *msg
|
41
|
+
assert !boolean, *msg
|
42
|
+
end
|
43
|
+
|
data/uninstall.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Uninstall hook code here
|
metadata
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: has_many_booleans
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 9
|
8
|
+
version: "0.9"
|
9
|
+
platform: ruby
|
10
|
+
authors:
|
11
|
+
- Jan Lelis
|
12
|
+
autorequire:
|
13
|
+
bindir: bin
|
14
|
+
cert_chain: []
|
15
|
+
|
16
|
+
date: 2010-07-08 00:00:00 +02:00
|
17
|
+
default_executable:
|
18
|
+
dependencies: []
|
19
|
+
|
20
|
+
description:
|
21
|
+
email: mail@janlelis.de
|
22
|
+
executables: []
|
23
|
+
|
24
|
+
extensions: []
|
25
|
+
|
26
|
+
extra_rdoc_files:
|
27
|
+
- README.rdoc
|
28
|
+
files:
|
29
|
+
- MIT-LICENSE
|
30
|
+
- Rakefile
|
31
|
+
- README.rdoc
|
32
|
+
- install.rb
|
33
|
+
- uninstall.rb
|
34
|
+
- lib/has_many_booleans.rb
|
35
|
+
- lib/has_many_booleans/simple_bitset.rb
|
36
|
+
- rails/init.rb
|
37
|
+
- test/simple_bitset_test.rb
|
38
|
+
- test/debug.log
|
39
|
+
- test/test_helper.rb
|
40
|
+
- test/has_many_booleans_test.rb
|
41
|
+
- test/schema.rb
|
42
|
+
- test/has_many_booleans_plugin.sqlite3
|
43
|
+
- test/database.yml
|
44
|
+
has_rdoc: true
|
45
|
+
homepage: http://rbjl.net
|
46
|
+
licenses: []
|
47
|
+
|
48
|
+
post_install_message:
|
49
|
+
rdoc_options: []
|
50
|
+
|
51
|
+
require_paths:
|
52
|
+
- lib
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
segments:
|
58
|
+
- 0
|
59
|
+
version: "0"
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
segments:
|
65
|
+
- 0
|
66
|
+
version: "0"
|
67
|
+
requirements: []
|
68
|
+
|
69
|
+
rubyforge_project:
|
70
|
+
rubygems_version: 1.3.6
|
71
|
+
signing_key:
|
72
|
+
specification_version: 3
|
73
|
+
summary: This Rails plugin/gem allows you to generate virtual boolean attributes, which get saved in the database as a single bitset integer
|
74
|
+
test_files: []
|
75
|
+
|