rsense-server 0.5.8 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 511381f86e3b19b398abc58774ccc15fa950fbdb
4
- data.tar.gz: e9d6d0c49866f8b4467d44b7fc32826f1fa116f7
3
+ metadata.gz: d9434d2e554a2a1e1c4787f89ef5cedbe1b9e4c1
4
+ data.tar.gz: 819f7f6b5f73f2540aba167fb5ea57b08bb9dd44
5
5
  SHA512:
6
- metadata.gz: cd8d2e35f50ab60d0853f4f5ccbc0171aef0af2fa109ea5654393a21b273c8964549d1718febb9d0989b5c391cd30ecb656b1089c5597757bf6e3e13b9217296
7
- data.tar.gz: e770e4cc10859b7d2ec41ad00e516f1fc6fca56b55eb3fec35dd50608cc32c08b90e3563b73bad93ee1652760cd24ab5e60970d086110bb3bd39ee002a7f9ef8
6
+ metadata.gz: b3f85383a74b6d9df2774ca005c7846fd3855bbb6f7cfd601d49ce386aaad36615f3e7a4d5935fc02420734cf45bb8770cc1eea9aaf080bcfecaf4299d55b117
7
+ data.tar.gz: 68d849014cdda37efcfd257012c6bd593cc2a7e593e0479ba693144f364ea917974899aba465ab23af274ecd74dcdc303e71fadc8f4cdd0fe1684b2e319dbef2
data/bin/_rsense.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "rsense/server"
4
4
  require "rsense/server/config"
5
+ require "rsense/server/command/preload"
5
6
  require "optparse"
6
7
 
7
8
  SOCKET_PATH = '127.0.0.1:'
@@ -51,7 +52,14 @@ class ProjectManager
51
52
  attr_accessor :roptions, :rcommand, :rproject
52
53
  end
53
54
 
55
+ def projman_set_up(projman, options)
56
+ options[:path] ||= "."
57
+ path = Pathname.new(options[:path]).expand_path
58
+ Rsense::Server::Command::Preload.load(projman, path)
59
+ end
60
+
54
61
  PROJMAN = ProjectManager.new
62
+ projman_set_up(PROJMAN, options)
55
63
 
56
64
  require "puma"
57
65
  require "sinatra"
@@ -0,0 +1,28 @@
1
+ module Rsense
2
+ module Server
3
+ module Command
4
+ module Preload
5
+
6
+ def stub_data(path)
7
+ filepath = path.join("/lib/code.rb")
8
+ {
9
+ "command"=>"code_completion",
10
+ "project" => path.to_s,
11
+ "file" => filepath.to_s,
12
+ "code" => "def check(testarg)\n testarg\nend\ncheck('hello')",
13
+ "location" => { "row" => 2, "column" => 10 }
14
+ }
15
+ end
16
+ module_function :stub_data
17
+
18
+ def load(project_manager, path)
19
+ PROJMAN.roptions = Rsense::Server::Options.new(stub_data(path))
20
+ PROJMAN.rcommand = Rsense::Server::Command::Command.new(PROJMAN.roptions)
21
+ end
22
+
23
+ module_function :load
24
+
25
+ end
26
+ end
27
+ end
28
+ end
@@ -16,14 +16,18 @@ class Rsense::Server::Config
16
16
  @errors = []
17
17
  end
18
18
 
19
- def search(path_str="~")
19
+ def search(path_str="~", level=0)
20
+ level = level + 1
20
21
  path = FileTree.new(path_str)
21
22
  return if @searched.include?(path)
22
23
  @searched << path
23
24
  conf = path.join(".rsense").expand_path
24
25
  unless conf.exist?
25
- unless path.parent == path
26
- conf = search(path.parent)
26
+ if path.parent == path || level == 3
27
+ contender = Pathname.new("~").join(".rsense").expand_path
28
+ conf = contender if contender.exist?
29
+ else
30
+ conf = search(path.parent, level)
27
31
  end
28
32
  end
29
33
  conf
@@ -1,5 +1,5 @@
1
1
  module Rsense
2
2
  module Server
3
- VERSION = "0.5.8"
3
+ VERSION = "0.5.9"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsense-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.8
4
+ version: 0.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric West
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-06-23 00:00:00.000000000 Z
12
+ date: 2014-06-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rsense-core
@@ -230,6 +230,7 @@ files:
230
230
  - lib/rsense/server/command/alias_native_method.rb
231
231
  - lib/rsense/server/command/completion_result.rb
232
232
  - lib/rsense/server/command/native_attr_method.rb
233
+ - lib/rsense/server/command/preload.rb
233
234
  - lib/rsense/server/command/rsense_method.rb
234
235
  - lib/rsense/server/command/special_meth.rb
235
236
  - lib/rsense/server/command/type_inference_method.rb