method-ray 0.1.0-x86_64-linux

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: cbe7b7adf56325e243993614e31974b6fe20022b50f4ddc43cd91318db846a9b
4
+ data.tar.gz: b4dfdc516218712b8190328ac5a12c99da5f4d31faef2d5304c3077c2ad9732a
5
+ SHA512:
6
+ metadata.gz: 5d5a3da658afe72dfaf0cc32112979bc81764f49781487de639bf7241837e39f0f1640292e004cf7a60c88875dbd11718356828cdb919fadc7bfa870bff4c3da
7
+ data.tar.gz: 2e39cc17005f164fd0851bd9e548561d6b2d8c4f4ef50a3118b55c00304260b92602e369b306163c616840f655c4cb74c94a89a33c9d81e8535db51b669c1224
data/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] - 2025-01-18
9
+
10
+ ### Added
11
+
12
+ - Initial release
13
+ - `methodray check` - Static type checking for Ruby files
14
+
15
+ [0.1.0]: https://github.com/dak2/method-ray/releases/tag/v0.1.0
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Daichi Kamiyama
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # Method-Ray
2
+
3
+ A fast static callable method checker for Ruby code.
4
+
5
+ ## Requirements
6
+
7
+ Method-Ray supports Ruby 3.4 or later.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ gem install methodray
13
+ ```
14
+
15
+ ## Quick Start
16
+
17
+ ### VSCode Extension
18
+
19
+ 1. Install the [Method-Ray VSCode extension](https://github.com/dak2/method-ray-vscode)
20
+ 2. Open a Ruby file in VSCode
21
+ 3. Errors will be highlighted automatically
22
+
23
+ ### CLI
24
+
25
+ ```bash
26
+ # Check a single file
27
+ bundle exec methodray check app/models/user.rb
28
+
29
+ # Watch mode - auto re-check on file changes
30
+ bundle exec methodray watch app/models/user.rb
31
+ ```
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at this repository!
36
+
37
+ ## License
38
+
39
+ MIT License. See [LICENSE](https://github.com/dak2/method-ray/blob/main/LICENSE) file for details.
data/exe/methodray ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require_relative '../lib/methodray'
5
+ require_relative '../lib/methodray/cli'
6
+
7
+ MethodRay::CLI.start(ARGV)
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'commands'
4
+
5
+ module MethodRay
6
+ class CLI
7
+ def self.start(args)
8
+ command = args.shift
9
+
10
+ case command
11
+ when 'help', '--help', '-h', nil
12
+ Commands.help
13
+ when 'version', '--version', '-v'
14
+ Commands.version
15
+ when 'check'
16
+ Commands.check(args)
17
+ when 'watch'
18
+ Commands.watch(args)
19
+ when 'clear-cache'
20
+ Commands.clear_cache(args)
21
+ else
22
+ puts "Unknown command: #{command}"
23
+ Commands.help
24
+ exit 1
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,78 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MethodRay
4
+ module Commands
5
+ COMMANDS_DIR = __dir__
6
+
7
+ class << self
8
+ def help
9
+ puts <<~HELP
10
+ MethodRay v#{MethodRay::VERSION} - A fast static analysis tool for Ruby methods.
11
+
12
+ Usage:
13
+ methodray help # Show this help
14
+ methodray version # Show version
15
+ methodray check [FILE] [OPTIONS] # Type check a Ruby file
16
+ methodray watch FILE # Watch file for changes and auto-check
17
+ methodray clear-cache # Clear RBS method cache
18
+
19
+ Examples:
20
+ methodray check app/models/user.rb
21
+ methodray watch app/models/user.rb
22
+ HELP
23
+ end
24
+
25
+ def version
26
+ puts "MethodRay v#{MethodRay::VERSION}"
27
+ end
28
+
29
+ def check(args)
30
+ exec_rust_cli('check', args)
31
+ end
32
+
33
+ def watch(args)
34
+ exec_rust_cli('watch', args)
35
+ end
36
+
37
+ def clear_cache(args)
38
+ exec_rust_cli('clear-cache', args)
39
+ end
40
+
41
+ private
42
+
43
+ def exec_rust_cli(command, args)
44
+ binary_path = find_rust_binary
45
+
46
+ unless binary_path
47
+ warn 'Error: CLI binary not found.'
48
+ warn ''
49
+ warn 'For development, build with:'
50
+ warn ' cd rust && cargo build --release --bin methodray --features cli'
51
+ warn ''
52
+ warn 'If installed via gem, this might be a platform compatibility issue.'
53
+ warn 'Please report at: https://github.com/dak2/method-ray/issues'
54
+ exit 1
55
+ end
56
+
57
+ exec(binary_path, command, *args)
58
+ end
59
+
60
+ def find_rust_binary
61
+ # Platform-specific binary name
62
+ cli_binary = Gem.win_platform? ? 'methodray-cli.exe' : 'methodray-cli'
63
+ legacy_binary = Gem.win_platform? ? 'methodray.exe' : 'methodray'
64
+
65
+ candidates = [
66
+ # CLI binary built during gem install (lib/methodray directory)
67
+ File.expand_path(cli_binary, COMMANDS_DIR),
68
+ # Development: target/release (project root)
69
+ File.expand_path("../../target/release/#{cli_binary}", COMMANDS_DIR),
70
+ # Development: rust/target/release (legacy standalone binary)
71
+ File.expand_path("../../rust/target/release/#{legacy_binary}", COMMANDS_DIR)
72
+ ]
73
+
74
+ candidates.find { |path| File.executable?(path) }
75
+ end
76
+ end
77
+ end
78
+ end
Binary file
Binary file
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MethodRay
4
+ VERSION = '0.1.0'
5
+ end
data/lib/methodray.rb ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rbs'
4
+ require_relative 'methodray/version'
5
+ require_relative 'methodray/methodray' # ネイティブ拡張
6
+
7
+ module MethodRay
8
+ class Error < StandardError; end
9
+ end
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: method-ray
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: x86_64-linux
6
+ authors:
7
+ - dak2
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: rbs
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '3.0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '3.0'
26
+ description: A static analysis tool that checks the callability of methods in Ruby
27
+ code.
28
+ email:
29
+ - dak2.dev@gmail.com
30
+ executables:
31
+ - methodray
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - CHANGELOG.md
36
+ - LICENSE
37
+ - README.md
38
+ - exe/methodray
39
+ - lib/methodray.rb
40
+ - lib/methodray/cli.rb
41
+ - lib/methodray/commands.rb
42
+ - lib/methodray/methodray-cli
43
+ - lib/methodray/methodray.so
44
+ - lib/methodray/version.rb
45
+ homepage: https://github.com/dak2/method-ray
46
+ licenses:
47
+ - MIT
48
+ metadata: {}
49
+ rdoc_options: []
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 3.4.0
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ requirements: []
63
+ rubygems_version: 3.6.9
64
+ specification_version: 4
65
+ summary: Method-Ray is a fast static analysis tool for Ruby methods.
66
+ test_files: []