cartograss 0.0.1 → 0.1.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: 09f42fc33c9f9f712e9093fd68ff1423e66dccc9
4
- data.tar.gz: eae2e947a513cce34bad1643f7f8abd71ad1b013
3
+ metadata.gz: e7f4fcd310a9a7faa6110747fa65497f93abb03b
4
+ data.tar.gz: 38d72353181192e2e8cc24f4f4f80a024556d079
5
5
  SHA512:
6
- metadata.gz: 19e9e7c7b3611f0b4cf319fc15e84c26a9c6f943dbb35fa13a2a752af0d72905688b796002a32e1b4f9864d8e60ea356a1d011a80efb57cf2a95508d190d43a8
7
- data.tar.gz: 74bd88e86cd384c0209f25c06cb916a8e2a9365052fa57e2d5e2bbb679306305d4ec283c0f022614b8d47ddc5607773720d5259f7cc61241777e32817950180a
6
+ metadata.gz: da04fab40d67cd08a1042ebfd2634bf05a77887e05dd57dee3840474b3eeb30020ef76c06c7a31eeed8e3e233e068c467d1e3bdbd3e0b8dad1a199a95715cbd8
7
+ data.tar.gz: cc3e00b51ef2fcf770d60b9ec34e6b85714e8cc41ded3a6fb2a0605326247042245e981f521703b4f47b31d39cae21882036bbcf483681e2512560c84cdff5d1
data/README.md CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/cartograss.svg)](http://badge.fury.io/rb/cartograss)
4
4
 
5
- Import and Export [CARTO](http://carto.com) datasets as GRASS GIS maps.
5
+ Import and Export [CARTO](http://carto.com) datasets as [GRASS GIS](https://grass.osgeo.org/) maps,
6
+ using the [GrassGis](https://github.com/jgoizueta/grassgis) Ruby Gem.
6
7
 
7
8
  Works with GRASS 7.x and only with vector geometry.
8
9
 
@@ -24,8 +25,9 @@ Or install it yourself as:
24
25
 
25
26
  ## Usage
26
27
 
27
- You'll need a [CARTO engine](https://carto.com/engine/) account
28
- (that is, one with an authorized API KEY).
28
+ You'll need a [CARTO engine](https://carto.com/engine/) account
29
+ (that is, one with an authorized API KEY). The api key will actually needed to export data to CARTO
30
+ or import from private CARTO datasets.
29
31
 
30
32
  This example fetches some data from your CARTO account, then processes it in GRASS and
31
33
  sends the results back to CARTO so they can be visualized in web maps.
@@ -58,7 +60,6 @@ GrassGis.session grass_config do
58
60
  dataset: 'mydataset'
59
61
  )
60
62
  end
61
-
62
63
  ```
63
64
 
64
65
  ## Development
@@ -69,7 +70,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
69
70
 
70
71
  ## Contributing
71
72
 
72
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cartograss. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
73
+ Bug reports and pull requests are welcome on GitHub at https://github.com/jgoizueta/cartograss. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
73
74
 
74
75
 
75
76
  ## License
@@ -1,7 +1,7 @@
1
1
  require "cartograss/version"
2
2
 
3
3
  module CartoGrass
4
- def carto_import(user:, dataset:, api_key:)
4
+ def carto_import(user:, dataset:, api_key: nil)
5
5
  with_api_key api_key do
6
6
  if epsg4326?
7
7
  v.in.ogr(
@@ -70,12 +70,16 @@ module CartoGrass
70
70
  end
71
71
 
72
72
  def with_api_key(api_key)
73
- api_key_var = "#{CARTO_OGR.upcase}_API_KEY"
74
- begin
75
- ENV[api_key_var] = api_key
73
+ if api_key
74
+ api_key_var = "#{CARTO_OGR.upcase}_API_KEY"
75
+ begin
76
+ ENV[api_key_var] = api_key
77
+ yield
78
+ ensure
79
+ ENV.delete api_key_var
80
+ end
81
+ else
76
82
  yield
77
- ensure
78
- ENV.delete api_key_var
79
83
  end
80
84
  end
81
85
 
@@ -1,3 +1,3 @@
1
1
  module CartoGrass
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cartograss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Goizueta
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-30 00:00:00.000000000 Z
11
+ date: 2017-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  requirements: []
107
107
  rubyforge_project:
108
- rubygems_version: 2.4.5.1
108
+ rubygems_version: 2.6.8
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: Use CARTO datasets in GRASS GIS