grn2drn 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/grn2drn/command-converter.rb +9 -29
- data/lib/grn2drn/version.rb +1 -1
- metadata +19 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e60d608aada1e0b439f28ec7a5b7628365c09b0
|
4
|
+
data.tar.gz: 2c66b85496f571eb94437b76408f2921c4b9452a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afd6e187ba5588f78dc3348fde7013434fdb4cc26cba905ae543bb408c0aa72cd9f074a7b6077331a79a9aba3d74b8395146c83d7e5d6ce5f558bb78b0d5e9f4
|
7
|
+
data.tar.gz: 35eafde72a0833c6b71e54caa4155183da57eff182c6881a91bb204b8f14da1c76588a1b3ba7deb224a5a4fc83f3f2391024fd6e717b98b57f4cb82681735597
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
|
-
# Copyright (C) 2013-
|
3
|
+
# Copyright (C) 2013-2015 Droonga Project
|
4
4
|
#
|
5
5
|
# This library is free software; you can redistribute it and/or
|
6
6
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -32,15 +32,8 @@ module Grn2Drn
|
|
32
32
|
|
33
33
|
def convert(input, &block)
|
34
34
|
@command_parser.on_command do |command|
|
35
|
-
|
36
|
-
|
37
|
-
yield create_table_create_command(command)
|
38
|
-
when "table_remove"
|
39
|
-
yield create_table_remove_command(command)
|
40
|
-
when "column_create"
|
41
|
-
yield create_column_create_command(command)
|
42
|
-
when "select"
|
43
|
-
yield create_select_command(command)
|
35
|
+
unless command.name == "load"
|
36
|
+
yield create_message(command.name, command_to_body(command))
|
44
37
|
end
|
45
38
|
end
|
46
39
|
|
@@ -69,14 +62,15 @@ module Grn2Drn
|
|
69
62
|
@count += 1
|
70
63
|
end
|
71
64
|
|
72
|
-
{
|
65
|
+
message = {
|
73
66
|
"id" => id,
|
74
67
|
"date" => format_date(@options[:date] || Time.now),
|
75
|
-
"replyTo" => @options[:reply_to],
|
76
68
|
"dataset" => @options[:dataset],
|
77
69
|
"type" => type,
|
78
70
|
"body" => body,
|
79
71
|
}
|
72
|
+
message["replyTo"] = @options[:reply_to] if @options[:reply_to]
|
73
|
+
message
|
80
74
|
end
|
81
75
|
|
82
76
|
def new_unique_id
|
@@ -86,8 +80,10 @@ module Grn2Drn
|
|
86
80
|
Digest::SHA1.hexdigest("#{now_msec}:#{random_string}")
|
87
81
|
end
|
88
82
|
|
83
|
+
MICRO_SECONDS_DECIMAL_PLACE = 6
|
84
|
+
|
89
85
|
def format_date(time)
|
90
|
-
time.iso8601
|
86
|
+
time.utc.iso8601(MICRO_SECONDS_DECIMAL_PLACE)
|
91
87
|
end
|
92
88
|
|
93
89
|
def stringify_keys(hash)
|
@@ -102,18 +98,6 @@ module Grn2Drn
|
|
102
98
|
stringify_keys(command.arguments)
|
103
99
|
end
|
104
100
|
|
105
|
-
def create_table_create_command(command)
|
106
|
-
create_message("table_create", command_to_body(command))
|
107
|
-
end
|
108
|
-
|
109
|
-
def create_table_remove_command(command)
|
110
|
-
create_message("table_remove", command_to_body(command))
|
111
|
-
end
|
112
|
-
|
113
|
-
def create_column_create_command(command)
|
114
|
-
create_message("column_create", command_to_body(command))
|
115
|
-
end
|
116
|
-
|
117
101
|
def create_add_command(command, columns, record)
|
118
102
|
table = command[:table]
|
119
103
|
body = {
|
@@ -139,9 +123,5 @@ module Grn2Drn
|
|
139
123
|
|
140
124
|
create_message("add", body)
|
141
125
|
end
|
142
|
-
|
143
|
-
def create_select_command(command)
|
144
|
-
create_message("select", command_to_body(command))
|
145
|
-
end
|
146
126
|
end
|
147
127
|
end
|
data/lib/grn2drn/version.rb
CHANGED
metadata
CHANGED
@@ -1,111 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grn2drn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Droonga Project
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '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
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: groonga-command-parser
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: test-unit
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: packnga
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: kramdown
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
description: ''
|
@@ -137,12 +137,12 @@ require_paths:
|
|
137
137
|
- lib
|
138
138
|
required_ruby_version: !ruby/object:Gem::Requirement
|
139
139
|
requirements:
|
140
|
-
- -
|
140
|
+
- - ">="
|
141
141
|
- !ruby/object:Gem::Version
|
142
142
|
version: '0'
|
143
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
144
144
|
requirements:
|
145
|
-
- -
|
145
|
+
- - ">="
|
146
146
|
- !ruby/object:Gem::Version
|
147
147
|
version: '0'
|
148
148
|
requirements: []
|
@@ -152,3 +152,4 @@ signing_key:
|
|
152
152
|
specification_version: 4
|
153
153
|
summary: Grn2drn is a command to convert a *.grn dump file to a JSONs file for Droonga.
|
154
154
|
test_files: []
|
155
|
+
has_rdoc:
|