plastic_wrap 0.1.0 → 0.2.0
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/lib/plastic_wrap/cardboard_tube.rb +7 -13
- data/lib/plastic_wrap/helpers.rb +46 -0
- data/lib/plastic_wrap/version.rb +1 -1
- metadata +11 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6e7ce8eb2e68290c0bffc514c6f1cd15a4ef5272
|
|
4
|
+
data.tar.gz: 5bd99475a87c546ce92badb68298e793a41badd1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d5527c2cdd54d52471fc2a0a5c828ceb8b8a19297b849bcadf4605c8adeb20476993c14ce6bd6e635f454fba5a6092334042f9eb219334d608fec620f2f30d74
|
|
7
|
+
data.tar.gz: 8787695f7383e1af7b902b0a5730d8e26a56fc90b5c3dd5ec33c7394164667047f2ce3e8dd49fcb0b1e27be61921cfae67c1f3a7f5a4cc8980a6af659444f177
|
|
@@ -3,17 +3,11 @@ module PlasticWrap
|
|
|
3
3
|
extend ActiveSupport::Concern
|
|
4
4
|
|
|
5
5
|
included do
|
|
6
|
-
include
|
|
7
|
-
include Rails.application.routes.url_helpers
|
|
8
|
-
if Rails::VERSION::MAJOR >= 4
|
|
9
|
-
include Sprockets::Rails::Helper
|
|
10
|
-
else
|
|
11
|
-
include Sprockets::Helpers::RailsHelper
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
attr_accessor :options, :output_buffer
|
|
6
|
+
include Helpers
|
|
15
7
|
end
|
|
16
8
|
|
|
9
|
+
attr_accessor :options
|
|
10
|
+
|
|
17
11
|
def initialize(wrappable, options={})
|
|
18
12
|
super(wrappable)
|
|
19
13
|
|
|
@@ -25,10 +19,6 @@ module PlasticWrap
|
|
|
25
19
|
__getobj__
|
|
26
20
|
end
|
|
27
21
|
|
|
28
|
-
def config
|
|
29
|
-
Rails.application.config.action_controller
|
|
30
|
-
end
|
|
31
|
-
|
|
32
22
|
def ==(obj)
|
|
33
23
|
return true if obj.equal?(self)
|
|
34
24
|
if obj.respond_to?(:__getobj__)
|
|
@@ -38,6 +28,10 @@ module PlasticWrap
|
|
|
38
28
|
end
|
|
39
29
|
end
|
|
40
30
|
|
|
31
|
+
def use_mailer_config?
|
|
32
|
+
options[:use_mailer_config]
|
|
33
|
+
end
|
|
34
|
+
|
|
41
35
|
module ClassMethods
|
|
42
36
|
def wrap(wrappable, options={})
|
|
43
37
|
return wrappable if wrappable.instance_of? self
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
module PlasticWrap
|
|
2
|
+
module Helpers
|
|
3
|
+
extend ActiveSupport::Concern
|
|
4
|
+
|
|
5
|
+
included do
|
|
6
|
+
include ActionView::Helpers
|
|
7
|
+
include Rails.application.routes.url_helpers
|
|
8
|
+
|
|
9
|
+
if Rails::VERSION::MAJOR >= 4
|
|
10
|
+
include Sprockets::Rails::Helper
|
|
11
|
+
|
|
12
|
+
def assets_manifest
|
|
13
|
+
ActionView::Base.assets_manifest
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def assets_environment
|
|
17
|
+
ActionView::Base.assets_environment
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def assets_prefix
|
|
21
|
+
Rails.application.assets.context_class.assets_prefix
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def digest_assets
|
|
25
|
+
Rails.configuration.assets.digest
|
|
26
|
+
end
|
|
27
|
+
else
|
|
28
|
+
include Sprockets::Helpers::RailsHelper
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
attr_accessor :output_buffer
|
|
32
|
+
|
|
33
|
+
def config
|
|
34
|
+
if use_mailer_config?
|
|
35
|
+
ActionMailer::Base.config
|
|
36
|
+
else
|
|
37
|
+
ActionController::Base.config
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def use_mailer_config?
|
|
42
|
+
false
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
data/lib/plastic_wrap/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: plastic_wrap
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Craig Savolainen
|
|
@@ -9,34 +9,34 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2014-
|
|
12
|
+
date: 2014-11-30 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: actionpack
|
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
|
17
17
|
requirements:
|
|
18
|
-
- -
|
|
18
|
+
- - ">="
|
|
19
19
|
- !ruby/object:Gem::Version
|
|
20
20
|
version: '0'
|
|
21
21
|
type: :runtime
|
|
22
22
|
prerelease: false
|
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
|
24
24
|
requirements:
|
|
25
|
-
- -
|
|
25
|
+
- - ">="
|
|
26
26
|
- !ruby/object:Gem::Version
|
|
27
27
|
version: '0'
|
|
28
28
|
- !ruby/object:Gem::Dependency
|
|
29
29
|
name: activesupport
|
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
|
31
31
|
requirements:
|
|
32
|
-
- -
|
|
32
|
+
- - ">="
|
|
33
33
|
- !ruby/object:Gem::Version
|
|
34
34
|
version: '0'
|
|
35
35
|
type: :runtime
|
|
36
36
|
prerelease: false
|
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
|
38
38
|
requirements:
|
|
39
|
-
- -
|
|
39
|
+
- - ">="
|
|
40
40
|
- !ruby/object:Gem::Version
|
|
41
41
|
version: '0'
|
|
42
42
|
description: Decorator to help with the boilerplate of using Rails helpers. It gently
|
|
@@ -48,7 +48,7 @@ executables: []
|
|
|
48
48
|
extensions: []
|
|
49
49
|
extra_rdoc_files: []
|
|
50
50
|
files:
|
|
51
|
-
- .gitignore
|
|
51
|
+
- ".gitignore"
|
|
52
52
|
- Gemfile
|
|
53
53
|
- LICENSE.txt
|
|
54
54
|
- README.md
|
|
@@ -56,6 +56,7 @@ files:
|
|
|
56
56
|
- lib/plastic_wrap.rb
|
|
57
57
|
- lib/plastic_wrap/cardboard_tube.rb
|
|
58
58
|
- lib/plastic_wrap/heavy.rb
|
|
59
|
+
- lib/plastic_wrap/helpers.rb
|
|
59
60
|
- lib/plastic_wrap/light.rb
|
|
60
61
|
- lib/plastic_wrap/version.rb
|
|
61
62
|
- plastic_wrap.gemspec
|
|
@@ -68,17 +69,17 @@ require_paths:
|
|
|
68
69
|
- lib
|
|
69
70
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
70
71
|
requirements:
|
|
71
|
-
- -
|
|
72
|
+
- - ">="
|
|
72
73
|
- !ruby/object:Gem::Version
|
|
73
74
|
version: '0'
|
|
74
75
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
76
|
requirements:
|
|
76
|
-
- -
|
|
77
|
+
- - ">="
|
|
77
78
|
- !ruby/object:Gem::Version
|
|
78
79
|
version: '0'
|
|
79
80
|
requirements: []
|
|
80
81
|
rubyforge_project:
|
|
81
|
-
rubygems_version: 2.
|
|
82
|
+
rubygems_version: 2.2.2
|
|
82
83
|
signing_key:
|
|
83
84
|
specification_version: 4
|
|
84
85
|
summary: ''
|