quandl 0.2.25 → 0.2.26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWM4ZGVjODcyNzQ5NjdiN2I1NDY5NTU5OTU3MDIxZjhlZmNmM2Y4Yw==
4
+ YTM2NzRlMjZiMjllYmI3ZTJiNjhkY2E4Y2MzMzU3NDU2MjYxNmI5Ng==
5
5
  data.tar.gz: !binary |-
6
- YWRhMjgyNWIwODUxMzk1NTQ3ZGVhYWFmNGIxNzRiYTNiZDcyNjI2YQ==
6
+ MjI3Y2NlYTU1MGQwYzUzMTAwMGIxNGUyZGI2ODQ2Y2Y5MWI1YzM1ZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MGI2ZWIxOWQ0OTcwNmFjNmQxM2ViYWZhM2JmMzA2YWQ5NTgxNmQ1M2FlNWQ4
10
- YjEwNDJlMjM4OGZlNzEyYzdmMWVlODkwODI1YTJlY2QwZDViNTA2MDVmN2Uz
11
- NTRhMjI5Yjc4N2FhODg5MGIzYjU5YzQ5MTljNDFjMDFkMTRmMTA=
9
+ YjA2YzZhNTk3MmU1MWRlYTdkYjQ5MTFmNmUwOTg1MmE0MDU5NDgwM2U5ZTI5
10
+ ZDY5ODAyZTM1YTM5ZDAwYjk3Y2JhZGI3YzEwNDJmYTY3N2I4MjUwNTY0MDdk
11
+ ZDJiOGQ4NjQ2NDRiMDkxY2QwNTRlN2M2MjY3ODIxNjdjNjhjYzk=
12
12
  data.tar.gz: !binary |-
13
- YjRiNjJkZDE5ZGE0ZjBlMGYzZWM4ZTdhMGQ1NzY0NGM3ODhjMDlkY2Y0MTY1
14
- MDAyNGRjOGFkMzkzZTRkZjYzZTFmYWRiYzJkM2E2Yjc2OWU1MDk2OGVjMWE2
15
- OWI0MGU1OTNjMzYzZThmMmJiYzZlYTFhOWM0OWM2NWY4YmNiZTI=
13
+ OWU1MjMzMzlhNmMyOTQ5YjI1YWI3Y2Y1NGFiNmE5OGU5N2ZjYTdmYzA1YzY2
14
+ YzBkM2NiYmY0OTUzYzljZTEwNGJlZGMyNWU4MDU0MzY2MGZhYjI2M2I0M2Ew
15
+ ZWEzYzYzZTk2NjMwMmY1ODkwZWU0NzBkNDQ1OGEwMzY0MTU3MTY=
data/Rakefile CHANGED
@@ -46,14 +46,6 @@ def file_contains_matching(file_path, matching)
46
46
  end
47
47
 
48
48
  namespace :quandl do
49
- desc "build and push gem & distros"
50
- task :release do |t,args|
51
- checkout_master!
52
- # tag git revision with version, build quandl.gem, push to rubygems
53
- Rake::Task["release"].execute
54
- # build windows exe, mac pkg, tarball
55
- Rake::Task["toolbelt:release:all"].execute
56
- end
57
49
  desc "bump version and generate UPGRADE documentation"
58
50
  task :bump, :version do |t,args|
59
51
  version = args['version']
@@ -63,6 +55,14 @@ namespace :quandl do
63
55
  Rake::Task["quandl:generate:documentation"].execute args.to_hash.stringify_keys!
64
56
  Rake::Task["quandl:version:bump"].execute args.to_hash.stringify_keys!
65
57
  end
58
+ desc "build and push gem & distros"
59
+ task :release do |t,args|
60
+ checkout_master!
61
+ # tag git revision with version, build quandl.gem, push to rubygems
62
+ Rake::Task["release"].execute
63
+ # build windows exe, mac pkg, tarball
64
+ Rake::Task["toolbelt:release:all"].execute
65
+ end
66
66
  namespace :version do
67
67
  task :bump, :version do |t,args|
68
68
  version_file = 'lib/quandl/command/version.rb'
data/UPGRADE.md CHANGED
@@ -1,6 +1,14 @@
1
- ## 0.2.25
1
+ ## 0.2.26
2
+
3
+ * QUGC-90 fix quandl login barfs on linux
4
+ * QUGC-96 fix toolbelt failing to run due to missing config
5
+ * QUGC-95 rename ruby package identifier to avoid clobbering other ruby packages
6
+
2
7
 
3
8
 
9
+ ## 0.2.25
10
+
11
+ * info outputs install path when given verbose
4
12
 
5
13
 
6
14
 
@@ -1,6 +1,10 @@
1
1
  quandl:
2
2
  command:
3
3
  tasks:
4
+ delete:
5
+ options:
6
+ threads: "How many workers to use during delete."
7
+
4
8
  download:
5
9
  options:
6
10
  order: "Return rows in either ASC or DESC order"
@@ -1,3 +1,3 @@
1
- <pkg-info format-version="2" identifier="org.ruby-lang.installer" version="1.9.3-p448" install-location="/usr/local/quandl/ruby" auth="root">
1
+ <pkg-info format-version="2" identifier="org.quandl.ruby-lang.installer" version="1.9.3-p448" install-location="/usr/local/quandl/ruby" auth="root">
2
2
  <payload installKBytes="78196" numberOfFiles="16186"/>
3
3
  </pkg-info>
@@ -12,18 +12,12 @@ class QConfig
12
12
  @configuration ||= self.new( config_file: config_file )
13
13
  end
14
14
 
15
- def convert_legacy_config
16
- return if File.directory?(root_path)
17
- # otherwise move the old .quandl into .quandl/config
18
- FileUtils.mv(root_path, "#{root_path}.old")
19
- FileUtils.mkdir(root_path)
20
- token = File.read("#{root_path}.old")
21
- File.write(config_file, "token: #{token}")
22
- end
23
-
24
15
  def config_file
16
+ return @config_file if defined?(@config_file)
17
+ @config_file = File.join(root_path, 'config')
25
18
  convert_legacy_config
26
- @config_file ||= File.join(root_path, 'config')
19
+ ensure_directory_is_present
20
+ @config_file
27
21
  end
28
22
 
29
23
  def root_path
@@ -32,6 +26,21 @@ class QConfig
32
26
 
33
27
  protected
34
28
 
29
+ def ensure_directory_is_present
30
+ return if File.exists?(config_file)
31
+ FileUtils.mkdir(root_path) unless Dir.exists?(root_path)
32
+ File.write( config_file, YAML.dump({}) )
33
+ end
34
+
35
+ def convert_legacy_config
36
+ return if File.directory?(root_path) || !File.exists?(root_path)
37
+ # otherwise move the old .quandl into .quandl/config
38
+ FileUtils.mv(root_path, "#{root_path}.old")
39
+ FileUtils.mkdir(root_path)
40
+ token = File.read("#{root_path}.old")
41
+ File.write(config_file, "token: #{token}")
42
+ end
43
+
35
44
  def define_attributes(*attr_names)
36
45
  attr_names.each do |attr_name|
37
46
  define_attribute(attr_name)
@@ -1,4 +1,8 @@
1
1
  require 'active_model'
2
+ require 'quandl/pattern'
3
+ require 'quandl/pattern/client'
4
+ require 'quandl/operation'
5
+ require 'quandl/operation'
2
6
 
3
7
  module Quandl
4
8
  module Command
@@ -74,7 +78,7 @@ class Base
74
78
  def t(key)
75
79
  key = key.to_s
76
80
  translation = lang
77
- key.split('.').each{|m| translation = translation.send(m) }
81
+ key.split('.').each{|m| translation = translation.respond_to?(m) ? translation.send(m) : nil }
78
82
  translation
79
83
  end
80
84
 
@@ -1,11 +1,31 @@
1
1
  class Quandl::Command::Tasks::Delete < Quandl::Command::Tasks::Base
2
+
2
3
  autoload_client_library
4
+ authenticated_users_only!
3
5
 
