sqlsnip 0.2.1 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/exe/sqlsnip +17 -4
  3. data/lib/sqlsnip/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eff6793c0897ff170d7113e76b9599ebba9e781a17a7c79f0e290072f51b8126
4
- data.tar.gz: 18cb83ef312352f398989ad01f96bff419db7cf755d1c93d891bb9c8cc641c08
3
+ metadata.gz: b168b2c36faf3caa780d2ad91300cd40c8a55ea762c13a0417334a8e0819f0d0
4
+ data.tar.gz: 473e5732ced5119690d24204b1a02e1cf91a36e1793d70fa6114a0dc976bebe9
5
5
  SHA512:
6
- metadata.gz: 2b28921c49c85b91418e74a5e193431187778fa84a274c5a3d894b03fc0269da4cec30955d551123eb1451f7af325cf67115b75068a604cbae38b290f71e5e09
7
- data.tar.gz: 1836d49c1dc2f46f4889d92243b2b59452017ccabb68af0ed261ab62b2d5990ff0a0bee7627b4580a219b1a6e13e81fc5d117b6f6ad2364b0625fece9fd47fc8
6
+ metadata.gz: 994efc1c387cd1a2b35f0e21e20fb43aa9e912852f87a6f064e7889019ae5a5bb483faea69af18374fe11cb19b24ebc0fad38b80dca3355c14b309cd6d568b58
7
+ data.tar.gz: b16c28f4e078aab3c20a7c28c8eabd0f6d577071e30305a021d4a4b618649db23c0b138fd41e15f00cda1aec2a23d1960bb93cd5f7de57274f01e46f8b93a9c0
data/exe/sqlsnip CHANGED
@@ -68,14 +68,14 @@ SPEC = %(
68
68
 
69
69
  ...or to just replace the current selected text with drop statements
70
70
 
71
- \\function! ReplaceSqlRange() range " ChatGPT
71
+ \\function! ReplaceSqlRange() range
72
72
  let start_line = line("'<")
73
73
  let end_line = line("'>")
74
74
  let save_cursor = getpos('.')
75
75
  let range_text = getline(start_line, end_line)
76
76
  let path = expand('%:p')
77
- let shell_output = system('bundle exec exe/sqlsnip -ds"" ' . path)
78
- let shell_output_lines = split(shell_output, "\n")
77
+ let shell_output = system('exe/sqlsnip -ds"" ' . path)
78
+ let shell_output_lines = split(shell_output, "\\n")
79
79
  call deletebufline('%', start_line, end_line)
80
80
  call append(start_line - 1, shell_output_lines)
81
81
  call setpos('.', save_cursor)
@@ -83,7 +83,6 @@ SPEC = %(
83
83
 
84
84
  " CTRL+I - insert drop statements
85
85
  map <C-I> :call ReplaceSqlRange()<CR>
86
-
87
86
  )
88
87
 
89
88
  opts, args = ShellOpts.process(SPEC, ARGV)
@@ -101,3 +100,17 @@ if !opts.drop_only?
101
100
  puts source.lines
102
101
  end
103
102
 
103
+ __END__
104
+ \\function! ReplaceSqlRange() range
105
+ let start_line = line("'<")
106
+ let end_line = line("'>")
107
+ let save_cursor = getpos('.')
108
+ let range_text = getline(start_line, end_line)
109
+ let path = expand('%:p')
110
+ let shell_output = system('exe/sqlsnip -ds"" ' . path)
111
+ let shell_output_lines = split(shell_output, "\n")
112
+ call deletebufline('%', start_line, end_line)
113
+ call append(start_line - 1, shell_output_lines)
114
+ call setpos('.', save_cursor)
115
+ endfunction
116
+
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sqlsnip
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqlsnip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claus Rasmussen