locomotivecms_common 0.0.4 → 0.0.5
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +9 -4
- data/lib/locomotive/common/attr_extras_ext.rb +23 -0
- data/lib/locomotive/common/version.rb +1 -1
- data/lib/locomotive/common.rb +1 -0
- data/locomotivecms_common.gemspec +1 -0
- data/spec/unit/attr_extras_ext_spec.rb +26 -0
- metadata +19 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ee2309b329d268b3039bf97b745adef6cc7cafb
|
4
|
+
data.tar.gz: 295494b98c3d36067d498814967722673bab19d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6a73ca43bbd6c24dd878126ebc89416a6484d2f055fbfb507928eeae81d4bc1ce055694d84c054b544356cfc1b7630df00b0132c53576fac0b6b61b065e5dd0
|
7
|
+
data.tar.gz: 1a4c9f6913f25f0ba0a6417101ae4465403a8c345a09f9fe20dd231b42bd234d13dc0ea2c2d3fcb629d216b89df8deba97f2813213a41f42964a7c197164dd7f
|
data/Gemfile.lock
CHANGED
@@ -1,20 +1,22 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
locomotivecms_common (0.0.
|
4
|
+
locomotivecms_common (0.0.5)
|
5
5
|
activesupport (~> 4.2.1)
|
6
|
+
attr_extras (~> 4.4.0)
|
6
7
|
colorize
|
7
8
|
stringex (~> 2.5.2)
|
8
9
|
|
9
10
|
GEM
|
10
11
|
remote: https://rubygems.org/
|
11
12
|
specs:
|
12
|
-
activesupport (4.2.
|
13
|
+
activesupport (4.2.4)
|
13
14
|
i18n (~> 0.7)
|
14
15
|
json (~> 1.7, >= 1.7.7)
|
15
16
|
minitest (~> 5.1)
|
16
17
|
thread_safe (~> 0.3, >= 0.3.4)
|
17
18
|
tzinfo (~> 1.1)
|
19
|
+
attr_extras (4.4.0)
|
18
20
|
codeclimate-test-reporter (0.4.7)
|
19
21
|
simplecov (>= 0.7.1, < 1.0.0)
|
20
22
|
colorize (0.7.7)
|
@@ -31,9 +33,9 @@ GEM
|
|
31
33
|
http-cookie (1.0.2)
|
32
34
|
domain_name (~> 0.5)
|
33
35
|
i18n (0.7.0)
|
34
|
-
json (1.8.
|
36
|
+
json (1.8.3)
|
35
37
|
mime-types (2.4.3)
|
36
|
-
minitest (5.
|
38
|
+
minitest (5.8.0)
|
37
39
|
multi_json (1.11.0)
|
38
40
|
netrc (0.10.3)
|
39
41
|
rake (10.2.2)
|
@@ -81,3 +83,6 @@ DEPENDENCIES
|
|
81
83
|
locomotivecms_common!
|
82
84
|
rake (~> 10.1)
|
83
85
|
rspec (~> 3.2.0)
|
86
|
+
|
87
|
+
BUNDLED WITH
|
88
|
+
1.10.6
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'attr_extras'
|
2
|
+
|
3
|
+
# https://github.com/barsoom/attr_extras/issues/18
|
4
|
+
module AttrExtrasExt
|
5
|
+
|
6
|
+
def self.mixin
|
7
|
+
self::Mixin
|
8
|
+
end
|
9
|
+
|
10
|
+
module Mixin
|
11
|
+
|
12
|
+
def attr_accessor_initialize(*names, &block)
|
13
|
+
attr_initialize(*names, &block)
|
14
|
+
attr_accessor(*AttrExtras::Utils.flat_names(names))
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
class Module
|
22
|
+
include AttrExtrasExt.mixin
|
23
|
+
end
|
data/lib/locomotive/common.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe AttrExtrasExt do
|
4
|
+
|
5
|
+
subject { Person.new('Hank', 'Moody') }
|
6
|
+
|
7
|
+
describe 'reader' do
|
8
|
+
|
9
|
+
it { expect(subject.first_name).to eq 'Hank' }
|
10
|
+
it { expect(subject.last_name).to eq 'Moody' }
|
11
|
+
|
12
|
+
end
|
13
|
+
|
14
|
+
describe 'writer' do
|
15
|
+
|
16
|
+
before { subject.first_name = 'Karen' }
|
17
|
+
|
18
|
+
it { expect(subject.first_name).to eq 'Karen' }
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
class Person
|
24
|
+
attr_accessor_initialize :first_name, :last_name
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: locomotivecms_common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Didier Lafforgue
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-09-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -68,6 +68,20 @@ dependencies:
|
|
68
68
|
- - "~>"
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: 2.5.2
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: attr_extras
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - "~>"
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 4.4.0
|
78
|
+
type: :runtime
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - "~>"
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: 4.4.0
|
71
85
|
- !ruby/object:Gem::Dependency
|
72
86
|
name: colorize
|
73
87
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,6 +114,7 @@ files:
|
|
100
114
|
- README.md
|
101
115
|
- Rakefile
|
102
116
|
- lib/locomotive/common.rb
|
117
|
+
- lib/locomotive/common/attr_extras_ext.rb
|
103
118
|
- lib/locomotive/common/configuration.rb
|
104
119
|
- lib/locomotive/common/core_ext.rb
|
105
120
|
- lib/locomotive/common/core_ext/boolean/false.rb
|
@@ -115,6 +130,7 @@ files:
|
|
115
130
|
- locomotivecms_common.gemspec
|
116
131
|
- spec/locomotive/exception_spec.rb
|
117
132
|
- spec/spec_helper.rb
|
133
|
+
- spec/unit/attr_extras_ext_spec.rb
|
118
134
|
- spec/unit/core_ext/string_spec.rb
|
119
135
|
homepage: https://github.com/locomotivecms/common
|
120
136
|
licenses:
|
@@ -144,4 +160,5 @@ summary: The LocomotiveCMS Common is a shared libraries package for all Locomoti
|
|
144
160
|
test_files:
|
145
161
|
- spec/locomotive/exception_spec.rb
|
146
162
|
- spec/spec_helper.rb
|
163
|
+
- spec/unit/attr_extras_ext_spec.rb
|
147
164
|
- spec/unit/core_ext/string_spec.rb
|