caxlsx_rails 0.6.3 → 0.7.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 +4 -4
- data/CHANGELOG.md +17 -1
- data/README.md +24 -142
- data/caxlsx_rails.gemspec +33 -0
- data/lib/axlsx_rails/action_controller.rb +14 -19
- data/lib/axlsx_rails/railtie.rb +3 -2
- data/lib/axlsx_rails/template_handler.rb +18 -29
- data/lib/axlsx_rails/version.rb +1 -1
- data/lib/axlsx_rails.rb +1 -1
- metadata +12 -825
- data/Gemfile +0 -53
- data/Gemfile.lock +0 -263
- data/Gemfile.lock.5.2 +0 -263
- data/Gemfile.lock.6.0 +0 -282
- data/Guardfile +0 -16
- data/Rakefile +0 -29
- data/lib/tasks/axlsx_rails_tasks.rake +0 -4
- data/spec/axlsx_builder_spec.rb +0 -48
- data/spec/axlsx_mailer_spec.rb +0 -15
- data/spec/axlsx_renderer_spec.rb +0 -16
- data/spec/axlsx_request_spec.rb +0 -202
- data/spec/ci.rb +0 -15
- data/spec/dummy/Rakefile +0 -7
- data/spec/dummy/app/assets/javascripts/application.js +0 -15
- data/spec/dummy/app/assets/stylesheets/application.css +0 -13
- data/spec/dummy/app/controllers/application_controller.rb +0 -3
- data/spec/dummy/app/controllers/home_controller.rb +0 -54
- data/spec/dummy/app/controllers/likes_controller.rb +0 -18
- data/spec/dummy/app/controllers/users_controller.rb +0 -27
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/app/mailers/notifier.rb +0 -14
- data/spec/dummy/app/models/like.rb +0 -3
- data/spec/dummy/app/models/user.rb +0 -10
- data/spec/dummy/app/views/home/_cover_sheet.xlsx.axlsx +0 -3
- data/spec/dummy/app/views/home/index.html.erb +0 -4
- data/spec/dummy/app/views/home/index.xlsx.axlsx +0 -8
- data/spec/dummy/app/views/home/useheader.xlsx.axlsx +0 -8
- data/spec/dummy/app/views/home/withpartial.xlsx.axlsx +0 -9
- data/spec/dummy/app/views/layouts/application.html.erb +0 -12
- data/spec/dummy/app/views/likes/index.html.erb +0 -17
- data/spec/dummy/app/views/likes/index.xlsx.axlsx +0 -7
- data/spec/dummy/app/views/notifier/instructions.html.erb +0 -14
- data/spec/dummy/app/views/users/index.html.erb +0 -23
- data/spec/dummy/app/views/users/index.xlsx.axlsx +0 -1
- data/spec/dummy/app/views/users/respond_with.xlsx.axlsx +0 -8
- data/spec/dummy/app/views/users/send_instructions.xlsx.axlsx +0 -5
- data/spec/dummy/config/application.rb +0 -70
- data/spec/dummy/config/boot.rb +0 -10
- data/spec/dummy/config/database.yml +0 -11
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -39
- data/spec/dummy/config/environments/production.rb +0 -69
- data/spec/dummy/config/environments/test.rb +0 -40
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/inflections.rb +0 -15
- data/spec/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy/config/initializers/secret_token.rb +0 -8
- data/spec/dummy/config/initializers/session_store.rb +0 -8
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy/config/locales/en.yml +0 -5
- data/spec/dummy/config/routes.rb +0 -14
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/db/migrate/20120717192452_create_users.rb +0 -12
- data/spec/dummy/db/migrate/20121206210955_create_likes.rb +0 -10
- data/spec/dummy/db/schema.rb +0 -32
- data/spec/dummy/public/404.html +0 -26
- data/spec/dummy/public/422.html +0 -26
- data/spec/dummy/public/500.html +0 -25
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +0 -6
- data/spec/dummy_4/Rakefile +0 -6
- data/spec/dummy_4/app/assets/javascripts/application.js +0 -13
- data/spec/dummy_4/app/assets/stylesheets/application.css +0 -15
- data/spec/dummy_4/app/controllers/application_controller.rb +0 -5
- data/spec/dummy_4/app/controllers/home_controller.rb +0 -56
- data/spec/dummy_4/app/controllers/likes_controller.rb +0 -18
- data/spec/dummy_4/app/controllers/users_controller.rb +0 -27
- data/spec/dummy_4/app/helpers/application_helper.rb +0 -2
- data/spec/dummy_4/app/mailers/notifier.rb +0 -14
- data/spec/dummy_4/app/models/like.rb +0 -3
- data/spec/dummy_4/app/models/user.rb +0 -10
- data/spec/dummy_4/app/views/home/_cover_sheet.xlsx.axlsx +0 -3
- data/spec/dummy_4/app/views/home/index.html.erb +0 -4
- data/spec/dummy_4/app/views/home/index.xlsx.axlsx +0 -8
- data/spec/dummy_4/app/views/home/only_html.html.erb +0 -1
- data/spec/dummy_4/app/views/home/useheader.xlsx.axlsx +0 -8
- data/spec/dummy_4/app/views/home/withpartial.xlsx.axlsx +0 -9
- data/spec/dummy_4/app/views/layouts/application.html.erb +0 -12
- data/spec/dummy_4/app/views/layouts/users.html.erb +0 -12
- data/spec/dummy_4/app/views/likes/index.html.erb +0 -17
- data/spec/dummy_4/app/views/likes/index.xlsx.axlsx +0 -7
- data/spec/dummy_4/app/views/notifier/instructions.html.erb +0 -14
- data/spec/dummy_4/app/views/notifier/instructions.txt.erb +0 -6
- data/spec/dummy_4/app/views/users/export.xlsx.axlsx +0 -8
- data/spec/dummy_4/app/views/users/index.html.erb +0 -23
- data/spec/dummy_4/app/views/users/index.xlsx.axlsx +0 -1
- data/spec/dummy_4/app/views/users/noaction.xlsx.axlsx +0 -1
- data/spec/dummy_4/app/views/users/respond_with.xlsx.axlsx +0 -8
- data/spec/dummy_4/app/views/users/send_instructions.xlsx.axlsx +0 -5
- data/spec/dummy_4/bin/bundle +0 -3
- data/spec/dummy_4/bin/rails +0 -4
- data/spec/dummy_4/bin/rake +0 -4
- data/spec/dummy_4/config/application.rb +0 -23
- data/spec/dummy_4/config/boot.rb +0 -5
- data/spec/dummy_4/config/database.yml +0 -25
- data/spec/dummy_4/config/environment.rb +0 -5
- data/spec/dummy_4/config/environments/development.rb +0 -37
- data/spec/dummy_4/config/environments/production.rb +0 -83
- data/spec/dummy_4/config/environments/test.rb +0 -40
- data/spec/dummy_4/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy_4/config/initializers/cookies_serializer.rb +0 -3
- data/spec/dummy_4/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy_4/config/initializers/inflections.rb +0 -16
- data/spec/dummy_4/config/initializers/mime_types.rb +0 -4
- data/spec/dummy_4/config/initializers/secret_token.rb +0 -2
- data/spec/dummy_4/config/initializers/session_store.rb +0 -3
- data/spec/dummy_4/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy_4/config/locales/en.yml +0 -23
- data/spec/dummy_4/config/routes.rb +0 -17
- data/spec/dummy_4/config/secrets.yml +0 -22
- data/spec/dummy_4/config.ru +0 -4
- data/spec/dummy_4/db/migrate/20120717192452_create_users.rb +0 -12
- data/spec/dummy_4/db/migrate/20121206210955_create_likes.rb +0 -10
- data/spec/dummy_4/db/schema.rb +0 -32
- data/spec/dummy_4/public/404.html +0 -67
- data/spec/dummy_4/public/422.html +0 -67
- data/spec/dummy_4/public/500.html +0 -66
- data/spec/dummy_4/public/favicon.ico +0 -0
- data/spec/dummy_5.0/Rakefile +0 -6
- data/spec/dummy_5.0/app/assets/javascripts/application.js +0 -13
- data/spec/dummy_5.0/app/assets/stylesheets/application.css +0 -15
- data/spec/dummy_5.0/app/controllers/application_controller.rb +0 -5
- data/spec/dummy_5.0/app/controllers/home_controller.rb +0 -56
- data/spec/dummy_5.0/app/controllers/likes_controller.rb +0 -18
- data/spec/dummy_5.0/app/controllers/users_controller.rb +0 -37
- data/spec/dummy_5.0/app/helpers/application_helper.rb +0 -2
- data/spec/dummy_5.0/app/mailers/notifier.rb +0 -14
- data/spec/dummy_5.0/app/models/like.rb +0 -3
- data/spec/dummy_5.0/app/models/user.rb +0 -10
- data/spec/dummy_5.0/app/views/home/_cover_sheet.xlsx.axlsx +0 -3
- data/spec/dummy_5.0/app/views/home/index.html.erb +0 -4
- data/spec/dummy_5.0/app/views/home/index.xlsx.axlsx +0 -8
- data/spec/dummy_5.0/app/views/home/only_html.html.erb +0 -1
- data/spec/dummy_5.0/app/views/home/useheader.xlsx.axlsx +0 -8
- data/spec/dummy_5.0/app/views/home/withpartial.xlsx.axlsx +0 -9
- data/spec/dummy_5.0/app/views/layouts/application.html.erb +0 -12
- data/spec/dummy_5.0/app/views/layouts/users.html.erb +0 -12
- data/spec/dummy_5.0/app/views/likes/index.html.erb +0 -17
- data/spec/dummy_5.0/app/views/likes/index.xlsx.axlsx +0 -7
- data/spec/dummy_5.0/app/views/notifier/instructions.html.erb +0 -14
- data/spec/dummy_5.0/app/views/notifier/instructions.txt.erb +0 -6
- data/spec/dummy_5.0/app/views/users/export.xlsx.axlsx +0 -8
- data/spec/dummy_5.0/app/views/users/index.html.erb +0 -23
- data/spec/dummy_5.0/app/views/users/index.xlsx.axlsx +0 -1
- data/spec/dummy_5.0/app/views/users/noaction.xlsx.axlsx +0 -1
- data/spec/dummy_5.0/app/views/users/respond_with.xlsx.axlsx +0 -8
- data/spec/dummy_5.0/app/views/users/send_instructions.xlsx.axlsx +0 -5
- data/spec/dummy_5.0/bin/bundle +0 -3
- data/spec/dummy_5.0/bin/rails +0 -4
- data/spec/dummy_5.0/bin/rake +0 -4
- data/spec/dummy_5.0/config/application.rb +0 -23
- data/spec/dummy_5.0/config/boot.rb +0 -5
- data/spec/dummy_5.0/config/database.yml +0 -25
- data/spec/dummy_5.0/config/environment.rb +0 -5
- data/spec/dummy_5.0/config/environments/development.rb +0 -37
- data/spec/dummy_5.0/config/environments/production.rb +0 -83
- data/spec/dummy_5.0/config/environments/test.rb +0 -40
- data/spec/dummy_5.0/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy_5.0/config/initializers/cookies_serializer.rb +0 -3
- data/spec/dummy_5.0/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy_5.0/config/initializers/inflections.rb +0 -16
- data/spec/dummy_5.0/config/initializers/mime_types.rb +0 -4
- data/spec/dummy_5.0/config/initializers/secret_token.rb +0 -2
- data/spec/dummy_5.0/config/initializers/session_store.rb +0 -3
- data/spec/dummy_5.0/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy_5.0/config/locales/en.yml +0 -23
- data/spec/dummy_5.0/config/routes.rb +0 -17
- data/spec/dummy_5.0/config/secrets.yml +0 -22
- data/spec/dummy_5.0/config.ru +0 -4
- data/spec/dummy_5.0/db/migrate/20120717192452_create_users.rb +0 -12
- data/spec/dummy_5.0/db/migrate/20121206210955_create_likes.rb +0 -10
- data/spec/dummy_5.0/db/schema.rb +0 -31
- data/spec/dummy_5.0/public/404.html +0 -67
- data/spec/dummy_5.0/public/422.html +0 -67
- data/spec/dummy_5.0/public/500.html +0 -66
- data/spec/dummy_5.0/public/favicon.ico +0 -0
- data/spec/dummy_5.1/Rakefile +0 -6
- data/spec/dummy_5.1/app/assets/javascripts/application.js +0 -13
- data/spec/dummy_5.1/app/assets/stylesheets/application.css +0 -15
- data/spec/dummy_5.1/app/controllers/application_controller.rb +0 -5
- data/spec/dummy_5.1/app/controllers/home_controller.rb +0 -56
- data/spec/dummy_5.1/app/controllers/likes_controller.rb +0 -18
- data/spec/dummy_5.1/app/controllers/users_controller.rb +0 -37
- data/spec/dummy_5.1/app/helpers/application_helper.rb +0 -2
- data/spec/dummy_5.1/app/mailers/notifier.rb +0 -14
- data/spec/dummy_5.1/app/models/like.rb +0 -3
- data/spec/dummy_5.1/app/models/user.rb +0 -10
- data/spec/dummy_5.1/app/views/home/_cover_sheet.xlsx.axlsx +0 -3
- data/spec/dummy_5.1/app/views/home/index.html.erb +0 -4
- data/spec/dummy_5.1/app/views/home/index.xlsx.axlsx +0 -8
- data/spec/dummy_5.1/app/views/home/only_html.html.erb +0 -1
- data/spec/dummy_5.1/app/views/home/useheader.xlsx.axlsx +0 -8
- data/spec/dummy_5.1/app/views/home/withpartial.xlsx.axlsx +0 -9
- data/spec/dummy_5.1/app/views/layouts/application.html.erb +0 -12
- data/spec/dummy_5.1/app/views/layouts/users.html.erb +0 -12
- data/spec/dummy_5.1/app/views/likes/index.html.erb +0 -17
- data/spec/dummy_5.1/app/views/likes/index.xlsx.axlsx +0 -7
- data/spec/dummy_5.1/app/views/notifier/instructions.html.erb +0 -14
- data/spec/dummy_5.1/app/views/notifier/instructions.txt.erb +0 -6
- data/spec/dummy_5.1/app/views/users/export.xlsx.axlsx +0 -8
- data/spec/dummy_5.1/app/views/users/index.html.erb +0 -23
- data/spec/dummy_5.1/app/views/users/index.xlsx.axlsx +0 -1
- data/spec/dummy_5.1/app/views/users/noaction.xlsx.axlsx +0 -1
- data/spec/dummy_5.1/app/views/users/respond_with.xlsx.axlsx +0 -8
- data/spec/dummy_5.1/app/views/users/send_instructions.xlsx.axlsx +0 -5
- data/spec/dummy_5.1/bin/bundle +0 -3
- data/spec/dummy_5.1/bin/rails +0 -4
- data/spec/dummy_5.1/bin/rake +0 -4
- data/spec/dummy_5.1/config/application.rb +0 -23
- data/spec/dummy_5.1/config/boot.rb +0 -5
- data/spec/dummy_5.1/config/database.yml +0 -25
- data/spec/dummy_5.1/config/environment.rb +0 -5
- data/spec/dummy_5.1/config/environments/development.rb +0 -37
- data/spec/dummy_5.1/config/environments/production.rb +0 -83
- data/spec/dummy_5.1/config/environments/test.rb +0 -40
- data/spec/dummy_5.1/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy_5.1/config/initializers/cookies_serializer.rb +0 -3
- data/spec/dummy_5.1/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy_5.1/config/initializers/inflections.rb +0 -16
- data/spec/dummy_5.1/config/initializers/mime_types.rb +0 -4
- data/spec/dummy_5.1/config/initializers/secret_token.rb +0 -2
- data/spec/dummy_5.1/config/initializers/session_store.rb +0 -3
- data/spec/dummy_5.1/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy_5.1/config/locales/en.yml +0 -23
- data/spec/dummy_5.1/config/routes.rb +0 -17
- data/spec/dummy_5.1/config/secrets.yml +0 -22
- data/spec/dummy_5.1/config.ru +0 -4
- data/spec/dummy_5.1/db/migrate/20120717192452_create_users.rb +0 -12
- data/spec/dummy_5.1/db/migrate/20121206210955_create_likes.rb +0 -10
- data/spec/dummy_5.1/db/schema.rb +0 -31
- data/spec/dummy_5.1/public/404.html +0 -67
- data/spec/dummy_5.1/public/422.html +0 -67
- data/spec/dummy_5.1/public/500.html +0 -66
- data/spec/dummy_5.1/public/favicon.ico +0 -0
- data/spec/dummy_5.2/Rakefile +0 -6
- data/spec/dummy_5.2/app/assets/javascripts/application.js +0 -13
- data/spec/dummy_5.2/app/assets/stylesheets/application.css +0 -15
- data/spec/dummy_5.2/app/controllers/application_controller.rb +0 -5
- data/spec/dummy_5.2/app/controllers/home_controller.rb +0 -56
- data/spec/dummy_5.2/app/controllers/likes_controller.rb +0 -18
- data/spec/dummy_5.2/app/controllers/users_controller.rb +0 -37
- data/spec/dummy_5.2/app/helpers/application_helper.rb +0 -2
- data/spec/dummy_5.2/app/mailers/notifier.rb +0 -14
- data/spec/dummy_5.2/app/models/like.rb +0 -3
- data/spec/dummy_5.2/app/models/user.rb +0 -10
- data/spec/dummy_5.2/app/views/home/_cover_sheet.xlsx.axlsx +0 -3
- data/spec/dummy_5.2/app/views/home/index.html.erb +0 -4
- data/spec/dummy_5.2/app/views/home/index.xlsx.axlsx +0 -8
- data/spec/dummy_5.2/app/views/home/only_html.html.erb +0 -1
- data/spec/dummy_5.2/app/views/home/useheader.xlsx.axlsx +0 -8
- data/spec/dummy_5.2/app/views/home/withpartial.xlsx.axlsx +0 -9
- data/spec/dummy_5.2/app/views/layouts/application.html.erb +0 -12
- data/spec/dummy_5.2/app/views/layouts/users.html.erb +0 -12
- data/spec/dummy_5.2/app/views/likes/index.html.erb +0 -17
- data/spec/dummy_5.2/app/views/likes/index.xlsx.axlsx +0 -7
- data/spec/dummy_5.2/app/views/notifier/instructions.html.erb +0 -14
- data/spec/dummy_5.2/app/views/notifier/instructions.txt.erb +0 -6
- data/spec/dummy_5.2/app/views/users/export.xlsx.axlsx +0 -8
- data/spec/dummy_5.2/app/views/users/index.html.erb +0 -23
- data/spec/dummy_5.2/app/views/users/index.xlsx.axlsx +0 -1
- data/spec/dummy_5.2/app/views/users/noaction.xlsx.axlsx +0 -1
- data/spec/dummy_5.2/app/views/users/respond_with.xlsx.axlsx +0 -8
- data/spec/dummy_5.2/app/views/users/send_instructions.xlsx.axlsx +0 -5
- data/spec/dummy_5.2/bin/bundle +0 -3
- data/spec/dummy_5.2/bin/rails +0 -4
- data/spec/dummy_5.2/bin/rake +0 -4
- data/spec/dummy_5.2/config/application.rb +0 -23
- data/spec/dummy_5.2/config/boot.rb +0 -5
- data/spec/dummy_5.2/config/database.yml +0 -25
- data/spec/dummy_5.2/config/environment.rb +0 -5
- data/spec/dummy_5.2/config/environments/development.rb +0 -37
- data/spec/dummy_5.2/config/environments/production.rb +0 -83
- data/spec/dummy_5.2/config/environments/test.rb +0 -40
- data/spec/dummy_5.2/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy_5.2/config/initializers/cookies_serializer.rb +0 -3
- data/spec/dummy_5.2/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy_5.2/config/initializers/inflections.rb +0 -16
- data/spec/dummy_5.2/config/initializers/mime_types.rb +0 -4
- data/spec/dummy_5.2/config/initializers/secret_token.rb +0 -2
- data/spec/dummy_5.2/config/initializers/session_store.rb +0 -3
- data/spec/dummy_5.2/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy_5.2/config/locales/en.yml +0 -23
- data/spec/dummy_5.2/config/routes.rb +0 -17
- data/spec/dummy_5.2/config/secrets.yml +0 -22
- data/spec/dummy_5.2/config.ru +0 -4
- data/spec/dummy_5.2/db/migrate/20120717192452_create_users.rb +0 -12
- data/spec/dummy_5.2/db/migrate/20121206210955_create_likes.rb +0 -10
- data/spec/dummy_5.2/db/schema.rb +0 -31
- data/spec/dummy_5.2/db/test.sqlite3 +0 -0
- data/spec/dummy_5.2/log/test.log +0 -1032
- data/spec/dummy_5.2/public/404.html +0 -67
- data/spec/dummy_5.2/public/422.html +0 -67
- data/spec/dummy_5.2/public/500.html +0 -66
- data/spec/dummy_5.2/public/favicon.ico +0 -0
- data/spec/dummy_6.0/Rakefile +0 -6
- data/spec/dummy_6.0/app/assets/javascripts/application.js +0 -13
- data/spec/dummy_6.0/app/assets/stylesheets/application.css +0 -15
- data/spec/dummy_6.0/app/controllers/application_controller.rb +0 -5
- data/spec/dummy_6.0/app/controllers/home_controller.rb +0 -56
- data/spec/dummy_6.0/app/controllers/likes_controller.rb +0 -18
- data/spec/dummy_6.0/app/controllers/users_controller.rb +0 -37
- data/spec/dummy_6.0/app/helpers/application_helper.rb +0 -2
- data/spec/dummy_6.0/app/mailers/notifier.rb +0 -14
- data/spec/dummy_6.0/app/models/like.rb +0 -3
- data/spec/dummy_6.0/app/models/user.rb +0 -10
- data/spec/dummy_6.0/app/views/home/_cover_sheet.xlsx.axlsx +0 -3
- data/spec/dummy_6.0/app/views/home/index.html.erb +0 -4
- data/spec/dummy_6.0/app/views/home/index.xlsx.axlsx +0 -8
- data/spec/dummy_6.0/app/views/home/only_html.html.erb +0 -1
- data/spec/dummy_6.0/app/views/home/useheader.xlsx.axlsx +0 -8
- data/spec/dummy_6.0/app/views/home/withpartial.xlsx.axlsx +0 -9
- data/spec/dummy_6.0/app/views/layouts/application.html.erb +0 -12
- data/spec/dummy_6.0/app/views/layouts/users.html.erb +0 -12
- data/spec/dummy_6.0/app/views/likes/index.html.erb +0 -17
- data/spec/dummy_6.0/app/views/likes/index.xlsx.axlsx +0 -7
- data/spec/dummy_6.0/app/views/notifier/instructions.html.erb +0 -14
- data/spec/dummy_6.0/app/views/notifier/instructions.txt.erb +0 -6
- data/spec/dummy_6.0/app/views/users/export.xlsx.axlsx +0 -8
- data/spec/dummy_6.0/app/views/users/index.html.erb +0 -23
- data/spec/dummy_6.0/app/views/users/index.xlsx.axlsx +0 -1
- data/spec/dummy_6.0/app/views/users/noaction.xlsx.axlsx +0 -1
- data/spec/dummy_6.0/app/views/users/respond_with.xlsx.axlsx +0 -8
- data/spec/dummy_6.0/app/views/users/send_instructions.xlsx.axlsx +0 -5
- data/spec/dummy_6.0/bin/bundle +0 -3
- data/spec/dummy_6.0/bin/rails +0 -4
- data/spec/dummy_6.0/bin/rake +0 -4
- data/spec/dummy_6.0/config/application.rb +0 -23
- data/spec/dummy_6.0/config/boot.rb +0 -5
- data/spec/dummy_6.0/config/database.yml +0 -25
- data/spec/dummy_6.0/config/environment.rb +0 -5
- data/spec/dummy_6.0/config/environments/development.rb +0 -37
- data/spec/dummy_6.0/config/environments/production.rb +0 -83
- data/spec/dummy_6.0/config/environments/test.rb +0 -40
- data/spec/dummy_6.0/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy_6.0/config/initializers/cookies_serializer.rb +0 -3
- data/spec/dummy_6.0/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy_6.0/config/initializers/inflections.rb +0 -16
- data/spec/dummy_6.0/config/initializers/mime_types.rb +0 -4
- data/spec/dummy_6.0/config/initializers/secret_token.rb +0 -2
- data/spec/dummy_6.0/config/initializers/session_store.rb +0 -3
- data/spec/dummy_6.0/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy_6.0/config/locales/en.yml +0 -23
- data/spec/dummy_6.0/config/routes.rb +0 -17
- data/spec/dummy_6.0/config/secrets.yml +0 -22
- data/spec/dummy_6.0/config.ru +0 -4
- data/spec/dummy_6.0/db/migrate/20120717192452_create_users.rb +0 -12
- data/spec/dummy_6.0/db/migrate/20121206210955_create_likes.rb +0 -10
- data/spec/dummy_6.0/db/schema.rb +0 -31
- data/spec/dummy_6.0/db/test.sqlite3 +0 -0
- data/spec/dummy_6.0/log/test.log +0 -364
- data/spec/dummy_6.0/public/404.html +0 -67
- data/spec/dummy_6.0/public/422.html +0 -67
- data/spec/dummy_6.0/public/500.html +0 -66
- data/spec/dummy_6.0/public/favicon.ico +0 -0
- data/spec/reset_gems.sh +0 -2
- data/spec/spec_helper.rb +0 -53
- data/spec/test_3.1.sh +0 -16
- data/spec/test_3.2.sh +0 -16
- data/spec/test_4.0.sh +0 -16
- data/spec/test_4.1.sh +0 -16
- data/spec/test_4.2.sh +0 -16
- data/spec/test_5.0.sh +0 -16
- data/spec/test_5.1.sh +0 -16
- data/spec/test_5.2.sh +0 -16
- data/spec/test_6.0.sh +0 -16
- data/spec/test_all_rails.sh +0 -8
- data/spec/test_revert.sh +0 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 22c74d3929476fad668147236c3023cb4f52ef9471e0479a0bdbe7ef89dcb980
|
|
4
|
+
data.tar.gz: 32c5a47c42f98e2b26f20b618eb86ecce0b50b9296eb4d227b7bd414cdd487f7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 702ccb285b30c7f2498663858e0e1b3d2368156e1f23c836683f39ecf154247db44fb9e975fb5846d81a26da9a7cc2786d0e7842c06a17d67b4c6eddb757298d
|
|
7
|
+
data.tar.gz: 6b37602c7d82d45dc41d3907904078204d6a797948b5a54556f1a7a5f6d899de76b151b1f5509c61ef06f66a6b01fd820c3048a8ffa8a639602bd3d8c61750a3
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Change log
|
|
2
2
|
|
|
3
|
+
**Unreleased**
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
**April 1, 2026**: 0.7.1 release
|
|
7
|
+
|
|
8
|
+
Note: v0.7.0 failed on the GitHub CI, skipping that version number.
|
|
9
|
+
|
|
10
|
+
- Drop support for Ruby < 2.6 and Rails < 6.1
|
|
11
|
+
- Require at least caxlsx 4.0
|
|
12
|
+
- Add Rails 8.0 and Ruby 3.4 to the CI matrix
|
|
13
|
+
|
|
14
|
+
**June 18, 2024**: 0.6.4 release
|
|
15
|
+
|
|
16
|
+
- Convert to Github actions
|
|
17
|
+
- Improve tests
|
|
18
|
+
- Fix broken templates with comments as their last line
|
|
19
|
+
|
|
3
20
|
**March 8, 2022**: 0.6.3 release
|
|
4
21
|
|
|
5
22
|
- Exclude rspec directory (#149)[https://github.com/caxlsx/caxlsx_rails/pull/149]
|
|
@@ -98,4 +115,3 @@
|
|
|
98
115
|
|
|
99
116
|
- Initial posting.
|
|
100
117
|
- It works, but there are no tests! Bad programmer!
|
|
101
|
-
|
data/README.md
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
Notice: axlsx_rails renamed to caxlsx_rails
|
|
2
2
|
===================================================
|
|
3
|
-
This gem has been renamed to match other gems in the Axlsx community organization:
|
|
3
|
+
This gem has been renamed to match other gems in the Axlsx community organization: https://github.com/caxlsx
|
|
4
4
|
|
|
5
5
|
Axlsx-Rails — Spreadsheet templates for Rails
|
|
6
6
|
===================================================
|
|
7
7
|
|
|
8
|
-
[](http://travis-ci.org/caxlsx/caxlsx_rails)
|
|
9
8
|
[](
|
|
9
|
+
Version](https://badge.fury.io/rb/caxlsx_rails.svg)](https://badge.fury.io/rb/caxlsx_rails)
|
|
11
10
|
[](https://coveralls.io/r/caxlsx/caxlsx_rails)
|
|
13
|
-
|
|
14
|
-

|
|
16
|
-

|
|
12
|
+
[](https://github.com/caxlsx/caxlsx_rails/actions)
|
|
13
|
+

|
|
17
14
|
|
|
18
15
|
## Notice: Community Axlsx Organization
|
|
19
16
|
|
|
20
|
-
To better maintain the Axlsx ecosystem, all related gems have been forked or moved to the following community organization:
|
|
17
|
+
To better maintain the Axlsx ecosystem, all related gems have been forked or moved to the following community organization:
|
|
21
18
|
|
|
22
|
-
|
|
19
|
+
https://github.com/caxlsx
|
|
23
20
|
|
|
24
21
|
[Join the Caxlsx Slack channel](https://join.slack.com/t/caxlsx/shared_invite/enQtOTI5OTM0MzI1Njk5LTBlMDQzNDk2YzkwODMxMmVkODMyYzJiZGU5NTQ3YTg5NTBlN2IwZTlmNTRjNzhiY2E0MDY2OTEyYmFlODI5NjA)
|
|
25
22
|
|
|
@@ -36,10 +33,9 @@ See [previous installations](#previous-installations) if needed.
|
|
|
36
33
|
|
|
37
34
|
## Requirements
|
|
38
35
|
|
|
39
|
-
* Tested on Rails
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* As of Rails 4.1 you must use `render_to_string` to render a mail attachment.
|
|
36
|
+
* Tested on Rails 6.1, and 7.x.
|
|
37
|
+
* Supported Ruby versions: 2.6, 2.7, 3.x
|
|
38
|
+
* Minimum Caxlsx version: 4.0
|
|
43
39
|
|
|
44
40
|
## FYI
|
|
45
41
|
|
|
@@ -249,8 +245,8 @@ RSpec.shared_context 'axlsx' do
|
|
|
249
245
|
# mimics an ActionView::Template class, presenting a 'source' method
|
|
250
246
|
# to retrieve the content of the template
|
|
251
247
|
filename = Rails.root.join(*template_path).to_s
|
|
252
|
-
|
|
253
|
-
axlsx_binding.eval(
|
|
248
|
+
template = Struct.new(:source).new(File.read(filename))
|
|
249
|
+
axlsx_binding.eval(AxlsxRails::TemplateHandler.new.call(template), filename)
|
|
254
250
|
axlsx_binding.local_variable_get(:wb)
|
|
255
251
|
end
|
|
256
252
|
end
|
|
@@ -295,7 +291,7 @@ end
|
|
|
295
291
|
|
|
296
292
|
require 'rspec/expectations'
|
|
297
293
|
|
|
298
|
-
module
|
|
294
|
+
module XlsxMatchers
|
|
299
295
|
|
|
300
296
|
RSpec::Matchers.define :have_header_cells do |cell_values|
|
|
301
297
|
match do |worksheet|
|
|
@@ -383,7 +379,7 @@ If you get these errors, please open an issue and share code so the bug can be i
|
|
|
383
379
|
|
|
384
380
|
### The unparsed template is returned, or something similar
|
|
385
381
|
|
|
386
|
-
Have you followed other tutorials for serving Excel from Rails? Have you declared the MIME type already? These may be incompatible with caxlsx_rails (which declares the MIME type for you.) Remove any vestiges of other tutorials from your code and try again.
|
|
382
|
+
Have you followed other tutorials for serving Excel from Rails? Have you declared the MIME type already? These may be incompatible with caxlsx_rails (which declares the MIME type for you.) Remove any vestiges of other tutorials from your code and try again.
|
|
387
383
|
|
|
388
384
|
### Generated Files Can't Be Opened or Invalid Byte Sequence in UTF-8
|
|
389
385
|
|
|
@@ -422,35 +418,29 @@ If you are using turbolinks, you may need to disable turbolinks when you link to
|
|
|
422
418
|
link_to 'Download spreadsheet', path_to_sheet, data: {turbolinks: false}
|
|
423
419
|
```
|
|
424
420
|
|
|
425
|
-
###
|
|
421
|
+
### Rails 7 Unknown Format
|
|
426
422
|
|
|
427
|
-
|
|
423
|
+
In Rails 7, if you get an error of "Unknown Format" you may need to add `(format: "xlsx")` to the named route.
|
|
428
424
|
|
|
429
|
-
|
|
425
|
+
A clue to the "format" that Rails is responding with is to look at your log file or console after you click the HTML link or submit your form. You should see `Processing by Controller#action as XLSX`.
|
|
430
426
|
|
|
431
|
-
|
|
427
|
+
#### Code Examples
|
|
428
|
+
|
|
429
|
+
Scenario 1 - HTML Link within index.html.erb
|
|
432
430
|
|
|
433
431
|
```ruby
|
|
434
|
-
|
|
435
|
-
gem 'axlsx', git: 'https://github.com/randym/axlsx.git', ref: 'c8ac844'
|
|
436
|
-
gem 'axlsx_rails'
|
|
432
|
+
link_to "Download as Excel", my_named_route_path(format: "xlsx")
|
|
437
433
|
```
|
|
438
434
|
|
|
439
|
-
|
|
435
|
+
Scenario 2 - Using form_with()
|
|
440
436
|
|
|
441
437
|
```ruby
|
|
442
|
-
|
|
443
|
-
gem 'axlsx', '= 2.0.1'
|
|
444
|
-
gem 'axlsx_rails'
|
|
438
|
+
form_with method: :post, url: my_named_route_path(format: :xlsx) do |f|
|
|
445
439
|
```
|
|
446
440
|
|
|
447
|
-
|
|
441
|
+
### What to do
|
|
448
442
|
|
|
449
|
-
|
|
450
|
-
gem 'rubyzip', '~> 1.1.0'
|
|
451
|
-
gem 'axlsx', '2.1.0.pre'
|
|
452
|
-
gem 'axlsx_rails'
|
|
453
|
-
```
|
|
443
|
+
If you are having problems, try to isolate the issue. Use the console or a script to make sure your data is good. Then create the spreadsheet line by line without Axlsx-Rails to see if you are having caxlsx problems. If you can manually create the spreadsheet, create an issue and we will work it out.
|
|
454
444
|
|
|
455
445
|
## Dependencies
|
|
456
446
|
|
|
@@ -476,111 +466,3 @@ Many thanks to [contributors](https://github.com/caxlsx/caxlsx_rails/graphs/cont
|
|
|
476
466
|
* [kodram](https://github.com/kodram)
|
|
477
467
|
* [JohnSmall](https://github.com/JohnSmall)
|
|
478
468
|
* [BenoitHiller](https://github.com/BenoitHiller)
|
|
479
|
-
|
|
480
|
-
## Donations
|
|
481
|
-
|
|
482
|
-
Say thanks for Axlsx-Rails by donating! It makes it easier for me to provide to open
|
|
483
|
-
source:
|
|
484
|
-
|
|
485
|
-
[](http://www.pledgie.com/campaigns/27737)
|
|
486
|
-
|
|
487
|
-
## Change log
|
|
488
|
-
|
|
489
|
-
**March 8, 2022**: 0.6.3 release
|
|
490
|
-
|
|
491
|
-
- Exclude rspec directory (#149)[https://github.com/caxlsx/caxlsx_rails/pull/149]
|
|
492
|
-
|
|
493
|
-
**December 18, 2019**: 0.6.2 release
|
|
494
|
-
|
|
495
|
-
- Release under caxlsx_rails
|
|
496
|
-
|
|
497
|
-
**December 18, 2019**: 0.6.1 release
|
|
498
|
-
|
|
499
|
-
- Deprecate axlsx_rails name, release under caxlsx_rails
|
|
500
|
-
- Switch to using caxlsx 3.0 gem
|
|
501
|
-
|
|
502
|
-
**September 5, 2019**: 0.6.0 release
|
|
503
|
-
|
|
504
|
-
- Improved Rails 6.0 compatibility re MIME type
|
|
505
|
-
|
|
506
|
-
**May 1st, 2018**: 0.5.2 release
|
|
507
|
-
|
|
508
|
-
- Improved Rails 5 compatibility re MIME type
|
|
509
|
-
|
|
510
|
-
**March 29th, 2017**: 0.5.1 release
|
|
511
|
-
|
|
512
|
-
- Fix stack trace line numbers
|
|
513
|
-
- Thanks to [BenoitHiller](https://github.com/BenoitHiller)
|
|
514
|
-
|
|
515
|
-
**July 26st, 2016**: 0.5.0 release
|
|
516
|
-
|
|
517
|
-
- Support for Rails 5
|
|
518
|
-
- **Tested on on Rails 4.0, 4.1, 4.2, and 5.0**
|
|
519
|
-
- Bug fixes for unreadable files and UTF-8 errors
|
|
520
|
-
|
|
521
|
-
**July 13th, 2015**: 0.4.0 release
|
|
522
|
-
|
|
523
|
-
- Support for Rails 4.2
|
|
524
|
-
- **Removal of forced default_formats** (url format must match)
|
|
525
|
-
- **Tested only on Rails 4.1 and 4.2**
|
|
526
|
-
- **For Rails 3.2 or below, use 0.3.0**
|
|
527
|
-
|
|
528
|
-
**November 20th, 2014**: 0.3.0 release
|
|
529
|
-
|
|
530
|
-
- Support for Rails 4.2.beta4.
|
|
531
|
-
- **Removal of shorthand template syntax** (`render xlsx: 'another/directory'`)
|
|
532
|
-
|
|
533
|
-
**September 4, 2014**: 0.2.1 release
|
|
534
|
-
|
|
535
|
-
- Rails 4.2.beta1 no longer includes responder. This release checks for the existence of responder before configuring a default responder.
|
|
536
|
-
- Rails 4.2 testing, though not yet on Travis CI
|
|
537
|
-
- Author, created_at, and use_shared_strings parameters for Axlsx::Package.new
|
|
538
|
-
|
|
539
|
-
**April 9, 2014**: 0.2.0 release
|
|
540
|
-
|
|
541
|
-
- Require Axlsx 2.0.1, which requires rubyzip 1.0.0
|
|
542
|
-
- Better render handling and testing, which might break former usage
|
|
543
|
-
- Rails 4.1 testing
|
|
544
|
-
- Mailer example update (**use render_to_string not render**)
|
|
545
|
-
|
|
546
|
-
**October 11, 2013**
|
|
547
|
-
|
|
548
|
-
- Handle (and test) respond_to override
|
|
549
|
-
|
|
550
|
-
**October 4, 2013**
|
|
551
|
-
|
|
552
|
-
- Added coveralls
|
|
553
|
-
- Raised testing to axlsx 2.0.1, roo 1.12.2, and rubyzip 1.0.0
|
|
554
|
-
|
|
555
|
-
**July 25, 2013**
|
|
556
|
-
|
|
557
|
-
- Documentation improved
|
|
558
|
-
- Testing for generating partial in mailer
|
|
559
|
-
|
|
560
|
-
**January 18, 2013**: 0.1.4 release
|
|
561
|
-
|
|
562
|
-
- Now supports Rails 4 (thanks [Envek](https://github.com/Envek))
|
|
563
|
-
- If you call render :xlsx on a request without :xlsx format, it should force the :xlsx format. Works on Rails 3.2+.
|
|
564
|
-
|
|
565
|
-
**December 6, 2012**: 0.1.3 release
|
|
566
|
-
|
|
567
|
-
- Fix for absolute template paths
|
|
568
|
-
|
|
569
|
-
**July 25, 2012**: 0.1.2 release
|
|
570
|
-
|
|
571
|
-
- Partials tested
|
|
572
|
-
|
|
573
|
-
**July 19, 2012**: 0.1.1 release
|
|
574
|
-
|
|
575
|
-
- Travis-ci added (thanks [randym](https://github.com/randym))
|
|
576
|
-
- render statements and filename tests fixes (thanks [engwan](https://github.com/engwan))
|
|
577
|
-
|
|
578
|
-
**July 17, 2012**: 0.1.0 release
|
|
579
|
-
|
|
580
|
-
- Tests completed
|
|
581
|
-
- Acts_as_xlsx tested, example in docs
|
|
582
|
-
|
|
583
|
-
**July 12, 2012**: 0.0.1 release
|
|
584
|
-
|
|
585
|
-
- Initial posting.
|
|
586
|
-
- It works, but there are no tests! Bad programmer!
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'lib/axlsx_rails/version'
|
|
4
|
+
|
|
5
|
+
# Describe your gem and declare its dependencies:
|
|
6
|
+
Gem::Specification.new do |s|
|
|
7
|
+
s.name = 'caxlsx_rails'
|
|
8
|
+
s.version = AxlsxRails::VERSION
|
|
9
|
+
s.licenses = ['MIT']
|
|
10
|
+
s.authors = ['Noel Peden']
|
|
11
|
+
s.email = ['noel@peden.biz']
|
|
12
|
+
s.homepage = 'https://github.com/caxlsx/caxlsx_rails'
|
|
13
|
+
s.summary = 'A simple rails plugin to provide an xlsx renderer using the caxlsx gem.'
|
|
14
|
+
s.description = "Caxlsx_Rails provides an Caxlsx renderer so you can move all your spreadsheet code from your controller into view files. Partials are supported so you can organize any code into reusable chunks (e.g. cover sheets, common styling, etc.) You can use it with acts_as_caxlsx, placing the to_xlsx call in a view and adding ':package => xlsx_package' to the parameter list. Now you can keep your controllers thin!"
|
|
15
|
+
|
|
16
|
+
s.metadata = {
|
|
17
|
+
"changelog_uri" => "https://github.com/caxlsx/caxlsx_rails/blob/master/CHANGELOG.md"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
s.files = Dir['lib/**/*', 'CHANGELOG.md', 'README.md', 'MIT-LICENSE', 'caxlsx_rails.gemspec']
|
|
21
|
+
|
|
22
|
+
s.add_dependency 'actionpack', '>= 6.1'
|
|
23
|
+
s.add_dependency 'caxlsx', '>= 4.0'
|
|
24
|
+
|
|
25
|
+
s.add_development_dependency 'bundler'
|
|
26
|
+
s.add_development_dependency 'rake'
|
|
27
|
+
s.add_development_dependency 'rspec-rails'
|
|
28
|
+
s.add_development_dependency 'capybara'
|
|
29
|
+
s.add_development_dependency 'roo'
|
|
30
|
+
s.add_development_dependency 'rubyzip'
|
|
31
|
+
|
|
32
|
+
s.required_ruby_version = '>= 2.6'
|
|
33
|
+
end
|
|
@@ -2,15 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require 'action_controller'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
unless Mime[:xlsx]
|
|
7
|
-
Mime::Type.register 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', :xlsx
|
|
8
|
-
end
|
|
9
|
-
else
|
|
10
|
-
unless defined? Mime::XLSX
|
|
11
|
-
Mime::Type.register 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', :xlsx
|
|
12
|
-
end
|
|
13
|
-
end
|
|
5
|
+
Mime::Type.register 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', :xlsx unless Mime[:xlsx]
|
|
14
6
|
|
|
15
7
|
ActionController::Renderers.add :xlsx do |filename, options|
|
|
16
8
|
#
|
|
@@ -19,7 +11,7 @@ ActionController::Renderers.add :xlsx do |filename, options|
|
|
|
19
11
|
# def called_action
|
|
20
12
|
# render xlsx: 'filename', template: 'controller/diff_action'
|
|
21
13
|
# end
|
|
22
|
-
#
|
|
14
|
+
#
|
|
23
15
|
# And the normal use case works:
|
|
24
16
|
#
|
|
25
17
|
# def called_action
|
|
@@ -28,14 +20,21 @@ ActionController::Renderers.add :xlsx do |filename, options|
|
|
|
28
20
|
# render 'controller/diff_action'
|
|
29
21
|
# end
|
|
30
22
|
#
|
|
31
|
-
|
|
23
|
+
if options[:template].nil?
|
|
24
|
+
options[:template] ||= action_name
|
|
25
|
+
options[:prefixes] ||= self.class.ancestors
|
|
26
|
+
.take_while { |a| a.respond_to?(:controller_path) }
|
|
27
|
+
.map(&:controller_path)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
options[:template] = filename.gsub(%r{^.*/}, '') if options[:template] == action_name
|
|
32
31
|
|
|
33
32
|
# force layout false
|
|
34
33
|
options[:layout] = false
|
|
35
34
|
|
|
36
35
|
# disposition / filename
|
|
37
36
|
disposition = options.delete(:disposition) || 'attachment'
|
|
38
|
-
file_name = options.delete(:filename) || "#{filename.gsub(
|
|
37
|
+
file_name = options.delete(:filename) || "#{filename.gsub(%r{^.*/}, '')}.xlsx"
|
|
39
38
|
file_name = "#{file_name}.xlsx" unless file_name =~ /\.xlsx$/
|
|
40
39
|
|
|
41
40
|
# alternate settings
|
|
@@ -46,22 +45,18 @@ ActionController::Renderers.add :xlsx do |filename, options|
|
|
|
46
45
|
options[:locals][:xlsx_use_shared_strings] = options.delete(:xlsx_use_shared_strings)
|
|
47
46
|
end
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
send_data render_to_string(options), filename: file_name, type: mime, disposition: disposition
|
|
48
|
+
send_data render_to_string(options), filename: file_name, type: Mime[:xlsx], disposition: disposition
|
|
51
49
|
end
|
|
52
50
|
|
|
53
51
|
# For respond_to default
|
|
54
|
-
|
|
55
|
-
ActionController::Responder
|
|
56
|
-
rescue
|
|
57
|
-
else
|
|
52
|
+
if defined?(ActionController::Responder)
|
|
58
53
|
class ActionController::Responder
|
|
59
54
|
def to_xlsx
|
|
60
55
|
@_action_has_layout = false
|
|
61
56
|
if @default_response
|
|
62
57
|
@default_response.call(options)
|
|
63
58
|
else
|
|
64
|
-
controller.render({xlsx: controller.action_name}.merge(options))
|
|
59
|
+
controller.render({ xlsx: controller.action_name }.merge(options))
|
|
65
60
|
end
|
|
66
61
|
end
|
|
67
62
|
end
|
data/lib/axlsx_rails/railtie.rb
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'axlsx_rails/template_handler'
|
|
4
|
+
|
|
3
5
|
module AxlsxRails
|
|
4
6
|
class Railtie < Rails::Railtie
|
|
5
7
|
initializer 'axlsx_rails.initialization' do
|
|
6
8
|
ActiveSupport.on_load(:action_view) do
|
|
7
|
-
|
|
8
|
-
ActionView::Template.register_template_handler :axlsx, ActionView::Template::Handlers::AxlsxBuilder.new
|
|
9
|
+
ActionView::Template.register_template_handler :axlsx, AxlsxRails::TemplateHandler.new
|
|
9
10
|
end
|
|
10
11
|
|
|
11
12
|
ActiveSupport.on_load(:action_controller) do
|
|
@@ -1,37 +1,26 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'action_view'
|
|
4
3
|
require 'stringio'
|
|
5
4
|
|
|
6
|
-
module
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
case
|
|
12
|
-
when Rails.version.to_f >= 6
|
|
13
|
-
Mime[:xlsx].symbol
|
|
14
|
-
when Rails.version.to_f >= 5
|
|
15
|
-
Mime[:xlsx]
|
|
16
|
-
else
|
|
17
|
-
Mime::XLSX
|
|
18
|
-
end
|
|
19
|
-
end
|
|
5
|
+
module AxlsxRails
|
|
6
|
+
class TemplateHandler
|
|
7
|
+
def default_format
|
|
8
|
+
Mime[:xlsx].symbol
|
|
9
|
+
end
|
|
20
10
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
end
|
|
11
|
+
def call(template, source = nil)
|
|
12
|
+
builder = StringIO.new
|
|
13
|
+
builder << "require 'caxlsx';"
|
|
14
|
+
builder << "xlsx_author = defined?(xlsx_author).nil? ? nil : xlsx_author;"
|
|
15
|
+
builder << "xlsx_created_at = defined?(xlsx_created_at).nil? ? nil : xlsx_created_at;"
|
|
16
|
+
builder << "xlsx_use_shared_strings = defined?(xlsx_use_shared_strings).nil? ? nil : xlsx_use_shared_strings;"
|
|
17
|
+
builder << "xlsx_package = Axlsx::Package.new("
|
|
18
|
+
builder << ":author => xlsx_author,"
|
|
19
|
+
builder << ":created_at => xlsx_created_at,"
|
|
20
|
+
builder << ":use_shared_strings => xlsx_use_shared_strings);"
|
|
21
|
+
builder << (source || template.source)
|
|
22
|
+
builder << "\n;xlsx_package.to_stream.string;"
|
|
23
|
+
builder.string
|
|
35
24
|
end
|
|
36
25
|
end
|
|
37
26
|
end
|
data/lib/axlsx_rails/version.rb
CHANGED
data/lib/axlsx_rails.rb
CHANGED