action_link 0.1.1 → 1.0.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: 1fb82eefce04018119e077392dd55980535cb21407adcb14988605f199bd3e42
4
- data.tar.gz: ea83ec0bf21af581e71ec2a79783adb97a3e65f8fe91ef43d1ef241f1ad56232
3
+ metadata.gz: 90a160a0379ad2b4ff0a3813e886c89e89ca482c4ef94b3299d115c16e343e8b
4
+ data.tar.gz: 10e782ef155643a9740d39c4c946afc28df9dc34fc80b1cd1319e7be6205ec60
5
5
  SHA512:
6
- metadata.gz: b1f640474051d8720d8de893567ded1129277abde85b36f07d2c2d16932dd2d7a1c7b349dd9a9c23f274f67d4892f5b68ac14427f20c930887b996546a29e214
7
- data.tar.gz: b142f701ff7b43541fb9a5d99c98ec297e1480701b0dfeab848b243662c5c05c5abcc2c42ced17333e615380064f5a8c10e34a88d219f1436b0188aeb21c93ec
6
+ metadata.gz: 23ff1d124a0aa98854c1a86a09e030ac942999318febb6e006ac307d73aabb05c7cd3008fb162f45e145c82211cd60a5149240de912b3643315a46d0eff3cbb1
7
+ data.tar.gz: 9b76d7416233de84b45201b9e151961d46a666dab70cd1661540a04d50c1b1808221c37a0a826ff915c1a8ce798ecdfda5c7aed71cc83aa4799488c6d3a34c4e
data/README.md CHANGED
@@ -1,34 +1,55 @@
1
1
  # ActionLink
2
2
 
3
- Intuitive ViewComponents for CRUD resource link actions in Rails.
3
+ ActionLink is a Ruby gem that provides intuitive ViewComponents for CRUD resource link actions in Rails. It simplifies the process of creating common action links (show, edit, delete, etc.) with associated icons.
4
4
 
5
5
  ## Usage
6
6
 
7
+ Here's an example of how to use the `ActionLink` gem in a Rails view:
8
+
7
9
  ```ruby
8
10
  # In Rails view
9
- = render ActionLink::Show.new(url: [:admin, @post], current_user:)
11
+ = render ActionLink::Show.new(url: [:admin, @post], current_user: current_user)
12
+ ```
13
+
14
+ ## More Usage Examples
15
+
16
+ Here are some more examples of how to use the `ActionLink` gem in a Rails view:
17
+
18
+ ```ruby
19
+ # In Rails view
20
+ = render ActionLink::Edit.new(url: [:edit, @post], current_user: current_user)
21
+ = render ActionLink::Destroy.new(url: [:destroy, @post], current_user: current_user)
22
+ = render ActionLink::New.new(url: [:new, @post], current_user: current_user)
10
23
  ```
11
24
 
12
25
  ## Installation
13
26
 
14
- Install the gem and add to the application's Gemfile by executing:
27
+ To install the `ActionLink` gem, add it to your application's Gemfile and run `bundle install`:
15
28
 
16
- $ bundle add action_link
29
+ ```ruby
30
+ gem 'action_link'
31
+ ```
17
32
 
18
- If bundler is not being used to manage dependencies, install the gem by executing:
33
+ Alternatively, you can install the gem manually by running:
19
34
 
20
- $ gem install action_link
35
+ ```sh
36
+ gem install action_link
37
+ ```
21
38
 
22
39
  ## Development
23
40
 
24
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
25
-
26
- ## Contributing
41
+ To contribute to the development of the `ActionLink` gem, follow these steps:
27
42
 
28
- Bug reports and pull requests are welcome on GitHub at https://github.com/halo/action_link.
43
+ 1. Fork the repository on GitHub.
44
+ 2. Clone your forked repository to your local machine.
45
+ 3. Install the gem's dependencies by running `bin/setup`.
46
+ 4. Run the tests to ensure everything is working correctly: `rake test`.
47
+ 5. Make your changes and add tests for your changes.
48
+ 6. Commit your changes and push them to your forked repository.
49
+ 7. Create a pull request on GitHub with a description of your changes.
29
50
 
30
51
  ## License
31
52
 
32
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
53
+ The `ActionLink` gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
33
54
 
