lite_enum 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/lib/lite_enum.rb +0 -9
- data/lite_enum.gemspec +1 -1
- metadata +3 -5
- data/lib/simple_form_monkeypatch.rb +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bcd529c0f7c18aad0a1f90399cc68ded2e34b81
|
4
|
+
data.tar.gz: 29d8f741a2df066869022507ce7ad6236154fd48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea0095ff156989b1a54a3ffd96b6f5289185c2672753cd2e609174d26c3f5554433b3980aee12db6711f5dfb8c051a64d54d3fe1db7776a2cd865e6c3b480fb3
|
7
|
+
data.tar.gz: 42609c2e84b59eb056bbe679356b3a5ea282181597bf3decc8611b022504b4283db4a16673301a0f90ea81db894f29df142d41ff6527e92362221dd504f43f03
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.1
|
1
|
+
2.3.1
|
data/lib/lite_enum.rb
CHANGED
@@ -52,12 +52,3 @@ class LiteEnum < SimpleDelegator
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
begin
|
56
|
-
require 'simple_form'
|
57
|
-
require 'simple_form/version'
|
58
|
-
rescue LoadError
|
59
|
-
end
|
60
|
-
|
61
|
-
if defined?(SimpleForm) && Gem::Version.new(SimpleForm::VERSION) >= Gem::Version.new('3.1.0')
|
62
|
-
require 'simple_form_monkeypatch'
|
63
|
-
end
|
data/lite_enum.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
# Describe your gem and declare its dependencies:
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = 'lite_enum'
|
6
|
-
s.version = '0.0
|
6
|
+
s.version = '0.1.0'
|
7
7
|
s.required_ruby_version = Gem::Requirement.new('>= 2.0.0')
|
8
8
|
s.authors = ['Adam Becker']
|
9
9
|
s.summary = 'Lightweight Enum class'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lite_enum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Becker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -50,7 +50,6 @@ files:
|
|
50
50
|
- Gemfile
|
51
51
|
- README.md
|
52
52
|
- lib/lite_enum.rb
|
53
|
-
- lib/simple_form_monkeypatch.rb
|
54
53
|
- lite_enum.gemspec
|
55
54
|
- script/release
|
56
55
|
- spec/lite_enum_spec.rb
|
@@ -74,10 +73,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
73
|
version: '0'
|
75
74
|
requirements: []
|
76
75
|
rubyforge_project:
|
77
|
-
rubygems_version: 2.
|
76
|
+
rubygems_version: 2.5.1
|
78
77
|
signing_key:
|
79
78
|
specification_version: 4
|
80
79
|
summary: Lightweight Enum class
|
81
80
|
test_files:
|
82
81
|
- spec/lite_enum_spec.rb
|
83
|
-
has_rdoc:
|
@@ -1,26 +0,0 @@
|
|
1
|
-
module SimpleForm
|
2
|
-
module Inputs
|
3
|
-
class CollectionInput
|
4
|
-
def collection_with_lite_enum
|
5
|
-
@collection ||= begin
|
6
|
-
if options[:collection] &&
|
7
|
-
options[:collection].is_a?(LiteEnum) &&
|
8
|
-
(translated = translate_from_namespace(:options))
|
9
|
-
|
10
|
-
options.delete(:collection).map do |k, v|
|
11
|
-
if translated[k].is_a?(Hash)
|
12
|
-
[translated[k][:short], v, translated[k][:long]]
|
13
|
-
else
|
14
|
-
[translated[k], v]
|
15
|
-
end
|
16
|
-
end
|
17
|
-
else
|
18
|
-
collection_without_lite_enum
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
alias_method_chain :collection, :lite_enum
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|