editor_opener 0.1.2 → 0.1.3

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: 6c8b8e6b943f3a78a43389bf47f24c2bc6b9880ad791e7344035ecc6d0057d84
4
- data.tar.gz: 136ce7ea6b21b4b181f69e6a1a32f3ed7427a8963b132194fc5df8367020e23f
3
+ metadata.gz: 1cfef991d8d0bc6a17c4d34462f2c48a2e10053396b88b0f93ca6bee77b89d32
4
+ data.tar.gz: b99da146b7413702fb16be1f90c30bacf9609879afa75ebc17793eeb2fb4e7ba
5
5
  SHA512:
6
- metadata.gz: e3fbaa4c31d6b2a1492caa43f36a1587381b0e4b5377fcb5c57349140cf1c84969fcf7c1153d642a8918f5b3085b4dedb264fd015ccdbf5ef72159c1a759f486
7
- data.tar.gz: 1fcdb2135fa17421f3472118575a509f3ab5c7a3c8a033726dcd626e230c4ad25937fb592829d237adb5264705f3b0b210f391ba4ffcb901d118075603830ea8
6
+ metadata.gz: '0339245f76e84ff7720cd0c6cf7662e4f91220a316a686cb8baf0c944c80b0cc2019a9e916a9ea3ac0d51433afcb8cda37ca8c445a70c8be0870abbb1b53ee76'
7
+ data.tar.gz: 0332a6abb0cae9929840e4c0a4d6030dfe211eead497b5cab90aec288461a9b31dd7b323cb920609030aa00579e5ed7c6195924a79bbf61c22a6387c1702f4b1
data/README.md CHANGED
@@ -11,7 +11,7 @@ Open source files in your editor directly from Rails error pages. This gem adds
11
11
  - 📝 **Multiple editor support** - Works with 13+ popular editors
12
12
  - 🎯 **Precise line targeting** - Opens files at the exact error line
13
13
  - 🔧 **Easy configuration** - Set via initializer or environment variable
14
- - 🚀 **Zero configuration** - Works out of the box with `EDITOR` environment variable
14
+ - 🚀 **Zero configuration** - Works out of the box with `EDITOR` or `RAILS_EDITOR` environment variable
15
15
  - 📱 **Custom URL schemes** - Uses editor-specific protocols for seamless integration
16
16
 
17
17
  ## Installation
@@ -49,12 +49,15 @@ end
49
49
 
50
50
  ### Option 2: Environment variable
51
51
 
52
- Set the `EDITOR` environment variable:
52
+ Set the `EDITOR` or `RAILS_EDITOR` environment variable:
53
53
 
54
54
  ```bash
55
55
  export EDITOR=cursor # for Cursor
56
56
  export EDITOR=atom # for Atom
57
57
  export EDITOR=subl # for Sublime Text
58
+ export RAILS_EDITOR=cursor # for Cursor
59
+ export RAILS_EDITOR=atom # for Atom
60
+ export RAILS_EDITOR=subl # for Sublime Text
58
61
  ```
59
62
 
60
63
  ## Usage
@@ -105,9 +108,13 @@ end
105
108
  ```bash
106
109
  # In your shell profile (~/.bashrc, ~/.zshrc, etc.)
107
110
  export EDITOR=cursor
111
+ # or
112
+ export RAILS_EDITOR=cursor
108
113
 
109
114
  # Or in your .env file (if using dotenv)
110
115
  EDITOR=cursor
116
+ # or
117
+ RAILS_EDITOR=cursor
111
118
  ```
112
119
 
113
120
  ### Multiple Environments
@@ -16,12 +16,8 @@
16
16
  <% trace.each do |frame| %>
17
17
  <div class="trace">
18
18
  <% file_url = ActionDispatch::TraceToFileExtractor.open_in_editor? && ActionDispatch::TraceToFileExtractor.new(frame[:trace]).call %>
19
- <% if file_url.present? %>
20
- <a href="<%= file_url %>" class="edit-icon">
21
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
22
- <path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10" />
23
- </svg>
24
- </a>
19
+ <% if file_url %>
20
+ <%= link_to("✏️", file_url, class: "edit-icon") %>
25
21
  <% end %>
26
22
  <a class="trace-frames trace-frames-<%= error_index %>" data-exception-object-id="<%= frame[:exception_object_id] %>" data-frame-id="<%= frame[:id] %>" href="#">
27
23
  <%= frame[:trace] %>
@@ -67,10 +67,15 @@
67
67
  .edit-icon {
68
68
  width: 16px;
69
69
  height: 16px;
70
+ font-size: 13px;
70
71
  display: flex;
71
72
  align-items: center;
72
73
  justify-content: center;
73
- color: #A0A0A0;
74
+ text-decoration: none;
75
+ }
76
+
77
+ .edit-icon:hover {
78
+ scale: 1.05;
74
79
  }
75
80
 
76
81
  .edit-line-link {
@@ -18,7 +18,8 @@ module ActionDispatch
18
18
  { symbols: [ :windsurf ], sniff: /windsurf/i, url: "windsurf://file/%{file}:%{line}" },
19
19
  { symbols: [ :zed ], sniff: /zed/i, url: "zed://file/%{file}:%{line}" },
20
20
  { symbols: [ :nova ], sniff: /nova/i, url: "nova://open?path=%{file}&line=%{line}" },
21
- { symbols: [ :cursor ], sniff: /cursor/i, url: "cursor://file/%{file}:%{line}" }
21
+ { symbols: [ :cursor ], sniff: /cursor/i, url: "cursor://file/%{file}:%{line}" },
22
+ { symbols: [ :kiro ], sniff: /kiro/i, url: "kiro://file/%{file}:%{line}" }
22
23
  ]
23
24
 
24
25
  class << self
@@ -33,7 +34,7 @@ module ActionDispatch
33
34
  private
34
35
 
35
36
  def potential_editor
36
- EditorOpener.editor || ENV["EDITOR"]
37
+ EditorOpener.editor || ENV["RAILS_EDITOR"] || ENV["EDITOR"]
37
38
  end
38
39
  end
39
40
 
@@ -1,3 +1,3 @@
1
1
  module EditorOpener
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -5,7 +5,7 @@
5
5
  EditorOpener.setup do |config|
6
6
  # Set your preferred editor
7
7
  # You can use any of the supported editors listed below:
8
- # config.editor = ENV["EDITOR"] || :cursor
8
+ # config.editor = ENV["RAILS_EDITOR"] || ENV["EDITOR"] || :cursor
9
9
 
10
10
  # Alternatively, you can set the EDITOR environment variable
11
11
  # export EDITOR=cursor
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: editor_opener
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Kasyanchuk
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-07-04 00:00:00.000000000 Z
10
+ date: 2025-07-16 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rails