salesforce_bulk_query 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a35d7475e79ba07b3fa4670c7883efc70a1be3b0
4
- data.tar.gz: f2234bbc4b5689aa3e9953092cacc89dc6a1c0fa
3
+ metadata.gz: 14c6c47c7354675aa3a523f74c53b3634bae49df
4
+ data.tar.gz: 42711066f4c36b616544355475554aceb097915f
5
5
  SHA512:
6
- metadata.gz: 41e48bada843cc5c2b1a8bb4a9335bc767a6b36258005d745540673361be303790dbc6fe6a14dacbb90554c6d6069f0539f307b55ea471997c323f1512cc6591
7
- data.tar.gz: 39bef5c6e5b77745a14490faa7c860c550bce86026bf3f7b7420b6b41ad1a3c7100c496cd6efea5ad9c30d011543b6b0471b9e08ef33253783049fb1228cc64b
6
+ metadata.gz: 02663ff473cd34a7c19331c7e60ffe987e2e9acc55389c61d79da638565b018ba8fce3166eaafb27d717e0a9205c5310d39b773e51bc970c6f82fdbb6c005ae7
7
+ data.tar.gz: 4c5d030b769934c744550d3dcf59d6fc3d6b0a6d88570e39366662f129601c20569f17bee8e63d9af1be794c5c833444e42859005902d44c0b2cb3ce70ecbd86
@@ -1,3 +1,3 @@
1
1
  module SalesforceBulkQuery
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
@@ -86,8 +86,9 @@ module SalesforceBulkQuery
86
86
 
87
87
  # nice list of files to log
88
88
  if @logger && ! results[:filenames].empty?
89
- @logger.info "Download finished. Downloaded files in #{File.dirname(results[:filenames][0])}. Filename size:"
90
- @logger.info "\n" + results[:filenames].sort.map{|f| "#{File.basename(f)} #{File.size(f)}"}.join("\n")
89
+
90
+ @logger.info "Download finished. Downloaded files in #{File.dirname(results[:filenames][0])}. Filename size [line count]:"
91
+ @logger.info "\n" + results[:filenames].sort.map{|f| "#{File.basename(f)} #{File.size(f)} #{line_count(f) if options[:count_lines]}"}.join("\n")
91
92
  end
92
93
  return results
93
94
  end
@@ -103,6 +104,14 @@ module SalesforceBulkQuery
103
104
  end
104
105
 
105
106
  private
107
+
108
+ # record count if they want to
109
+ def line_count(f)
110
+ i = 0
111
+ CSV.foreach(f, :headers => true) {|_| i+=1}
112
+ i
113
+ end
114
+
106
115
  # create a hash with just the fields we want to show in logs
107
116
  def results_to_string(results)
108
117
  return results.merge({
@@ -117,4 +126,4 @@ module SalesforceBulkQuery
117
126
  })
118
127
  end
119
128
  end
120
- end
129
+ end
@@ -74,7 +74,8 @@ describe SalesforceBulkQuery do
74
74
  :directory_path => tmp,
75
75
  :created_from => from,
76
76
  :created_to => to,
77
- :single_batch => true
77
+ :single_batch => true,
78
+ :count_lines => true
78
79
  )
79
80
 
80
81
  result[:filenames].should have(1).items
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salesforce_bulk_query
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Petr Cvengros