td-client 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,4 +1,12 @@
1
1
 
2
+ == 2011-11-11 version 0.8.4
3
+
4
+ * Added Model#client
5
+ * Added Database#query
6
+ * Added Table#import
7
+ * Increased http.read_timeout on Client#import
8
+
9
+
2
10
  == 2011-10-03 version 0.8.3
3
11
 
4
12
  * Added Client#tail method
data/lib/td/client/api.rb CHANGED
@@ -487,6 +487,8 @@ class API
487
487
  def put(url, stream, size)
488
488
  http, header = new_http
489
489
 
490
+ http.read_timeout = 600
491
+
490
492
  path = BASE_URL + url
491
493
 
492
494
  header['Content-Type'] = 'application/octet-stream'
@@ -519,8 +521,6 @@ class API
519
521
  http.cert_store = store
520
522
  end
521
523
 
522
- #http.read_timeout = options[:read_timeout]
523
-
524
524
  header = {}
525
525
  if @apikey
526
526
  header['Authorization'] = "TD1 #{apikey}"
@@ -6,6 +6,8 @@ class Model
6
6
  def initialize(client)
7
7
  @client = client
8
8
  end
9
+
10
+ attr_reader :client
9
11
  end
10
12
 
11
13
  class Database < Model
@@ -40,6 +42,10 @@ class Database < Model
40
42
  @client.delete_database(@db_name)
41
43
  end
42
44
 
45
+ def query(q)
46
+ @client.query(@db_name, q)
47
+ end
48
+
43
49
  def update_tables!
44
50
  @tables = @client.tables(@db_name)
45
51
  end
@@ -75,6 +81,10 @@ class Table < Model
75
81
  def tail(count, to=nil, from=nil)
76
82
  @client.tail(@db_name, @table_name, count, to, from)
77
83
  end
84
+
85
+ def import(format, stream, size)
86
+ @api.import(@db_name, @table_name, format, stream, size)
87
+ end
78
88
  end
79
89
 
80
90
  class Schema
@@ -1,5 +1,5 @@
1
1
  module TreasureData
2
2
 
3
- VERSION = '0.8.3'
3
+ VERSION = '0.8.4'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,65 +1,46 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: td-client
3
- version: !ruby/object:Gem::Version
4
- hash: 57
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 8
9
- - 3
10
- version: 0.8.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.4
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Sadayuki Furuhashi
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-10-03 00:00:00 +09:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2011-11-10 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: msgpack
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70306417282560 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
18
+ requirements:
27
19
  - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 7
30
- segments:
31
- - 0
32
- - 4
33
- - 4
20
+ - !ruby/object:Gem::Version
34
21
  version: 0.4.4
35
22
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: json
39
23
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70306417282560
25
+ - !ruby/object:Gem::Dependency
26
+ name: json
27
+ requirement: &70306417281540 !ruby/object:Gem::Requirement
41
28
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 1
46
- segments:
47
- - 1
48
- - 4
49
- - 3
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
50
32
  version: 1.4.3
51
33
  type: :runtime
52
- version_requirements: *id002
34
+ prerelease: false
35
+ version_requirements: *70306417281540
53
36
  description:
54
37
  email:
55
38
  executables: []
56
-
57
39
  extensions: []
58
-
59
- extra_rdoc_files:
40
+ extra_rdoc_files:
60
41
  - ChangeLog
61
42
  - README.rdoc
62
- files:
43
+ files:
63
44
  - lib/td-client.rb
64
45
  - lib/td/client.rb
65
46
  - lib/td/client/api.rb
@@ -67,39 +48,28 @@ files:
67
48
  - lib/td/client/version.rb
68
49
  - ChangeLog
69
50
  - README.rdoc
70
- has_rdoc: true
71
51
  homepage:
72
52
  licenses: []
73
-
74
53
  post_install_message:
75
- rdoc_options:
76
- - --charset=UTF-8
77
- require_paths:
54
+ rdoc_options: []
55
+ require_paths:
78
56
  - lib
79
- required_ruby_version: !ruby/object:Gem::Requirement
57
+ required_ruby_version: !ruby/object:Gem::Requirement
80
58
  none: false
81
- requirements:
82
- - - ">="
83
- - !ruby/object:Gem::Version
84
- hash: 3
85
- segments:
86
- - 0
87
- version: "0"
88
- required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
64
  none: false
90
- requirements:
91
- - - ">="
92
- - !ruby/object:Gem::Version
93
- hash: 3
94
- segments:
95
- - 0
96
- version: "0"
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
97
69
  requirements: []
98
-
99
70
  rubyforge_project:
100
- rubygems_version: 1.3.7
71
+ rubygems_version: 1.8.10
101
72
  signing_key:
102
73
  specification_version: 3
103
74
  summary: Treasure Data API library for Ruby
104
75
  test_files: []
105
-