source_locator 0.0.5 → 0.0.6

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 CHANGED
@@ -7,8 +7,11 @@ rails_env_file = File.join(Dir.pwd, 'config', 'environment.rb')
7
7
  data_dump_file = File.join(Dir.pwd,SourceLocator::IndexFile)
8
8
 
9
9
  if File.exists? data_dump_file
10
- data = YAML.parse File.open(data_dump_file).read
11
- storage = SourceLocator::Dictionary.new data
10
+ data = {}
11
+ File.open(data_dump_file) do |f|
12
+ data = Marshal.load(f)
13
+ end
14
+ storage = SourceLocator::Dictionary.new data, data_dump_file
12
15
  else
13
16
  if File.exists? rails_env_file
14
17
  puts "Loading Rails env..."
@@ -2,6 +2,7 @@ module SourceLocator
2
2
  class Dictionary
3
3
  def initialize(data, dump_file)
4
4
  @dict = data
5
+ @dump_file = dump_file
5
6
  end
6
7
 
7
8
  def find(method)
@@ -9,8 +10,8 @@ module SourceLocator
9
10
  end
10
11
 
11
12
  def export
12
- File.open(dump_file) do |f|
13
- f.puts @dict.to_yaml
13
+ File.open(@dump_file, 'w+') do |f|
14
+ Marshal.dump(@dict, f)
14
15
  end
15
16
  end
16
17
  end
@@ -1,3 +1,3 @@
1
1
  module SourceLocator
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: source_locator
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Unnikrishnan KP