source_locator 0.0.4 → 0.0.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.
- data/bin/showme +25 -18
- data/lib/source_locator/dictionary.rb +4 -1
- data/lib/source_locator/version.rb +1 -1
- data/lib/source_locator.rb +1 -0
- metadata +40 -22
data/bin/showme
CHANGED
@@ -1,26 +1,33 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'source_locator'
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
rails_env_file = File.join(Dir.pwd, 'config', 'environment.rb')
|
7
|
+
data_dump_file = File.join(Dir.pwd,SourceLocator::IndexFile)
|
8
|
+
|
9
|
+
if File.exists? data_dump_file
|
10
|
+
data = YAML.parse File.open(data_dump_file).read
|
11
|
+
storage = SourceLocator::Dictionary.new data
|
12
|
+
else
|
13
|
+
if File.exists? rails_env_file
|
14
|
+
puts "Loading Rails env..."
|
15
|
+
require rails_env_file
|
16
|
+
end
|
17
|
+
|
18
|
+
if defined? Rails
|
19
|
+
puts "Rails loaded."
|
20
|
+
puts "Loading classes from the Rails app..."
|
21
|
+
Rails.application.eager_load!
|
22
|
+
puts "Done."
|
23
|
+
end
|
24
|
+
|
25
|
+
class_loader = SourceLocator::ClassLoader.new
|
26
|
+
data = class_loader.build
|
27
|
+
storage = SourceLocator::Dictionary.new data, data_dump_file
|
28
|
+
storage.export
|
17
29
|
end
|
18
30
|
|
19
|
-
class_loader = SourceLocator::ClassLoader.new
|
20
|
-
data = class_loader.build
|
21
|
-
|
22
|
-
storage = SourceLocator::Dictionary.new data
|
23
|
-
|
24
31
|
locater = SourceLocator::Locater.new(storage, ARGV[0])
|
25
32
|
results = locater.find
|
26
33
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module SourceLocator
|
2
2
|
class Dictionary
|
3
|
-
def initialize(data)
|
3
|
+
def initialize(data, dump_file)
|
4
4
|
@dict = data
|
5
5
|
end
|
6
6
|
|
@@ -9,6 +9,9 @@ module SourceLocator
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def export
|
12
|
+
File.open(dump_file) do |f|
|
13
|
+
f.puts @dict.to_yaml
|
14
|
+
end
|
12
15
|
end
|
13
16
|
end
|
14
17
|
end
|
data/lib/source_locator.rb
CHANGED
metadata
CHANGED
@@ -1,24 +1,33 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: source_locator
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Unnikrishnan KP
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
17
|
+
|
18
|
+
date: 2012-11-18 00:00:00 Z
|
13
19
|
dependencies: []
|
20
|
+
|
14
21
|
description: Source code locater
|
15
|
-
email:
|
22
|
+
email:
|
16
23
|
- unni.tallman@gmail.com
|
17
|
-
executables:
|
24
|
+
executables:
|
18
25
|
- showme
|
19
26
|
extensions: []
|
27
|
+
|
20
28
|
extra_rdoc_files: []
|
21
|
-
|
29
|
+
|
30
|
+
files:
|
22
31
|
- .gitignore
|
23
32
|
- Gemfile
|
24
33
|
- LICENSE
|
@@ -33,29 +42,38 @@ files:
|
|
33
42
|
- lib/source_locator/locater.rb
|
34
43
|
- lib/source_locator/version.rb
|
35
44
|
- source_locator.gemspec
|
36
|
-
homepage:
|
45
|
+
homepage: ""
|
37
46
|
licenses: []
|
47
|
+
|
38
48
|
post_install_message:
|
39
49
|
rdoc_options: []
|
40
|
-
|
50
|
+
|
51
|
+
require_paths:
|
41
52
|
- lib
|
42
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
43
54
|
none: false
|
44
|
-
requirements:
|
45
|
-
- -
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
|
48
|
-
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
59
|
+
segments:
|
60
|
+
- 0
|
61
|
+
version: "0"
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
63
|
none: false
|
50
|
-
requirements:
|
51
|
-
- -
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
hash: 3
|
68
|
+
segments:
|
69
|
+
- 0
|
70
|
+
version: "0"
|
54
71
|
requirements: []
|
72
|
+
|
55
73
|
rubyforge_project:
|
56
|
-
rubygems_version: 1.8.
|
74
|
+
rubygems_version: 1.8.24
|
57
75
|
signing_key:
|
58
76
|
specification_version: 3
|
59
77
|
summary: Source code locater
|
60
78
|
test_files: []
|
61
|
-
|
79
|
+
|