erb_lint_daemon 0.1.4 → 0.1.5

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: aa7eed35cc085c04ff080b681c399889b01945d80940254c719f0d803e684d93
4
- data.tar.gz: '01492be529e480995bec50f8c2ed0a3f1ef40d2814b166fd06c17889842c0611'
3
+ metadata.gz: 8fb7f0e992a2e5c72c8dea3ea44af38886f1bafce347a6bfeaf7da07b9f55c60
4
+ data.tar.gz: 2f64baf0dccb1e991763da5f99d7dc8a120c8452f0e007ba10dbab7fd40f9c4b
5
5
  SHA512:
6
- metadata.gz: 53fca250bfbd43dbbda153e9ed7f39f6a627bd2908b59e96e69d08d44a9aa8cbbadacdc3dfd13df3b933b0ddc84aa64e608ff0b76cad819f8e51e4c5421e530f
7
- data.tar.gz: 62f4468f1a7c8ca8fd2768b755dee42f45be4eb826d28ec1275c39ad87669c0b878467a57bb1115238d294562692dd2c0621212d648510fa9d3ea0791212306c
6
+ metadata.gz: f3849ad7e1129f50145c1d79c363fab93f34735f69ea2c14df0f2706c5f4f95d41b3e45dec9b313b85062bffa73ee4e2046a60178edb523dd8835f5e916a599d
7
+ data.tar.gz: 5a9b13aa17e412b32a4c99a7857f41a4084b559581a57c39bb537859be958aa77dfb40eddd1ee4e13979888c191d7f064e7059442a344e109aa734fb7aa406a1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- erb_lint_daemon (0.1.4)
4
+ erb_lint_daemon (0.1.5)
5
5
  erb_lint
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -36,13 +36,13 @@ ruby -r erb_lint_daemon/server -e 'ErbLintDaemon::Server.new.start'
36
36
 
37
37
  By default, RubyGems creates a Ruby wrapper for the `erb_lint_daemon` command, which adds ~100ms of overhead. To get the full performance benefit, you should call the compiled Go binary directly.
38
38
 
39
- You can create a symlink to the fast binary:
40
-
41
- ```bash
42
- ln -s $(gem which erb_lint_daemon | sed 's|lib/erb_lint_daemon.rb|bin/erb_lint_client_bin|') /usr/local/bin/erb_lint_fast
43
- ```
44
-
45
- Now you can use `erb_lint_fast` for instant results!
39
+ You can automatically create a symlink to the fast binary:
40
+ +
41
+ +```bash
42
+ +erb_lint_daemon --setup
43
+ +```
44
+ +
45
+ +Now you can use `erb_lint_fast` for instant results!
46
46
 
47
47
  ## Development
48
48
 
data/bin/erb_lint_daemon CHANGED
@@ -1,5 +1,25 @@
1
1
  #!/usr/bin/env ruby
2
2
  # Wrapper to execute the compiled Go client
3
- # We expect the binary to be in the same directory as this script
4
3
  binary = File.join(File.dirname(__FILE__), 'erb_lint_client_bin')
4
+
5
+ if ARGV.include?('--setup')
6
+ target = '/usr/local/bin/erb_lint_fast'
7
+ puts "Attempting to symlink #{binary} to #{target}..."
8
+
9
+ if File.exist?(target)
10
+ print "#{target} already exists. Overwrite? [y/N] "
11
+ exit(0) unless gets.chomp.downcase == 'y'
12
+ system("sudo rm #{target}")
13
+ end
14
+
15
+ if system("sudo ln -s #{binary} #{target}")
16
+ puts "Successfully created symlink!"
17
+ puts "You can now use 'erb_lint_fast' for instant linting."
18
+ else
19
+ puts "Failed to create symlink. You might need to do it manually:"
20
+ puts " sudo ln -s #{binary} #{target}"
21
+ end
22
+ exit(0)
23
+ end
24
+
5
25
  exec(binary, *ARGV)
@@ -35,11 +35,8 @@ Gem::Specification.new do |spec|
35
35
  NOTE: To achieve the maximum performance (~20ms startup), you should run the
36
36
  compiled binary directly to bypass the RubyGems wrapper overhead (~100ms).
37
37
 
38
- The binary is located at:
39
- <GEM_HOME>/gems/erb_lint_daemon-#{ErbLintDaemon::VERSION}/bin/erb_lint_client_bin
40
-
41
- You can symlink it to your path, e.g.:
42
- ln -s $(gem which erb_lint_daemon | sed 's|lib/erb_lint_daemon.rb|bin/erb_lint_client_bin|') /usr/local/bin/erb_lint_client
38
+ You can automatically create a symlink by running:
39
+ erb_lint_daemon --setup
43
40
  --------------------------------------------------------------------------------
44
41
  MESSAGE
45
42
  end
@@ -1,3 +1,3 @@
1
1
  module ErbLintDaemon
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erb_lint_daemon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owais Khan
@@ -77,11 +77,8 @@ post_install_message: |
77
77
  NOTE: To achieve the maximum performance (~20ms startup), you should run the
78
78
  compiled binary directly to bypass the RubyGems wrapper overhead (~100ms).
79
79
 
80
- The binary is located at:
81
- <GEM_HOME>/gems/erb_lint_daemon-0.1.4/bin/erb_lint_client_bin
82
-
83
- You can symlink it to your path, e.g.:
84
- ln -s $(gem which erb_lint_daemon | sed 's|lib/erb_lint_daemon.rb|bin/erb_lint_client_bin|') /usr/local/bin/erb_lint_client
80
+ You can automatically create a symlink by running:
81
+ erb_lint_daemon --setup
85
82
  --------------------------------------------------------------------------------
86
83
  rdoc_options: []
87
84
  require_paths: