xamplr 1.9.3 → 1.9.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 1
3
3
  :minor: 9
4
- :patch: 3
4
+ :patch: 4
5
5
  :build:
@@ -251,6 +251,7 @@ module Xampl
251
251
  class_cache[class_name] = result_class
252
252
  end
253
253
 
254
+
254
255
  self.lookup(result_class, result['pid'])
255
256
  end
256
257
 
@@ -490,6 +491,10 @@ module Xampl
490
491
  place_dir = File.join( @files_dir, place_dir )
491
492
  mentions = Set.new
492
493
  xampl_in_xml = represent(xampl, mentions)
494
+ unless xampl_in_xml && 0 < xampl_in_xml.size then
495
+ puts "Cannot persist #{ xampl } because representation is unobtainable"
496
+ return
497
+ end
493
498
 
494
499
  #get rid of any supplimentary indexes associated with this xampl object
495
500
  # TODO -- This can be slow
@@ -581,26 +586,30 @@ module Xampl
581
586
  end
582
587
 
583
588
  note_errors("TC[[#{ @filename }]]:: write error: %s\n") do
584
- if Xampl.raw_persister_options[:write_through] then
585
- FileUtils.mkdir_p(place_dir) unless File.exist?(place_dir)
586
- file_place = "#{ @files_dir }/#{ place }"
587
- File.open(file_place, "w") do |out|
588
- out.write xampl_hash['xampl']
589
- if :sync == Xampl.raw_persister_options[:write_through] then
590
- out.fsync
591
- if $is_darwin then
592
- out.fcntl(51, 0) # Attempt an F_FULLFSYNC fcntl to commit data to disk (darwin *ONLY*)
589
+ begin
590
+ if Xampl.raw_persister_options[:write_through] then
591
+ FileUtils.mkdir_p(place_dir) unless File.exist?(place_dir)
592
+ file_place = "#{ @files_dir }/#{ place }"
593
+ File.open(file_place, "w") do |out|
594
+ out.write xampl_hash['xampl']
595
+ if :sync == Xampl.raw_persister_options[:write_through] then
596
+ out.fsync
597
+ if $is_darwin then
598
+ out.fcntl(51, 0) # Attempt an F_FULLFSYNC fcntl to commit data to disk (darwin *ONLY*)
599
+ end
593
600
  end
594
601
  end
595
- end
596
- if index_info[:primary] && 0 < index_info[:secondary].size then
597
- file_place += ".idx"
598
- File.open(file_place, "w") do |out|
599
- out.write index_info.to_yaml
602
+ if index_info[:primary] && 0 < index_info[:secondary].size then
603
+ file_place += ".idx"
604
+ File.open(file_place, "w") do |out|
605
+ out.write index_info.to_yaml
606
+ end
600
607
  end
601
608
  end
609
+ rescue => e
610
+ puts "#{ File.basename __FILE__ }:#{ __LINE__ } [#{__method__}] write through failed #{ xampl }"
602
611
  end
603
-
612
+
604
613
  @tc_db.put(place, xampl_hash)
605
614
  end
606
615
 
data/xamplr.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{xamplr}
8
- s.version = "1.9.3"
8
+ s.version = "1.9.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Bob Hutchison"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xamplr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.3
4
+ version: 1.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Hutchison