code-box 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +1 -1
- data/README.md +6 -2
- data/lib/code-box/acts_as_code.rb +4 -4
- data/lib/code-box/version.rb +1 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -3,8 +3,7 @@
|
|
3
3
|
|
4
4
|
# Notes
|
5
5
|
|
6
|
-
|
7
|
-
If you re using ActiveRecord ~> 3.0 use the version ~> 0.5.0
|
6
|
+
Use version 1.0.0 in any case. Works for none activerecord codes, or activerecord codes 3.x and 4.x.
|
8
7
|
|
9
8
|
# CodeBox::CodeAttribute
|
10
9
|
|
@@ -305,6 +304,11 @@ Assuming we have an ActiveRecod code class with `code_attribute :code` we can de
|
|
305
304
|
|
306
305
|
## Changelog
|
307
306
|
|
307
|
+
### Version 1.0.0
|
308
|
+
* Whatever activerecord version you use - or not activerecord at all - simply use the gem version 1.0.0. There is
|
309
|
+
no dependency on activerecord anymore. You can use activerecord codes as described. TravisCI tests show proper working on activerecord 3.x and 4.x.
|
310
|
+
|
311
|
+
|
308
312
|
### Version 0.5.1
|
309
313
|
* Adding testing methods for codes objects. E.g. Code-Object with code 'my_code' get method `#codeObjectInstance.my_code?` defined.
|
310
314
|
* Method `.build_select_options` has been changed so you can pass in more flexible empty option configuration (see Readme).
|
@@ -212,12 +212,12 @@ module CodeBox
|
|
212
212
|
constants = {}
|
213
213
|
codes.each do |code|
|
214
214
|
constant_name = code.to_s.camelize
|
215
|
-
constant = codes_module.const_set(constant_name, code.to_s) unless codes_module.const_defined?(constant_name)
|
215
|
+
constant = codes_module.const_set(constant_name, code.to_s) unless codes_module.const_defined?(constant_name, false)
|
216
216
|
constants[constant_name] = constant
|
217
217
|
end
|
218
218
|
raise "Could not define all code constants. Only defined for #{constants.values.compact.inspect}" unless constants.values.compact.size == codes.size
|
219
219
|
|
220
|
-
if const_defined?('All')
|
220
|
+
if const_defined?('All', false)
|
221
221
|
raise "Could not define constant 'All' for all codes."
|
222
222
|
else
|
223
223
|
codes_module.const_set('All', constants.values.compact)
|
@@ -249,13 +249,13 @@ module CodeBox
|
|
249
249
|
constants = {}
|
250
250
|
codes.each do |code|
|
251
251
|
constant_name = "#{code.to_s.camelize}"
|
252
|
-
constant = const_set(constant_name, self.new(code.to_s)) unless const_defined?(constant_name)
|
252
|
+
constant = const_set(constant_name, self.new(code.to_s)) unless const_defined?(constant_name, false)
|
253
253
|
constants[constant_name] = constant
|
254
254
|
end
|
255
255
|
raise "Could not define all code instance constants. Only defined for #{constants.values.compact.inspect}" unless constants.values.compact.size == codes.size
|
256
256
|
|
257
257
|
constant_name = 'All'
|
258
|
-
if const_defined?(constant_name)
|
258
|
+
if const_defined?(constant_name, false)
|
259
259
|
raise "Could not define constant '#{const_name}' for all codes."
|
260
260
|
else
|
261
261
|
const_set(constant_name, constants.values.compact)
|
data/lib/code-box/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: code-box
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-09-
|
12
|
+
date: 2013-09-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|