quandl 0.2.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +16 -0
  3. data/.travis.yml +20 -0
  4. data/Gemfile +14 -0
  5. data/Guardfile +8 -0
  6. data/LICENSE +7 -0
  7. data/README.md +316 -0
  8. data/Rakefile +39 -0
  9. data/UPGRADE.md +143 -0
  10. data/bin/quandl +26 -0
  11. data/dist/resources/pkg/Distribution.erb +15 -0
  12. data/dist/resources/pkg/PackageInfo.erb +6 -0
  13. data/dist/resources/pkg/postinstall +45 -0
  14. data/dist/resources/pkg/quandl +25 -0
  15. data/dist/resources/ruby/PackageInfo +3 -0
  16. data/lib/commander/command/quandl_ext.rb +21 -0
  17. data/lib/quandl/command.rb +45 -0
  18. data/lib/quandl/command/client_ext.rb +1 -0
  19. data/lib/quandl/command/client_ext/user.rb +11 -0
  20. data/lib/quandl/command/compatibility_check.rb +11 -0
  21. data/lib/quandl/command/qconfig.rb +76 -0
  22. data/lib/quandl/command/tasks.rb +15 -0
  23. data/lib/quandl/command/tasks/base.rb +263 -0
  24. data/lib/quandl/command/tasks/delete.rb +58 -0
  25. data/lib/quandl/command/tasks/download.rb +111 -0
  26. data/lib/quandl/command/tasks/info.rb +46 -0
  27. data/lib/quandl/command/tasks/list.rb +40 -0
  28. data/lib/quandl/command/tasks/login.rb +46 -0
  29. data/lib/quandl/command/tasks/update.rb +205 -0
  30. data/lib/quandl/command/tasks/upload.rb +69 -0
  31. data/lib/quandl/command/version.rb +5 -0
  32. data/lib/quandl/utility.rb +2 -0
  33. data/lib/quandl/utility/config.rb +43 -0
  34. data/lib/quandl/utility/ruby_version.rb +143 -0
  35. data/quandl.gemspec +39 -0
  36. data/scripts/compile_ruby_pkg.sh +34 -0
  37. data/scripts/install.sh +51 -0
  38. data/scripts/win/quandl_toolbelt.iss +82 -0
  39. data/spec/lib/quandl/command/delete_spec.rb +31 -0
  40. data/spec/lib/quandl/command/download_spec.rb +42 -0
  41. data/spec/lib/quandl/command/upload_spec.rb +39 -0
  42. data/spec/lib/quandl/command_spec.rb +46 -0
  43. data/spec/spec_helper.rb +20 -0
  44. data/tasks/toolbelt.rake +133 -0
  45. data/tasks/toolbelt.rb +92 -0
  46. data/tasks/toolbelt/build.rb +2 -0
  47. data/tasks/toolbelt/build/darwin.rb +71 -0
  48. data/tasks/toolbelt/build/ruby.rb +105 -0
  49. data/tasks/toolbelt/build/tarball.rb +73 -0
  50. data/tasks/toolbelt/build/windows.rb +25 -0
  51. data/tasks/toolbelt/push.rb +15 -0
  52. data/tasks/toolbelt/storage.rb +28 -0
  53. data/tasks/toolbelt/tar.rb +21 -0
  54. metadata +354 -0
