export_manager 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bef60f8d969610cbcdecd4080a8e7f523a72f12236fda5cf4c888a988e4c4865
4
- data.tar.gz: 6d6952cac70b8b184a71ff96fc6d4bc2ecc18d3e5be46246f77a561096c45d8b
3
+ metadata.gz: 58ce4d82284296f0a5eb94bcfe2292be7fc954e23ecce55198692fd353f95bc0
4
+ data.tar.gz: 1994b72616f21d174a801f88d3ea3c8d9e0f3ce6fa1b4028a5c342f1761017fc
5
5
  SHA512:
6
- metadata.gz: 52a52b61970df870b054494cdfa748b12ee8361821b16ef874272aea2a26744066361ca9c997a194cf89a820dec9c115044d1f07f1714a43a6b48452930a8c3a
7
- data.tar.gz: ed6f1ac833eb002539bd2c9b8b1c890ae79b1a4ee151c7af18c397523767dce15aec51d0a5a726e65128f2ef0028e24fa67fd6ac57b3527c8efa771679f2e7c2
6
+ metadata.gz: 412b576a42d26daf338ee8a82bccb42188f958be822fd34e1cf4262b8e1733ae4eaa173813b837d2fee67a8888b3d29f96b6057e8fabd15ccb2954cfca1d9190
7
+ data.tar.gz: 2c50436235c21854f58ee5dc324d28f0a0f189d96cdc3dd2875d7176cb261d249c6dd69397cd4147fe2919843ad2ced2e1aa49c6551234e51820d92b8f135b3f
data/README.md CHANGED
@@ -7,6 +7,8 @@ The ExportManager allows users to export data from dynamic tables with dynamic c
7
7
  ## Quick Start
8
8
  ```ruby
9
9
  1) gem "export_manager"
10
+ gem "caxlsx"
11
+ gem "caxlsx_rails"
10
12
  2) Add on config/routes.rb -> mount ExportManager::Engine, at: '/'
11
13
  3) Add manifest.js
12
14
  //= link export_manager/application.css
@@ -26,6 +28,8 @@ Add this line to your application's Gemfile:
26
28
 
27
29
  ```ruby
28
30
  gem "export_manager"
31
+ gem "caxlsx"
32
+ gem "caxlsx_rails"
29
33
  ```
30
34
 
31
35
  And then execute:
@@ -56,5 +60,11 @@ JSON_FILE_NAME = "JSON_EXPORT_#{Date.today}.json"
56
60
  XML_FILE_NAME = "XML_EXPORT_#{Date.today}.xml"
57
61
  ```
58
62
 
63
+ If an authenticated user has the admin? method returning true, they can access the ExportManager engine at /.
64
+ ```ruby
65
+ authenticated :user, ->(user) { user.admin? } do
66
+ mount ExportManager::Engine, at: '/'
67
+ end
68
+ ```
59
69
  ## License
60
70
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -66,9 +66,6 @@ module ExportManager
66
66
  excel_data = ExportManager.generate_json(records, columns)
67
67
  send_json(excel_data, file_name)
68
68
  when "xml"
69
- puts "records======#{records.first}"
70
- puts "columns======#{columns}"
71
-
72
69
  xml_data = ExportManager.generate_xml(records, columns)
73
70
  send_xml(xml_data, file_name)
74
71
  end
@@ -1,3 +1,3 @@
1
1
  module ExportManager
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -1,5 +1,6 @@
1
1
  require "export_manager/version"
2
2
  require "export_manager/engine"
3
+ require "csv"
3
4
 
4
5
  module ExportManager
5
6
  def self.generate_csv(records, columns)
@@ -13,7 +14,7 @@ module ExportManager
13
14
 
14
15
  def self.generate_excel(records, columns)
15
16
  wb = Axlsx::Package.new
16
- wb.workbook.add_worksheet(name: "Users Report") do |sheet|
17
+ wb.workbook.add_worksheet(name: "Report") do |sheet|
17
18
  sheet.add_row columns
18
19
 
19
20
  records.each do |record|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: export_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vishal Mahto