Skip to content
This repository
Browse code

added issn registry

  • Loading branch information...
commit f0b5173862ca16cb2f0d53a10ddbb49f9cdcacd8 1 parent 6162e0e
Sylvester Keil authored August 04, 2012
4  spec/independent_styles_spec.rb
... ...
@@ -1,7 +1,7 @@
1 1
 Independents.each_pair do |id, (filename, path, style)|
2 2
 
3 3
   describe "independent style #{id}" do
4  
-
  4
+    
5 5
     it "is a valid CSL 1.0 style" do
6 6
       CSL.validate(path).should == []
7 7
     end
@@ -77,7 +77,7 @@
77 77
             style.macros.should have_key(node[:macro])
78 78
           end
79 79
         end
80  
-      end
  80
+      end      
81 81
     end
82 82
 
83 83
   end
5  spec/repository_spec.rb
@@ -11,4 +11,9 @@
11 11
   it "does not contain any duplicate file names" do
12 12
     (Independents.keys & Dependents.keys).should be_empty
13 13
   end
  14
+
  15
+  # it "contains no duplicate ISSNs" do
  16
+  #   ISSN.select { |k,v| v.length > 1 }.should == []
  17
+  # end
  18
+  
14 19
 end
10  spec/spec_helper.rb
@@ -2,6 +2,8 @@
2 2
 
3 3
 STYLE_ROOT = File.expand_path('../..', __FILE__)
4 4
 
  5
+ISSN = Hash.new { |h,k| h[k] = [] }
  6
+
5 7
 def load_style(path)
6 8
   filename = File.basename(path)
7 9
   id = filename[0..-5]
@@ -11,7 +13,13 @@ def load_style(path)
11 13
   rescue
12 14
     # failed to parse the style. we'll report the error later
13 15
   end
14  
-  
  16
+
  17
+  begin    
  18
+    ISSN[style.info.issn.to_s] << id if style.info.has_issn?
  19
+  rescue
  20
+    warn "Failed to extract ISSN of style #{id}"
  21
+  end
  22
+
15 23
   [id, [filename, path, style]]
16 24
 end
17 25
 

0 notes on commit f0b5173

Please sign in to comment.
Something went wrong with that request. Please try again.