actionview-component 1.16.0 → 1.17.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ba3d4977df1eebf5c9302cd205026c2c24171573ac3e773e7842d7951a3dba3
4
- data.tar.gz: 8b304a5e95a8483fa76227c6949a5d97a645ed70e7529bec41d21faee6a1b5f0
3
+ metadata.gz: 24d6994186bb4c3e5f6fb8c628a3d91124cc6bdcbad61b966365c9170ab3b901
4
+ data.tar.gz: 020ab981225e9bb34508583c2aff096b125e43bee8c5ecc935ab52c6a22eb014
5
5
  SHA512:
6
- metadata.gz: 96cb83f9aa25bfc9e363b0d9fca3e62b84829514f5340f4a531b4f8709563fc85fd2990b2175c912938993a09dc9d834396589daec8839b30523156eb21250d1
7
- data.tar.gz: 9e03e678effd5b1716d24f23f7c16c0b4342ba18a4c480ac93ac5bdd3e7d049285e15974642c363b8d4e3b085108ae1b5a16ccf20bd3ed553472edc70fd4a722
6
+ metadata.gz: 608b7e73a07c3b24c1fa273f65c1dea5f1e5d993f3db8ff3c3dde2d9d6a207604141849686cd78f4a6ac7a4a6c45567d81fb3eb054c7bccf4802565a3eb83a71
7
+ data.tar.gz: 8376ee07b5534e81b25c6241a0e9da6d02cf13a0b8b3b4036cdb6a062695897efaefd75a779f5d5d7009477ab03524da13f7a52fc557484dfd128cf77927e3f3
@@ -8,7 +8,7 @@ jobs:
8
8
  strategy:
9
9
  matrix:
10
10
  rails_version: [5.0.0, 5.2.3, 6.0.0, master]
11
- ruby_version: [2.5.x, 2.6.x, 2.7.x]
11
+ ruby_version: [2.4.x, 2.5.x, 2.6.x, 2.7.x]
12
12
  exclude:
13
13
  - rails_version: master
14
14
  ruby_version: 2.4.x
@@ -20,6 +20,10 @@ jobs:
20
20
  uses: actions/setup-ruby@v1
21
21
  with:
22
22
  ruby-version: ${{ matrix.ruby_version }}
23
+ - name: Update rubygems when testing with Ruby 2.4.x
24
+ if: startsWith(matrix.ruby_version, '2.4')
25
+ run: |
26
+ gem update --system --no-document
23
27
  - name: Build and test with Rake
24
28
  run: |
25
29
  gem install bundler:1.17.3
@@ -1,5 +1,19 @@
1
1
  # master
2
2
 
3
+ # v1.17.0
4
+
5
+ * Support Ruby 2.4 in CI.
6
+
7
+ *Andrew Mason*
8
+
9
+ * ViewComponent generators do not not prompt for content requirement.
10
+
11
+ *Joel Hawksley*
12
+
13
+ * Add post-install message that gem has been renamed to `view_component`.
14
+
15
+ *Joel Hawksley*
16
+
3
17
  # v1.16.0
4
18
 
5
19
  * Add `refute_component_rendered` test helper.
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- actionview-component (1.16.0)
5
- capybara (>= 3)
4
+ actionview-component (1.17.0)
5
+ capybara (~> 3)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -189,7 +189,7 @@ PLATFORMS
189
189
  DEPENDENCIES
190
190
  actionview-component!
191
191
  better_html (~> 1)
192
- bundler (>= 1.14)
192
+ bundler (~> 1.14)
193
193
  haml (~> 5)
194
194
  minitest (= 5.1.0)
195
195
  rails (= 6.0.0)
data/README.md CHANGED
@@ -33,7 +33,7 @@ This library is designed to integrate as seamlessly as possible with Rails, with
33
33
 
34
34
  ## Compatibility
35
35
 
36
- `actionview-component` is tested for compatibility with combinations of Ruby `2.5`/`2.6`/`2.7` and Rails `5.0.0`/`5.2.3`/`6.0.0`/`master`.
36
+ `actionview-component` is tested for compatibility with combinations of Ruby `2.4`/`2.5`/`2.6`/`2.7` and Rails `5.0.0`/`5.2.3`/`6.0.0`/`master`.
37
37
 
38
38
  ## Installation
39
39
 
