tuxedo_decorate 0.4.0 → 0.5.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/.rubocop_todo.yml +1 -11
- data/.travis.yml +3 -3
- data/Appraisals +2 -2
- data/CHANGELOG.md +5 -0
- data/Gemfile +5 -5
- data/lib/tuxedo.rb +7 -4
- data/lib/tuxedo/action_view/helpers.rb +1 -1
- data/lib/tuxedo/config.rb +1 -0
- data/lib/tuxedo/railtie.rb +3 -0
- data/lib/tuxedo/version.rb +2 -1
- data/tuxedo_decorate.gemspec +12 -16
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4de66ac13f35c6683b56dd28c8268fadc5b9ed59
|
4
|
+
data.tar.gz: 16da8c9198868aee6849c3093399194fa2bcc736
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cac6f2c2847ea10d6524bd56bfb152c4d5eecc405fc9da9634bbb3af276258546b0f7dd071c39adfbcfffb053506ac2f603e7823b60d6eff2498b58175a09af3
|
7
|
+
data.tar.gz: 2eed5764d80ef3b4dd71a4d6dad3fe6d24a82806bc723e6d2fda91c595f5e1715afd87c8e41c1a8fd2e7fb0063eb4ee2ce056a67dc125f1af735df7994238798
|
data/.rubocop_todo.yml
CHANGED
@@ -1,17 +1,7 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2016-07-21 13:12:55 +0200 using RuboCop version 0.41.2.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
|
-
|
9
|
-
# Offense count: 11
|
10
|
-
# Configuration parameters: AllowURI, URISchemes.
|
11
|
-
Metrics/LineLength:
|
12
|
-
Max: 124
|
13
|
-
|
14
|
-
# Offense count: 5
|
15
|
-
# Configuration parameters: Exclude.
|
16
|
-
Style/Documentation:
|
17
|
-
Enabled: false
|
data/.travis.yml
CHANGED
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
## Unreleased
|
3
3
|
- Add your entry here!
|
4
4
|
|
5
|
+
## v0.5.0
|
6
|
+
- Updated Travis to build on latest ruby/jruby version
|
7
|
+
- Updated dependencies
|
8
|
+
- Also test on Rails 5 (Tuxedo is Rails 5.0 ready)
|
9
|
+
|
5
10
|
## v0.4.0
|
6
11
|
- Fixes #3: Using `alias_method` instead of `define_method` to improve performance
|
7
12
|
|
data/Gemfile
CHANGED
@@ -3,12 +3,12 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in tuxedo.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
gem 'rake', '~>
|
7
|
-
gem 'rspec', '~> 3.
|
8
|
-
gem 'yard', '~> 0.
|
9
|
-
gem 'simplecov', '~> 0.
|
6
|
+
gem 'rake', '~> 11.2'
|
7
|
+
gem 'rspec', '~> 3.5.0'
|
8
|
+
gem 'yard', '~> 0.9'
|
9
|
+
gem 'simplecov', '~> 0.12'
|
10
10
|
gem 'appraisal', '~> 2.1.0'
|
11
|
-
gem 'rubocop', '~> 0.
|
11
|
+
gem 'rubocop', '~> 0.41.0'
|
12
12
|
|
13
13
|
group :test do
|
14
14
|
gem 'codeclimate-test-reporter', require: false
|
data/lib/tuxedo.rb
CHANGED
@@ -26,10 +26,12 @@ require 'tuxedo/railtie' if defined?(Rails)
|
|
26
26
|
# end
|
27
27
|
#
|
28
28
|
module Tuxedo
|
29
|
+
# InstanceMethods that are available in every presenter
|
29
30
|
module InstanceMethods
|
30
31
|
include Charlatan.new(:object)
|
31
32
|
|
32
|
-
# Initializes a new Tuxedo class using the to decorate object
|
33
|
+
# Initializes a new Tuxedo class using the to decorate object
|
34
|
+
# and the view context
|
33
35
|
# @param [Object] object to decorate
|
34
36
|
# @param [ActionView::Context] view_context
|
35
37
|
#
|
@@ -50,8 +52,8 @@ module Tuxedo
|
|
50
52
|
@view_context
|
51
53
|
end
|
52
54
|
|
53
|
-
# Define delegations of our prac helper to the view context,
|
54
|
-
# presenters
|
55
|
+
# Define delegations of our prac helper to the view context,
|
56
|
+
# allows to call prac inside the presenters
|
55
57
|
delegate(:prac, to: :_h)
|
56
58
|
|
57
59
|
# These methods are already defined on Object by default or by rails, so we
|
@@ -59,6 +61,7 @@ module Tuxedo
|
|
59
61
|
delegate(:to_param, to: :object)
|
60
62
|
end
|
61
63
|
|
64
|
+
# ClassMethods that are available in every presenter
|
62
65
|
module ClassMethods
|
63
66
|
# Alias method name for accessing the original object
|
64
67
|
# Defaults to guessing the name from the class
|
@@ -78,7 +81,7 @@ module Tuxedo
|
|
78
81
|
end
|
79
82
|
|
80
83
|
# @api private
|
81
|
-
#
|
84
|
+
# Setup (after initialize) a new method for accessing the original object
|
82
85
|
#
|
83
86
|
def setup_alias_method(name = underscored_name)
|
84
87
|
alias_method(name, :object)
|
data/lib/tuxedo/config.rb
CHANGED
data/lib/tuxedo/railtie.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
require 'rails/railtie'
|
2
2
|
|
3
|
+
# Tuxedo main module
|
3
4
|
module Tuxedo
|
5
|
+
# Railtie that allows to include the Tuxedo::ActionView::Helpers
|
6
|
+
# makes it possible to use `prac` and `presenter_for`
|
4
7
|
class Railtie < ::Rails::Railtie
|
5
8
|
initializer 'tuxedo.action_view' do
|
6
9
|
ActiveSupport.on_load :action_view do
|
data/lib/tuxedo/version.rb
CHANGED
data/tuxedo_decorate.gemspec
CHANGED
@@ -4,25 +4,21 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'tuxedo/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
|
-
gem.name
|
8
|
-
gem.version
|
9
|
-
gem.authors
|
10
|
-
gem.email
|
7
|
+
gem.name = 'tuxedo_decorate'
|
8
|
+
gem.version = Tuxedo::VERSION
|
9
|
+
gem.authors = ['Jan Stevens', 'Maarten Claes']
|
10
|
+
gem.email = ['jan@playpass.be', 'mcls@playpass.be']
|
11
11
|
|
12
|
-
gem.summary
|
13
|
-
gem.homepage
|
14
|
-
gem.license
|
12
|
+
gem.summary = 'Tuxedo simple presenter logic under 150 LOC'
|
13
|
+
gem.homepage = 'https://github.com/playpasshq/tuxedo'
|
14
|
+
gem.license = 'MIT'
|
15
15
|
|
16
|
-
|
17
|
-
# delete this section to allow pushing this gem to any host.
|
18
|
-
if gem.respond_to?(:metadata)
|
19
|
-
gem.metadata['allowed_push_host'] = 'https://rubygems.org'
|
20
|
-
else
|
21
|
-
fail 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
|
22
|
-
end
|
16
|
+
gem.metadata['allowed_push_host'] = 'https://rubygems.org'
|
23
17
|
|
24
|
-
gem.files
|
25
|
-
|
18
|
+
gem.files = `git ls-files -z`.split("\x0").reject do |f|
|
19
|
+
f.match(%r{^(test|gem|features)/})
|
20
|
+
end
|
21
|
+
gem.test_files = gem.files.grep(%r{^(test|gem|features)/})
|
26
22
|
gem.require_paths = ['lib']
|
27
23
|
|
28
24
|
gem.add_dependency 'activesupport', '>= 4.0.0'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tuxedo_decorate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Stevens
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-07-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -113,9 +113,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
113
|
version: '0'
|
114
114
|
requirements: []
|
115
115
|
rubyforge_project:
|
116
|
-
rubygems_version: 2.
|
116
|
+
rubygems_version: 2.6.4
|
117
117
|
signing_key:
|
118
118
|
specification_version: 4
|
119
119
|
summary: Tuxedo simple presenter logic under 150 LOC
|
120
120
|
test_files: []
|
121
|
-
has_rdoc:
|