@@ -0,0 +1,73 @@
1
+ class Tasks::Toolbelt::Build::Tarball < Tasks::Toolbelt
2
+
3
+ around_ensure :cleanup
4
+
5
+ def call
6
+ # checkout requested revision
7
+ checkout_revision
8
+ # clean directories
9
+ clean
10
+ # copy files into release
11
+ copy_files_into_release
12
+ # add revision when given
13
+ append_revision_to_release_version if options.revision.present?
14
+ # vendorize the bundle
15
+ copy_vendored_gems
16
+ # build tar
17
+ package_release_into_tar
18
+ end
19
+
20
+ protected
21
+
22
+ def checkout_revision
23
+ raise "You have unstaged commits." if %x{git status} =~ /Changes not staged for commit/
24
+ sh "git checkout #{revision}"
25
+ raise "Unable to checkout #{revision}" unless %x{git branch | grep '*'} =~ /#{revision}/
26
+ end
27
+
28
+
29
+ def copy_files_into_release
30
+ # for each path
31
+ ['lib', 'bin'].each do |path|
32
+ # recursively copy into release
33
+ cp_r File.join( root_path, path ), File.join( release_path, path )
34
+ end
35
+ end
36
+
37
+ def clean
38
+ rm_rf tarball_path
39
+ # create release
40
+ mkdir_p release_path
41
+ end
42
+
43
+ def append_revision_to_release_version
44
+ version_file = File.join( release_path, 'lib/quandl/command/version.rb')
45
+ IO.write(version_file, File.open(version_file) do |f|
46
+ f.read.gsub(version, "#{version}-#{revision}")
47
+ end
48
+ )
49
+ end
50
+
51
+ def copy_vendored_gems
52
+ Bundler.with_clean_env do
53
+ sh( "bundle install --without development test --path #{release_path}/vendor" )
54
+ mv File.join(release_path, "vendor/ruby/1.9.1/gems"), File.join(release_path, "vendor")
55
+ rm_rf File.join(release_path, "vendor/ruby")
56
+ end
57
+ end
58
+
59
+ def package_release_into_tar
60
+ # path to tarball
61
+ tarball_filename = File.basename([ release_path, revision, 'tar.gz' ].compact.join("."))
62
+ # enter tarball build directory
63
+ Dir.chdir(tarball_path) do
64
+ # create targz
65
+ Tar.pack( 'quandl-command', File.join(tarball_path, tarball_filename) )
66
+ end
67
+ end
68
+
69
+ def cleanup
70
+ rm_rf File.join( root_path, '.bundle')
71
+ end
72
+
73
+ end
@@ -0,0 +1,25 @@
1
+ class Tasks::Toolbelt::Build::Windows < Tasks::Toolbelt
2
+
3
+ around_ensure :cleanup
4
+
5
+ def call
6
+ input_file = File.join( tarball_path, 'win_setup.tar.gz')
7
+ # download file from s3
8
+ File.open(input_file, "wb") do |saved_file|
9
+ open('http://s3.amazonaws.com/quandl-command/win_setup/win_setup.tar.gz','rb') {|read_file|
10
+ saved_file.write(read_file.read)
11
+ }
12
+ end
13
+ # unpack win_setup
14
+ Tar.unpack( File.join( tarball_path, "win_setup.tar.gz" ), tarball_path )
15
+ #build win exe
16
+ sh "cd \"#{File.join(root_path, 'scripts','win')}\" && \"#{inno_path}\\iscc\" /cc \"quandl_toolbelt.iss\""
17
+ end
18
+
19
+ protected
20
+
21
+ def cleanup
22
+ rm_rf File.join( root_path, '.bundle')
23
+ end
24
+
25
+ end
@@ -0,0 +1,15 @@
1
+ class Tasks::Toolbelt::Push < Tasks::Toolbelt
2
+
3
+ def call
4
+ Storage.create( output_file, File.open(input_file) )
5
+ end
6
+
7
+ def input_file
8
+ @input_file ||= [ release_path, revision, 'tar.gz' ].compact.join(".")
9
+ end
10
+
11
+ def output_file
12
+ @output_file ||= File.basename([ release_path, options.platform, options.revision, 'tar.gz' ].compact.join("."))
13
+ end
14
+
15
+ end
@@ -0,0 +1,28 @@
1
+ require 'fog'
2
+
3
+ class Tasks::Toolbelt::Storage
4
+ class << self
5
+
6
+ PROVIDER = 'AWS'
7
+ BUCKET = "quandl-command"
8
+
9
+ def create(file_name, file_contents)
10
+ puts "Storage.create #{BUCKET}/#{file_name}"
11
+ directory.files.create( key: file_name, body: file_contents, public: true )
12
+ end
13
+
14
+ def directory
15
+ @directory ||= connection.directories.get(BUCKET)
16
+ end
17
+
18
+ def connection
19
+ # create a connection
20
+ @connection ||= Fog::Storage.new({
21
+ :provider => PROVIDER,
22
+ :aws_access_key_id => ENV['AWS_ACCESS_KEY_ID'],
23
+ :aws_secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']
24
+ })
25
+ end
26
+
27
+ end
28
+ end
@@ -0,0 +1,21 @@
1
+ require 'fog'
2
+ require 'archive/tar/minitar'
3
+
4
+ class Tasks::Toolbelt::Tar
5
+
6
+ class << self
7
+
8
+ def pack( input_path, output_file )
9
+ puts("Toolbelt::Tar.pack( '#{input_path}', '#{output_file} )")
10
+ tarball = File.new( output_file, 'wb' )
11
+ Archive::Tar::Minitar.pack( input_path, Zlib::GzipWriter.new( tarball ) )
12
+ end
13
+
14
+ def unpack( input_tarball, output_path )
15
+ puts("Toolbelt::Tar.unpack( '#{input_tarball}', '#{output_path} )")
16
+ Archive::Tar::Minitar.unpack( Zlib::GzipReader.open( input_tarball ), output_path )
17
+ end
18
+
19
+ end
20
+
21
+ end
metadata ADDED
@@ -0,0 +1,354 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: quandl
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.22
5
+ platform: ruby
6
+ authors:
7
+ - Blake Hilscher
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: commander
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 4.1.5
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 4.1.5
27
+ - !ruby/object:Gem::Dependency
28
+ name: quandl_format
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 0.2.8
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.8
41
+ - !ruby/object:Gem::Dependency
42
+ name: quandl_client
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 2.5.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 2.5.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: quandl_data
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 1.3.9
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: 1.3.9
69
+ - !ruby/object:Gem::Dependency
70
+ name: quandl_operation
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '='
74
+ - !ruby/object:Gem::Version
75
+ version: 0.3.2
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '='
81
+ - !ruby/object:Gem::Version
82
+ version: 0.3.2
83
+ - !ruby/object:Gem::Dependency
84
+ name: quandl_babelfish
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '='
88
+ - !ruby/object:Gem::Version
89
+ version: 0.0.9
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '='
95
+ - !ruby/object:Gem::Version
96
+ version: 0.0.9
97
+ - !ruby/object:Gem::Dependency
98
+ name: quandl_logger
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '='
102
+ - !ruby/object:Gem::Version
103
+ version: 0.2.5
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '='
109
+ - !ruby/object:Gem::Version
110
+ version: 0.2.5
111
+ - !ruby/object:Gem::Dependency
112
+ name: json
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '='
116
+ - !ruby/object:Gem::Version
117
+ version: 1.7.7
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '='
123
+ - !ruby/object:Gem::Version
124
+ version: 1.7.7
125
+ - !ruby/object:Gem::Dependency
126
+ name: minitar
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '='
130
+ - !ruby/object:Gem::Version
131
+ version: 0.5.4
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '='
137
+ - !ruby/object:Gem::Version
138
+ version: 0.5.4
139
+ - !ruby/object:Gem::Dependency
140
+ name: thread
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '='
144
+ - !ruby/object:Gem::Version
145
+ version: 0.1.3
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '='
151
+ - !ruby/object:Gem::Version
152
+ version: 0.1.3
153
+ - !ruby/object:Gem::Dependency
154
+ name: rake
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ~>
158
+ - !ruby/object:Gem::Version
159
+ version: '10.1'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ~>
165
+ - !ruby/object:Gem::Version
166
+ version: '10.1'
167
+ - !ruby/object:Gem::Dependency
168
+ name: fog
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ~>
172
+ - !ruby/object:Gem::Version
173
+ version: '1.19'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ~>
179
+ - !ruby/object:Gem::Version
180
+ version: '1.19'
181
+ - !ruby/object:Gem::Dependency
182
+ name: factory_girl
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ~>
186
+ - !ruby/object:Gem::Version
187
+ version: '4.3'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ~>
193
+ - !ruby/object:Gem::Version
194
+ version: '4.3'
195
+ - !ruby/object:Gem::Dependency
196
+ name: rspec
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ~>
200
+ - !ruby/object:Gem::Version
201
+ version: '2.13'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ~>
207
+ - !ruby/object:Gem::Version
208
+ version: '2.13'
209
+ - !ruby/object:Gem::Dependency
210
+ name: fivemat
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ~>
214
+ - !ruby/object:Gem::Version
215
+ version: '1.2'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ~>
221
+ - !ruby/object:Gem::Version
222
+ version: '1.2'
223
+ - !ruby/object:Gem::Dependency
224
+ name: pry
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - ~>
228
+ - !ruby/object:Gem::Version
229
+ version: '0.9'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - ~>
235
+ - !ruby/object:Gem::Version
236
+ version: '0.9'
237
+ - !ruby/object:Gem::Dependency
238
+ name: guard
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - ~>
242
+ - !ruby/object:Gem::Version
243
+ version: '2.3'
244
+ type: :development
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - ~>
249
+ - !ruby/object:Gem::Version
250
+ version: '2.3'
251
+ - !ruby/object:Gem::Dependency
252
+ name: guard-rspec
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ~>
256
+ - !ruby/object:Gem::Version
257
+ version: '4.2'
258
+ type: :development
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ~>
263
+ - !ruby/object:Gem::Version
264
+ version: '4.2'
265
+ description: http://quandl.com/help/toolbelt
266
+ email:
267
+ - blake@hilscher.ca
268
+ executables:
269
+ - quandl
270
+ extensions: []
271
+ extra_rdoc_files: []
272
+ files:
273
+ - .gitignore
274
+ - .travis.yml
275
+ - Gemfile
276
+ - Guardfile
277
+ - LICENSE
278
+ - README.md
279
+ - Rakefile
280
+ - UPGRADE.md
281
+ - bin/quandl
282
+ - dist/resources/pkg/Distribution.erb
283
+ - dist/resources/pkg/PackageInfo.erb
284
+ - dist/resources/pkg/postinstall
285
+ - dist/resources/pkg/quandl
286
+ - dist/resources/ruby/PackageInfo
287
+ - lib/commander/command/quandl_ext.rb
288
+ - lib/quandl/command.rb
289
+ - lib/quandl/command/client_ext.rb
290
+ - lib/quandl/command/client_ext/user.rb
291
+ - lib/quandl/command/compatibility_check.rb
292
+ - lib/quandl/command/qconfig.rb
293
+ - lib/quandl/command/tasks.rb
294
+ - lib/quandl/command/tasks/base.rb
295
+ - lib/quandl/command/tasks/delete.rb
296
+ - lib/quandl/command/tasks/download.rb
297
+ - lib/quandl/command/tasks/info.rb
298
+ - lib/quandl/command/tasks/list.rb
299
+ - lib/quandl/command/tasks/login.rb
300
+ - lib/quandl/command/tasks/update.rb
301
+ - lib/quandl/command/tasks/upload.rb
302
+ - lib/quandl/command/version.rb
303
+ - lib/quandl/utility.rb
304
+ - lib/quandl/utility/config.rb
305
+ - lib/quandl/utility/ruby_version.rb
306
+ - quandl.gemspec
307
+ - scripts/compile_ruby_pkg.sh
308
+ - scripts/install.sh
309
+ - scripts/win/quandl_toolbelt.iss
310
+ - spec/lib/quandl/command/delete_spec.rb
311
+ - spec/lib/quandl/command/download_spec.rb
312
+ - spec/lib/quandl/command/upload_spec.rb
313
+ - spec/lib/quandl/command_spec.rb
314
+ - spec/spec_helper.rb
315
+ - tasks/toolbelt.rake
316
+ - tasks/toolbelt.rb
317
+ - tasks/toolbelt/build.rb
318
+ - tasks/toolbelt/build/darwin.rb
319
+ - tasks/toolbelt/build/ruby.rb
320
+ - tasks/toolbelt/build/tarball.rb
321
+ - tasks/toolbelt/build/windows.rb
322
+ - tasks/toolbelt/push.rb
323
+ - tasks/toolbelt/storage.rb
324
+ - tasks/toolbelt/tar.rb
325
+ homepage: http://blake.hilscher.ca/
326
+ licenses:
327
+ - MIT
328
+ metadata: {}
329
+ post_install_message:
330
+ rdoc_options: []
331
+ require_paths:
332
+ - lib
333
+ required_ruby_version: !ruby/object:Gem::Requirement
334
+ requirements:
335
+ - - ! '>='
336
+ - !ruby/object:Gem::Version
337
+ version: '0'
338
+ required_rubygems_version: !ruby/object:Gem::Requirement
339
+ requirements:
340
+ - - ! '>='
341
+ - !ruby/object:Gem::Version
342
+ version: '0'
343
+ requirements: []
344
+ rubyforge_project:
345
+ rubygems_version: 2.2.2
346
+ signing_key:
347
+ specification_version: 4
348
+ summary: Quandl Toolbelt
349
+ test_files:
350
+ - spec/lib/quandl/command/delete_spec.rb
351
+ - spec/lib/quandl/command/download_spec.rb
352
+ - spec/lib/quandl/command/upload_spec.rb
353
+ - spec/lib/quandl/command_spec.rb
354
+ - spec/spec_helper.rb