light-decorator 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 247bcaa3a6bb0fe2bbe4f112e0422dcd5f294a21
4
- data.tar.gz: d501bf7b57e024db89623b2eb7ec7ecb52bc3e73
3
+ metadata.gz: 50ac1c83338c023bd392e1360547c9252b6da380
4
+ data.tar.gz: d303fb67ef0d9c301b35974f6cd02067058d24f6
5
5
  SHA512:
6
- metadata.gz: bbf95ea9db48bfc27651e8753ad2c0390ae2755cc6136ac27a04fd0d2156f7e54e4f1315c66e75aa9a3b002f20baf7d18c7322143f718f1c78d4352b3e451cb3
7
- data.tar.gz: f2468f0a450f5b6be3f0eeeec071a5c642e491903beeeea03f8eb6b7d0c805aa477b7ee8de28a8131c08d653586991611bbec590a7b52c87b60890d2c78a50dc
6
+ metadata.gz: c0232644c8a10474c4a4de5cf793bba8cfc302a31cb32a00ad9a83325a61f49a4cf925e5727e3378ef0bc9d3264339acbc12a1894ca495eca6f388662b2686de
7
+ data.tar.gz: 1aff70d56ed52a5dd54870c63102276e468e8726323234d8a4e04833e35a882f880994fa03787b53896d6742bb265b6b801759a8c89e6103a0175e5c613b40aa
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
  /.idea/
11
11
  /spec/internal/db/combustion_test.sqlite
