assignable_values 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.ruby-version +1 -1
- data/.travis.yml +1 -0
- data/README.md +2 -0
- data/Rakefile +19 -7
- data/lib/assignable_values/version.rb +1 -1
- data/spec/rails-2.3/Gemfile +4 -1
- data/spec/rails-2.3/Gemfile.lock +2 -2
- data/spec/rails-3.0/Gemfile +1 -1
- data/spec/rails-3.0/Gemfile.lock +2 -2
- data/spec/rails-3.2/Gemfile +1 -1
- data/spec/rails-3.2/Gemfile.lock +2 -2
- data/spec/rails-4.1/.rspec +2 -0
- data/spec/rails-4.1/.ruby-version +1 -0
- data/spec/rails-4.1/Gemfile +16 -0
- data/spec/rails-4.1/Gemfile.lock +143 -0
- data/spec/rails-4.1/Rakefile +12 -0
- data/spec/rails-4.1/app_root/.gitignore +16 -0
- data/spec/rails-4.1/app_root/bin/bundle +3 -0
- data/spec/rails-4.1/app_root/bin/rails +8 -0
- data/spec/rails-4.1/app_root/bin/rake +8 -0
- data/spec/rails-4.1/app_root/bin/spring +18 -0
- data/spec/rails-4.1/app_root/config/application.rb +28 -0
- data/spec/rails-4.1/app_root/config/boot.rb +4 -0
- data/spec/rails-4.1/app_root/config/database.yml +4 -0
- data/spec/rails-4.1/app_root/config/environment.rb +5 -0
- data/spec/rails-4.1/app_root/config/environments/development.rb +37 -0
- data/spec/rails-4.1/app_root/config/environments/production.rb +83 -0
- data/spec/rails-4.1/app_root/config/environments/test.rb +39 -0
- data/spec/rails-4.1/app_root/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/rails-4.1/app_root/config/initializers/cookies_serializer.rb +3 -0
- data/spec/rails-4.1/app_root/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/rails-4.1/app_root/config/initializers/inflections.rb +16 -0
- data/spec/rails-4.1/app_root/config/initializers/mime_types.rb +4 -0
- data/spec/rails-4.1/app_root/config/initializers/session_store.rb +3 -0
- data/spec/rails-4.1/app_root/config/initializers/wrap_parameters.rb +14 -0
- data/spec/rails-4.1/app_root/config/routes.rb +3 -0
- data/spec/rails-4.1/app_root/config/secrets.yml +22 -0
- data/spec/rails-4.1/rcov.opts +2 -0
- data/spec/rails-4.1/spec/spec_helper.rb +25 -0
- data/spec/shared/app_root/config/database.yml +4 -0
- metadata +64 -7
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.9.3
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -5,6 +5,8 @@ assignable_values - Enums on vitamins [![Build Status](https://secure.travis-ci.
|
|
5
5
|
|
6
6
|
We carefully enhanced the core enum functionality with small tweaks that are useful for web forms, internationalized applications and common authorization patterns.
|
7
7
|
|
8
|
+
`assignable_values` is tested with Rails 2.3, 3.0, 3.2 and 4.1 on Ruby 1.8.7, 1.9.3 and 2.1.0.
|
9
|
+
|
8
10
|
|
9
11
|
Restricting scalar attributes
|
10
12
|
-----------------------------
|
data/Rakefile
CHANGED
@@ -8,11 +8,13 @@ task :default => 'all:spec'
|
|
8
8
|
namespace :travis do
|
9
9
|
|
10
10
|
desc 'Run tests on Travis CI'
|
11
|
-
task :run => [
|
11
|
+
task :run => [:compatible_rubygems, 'all:bundle:install', 'all:spec']
|
12
12
|
|
13
|
-
desc '
|
14
|
-
task :
|
15
|
-
|
13
|
+
desc 'Ensure compatible Rubygems version for Ruby 1.8'
|
14
|
+
task :compatible_rubygems do
|
15
|
+
if RUBY_VERSION == '1.8.7'
|
16
|
+
system "rvm rubygems latest-1.8 --force"
|
17
|
+
end
|
16
18
|
end
|
17
19
|
|
18
20
|
end
|
@@ -29,13 +31,16 @@ namespace :all do
|
|
29
31
|
fail "Tests failed" unless success
|
30
32
|
end
|
31
33
|
|
34
|
+
|
35
|
+
task :bundle => 'bundle:install'
|
36
|
+
|
32
37
|
namespace :bundle do
|
33
38
|
|
34
39
|
desc "Bundle all spec apps"
|
35
40
|
task :install do
|
36
41
|
for_each_directory_of('spec/**/Gemfile') do |directory|
|
37
42
|
Bundler.with_clean_env do
|
38
|
-
system("cd #{directory} && bundle install")
|
43
|
+
system("cd #{directory} && bundle install --without development")
|
39
44
|
end
|
40
45
|
end
|
41
46
|
end
|
@@ -56,7 +61,14 @@ end
|
|
56
61
|
def for_each_directory_of(path, &block)
|
57
62
|
Dir[path].sort.each do |rakefile|
|
58
63
|
directory = File.dirname(rakefile)
|
59
|
-
puts '', "\033[
|
60
|
-
|
64
|
+
puts '', "\033[4;34m# #{directory}\033[0m" # blue underline
|
65
|
+
|
66
|
+
if directory.include?('rails-2.3') and RUBY_VERSION != '1.8.7'
|
67
|
+
puts 'Skipping - Rails 2.3 requires Ruby 1.8.7'
|
68
|
+
elsif directory.include?('rails-4.1') and RUBY_VERSION == '1.8.7'
|
69
|
+
puts 'Skipping - Rails 4.1 does not support Ruby 1.8'
|
70
|
+
else
|
71
|
+
block.call(directory)
|
72
|
+
end
|
61
73
|
end
|
62
74
|
end
|
data/spec/rails-2.3/Gemfile
CHANGED
data/spec/rails-2.3/Gemfile.lock
CHANGED
data/spec/rails-3.0/Gemfile
CHANGED
data/spec/rails-3.0/Gemfile.lock
CHANGED
data/spec/rails-3.2/Gemfile
CHANGED
data/spec/rails-3.2/Gemfile.lock
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
2.1.0
|
@@ -0,0 +1,16 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gem 'sqlite3'
|
4
|
+
gem 'rails', '4.1.0'
|
5
|
+
gem 'minitest' # fix MiniTest deprecation warnings
|
6
|
+
gem 'rspec'
|
7
|
+
gem 'rspec-rails'
|
8
|
+
gem 'rspec_candy'
|
9
|
+
gem 'rspec-collection_matchers' # support for ...should have(n).errors_on ...
|
10
|
+
|
11
|
+
gem 'assignable_values', :path => '../..'
|
12
|
+
|
13
|
+
group :development do
|
14
|
+
gem 'debugger', platform: 'ruby_19'
|
15
|
+
gem 'ruby-debug', :platforms => :ruby_18
|
16
|
+
end
|
@@ -0,0 +1,143 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../..
|
3
|
+
specs:
|
4
|
+
assignable_values (0.10.0)
|
5
|
+
activerecord
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actionmailer (4.1.0)
|
11
|
+
actionpack (= 4.1.0)
|
12
|
+
actionview (= 4.1.0)
|
13
|
+
mail (~> 2.5.4)
|
14
|
+
actionpack (4.1.0)
|
15
|
+
actionview (= 4.1.0)
|
16
|
+
activesupport (= 4.1.0)
|
17
|
+
rack (~> 1.5.2)
|
18
|
+
rack-test (~> 0.6.2)
|
19
|
+
actionview (4.1.0)
|
20
|
+
activesupport (= 4.1.0)
|
21
|
+
builder (~> 3.1)
|
22
|
+
erubis (~> 2.7.0)
|
23
|
+
activemodel (4.1.0)
|
24
|
+
activesupport (= 4.1.0)
|
25
|
+
builder (~> 3.1)
|
26
|
+
activerecord (4.1.0)
|
27
|
+
activemodel (= 4.1.0)
|
28
|
+
activesupport (= 4.1.0)
|
29
|
+
arel (~> 5.0.0)
|
30
|
+
activesupport (4.1.0)
|
31
|
+
i18n (~> 0.6, >= 0.6.9)
|
32
|
+
json (~> 1.7, >= 1.7.7)
|
33
|
+
minitest (~> 5.1)
|
34
|
+
thread_safe (~> 0.1)
|
35
|
+
tzinfo (~> 1.1)
|
36
|
+
arel (5.0.1.20140414130214)
|
37
|
+
builder (3.2.2)
|
38
|
+
columnize (0.3.6)
|
39
|
+
debugger (1.6.3)
|
40
|
+
columnize (>= 0.3.1)
|
41
|
+
debugger-linecache (~> 1.2.0)
|
42
|
+
debugger-ruby_core_source (~> 1.2.4)
|
43
|
+
debugger-linecache (1.2.0)
|
44
|
+
debugger-ruby_core_source (1.2.4)
|
45
|
+
diff-lcs (1.2.5)
|
46
|
+
erubis (2.7.0)
|
47
|
+
hike (1.2.3)
|
48
|
+
i18n (0.6.9)
|
49
|
+
json (1.8.1)
|
50
|
+
linecache (0.46)
|
51
|
+
rbx-require-relative (> 0.0.4)
|
52
|
+
mail (2.5.4)
|
53
|
+
mime-types (~> 1.16)
|
54
|
+
treetop (~> 1.4.8)
|
55
|
+
mime-types (1.25.1)
|
56
|
+
minitest (5.3.4)
|
57
|
+
multi_json (1.10.1)
|
58
|
+
polyglot (0.3.5)
|
59
|
+
rack (1.5.2)
|
60
|
+
rack-test (0.6.2)
|
61
|
+
rack (>= 1.0)
|
62
|
+
rails (4.1.0)
|
63
|
+
actionmailer (= 4.1.0)
|
64
|
+
actionpack (= 4.1.0)
|
65
|
+
actionview (= 4.1.0)
|
66
|
+
activemodel (= 4.1.0)
|
67
|
+
activerecord (= 4.1.0)
|
68
|
+
activesupport (= 4.1.0)
|
69
|
+
bundler (>= 1.3.0, < 2.0)
|
70
|
+
railties (= 4.1.0)
|
71
|
+
sprockets-rails (~> 2.0)
|
72
|
+
railties (4.1.0)
|
73
|
+
actionpack (= 4.1.0)
|
74
|
+
activesupport (= 4.1.0)
|
75
|
+
rake (>= 0.8.7)
|
76
|
+
thor (>= 0.18.1, < 2.0)
|
77
|
+
rake (10.3.2)
|
78
|
+
rbx-require-relative (0.0.9)
|
79
|
+
rspec (3.0.0)
|
80
|
+
rspec-core (~> 3.0.0)
|
81
|
+
rspec-expectations (~> 3.0.0)
|
82
|
+
rspec-mocks (~> 3.0.0)
|
83
|
+
rspec-collection_matchers (1.0.0)
|
84
|
+
rspec-expectations (>= 2.99.0.beta1)
|
85
|
+
rspec-core (3.0.0)
|
86
|
+
rspec-support (~> 3.0.0)
|
87
|
+
rspec-expectations (3.0.0)
|
88
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
89
|
+
rspec-support (~> 3.0.0)
|
90
|
+
rspec-mocks (3.0.0)
|
91
|
+
rspec-support (~> 3.0.0)
|
92
|
+
rspec-rails (3.0.0)
|
93
|
+
actionpack (>= 3.0)
|
94
|
+
activesupport (>= 3.0)
|
95
|
+
railties (>= 3.0)
|
96
|
+
rspec-core (~> 3.0.0)
|
97
|
+
rspec-expectations (~> 3.0.0)
|
98
|
+
rspec-mocks (~> 3.0.0)
|
99
|
+
rspec-support (~> 3.0.0)
|
100
|
+
rspec-support (3.0.0)
|
101
|
+
rspec_candy (0.3.1)
|
102
|
+
rspec
|
103
|
+
sneaky-save
|
104
|
+
ruby-debug (0.10.4)
|
105
|
+
columnize (>= 0.1)
|
106
|
+
ruby-debug-base (~> 0.10.4.0)
|
107
|
+
ruby-debug-base (0.10.4)
|
108
|
+
linecache (>= 0.3)
|
109
|
+
sneaky-save (0.0.5)
|
110
|
+
activerecord (>= 3.2.0)
|
111
|
+
sprockets (2.11.0)
|
112
|
+
hike (~> 1.2)
|
113
|
+
multi_json (~> 1.0)
|
114
|
+
rack (~> 1.0)
|
115
|
+
tilt (~> 1.1, != 1.3.0)
|
116
|
+
sprockets-rails (2.1.3)
|
117
|
+
actionpack (>= 3.0)
|
118
|
+
activesupport (>= 3.0)
|
119
|
+
sprockets (~> 2.8)
|
120
|
+
sqlite3 (1.3.9)
|
121
|
+
thor (0.19.1)
|
122
|
+
thread_safe (0.3.4)
|
123
|
+
tilt (1.4.1)
|
124
|
+
treetop (1.4.15)
|
125
|
+
polyglot
|
126
|
+
polyglot (>= 0.3.1)
|
127
|
+
tzinfo (1.2.1)
|
128
|
+
thread_safe (~> 0.1)
|
129
|
+
|
130
|
+
PLATFORMS
|
131
|
+
ruby
|
132
|
+
|
133
|
+
DEPENDENCIES
|
134
|
+
assignable_values!
|
135
|
+
debugger
|
136
|
+
minitest
|
137
|
+
rails (= 4.1.0)
|
138
|
+
rspec
|
139
|
+
rspec-collection_matchers
|
140
|
+
rspec-rails
|
141
|
+
rspec_candy
|
142
|
+
ruby-debug
|
143
|
+
sqlite3
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
|
4
|
+
desc 'Default: Run all specs for a specific rails version.'
|
5
|
+
task :default => :spec
|
6
|
+
|
7
|
+
desc "Run all specs for a specific rails version"
|
8
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
9
|
+
t.pattern = defined?(SPEC) ? SPEC : ['**/*_spec.rb', '../shared/**/*_spec.rb']
|
10
|
+
t.verbose = false
|
11
|
+
t.rspec_opts = '--backtrace'
|
12
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
|
2
|
+
#
|
3
|
+
# If you find yourself ignoring temporary files generated by your text editor
|
4
|
+
# or operating system, you probably want to add a global ignore instead:
|
5
|
+
# git config --global core.excludesfile '~/.gitignore_global'
|
6
|
+
|
7
|
+
# Ignore bundler config.
|
8
|
+
/.bundle
|
9
|
+
|
10
|
+
# Ignore the default SQLite database.
|
11
|
+
/db/*.sqlite3
|
12
|
+
/db/*.sqlite3-journal
|
13
|
+
|
14
|
+
# Ignore all logfiles and tempfiles.
|
15
|
+
/log/*.log
|
16
|
+
/tmp
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# This file loads spring without using Bundler, in order to be fast
|
4
|
+
# It gets overwritten when you run the `spring binstub` command
|
5
|
+
|
6
|
+
unless defined?(Spring)
|
7
|
+
require "rubygems"
|
8
|
+
require "bundler"
|
9
|
+
|
10
|
+
if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
|
11
|
+
ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
|
12
|
+
ENV["GEM_HOME"] = ""
|
13
|
+
Gem.paths = ENV
|
14
|
+
|
15
|
+
gem "spring", match[1]
|
16
|
+
require "spring/binstub"
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
# Require the gems listed in Gemfile, including any gems
|
6
|
+
# you've limited to :test, :development, or :production.
|
7
|
+
Bundler.require(*Rails.groups)
|
8
|
+
|
9
|
+
module SpecApp
|
10
|
+
class Application < Rails::Application
|
11
|
+
config.encoding = "utf-8"
|
12
|
+
|
13
|
+
config.cache_classes = true
|
14
|
+
config.whiny_nils = true
|
15
|
+
|
16
|
+
config.consider_all_requests_local = true
|
17
|
+
config.action_controller.perform_caching = false
|
18
|
+
config.action_controller.allow_forgery_protection = false
|
19
|
+
|
20
|
+
config.action_dispatch.show_exceptions = false
|
21
|
+
|
22
|
+
config.action_mailer.delivery_method = :test
|
23
|
+
|
24
|
+
config.active_support.deprecation = :stderr
|
25
|
+
|
26
|
+
config.root = File.expand_path('../..', __FILE__)
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
|
+
|
12
|
+
# Show full error reports and disable caching.
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Don't care if the mailer can't send.
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
18
|
+
|
19
|
+
# Print deprecation notices to the Rails logger.
|
20
|
+
config.active_support.deprecation = :log
|
21
|
+
|
22
|
+
# Raise an error on page load if there are pending migrations.
|
23
|
+
config.active_record.migration_error = :page_load
|
24
|
+
|
25
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
26
|
+
# This option may cause significant delays in view rendering with a large
|
27
|
+
# number of complex assets.
|
28
|
+
config.assets.debug = true
|
29
|
+
|
30
|
+
# Adds additional error checking when serving assets at runtime.
|
31
|
+
# Checks for improperly declared sprockets dependencies.
|
32
|
+
# Raises helpful error messages.
|
33
|
+
config.assets.raise_runtime_errors = true
|
34
|
+
|
35
|
+
# Raises error for missing translations
|
36
|
+
# config.action_view.raise_on_missing_translations = true
|
37
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# Code is not reloaded between requests.
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Eager load code on boot. This eager loads most of Rails and
|
8
|
+
# your application in memory, allowing both threaded web servers
|
9
|
+
# and those relying on copy on write to perform better.
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
11
|
+
config.eager_load = true
|
12
|
+
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
14
|
+
config.consider_all_requests_local = false
|
15
|
+
config.action_controller.perform_caching = true
|
16
|
+
|
17
|
+
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
|
+
# Add `rack-cache` to your Gemfile before enabling this.
|
19
|
+
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
|
20
|
+
# config.action_dispatch.rack_cache = true
|
21
|
+
|
22
|
+
# Disable Rails's static asset server (Apache or nginx will already do this).
|
23
|
+
config.serve_static_assets = false
|
24
|
+
|
25
|
+
# Compress JavaScripts and CSS.
|
26
|
+
config.assets.js_compressor = :uglifier
|
27
|
+
# config.assets.css_compressor = :sass
|
28
|
+
|
29
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
30
|
+
config.assets.compile = false
|
31
|
+
|
32
|
+
# Generate digests for assets URLs.
|
33
|
+
config.assets.digest = true
|
34
|
+
|
35
|
+
# Version of your assets, change this if you want to expire all your assets.
|
36
|
+
config.assets.version = '1.0'
|
37
|
+
|
38
|
+
# Specifies the header that your server uses for sending files.
|
39
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
40
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
41
|
+
|
42
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
43
|
+
# config.force_ssl = true
|
44
|
+
|
45
|
+
# Set to :debug to see everything in the log.
|
46
|
+
config.log_level = :info
|
47
|
+
|
48
|
+
# Prepend all log lines with the following tags.
|
49
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
50
|
+
|
51
|
+
# Use a different logger for distributed setups.
|
52
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
53
|
+
|
54
|
+
# Use a different cache store in production.
|
55
|
+
# config.cache_store = :mem_cache_store
|
56
|
+
|
57
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
58
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
59
|
+
|
60
|
+
# Precompile additional assets.
|
61
|
+
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
62
|
+
# config.assets.precompile += %w( search.js )
|
63
|
+
|
64
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
65
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
66
|
+
# config.action_mailer.raise_delivery_errors = false
|
67
|
+
|
68
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
69
|
+
# the I18n.default_locale when a translation cannot be found).
|
70
|
+
config.i18n.fallbacks = true
|
71
|
+
|
72
|
+
# Send deprecation notices to registered listeners.
|
73
|
+
config.active_support.deprecation = :notify
|
74
|
+
|
75
|
+
# Disable automatic flushing of the log to improve performance.
|
76
|
+
# config.autoflush_log = false
|
77
|
+
|
78
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
79
|
+
config.log_formatter = ::Logger::Formatter.new
|
80
|
+
|
81
|
+
# Do not dump schema after migrations.
|
82
|
+
config.active_record.dump_schema_after_migration = false
|
83
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
10
|
+
# Do not eager load code on boot. This avoids loading your whole application
|
11
|
+
# just for the purpose of running a single test. If you are using a tool that
|
12
|
+
# preloads Rails for running tests, you may have to set it to true.
|
13
|
+
config.eager_load = false
|
14
|
+
|
15
|
+
# Configure static asset server for tests with Cache-Control for performance.
|
16
|
+
config.serve_static_assets = true
|
17
|
+
config.static_cache_control = 'public, max-age=3600'
|
18
|
+
|
19
|
+
# Show full error reports and disable caching.
|
20
|
+
config.consider_all_requests_local = true
|
21
|
+
config.action_controller.perform_caching = false
|
22
|
+
|
23
|
+
# Raise exceptions instead of rendering exception templates.
|
24
|
+
config.action_dispatch.show_exceptions = false
|
25
|
+
|
26
|
+
# Disable request forgery protection in test environment.
|
27
|
+
config.action_controller.allow_forgery_protection = false
|
28
|
+
|
29
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
30
|
+
# The :test delivery method accumulates sent emails in the
|
31
|
+
# ActionMailer::Base.deliveries array.
|
32
|
+
config.action_mailer.delivery_method = :test
|
33
|
+
|
34
|
+
# Print deprecation notices to the stderr.
|
35
|
+
config.active_support.deprecation = :stderr
|
36
|
+
|
37
|
+
# Raises error for missing translations
|
38
|
+
# config.action_view.raise_on_missing_translations = true
|
39
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
+
|
6
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
7
|
+
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format. Inflections
|
4
|
+
# are locale specific, and you may define rules for as many different
|
5
|
+
# locales as you wish. All of these examples are active by default:
|
6
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
7
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
8
|
+
# inflect.singular /^(ox)en/i, '\1'
|
9
|
+
# inflect.irregular 'person', 'people'
|
10
|
+
# inflect.uncountable %w( fish sheep )
|
11
|
+
# end
|
12
|
+
|
13
|
+
# These inflection rules are supported but not enabled by default:
|
14
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
15
|
+
# inflect.acronym 'RESTful'
|
16
|
+
# end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
9
|
+
end
|
10
|
+
|
11
|
+
# To enable root element in JSON for ActiveRecord objects.
|
12
|
+
# ActiveSupport.on_load(:active_record) do
|
13
|
+
# self.include_root_in_json = true
|
14
|
+
# end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
6
|
+
# Make sure the secret is at least 30 characters and all random,
|
7
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
8
|
+
# You can use `rake secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure the secrets in this file are kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
|
13
|
+
development:
|
14
|
+
secret_key_base: 7aa3418aec81500e8e336d984b9d438f602911ae48df0725543b9c72699a9fa84ce099b327d7db2b10f2655963f19139c9c4c86304b9342ccb9c7e389fc65b6e
|
15
|
+
|
16
|
+
test:
|
17
|
+
secret_key_base: 9eb558edf0b5fda539c566df1e3a5b699e7e16267167c797ce838d120a0d52c7c5672bada24457f0ed7b59786e360e2c27e9b9e021cbe98358dc72382cfcd50f
|
18
|
+
|
19
|
+
# Do not keep production secrets in the repository,
|
20
|
+
# instead read values from the environment.
|
21
|
+
production:
|
22
|
+
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
$: << File.join(File.dirname(__FILE__), "/../../lib" )
|
2
|
+
|
3
|
+
ENV['RAILS_ENV'] ||= 'test'
|
4
|
+
ENV['RAILS_ROOT'] = 'app_root'
|
5
|
+
|
6
|
+
# Load the Rails environment and testing framework
|
7
|
+
require "#{File.dirname(__FILE__)}/../app_root/config/environment"
|
8
|
+
require 'rspec/rails'
|
9
|
+
require 'rspec_candy/all'
|
10
|
+
|
11
|
+
# Run the migrations
|
12
|
+
print "\033[30m" # dark gray text
|
13
|
+
ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate")
|
14
|
+
print "\033[0m"
|
15
|
+
|
16
|
+
RSpec.configure do |config|
|
17
|
+
config.use_transactional_fixtures = false
|
18
|
+
config.use_instantiated_fixtures = false
|
19
|
+
config.mock_with :rspec do |c|
|
20
|
+
c.syntax = [:should, :expect]
|
21
|
+
end
|
22
|
+
config.expect_with :rspec do |c|
|
23
|
+
c.syntax = [:should, :expect]
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: assignable_values
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 55
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 10
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.10.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Henning Koch
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2014-
|
19
|
-
default_executable:
|
18
|
+
date: 2014-06-10 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: activerecord
|
@@ -174,18 +173,46 @@ files:
|
|
174
173
|
- spec/rails-3.2/app_root/script/rails
|
175
174
|
- spec/rails-3.2/rcov.opts
|
176
175
|
- spec/rails-3.2/spec/spec_helper.rb
|
176
|
+
- spec/rails-4.1/.rspec
|
177
|
+
- spec/rails-4.1/.ruby-version
|
178
|
+
- spec/rails-4.1/Gemfile
|
179
|
+
- spec/rails-4.1/Gemfile.lock
|
180
|
+
- spec/rails-4.1/Rakefile
|
181
|
+
- spec/rails-4.1/app_root/.gitignore
|
182
|
+
- spec/rails-4.1/app_root/bin/bundle
|
183
|
+
- spec/rails-4.1/app_root/bin/rails
|
184
|
+
- spec/rails-4.1/app_root/bin/rake
|
185
|
+
- spec/rails-4.1/app_root/bin/spring
|
186
|
+
- spec/rails-4.1/app_root/config/application.rb
|
187
|
+
- spec/rails-4.1/app_root/config/boot.rb
|
188
|
+
- spec/rails-4.1/app_root/config/database.yml
|
189
|
+
- spec/rails-4.1/app_root/config/environment.rb
|
190
|
+
- spec/rails-4.1/app_root/config/environments/development.rb
|
191
|
+
- spec/rails-4.1/app_root/config/environments/production.rb
|
192
|
+
- spec/rails-4.1/app_root/config/environments/test.rb
|
193
|
+
- spec/rails-4.1/app_root/config/initializers/backtrace_silencers.rb
|
194
|
+
- spec/rails-4.1/app_root/config/initializers/cookies_serializer.rb
|
195
|
+
- spec/rails-4.1/app_root/config/initializers/filter_parameter_logging.rb
|
196
|
+
- spec/rails-4.1/app_root/config/initializers/inflections.rb
|
197
|
+
- spec/rails-4.1/app_root/config/initializers/mime_types.rb
|
198
|
+
- spec/rails-4.1/app_root/config/initializers/session_store.rb
|
199
|
+
- spec/rails-4.1/app_root/config/initializers/wrap_parameters.rb
|
200
|
+
- spec/rails-4.1/app_root/config/routes.rb
|
201
|
+
- spec/rails-4.1/app_root/config/secrets.yml
|
202
|
+
- spec/rails-4.1/rcov.opts
|
203
|
+
- spec/rails-4.1/spec/spec_helper.rb
|
177
204
|
- spec/shared/app_root/app/controllers/application_controller.rb
|
178
205
|
- spec/shared/app_root/app/helpers/application_helper.rb
|
179
206
|
- spec/shared/app_root/app/models/artist.rb
|
180
207
|
- spec/shared/app_root/app/models/recording/vinyl.rb
|
181
208
|
- spec/shared/app_root/app/models/song.rb
|
209
|
+
- spec/shared/app_root/config/database.yml
|
182
210
|
- spec/shared/app_root/config/locales/en.yml
|
183
211
|
- spec/shared/app_root/db/migrate/001_create_artists.rb
|
184
212
|
- spec/shared/app_root/db/migrate/002_create_songs.rb
|
185
213
|
- spec/shared/app_root/db/migrate/003_create_recordings.rb
|
186
214
|
- spec/shared/assignable_values/active_record_spec.rb
|
187
215
|
- spec/shared/assignable_values/humanized_value_spec.rb
|
188
|
-
has_rdoc: true
|
189
216
|
homepage: https://github.com/makandra/assignable_values
|
190
217
|
licenses:
|
191
218
|
- MIT
|
@@ -215,7 +242,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
242
|
requirements: []
|
216
243
|
|
217
244
|
rubyforge_project:
|
218
|
-
rubygems_version: 1.
|
245
|
+
rubygems_version: 1.8.29
|
219
246
|
signing_key:
|
220
247
|
specification_version: 3
|
221
248
|
summary: Restrict the values assignable to ActiveRecord attributes or associations. Or enums on steroids.
|
@@ -277,14 +304,44 @@ test_files:
|
|
277
304
|
- spec/rails-3.2/app_root/script/rails
|
278
305
|
- spec/rails-3.2/rcov.opts
|
279
306
|
- spec/rails-3.2/spec/spec_helper.rb
|
307
|
+
- spec/rails-4.1/.rspec
|
308
|
+
- spec/rails-4.1/.ruby-version
|
309
|
+
- spec/rails-4.1/Gemfile
|
310
|
+
- spec/rails-4.1/Gemfile.lock
|
311
|
+
- spec/rails-4.1/Rakefile
|
312
|
+
- spec/rails-4.1/app_root/.gitignore
|
313
|
+
- spec/rails-4.1/app_root/bin/bundle
|
314
|
+
- spec/rails-4.1/app_root/bin/rails
|
315
|
+
- spec/rails-4.1/app_root/bin/rake
|
316
|
+
- spec/rails-4.1/app_root/bin/spring
|
317
|
+
- spec/rails-4.1/app_root/config/application.rb
|
318
|
+
- spec/rails-4.1/app_root/config/boot.rb
|
319
|
+
- spec/rails-4.1/app_root/config/database.yml
|
320
|
+
- spec/rails-4.1/app_root/config/environment.rb
|
321
|
+
- spec/rails-4.1/app_root/config/environments/development.rb
|
322
|
+
- spec/rails-4.1/app_root/config/environments/production.rb
|
323
|
+
- spec/rails-4.1/app_root/config/environments/test.rb
|
324
|
+
- spec/rails-4.1/app_root/config/initializers/backtrace_silencers.rb
|
325
|
+
- spec/rails-4.1/app_root/config/initializers/cookies_serializer.rb
|
326
|
+
- spec/rails-4.1/app_root/config/initializers/filter_parameter_logging.rb
|
327
|
+
- spec/rails-4.1/app_root/config/initializers/inflections.rb
|
328
|
+
- spec/rails-4.1/app_root/config/initializers/mime_types.rb
|
329
|
+
- spec/rails-4.1/app_root/config/initializers/session_store.rb
|
330
|
+
- spec/rails-4.1/app_root/config/initializers/wrap_parameters.rb
|
331
|
+
- spec/rails-4.1/app_root/config/routes.rb
|
332
|
+
- spec/rails-4.1/app_root/config/secrets.yml
|
333
|
+
- spec/rails-4.1/rcov.opts
|
334
|
+
- spec/rails-4.1/spec/spec_helper.rb
|
280
335
|
- spec/shared/app_root/app/controllers/application_controller.rb
|
281
336
|
- spec/shared/app_root/app/helpers/application_helper.rb
|
282
337
|
- spec/shared/app_root/app/models/artist.rb
|
283
338
|
- spec/shared/app_root/app/models/recording/vinyl.rb
|
284
339
|
- spec/shared/app_root/app/models/song.rb
|
340
|
+
- spec/shared/app_root/config/database.yml
|
285
341
|
- spec/shared/app_root/config/locales/en.yml
|
286
342
|
- spec/shared/app_root/db/migrate/001_create_artists.rb
|
287
343
|
- spec/shared/app_root/db/migrate/002_create_songs.rb
|
288
344
|
- spec/shared/app_root/db/migrate/003_create_recordings.rb
|
289
345
|
- spec/shared/assignable_values/active_record_spec.rb
|
290
346
|
- spec/shared/assignable_values/humanized_value_spec.rb
|
347
|
+
has_rdoc:
|