geo_combine 0.0.2 → 0.0.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66720182889b98a3b1ef96cbdf22f454a90550bf
4
- data.tar.gz: 5ec28f72313b22ba934b0ee3e093fedbfcc0c4d7
3
+ metadata.gz: 5783dffed9a83f91f83260196363a9a0d8913f88
4
+ data.tar.gz: e12b7305ad32f141e5a98543f6c908a95ee7d483
5
5
  SHA512:
6
- metadata.gz: 89d15e4a3612d245b017cbcd901a460670e55c6c4c49add06b29da0e56ae3a2c8a4d2fbecf28fa1cfb5e41768da9817b029219007df823343a2cb8b16d84e98e
7
- data.tar.gz: ced995dcb3f7cefb677ee22cfb95c09c99293875e509cb197f53d9aaf2c63e269dce9fe7011a90c2bd0b2a794a0be4b06336c5b5b095c10d19b16eac11140e13
6
+ metadata.gz: 0bf4f267d66ce5a491854a25dc3909b8ac9d00398e0e99fcadfb03eecf5c79370fcc76a55791565729a75d499beadc03c3ce530a8fbe09af551c3b7665658035
7
+ data.tar.gz: 44bcd08fda5b8206cf8ab073dfcf46b6faf4394dfb1c74b8a90c4c6699a12c9601311146dbc6ca15a2a3c74ada652094556803795d112a702fb0a13bf0d4a86b
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # GeoCombine
2
2
 
3
+ [![Build Status](https://travis-ci.org/OpenGeoMetadata/GeoCombine.svg?branch=master)](https://travis-ci.org/OpenGeoMetadata/GeoCombine) | [![Coverage Status](https://coveralls.io/repos/OpenGeoMetadata/GeoCombine/badge.svg?branch=master)](https://coveralls.io/r/OpenGeoMetadata/GeoCombine?branch=master)
4
+
5
+
6
+
3
7
  A Ruby toolkit for managing geospatial metadata
4
8
 
5
9
  ## Installation
@@ -32,6 +36,9 @@ GeoCombine can be used as a set of rake tasks for cloning, updating, and indexin
32
36
 
33
37
  # Convert that to JSON
34
38
  > iso_metadata.to_geoblacklight.to_json
39
+
40
+ # Convert ISO or FGDC to HTML
41
+ > iso_metadata.to_html
35
42
  ```
36
43
 
37
44
  ### Clone all OpenGeoMetadata repositories
@@ -6,9 +6,16 @@ module GeoCombine
6
6
 
7
7
  ##
8
8
  # Returns a Nokogiri::XSLT object containing the FGDC to GeoBlacklight XSL
9
- # @return (Nokogiri::XSLT)
10
- def xsl
9
+ # @return [Nokogiri::XSLT]
10
+ def xsl_geoblacklight
11
11
  Nokogiri::XSLT(File.read('./lib/xslt/fgdc2geoBL.xsl'))
12
12
  end
13
+
14
+ ##
15
+ # Returns a Nokogiri::XSLT object containing the ISO19139 to HTML XSL
16
+ # @return [Nokogiri:XSLT]
17
+ def xsl_html
18
+ Nokogiri::XSLT(File.read('./lib/xslt/fgdc2html.xsl'))
19
+ end
13
20
  end
14
21
  end
@@ -4,9 +4,16 @@ module GeoCombine
4
4
  ##
5
5
  # Returns a Nokogiri::XSLT object containing the ISO19139 to GeoBlacklight
6
6
  # XSL
7
- # @return (Nokogiri::XSLT)
8
- def xsl
7
+ # @return [Nokogiri::XSLT]
8
+ def xsl_geoblacklight
9
9
  Nokogiri::XSLT(File.read('./lib/xslt/iso2geoBL.xsl'))
10
10
  end
11
+
12
+ ##
13
+ # Returns a Nokogiri::XSLT object containing the ISO19139 to HTML XSL
14
+ # @return [Nokogiri:XSLT]
15
+ def xsl_html
16
+ Nokogiri::XSLT(File.read('./lib/xslt/iso2html.xsl'))
17
+ end
11
18
  end
12
19
  end
@@ -1,3 +1,3 @@
1
1
  module GeoCombine
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
data/lib/geo_combine.rb CHANGED
@@ -17,7 +17,7 @@ module GeoCombine
17
17
  ##
18
18
  # Creates a new GeoCombine::Metadata object, where metadata parameter is can
19
19
  # be a File path or String of XML
20
- # @param (String) metadata can be a File path
20
+ # @param [String] metadata can be a File path
21
21
  # "./tmp/edu.stanford.purl/bb/338/jh/0716/iso19139.xml" or a String of XML
22
22
  # metadata
23
23
  def initialize metadata
@@ -28,8 +28,16 @@ module GeoCombine
28
28
 
29
29
  ##
30
30
  # Perform an XSLT tranformation on metadata using an object's XSL
31
+ # @return [GeoCombine::Geoblacklight] the data transformed into geoblacklight schema, returned as a GeoCombine::Geoblacklight
31
32
  def to_geoblacklight
32
- GeoCombine::Geoblacklight.new(xsl.transform(@metadata))
33
+ GeoCombine::Geoblacklight.new(xsl_geoblacklight.transform(@metadata))
34
+ end
35
+
36
+ ##
37
+ # Perform an XSLT transformation to HTML using an object's XSL
38
+ # @return [String] the xml transformed to an HTML String
39
+ def to_html
40
+ xsl_html.transform(@metadata).to_html
33
41
  end
34
42
  end
35
43
  end