34
- The icons are taken from the incredible [iconmonstr](https://iconmonstr.com/license/).
55
+ The icons used in this gem are taken from the incredible [iconmonstr](https://iconmonstr.com/license/).
@@ -0,0 +1,4 @@
1
+ @use "./variables"
2
+ @use "./style"
3
+ @use "./fonts"
4
+ @use "./acticons"
@@ -1,42 +1,44 @@
1
1
  // This file is autogenerated by `rake acticons:update`
2
2
 
3
+ @use "variables";
4
+
3
5
  .o-acticon--info-circle {
4
6
  &:before {
5
- content: $o-acticon--info-circle;
7
+ content: variables.$info-circle;
6
8
  }
7
9
  }
8
10
  .o-acticon--questionmark {
9
11
  &:before {
10
- content: $o-acticon--questionmark;
12
+ content: variables.$questionmark;
11
13
  }
12
14
  }
13
15
  .o-acticon--arrow-down-circle {
14
16
  &:before {
15
- content: $o-acticon--arrow-down-circle;
17
+ content: variables.$arrow-down-circle;
16
18
  }
17
19
  }
18
20
  .o-acticon--pencil-circle {
19
21
  &:before {
20
- content: $o-acticon--pencil-circle;
22
+ content: variables.$pencil-circle;
21
23
  }
22
24
  }
23
25
  .o-acticon--check-circle {
24
26
  &:before {
25
- content: $o-acticon--check-circle;
27
+ content: variables.$check-circle;
26
28
  }
27
29
  }
28
30
  .o-acticon--chevron-circle-right {
29
31
  &:before {
30
- content: $o-acticon--chevron-circle-right;
32
+ content: variables.$chevron-circle-right;
31
33
  }
32
34
  }
33
35
  .o-acticon--plus-circle {
34
36
  &:before {
35
- content: $o-acticon--plus-circle;
37
+ content: variables.$plus-circle;
36
38
  }
37
39
  }
38
40
  .o-acticon--times-circle {
39
41
  &:before {
40
- content: $o-acticon--times-circle;
42
+ content: variables.$times-circle;
41
43
  }
42
44
  }
@@ -1,10 +1,10 @@
1
1
  // This file is autogenerated by `rake acticons:update`
2
2
 
3
- $o-acticon--info-circle: "\e907";
4
- $o-acticon--questionmark: "\2753";
5
- $o-acticon--arrow-down-circle: "\e9af";
6
- $o-acticon--pencil-circle: "\e9ae";
7
- $o-acticon--check-circle: "\e93b";
8
- $o-acticon--chevron-circle-right: "\e928";
9
- $o-acticon--plus-circle: "\e919";
10
- $o-acticon--times-circle: "\e91a";
3
+ $info-circle: "\e907";
4
+ $questionmark: "\2753";
5
+ $arrow-down-circle: "\e9af";
6
+ $pencil-circle: "\e9ae";
7
+ $check-circle: "\e93b";
8
+ $chevron-circle-right: "\e928";
9
+ $plus-circle: "\e919";
10
+ $times-circle: "\e91a";
@@ -24,6 +24,7 @@ module ActionLink
24
24
  option :url, default: -> {}
25
25
 
26
26
  def permission?
27
+ # TODO: use allowed? in ActionPolicy
27
28
  _policy.public_send(:"#{_action}?")
28
29
  end
29
30
 
@@ -8,6 +8,10 @@ module ActionLink
8
8
  class Engine < ::Rails::Engine
9
9
  isolate_namespace ActionLink
10
10
 
11
+ initializer "action_link.assets" do |app|
12
+ app.config.assets.paths << File.expand_path("../app/assets/stylesheets", __dir__)
13
+ end
14
+
11
15
  config.to_prepare do
12
16
  # Our ActionLink components are subclasses of `ViewComponent::Base`.
13
17
  # When `ViewComponent::Base` is subclassed, two things happen:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActionLink
4
- VERSION = '0.1.1'
4
+ VERSION = '1.0.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_link
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - halo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-20 00:00:00.000000000 Z
11
+ date: 2025-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -77,8 +77,8 @@ files:
77
77
  - LICENSE.txt
78
78
  - README.md
79
79
  - app/assets/fonts/action_link/acticons.woff
80
+ - app/assets/stylesheets/action_link/_index.sass
80
81
  - app/assets/stylesheets/action_link/acticons.sass
81
- - app/assets/stylesheets/action_link/all.sass
82
82
  - app/assets/stylesheets/action_link/fonts.sass
83
83
  - app/assets/stylesheets/action_link/style.scss
84
84
  - app/assets/stylesheets/action_link/variables.scss
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  - !ruby/object:Gem::Version
119
119
  version: '0'
120
120
  requirements: []
121
- rubygems_version: 3.5.6
121
+ rubygems_version: 3.5.14
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: A set of ViewComponents for common links (show, edit, delete, etc.)
@@ -1,4 +0,0 @@
1
- @import ./variables
2
- @import ./style
3
- @import ./fonts
4
- @import ./acticons