12
12
  /*.gem
13
+ /.ruby-version
@@ -724,7 +724,7 @@ Style/LineEndConcatenation:
724
724
  line end.
725
725
  Enabled: true
726
726
 
727
- Style/MethodCallParentheses:
727
+ Style/MethodCallWithoutArgsParentheses:
728
728
  Description: 'Do not use parentheses for method calls with no arguments.'
729
729
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
730
730
  Enabled: true
@@ -2,7 +2,7 @@ sudo: false
2
2
  language: ruby
3
3
 
4
4
  rvm:
5
- - 2.3.0
5
+ - 2.3.3
6
6
 
7
7
  before_install: gem install bundler -v 1.12.5
8
8
 
data/README.md CHANGED
@@ -15,7 +15,7 @@ Decorator Pattern – What is it? Check it here:
15
15
  Add this line to your application's Gemfile:
16
16
 
17
17
  ```ruby
18
- gem 'light-decorator', '~> 1.0.0'
18
+ gem 'light-decorator', '~> 1.0.1'
19
19
  ```
20
20
 
21
21
  Create base class `ApplicationDecorator` in folder `app/decorators/application_decorator.rb`
@@ -31,7 +31,7 @@ We can manually create file:
31
31
 
32
32
  ```ruby
33
33
  # app/decorators/user_decorator.rb
34
- class UserDecorator < Application
34
+ class UserDecorator < ApplicationDecorator
35
35
  def full_name
36
36
  "#{object.first_name} #{object.last_name}"
37
37
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
- remote: ../
2
+ remote: ..
3
3
  specs:
4
- light-decorator (1.0.0)
4
+ light-decorator (1.0.1)
5
5
  rails (>= 4.0.0)
6
6
  request_store (>= 1.0.0)
7
7
 
@@ -63,7 +63,7 @@ GEM
63
63
  activesupport (>= 3.0.0)
64
64
  railties (>= 3.0.0)
65
65
  i18n (0.7.0)
66
- json (1.8.3)
66
+ json (1.8.6)
67
67
  mail (2.6.4)
68
68
  mime-types (>= 1.16, < 4)
69
69
  mime-types (3.1)
@@ -93,7 +93,7 @@ GEM
93
93
  rake (>= 0.8.7)
94
94
  thor (>= 0.18.1, < 2.0)
95
95
  rake (10.5.0)
96
- request_store (1.3.1)
96
+ request_store (1.3.2)
97
97
  rspec (3.4.0)
98
98
  rspec-core (~> 3.4.0)
99
99
  rspec-expectations (~> 3.4.0)
@@ -146,4 +146,4 @@ DEPENDENCIES
146
146
  sqlite3 (~> 1.3.11)
147
147
 
148
148
  BUNDLED WITH
149
- 1.12.5
149
+ 1.14.4
@@ -1,7 +1,7 @@
1
1
  PATH
2
- remote: ../
2
+ remote: ..
3
3
  specs:
4
- light-decorator (1.0.0)
4
+ light-decorator (1.0.1)
5
5
  rails (>= 4.0.0)
6
6
  request_store (>= 1.0.0)
7
7
 
@@ -65,7 +65,7 @@ GEM
65
65
  activesupport (>= 3.0.0)
66
66
  railties (>= 3.0.0)
67
67
  i18n (0.7.0)
68
- json (1.8.3)
68
+ json (1.8.6)
69
69
  mail (2.6.4)
70
70
  mime-types (>= 1.16, < 4)
71
71
  mime-types (3.1)
@@ -96,7 +96,7 @@ GEM
96
96
  rake (>= 0.8.7)
97
97
  thor (>= 0.18.1, < 2.0)
98
98
  rake (10.5.0)
99
- request_store (1.3.1)
99
+ request_store (1.3.2)
100
100
  rspec (3.4.0)
101
101
  rspec-core (~> 3.4.0)
102
102
  rspec-expectations (~> 3.4.0)
@@ -150,4 +150,4 @@ DEPENDENCIES
150
150
  sqlite3 (~> 1.3.11)
151
151
 
152
152
  BUNDLED WITH
153
- 1.12.5
153
+ 1.14.4
@@ -1,7 +1,7 @@
1
1
  PATH
2
- remote: ../
2
+ remote: ..
3
3
  specs:
4
- light-decorator (1.0.0)
4
+ light-decorator (1.0.1)
5
5
  rails (>= 4.0.0)
6
6
  request_store (>= 1.0.0)
7
7
 
@@ -76,7 +76,7 @@ GEM
76
76
  globalid (0.3.6)
77
77
  activesupport (>= 4.1.0)
78
78
  i18n (0.7.0)
79
- json (1.8.3)
79
+ json (1.8.6)
80
80
  loofah (2.0.3)
81
81
  nokogiri (>= 1.5.9)
82
82
  mail (2.6.4)
@@ -118,7 +118,7 @@ GEM
118
118
  rake (>= 0.8.7)
119
119
  thor (>= 0.18.1, < 2.0)
120
120
  rake (10.5.0)
121
- request_store (1.3.1)
121
+ request_store (1.3.2)
122
122
  rspec (3.4.0)
123
123
  rspec-core (~> 3.4.0)
124
124
  rspec-expectations (~> 3.4.0)
@@ -172,4 +172,4 @@ DEPENDENCIES
172
172
  sqlite3 (~> 1.3.11)
173
173
 
174
174
  BUNDLED WITH
175
- 1.12.5
175
+ 1.14.4
@@ -1,7 +1,7 @@
1
1
  PATH
2
- remote: ../
2
+ remote: ..
3
3
  specs:
4
- light-decorator (1.0.0)
4
+ light-decorator (1.0.1)
5
5
  rails (>= 4.0.0)
6
6
  request_store (>= 1.0.0)
7
7
 
@@ -78,7 +78,7 @@ GEM
78
78
  globalid (0.3.6)
79
79
  activesupport (>= 4.1.0)
80
80
  i18n (0.7.0)
81
- json (1.8.3)
81
+ json (1.8.6)
82
82
  loofah (2.0.3)
83
83
  nokogiri (>= 1.5.9)
84
84
  mail (2.6.4)
@@ -125,7 +125,7 @@ GEM
125
125
  rake (>= 0.8.7)
126
126
  thor (>= 0.18.1, < 2.0)
127
127
  rake (10.5.0)
128
- request_store (1.3.1)
128
+ request_store (1.3.2)
129
129
  rspec (3.4.0)
130
130
  rspec-core (~> 3.4.0)
131
131
  rspec-expectations (~> 3.4.0)
@@ -182,4 +182,4 @@ DEPENDENCIES
182
182
  sqlite3 (~> 1.3.11)
183
183
 
184
184
  BUNDLED WITH
185
- 1.12.5
185
+ 1.14.4
@@ -1,2 +1,10 @@
1
1
  class ApplicationDecorator < Light::Decorator::Base
2
+ # Use `object` or `o` to access object
3
+ # Use `helpers` or `h` to access helpers
4
+ #
5
+ # Example:
6
+ #
7
+ # def created_at
8
+ # h.content_tag :span, o.created_at.to_s(:long)
9
+ # end
2
10
  end
@@ -1,10 +1,2 @@
1
1
  class <%= class_name %>Decorator < ApplicationDecorator
2
- # Use `object` or `o` to access object
3
- # Use `helper` or `h` to access helpers
4
- #
5
- # Example:
6
- #
7
- # def created_at
8
- # h.content_tag :span, o.created_at.to_s(:long)
9
- # end
10
2
  end
@@ -41,6 +41,14 @@ module Light
41
41
  super || object.eql?(other)
42
42
  end
43
43
 
44
+ def is_a?(klass)
45
+ super || object.is_a?(klass)
46
+ end
47
+
48
+ def kind_of?(klass)
49
+ super || object.kind_of?(klass)
50
+ end
51
+
44
52
  class << self
45
53
  alias decorate new
46
54
  end
@@ -1,5 +1,5 @@
1
1
  module Light
2
2
  module Decorator
3
- VERSION = '1.0.0'.freeze
3
+ VERSION = '1.0.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: light-decorator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Emelianenko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-31 00:00:00.000000000 Z
11
+ date: 2017-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -217,6 +217,7 @@ files:
217
217
  - ".gitignore"
218
218
  - ".rspec"
219
219
  - ".rubocop.yml"
220
+ - ".ruby-version"
220
221
  - ".travis.yml"
221
222
  - Appraisals
222
223
  - CODE_OF_CONDUCT.md
@@ -274,9 +275,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
274
275
  version: '0'
275
276
  requirements: []
276
277
  rubyforge_project:
277
- rubygems_version: 2.6.3
278
+ rubygems_version: 2.6.10
278
279
  signing_key:
279
280
  specification_version: 4
280
281
  summary: Light pattern Decorator for Rails
281
282
  test_files: []
282
- has_rdoc: