tramway-export 0.1.0 → 0.1.0.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: 2db1abd681f33aec113b89d0d4e79e2329258884e3f7cb2258c8640f2f3a23e9
4
- data.tar.gz: c58acc9906fa3d6535fdb89d75b7cd10ada709e6994979d492eb3f6334859022
3
+ metadata.gz: c8a28bffa99e723823389b97dc255132840d45082e6cd1983a76e2c28f678196
4
+ data.tar.gz: 107fa809104440a7c3fb9528dbd21750b5e62fac72eba2da8bc1237c8df89202
5
5
  SHA512:
6
- metadata.gz: 68b188497c5fcb65fe07ba35f0a161843951dc7d44d27abc8395c1f85e59a80cf5e1c576e78193e9040c34410df970a17d4a8ef1ecd3fa0850c6dffaaf40de59
7
- data.tar.gz: b377e4d1a07c3898ed589aa7a91b59b527ae4c738411bc7aaa7b3b760b51e2cf46b46dbeed85ee3c9327a91078ce754f43687cef09b3ee75a2de4c366cf896da
6
+ metadata.gz: 2caa6491848f3f0398295f35d80f03d621b8ca02fab4b8847132ea63948fb4f571917391b694ca67dea210a0cf254217ada1e226f34362e59342b216eb7f489f
7
+ data.tar.gz: 71e40c79c77e859c0d3848c26e76426116dae437e05147e5f19c53aa8a78d9e42a2866698c793283f7be2025dfb99aa3039b9f162af1d9425caa63b273f20111
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  begin
2
4
  require 'bundler/setup'
3
5
  rescue LoadError
@@ -14,7 +16,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
14
16
  rdoc.rdoc_files.include('lib/**/*.rb')
15
17
  end
16
18
 
17
- APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
19
+ APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
18
20
  load 'rails/tasks/engine.rake'
19
21
 
20
22
  load 'rails/tasks/statistics.rake'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module Export
3
5
  class ApplicationController < Tramway::Core::ApplicationController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'xls_exporter'
2
4
 
3
5
  class Tramway::Export::ExportsController < Tramway::Export::ApplicationController
@@ -13,12 +15,12 @@ class Tramway::Export::ExportsController < Tramway::Export::ApplicationControlle
13
15
  export_models records, *xlsx_decorator_class.columns
14
16
  end
15
17
  stream = StringIO.new
16
- book.write stream
18
+ book.write stream
17
19
  send_data stream.string, content_type: 'application/xlsx', filename: xlsx_decorator_class.filename
18
20
  end
19
21
 
20
22
  private
21
-
23
+
22
24
  def xlsx_decorator_class_name(model_name)
23
25
  "#{model_name}XlsxDecorator".constantize
24
26
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Tramway::Export::ApplicationDecorator
2
4
  def initialize(object)
3
5
  @object = object
@@ -21,7 +23,5 @@ class Tramway::Export::ApplicationDecorator
21
23
 
22
24
  private
23
25
 
24
- def object
25
- @object
26
- end
26
+ attr_reader :object
27
27
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module Export
3
5
  module Xlsx
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module Export
3
5
  module ApplicationHelper
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module Export
3
5
  class ApplicationJob < ActiveJob::Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module Export
3
5
  class ApplicationMailer < ActionMailer::Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module Export
3
5
  class ApplicationRecord < ActiveRecord::Base
data/config/routes.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Tramway::Export::Engine.routes.draw do
2
4
  resources :exports, only: [] do
3
5
  collection do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # desc "Explaining what the task does"
2
4
  # task :tramway_export do
3
5
  # # Task goes here
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module Export
3
5
  class Engine < ::Rails::Engine
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module Export
3
- VERSION = '0.1.0'
5
+ VERSION = '0.1.0.1'
4
6
  end
5
7
  end
@@ -1,4 +1,6 @@
1
- require "tramway/export/engine"
1
+ # frozen_string_literal: true
2
+
3
+ require 'tramway/export/engine'
2
4
 
3
5
  module Tramway
4
6
  module Export
@@ -10,6 +12,7 @@ module Tramway
10
12
  end
11
13
 
12
14
  def exportable_model?(model_class, project:)
15
+ return false unless project.present?
13
16
  @exportable_models[project.to_sym]&.include? model_class
14
17
  end
15
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-export
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-30 00:00:00.000000000 Z
11
+ date: 2020-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xls_exporter
@@ -70,8 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  requirements: []
73
- rubyforge_project:
74
- rubygems_version: 2.7.6
73
+ rubygems_version: 3.0.3
75
74
  signing_key:
76
75
  specification_version: 4
77
76
  summary: Rails engine for exporting data