@@ -11,8 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.authors = ["GitHub Open Source"]
12
12
  spec.email = ["opensource+view_component@github.com"]
13
13
 
14
- spec.summary = %q{View components for Rails}
15
- spec.description = %q{View components for Rails}
14
+ spec.summary = %q{MOVED to view_component.}
16
15
  spec.homepage = "https://github.com/github/view_component"
17
16
  spec.license = "MIT"
18
17
 
@@ -34,8 +33,8 @@ Gem::Specification.new do |spec|
34
33
 
35
34
  spec.required_ruby_version = ">= 2.3.0"
36
35
 
37
- spec.add_runtime_dependency "capybara", ">= 3"
38
- spec.add_development_dependency "bundler", ">= 1.14"
36
+ spec.add_runtime_dependency "capybara", "~> 3"
37
+ spec.add_development_dependency "bundler", "~> 1.14"
39
38
  spec.add_development_dependency "rake", "~> 13.0"
40
39
  spec.add_development_dependency "minitest", "= 5.1.0"
41
40
  spec.add_development_dependency "haml", "~> 5"
@@ -43,4 +42,6 @@ Gem::Specification.new do |spec|
43
42
  spec.add_development_dependency "better_html", "~> 1"
44
43
  spec.add_development_dependency "rubocop", "= 0.74"
45
44
  spec.add_development_dependency "rubocop-github", "~> 0.13.0"
45
+
46
+ spec.post_install_message = "WARNING: actionview-component has been renamed to view_component, and will no longer be published in this namespace. Please update your Gemfile to use view_component."
46
47
  end
@@ -8,8 +8,6 @@ module Rails
8
8
  argument :attributes, type: :array, default: [], banner: "attribute"
9
9
  check_class_collision suffix: "Component"
10
10
 
11
- class_option :require_content, type: :boolean, default: false
12
-
13
11
  def create_component_file
14
12
  template "component.rb", File.join("app/components", class_path, "#{file_name}_component.rb")
15
13
  end
@@ -17,7 +15,7 @@ module Rails
17
15
  hook_for :test_framework
18
16
 
19
17
  hook_for :template_engine do |instance, template_engine|
20
- instance.invoke template_engine, [instance.name], require_content: instance.send(:requires_content?)
18
+ instance.invoke template_engine, [instance.name]
21
19
  end
22
20
 
23
21
  private
@@ -26,14 +24,6 @@ module Rails
26
24
  @_file_name ||= super.sub(/_component\z/i, "")
27
25
  end
28
26
 
29
- def requires_content?
30
- return if behavior == :revoke
31
- return @requires_content if @asked
32
-
33
- @asked = true
34
- @requires_content = ask("Would you like #{class_name} to require content? (Y/n)").downcase == "y"
35
- end
36
-
37
27
  def parent_class
38
28
  defined?(ApplicationComponent) ? "ApplicationComponent" : "ViewComponent::Base"
39
29
  end
@@ -1,8 +1,4 @@
1
1
  class <%= class_name %>Component < <%= parent_class %>
2
- <%- if requires_content? -%>
3
- validates :content, presence: true
4
- <%- end -%>
5
-
6
2
  def initialize(<%= initialize_signature %>)
7
3
  <%= initialize_body %>
8
4
  end
@@ -7,18 +7,12 @@ module Erb
7
7
  class ComponentGenerator < Base
8
8
  source_root File.expand_path("templates", __dir__)
9
9
 
10
- class_option :require_content, type: :boolean, default: false
11
-
12
10
  def copy_view_file
13
11
  template "component.html.erb", File.join("app/components", class_path, "#{file_name}_component.html.erb")
14
12
  end
15
13
 
16
14
  private
17
15
 
18
- def requires_content?
19
- options["require_content"]
20
- end
21
-
22
16
  def file_name
23
17
  @_file_name ||= super.sub(/_component\z/i, "")
24
18
  end
@@ -1,5 +1 @@
1
- <%- if requires_content? -%>
2
- <%= "<%= content %%>" %>
3
- <%- else -%>
4
1
  <div>Add <%= class_name %> template here</div>
5
- <%- end -%>
@@ -7,18 +7,12 @@ module Haml
7
7
  class ComponentGenerator < Erb::Generators::ComponentGenerator
8
8
  source_root File.expand_path("templates", __dir__)
9
9
 
10
- class_option :require_content, type: :boolean, default: false
11
-
12
10
  def copy_view_file
13
11
  template "component.html.haml", File.join("app/components", class_path, "#{file_name}_component.html.haml")
14
12
  end
15
13
 
16
14
  private
17
15
 
18
- def requires_content?
19
- options["require_content"]
20
- end
21
-
22
16
  def file_name
23
17
  @_file_name ||= super.sub(/_component\z/i, "")
24
18
  end
@@ -1,5 +1 @@
1
- <%- if requires_content? -%>
2
- <%= "= content" %>
3
- <%- else -%>
4
1
  %div Add <%= class_name %> template here
5
- <%- end -%>
@@ -7,18 +7,12 @@ module Slim
7
7
  class ComponentGenerator < Erb::Generators::ComponentGenerator
8
8
  source_root File.expand_path("templates", __dir__)
9
9
 
10
- class_option :require_content, type: :boolean, default: false
11
-
12
10
  def copy_view_file
13
11
  template "component.html.slim", File.join("app/components", class_path, "#{file_name}_component.html.slim")
14
12
  end
15
13
 
16
14
  private
17
15
 
18
- def requires_content?
19
- options["require_content"]
20
- end
21
-
22
16
  def file_name
23
17
  @_file_name ||= super.sub(/_component\z/i, "")
24
18
  end
@@ -0,0 +1 @@
1
+ div Add <%= class_name %> template here
@@ -3,8 +3,8 @@ require "test_helper"
3
3
  class <%= class_name %>ComponentTest < ViewComponent::TestCase
4
4
  test "component renders something useful" do
5
5
  # assert_equal(
6
- # %(<span title="my title">Hello, components!</span>),
7
- # render_inline(<%= class_name %>Component.new(attr: "value")) { "Hello, components!" }.css("span").to_html
6
+ # %(<span>Hello, components!</span>),
7
+ # render_inline(<%= class_name %>Component.new(message: "Hello, components!")).css("span").to_html
8
8
  # )
9
9
  end
10
10
  end
@@ -3,7 +3,7 @@
3
3
  module ViewComponent
4
4
  module VERSION
5
5
  MAJOR = 1
6
- MINOR = 16
6
+ MINOR = 17
7
7
  PATCH = 0
8
8
 
9
9
  STRING = [MAJOR, MINOR, PATCH].join(".")
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionview-component
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.0
4
+ version: 1.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Open Source
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-20 00:00:00.000000000 Z
11
+ date: 2020-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.14'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.14'
41
41
  - !ruby/object:Gem::Dependency
@@ -136,7 +136,7 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: 0.13.0
139
- description: View components for Rails
139
+ description:
140
140
  email:
141
141
  - opensource+view_component@github.com
142
142
  executables: []
@@ -175,7 +175,7 @@ files:
175
175
  - lib/rails/generators/rspec/component_generator.rb
176
176
  - lib/rails/generators/rspec/templates/component_spec.rb.tt
177
177
  - lib/rails/generators/slim/component_generator.rb
178
- - lib/rails/generators/slim/templates/component.html.slim
178
+ - lib/rails/generators/slim/templates/component.html.slim.tt
179
179
  - lib/rails/generators/test_unit/component_generator.rb
180
180
  - lib/rails/generators/test_unit/templates/component_test.rb.tt
181
181
  - lib/railties/lib/rails.rb
@@ -204,7 +204,9 @@ licenses:
204
204
  - MIT
205
205
  metadata:
206
206
  allowed_push_host: https://rubygems.org
207
- post_install_message:
207
+ post_install_message: 'WARNING: actionview-component has been renamed to view_component,
208
+ and will no longer be published in this namespace. Please update your Gemfile to
209
+ use view_component.'
208
210
  rdoc_options: []
209
211
  require_paths:
210
212
  - lib
@@ -219,8 +221,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
221
  - !ruby/object:Gem::Version
220
222
  version: '0'
221
223
  requirements: []
222
- rubygems_version: 3.0.3
224
+ rubygems_version: 3.1.2
223
225
  signing_key:
224
226
  specification_version: 4
225
- summary: View components for Rails
227
+ summary: MOVED to view_component.
226
228
  test_files: []
@@ -1,5 +0,0 @@
1
- <%- if requires_content? -%>
2
- = content
3
- <%- else -%>
4
- div Add <%= class_name %> template here
5
- <%- end -%>