gifted 0.1.0 → 1.1.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
  SHA256:
3
- metadata.gz: 2ece94319acfed183417eba523628e5114f26bcfd5c2a73d4bd0463c233147dd
4
- data.tar.gz: 5dbbab9578f5e6f0019757fe4d6edd70c202030f43f17db6d69bcf88d1470e84
3
+ metadata.gz: a6eb93513a2bde400a1f231c422421d382b9cd4b95405a904776e9cbd97a0ba9
4
+ data.tar.gz: 48bef09ee90ac0235c2c1f1dae1916ea61883547185c99eaa3b541d5d73ee1a9
5
5
  SHA512:
6
- metadata.gz: 770cdc16ca0bd4e9cd5a04e4eb22dcad4e2202a0b2da3373a8ac3764354931d7736cb984654afd8b3f74c2be4e09bcec537d1947209a7827a0eea298cc058abb
7
- data.tar.gz: 744873ea14f98a727f68fe9bdfffdaf4284615fab164c9781ead73bbe7c134855e9fc70be82e8cec9777afe5602cfd04731869673cdcf1edb50dc32194a5a87e
6
+ metadata.gz: 6fd47419d630d51cbfb144ce8a1789f840b589525c98d583206d75198afee38014711af28a17ee38630164fdeef3e2367c29ccee3c81b4d17a2e6fac22128e94
7
+ data.tar.gz: f309b165d5d21599099d5f2208ae60baed1da4c316a3417b865600205f6d48b1ebcbebd9d89a759c5b923bc703851ff1da4261652fa69e53903c855594aac190
data/.gitignore CHANGED
@@ -6,3 +6,5 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ **/*.log
10
+ .DS_Store
data/Gemfile.lock CHANGED
@@ -1,145 +1,164 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gifted (0.1.0)
4
+ gifted (1.1.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- actioncable (5.2.3)
10
- actionpack (= 5.2.3)
9
+ actioncable (6.1.3.1)
10
+ actionpack (= 6.1.3.1)
11
+ activesupport (= 6.1.3.1)
11
12
  nio4r (~> 2.0)
12
13
  websocket-driver (>= 0.6.1)
13
- actionmailer (5.2.3)
14
- actionpack (= 5.2.3)
15
- actionview (= 5.2.3)
16
- activejob (= 5.2.3)
14
+ actionmailbox (6.1.3.1)
15
+ actionpack (= 6.1.3.1)
16
+ activejob (= 6.1.3.1)
17
+ activerecord (= 6.1.3.1)
18
+ activestorage (= 6.1.3.1)
19
+ activesupport (= 6.1.3.1)
20
+ mail (>= 2.7.1)
21
+ actionmailer (6.1.3.1)
22
+ actionpack (= 6.1.3.1)
23
+ actionview (= 6.1.3.1)
24
+ activejob (= 6.1.3.1)
25
+ activesupport (= 6.1.3.1)
17
26
  mail (~> 2.5, >= 2.5.4)
18
27
  rails-dom-testing (~> 2.0)
19
- actionpack (5.2.3)
20
- actionview (= 5.2.3)
21
- activesupport (= 5.2.3)
22
- rack (~> 2.0)
28
+ actionpack (6.1.3.1)
29
+ actionview (= 6.1.3.1)
30
+ activesupport (= 6.1.3.1)
31
+ rack (~> 2.0, >= 2.0.9)
23
32
  rack-test (>= 0.6.3)
24
33
  rails-dom-testing (~> 2.0)
25
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
26
- actionview (5.2.3)
27
- activesupport (= 5.2.3)
34
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
35
+ actiontext (6.1.3.1)
36
+ actionpack (= 6.1.3.1)
37
+ activerecord (= 6.1.3.1)
38
+ activestorage (= 6.1.3.1)
39
+ activesupport (= 6.1.3.1)
40
+ nokogiri (>= 1.8.5)
41
+ actionview (6.1.3.1)
42
+ activesupport (= 6.1.3.1)
28
43
  builder (~> 3.1)
29
44
  erubi (~> 1.4)
30
45
  rails-dom-testing (~> 2.0)
31
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
32
- activejob (5.2.3)
33
- activesupport (= 5.2.3)
46
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
47
+ activejob (6.1.3.1)
48
+ activesupport (= 6.1.3.1)
34
49
  globalid (>= 0.3.6)
35
- activemodel (5.2.3)
36
- activesupport (= 5.2.3)
37
- activerecord (5.2.3)
38
- activemodel (= 5.2.3)
39
- activesupport (= 5.2.3)
40
- arel (>= 9.0)
41
- activestorage (5.2.3)
42
- actionpack (= 5.2.3)
43
- activerecord (= 5.2.3)
44
- marcel (~> 0.3.1)
45
- activesupport (5.2.3)
50
+ activemodel (6.1.3.1)
51
+ activesupport (= 6.1.3.1)
52
+ activerecord (6.1.3.1)
53
+ activemodel (= 6.1.3.1)
54
+ activesupport (= 6.1.3.1)
55
+ activestorage (6.1.3.1)
56
+ actionpack (= 6.1.3.1)
57
+ activejob (= 6.1.3.1)
58
+ activerecord (= 6.1.3.1)
59
+ activesupport (= 6.1.3.1)
60
+ marcel (~> 1.0.0)
61
+ mini_mime (~> 1.0.2)
62
+ activesupport (6.1.3.1)
46
63
  concurrent-ruby (~> 1.0, >= 1.0.2)
47
- i18n (>= 0.7, < 2)
48
- minitest (~> 5.1)
49
- tzinfo (~> 1.1)
50
- addressable (2.6.0)
51
- public_suffix (>= 2.0.2, < 4.0)
52
- arel (9.0.0)
53
- builder (3.2.3)
54
- byebug (11.0.1)
55
- capybara (3.24.0)
64
+ i18n (>= 1.6, < 2)
65
+ minitest (>= 5.1)
66
+ tzinfo (~> 2.0)
67
+ zeitwerk (~> 2.3)
68
+ addressable (2.7.0)
69
+ public_suffix (>= 2.0.2, < 5.0)
70
+ builder (3.2.4)
71
+ byebug (11.1.3)
72
+ capybara (3.35.3)
56
73
  addressable
57
74
  mini_mime (>= 0.1.3)
58
75
  nokogiri (~> 1.8)
59
76
  rack (>= 1.6.0)
60
77
  rack-test (>= 0.6.3)
61
- regexp_parser (~> 1.5)
78
+ regexp_parser (>= 1.5, < 3.0)
62
79
  xpath (~> 3.2)
63
- childprocess (1.0.1)
64
- rake (< 13.0)
65
- concurrent-ruby (1.1.5)
66
- crass (1.0.4)
67
- erubi (1.8.0)
80
+ childprocess (3.0.0)
81
+ concurrent-ruby (1.1.8)
82
+ crass (1.0.6)
83
+ erubi (1.10.0)
68
84
  globalid (0.4.2)
69
85
  activesupport (>= 4.2.0)
70
- i18n (1.6.0)
86
+ i18n (1.8.10)
71
87
  concurrent-ruby (~> 1.0)
72
- json (2.2.0)
73
- loofah (2.2.3)
88
+ json (2.5.1)
89
+ loofah (2.9.1)
74
90
  crass (~> 1.0.2)
75
91
  nokogiri (>= 1.5.9)
76
92
  mail (2.7.1)
77
93
  mini_mime (>= 0.1.1)
78
- marcel (0.3.3)
79
- mimemagic (~> 0.3.2)
80
- method_source (0.9.2)
81
- mimemagic (0.3.3)
82
- mini_mime (1.0.1)
83
- mini_portile2 (2.4.0)
84
- minitest (5.11.3)
85
- nio4r (2.3.1)
86
- nokogiri (1.10.3)
87
- mini_portile2 (~> 2.4.0)
88
- power_assert (1.1.4)
89
- public_suffix (3.1.0)
90
- puma (3.12.1)
91
- rack (2.0.7)
94
+ marcel (1.0.1)
95
+ method_source (1.0.0)
96
+ mini_mime (1.0.3)
97
+ mini_portile2 (2.5.0)
98
+ minitest (5.14.4)
99
+ nio4r (2.5.7)
100
+ nokogiri (1.11.3)
101
+ mini_portile2 (~> 2.5.0)
102
+ racc (~> 1.4)
103
+ power_assert (2.0.0)
104
+ public_suffix (4.0.6)
105
+ puma (5.2.2)
106
+ nio4r (~> 2.0)
107
+ racc (1.5.2)
108
+ rack (2.2.3)
92
109
  rack-test (1.1.0)
93
110
  rack (>= 1.0, < 3)
94
- rails (5.2.3)
95
- actioncable (= 5.2.3)
96
- actionmailer (= 5.2.3)
97
- actionpack (= 5.2.3)
98
- actionview (= 5.2.3)
99
- activejob (= 5.2.3)
100
- activemodel (= 5.2.3)
101
- activerecord (= 5.2.3)
102
- activestorage (= 5.2.3)
103
- activesupport (= 5.2.3)
104
- bundler (>= 1.3.0)
105
- railties (= 5.2.3)
111
+ rails (6.1.3.1)
112
+ actioncable (= 6.1.3.1)
113
+ actionmailbox (= 6.1.3.1)
114
+ actionmailer (= 6.1.3.1)
115
+ actionpack (= 6.1.3.1)
116
+ actiontext (= 6.1.3.1)
117
+ actionview (= 6.1.3.1)
118
+ activejob (= 6.1.3.1)
119
+ activemodel (= 6.1.3.1)
120
+ activerecord (= 6.1.3.1)
121
+ activestorage (= 6.1.3.1)
122
+ activesupport (= 6.1.3.1)
123
+ bundler (>= 1.15.0)
124
+ railties (= 6.1.3.1)
106
125
  sprockets-rails (>= 2.0.0)
107
126
  rails-dom-testing (2.0.3)
108
127
  activesupport (>= 4.2.0)
109
128
  nokogiri (>= 1.6)
110
- rails-html-sanitizer (1.0.4)
111
- loofah (~> 2.2, >= 2.2.2)
112
- railties (5.2.3)
113
- actionpack (= 5.2.3)
114
- activesupport (= 5.2.3)
129
+ rails-html-sanitizer (1.3.0)
130
+ loofah (~> 2.3)
131
+ railties (6.1.3.1)
132
+ actionpack (= 6.1.3.1)
133
+ activesupport (= 6.1.3.1)
115
134
  method_source
116
135
  rake (>= 0.8.7)
117
- thor (>= 0.19.0, < 2.0)
118
- rake (10.5.0)
119
- regexp_parser (1.5.1)
120
- rr (1.2.1)
121
- rubyzip (1.2.3)
122
- selenium-webdriver (3.142.3)
123
- childprocess (>= 0.5, < 2.0)
124
- rubyzip (~> 1.2, >= 1.2.2)
125
- sprockets (3.7.2)
136
+ thor (~> 1.0)
137
+ rake (13.0.3)
138
+ regexp_parser (2.1.1)
139
+ rr (3.0.0)
140
+ rubyzip (2.3.0)
141
+ selenium-webdriver (3.142.7)
142
+ childprocess (>= 0.5, < 4.0)
143
+ rubyzip (>= 1.2.2)
144
+ sprockets (4.0.2)
126
145
  concurrent-ruby (~> 1.0)
127
146
  rack (> 1, < 3)
128
- sprockets-rails (3.2.1)
147
+ sprockets-rails (3.2.2)
129
148
  actionpack (>= 4.0)
130
149
  activesupport (>= 4.0)
131
150
  sprockets (>= 3.0.0)
132
- sqlite3 (1.4.1)
133
- test-unit (3.3.3)
151
+ sqlite3 (1.4.2)
152
+ test-unit (3.4.0)
134
153
  power_assert
135
154
  test-unit-activesupport (1.0.9)
136
155
  activesupport
137
156
  test-unit
138
- test-unit-capybara (1.0.7)
157
+ test-unit-capybara (1.1.1)
139
158
  capybara (>= 2.1.0)
140
159
  json
141
160
  test-unit (>= 2.5.3)
142
- test-unit-rails (5.2.2)
161
+ test-unit-rails (6.1.0)
143
162
  rails (>= 5.1.2)
144
163
  test-unit (>= 3.1.7)
145
164
  test-unit-activesupport (>= 1.0.8)
@@ -148,15 +167,15 @@ GEM
148
167
  test-unit-rr (1.0.5)
149
168
  rr (>= 1.1.1)
150
169
  test-unit (>= 2.5.2)
151
- thor (0.20.3)
152
- thread_safe (0.3.6)
153
- tzinfo (1.2.5)
154
- thread_safe (~> 0.1)
155
- websocket-driver (0.7.1)
170
+ thor (1.1.0)
171
+ tzinfo (2.0.4)
172
+ concurrent-ruby (~> 1.0)
173
+ websocket-driver (0.7.3)
156
174
  websocket-extensions (>= 0.1.0)
157
- websocket-extensions (0.1.4)
175
+ websocket-extensions (0.1.5)
158
176
  xpath (3.2.0)
159
177
  nokogiri (~> 1.8)
178
+ zeitwerk (2.4.2)
160
179
 
161
180
  PLATFORMS
162
181
  ruby
@@ -173,4 +192,4 @@ DEPENDENCIES
173
192
  test-unit-rails
174
193
 
175
194
  BUNDLED WITH
176
- 2.0.1
195
+ 2.2.15
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Gifted
2
2
 
3
- Simple, yet powerful decorators for Ruby on Rails, inspired (and forked) from [ActiveDecorator](https://github.com/amatsuda/active_decorator). It has the following goals:
3
+ Simple, powerful, and explicit decorators for Ruby on Rails, inspired (and forked) from [ActiveDecorator](https://github.com/amatsuda/active_decorator). It has the following goals:
4
4
 
5
5
  1. Fast and efficient.
6
6
  2. Implicit decorators.
data/gifted.gemspec CHANGED
@@ -1,27 +1,28 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path("../lib", __FILE__)
3
+ lib = File.expand_path('lib', __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require "gifted/version"
5
+ require 'gifted/version'
6
6
 
7
7
  Gem::Specification.new do |spec|
8
- spec.name = "gifted"
8
+ spec.name = 'gifted'
9
9
  spec.version = Gifted::VERSION
10
- spec.authors = ["Joel Moss"]
11
- spec.email = ["joel@developwithstyle.com"]
10
+ spec.authors = ['Joel Moss']
11
+ spec.email = ['joel@developwithstyle.com']
12
12
 
13
- spec.summary = %q{Simple, yet Powerful Rails Decorators}
14
- spec.description = %q{Simple, yet Powerful Rails Decorators}
13
+ spec.summary = 'Simple, yet Powerful Rails Decorators'
14
+ spec.description = 'Simple, yet Powerful Rails Decorators'
15
15
  spec.homepage = 'https://github.com/joelmoss/gifted'
16
+ spec.license = 'MIT'
16
17
 
17
18
  # Specify which files should be added to the gem when it is released.
18
19
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
19
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
20
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
20
21
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
22
  end
22
- spec.bindir = "exe"
23
+ spec.bindir = 'exe'
23
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
- spec.require_paths = ["lib"]
25
+ spec.require_paths = ['lib']
25
26
 
26
27
  spec.add_development_dependency 'bundler', '~> 2.0'
27
28
  spec.add_development_dependency 'test-unit-rails'
data/lib/gifted/gift.rb CHANGED
@@ -21,7 +21,7 @@ module Gifted
21
21
 
22
22
  if view
23
23
  decorator = default_decorator.const_get("#{view.to_s.camelcase}Decorator")
24
- decorator.send :include, Gifted::ViewContext unless decorator.is_a?(Class)
24
+ decorator.send :include, Gifted::ViewHelpers unless decorator.is_a?(Class)
25
25
  end
26
26
 
27
27
  SimpleDelegator.new(self).extend decorator
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gifted
4
- VERSION = "0.1.0"
4
+ VERSION = "1.1.1"
5
5
  end
@@ -10,5 +10,9 @@ module Gifted
10
10
  def respond_to_missing?(method_name, *args)
11
11
  Gifted::ViewContext.current.respond_to?(method_name) || super
12
12
  end
13
+
14
+ def controller
15
+ @controller ||= Gifted::ViewContext.current.instance_variable_get(:@_controller)
16
+ end
13
17
  end
14
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gifted
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Moss
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-20 00:00:00.000000000 Z
11
+ date: 2021-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -129,7 +129,6 @@ executables: []
129
129
  extensions: []
130
130
  extra_rdoc_files: []
131
131
  files:
132
- - ".DS_Store"
133
132
  - ".gitignore"
134
133
  - ".travis.yml"
135
134
  - Gemfile
@@ -152,9 +151,10 @@ files:
152
151
  - lib/gifted/view_context.rb
153
152
  - lib/gifted/view_helpers.rb
154
153
  homepage: https://github.com/joelmoss/gifted
155
- licenses: []
154
+ licenses:
155
+ - MIT
156
156
  metadata: {}
157
- post_install_message:
157
+ post_install_message:
158
158
  rdoc_options: []
159
159
  require_paths:
160
160
  - lib
@@ -169,8 +169,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  - !ruby/object:Gem::Version
170
170
  version: '0'
171
171
  requirements: []
172
- rubygems_version: 3.0.3
173
- signing_key:
172
+ rubygems_version: 3.2.3
173
+ signing_key:
174
174
  specification_version: 4
175
175
  summary: Simple, yet Powerful Rails Decorators
176
176
  test_files: []
data/.DS_Store DELETED
Binary file