dekorator 1.0.0.pre.1

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.
Files changed (42) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +14 -0
  3. data/.gitignore +11 -0
  4. data/.rspec +3 -0
  5. data/.rubocop.yml +114 -0
  6. data/.simplecov +5 -0
  7. data/.travis.yml +37 -0
  8. data/Appraisals +17 -0
  9. data/CHANGELOG.md +16 -0
  10. data/CODE_OF_CONDUCT.md +74 -0
  11. data/Gemfile +22 -0
  12. data/Gemfile.lock +157 -0
  13. data/LICENSE.txt +21 -0
  14. data/README.md +179 -0
  15. data/Rakefile +21 -0
  16. data/bin/console +16 -0
  17. data/bin/setup +8 -0
  18. data/dekorator.gemspec +34 -0
  19. data/gemfiles/.bundle/config +2 -0
  20. data/gemfiles/rails_5.0.x.gemfile +21 -0
  21. data/gemfiles/rails_5.0.x.gemfile.lock +207 -0
  22. data/gemfiles/rails_5.1.x.gemfile +21 -0
  23. data/gemfiles/rails_5.1.x.gemfile.lock +207 -0
  24. data/gemfiles/rails_5.2.x.gemfile +21 -0
  25. data/gemfiles/rails_5.2.x.gemfile.lock +207 -0
  26. data/gemfiles/rails_6.0.x.gemfile +21 -0
  27. data/gemfiles/rails_6.0.x.gemfile.lock +220 -0
  28. data/lib/dekorator.rb +123 -0
  29. data/lib/dekorator/decorators_helper.rb +5 -0
  30. data/lib/dekorator/railtie.rb +11 -0
  31. data/lib/dekorator/rspec.rb +0 -0
  32. data/lib/dekorator/version.rb +5 -0
  33. data/lib/generators/decorator/USAGE +9 -0
  34. data/lib/generators/decorator/decorator_generator.rb +11 -0
  35. data/lib/generators/decorator/templates/decorator.rb +17 -0
  36. data/lib/generators/decorator/templates/decorator_test.rb +1 -0
  37. data/lib/generators/dekorator/install_generator.rb +35 -0
  38. data/lib/generators/rspec/decorator_generator.rb +13 -0
  39. data/lib/generators/rspec/templates/decorator_spec.rb +17 -0
  40. data/lib/generators/test_unit/decorator_generator.rb +13 -0
  41. data/lib/generators/test_unit/templates/decorator_test.rb +6 -0
  42. metadata +187 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 92168b3d181e861e0c2649e7f6a56165da132af21e251ddaa92d08e6f98381b8
4
+ data.tar.gz: ac455c756a54061271316b83e37025353a9371480b19f212aabdc37a72056f66
5
+ SHA512:
6
+ metadata.gz: 75e15ec204e2ce9645209582b70009c21690857df2eca9098b3d45ffc725bd92cc673d65d7ae0f2f69515a26befcaedf85dd7a80fae520b6d4b22d17982f15f7
7
+ data.tar.gz: 6432e281aa9ff6dee4fb31b247f4ffa216b35fe3cc522f794e0d75040518c9cb3e318fcc3e053a9e9daa3ec346a6778b75dc906e580b66b21ae659d95e50dbe3
@@ -0,0 +1,14 @@
1
+ ; top-most EditorConfig file
2
+ root = true
3
+
4
+ ; Unix-style newlines
5
+ [*]
6
+ end_of_line = LF
7
+ indent_style = space
8
+ indent_size = 2
9
+ charset = utf-8
10
+ trim_trailing_whitespace = true
11
+ insert_final_newline = true
12
+
13
+ [*.md]
14
+ trim_trailing_whitespace = false
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,114 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.2
3
+ DisabledByDefault: true
4
+ Exclude:
5
+ - lib/generators/**/templates/**/*
6
+
7
+ Gemspec/OrderedDependencies:
8
+ Enabled: true
9
+
10
+ Style/BlockDelimiters:
11
+ Enabled: true
12
+
13
+ Style/BracesAroundHashParameters:
14
+ Enabled: true
15
+ EnforcedStyle: no_braces
16
+
17
+ Style/Dir:
18
+ Enabled: true
19
+
20
+ Style/Encoding:
21
+ Enabled: true
22
+
23
+ Style/For:
24
+ Enabled: true
25
+ EnforcedStyle: each
26
+
27
+ Style/MethodCallWithoutArgsParentheses:
28
+ Enabled: true
29
+
30
+ Style/MethodDefParentheses:
31
+ Enabled: true
32
+
33
+ Style/FrozenStringLiteralComment:
34
+ Enabled: true
35
+ EnforcedStyle: always
36
+
37
+ Naming/ConstantName:
38
+ Enabled: true
39
+
40
+ Naming/FileName:
41
+ Enabled: true
42
+
43
+ Naming/MethodName:
44
+ Enabled: true
45
+
46
+ Naming/PredicateName:
47
+ Enabled: true
48
+
49
+ Naming/VariableName:
50
+ Enabled: true
51
+
52
+ Lint/DeprecatedClassMethods:
53
+ Enabled: true
54
+
55
+ Layout/AlignParameters:
56
+ Enabled: true
57
+
58
+ Layout/BlockAlignment:
59
+ Enabled: true
60
+ EnforcedStyleAlignWith: start_of_block
61
+
62
+ Layout/BlockEndNewline:
63
+ Enabled: true
64
+
65
+ Layout/CaseIndentation:
66
+ Enabled: true
67
+
68
+ Layout/ClosingParenthesisIndentation:
69
+ Enabled: true
70
+
71
+ Layout/ConditionPosition:
72
+ Enabled: true
73
+
74
+ Layout/DefEndAlignment:
75
+ Enabled: true
76
+
77
+ Layout/DotPosition:
78
+ Enabled: true
79
+
80
+ Layout/ElseAlignment:
81
+ Enabled: true
82
+
83
+ Layout/EmptyLines:
84
+ Enabled: true
85
+
86
+ Layout/EmptyLinesAroundAccessModifier:
87
+ Enabled: true
88
+
89
+ Layout/SpaceAroundBlockParameters:
90
+ Enabled: true
91
+
92
+ Layout/SpaceAroundEqualsInParameterDefault:
93
+ Enabled: true
94
+
95
+ Layout/SpaceAroundOperators:
96
+ Enabled: true
97
+
98
+ Layout/SpaceBeforeBlockBraces:
99
+ Enabled: true
100
+
101
+ Layout/SpaceBeforeComma:
102
+ Enabled: true
103
+
104
+ Layout/SpaceInsideArrayLiteralBrackets:
105
+ Enabled: true
106
+
107
+ Layout/SpaceInsideHashLiteralBraces:
108
+ Enabled: true
109
+
110
+ Layout/SpaceInsideParens:
111
+ Enabled: true
112
+
113
+ Layout/TrailingWhitespace:
114
+ Enabled: true
@@ -0,0 +1,5 @@
1
+ SimpleCov.minimum_coverage 70 # TODO: should be 90
2
+
3
+ SimpleCov.start do
4
+ add_filter "/spec/"
5
+ end
@@ -0,0 +1,37 @@
1
+ language: ruby
2
+ sudo: false
3
+
4
+ before_install:
5
+ - gem update --system
6
+ - gem install bundler
7
+
8
+ rvm:
9
+ - 2.3
10
+ - 2.4
11
+ - 2.5
12
+ - 2.6
13
+ - ruby-head
14
+
15
+ cache:
16
+ bundler: true
17
+
18
+ gemfile:
19
+ - gemfiles/rails_5.0.x.gemfile
20
+ - gemfiles/rails_5.1.x.gemfile
21
+ - gemfiles/rails_5.2.x.gemfile
22
+ - gemfiles/rails_6.0.x.gemfile
23
+
24
+ matrix:
25
+ exclude:
26
+ - rvm: 2.2
27
+ gemfile: gemfiles/rails_6.0.x.gemfile
28
+ - rvm: 2.3
29
+ gemfile: gemfiles/rails_6.0.x.gemfile
30
+ - rvm: 2.4
31
+ gemfile: gemfiles/rails_6.0.x.gemfile
32
+
33
+ install:
34
+ - bundle install
35
+
36
+ script:
37
+ - bundle exec rake test:all_with_coverage
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ appraise "rails-5.0.x" do
4
+ gem "rails", "~> 5.0"
5
+ end
6
+
7
+ appraise "rails-5.1.x" do
8
+ gem "rails", "~> 5.1"
9
+ end
10
+
11
+ appraise "rails-5.2.x" do
12
+ gem "rails", "~> 5.2"
13
+ end
14
+
15
+ appraise "rails-6.0.x" do
16
+ gem "rails", "~> 6.0.0.beta1"
17
+ end
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+ Nothing yet
9
+
10
+ ## 1.0.0.pre.1 - 2019-01-30
11
+ ### Added
12
+ - Create Dekorator::Base the base of decorators (a2a36d66)
13
+ - Create `dekorator:install` generator (a2a36d66)
14
+ - Create `decorator` generator (a2a36d66)
15
+
16
+ [Unreleased]: https://github.com/pantographe/dekorator/compare/v1.0.0.pre.1...HEAD
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at nicolas@pantographe.studio. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
+
7
+ # Specify your gem's dependencies in dekorator.gemspec
8
+ gemspec
9
+
10
+ gem "activerecord"
11
+ gem "activemodel"
12
+ gem "activesupport"
13
+ gem "actionview"
14
+ gem "railties"
15
+
16
+ gem "appraisal", require: false
17
+ gem "rubocop", require: false
18
+
19
+ group :test do
20
+ gem "simplecov", require: false
21
+ gem 'coveralls', require: false
22
+ end
@@ -0,0 +1,157 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ dekorator (1.0.0.pre.1)
5
+ actionview (>= 5.0, < 6.1)
6
+ activesupport (>= 5.0, < 6.1)
7
+ railties (>= 5.0, < 6.1)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actionpack (5.2.2)
13
+ actionview (= 5.2.2)
14
+ activesupport (= 5.2.2)
15
+ rack (~> 2.0)
16
+ rack-test (>= 0.6.3)
17
+ rails-dom-testing (~> 2.0)
18
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
19
+ actionview (5.2.2)
20
+ activesupport (= 5.2.2)
21
+ builder (~> 3.1)
22
+ erubi (~> 1.4)
23
+ rails-dom-testing (~> 2.0)
24
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
25
+ activemodel (5.2.2)
26
+ activesupport (= 5.2.2)
27
+ activerecord (5.2.2)
28
+ activemodel (= 5.2.2)
29
+ activesupport (= 5.2.2)
30
+ arel (>= 9.0)
31
+ activesupport (5.2.2)
32
+ concurrent-ruby (~> 1.0, >= 1.0.2)
33
+ i18n (>= 0.7, < 2)
34
+ minitest (~> 5.1)
35
+ tzinfo (~> 1.1)
36
+ appraisal (2.2.0)
37
+ bundler
38
+ rake
39
+ thor (>= 0.14.0)
40
+ arel (9.0.0)
41
+ ast (2.4.0)
42
+ builder (3.2.3)
43
+ concurrent-ruby (1.1.4)
44
+ coveralls (0.7.1)
45
+ multi_json (~> 1.3)
46
+ rest-client
47
+ simplecov (>= 0.7)
48
+ term-ansicolor
49
+ thor
50
+ crass (1.0.4)
51
+ diff-lcs (1.3)
52
+ docile (1.3.1)
53
+ domain_name (0.5.20180417)
54
+ unf (>= 0.0.5, < 1.0.0)
55
+ erubi (1.8.0)
56
+ http-cookie (1.0.3)
57
+ domain_name (~> 0.5)
58
+ i18n (1.5.3)
59
+ concurrent-ruby (~> 1.0)
60
+ jaro_winkler (1.5.2)
61
+ json (2.1.0)
62
+ loofah (2.2.3)
63
+ crass (~> 1.0.2)
64
+ nokogiri (>= 1.5.9)
65
+ method_source (0.9.2)
66
+ mime-types (3.2.2)
67
+ mime-types-data (~> 3.2015)
68
+ mime-types-data (3.2018.0812)
69
+ mini_portile2 (2.4.0)
70
+ minitest (5.11.3)
71
+ multi_json (1.13.1)
72
+ netrc (0.11.0)
73
+ nokogiri (1.10.1)
74
+ mini_portile2 (~> 2.4.0)
75
+ parallel (1.13.0)
76
+ parser (2.6.0.0)
77
+ ast (~> 2.4.0)
78
+ powerpack (0.1.2)
79
+ rack (2.0.6)
80
+ rack-test (1.1.0)
81
+ rack (>= 1.0, < 3)
82
+ rails-dom-testing (2.0.3)
83
+ activesupport (>= 4.2.0)
84
+ nokogiri (>= 1.6)
85
+ rails-html-sanitizer (1.0.4)
86
+ loofah (~> 2.2, >= 2.2.2)
87
+ railties (5.2.2)
88
+ actionpack (= 5.2.2)
89
+ activesupport (= 5.2.2)
90
+ method_source
91
+ rake (>= 0.8.7)
92
+ thor (>= 0.19.0, < 2.0)
93
+ rainbow (3.0.0)
94
+ rake (10.5.0)
95
+ rest-client (2.0.2)
96
+ http-cookie (>= 1.0.2, < 2.0)
97
+ mime-types (>= 1.16, < 4.0)
98
+ netrc (~> 0.8)
99
+ rspec (3.8.0)
100
+ rspec-core (~> 3.8.0)
101
+ rspec-expectations (~> 3.8.0)
102
+ rspec-mocks (~> 3.8.0)
103
+ rspec-core (3.8.0)
104
+ rspec-support (~> 3.8.0)
105
+ rspec-expectations (3.8.2)
106
+ diff-lcs (>= 1.2.0, < 2.0)
107
+ rspec-support (~> 3.8.0)
108
+ rspec-mocks (3.8.0)
109
+ diff-lcs (>= 1.2.0, < 2.0)
110
+ rspec-support (~> 3.8.0)
111
+ rspec-support (3.8.0)
112
+ rubocop (0.63.1)
113
+ jaro_winkler (~> 1.5.1)
114
+ parallel (~> 1.10)
115
+ parser (>= 2.5, != 2.5.1.1)
116
+ powerpack (~> 0.1)
117
+ rainbow (>= 2.2.2, < 4.0)
118
+ ruby-progressbar (~> 1.7)
119
+ unicode-display_width (~> 1.4.0)
120
+ ruby-progressbar (1.10.0)
121
+ simplecov (0.16.1)
122
+ docile (~> 1.1)
123
+ json (>= 1.8, < 3)
124
+ simplecov-html (~> 0.10.0)
125
+ simplecov-html (0.10.2)
126
+ term-ansicolor (1.7.1)
127
+ tins (~> 1.0)
128
+ thor (0.20.3)
129
+ thread_safe (0.3.6)
130
+ tins (1.20.2)
131
+ tzinfo (1.2.5)
132
+ thread_safe (~> 0.1)
133
+ unf (0.1.4)
134
+ unf_ext
135
+ unf_ext (0.0.7.5)
136
+ unicode-display_width (1.4.1)
137
+
138
+ PLATFORMS
139
+ ruby
140
+
141
+ DEPENDENCIES
142
+ actionview
143
+ activemodel
144
+ activerecord
145
+ activesupport
146
+ appraisal
147
+ bundler (~> 2.0)
148
+ coveralls
149
+ dekorator!
150
+ railties
151
+ rake (~> 10.0)
152
+ rspec (~> 3.0)
153
+ rubocop
154
+ simplecov
155
+
156
+ BUNDLED WITH
157
+ 2.0.1