dekorator 1.0.0.pre.1

Sign up to get free protection for your applications and to get access to all the features.
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,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rspec
4
+ module Generators
5
+ class DecoratorGenerator < ::Rails::Generators::NamedBase
6
+ source_root File.expand_path("templates", __dir__)
7
+
8
+ def create_decorator_spec
9
+ template "decorator_spec.rb", File.join("spec/decorators", class_path, "#{file_name}_decorator_spec.rb")
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require '<%= File.exists?("spec/rails_helper.rb") ? "rails_helper" : "spec_helper" %>'
4
+
5
+ # Example:
6
+ #
7
+ # describe <%= class_name %>Decorator, type: :decorator do
8
+ # let(:object) { User.new(first_name: "John", last_name: "Doe") }
9
+ # let(:decorated_user) { described_class.new(object) }
10
+ #
11
+ # describe "#full_name" do
12
+ # it { expect(decorated_user.full_name).to eq("John Doe") }
13
+ # end
14
+ # end
15
+ RSpec.describe <%= class_name %>Decorator, type: :decorator do
16
+ pending "add some examples to (or delete) #{__FILE__}"
17
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TestUnit
4
+ module Generators
5
+ class DecoratorGenerator < ::Rails::Generators::NamedBase
6
+ source_root File.expand_path("templates", __dir__)
7
+
8
+ def create_decorator_test
9
+ template "decorator_test.rb", File.join("test/decorators", class_path, "#{file_name}_decorator_test.rb")
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'test_helper'
4
+
5
+ class <%= class_name %>DecoratorTest < ActiveSupport::TestCase
6
+ end
metadata ADDED
@@ -0,0 +1,187 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dekorator
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0.pre.1
5
+ platform: ruby
6
+ authors:
7
+ - Nicolas Brousse
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-01-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: actionview
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '5.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '6.1'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '5.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '6.1'
33
+ - !ruby/object:Gem::Dependency
34
+ name: activesupport
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '5.0'
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '6.1'
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '5.0'
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '6.1'
53
+ - !ruby/object:Gem::Dependency
54
+ name: railties
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '5.0'
60
+ - - "<"
61
+ - !ruby/object:Gem::Version
62
+ version: '6.1'
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '5.0'
70
+ - - "<"
71
+ - !ruby/object:Gem::Version
72
+ version: '6.1'
73
+ - !ruby/object:Gem::Dependency
74
+ name: bundler
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: '2.0'
80
+ type: :development
81
+ prerelease: false
82
+ version_requirements: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - "~>"
85
+ - !ruby/object:Gem::Version
86
+ version: '2.0'
87
+ - !ruby/object:Gem::Dependency
88
+ name: rake
89
+ requirement: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - "~>"
92
+ - !ruby/object:Gem::Version
93
+ version: '10.0'
94
+ type: :development
95
+ prerelease: false
96
+ version_requirements: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - "~>"
99
+ - !ruby/object:Gem::Version
100
+ version: '10.0'
101
+ - !ruby/object:Gem::Dependency
102
+ name: rspec
103
+ requirement: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - "~>"
106
+ - !ruby/object:Gem::Version
107
+ version: '3.0'
108
+ type: :development
109
+ prerelease: false
110
+ version_requirements: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - "~>"
113
+ - !ruby/object:Gem::Version
114
+ version: '3.0'
115
+ description: An opinionated way of organizing model-view code in Ruby on Rails, based
116
+ on decorators
117
+ email:
118
+ - nicolas@pantographe.studio
119
+ executables: []
120
+ extensions: []
121
+ extra_rdoc_files: []
122
+ files:
123
+ - ".editorconfig"
124
+ - ".gitignore"
125
+ - ".rspec"
126
+ - ".rubocop.yml"
127
+ - ".simplecov"
128
+ - ".travis.yml"
129
+ - Appraisals
130
+ - CHANGELOG.md
131
+ - CODE_OF_CONDUCT.md
132
+ - Gemfile
133
+ - Gemfile.lock
134
+ - LICENSE.txt
135
+ - README.md
136
+ - Rakefile
137
+ - bin/console
138
+ - bin/setup
139
+ - dekorator.gemspec
140
+ - gemfiles/.bundle/config
141
+ - gemfiles/rails_5.0.x.gemfile
142
+ - gemfiles/rails_5.0.x.gemfile.lock
143
+ - gemfiles/rails_5.1.x.gemfile
144
+ - gemfiles/rails_5.1.x.gemfile.lock
145
+ - gemfiles/rails_5.2.x.gemfile
146
+ - gemfiles/rails_5.2.x.gemfile.lock
147
+ - gemfiles/rails_6.0.x.gemfile
148
+ - gemfiles/rails_6.0.x.gemfile.lock
149
+ - lib/dekorator.rb
150
+ - lib/dekorator/decorators_helper.rb
151
+ - lib/dekorator/railtie.rb
152
+ - lib/dekorator/rspec.rb
153
+ - lib/dekorator/version.rb
154
+ - lib/generators/decorator/USAGE
155
+ - lib/generators/decorator/decorator_generator.rb
156
+ - lib/generators/decorator/templates/decorator.rb
157
+ - lib/generators/decorator/templates/decorator_test.rb
158
+ - lib/generators/dekorator/install_generator.rb
159
+ - lib/generators/rspec/decorator_generator.rb
160
+ - lib/generators/rspec/templates/decorator_spec.rb
161
+ - lib/generators/test_unit/decorator_generator.rb
162
+ - lib/generators/test_unit/templates/decorator_test.rb
163
+ homepage:
164
+ licenses:
165
+ - MIT
166
+ metadata: {}
167
+ post_install_message:
168
+ rdoc_options: []
169
+ require_paths:
170
+ - lib
171
+ required_ruby_version: !ruby/object:Gem::Requirement
172
+ requirements:
173
+ - - ">="
174
+ - !ruby/object:Gem::Version
175
+ version: '2.3'
176
+ required_rubygems_version: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">"
179
+ - !ruby/object:Gem::Version
180
+ version: 1.3.1
181
+ requirements: []
182
+ rubygems_version: 3.0.1
183
+ signing_key:
184
+ specification_version: 4
185
+ summary: An opinionated way of organizing model-view code in Ruby on Rails, based
186
+ on decorators
187
+ test_files: []