Skip to content

Commit a85d619

Browse files
authored
Merge pull request #34 from Shopify/andyw8/rename-gem
Rename gem to `ruby-lsp-rails`
2 parents 00ebf58 + cc65dd5 commit a85d619

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+448
-432
lines changed

.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ AllCops:
1313
Exclude:
1414
- "test/dummy/db/**/*.rb"
1515

16+
Naming/FileName:
17+
Exclude:
18+
- "lib/ruby-lsp-rails.rb"
19+
1620
Sorbet/FalseSigil:
1721
Enabled: false
1822

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
source "https://rubygems.org"
44
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
55

6-
# Specify your gem's dependencies in rails_ruby_lsp.gemspec.
6+
# Specify your gem's dependencies in ruby_lsp_rails.gemspec.
77
gemspec
88

99
gem "puma"

Gemfile.lock

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GIT
1111
PATH
1212
remote: .
1313
specs:
14-
rails_ruby_lsp (0.1.0)
14+
ruby-lsp-rails (0.1.0)
1515
rails (>= 6.0)
1616
ruby-lsp (>= 0.4.0)
1717
sorbet-runtime (>= 0.5.9897)
@@ -103,7 +103,7 @@ GEM
103103
reline (>= 0.3.0)
104104
json (2.6.3)
105105
language_server-protocol (3.17.0.3)
106-
loofah (2.19.1)
106+
loofah (2.20.0)
107107
crass (~> 1.0.2)
108108
nokogiri (>= 1.5.9)
109109
mail (2.8.1)
@@ -114,6 +114,7 @@ GEM
114114
marcel (1.0.2)
115115
method_source (1.0.0)
116116
mini_mime (1.1.2)
117+
mini_portile2 (2.8.1)
117118
minitest (5.18.0)
118119
mocha (2.0.2)
119120
ruby2_keywords (>= 0.0.5)
@@ -128,9 +129,10 @@ GEM
128129
net-protocol
129130
netrc (0.11.0)
130131
nio4r (2.5.9)
131-
nokogiri (1.14.3-arm64-darwin)
132+
nokogiri (1.14.3)
133+
mini_portile2 (~> 2.8.0)
132134
racc (~> 1.4)
133-
nokogiri (1.14.3-x86_64-linux)
135+
nokogiri (1.14.3-arm64-darwin)
134136
racc (~> 1.4)
135137
parallel (1.22.1)
136138
parser (3.2.2.0)
@@ -251,13 +253,13 @@ DEPENDENCIES
251253
debug (>= 1.7.0)
252254
mocha
253255
puma
254-
rails_ruby_lsp!
255256
rubocop (~> 1.48)
256257
rubocop-minitest (~> 0.30.0)
257258
rubocop-rake (~> 0.6.0)
258259
rubocop-shopify (~> 2.13)
259260
rubocop-sorbet (~> 0.7)
260261
ruby-lsp!
262+
ruby-lsp-rails!
261263
sorbet-static-and-runtime
262264
sqlite3
263265
tapioca (~> 0.11)

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Rails Ruby Lsp
1+
# Ruby LSP Rails
22

