arcgis-opendata 0.0.3 → 0.0.4.1
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 +4 -4
- data/README.md +34 -11
- data/lib/client.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 149324d284a0888b8bfbb57c28842b6e52bdc8d4
|
4
|
+
data.tar.gz: 442c429e07ee4606790fed1e4723769708c071d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05274fb3bd8413a62fea7c865d470c3223a8bb872496dbed35c31724ac59077c2e7b7d2258c202464e5441e2531512541d0f567c90eec11208cf7ac8a6fd4529
|
7
|
+
data.tar.gz: 25998b84c58da249d6b5eacce49e04ce75d9d2b94ad179de8a01b3ccfdba436bcd0cb28458dcd6d16e8e562138462213b7ed7474c4edae98a41552a3d0ec159b
|
data/README.md
CHANGED
@@ -1,19 +1,15 @@
|
|
1
1
|
# Opendata
|
2
2
|
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/opendata`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
-
|
7
3
|
## Installation
|
8
4
|
|
9
5
|
Add this line to your application's Gemfile:
|
10
6
|
|
11
|
-
|
12
|
-
|
7
|
+
Reference the latest source directly
|
8
|
+
```ruby
|
13
9
|
gem "arcgis-opendata", :git => "git://github.com/esridc/arcgis-opendata.rb.git", require: 'opendata'
|
14
|
-
|
10
|
+
```
|
15
11
|
|
16
|
-
|
12
|
+
From rubygems.org
|
17
13
|
```ruby
|
18
14
|
gem 'arcgis-opendata', require: 'opendata'
|
19
15
|
```
|
@@ -28,13 +24,40 @@ Or install it yourself as:
|
|
28
24
|
|
29
25
|
## Usage
|
30
26
|
|
31
|
-
|
27
|
+
The main class the gem provides is `Opendata::Client`, which can be used to query and fetch
|
28
|
+
resources from the ArcGIS Open Data API
|
29
|
+
|
30
|
+
Instantiate an Opendata::Client instance
|
31
|
+
```ruby
|
32
|
+
client = Opendata::Client.new('https://opendata.arcgis.com')
|
33
|
+
```
|
34
|
+
|
35
|
+
You can also instantiate an instance directly from the Opendata module
|
36
|
+
```ruby
|
37
|
+
client = Opendata.new('https://opendata.arcgis.com')
|
38
|
+
```
|
39
|
+
|
40
|
+
Make queries for datasets
|
41
|
+
```ruby
|
42
|
+
client = Opendata.new('https://opendata.arcgis.com')
|
43
|
+
|
44
|
+
response = client.dataset_list(q: 'census', page: { size: 25}, include: 'organizations')
|
45
|
+
# => returns a Faraday::Response object
|
46
|
+
```
|
47
|
+
|
48
|
+
Fetch a single dataset
|
49
|
+
```ruby
|
50
|
+
client = Opendata.new('https://opendata.arcgis.com')
|
51
|
+
|
52
|
+
response = client.dataset_show('4df13_11', include: 'organizations,groups')
|
53
|
+
# => returns a Faraday::Response object
|
54
|
+
```
|
32
55
|
|
33
56
|
## Development
|
34
57
|
|
35
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment
|
58
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. ~~You can also run `bin/console` for an interactive prompt that will allow you to experiment.~~ `bin/console` is currently not working
|
36
59
|
|
37
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `
|
60
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `client.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
38
61
|
|
39
62
|
## Contributing
|
40
63
|
|
data/lib/client.rb
CHANGED