fc2json 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e40ed0ee6914ba7f03f52603b94dfc7f4f0b430
4
- data.tar.gz: e3d0c184cc995e5197acd0d7fa69f1d2eafa803f
3
+ metadata.gz: 06c7d8b4284506adff00d95b7ca56aa0827b786f
4
+ data.tar.gz: 7236fc2320b8e6b0ca3b5e4d4e2a02dbd08048af
5
5
  SHA512:
6
- metadata.gz: e0f253865ab0212168ed90dce50cbcb1fb3573ee18eb89fb5eab8d0ec75beaf1f6eed3add623066715bd9f3a77fec26069685db4af23d3db35f7146e49ed6771
7
- data.tar.gz: 0387251b1aca6c4e95f09f6eee1497b00fc8d49dc7de4b42b2a4c803c1f8ba0618c7f439c11700d760e10ef2ba70c9ebce51f4da2aa5f5b9c1ce3194daaeb0f5
6
+ metadata.gz: 7d59432dfbe6650042149cf5917e5a2e4263ee6e13f83e9939e7ff10f95ed6a3e38bcc63283c6ad43c149cbd35f4bec21837413aea246f4a425c68361e215deb
7
+ data.tar.gz: 5318473b30f5608aa2f7d99f6dce7c249b1c4ac966400ba15f97bad9537d113c02d0033bbbc4f126b45ff013c2a41786b9da102731d13451ee2f9f1ac890dea2
data/Gemfile CHANGED
@@ -1,5 +1,5 @@
1
1
  source "http://rubygems.org"
2
- gem 'nokogiri', "~> 1.5.10"
2
+ gem 'nokogiri', "~> 1.5", ">= 1.5.10"
3
3
 
4
4
  group :development, :test do
5
5
  gem "rspec", "~> 2.8", ">= 2.8.0"
data/Gemfile.lock CHANGED
@@ -66,7 +66,7 @@ PLATFORMS
66
66
  DEPENDENCIES
67
67
  bundler (~> 1.0)
68
68
  jeweler (~> 1.8, >= 1.8.7)
69
- nokogiri (~> 1.5.10)
69
+ nokogiri (~> 1.5, >= 1.5.10)
70
70
  rspec (~> 2.8, >= 2.8.0)
71
71
  vcr (~> 2.8, >= 2.8.0)
72
72
  webmock (~> 1.15, < 1.16.0)
data/README.md ADDED
@@ -0,0 +1,53 @@
1
+ fc2json
2
+ ==================
3
+
4
+ When querying a esri feature service to get all data published through it, it is needed to deal with the limitation on the number
5
+ of records returned by the server. fc2json abstracts the tasks needed to get all data from a esri feature service.
6
+
7
+ ###Usage
8
+
9
+ Install the gem as usual:
10
+
11
+ ```ruby
12
+ gem install fc2json
13
+ ```
14
+
15
+ Create an instance of a FC2Json object, passing it the service url as a parameter. After creating the instance, just call the get method on it to get a json object with all the data exposed by the service. The following code presents a sample on downloading and saving the service data to a file:
16
+
17
+ ```ruby
18
+ File.open("output.json", 'w') do |file|
19
+ file.write FC2Json.new("http://services2.arcgis.com/hMIIIBIOpi8Cdgjw/arcgis/rest/services/ubs/FeatureServer/0").get
20
+ end
21
+ ```
22
+
23
+ ####Initialization parameters
24
+
25
+ The constructor of a FC2Json object is declares as follows:
26
+
27
+ ```ruby
28
+ def initialize (service_url, object_identifier_field_name = nil, records_per_request = nil, where_clause = nil)
29
+ end
30
+ ```
31
+
32
+ The construction parameters are:
33
+
34
+ * __service_url:__ Mandatory. The url for the feature service.
35
+ * __object_identifier_field_name:__ Optional. The name of the field used as an object identifier on the feature service. If not provided, defaults to "FID"
36
+ * __records_per_request:__ Optional. The number of records returned on each request to the service. Be aware that if you specify a number greater than the max number of records configured on the service, an ArgumentError will be raised. If not provided, defaults to 2000.
37
+ * __where_clause:__ Optional. The where condition (SQL query) to filter the records on the feature service. If not provided, defaults to "1 = 1"
38
+
39
+ ###Contributing to fc2json
40
+
41
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
42
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
43
+ * Fork the project.
44
+ * Start a feature/bugfix branch.
45
+ * Commit and push until you are happy with your contribution.
46
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
47
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
48
+
49
+ ###Copyright
50
+
51
+ Copyright (c) 2013 rpepato. See LICENSE.txt for
52
+ further details.
53
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
data/bin/fc2json ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
3
+ require 'fc2json'
4
+ print FC2Json.new(*ARGV).get
data/fc2json.gemspec CHANGED
@@ -2,21 +2,22 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: fc2json 0.1.0 ruby lib
5
+ # stub: fc2json 0.2.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "fc2json"
9
- s.version = "0.1.0"
9
+ s.version = "0.2.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Roberto Pepato"]
14
- s.date = "2013-12-30"
14
+ s.date = "2013-12-31"
15
15
  s.description = "fc2json queries, downloads and formats all data from a remote Esri feature service, exposing it as json representation"
16
16
  s.email = "rpepato@gmail.com"
17
+ s.executables = ["fc2json"]
17
18
  s.extra_rdoc_files = [
18
19
  "LICENSE.txt",
19
- "README.rdoc"
20
+ "README.md"
20
21
  ]
21
22
  s.files = [
22
23
  ".document",
@@ -24,9 +25,10 @@ Gem::Specification.new do |s|
24
25
  "Gemfile",
25
26
  "Gemfile.lock",
26
27
  "LICENSE.txt",
27
- "README.rdoc",
28
+ "README.md",
28
29
  "Rakefile",
29
30
  "VERSION",
31
+ "bin/fc2json",
30
32
  "fc2json.gemspec",
31
33
  "lib/fc2json.rb",
32
34
  "spec/fc2json_spec.rb",
@@ -47,18 +49,18 @@ Gem::Specification.new do |s|
47
49
  s.specification_version = 4
48
50
 
49
51
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
50
- s.add_runtime_dependency(%q<nokogiri>, ["~> 1.5.10"])
52
+ s.add_runtime_dependency(%q<nokogiri>, [">= 1.5.10", "~> 1.5"])
51
53
  s.add_development_dependency(%q<rspec>, [">= 2.8.0", "~> 2.8"])
52
54
  s.add_development_dependency(%q<bundler>, ["~> 1.0"])
53
55
  s.add_development_dependency(%q<jeweler>, [">= 1.8.7", "~> 1.8"])
54
56
  else
55
- s.add_dependency(%q<nokogiri>, ["~> 1.5.10"])
57
+ s.add_dependency(%q<nokogiri>, [">= 1.5.10", "~> 1.5"])
56
58
  s.add_dependency(%q<rspec>, [">= 2.8.0", "~> 2.8"])
57
59
  s.add_dependency(%q<bundler>, ["~> 1.0"])
58
60
  s.add_dependency(%q<jeweler>, [">= 1.8.7", "~> 1.8"])
59
61
  end
60
62
  else
61
- s.add_dependency(%q<nokogiri>, ["~> 1.5.10"])
63
+ s.add_dependency(%q<nokogiri>, [">= 1.5.10", "~> 1.5"])
62
64
  s.add_dependency(%q<rspec>, [">= 2.8.0", "~> 2.8"])
63
65
  s.add_dependency(%q<bundler>, ["~> 1.0"])
64
66
  s.add_dependency(%q<jeweler>, [">= 1.8.7", "~> 1.8"])
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fc2json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Pepato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-30 00:00:00.000000000 Z
11
+ date: 2013-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.5.10
20
+ - - "~>"
21
+ - !ruby/object:Gem::Version
22
+ version: '1.5'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: 1.5.10
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '1.5'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rspec
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -81,20 +87,22 @@ dependencies:
81
87
  description: fc2json queries, downloads and formats all data from a remote Esri feature
82
88
  service, exposing it as json representation
83
89
  email: rpepato@gmail.com
84
- executables: []
90
+ executables:
91
+ - fc2json
85
92
  extensions: []
86
93
  extra_rdoc_files:
87
94
  - LICENSE.txt
88
- - README.rdoc
95
+ - README.md
89
96
  files:
90
97
  - ".document"
91
98
  - ".rspec"
92
99
  - Gemfile
93
100
  - Gemfile.lock
94
101
  - LICENSE.txt
95
- - README.rdoc
102
+ - README.md
96
103
  - Rakefile
97
104
  - VERSION
105
+ - bin/fc2json
98
106
  - fc2json.gemspec
99
107
  - lib/fc2json.rb
100
108
  - spec/fc2json_spec.rb
data/README.rdoc DELETED
@@ -1,19 +0,0 @@
1
- = fc2json
2
-
3
- Description goes here.
4
-
5
- == Contributing to fc2json
6
-
7
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
9
- * Fork the project.
10
- * Start a feature/bugfix branch.
11
- * Commit and push until you are happy with your contribution.
12
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
-
15
- == Copyright
16
-
17
- Copyright (c) 2013 rpepato. See LICENSE.txt for
18
- further details.
19
-