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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71bb105eef9643197bcc74f6f6bd6bea76b31b00
4
- data.tar.gz: 2d6d904775a0a9a19ff369ac47d219604c887862
3
+ metadata.gz: 8ee2309b329d268b3039bf97b745adef6cc7cafb
4
+ data.tar.gz: 295494b98c3d36067d498814967722673bab19d2
5
5
  SHA512:
6
- metadata.gz: 9284e3c6f08e5d7fb8148beed61d29ad5f27e7a61ed0a5d8f9d8735fdfd33eade45c5042763755aae5f1a901835788d43e70010fd0c7c232095f394d8cc27a27
7
- data.tar.gz: 191f1e5a0edc09dc0d52770956a99b82f2173acba45001195f463a81028d922473b443c5ae43e67546ebb13a4cd620244cd973ec277b12e133d8a48cf43d443e
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)
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.1)
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.2)
36
+ json (1.8.3)
35
37
  mime-types (2.4.3)
36
- minitest (5.6.0)
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
@@ -1,5 +1,5 @@
1
1
  module Locomotive
2
2
  module Common
3
- VERSION = '0.0.4'
3
+ VERSION = '0.0.5'
4
4
  end
5
5
  end
@@ -1,5 +1,6 @@
1
1
  require_relative 'common/version'
2
2
  require_relative 'common/core_ext'
3
+ require_relative 'common/attr_extras_ext'
3
4
  require_relative 'common/logger'
4
5
  require_relative 'common/exception'
5
6
  require_relative 'common/notifier'
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_dependency 'activesupport', '~> 4.2.1'
23
23
  spec.add_dependency 'stringex', '~> 2.5.2'
24
+ spec.add_dependency 'attr_extras', '~> 4.4.0'
24
25
  spec.add_dependency 'colorize'
25
26
 
26
27
  spec.required_ruby_version = '~> 2.0'
@@ -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
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-05-04 00:00:00.000000000 Z
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