4
- syntax "quandl #{command_name} (SOURCE_CODE/)CODE"
5
6
  description "Delete a dataset by its quandl code."
6
-
7
- authenticated_users_only!
7
+ syntax %Q{quandl delete (SOURCE_CODE/)CODE
8
+
9
+ Examples:
10
+
11
+ $ quandl delete TEST
12
+ Are you sure? (y/n)
13
+
14
+ $ quandl delete TEST TEST2 TEST3 --force-yes
15
+ Deleted | 164ms | TEST
16
+ Deleted | 134ms | TEST2
17
+ Deleted | 124ms | TEST3
18
+
19
+ $ quandl list --match TEST | quandl delete --force-yes
8
20
 
21
+ $ cat ids.txt | quandl delete --force-yes}
22
+
23
+ options({
24
+ Integer => {
25
+ threads: t('options.threads'),
26
+ }
27
+ })
28
+
9
29
  def execute
10
30
  # download using arguments when present
11
31
  return delete_each_argument if args.first.present?
@@ -14,20 +34,32 @@ class Quandl::Command::Tasks::Delete < Quandl::Command::Tasks::Base
14
34
  end
15
35
 
16
36
  def delete_each_argument
17
- args.each do |code|
18
- pool.process{ delete( code ) }
19
- end
37
+ # delete each arg
38
+ args.each{|code| delete_with_pool(code) }
39
+ # wait for all deletes to finish
20
40
  pool.shutdown
21
41
  end
22
42
 
23
43
  def delete_each_stdin
24
44
  return error("Cannot delete datasets from STDIN unless --force-yes is set!") unless force_yes?
25
- $stdin.each_line do |code|
26
- pool.process{ delete( code.strip.rstrip ) }
27
- end
45
+ # treat each line from stdin as a code
46
+ $stdin.each_line{|code| delete_with_pool(code) }
47
+ # wait for deletes to finish
28
48
  pool.shutdown
29
49
  end
30
50
 
51
+ def delete_with_pool(code)
52
+ # sanitize
53
+ code = code.to_s.strip.rstrip
54
+ # if --force-yes send the deletes async
55
+ if force_yes?
56
+ pool.process{ delete( code ) }
57
+ # otherwise send each delete sync and wait for confirmation
58
+ else
59
+ delete( code )
60
+ end
61
+ end
62
+
31
63
  def delete(code)
32
64
  return error("You must provide a code!") if code.blank?
33
65
  # find by code
@@ -1,8 +1,3 @@
1
- require 'quandl/pattern'
2
- require 'quandl/pattern/client'
3
- require 'quandl/operation'
4
- require 'quandl/operation'
5
-
6
1
  class Quandl::Command::Tasks::Download < Quandl::Command::Tasks::Base
7
2
  autoload_client_library
8
3
 
@@ -1,5 +1,5 @@
1
1
  module Quandl
2
2
  module Command
3
- VERSION = '0.2.25'
3
+ VERSION = '0.2.26'
4
4
  end
5
5
  end
@@ -34,6 +34,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
34
34
  Source: "..\..\build\tarball\installer\rubyinstaller.exe"; DestDir: "{tmp}";
35
35
  Source: "..\..\build\tarball\quandl-command\bin\*.*"; DestDir: "{app}\bin"; Flags: recursesubdirs;
36
36
  Source: "..\..\build\tarball\quandl-command\lib\*.*"; DestDir: "{app}\lib"; Flags: recursesubdirs;
37
+ Source: "..\..\build\tarball\quandl-command\config\*.*"; DestDir: "{app}\config"; Flags: recursesubdirs;
37
38
  Source: "..\..\build\tarball\quandl-command\vendor\*.*"; DestDir: "{app}\vendor"; Flags: recursesubdirs;
38
39
  Source: "..\..\build\tarball\quandl\quandl.bat"; DestDir: "{app}\bin"; Flags: recursesubdirs;
39
40
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quandl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.25
4
+ version: 0.2.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Hilscher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-24 00:00:00.000000000 Z
11
+ date: 2014-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander