to_wkt_ 0.1.0 → 0.1.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 +1 -1
- data/lib/{to_wkt → to_wkt_}/adapter.rb +0 -0
- data/lib/to_wkt_/version.rb +3 -0
- data/lib/{to_wkt.rb → to_wkt_.rb} +2 -2
- data/spec/spec_helper.rb +1 -1
- data/{to_wkt.gemspec → to_wkt_.gemspec} +4 -4
- metadata +32 -10
- data/.rvmrc +0 -62
- data/lib/to_wkt/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f2c8a3af6bfbbeeeea2525b1850aacdac996068
|
4
|
+
data.tar.gz: 05ad08cb0ada51d4a9ede43d61e8f6b0df77601e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f278f75366563c1c44dc05e85f18ec0ce36cf999437972363067134ef07189d12a15af7a54e24ab06411f56904ccd8ac080d410b59989278fcb199cdba9d75d1
|
7
|
+
data.tar.gz: e67fbbbeee160aaa282482ab1d3195daf3244ed82359985b8b0f7cd8b302c594f7bf76401517042f87ab73db821f40e786ef63a9e31952e5e8e83aaf75486d03
|
data/README.md
CHANGED
File without changes
|
data/spec/spec_helper.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require '
|
4
|
+
require 'to_wkt_/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "to_wkt_"
|
8
8
|
spec.version = ToWkt::VERSION
|
9
9
|
spec.authors = ["Steven Dunlap"]
|
10
10
|
spec.email = ["steven@roadtrippers.com"]
|
11
|
-
spec.description = %q{
|
12
|
-
spec.summary =
|
13
|
-
spec.homepage = "http://github.com/roadtrippers/
|
11
|
+
spec.description = %q{Quickly and easily convert arrays to [Well-Known Text (WKT)] format.}
|
12
|
+
spec.summary = File.open('README.md').read
|
13
|
+
spec.homepage = "http://github.com/roadtrippers/to_wkt_"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: to_wkt_
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Dunlap
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
description:
|
55
|
+
description: Quickly and easily convert arrays to [Well-Known Text (WKT)] format.
|
56
56
|
email:
|
57
57
|
- steven@roadtrippers.com
|
58
58
|
executables: []
|
@@ -60,18 +60,17 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
|
-
- ".rvmrc"
|
64
63
|
- Gemfile
|
65
64
|
- LICENSE.txt
|
66
65
|
- README.md
|
67
66
|
- Rakefile
|
68
|
-
- lib/
|
69
|
-
- lib/
|
70
|
-
- lib/
|
67
|
+
- lib/to_wkt_.rb
|
68
|
+
- lib/to_wkt_/adapter.rb
|
69
|
+
- lib/to_wkt_/version.rb
|
71
70
|
- spec/array.rb
|
72
71
|
- spec/spec_helper.rb
|
73
|
-
-
|
74
|
-
homepage: http://github.com/roadtrippers/
|
72
|
+
- to_wkt_.gemspec
|
73
|
+
homepage: http://github.com/roadtrippers/to_wkt_
|
75
74
|
licenses:
|
76
75
|
- MIT
|
77
76
|
metadata: {}
|
@@ -94,8 +93,31 @@ rubyforge_project:
|
|
94
93
|
rubygems_version: 2.1.5
|
95
94
|
signing_key:
|
96
95
|
specification_version: 4
|
97
|
-
summary:
|
98
|
-
as
|
96
|
+
summary: "# to_wkt_ Quickly and easily convert arrays to [Well-Known Text (WKT)]
|
97
|
+
format. Which are commonly used in GIS Databases such as [PostGIS]. ## Installation
|
98
|
+
\ Add this line to your application's Gemfile: gem 'to_wkt_' And then execute:
|
99
|
+
\ $ bundle Or install it yourself as: $ gem install to_wkt_ ## Usage ToWkt automatically
|
100
|
+
exposes the following methods on any instance of `Array`: - `#to_wkt_point` - converts
|
101
|
+
an array to a WKT POINT - e.g. ```ruby [0,0].to_wkt_point # \"POINT(0 0)\" ```
|
102
|
+
\ - `#to_wkt_line_string` - converts an array to a WKT LINESTRING - e.g. ```ruby
|
103
|
+
[ [0,0], [1,1], [1,2] ].to_wkt_line_string # \"LINESTRING(0 0,1 1,1 2)\" ``` -
|
104
|
+
`#to_wkt_polygon` - converts an array to a WKT POLYGON - e.g. ```ruby polygon_array
|
105
|
+
= [ [ [0,0], [4,0], [4,4], [0,4], [0,0] ], [ [1,1], [2,1], [2,2], [1,2], [1,1] ]
|
106
|
+
] polygon_array.to_wkt_polygon # \"POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1,2 1,2 2,1
|
107
|
+
2,1 1))\" ``` - `#to_wkt_multi_point` - converts an array to a WKT MULTIPOINT -
|
108
|
+
e.g. ```ruby [ [0,0], [1,2] ].to_wkt_multi_point # \"MULTIPOINT(0 0,1 2)\" ```
|
109
|
+
\ - `#to_wkt_multi_line_string` - converts an array to a WKT MULTILINESTRING -
|
110
|
+
e.g. ```ruby multi_line_array = [ [ [0,0], [1,1], [1,2] ], [ [2,3], [3,2], [5,4]
|
111
|
+
] ] multi_line_array.to_wkt_multi_line_string # \"MULTILINESTRING((0 0,1 1,1 2),(2
|
112
|
+
3,3 2,5 4))\" ``` - `#to_wkt_multi_polygon` - converts an array to a WKT MULTIPOLYGON
|
113
|
+
\ - e.g. ```ruby multi_polygon_array = [ [ [[0,0], [4,0], [4,4], [0,4], [0,0]],
|
114
|
+
[[1,1], [2,1], [2,2], [1,2], [1,1]] ], [ [[-1,-1], [-1,-2], [-2,-2], [-2,-1], [-1,-1]]
|
115
|
+
] ] multi_polygon_array.to_wkt_multi_polygon= \"MULTIPOLYGON(((0 0,4 0,4 4,0 4,0
|
116
|
+
0),(1 1,2 1,2 2,1 2,1 1)),((-1 -1,-1 -2,-2 -2,-2 -1,-1 -1)))\" ``` ## Contributing
|
117
|
+
\ 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3.
|
118
|
+
Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch
|
119
|
+
(`git push origin my-new-feature`) 5. Create new Pull Request [Well-Known Text
|
120
|
+
(WKT)]: http://en.wikipedia.org/wiki/Well-known_text [PostGIS]: http://postgis.refractions.net/documentation/manual-1.3SVN/ch04.html#id2726203"
|
99
121
|
test_files:
|
100
122
|
- spec/array.rb
|
101
123
|
- spec/spec_helper.rb
|
data/.rvmrc
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
# This is an RVM Project .rvmrc file, used to automatically load the ruby
|
4
|
-
# development environment upon cd'ing into the directory
|
5
|
-
|
6
|
-
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
|
7
|
-
# Only full ruby name is supported here, for short names use:
|
8
|
-
# echo "rvm use head@to_wkt" > .rvmrc
|
9
|
-
environment_id="ruby-head@to_wkt"
|
10
|
-
|
11
|
-
# Uncomment the following lines if you want to verify rvm version per project
|
12
|
-
# rvmrc_rvm_version="1.22.10 (stable)" # 1.10.1 seems like a safe start
|
13
|
-
# eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | __rvm_awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
|
14
|
-
# echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
|
15
|
-
# return 1
|
16
|
-
# }
|
17
|
-
|
18
|
-
# First we attempt to load the desired environment directly from the environment
|
19
|
-
# file. This is very fast and efficient compared to running through the entire
|
20
|
-
# CLI and selector. If you want feedback on which environment was used then
|
21
|
-
# insert the word 'use' after --create as this triggers verbose mode.
|
22
|
-
if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
|
23
|
-
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
|
24
|
-
then
|
25
|
-
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
|
26
|
-
for __hook in "${rvm_path:-$HOME/.rvm}/hooks/after_use"*
|
27
|
-
do
|
28
|
-
if [[ -f "${__hook}" && -x "${__hook}" && -s "${__hook}" ]]
|
29
|
-
then \. "${__hook}" || true
|
30
|
-
fi
|
31
|
-
done
|
32
|
-
unset __hook
|
33
|
-
if (( ${rvm_use_flag:=1} >= 1 )) # display automatically
|
34
|
-
then
|
35
|
-
if [[ $- == *i* ]] # check for interactive shells
|
36
|
-
then printf "%b" "Using: $(tput setaf 2 2>/dev/null)$GEM_HOME$(tput sgr0 2>/dev/null)
|
37
|
-
" # show the user the ruby and gemset they are using in green
|
38
|
-
else printf "%b" "Using: $GEM_HOME
|
39
|
-
" # don't use colors in non-interactive shells
|
40
|
-
fi
|
41
|
-
fi
|
42
|
-
else
|
43
|
-
# If the environment file has not yet been created, use the RVM CLI to select.
|
44
|
-
rvm --create use "$environment_id" || {
|
45
|
-
echo "Failed to create RVM environment '${environment_id}'."
|
46
|
-
return 1
|
47
|
-
}
|
48
|
-
fi
|
49
|
-
|
50
|
-
# If you use bundler, this might be useful to you:
|
51
|
-
# if [[ -s Gemfile ]] && {
|
52
|
-
# ! builtin command -v bundle >/dev/null ||
|
53
|
-
# builtin command -v bundle | GREP_OPTIONS="" \grep $rvm_path/bin/bundle >/dev/null
|
54
|
-
# }
|
55
|
-
# then
|
56
|
-
# printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
|
57
|
-
# gem install bundler
|
58
|
-
# fi
|
59
|
-
# if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null
|
60
|
-
# then
|
61
|
-
# bundle install | GREP_OPTIONS="" \grep -vE '^Using|Your bundle is complete'
|
62
|
-
# fi
|
data/lib/to_wkt/version.rb
DELETED