excelizer 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3276787f642062455fbd78534c694e066d48ec90
4
+ data.tar.gz: 68315509d7e1b21f3b2fa3cf6525bf10f8d119ad
5
+ SHA512:
6
+ metadata.gz: 5ab5a5925939314c1937b9ec050968de16b7711d51b4062d03d0c5b7d9017b2367fcd5acb8f19f11cb4f8b510a9b5313759fda0d52e41386d9894295d69b1d87
7
+ data.tar.gz: 0a2f2ade998315cc92c498a3f309d71170e86e2aa1c1baef9c90ecede018da4a875bb5bae9a9f9791ef4439f8a7f79ca1bb0229fdce74cdec7e4b0d5506c55a1
data/README.md CHANGED
@@ -97,6 +97,7 @@ Brought to you by Arturo Puente and the team at [Phantasia](http://www.phantasia
97
97
 
98
98
  ## Changelog
99
99
 
100
+ 0.1.0 Custom header support.
100
101
  0.0.9 Adds support for Rails 4.
101
102
  0.0.8 Safer attribute initialization.
102
103
  0.0.7 First release. Codename: Bond
@@ -1,3 +1,3 @@
1
1
  module Excelizer
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
data/lib/excelizer.rb CHANGED
@@ -11,8 +11,16 @@ module Excelizer
11
11
  end
12
12
  end
13
13
 
14
+ def self.attr_headers(*attrs)
15
+ @headers = attrs.to_a
16
+ end
17
+
14
18
  def build_xls(collection=model_class.all)
15
- headers = *methods.select { |m| self.method(m).owner == self.class }.map { |m| m.to_s.titleize }
19
+ if @headers
20
+ headers = @headers
21
+ else
22
+ headers = *methods.select { |m| self.method(m).owner == self.class }.map { |m| m.to_s.titleize }
23
+ end
16
24
  records = get_collection_data(collection)
17
25
 
18
26
  Excelizer::Writer.write headers, records
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excelizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
5
- prerelease:
4
+ version: 0.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Arturo Puente
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-10-23 00:00:00.000000000 Z
11
+ date: 2013-10-31 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,33 +27,29 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: spreadsheet
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  description: An Excel helper for Rails project. It integrates with ActiveRecord models
@@ -79,27 +72,26 @@ files:
79
72
  homepage: https://github.com/arturopuente/excelizer
80
73
  licenses:
81
74
  - MIT
75
+ metadata: {}
82
76
  post_install_message:
83
77
  rdoc_options: []
84
78
  require_paths:
85
79
  - lib
86
80
  required_ruby_version: !ruby/object:Gem::Requirement
87
- none: false
88
81
  requirements:
89
- - - ! '>='
82
+ - - '>='
90
83
  - !ruby/object:Gem::Version
91
84
  version: '0'
92
85
  required_rubygems_version: !ruby/object:Gem::Requirement
93
- none: false
94
86
  requirements:
95
- - - ! '>='
87
+ - - '>='
96
88
  - !ruby/object:Gem::Version
97
89
  version: '0'
98
90
  requirements: []
99
91
  rubyforge_project:
100
- rubygems_version: 1.8.23
92
+ rubygems_version: 2.0.3
101
93
  signing_key:
102
- specification_version: 3
94
+ specification_version: 4
103
95
  summary: An Excel helper for Rails project
104
96
  test_files:
105
97
  - test/spec.rb