3-
The Rails Ruby Lsp is a [Ruby LSP](https://github.com/Shopify/ruby-lsp) extension for extra Rails editor features, such as:
3+
Ruby LSP Rails is a [Ruby LSP](https://github.com/Shopify/ruby-lsp) extension for extra Rails editor features, such as:
44

55
- Displaying an ActiveRecord model's database columns and types when hovering over it
66
- (More to come!)
@@ -12,7 +12,7 @@ To install, add the following line to your application's Gemfile:
1212

1313
```ruby
1414
group :development do
15-
gem "rails_ruby_lsp"
15+
gem "ruby-lsp-rails"
1616
end
1717
```
1818

@@ -38,11 +38,11 @@ This is why the Rails server needs to be running for features to work.
3838

3939
## Contributing
4040

41-
Bug reports and pull requests are welcome on GitHub at https://github.com/Shopify/rails_ruby_lsp. This project is
41+
Bug reports and pull requests are welcome on GitHub at https://github.com/Shopify/ruby-lsp-rails. This project is
4242
intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the
43-
[Contributor Covenant](https://github.com/Shopify/rails_ruby_lsp/blob/main/CODE_OF_CONDUCT.md) code of conduct.
43+
[Contributor Covenant](https://github.com/Shopify/ruby-lsp-rails/blob/main/CODE_OF_CONDUCT.md) code of conduct.
4444

4545
## License
4646

4747
The gem is available as open source under the terms of the
48-
[MIT License](https://github.com/Shopify/rails_ruby_lsp/blob/main/LICENSE.txt).
48+
[MIT License](https://github.com/Shopify/ruby-lsp-rails/blob/main/LICENSE.txt).

app/assets/config/rails_ruby_lsp_manifest.js

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//= link_directory ../stylesheets/ruby_lsp_rails .css

app/controllers/rails_ruby_lsp/application_controller.rb

Lines changed: 0 additions & 7 deletions
This file was deleted.

app/controllers/rails_ruby_lsp/models_controller.rb

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# typed: strict
2+
# frozen_string_literal: true
3+
4+
module RubyLsp
5+
module Rails
6+
class ApplicationController < ActionController::Base
7+
end
8+
end
9+
end
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# typed: strict
2+
# frozen_string_literal: true
3+
4+
module RubyLsp
5+
module Rails
6+
class ModelsController < ApplicationController
7+
extend T::Sig
8+
9+
sig { returns(T.untyped) }
10+
def show
11+
const = Object.const_get(params[:id]) # rubocop:disable Sorbet/ConstantsFromStrings
12+
13+
begin
14+
schema_file = ActiveRecord::Tasks::DatabaseTasks.schema_dump_path(const.connection.pool.db_config)
15+
rescue => e
16+
warn("Could not locate schema: #{e.message}")
17+
end
18+
19+
if const < ActiveRecord::Base
20+
render(json: {
21+
columns: const.columns.map { |column| [column.name, column.type] },
22+
schema_file: schema_file,
23+
})
24+
else
25+
head(:not_found)
26+
end
27+
rescue NameError, ActiveRecord::TableNotSpecified
28+
head(:not_found)
29+
end
30+
end
31+
end
32+
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# typed: strict
22
# frozen_string_literal: true
33

4-
module RailsRubyLsp
4+
module RubyLspRails
55
class ApplicationJob < ActiveJob::Base
66
end
77
end

app/mailers/rails_ruby_lsp/application_mailer.rb renamed to app/mailers/ruby_lsp_rails/application_mailer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# typed: strict
22
# frozen_string_literal: true
33

4-
module RailsRubyLsp
4+
module RubyLspRails
55
class ApplicationMailer < ActionMailer::Base
66
default from: "[email protected]"
77
layout "mailer"

app/models/rails_ruby_lsp/application_record.rb

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# typed: strict
2+
# frozen_string_literal: true
3+
4+
module RubyLsp
5+
module Rails
6+
class ApplicationRecord < ActiveRecord::Base
7+
self.abstract_class = true
8+
end
9+
end
10+
end

app/views/layouts/rails_ruby_lsp/application.html.erb renamed to app/views/layouts/ruby_lsp_rails/application.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>Rails ruby lsp</title>
4+
<title>Ruby LSP Rails</title>
55
<%= csrf_meta_tags %>
66
<%= csp_meta_tag %>
77

8-
<%= stylesheet_link_tag "rails_ruby_lsp/application", media: "all" %>
8+
<%= stylesheet_link_tag "ruby_lsp_rails/application", media: "all" %>
99
</head>
1010
<body>
1111

bin/rails

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# installed from the root of your application.
66

77
ENGINE_ROOT = File.expand_path("..", __dir__)
8-
ENGINE_PATH = File.expand_path("../lib/rails_ruby_lsp/engine", __dir__)
8+
ENGINE_PATH = File.expand_path("../lib/ruby_lsp_rails/engine", __dir__)
99
APP_PATH = File.expand_path("../test/dummy/config/application", __dir__)
1010

1111
# Set up gems listed in the Gemfile.

config/routes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# typed: strict
22
# frozen_string_literal: true
33

4-
RailsRubyLsp::Engine.routes.draw do
4+
RubyLsp::Rails::Engine.routes.draw do
55
resources :models, only: [:show]
66
end

dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: rails-ruby-lsp
1+
name: ruby-lsp-rails
22

33
type: ruby
44

lib/rails_ruby_lsp.rb

Lines changed: 0 additions & 9 deletions
This file was deleted.

lib/rails_ruby_lsp/engine.rb

Lines changed: 0 additions & 28 deletions
This file was deleted.

lib/rails_ruby_lsp/version.rb

Lines changed: 0 additions & 6 deletions
This file was deleted.

lib/ruby-lsp-rails.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# typed: strict
2+
# frozen_string_literal: true
3+
4+
require "sorbet-runtime"
5+
require "ruby_lsp_rails/version"
6+
require "ruby_lsp_rails/engine"
7+
8+
module RubyLSP
9+
module Rails
10+
end
11+
end

lib/ruby_lsp/rails_ruby_lsp/extension.rb

Lines changed: 0 additions & 24 deletions
This file was deleted.

lib/ruby_lsp/rails_ruby_lsp/hover.rb

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)