jetel 0.0.15 → 0.0.16
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/.travis.yml +34 -0
- data/README.md +14 -7
- data/Rakefile +11 -0
- data/bin/jetel +20 -0
- data/lib/jetel.rb +20 -0
- data/lib/jetel/cli/app.rb +20 -0
- data/lib/jetel/cli/cli.rb +20 -0
- data/lib/jetel/cli/cmd/config_cmd.rb +20 -0
- data/lib/jetel/cli/cmd/downloaders_cmd.rb +20 -0
- data/lib/jetel/cli/cmd/loaders_cmd.rb +20 -0
- data/lib/jetel/cli/cmd/modules_cmd.rb +31 -0
- data/lib/jetel/cli/cmd/version_cmd.rb +20 -0
- data/lib/jetel/cli/shared.rb +20 -0
- data/lib/jetel/config/config.rb +20 -0
- data/lib/jetel/downloaders/base_downloader.rb +20 -0
- data/lib/jetel/downloaders/downloader.rb +20 -0
- data/lib/jetel/downloaders/downloaders.rb +22 -0
- data/lib/jetel/helpers/general_helper.rb +20 -0
- data/lib/jetel/helpers/helpers.rb +19 -3
- data/lib/jetel/helpers/os_helper.rb +22 -0
- data/lib/jetel/lib.rb +20 -0
- data/lib/jetel/loaders/couchbase/couchbase.rb +42 -4
- data/lib/jetel/loaders/elasticsearch/elasticsearch.rb +22 -0
- data/lib/jetel/loaders/loader.rb +22 -0
- data/lib/jetel/loaders/loaders.rb +22 -0
- data/lib/jetel/loaders/pg/pg.rb +22 -0
- data/lib/jetel/loaders/pg/sql/copy.sql.erb +20 -0
- data/lib/jetel/loaders/pg/sql/create_table.sql.erb +20 -0
- data/lib/jetel/loaders/pg/sql/drop_table.sql.erb +20 -0
- data/lib/jetel/loaders/pg/sql/header.sql.erb +20 -0
- data/lib/jetel/loaders/pg/sql/schema.sql.erb +20 -0
- data/lib/jetel/loaders/pg/sql/truncate_table.sql.erb +20 -0
- data/lib/jetel/modules/alexa/alexa.rb +19 -0
- data/lib/jetel/modules/gadm/gadm.rb +5 -1
- data/lib/jetel/modules/geolite/geolite.rb +19 -0
- data/lib/jetel/modules/ip/ip.rb +20 -0
- data/lib/jetel/modules/iso3166/iso3166.rb +20 -0
- data/lib/jetel/modules/module.rb +46 -4
- data/lib/jetel/modules/modules.rb +22 -0
- data/lib/jetel/modules/nga/nga.rb +20 -0
- data/lib/jetel/modules/sfpd/sfpd.rb +20 -0
- data/lib/jetel/modules/tiger/tiger.rb +113 -0
- data/lib/jetel/modules/wifileaks/wifileaks.rb +21 -1
- data/lib/jetel/version.rb +21 -1
- data/spec/helpers/general_helper_spec.rb +16 -0
- data/spec/modules/alexa_spec.rb +0 -0
- data/{test → spec}/spec_helper.rb +0 -0
- metadata +10 -5
- data/Gemfile.lock +0 -156
@@ -1,5 +1,25 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
+
# Copyright (c) 2015, Tomas Korcak <korczis@gmail.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
3
23
|
module Jetel
|
4
24
|
class Downloader
|
5
25
|
attr_reader :downloader
|
@@ -1,3 +1,25 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# Copyright (c) 2015, Tomas Korcak <korczis@gmail.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
1
23
|
require 'active_support/inflector'
|
2
24
|
require_relative 'downloaders'
|
3
25
|
|
@@ -1,5 +1,25 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
+
# Copyright (c) 2015, Tomas Korcak <korczis@gmail.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
3
23
|
require_relative '../config/config'
|
4
24
|
|
5
25
|
require_relative '../helpers/helpers'
|
@@ -1,8 +1,24 @@
|
|
1
1
|
# encoding: UTF-8
|
2
|
+
|
3
|
+
# Copyright (c) 2015, Tomas Korcak <korczis@gmail.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
2
14
|
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
6
22
|
|
7
23
|
require 'pathname'
|
8
24
|
|
@@ -1,3 +1,25 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# Copyright (c) 2015, Tomas Korcak <korczis@gmail.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
1
23
|
module Jetel
|
2
24
|
module Helper
|
3
25
|
class << self
|
data/lib/jetel/lib.rb
CHANGED
@@ -1,5 +1,25 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
+
# Copyright (c) 2015, Tomas Korcak <korczis@gmail.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
3
23
|
require_relative 'version'
|
4
24
|
|
5
25
|
require_relative 'extensions/extensions'
|
@@ -1,9 +1,31 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# Copyright (c) 2015, Tomas Korcak <korczis@gmail.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
1
23
|
require_relative '../loader'
|
2
24
|
|
3
25
|
require_relative '../../helpers/helpers'
|
4
26
|
|
5
27
|
require 'couchbase'
|
6
|
-
|
28
|
+
require 'multi_json'
|
7
29
|
require 'securerandom'
|
8
30
|
|
9
31
|
module Jetel
|
@@ -40,9 +62,7 @@ module Jetel
|
|
40
62
|
@client = ::Couchbase.connect(opts)
|
41
63
|
end
|
42
64
|
|
43
|
-
def
|
44
|
-
super
|
45
|
-
|
65
|
+
def load_csv(modul, source, file, opts)
|
46
66
|
cache = {}
|
47
67
|
CSV.open(file, 'rt', :headers => true, :converters => :all) do |csv|
|
48
68
|
csv.each do |row|
|
@@ -60,6 +80,24 @@ module Jetel
|
|
60
80
|
end
|
61
81
|
end
|
62
82
|
end
|
83
|
+
|
84
|
+
def load_json(modul, source, file, opts)
|
85
|
+
uuid = SecureRandom.uuid
|
86
|
+
doc = {
|
87
|
+
uuid => MultiJson.load(File.read(file))
|
88
|
+
}
|
89
|
+
client.add(doc)
|
90
|
+
end
|
91
|
+
|
92
|
+
def load(modul, source, file, opts)
|
93
|
+
super
|
94
|
+
|
95
|
+
if file =~ /\.csv/
|
96
|
+
load_csv(modul, source, file, opts)
|
97
|
+
elsif file =~ /\.json/
|
98
|
+
load_json(modul, source, file, opts)
|
99
|
+
end
|
100
|
+
end
|
63
101
|
end
|
64
102
|
end
|
65
103
|
end
|
@@ -1,3 +1,25 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# Copyright (c) 2015, Tomas Korcak <korczis@gmail.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
1
23
|
require_relative '../loader'
|
2
24
|
|
3
25
|
require_relative '../../helpers/helpers'
|
data/lib/jetel/loaders/loader.rb
CHANGED
@@ -1,3 +1,25 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# Copyright (c) 2015, Tomas Korcak <korczis@gmail.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
1
23
|
module Jetel
|
2
24
|
module Loaders
|
3
25
|
class Loader
|
@@ -1,3 +1,25 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# Copyright (c) 2015, Tomas Korcak <korczis@gmail.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
1
23
|
require 'active_support/inflector'
|
2
24
|
require_relative '../extensions/extensions'
|
3
25
|
|
data/lib/jetel/loaders/pg/pg.rb
CHANGED
@@ -1,3 +1,25 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# Copyright (c) 2015, Tomas Korcak <korczis@gmail.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
1
23
|
require_relative '../loader'
|
2
24
|
|
3
25
|
require_relative '../../helpers/helpers'
|
@@ -1,3 +1,23 @@
|
|
1
|
+
-- Copyright (c) 2015, Tomas Korcak <korczis@gmail.com>
|
2
|
+
|
3
|
+
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
-- of this software and associated documentation files (the "Software"), to deal
|
5
|
+
-- in the Software without restriction, including without limitation the rights
|
6
|
+
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
-- copies of the Software, and to permit persons to whom the Software is
|
8
|
+
-- furnished to do so, subject to the following conditions:
|
9
|
+
--
|
10
|
+
-- The above copyright notice and this permission notice shall be included in
|
11
|
+
-- all copies or substantial portions of the Software.
|
12
|
+
--
|
13
|
+
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
-- THE SOFTWARE.
|
20
|
+
|
1
21
|
COPY "<%= ctx[:table] %>"
|
2
22
|
FROM STDIN
|
3
23
|
<% if ctx[:delimiter] || ctx[:row_sep] %>
|
@@ -1,3 +1,23 @@
|
|
1
|
+
-- Copyright (c) 2015, Tomas Korcak <korczis@gmail.com>
|
2
|
+
|
3
|
+
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
-- of this software and associated documentation files (the "Software"), to deal
|
5
|
+
-- in the Software without restriction, including without limitation the rights
|
6
|
+
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
-- copies of the Software, and to permit persons to whom the Software is
|
8
|
+
-- furnished to do so, subject to the following conditions:
|
9
|
+
--
|
10
|
+
-- The above copyright notice and this permission notice shall be included in
|
11
|
+
-- all copies or substantial portions of the Software.
|
12
|
+
--
|
13
|
+
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
-- THE SOFTWARE.
|
20
|
+
|
1
21
|
DROP TABLE IF EXISTS "<%= ctx[:table] %>";
|
2
22
|
|
3
23
|
CREATE TABLE "<%= ctx[:table] %>"
|
@@ -1,2 +1,22 @@
|
|
1
|
+
-- Copyright (c) 2015, Tomas Korcak <korczis@gmail.com>
|
2
|
+
|
3
|
+
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
-- of this software and associated documentation files (the "Software"), to deal
|
5
|
+
-- in the Software without restriction, including without limitation the rights
|
6
|
+
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
-- copies of the Software, and to permit persons to whom the Software is
|
8
|
+
-- furnished to do so, subject to the following conditions:
|
9
|
+
--
|
10
|
+
-- The above copyright notice and this permission notice shall be included in
|
11
|
+
-- all copies or substantial portions of the Software.
|
12
|
+
--
|
13
|
+
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
-- THE SOFTWARE.
|
20
|
+
|
1
21
|
DROP TABLE IF EXISTS "<%= ctx[:table] %>";
|
2
22
|
|
@@ -1,2 +1,22 @@
|
|
1
|
+
-- Copyright (c) 2015, Tomas Korcak <korczis@gmail.com>
|
2
|
+
|
3
|
+
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
-- of this software and associated documentation files (the "Software"), to deal
|
5
|
+
-- in the Software without restriction, including without limitation the rights
|
6
|
+
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
-- copies of the Software, and to permit persons to whom the Software is
|
8
|
+
-- furnished to do so, subject to the following conditions:
|
9
|
+
--
|
10
|
+
-- The above copyright notice and this permission notice shall be included in
|
11
|
+
-- all copies or substantial portions of the Software.
|
12
|
+
--
|
13
|
+
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
-- THE SOFTWARE.
|
20
|
+
|
1
21
|
-- Table: "<%= ctx[:table] + "\n" %>"
|
2
22
|
|
@@ -1,3 +1,23 @@
|
|
1
|
+
-- Copyright (c) 2015, Tomas Korcak <korczis@gmail.com>
|
2
|
+
|
3
|
+
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
-- of this software and associated documentation files (the "Software"), to deal
|
5
|
+
-- in the Software without restriction, including without limitation the rights
|
6
|
+
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
-- copies of the Software, and to permit persons to whom the Software is
|
8
|
+
-- furnished to do so, subject to the following conditions:
|
9
|
+
--
|
10
|
+
-- The above copyright notice and this permission notice shall be included in
|
11
|
+
-- all copies or substantial portions of the Software.
|
12
|
+
--
|
13
|
+
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
-- THE SOFTWARE.
|
20
|
+
|
1
21
|
DROP TABLE IF EXISTS "<%= ctx[:table] %>";
|
2
22
|
|
3
23
|
CREATE TABLE "<%= ctx[:table] %>"
|