embulk-input-google_spreadsheets 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.travis.yml +12 -0
  4. data/CHANGELOG.md +67 -0
  5. data/Gemfile +3 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +94 -0
  8. data/Rakefile +13 -0
  9. data/embulk-input-google_spreadsheets.gemspec +24 -0
  10. data/example/config_authorized_user.yml +19 -0
  11. data/example/config_authorized_user.yml.liquid +25 -0
  12. data/example/config_authorized_user_emoji_worksheet.yml +19 -0
  13. data/example/config_authorized_user_empty_rows_appears_at_the_same_as_max_fetch_rows.yml +20 -0
  14. data/example/config_authorized_user_large_data.yml +19 -0
  15. data/example/config_authorized_user_no_data.yml +18 -0
  16. data/example/config_service_account.yml +19 -0
  17. data/example/config_service_account_emoji_worksheet.yml +19 -0
  18. data/example/config_service_account_empty_rows_appears_at_the_same_as_max_fetch_rows.yml +20 -0
  19. data/example/config_service_account_large_data.yml +19 -0
  20. data/example/config_service_account_no_data.yml +18 -0
  21. data/example/setup_authorized_user_credentials.rb +34 -0
  22. data/lib/embulk/input/google_spreadsheets.rb +182 -0
  23. data/lib/embulk/input/google_spreadsheets/auth.rb +63 -0
  24. data/lib/embulk/input/google_spreadsheets/error.rb +36 -0
  25. data/lib/embulk/input/google_spreadsheets/pager.rb +107 -0
  26. data/lib/embulk/input/google_spreadsheets/pager_util.rb +28 -0
  27. data/lib/embulk/input/google_spreadsheets/record_typecaster.rb +73 -0
  28. data/lib/embulk/input/google_spreadsheets/spreadsheets_client.rb +75 -0
  29. data/lib/embulk/input/google_spreadsheets/spreadsheets_url_util.rb +23 -0
  30. data/lib/embulk/input/google_spreadsheets/typecast/base.rb +62 -0
  31. data/lib/embulk/input/google_spreadsheets/typecast/loose_typecast.rb +84 -0
  32. data/lib/embulk/input/google_spreadsheets/typecast/minimal_typecast.rb +109 -0
  33. data/lib/embulk/input/google_spreadsheets/typecast/strict_typecast.rb +236 -0
  34. data/lib/embulk/input/google_spreadsheets/typecast/timestamp_format_util.rb +29 -0
  35. data/lib/embulk/input/google_spreadsheets/typecast_factory.rb +34 -0
  36. data/test/assert_embulk_nothing_raised.rb +11 -0
  37. data/test/assert_embulk_raise.rb +11 -0
  38. data/test/dummy.key +27 -0
  39. data/test/helper.rb +21 -0
  40. data/test/test_auth.rb +82 -0
  41. data/test/test_configure.rb +155 -0
  42. data/test/test_loose_typecast.rb +194 -0
  43. data/test/test_minimal_typecast.rb +616 -0
  44. data/test/test_pager_util.rb +24 -0
  45. data/test/test_run_examples.rb +125 -0
  46. data/test/test_spreadsheets_client.rb +87 -0
  47. data/test/test_spreadsheets_url_util.rb +23 -0
  48. data/test/test_strict_typecast.rb +666 -0
  49. data/test/test_typecast_factory.rb +36 -0
  50. metadata +220 -0
@@ -0,0 +1,36 @@
1
+ require_relative 'helper'
2
+ require 'embulk/input/google_spreadsheets/typecast_factory'
3
+ require 'embulk/input/google_spreadsheets/typecast/strict_typecast'
4
+ require 'embulk/input/google_spreadsheets/typecast/loose_typecast'
5
+ require 'embulk/input/google_spreadsheets/typecast/minimal_typecast'
6
+ require_relative 'assert_embulk_raise'
7
+
8
+ module Embulk
9
+ class Input::GoogleSpreadsheets < InputPlugin
10
+ class TestTypecastFactory < Test::Unit::TestCase
11
+
12
+ include AssertEmbulkRaise
13
+
14
+ sub_test_case 'TypecastFactory.create' do
15
+ test 'correct' do
16
+ assert_kind_of(Typecast::StrictTypecast, TypecastFactory.create('strict', {}))
17
+ assert_kind_of(Typecast::LooseTypecast, TypecastFactory.create('loose', {}))
18
+ assert_kind_of(Typecast::MinimalTypecast, TypecastFactory.create('minimal', {}))
19
+ end
20
+
21
+ test 'incorrect' do
22
+ assert_embulk_raise ConfigError do
23
+ TypecastFactory.create(nil, nil)
24
+ end
25
+ assert_embulk_raise ConfigError do
26
+ TypecastFactory.create({}, {})
27
+ end
28
+ assert_embulk_raise ConfigError do
29
+ TypecastFactory.create('hoge', nil)
30
+ end
31
+ end
32
+ end
33
+
34
+ end
35
+ end
36
+ end
metadata ADDED
@@ -0,0 +1,220 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: embulk-input-google_spreadsheets
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Civitaspo
8
+ - yang-xu
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2017-03-29 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.8.1
20
+ name: embulk
21
+ prerelease: false
22
+ type: :development
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: 0.8.1
28
+ - !ruby/object:Gem::Dependency
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ name: bundler
35
+ prerelease: false
36
+ type: :development
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ name: rake
49
+ prerelease: false
50
+ type: :development
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ name: highline
63
+ prerelease: false
64
+ type: :development
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ name: test-unit
77
+ prerelease: false
78
+ type: :development
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ name: test-unit-rr
91
+ prerelease: false
92
+ type: :development
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ - !ruby/object:Gem::Dependency
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: 0.9.15
104
+ name: google-api-client
105
+ prerelease: false
106
+ type: :runtime
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: 0.9.15
112
+ - !ruby/object:Gem::Dependency
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ name: time_with_zone
119
+ prerelease: false
120
+ type: :runtime
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ description: Load records from Google Spreadsheets.
127
+ email:
128
+ - civitaspo@gmail.com
129
+ - xu.yang.9.65@gmail.com
130
+ executables: []
131
+ extensions: []
132
+ extra_rdoc_files: []
133
+ files:
134
+ - ".gitignore"
135
+ - ".travis.yml"
136
+ - CHANGELOG.md
137
+ - Gemfile
138
+ - LICENSE.txt
139
+ - README.md
140
+ - Rakefile
141
+ - embulk-input-google_spreadsheets.gemspec
142
+ - example/config_authorized_user.yml
143
+ - example/config_authorized_user.yml.liquid
144
+ - example/config_authorized_user_emoji_worksheet.yml
145
+ - example/config_authorized_user_empty_rows_appears_at_the_same_as_max_fetch_rows.yml
146
+ - example/config_authorized_user_large_data.yml
147
+ - example/config_authorized_user_no_data.yml
148
+ - example/config_service_account.yml
149
+ - example/config_service_account_emoji_worksheet.yml
150
+ - example/config_service_account_empty_rows_appears_at_the_same_as_max_fetch_rows.yml
151
+ - example/config_service_account_large_data.yml
152
+ - example/config_service_account_no_data.yml
153
+ - example/setup_authorized_user_credentials.rb
154
+ - lib/embulk/input/google_spreadsheets.rb
155
+ - lib/embulk/input/google_spreadsheets/auth.rb
156
+ - lib/embulk/input/google_spreadsheets/error.rb
157
+ - lib/embulk/input/google_spreadsheets/pager.rb
158
+ - lib/embulk/input/google_spreadsheets/pager_util.rb
159
+ - lib/embulk/input/google_spreadsheets/record_typecaster.rb
160
+ - lib/embulk/input/google_spreadsheets/spreadsheets_client.rb
161
+ - lib/embulk/input/google_spreadsheets/spreadsheets_url_util.rb
162
+ - lib/embulk/input/google_spreadsheets/typecast/base.rb
163
+ - lib/embulk/input/google_spreadsheets/typecast/loose_typecast.rb
164
+ - lib/embulk/input/google_spreadsheets/typecast/minimal_typecast.rb
165
+ - lib/embulk/input/google_spreadsheets/typecast/strict_typecast.rb
166
+ - lib/embulk/input/google_spreadsheets/typecast/timestamp_format_util.rb
167
+ - lib/embulk/input/google_spreadsheets/typecast_factory.rb
168
+ - test/assert_embulk_nothing_raised.rb
169
+ - test/assert_embulk_raise.rb
170
+ - test/dummy.key
171
+ - test/helper.rb
172
+ - test/test_auth.rb
173
+ - test/test_configure.rb
174
+ - test/test_loose_typecast.rb
175
+ - test/test_minimal_typecast.rb
176
+ - test/test_pager_util.rb
177
+ - test/test_run_examples.rb
178
+ - test/test_spreadsheets_client.rb
179
+ - test/test_spreadsheets_url_util.rb
180
+ - test/test_strict_typecast.rb
181
+ - test/test_typecast_factory.rb
182
+ homepage: https://github.com/medjed/embulk-input-google_spreadsheets
183
+ licenses:
184
+ - MIT
185
+ metadata: {}
186
+ post_install_message:
187
+ rdoc_options: []
188
+ require_paths:
189
+ - lib
190
+ required_ruby_version: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ required_rubygems_version: !ruby/object:Gem::Requirement
196
+ requirements:
197
+ - - ">="
198
+ - !ruby/object:Gem::Version
199
+ version: '0'
200
+ requirements: []
201
+ rubyforge_project:
202
+ rubygems_version: 2.6.8
203
+ signing_key:
204
+ specification_version: 4
205
+ summary: Google Spreadsheets input plugin for Embulk
206
+ test_files:
207
+ - test/assert_embulk_nothing_raised.rb
208
+ - test/assert_embulk_raise.rb
209
+ - test/dummy.key
210
+ - test/helper.rb
211
+ - test/test_auth.rb
212
+ - test/test_configure.rb
213
+ - test/test_loose_typecast.rb
214
+ - test/test_minimal_typecast.rb
215
+ - test/test_pager_util.rb
216
+ - test/test_run_examples.rb
217
+ - test/test_spreadsheets_client.rb
218
+ - test/test_spreadsheets_url_util.rb
219
+ - test/test_strict_typecast.rb
220
+ - test/test_typecast_factory.rb