worlddb 2.2.1 → 2.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02e4aee5a2328bc9d9ad438f18008fdd21d9e032
4
- data.tar.gz: b7ffd082f22b1eae0b068119f137c81582803d38
3
+ metadata.gz: 24d659b0a6e54a1035ee66d2a01ab34766703d09
4
+ data.tar.gz: c813625ec34d148179e5950346b415a791729f11
5
5
  SHA512:
6
- metadata.gz: 437d157d9498a7c1c71f3edf419d38941706be74949949713d9486f3ac5a29354d210a4afe179c59c150390edc6b3f1cf326e0494d62cabe637259ddb4087919
7
- data.tar.gz: e8af4c21f138e17424bb314a183c56fa7924985e89c5a0967c1baeb8bee6020097050d4bff844672c042cd707ad9e38e2f0c5a0862f60e8a62886efe222cb8a7
6
+ metadata.gz: ff6dfd3b729c340fc7bf63050d87ac4dd72c5def886f9ae03626a8c71753228b359b3ad4378cdc6a48e4fe22c66c4228971284f08b0423f4d0837365833701a3
7
+ data.tar.gz: 2af456f08c297e815dcdc5faa3b737b6676a770f78016dd8959764b2306da522c8096da32899a1b399278a1fd2ea2c225fa973421a40c812ed96a92f25421aba
data/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  world.db Command Line Tool in Ruby
4
4
 
5
- * home :: [github.com/worlddb/world.db.ruby](https://github.com/worlddb/world.db.ruby)
6
- * bugs :: [github.com/worlddb/world.db.ruby/issues](https://github.com/worlddb/world.db.ruby/issues)
5
+ * home :: [github.com/worlddb/world.db.tools](https://github.com/worlddb/world.db.tools)
6
+ * bugs :: [github.com/worlddb/world.db.tools/issues](https://github.com/worlddb/world.db.tools/issues)
7
7
  * gem :: [rubygems.org/gems/worlddb](https://rubygems.org/gems/worlddb)
8
8
  * rdoc :: [rubydoc.info/gems/worlddb](http://rubydoc.info/gems/worlddb)
9
9
  * forum :: [groups.google.com/group/openmundi](https://groups.google.com/group/openmundi)
data/Rakefile CHANGED
@@ -9,15 +9,18 @@ Hoe.spec 'worlddb' do
9
9
  self.summary = "worlddb - world.db command line tool"
10
10
  self.description = summary
11
11
 
12
- self.urls = ['https://github.com/worlddb/world.db.ruby']
12
+ self.urls = ['https://github.com/worlddb/world.db.tools']
13
13
 
14
14
  self.author = 'Gerald Bauer'
15
15
  self.email = 'openmundi@googlegroups.com'
16
16
 
17
17
  self.extra_deps = [
18
- ['worlddb-models', '>=2.1.0'],
18
+ ['worlddb-models', '>=2.3.0'],
19
19
  ### ['worlddb-service'],
20
20
 
21
+ ['datafile', '>= 0.2.2'],
22
+ ['fetcher', '>= 0.4.5'],
23
+
21
24
  ## 3rd party
22
25
  ['gli', '>= 2.12.2'],
23
26
  ['sqlite3'] # Note: will include sqlite for activerecord; use worlddb-models for apps etc.
@@ -2,6 +2,8 @@
2
2
 
3
3
  require 'worlddb/models' # NOTE: depends on core (aka worlddb-models)
4
4
 
5
+ require 'fetcher'
6
+ require 'datafile'
5
7
 
6
8
  require 'gli'
7
9
 
@@ -80,6 +80,81 @@ desc 'Only show warnings, errors and fatal messages'
80
80
  switch [:q, :quiet], negatable: false
81
81
 
82
82
 
83
+ desc "Build DB (download/create/read); use ./Datafile - zips get downloaded to ./tmp"
84
+ command [:build,:b] do |c|
85
+
86
+ c.action do |g,o,args|
87
+
88
+ datafile = Datafile::Datafile.load_file( './Datafile' )
89
+ datafile.download # datafile step 1 - download all datasets/zips
90
+
91
+ connect_to_db( opts )
92
+
93
+ WorldDb.create_all
94
+
95
+ datafile.read # datafile step 2 - read all datasets
96
+
97
+ puts 'Done.'
98
+ end # action
99
+ end # command setup
100
+
101
+ desc "Read datasets; use ./Datafile - zips required in ./tmp"
102
+ command [:read,:r] do |c|
103
+
104
+ c.action do |g,o,args|
105
+
106
+ connect_to_db( opts )
107
+
108
+ datafile = Datafile::Datafile.load_file( './Datafile' )
109
+ datafile.read
110
+
111
+ puts 'Done.'
112
+ end # action
113
+ end # command setup
114
+
115
+ desc "Download datasets; use ./Datafile - zips get downloaded to ./tmp"
116
+ command [:download,:dl] do |c|
117
+
118
+ c.action do |g,o,args|
119
+
120
+ # note: no database connection needed (check - needed for logs?? - not setup by default???)
121
+
122
+ datafile = Datafile::Datafile.load_file( './Datafile' )
123
+ datafile.download
124
+
125
+ puts 'Done.'
126
+ end # action
127
+ end # command setup
128
+
129
+
130
+ desc "Build DB w/ quick starter Datafile templates"
131
+ arg_name 'NAME' # optional setup profile name
132
+ command [:new,:n] do |c|
133
+
134
+ c.action do |g,o,args|
135
+
136
+ ## todo: required template name (defaults to worldcup2014)
137
+ setup = args[0] || 'at'
138
+
139
+ worker = Fetcher::Worker.new
140
+ ## note: lets use http:// instead of https:// for now - lets us use person proxy (NOT working w/ https for now)
141
+ worker.copy( "http://github.com/openmundi/datafile/raw/master/#{setup}.rb", './Datafile' )
142
+
143
+ ## step 2: same as command build (todo - reuse code)
144
+ datafile = Datafile::Datafile.load_file( './Datafile' )
145
+ datafile.download # datafile step 1 - download all datasets/zips
146
+
147
+ connect_to_db( opts ) ### todo: check let connect go first?? - for logging (logs) to db ???
148
+
149
+ WorldDb.create_all
150
+
151
+ datafile.read # datafile step 2 - read all datasets
152
+
153
+ puts 'Done.'
154
+ end # action
155
+ end # command setup
156
+
157
+
83
158
 
84
159
  desc 'Create DB schema'
85
160
  command [:create] do |c|
@@ -93,7 +168,6 @@ command [:create] do |c|
93
168
  end # action
94
169
  end # command create
95
170
 
96
-
97
171
  desc "Create DB schema 'n' load all world data"
98
172
  arg_name 'NAME' # optional setup profile name
99
173
  command [:setup,:s] do |c|
@@ -6,8 +6,8 @@
6
6
  module WorldDbCli # todo/check - rename to WorldDbTool or WorldDbCommands or WorldDbShell ??
7
7
 
8
8
  MAJOR = 2 ## todo: namespace inside version or something - why? why not??
9
- MINOR = 2
10
- PATCH = 1
9
+ MINOR = 3
10
+ PATCH = 0
11
11
  VERSION = [MAJOR,MINOR,PATCH].join('.')
12
12
 
13
13
  def self.version
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: worlddb
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-06 00:00:00.000000000 Z
11
+ date: 2015-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: worlddb-models
@@ -16,14 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 2.1.0
19
+ version: 2.3.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 2.1.0
26
+ version: 2.3.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: datafile
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.2.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 0.2.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: fetcher
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 0.4.5
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 0.4.5
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: gli
29
57
  requirement: !ruby/object:Gem::Requirement
@@ -100,7 +128,7 @@ files:
100
128
  - lib/worlddb/cli/opts.rb
101
129
  - lib/worlddb/cli/version.rb
102
130
  - lib/worlddb/console.rb
103
- homepage: https://github.com/worlddb/world.db.ruby
131
+ homepage: https://github.com/worlddb/world.db.tools
104
132
  licenses:
105
133
  - Public Domain
106
134
  metadata: {}