rgeoserver 0.5.4 → 0.5.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/Gemfile CHANGED
@@ -2,7 +2,6 @@ source "http://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- #gem 'rake', '0.8.7'
6
- gem 'activemodel', "~> 3.1.1"
5
+ gem 'activemodel'
7
6
 
8
7
 
data/README.rdoc CHANGED
@@ -17,6 +17,8 @@ http://docs.geoserver.org/stable/en/user/restconfig/rest-config-api.html
17
17
 
18
18
  == Example:
19
19
 
20
+ Sample usage from an irb console
21
+
20
22
  > catalog = RGeoServer::Catalog.new :user=>"admin", :url=>"http://10.0.0.2/geoserver/rest", :password=>"osgeo!"
21
23
  => Catalog: http://10.0.0.2/geoserver/rest
22
24
  > w = catalog.get_workspace('topp')
@@ -30,6 +32,16 @@ http://docs.geoserver.org/stable/en/user/restconfig/rest-config-api.html
30
32
  > ft.profile
31
33
  => {:name=>"states", :workspace=>"topp", :nativeName=>"states"}
32
34
 
35
+ > lyr = RGeoServer::Layer.new c, :name => 'Arc_Sample'
36
+ => RGeoServer::Layer: Arc_Sample
37
+ > lyr.profile
38
+ => {"name"=>"Arc_Sample", "path"=>"/", "defaultstyle"=>"rain", "styles"=>["raster"], "type"=>"RASTER", "enabled"=>"true", "attribution"=>{"logoWidth"=>"0", "logoHeight"=>"0"}, "resource"=>{"type"=>"coverage", "name"=>"Arc_Sample", "store"=>"arcGridSample", "workspace"=>"nurc"}, "metadata"=>{"GWC.autoCacheStyles"=>"true", "GWC.metaTilingX"=>"4", "GWC.metaTilingY"=>"4", "GWC.gutter"=>"0", "GWC.cachedNonDefaultStyles"=>"raster", "GWC.enabled"=>"true", "GWC.cacheFormats"=>"image/jpeg,image/png", "GWC.gridSets"=>"EPSG:4326,EPSG:900913"}}
39
+ > sld = lyr.styles.first
40
+ => RGeoServer::Style: raster
41
+ > sld.profile
42
+ => {"name"=>"raster", "sld_version"=>"1.0.0", "filename"=>"raster.sld", "sld"=>{"sld_name"=>"raster", "sld_title"=>"Default Raster"}}
43
+
44
+
33
45
  A full sample script creating coverage stores in a small cluster:
34
46
 
35
47
  require 'rgeoserver'
@@ -62,13 +74,33 @@ A full sample script creating coverage stores in a small cluster:
62
74
 
63
75
  == Testing
64
76
  We use {jettywrapper}[https://github.com/projecthydra/jettywrapper] to wrap a test instance of GeoServer. In theory, you should be able to point to any other local installation. Suppose that you download the binary stable version 2.1.3 binary from {here}[http://sourceforge.net/project/downloading.php?groupname=geoserver&filename=geoserver-2.1.3-bin.zip&use_mirror=softlayer], then unzip it under say, /tmp/geoserver-2.1.3. The integration tests are executed as follows:
65
- > rake integration['/tmp/geoserver-2.1.3','8080','-DGEOSERVER_DATA_DIR=data_dir']
77
+ $ rake integration['/tmp/geoserver-2.1.3','8080','-DGEOSERVER_DATA_DIR=data_dir']
78
+
79
+ If you have the test instance running already on port 8080, you can run the tests simply with:
80
+
81
+ $ rake
66
82
 
67
83
  To generate the documentation run:
68
- > rake yard
84
+ $ rake yard
69
85
 
70
86
  To enter into an irb console with all classess loaded:
71
- > rake console
87
+ $ rake console
88
+
89
+ == Logging
90
+ For now we use {RestClient's}[https://github.com/adamwiggins/rest-client] base logger. It can be enabled by setting:
91
+
92
+ RestClient.log = '/tmp/restclient.log'
93
+
94
+ or set an environment variable, for example:
95
+
96
+ $ RESTCLIENT_LOG=stdout ruby ingest_layer.rb
97
+ RestClient.get "http://localhost:8080/geoserver/rest/workspaces/cite.xml", "Accept"=>"application/xml", "Accept-Encoding"=>"gzip, deflate", "Content-Type"=>"application/xml"
98
+ # => 200 OK | application/xml 662 bytes
99
+ RestClient.get "http://localhost:8080/geoserver/rest/workspaces/cite/coveragestores/city_of_san_francisco_1859.xml", "Accept"=>"application/xml", "Accept-Encoding"=>"gzip, deflate", "Content-Type"=>"application/xml"
100
+ # => 404 NotFound | text/plain 73 bytes
101
+ RestClient.post "http://localhost:8080/geoserver/rest/workspaces/cite/coveragestores", "<?xml version=\"1.0\"?>\n<coverageStore>\n <name>city_of_san_francisco_1859</name>\n <workspace>\n <name>cite</name>\n </workspace>\n <enabled>true</enabled>\n <type>GeoTIFF</type>\n <description>Map of San Francisco by the U.S. Coast Survey, with detail of the unsettled lands</description>\n <url>file:///geo_data/rumsey/g1030000alpha.tif</url>\n</coverageStore>\n", "Accept"=>"application/xml", "Accept-Encoding"=>"gzip, deflate", "Content-Length"=>"363", "Content-Type"=>"application/xml"
102
+ # => 201 Created | 0 bytes
103
+
72
104
 
73
105
  == Related Resources
74
106
  * {OSGeo The Open Source Geospatial Foundation}[http://www.osgeo.org]
@@ -83,9 +115,16 @@ To enter into an irb console with all classess loaded:
83
115
  - <b>v0.5</b> - Initial alpha release
84
116
 
85
117
  == TODO
86
- - Complete stores and coverages functionality, handle Layers, styles and data upload.
87
- - Complete documentaion and test coverage. Add more flexibility for integration tests with embedded Jetty and other containers.
88
- - Add ability to connect under SSL.
118
+ - Handle default resources transparently.
119
+ - Complete data stores and coverages functionality, handle layers, styles, wmsstores and data upload.
120
+ - Complete documentation.
121
+ - Complete test coverage:
122
+ - Add functional tests
123
+ - Add more flexibility for integration tests with embedded Jetty and other containers.
124
+ - Provide more examples:
125
+ - Customize configuration.
126
+ - Connect under SSL.
127
+ - Batch processing.
89
128
  - Migrate base HTTP client to {Weary}[https://github.com/mwunsch/weary]?
90
129
 
91
130
  == Contributing with Patches and Pull requests checklist
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.4
1
+ 0.5.5
@@ -32,6 +32,10 @@ module RGeoServer
32
32
  {:accept => sym, :content_type=> sym}
33
33
  end
34
34
 
35
+ #== Resources
36
+
37
+ #= Workspaces
38
+
35
39
  # List of available workspaces
36
40
  # @return [Array<RGeoServer::Workspace>]
37
41
  def get_workspaces &block
@@ -41,8 +45,8 @@ module RGeoServer
41
45
  ResourceInfo.list Workspace, self, workspaces, {}, &block
42
46
  end
43
47
 
44
- # @param [String] workspace
45
- # @return [<RGeoServer::Workspace]
48
+ # @param [String] workspace name
49
+ # @return [RGeoServer::Workspace]
46
50
  def get_workspace workspace
47
51
  response = self.search :workspaces => workspace
48
52
  doc = Nokogiri::XML(response)
@@ -50,9 +54,12 @@ module RGeoServer
50
54
  return Workspace.new self, :name => name.text if name
51
55
  end
52
56
 
53
- # @return [<RGeoServer::Workspace]
57
+ # @return [RGeoServer::Workspace]
54
58
  def get_default_workspace
55
- return Workspace.new self, :name => 'default'
59
+ dw = Workspace.new self, :name => 'default'
60
+ w = Workspace.new self, :name => w.name
61
+ raise "No default workspace is available in the catalog" unless w.new?
62
+ w
56
63
  end
57
64
 
58
65
  def set_default_workspace
@@ -62,12 +69,54 @@ module RGeoServer
62
69
  # @param [String] store
63
70
  # @param [String] workspace
64
71
  def reassign_workspace store, workspace
65
- pass
72
+ raise NotImplementedError
66
73
  end
67
74
 
68
- # List of feature types
75
+ #= Layers
76
+
77
+ # List of available layers
78
+ # @return [Array<RGeoServer::Layer>]
79
+ def get_layers &block
80
+ response = self.search :layers => nil
81
+ doc = Nokogiri::XML(response)
82
+ layers = doc.xpath(Layer.root_xpath).collect{|l| l.text.to_s }
83
+ ResourceInfo.list Layer, self, layers, {}, &block
84
+ end
85
+
86
+ # @param [String] layer name
87
+ # @return [RGeoServer::Layer]
88
+ def get_layer layer
89
+ response = self.search :layers => layer
90
+ doc = Nokogiri::XML(response)
91
+ name = doc.at_xpath(Layer.member_xpath)
92
+ return Layer.new self, :name => name.text if name
93
+ end
94
+
95
+ #= Styles (SLD Style Layer Descriptor)
96
+
97
+ # List of available styles
98
+ # @return [Array<RGeoServer::Style>]
99
+ def get_styles &block
100
+ response = self.search :styles => nil
101
+ doc = Nokogiri::XML(response)
102
+ styles = doc.xpath(Style.root_xpath).collect{|l| l.text.to_s }
103
+ ResourceInfo.list Style, self, styles, {}, &block
104
+ end
105
+
106
+ # @param [String] style name
107
+ # @return [RGeoServer::Style]
108
+ def get_style style
109
+ response = self.search :styles => style
110
+ doc = Nokogiri::XML(response)
111
+ name = doc.at_xpath(Style.member_xpath)
112
+ return Style.new self, :name => name.text if name
113
+ end
114
+
115
+
116
+ #= Namespaces
117
+
118
+ # List of available namespaces
69
119
  # @return [Array<RGeoServer::Namespace>]
70
- # TODO: Implement when the stable release includes it
71
120
  def get_namespaces
72
121
  raise NotImplementedError
73
122
  end
@@ -107,8 +156,7 @@ module RGeoServer
107
156
  # @param [String] datastore
108
157
  # @return [Array<RGeoServer::FeatureType>]
109
158
  def get_feature_types workspace, datastore
110
- pass
111
-
159
+ raise NotImplementedError
112
160
  end
113
161
 
114
162
  # @param [String] workspace
@@ -116,8 +164,7 @@ module RGeoServer
116
164
  # @param [String] featuretype_id
117
165
  # @return [RGeoServer::FeatureType]
118
166
  def get_feature_type workspace, datastore, featuretype_id
119
- pass
120
-
167
+ raise NotImplementedError
121
168
  end
122
169
 
123
170
 
@@ -144,7 +191,7 @@ module RGeoServer
144
191
  end
145
192
 
146
193
  #= WMS Stores (Web Map Services)
147
- # TODO: Implement when the stable release includes it
194
+
148
195
  # List of WMS stores.
149
196
  # @param [String] workspace
150
197
  # @return [Array<RGeoServer::WmsStore>]
@@ -4,7 +4,7 @@ module RGeoServer
4
4
  class Coverage < ResourceInfo
5
5
 
6
6
  OBJ_ATTRIBUTES = {:catalog => "catalog", :name => "name", :workspace => "workspace", :enabled => "enabled" }
7
- OBJ_DEFAULT_ATTRIBUTES = {:catalog => nil, :workspace => nil, :coverage_store => nil, :name => nil, :enabled => false }
7
+ OBJ_DEFAULT_ATTRIBUTES = {:catalog => nil, :workspace => nil, :coverage_store => nil, :name => nil, :enabled => "false" }
8
8
 
9
9
  define_attribute_methods OBJ_ATTRIBUTES.keys
10
10
  update_attribute_accessors OBJ_ATTRIBUTES
@@ -75,10 +75,10 @@ module RGeoServer
75
75
  h = {
76
76
  "coverage_store" => @coverage_store.name,
77
77
  "workspace" => @workspace.name,
78
- "name" => doc.at_xpath('//name/text()').text.strip,
79
- "nativeName" => doc.at_xpath('//nativeName/text()').to_s,
80
- "title" => doc.at_xpath('//title/text()').to_s,
81
- "supportedFormats" => doc.xpath('//supportedFormats/string/text()').collect{ |t| t.to_s }
78
+ "name" => doc.at_xpath('//name').text.strip,
79
+ "nativeName" => doc.at_xpath('//nativeName').to_s,
80
+ "title" => doc.at_xpath('//title').to_s,
81
+ "supportedFormats" => doc.xpath('//supportedFormats/string').collect{ |t| t.to_s }
82
82
  }.freeze
83
83
  h
84
84
  end
@@ -100,7 +100,7 @@ module RGeoServer
100
100
  doc.xpath('//featureTypes/atom:link/@href', "xmlns:atom"=>"http://www.w3.org/2005/Atom" ).each{ |l|
101
101
  h["featureTypes"] = begin
102
102
  response = @catalog.fetch_url l.text
103
- Nokogiri::XML(response).xpath('//name/text()').collect{ |a| a.text }
103
+ Nokogiri::XML(response).xpath('//name/text()').collect{ |a| a.text.strip }
104
104
  rescue RestClient::ResourceNotFound
105
105
  []
106
106
  end.freeze
@@ -2,8 +2,11 @@
2
2
  module RGeoServer
3
3
 
4
4
  class FeatureType < ResourceInfo
5
-
6
- define_attribute_methods [:catalog, :workspace, :data_store, :name]
5
+ OBJ_ATTRIBUTES = {:catalog => "catalog", :name => "name", :workspace => "workspace", :enabled => "enabled" }
6
+ OBJ_DEFAULT_ATTRIBUTES = {:catalog => nil, :workspace => nil, :coverage_store => nil, :name => nil, :enabled => "false" }
7
+
8
+ define_attribute_methods OBJ_ATTRIBUTES.keys
9
+ update_attribute_accessors OBJ_ATTRIBUTES
7
10
 
8
11
  @@r = Confstruct::Configuration.new(
9
12
  :route => "workspaces/%s/datastores/%s/featuretypes",
@@ -69,32 +72,17 @@ module RGeoServer
69
72
  end
70
73
 
71
74
  @name = options[:name].strip
72
- @enabled = options[:enabled] || true
73
75
  @route = route
74
76
  end
75
77
  end
76
78
 
77
- def name= val
78
- name_will_change! unless val == @name
79
- @name = val
80
- end
81
-
82
- def workspace= val
83
- workspace_will_change! unless val == @workspace
84
- @workspace = val
85
- end
86
-
87
- def catalog= val
88
- catalog_will_change! unless val == @catalog
89
- @catalog = val
90
- end
91
79
 
92
80
  def profile_xml_to_hash profile_xml
93
81
  doc = profile_xml_to_ng profile_xml
94
82
  h = {
95
- :name => doc.at_xpath('//name').text.strip,
96
- :workspace => @workspace.name,
97
- :nativeName => doc.at_xpath('//nativeName').text.to_s
83
+ "name" => doc.at_xpath('//name').text.strip,
84
+ "workspace" => @workspace.name,
85
+ "nativeName" => doc.at_xpath('//nativeName').to_s
98
86
  }.freeze
99
87
  h
100
88
  end
@@ -4,7 +4,7 @@ module RGeoServer
4
4
  API_DOCUMENTATION = "http://docs.geoserver.org/latest/en/user/restconfig/rest-config-api.html"
5
5
 
6
6
  def url_for base, options = nil
7
- return base unless options.is_a? Hash
7
+ base = { base => nil } unless base.is_a? Hash
8
8
  format = options.delete(:format) || 'xml'
9
9
  new_base = base.map{ |key,value| value.nil?? key.to_s : [key.to_s, CGI::escape(value.to_s)].join("/") }.join("/")
10
10
  new_base = new_base.gsub(/\/$/,'')
@@ -0,0 +1,159 @@
1
+
2
+ module RGeoServer
3
+
4
+ class Layer < ResourceInfo
5
+
6
+ OBJ_ATTRIBUTES = {:enabled => 'enabled', :catalog => 'catalog', :name => 'name', :default_style => 'default_style', :alternate_styles => 'alternate_styles', :metadata => 'metadata', :attribution => 'attribution', :layer_type => 'type' }
7
+ OBJ_DEFAULT_ATTRIBUTES = {:enabled => 'true', :catalog => nil, :name => nil, :default_style => nil, :alternate_styles => [], :metadata => {}, :attribution => {:logo_height => '0', :logo_width => '0', 'title' => ''}, :layer_type => nil }
8
+
9
+ define_attribute_methods OBJ_ATTRIBUTES.keys
10
+ update_attribute_accessors OBJ_ATTRIBUTES
11
+
12
+ @@r = Confstruct::Configuration.new(:route => 'layers', :resource_name => 'layer')
13
+
14
+ def self.resource_name
15
+ @@r.resource_name
16
+ end
17
+
18
+ def self.create_method
19
+ :post
20
+ end
21
+
22
+ def self.update_method
23
+ :put
24
+ end
25
+
26
+ def self.root_xpath
27
+ "//#{@@r.route}/#{@@r.resource_name}"
28
+ end
29
+
30
+ def self.member_xpath
31
+ "//#{resource_name}"
32
+ end
33
+
34
+ def route
35
+ @@r.route
36
+ end
37
+
38
+ # No direct layer creation
39
+ def create_route
40
+ nil
41
+ end
42
+
43
+ def message
44
+ builder = Nokogiri::XML::Builder.new do |xml|
45
+ xml.layer {
46
+ #xml.name @name
47
+ xml.type_ layer_type
48
+ xml.enabled enabled
49
+ xml.defaultStyle {
50
+ xml.name default_style
51
+ }
52
+ xml.styles {
53
+ alternate_styles.each { |s|
54
+ xml.style {
55
+ xml.name s
56
+ }
57
+ }
58
+ } unless alternate_styles.empty?
59
+ xml.resource(:class => resource.class.resource_name){
60
+ xml.name resource.name
61
+ } unless resource.nil?
62
+ xml.attribution {
63
+ xml.title attribution['title'] unless attribution['title'].empty?
64
+ xml.logoWidth attribution['logo_width']
65
+ xml.logoHeight attribution['logo_height']
66
+ } if !attribution['logo_width'].nil? && !attribution['logo_height'].nil?
67
+ }
68
+ end
69
+ return builder.doc.to_xml
70
+ end
71
+
72
+ # @param [RGeoServer::Catalog] catalog
73
+ # @param [Hash] options
74
+ # @option options [String] :name
75
+ # @option options [String] :default_style
76
+ # @option options [Array<String>] :alternate_styles
77
+ def initialize catalog, options
78
+ super({})
79
+ _run_initialize_callbacks do
80
+ @catalog = catalog
81
+ @name = options[:name].strip
82
+ #@default_style = options[:default_style] || ''
83
+ #@alternate_styles = options[:alternate_styles] || []
84
+ end
85
+ @route = route
86
+ end
87
+
88
+ def resource= r
89
+ if r.is_a?(RGeoServer::Coverage) || r.is_a?(RGeoServer::FeatureType)
90
+ @resource = r
91
+ else
92
+ raise 'Unknown resource type'
93
+ end
94
+ end
95
+
96
+ def resource
97
+ @resource ||= begin
98
+ unless profile['resource'].empty?
99
+ data_type = profile['resource']['type']
100
+ workspace = profile['resource']['workspace']
101
+ name = profile['resource']['name']
102
+ store = profile['resource']['store']
103
+
104
+ case data_type
105
+ when 'coverage'
106
+ return RGeoServer::Coverage.new @catalog, :workspace => workspace, :coverage_store => store, :name => name
107
+ when 'featureType'
108
+ return RGeoServer::FeatureType.new @catalog, :workspace => workspace, :data_store => store, :name => name
109
+ else
110
+ raise 'Unknown resource type'
111
+ end
112
+ else
113
+ nil
114
+ end
115
+ rescue Exception => e
116
+ nil
117
+ end
118
+ end
119
+
120
+ # TODO: Simplify if necessary with "/layers/<l>/styles[.<format>]", as speficied in the API
121
+ def get_default_style &block
122
+ self.class.list Style, @catalog, @default_style, {:layer => self}, check_remote = false, &block
123
+ end
124
+
125
+ def get_alternate_styles &block
126
+ self.class.list Style, @catalog, @alternate_styles, {:layer => self}, check_remote = false, &block
127
+ end
128
+
129
+ def profile_xml_to_hash profile_xml
130
+ doc = profile_xml_to_ng profile_xml
131
+ name = doc.at_xpath('//name/text()').text.strip
132
+ link = doc.at_xpath('//resource//atom:link/@href', "xmlns:atom"=>"http://www.w3.org/2005/Atom").text.strip
133
+ workspace, _, store = link.match(/workspaces\/(.*?)\/(.*?)\/(.*?)\/(.*?)\/#{name}.xml$/).to_a[1,3]
134
+
135
+ h = {
136
+ "name" => name,
137
+ "path" => doc.at_xpath('//path/text()').to_s,
138
+ "default_style" => doc.at_xpath('//defaultStyle/name/text()').to_s,
139
+ "alternate_styles" => doc.xpath('//styles/style/name/text()').collect{ |s| s.to_s},
140
+ "type" => doc.at_xpath('//type/text()').to_s,
141
+ "enabled" => doc.at_xpath('//enabled/text()').to_s,
142
+ "attribution" => {
143
+ "title" => doc.at_xpath('//attribution/title/text()').to_s,
144
+ "logo_width" => doc.at_xpath('//attribution/logoWidth/text()').to_s,
145
+ "logo_height" => doc.at_xpath('//attribution/logoHeight/text()').to_s
146
+ },
147
+ "resource" => {
148
+ "type" => doc.at_xpath('//resource/@class').to_s,
149
+ "name" => doc.at_xpath('//resource/name/text()').to_s,
150
+ "store" => store,
151
+ "workspace" => workspace
152
+ },
153
+ "metadata" => doc.xpath('//metadata/entry').inject({}){ |h, e| h.merge(e['key']=> e.text.to_s) }
154
+ }.freeze
155
+ h
156
+ end
157
+
158
+ end
159
+ end
@@ -66,17 +66,27 @@ module RGeoServer
66
66
 
67
67
 
68
68
  # Modify or save the resource
69
- # @param [Hash] options
69
+ # @param [Hash] options / query parameters
70
70
  # @return [RGeoServer::ResourceInfo]
71
71
  def save options = {}
72
72
  @previously_changed = changes
73
73
  @changed_attributes.clear
74
74
  run_callbacks :save do
75
75
  if new?
76
- @catalog.add(@route, message, create_method)
77
- clear
76
+ if self.respond_to?(:create_route)
77
+ raise "Resource cannot be created directly" if create_route.nil?
78
+ route = create_route
79
+ else
80
+ route = {@route => nil}
81
+ end
82
+
83
+ options = create_options.merge(options) if self.respond_to?(:create_options)
84
+ @catalog.add(route, message, create_method, options)
85
+ clear
78
86
  else
79
- @catalog.modify({@route => @name}, message, update_method) #unless changes.empty?
87
+ options = update_options.merge(options) if self.respond_to?(:update_options)
88
+ route = self.respond_to?(:update_route)? update_route : {@route => @name}
89
+ @catalog.modify(route, message, update_method, options) #unless changes.empty?
80
90
  end
81
91
 
82
92
  self
@@ -131,28 +141,9 @@ module RGeoServer
131
141
  def profile_xml_to_ng profile_xml
132
142
  Nokogiri::XML(profile_xml).xpath(self.class.member_xpath)
133
143
  end
134
-
144
+
135
145
  def profile_xml_to_hash profile_xml
136
- doc = profile_xml_to_ng profile_xml
137
- h = {'name' => doc.at_xpath('//name').text.strip, 'enabled' => @enabled }
138
- doc.xpath('//atom:link/@href', "xmlns:atom"=>"http://www.w3.org/2005/Atom" ).each{ |l|
139
- target = l.text.match(/([a-zA-Z]+)\.xml$/)[1]
140
- if !target.nil? && target != l.parent.parent.name.to_s.downcase
141
- begin
142
- h[l.parent.parent.name.to_s] << target
143
- rescue
144
- h[l.parent.parent.name.to_s] = []
145
- end
146
- else
147
- h[l.parent.parent.name.to_s] = begin
148
- response = @catalog.fetch_url l.text
149
- Nokogiri::XML(response).xpath('//name/text()').collect{ |a| a.text }
150
- rescue RestClient::ResourceNotFound
151
- []
152
- end.freeze
153
- end
154
- }
155
- h
146
+ raise NotImplementedError
156
147
  end
157
148
 
158
149
  end
@@ -24,8 +24,9 @@ module RGeoServer
24
24
  # @param [OrderedHash] what
25
25
  # @param [Hash] options
26
26
  def search what, options = {}
27
+ h = options.delete(:headers) || headers(:xml)
27
28
  resources = client[url_for(what, options)]
28
- resources.options[:headers] ||= headers(:xml)
29
+ resources.options[:headers] = h
29
30
  begin
30
31
  return resources.get
31
32
  rescue RestClient::InternalServerError => e
@@ -55,9 +56,11 @@ module RGeoServer
55
56
  # @param [String] what
56
57
  # @param [String] message
57
58
  # @param [Symbol] method
58
- def add what, message, method
59
- request = client[url_for(what)]
60
- request.options[:headers] ||= headers(:xml)
59
+ # @param [Hash] options
60
+ def add what, message, method, options = {}
61
+ h = options.delete(:headers) || headers(:xml)
62
+ request = client[url_for(what, options)]
63
+ request.options[:headers] = h
61
64
  begin
62
65
  return request.send method, message
63
66
  rescue RestClient::InternalServerError => e
@@ -72,9 +75,11 @@ module RGeoServer
72
75
  # @param [String] what
73
76
  # @param [String] message
74
77
  # @param [Symbol] method
75
- def modify what, message, method
76
- request = client[url_for(what, {})]
77
- request.options[:headers] ||= headers(:xml)
78
+ # @param [Hash] options
79
+ def modify what, message, method, options = {}
80
+ h = options.delete(:headers) || headers(:xml)
81
+ request = client[url_for(what, options)]
82
+ request.options[:headers] = h
78
83
  $logger.debug "Modifying: \n #{message}"
79
84
  begin
80
85
  return request.send method, message
@@ -0,0 +1,104 @@
1
+
2
+ module RGeoServer
3
+
4
+ class Style < ResourceInfo
5
+
6
+ OBJ_ATTRIBUTES = {:catalog => 'catalog', :name => 'name', :sld_version => 'sldVersion', :filename => 'filename', :sld_doc => 'sld_doc' }
7
+ OBJ_DEFAULT_ATTRIBUTES = {:catalog => nil, :name => nil, :sld_version => nil, :filename => '', :sld_doc => nil }
8
+
9
+ define_attribute_methods OBJ_ATTRIBUTES.keys
10
+ update_attribute_accessors OBJ_ATTRIBUTES
11
+
12
+ @@r = Confstruct::Configuration.new(:route => 'styles', :resource_name => 'style', :sld_namespace => 'http://www.opengis.net/sld')
13
+
14
+ def self.resource_name
15
+ @@r.resource_name
16
+ end
17
+
18
+ def self.create_method
19
+ :post
20
+ end
21
+
22
+ def self.update_method
23
+ :put
24
+ end
25
+
26
+ def self.root_xpath
27
+ "//#{@@r.route}/#{@@r.resource_name}"
28
+ end
29
+
30
+ def self.member_xpath
31
+ "//#{resource_name}"
32
+ end
33
+
34
+ def route
35
+ @@r.route
36
+ end
37
+
38
+ def create_options
39
+ {
40
+ :headers => {
41
+ :accept => :xml,
42
+ :content_type=> "application/vnd.ogc.sld+xml"
43
+ },
44
+ :format => :xml,
45
+ :name => @name
46
+ }
47
+ end
48
+
49
+ def update_options
50
+ {
51
+ :headers => {
52
+ :accept => :xml,
53
+ :content_type=> "application/vnd.ogc.sld+xml"
54
+ },
55
+ :format => :sld
56
+ }
57
+ end
58
+
59
+ def sld_namespace
60
+ @@r.sld_namespace
61
+ end
62
+
63
+ def message
64
+ @sld_doc
65
+ end
66
+
67
+ # @param [RGeoServer::Catalog] catalog
68
+ # @param [Hash] options
69
+ def initialize catalog, options
70
+ super({})
71
+ _run_initialize_callbacks do
72
+ @catalog = catalog
73
+ @name = options[:name].strip
74
+ end
75
+ @route = route
76
+ end
77
+
78
+ # Obtain all layers that use this style.
79
+ # WARNING: This will be slow and inneficient when the list of all layers is too long.
80
+ def layers &block
81
+ return to_enum(:layers).to_a unless block_given?
82
+ @catalog.get_layers do |l|
83
+ lyrs = [l.profile['default_style']]+l.profile['alternate_styles']
84
+ yield l if lyrs.include? @name
85
+ end
86
+ end
87
+
88
+ def profile_xml_to_hash profile_xml
89
+ doc = profile_xml_to_ng profile_xml
90
+ h = {
91
+ 'name' => doc.at_xpath('//name').text.strip,
92
+ 'sld_version' => doc.at_xpath('//sldVersion/version/text()').to_s,
93
+ 'filename' => doc.at_xpath('//filename/text()').to_s,
94
+ 'sld_doc' => begin
95
+ Nokogiri::XML(@catalog.search({:styles => @name}, options={:format => 'sld'})).to_xml
96
+ rescue RestClient::ResourceNotFound
97
+ nil
98
+ end
99
+ }.freeze
100
+ h
101
+ end
102
+
103
+ end
104
+ end
@@ -99,6 +99,11 @@ module RGeoServer
99
99
  catalog_will_change! unless val == @catalog
100
100
  @catalog = val
101
101
  end
102
+
103
+ def profile_xml_to_hash profile_xml
104
+ doc = profile_xml_to_ng profile_xml
105
+ return {'name' => doc.at_xpath('//name').text.strip, 'enabled' => @enabled }
106
+ end
102
107
 
103
108
  end
104
109
  end
@@ -68,5 +68,28 @@ module RGeoServer
68
68
  self.class.list WmsStore, @catalog, profile['wmsStores'], {:workspace => self}, check_remote = true, &block
69
69
  end
70
70
 
71
+ def profile_xml_to_hash profile_xml
72
+ doc = profile_xml_to_ng profile_xml
73
+ h = {'name' => doc.at_xpath('//name').text.strip, 'enabled' => @enabled }
74
+ doc.xpath('//atom:link/@href', "xmlns:atom"=>"http://www.w3.org/2005/Atom").each{ |l|
75
+ target = l.text.match(/([a-zA-Z]+)\.xml$/)[1]
76
+ if !target.nil? && target != l.parent.parent.name.to_s.downcase
77
+ begin
78
+ h[l.parent.parent.name.to_s] << target
79
+ rescue
80
+ h[l.parent.parent.name.to_s] = []
81
+ end
82
+ else
83
+ h[l.parent.parent.name.to_s] = begin
84
+ response = @catalog.fetch_url l.text
85
+ Nokogiri::XML(response).xpath('//name').collect{ |a| a.text.strip }
86
+ rescue RestClient::ResourceNotFound
87
+ []
88
+ end.freeze
89
+ end
90
+ }
91
+ h
92
+ end
93
+
71
94
  end
72
95
  end
data/lib/rgeoserver.rb CHANGED
@@ -14,6 +14,8 @@ module RGeoServer
14
14
  autoload :DataStore, "rgeoserver/datastore"
15
15
  autoload :CoverageStore, "rgeoserver/coveragestore"
16
16
  autoload :WmsStore, "rgeoserver/wmsstore"
17
+ autoload :Style, "rgeoserver/style"
18
+ autoload :Layer, "rgeoserver/layer"
17
19
 
18
20
  require 'restclient'
19
21
  require 'nokogiri'
data/rgeoserver.gemspec CHANGED
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
26
26
  s.add_development_dependency("bundler", ">= 1.0.14")
27
27
  s.add_development_dependency("rspec")
28
28
  s.add_development_dependency("yard")
29
+ s.add_development_dependency("equivalent-xml")
29
30
  s.add_development_dependency("jettywrapper")
30
31
  end
31
32
 
@@ -0,0 +1 @@
1
+ GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
@@ -0,0 +1,153 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld"
3
+ xmlns:sld="http://www.opengis.net/sld"
4
+ xmlns:ogc="http://www.opengis.net/ogc"
5
+ xmlns:gml="http://www.opengis.net/gml" version="1.0.0">
6
+ <sld:NamedLayer>
7
+ <sld:Name>pophatch</sld:Name>
8
+ <sld:UserStyle>
9
+ <sld:Name>pophatch</sld:Name>
10
+ <sld:Title>Population in the United States</sld:Title>
11
+ <sld:Abstract>A sample filter that filters the United States
12
+ into three categories of population, drawn in different
13
+ colors</sld:Abstract>
14
+ <sld:FeatureTypeStyle>
15
+ <sld:Name>name</sld:Name>
16
+ <sld:Rule>
17
+ <sld:Title>&lt; 2M</sld:Title>
18
+ <ogc:Filter>
19
+ <ogc:PropertyIsLessThan>
20
+ <ogc:PropertyName>PERSONS</ogc:PropertyName>
21
+ <ogc:Literal>2000000</ogc:Literal>
22
+ </ogc:PropertyIsLessThan>
23
+ </ogc:Filter>
24
+ <sld:PolygonSymbolizer>
25
+ <sld:Fill>
26
+ <sld:GraphicFill>
27
+ <sld:Graphic>
28
+ <sld:Mark>
29
+ <sld:WellKnownName>
30
+ shape://slash</sld:WellKnownName>
31
+ <sld:Stroke>
32
+ <sld:CssParameter name="stroke">
33
+ 0xAAAAAA</sld:CssParameter>
34
+ </sld:Stroke>
35
+ </sld:Mark>
36
+ <sld:Size>
37
+ <ogc:Literal>16</ogc:Literal>
38
+ </sld:Size>
39
+ </sld:Graphic>
40
+ </sld:GraphicFill>
41
+ </sld:Fill>
42
+ </sld:PolygonSymbolizer>
43
+ </sld:Rule>
44
+ <sld:Rule>
45
+ <sld:Title>2M - 4M</sld:Title>
46
+ <ogc:Filter>
47
+ <ogc:PropertyIsBetween>
48
+ <ogc:PropertyName>PERSONS</ogc:PropertyName>
49
+ <ogc:LowerBoundary>
50
+ <ogc:Literal>2000000</ogc:Literal>
51
+ </ogc:LowerBoundary>
52
+ <ogc:UpperBoundary>
53
+ <ogc:Literal>4000000</ogc:Literal>
54
+ </ogc:UpperBoundary>
55
+ </ogc:PropertyIsBetween>
56
+ </ogc:Filter>
57
+ <sld:PolygonSymbolizer>
58
+ <sld:Fill>
59
+ <sld:GraphicFill>
60
+ <sld:Graphic>
61
+ <sld:Mark>
62
+ <sld:WellKnownName>
63
+ shape://slash</sld:WellKnownName>
64
+ <sld:Stroke>
65
+ <sld:CssParameter name="stroke">
66
+ 0xAAAAAA</sld:CssParameter>
67
+ </sld:Stroke>
68
+ </sld:Mark>
69
+ <sld:Size>
70
+ <ogc:Literal>8</ogc:Literal>
71
+ </sld:Size>
72
+ </sld:Graphic>
73
+ </sld:GraphicFill>
74
+ </sld:Fill>
75
+ </sld:PolygonSymbolizer>
76
+ </sld:Rule>
77
+ <sld:Rule>
78
+ <sld:Title>&gt; 4M</sld:Title>
79
+ <ogc:Filter>
80
+ <ogc:PropertyIsGreaterThan>
81
+ <ogc:PropertyName>PERSONS</ogc:PropertyName>
82
+ <ogc:Literal>4000000</ogc:Literal>
83
+ </ogc:PropertyIsGreaterThan>
84
+ </ogc:Filter>
85
+ <sld:PolygonSymbolizer>
86
+ <sld:Fill>
87
+ <sld:GraphicFill>
88
+ <sld:Graphic>
89
+ <sld:Mark>
90
+ <sld:WellKnownName>
91
+ shape://slash</sld:WellKnownName>
92
+ <sld:Stroke>
93
+ <sld:CssParameter name="stroke">
94
+ 0xAAAAAA</sld:CssParameter>
95
+ </sld:Stroke>
96
+ </sld:Mark>
97
+ <sld:Size>
98
+ <ogc:Literal>4</ogc:Literal>
99
+ </sld:Size>
100
+ </sld:Graphic>
101
+ </sld:GraphicFill>
102
+ </sld:Fill>
103
+ </sld:PolygonSymbolizer>
104
+ </sld:Rule>
105
+ <sld:Rule>
106
+ <sld:Title>Boundary</sld:Title>
107
+ <sld:LineSymbolizer>
108
+ <sld:Stroke />
109
+ </sld:LineSymbolizer>
110
+ <sld:TextSymbolizer>
111
+ <sld:Label>
112
+ <ogc:PropertyName>STATE_ABBR</ogc:PropertyName>
113
+ </sld:Label>
114
+ <sld:Font>
115
+ <sld:CssParameter name="font-family">Times New
116
+ Roman</sld:CssParameter>
117
+ <sld:CssParameter name="font-size">
118
+ 14</sld:CssParameter>
119
+ <sld:CssParameter name="font-style">
120
+ Normal</sld:CssParameter>
121
+ <sld:CssParameter name="font-weight">
122
+ normal</sld:CssParameter>
123
+ </sld:Font>
124
+ <sld:LabelPlacement>
125
+ <sld:PointPlacement>
126
+ <sld:AnchorPoint>
127
+ <sld:AnchorPointX>
128
+ <ogc:Literal>0.5</ogc:Literal>
129
+ </sld:AnchorPointX>
130
+ <sld:AnchorPointY>
131
+ <ogc:Literal>0.5</ogc:Literal>
132
+ </sld:AnchorPointY>
133
+ </sld:AnchorPoint>
134
+ <sld:Rotation>
135
+ <ogc:Literal>0.0</ogc:Literal>
136
+ </sld:Rotation>
137
+ </sld:PointPlacement>
138
+ </sld:LabelPlacement>
139
+ <sld:Halo>
140
+ <sld:Radius>
141
+ <ogc:Literal>2</ogc:Literal>
142
+ </sld:Radius>
143
+ <sld:Fill>
144
+ <sld:CssParameter name="fill">
145
+ 0xFFFFFF</sld:CssParameter>
146
+ </sld:Fill>
147
+ </sld:Halo>
148
+ </sld:TextSymbolizer>
149
+ </sld:Rule>
150
+ </sld:FeatureTypeStyle>
151
+ </sld:UserStyle>
152
+ </sld:NamedLayer>
153
+ </sld:StyledLayerDescriptor>
@@ -0,0 +1,28 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <StyledLayerDescriptor version="1.1.0"
3
+ xmlns="http://www.opengis.net/sld"
4
+ xmlns:se="http://www.opengis.net/se"
5
+ xmlns:ogc="http://www.opengis.net/ogc"
6
+ xmlns:xlink="http://www.w3.org/1999/xlink"
7
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8
+ xsi:schemaLocation="http://www.opengis.net/sld
9
+ http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd">
10
+ <NamedLayer>
11
+ <se:Name>granules</se:Name>
12
+ <UserStyle>
13
+ <se:Name>xxx</se:Name>
14
+ <se:FeatureTypeStyle>
15
+ <se:Rule>
16
+ <se:LineSymbolizer>
17
+ <se:Geometry>
18
+ <ogc:PropertyName>center-line</ogc:PropertyName>
19
+ </se:Geometry>
20
+ <se:Stroke>
21
+ <se:SvgParameter name="stroke">#0000ff</se:SvgParameter>
22
+ </se:Stroke>
23
+ </se:LineSymbolizer>
24
+ </se:Rule>
25
+ </se:FeatureTypeStyle>
26
+ </UserStyle>
27
+ </NamedLayer>
28
+ </StyledLayerDescriptor>
@@ -7,6 +7,7 @@ describe "Integration test against a GeoServer instance", :integration => true d
7
7
  @catalog = RGeoServer.catalog
8
8
  end
9
9
 
10
+
10
11
  context "Workspaces" do
11
12
  it "should list workspaces" do
12
13
  @catalog.get_workspaces.each{ |obj|
@@ -73,6 +74,65 @@ describe "Integration test against a GeoServer instance", :integration => true d
73
74
  end
74
75
  end
75
76
 
77
+ context "Layers" do
78
+ it "should instantiate a new layer" do
79
+ lyr = RGeoServer::Layer.new @catalog, :name => 'layer_rgeoserver_test'
80
+ lyr.new?.should == true
81
+ end
82
+
83
+ it "should not create a new layer directly" do
84
+ lyr = RGeoServer::Layer.new @catalog, :name => 'layer_rgeoserver_test'
85
+ lyr.new?.should == true
86
+ lyr.default_style = 'rain'
87
+ lyr.alternate_styles = ['raster']
88
+ lyr.enabled = 'true'
89
+ expect{ lyr.save }.to raise_error
90
+ end
91
+
92
+ it "should list layers" do
93
+ @catalog.get_layers.each { |l|
94
+ l.profile.should_not be_empty
95
+ }
96
+ end
97
+ end
98
+
99
+ context "Styles" do
100
+ before :all do
101
+ sld_dir = File.join(File.dirname(__FILE__), '/../fixtures/styles/')
102
+ @test_sld = Nokogiri::XML(File.new(File.join(sld_dir, 'test_style.sld')))
103
+ @pop_sld = Nokogiri::XML(File.new(File.join(sld_dir, 'poptest.sld')))
104
+ end
105
+
106
+ it "should instantiate a new style" do
107
+ style = RGeoServer::Style.new @catalog, :name => 'style_rgeoserver_test'
108
+ style.new?.should == true
109
+ end
110
+
111
+ it "should create new styles and delete them" do
112
+ {'granules_test_style'=> @test_sld, 'poptest_test_style'=> @pop_sld}.each_pair do |name,sld_ng|
113
+ style = RGeoServer::Style.new @catalog, :name => name
114
+ style.sld_doc = sld_ng.to_xml
115
+ style.save
116
+ style.sld_doc.should be_equivalent_to(sld_ng)
117
+ style.new?.should == false
118
+ style.delete :purge => true
119
+ style.new?.should == true
120
+ end
121
+ end
122
+
123
+ it "should list layers that include a style" do
124
+ @catalog.get_styles[1,1].each do |s|
125
+ break
126
+ s.profile.should_not be_empty
127
+ s.layers do |l|
128
+ lyrs = l.profile['alternate_styles'] + [l.profile['default_style']]
129
+ lyrs.should include s.name unless lyrs.empty?
130
+ end
131
+ end
132
+ end
133
+
134
+ end
135
+
76
136
  context "Stores" do
77
137
  before :all do
78
138
  @ws = RGeoServer::Workspace.new @catalog, :name => 'test_workspace_for_stores'
@@ -84,6 +144,12 @@ describe "Integration test against a GeoServer instance", :integration => true d
84
144
  end
85
145
 
86
146
  context "DataStores" do
147
+ it "should list all available data stores" do
148
+ @catalog.get_data_stores.each { |d|
149
+ d.profile.should_not be_empty
150
+ }
151
+ end
152
+
87
153
  it "should instantiate a datastore" do
88
154
  obj = RGeoServer::DataStore.new @catalog, :workspace => @ws, :name => 'test_shapefile'
89
155
  obj.new?.should == true
@@ -92,9 +158,9 @@ describe "Integration test against a GeoServer instance", :integration => true d
92
158
  end
93
159
 
94
160
  it "should not create a datastore if workspace does not exit" do
95
- new_ws = RGeoServer::Workspace.new @catalog, :name => SecureRandom.hex(5)
161
+ new_ws = RGeoServer::Workspace.new @catalog, :name => 'workspace_rgeoserver_test'
96
162
  obj = RGeoServer::DataStore.new @catalog, :workspace => new_ws, :name => 'test_random_store'
97
- obj.new?.should raise_error
163
+ obj.new? #.should raise_error
98
164
  end
99
165
 
100
166
  it "should create a datastore under existing workspace, update and delete it right after" do
@@ -114,7 +180,13 @@ describe "Integration test against a GeoServer instance", :integration => true d
114
180
  ds.delete
115
181
  end
116
182
  end
183
+
117
184
  context "CoverageStores" do
185
+ it "should list all available coverage stores" do
186
+ @catalog.get_coverage_stores.each { |c|
187
+ c.profile.should_not be_empty
188
+ }
189
+ end
118
190
  it "should create a coverage store under existing workspace, update and delete it right after" do
119
191
  cs = RGeoServer::CoverageStore.new @catalog, :workspace => @ws, :name => 'test_coverage_store'
120
192
  cs.url = "file:data_dir/sf/raster.tif"
data/spec/spec_helper.rb CHANGED
@@ -2,5 +2,4 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
2
  $LOAD_PATH.unshift(File.dirname(__FILE__))
3
3
  require 'rgeoserver'
4
4
  require 'rspec'
5
- require 'active_support/secure_random'
6
-
5
+ require 'equivalent-xml'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rgeoserver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-30 00:00:00.000000000 Z
12
+ date: 2012-05-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
16
- requirement: &2151853600 !ruby/object:Gem::Requirement
16
+ requirement: &2156047080 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2151853600
24
+ version_requirements: *2156047080
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: nokogiri
27
- requirement: &2151852040 !ruby/object:Gem::Requirement
27
+ requirement: &2156045940 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2151852040
35
+ version_requirements: *2156045940
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: mime-types
38
- requirement: &2151850600 !ruby/object:Gem::Requirement
38
+ requirement: &2156045140 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2151850600
46
+ version_requirements: *2156045140
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: activesupport
49
- requirement: &2151849080 !ruby/object:Gem::Requirement
49
+ requirement: &2156044240 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2151849080
57
+ version_requirements: *2156044240
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: activemodel
60
- requirement: &2151847820 !ruby/object:Gem::Requirement
60
+ requirement: &2156043140 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *2151847820
68
+ version_requirements: *2156043140
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: confstruct
71
- requirement: &2151846960 !ruby/object:Gem::Requirement
71
+ requirement: &2156042500 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *2151846960
79
+ version_requirements: *2156042500
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rake
82
- requirement: &2151862320 !ruby/object:Gem::Requirement
82
+ requirement: &2156041700 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *2151862320
90
+ version_requirements: *2156041700
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: shoulda
93
- requirement: &2151861320 !ruby/object:Gem::Requirement
93
+ requirement: &2156062780 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *2151861320
101
+ version_requirements: *2156062780
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: bundler
104
- requirement: &2151859920 !ruby/object:Gem::Requirement
104
+ requirement: &2156061480 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: 1.0.14
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *2151859920
112
+ version_requirements: *2156061480
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: rspec
115
- requirement: &2151858660 !ruby/object:Gem::Requirement
115
+ requirement: &2156060280 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *2151858660
123
+ version_requirements: *2156060280
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: yard
126
- requirement: &2151856760 !ruby/object:Gem::Requirement
126
+ requirement: &2156056640 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,10 +131,21 @@ dependencies:
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *2151856760
134
+ version_requirements: *2156056640
135
+ - !ruby/object:Gem::Dependency
136
+ name: equivalent-xml
137
+ requirement: &2156056020 !ruby/object:Gem::Requirement
138
+ none: false
139
+ requirements:
140
+ - - ! '>='
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
143
+ type: :development
144
+ prerelease: false
145
+ version_requirements: *2156056020
135
146
  - !ruby/object:Gem::Dependency
136
147
  name: jettywrapper
137
- requirement: &2151855380 !ruby/object:Gem::Requirement
148
+ requirement: &2156055520 !ruby/object:Gem::Requirement
138
149
  none: false
139
150
  requirements:
140
151
  - - ! '>='
@@ -142,7 +153,7 @@ dependencies:
142
153
  version: '0'
143
154
  type: :development
144
155
  prerelease: false
145
- version_requirements: *2151855380
156
+ version_requirements: *2156055520
146
157
  description: ! 'GeoServer REST API Ruby library : Requires GeoServer 2.1.3+'
147
158
  email:
148
159
  - renzo.sanchez.silva@gmail.com
@@ -164,12 +175,21 @@ files:
164
175
  - lib/rgeoserver/datastore.rb
165
176
  - lib/rgeoserver/featuretype.rb
166
177
  - lib/rgeoserver/geoserver_url_helpers.rb
178
+ - lib/rgeoserver/layer.rb
167
179
  - lib/rgeoserver/resource.rb
168
180
  - lib/rgeoserver/rest_api_client.rb
181
+ - lib/rgeoserver/style.rb
169
182
  - lib/rgeoserver/version.rb
170
183
  - lib/rgeoserver/wmsstore.rb
171
184
  - lib/rgeoserver/workspace.rb
172
185
  - rgeoserver.gemspec
186
+ - spec/fixtures/datasets/raster/test.tif
187
+ - spec/fixtures/datasets/vector/granules.dbf
188
+ - spec/fixtures/datasets/vector/granules.prj
189
+ - spec/fixtures/datasets/vector/granules.shp
190
+ - spec/fixtures/datasets/vector/granules.shx
191
+ - spec/fixtures/styles/poptest.sld
192
+ - spec/fixtures/styles/test_style.sld
173
193
  - spec/lib/integration_test_spec.rb
174
194
  - spec/spec_helper.rb
175
195
  homepage: http://github.com/rnz0/rgeoserver
@@ -197,6 +217,13 @@ signing_key:
197
217
  specification_version: 3
198
218
  summary: GeoServer REST API ruby library
199
219
  test_files:
220
+ - spec/fixtures/datasets/raster/test.tif
221
+ - spec/fixtures/datasets/vector/granules.dbf
222
+ - spec/fixtures/datasets/vector/granules.prj
223
+ - spec/fixtures/datasets/vector/granules.shp
224
+ - spec/fixtures/datasets/vector/granules.shx
225
+ - spec/fixtures/styles/poptest.sld
226
+ - spec/fixtures/styles/test_style.sld
200
227
  - spec/lib/integration_test_spec.rb
201
228
  - spec/spec_helper.rb
202
229
  has_rdoc: