acts_as_xlsx 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.
- data/Gemfile.lock +16 -4
- data/README.md +12 -3
- data/acts_as_xlsx.gemspec +1 -1
- data/doc/Axlsx/Ar/ClassMethods.html +35 -27
- data/doc/Axlsx/Ar/SingletonMethods.html +60 -50
- data/doc/Axlsx/Ar.html +19 -16
- data/doc/Axlsx.html +6 -5
- data/doc/_index.html +2 -2
- data/doc/file.LICENSE.html +28 -23
- data/doc/file.README.html +45 -28
- data/doc/index.html +45 -28
- data/doc/top-level-namespace.html +2 -2
- data/lib/{axlsx/acts_as_xlsx.rb → acts_as_xlsx.rb} +0 -0
- data/test/acts_as_xlsx.sqlite3.db +0 -0
- data/test/tc_acts_as_xlsx.rb +1 -1
- metadata +120 -75
data/doc/file.LICENSE.html
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
4
|
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
6
|
<title>
|
7
7
|
File: LICENSE
|
8
8
|
|
@@ -54,32 +54,37 @@
|
|
54
54
|
|
55
55
|
<iframe id="search_frame"></iframe>
|
56
56
|
|
57
|
-
<div id="content"><div id='filecontents'>
|
58
|
-
|
59
|
-
|
60
|
-
<p>
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
57
|
+
<div id="content"><div id='filecontents'><p>
|
58
|
+
Copyright © 2011 Randy Morgan
|
59
|
+
</p>
|
60
|
+
<p>
|
61
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
62
|
+
copy of this software and associated documentation files (the
|
63
|
+
"Software"), to deal in the Software without restriction,
|
64
|
+
including without limitation the rights to use, copy, modify, merge,
|
65
|
+
publish, distribute, sublicense, and/or sell copies of the Software, and to
|
66
|
+
permit persons to whom the Software is furnished to do so, subject to the
|
67
|
+
following conditions:
|
68
|
+
</p>
|
69
|
+
<p>
|
70
|
+
The above copyright notice and this permission notice shall be included in
|
71
|
+
all copies or substantial portions of the Software.
|
72
|
+
</p>
|
73
|
+
<p>
|
74
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
75
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
76
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
77
|
+
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
78
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
79
|
+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
80
|
+
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
81
|
+
</p>
|
77
82
|
</div></div>
|
78
83
|
|
79
84
|
<div id="footer">
|
80
|
-
Generated on Thu Dec 1
|
85
|
+
Generated on Thu Dec 1 01:04:19 2011 by
|
81
86
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
82
|
-
0.7.3 (ruby-1.
|
87
|
+
0.7.3 (ruby-1.8.7).
|
83
88
|
</div>
|
84
89
|
|
85
90
|
</body>
|
data/doc/file.README.html
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
4
|
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
@@ -63,9 +63,9 @@
|
|
63
63
|
<strong>Author</strong>: Randy Morgan <br/>
|
64
64
|
<strong>Copyright</strong>: 2011 <br/>
|
65
65
|
<strong>License</strong>: MIT License <br/>
|
66
|
-
<strong>Latest Version</strong>: 1.0.
|
66
|
+
<strong>Latest Version</strong>: 1.0.1 <br/>
|
67
67
|
<strong>Ruby Version</strong>: 1.8.7 - 1.9.3<br/>
|
68
|
-
<strong>Release Date</strong>:
|
68
|
+
<strong>Release Date</strong>: December 1st 2011</p>
|
69
69
|
|
70
70
|
<h2>Synopsis</h2>
|
71
71
|
|
@@ -81,7 +81,7 @@
|
|
81
81
|
|
82
82
|
<p>**4. Automates localization of column heading with i18n support</p>
|
83
83
|
|
84
|
-
<p>**5. Lets you specify columns to
|
84
|
+
<p>**5. Lets you specify columns the precise columns and/or methods you want to call to populate your table in one go.</p>
|
85
85
|
|
86
86
|
<p>**6. Gives you access to the axlsx package so you can add styles, charts and pictures to satisfy those flashy sales guys.</p>
|
87
87
|
|
@@ -91,7 +91,7 @@
|
|
91
91
|
|
92
92
|
<p>To install, use the following command:</p>
|
93
93
|
|
94
|
-
<pre class="code">$ gem install acts_as_xlsx
|
94
|
+
<pre class="code">$ <span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='acts_as_xlsx identifier id'>acts_as_xlsx</span>
|
95
95
|
</pre>
|
96
96
|
|
97
97
|
<h2>Usage</h2>
|
@@ -100,36 +100,41 @@
|
|
100
100
|
|
101
101
|
<p>A trivial rails example</p>
|
102
102
|
|
103
|
-
<pre class="code"> <span class='comment'>#Add the gem to your Gemfile and bundle install
|
104
|
-
|
105
|
-
|
106
|
-
<span class='comment'># app/models/post.rb
|
107
|
-
|
108
|
-
<span class='id
|
109
|
-
<span class='kw'>end</span>
|
110
|
-
|
111
|
-
<span class='comment'># app/controllers/posts_controller.rb
|
112
|
-
|
113
|
-
<span class='comment'># GET posts/xlsx
|
114
|
-
|
115
|
-
<span class='id
|
116
|
-
<span class='id
|
117
|
-
<span class='id
|
118
|
-
<span class='kw'>end</span>
|
119
|
-
<span class='kw'>end</span>
|
103
|
+
<pre class="code"> <span class='comment val'>#Add the gem to your Gemfile and bundle install</span>
|
104
|
+
<span class='gem identifier id'>gem</span> <span class='string val'>'acts_as_xlsx'</span>
|
105
|
+
|
106
|
+
<span class='comment val'># app/models/post.rb</span>
|
107
|
+
<span class='class class kw'>class</span> <span class='Post constant id'>Post</span> <span class='lt op'><</span> <span class='ActiveRecord constant id'>ActiveRecord</span><span class='colon2 op'>::</span><span class='Base constant id'>Base</span>
|
108
|
+
<span class='acts_as_xlsx identifier id'>acts_as_xlsx</span>
|
109
|
+
<span class='end end kw'>end</span>
|
110
|
+
|
111
|
+
<span class='comment val'># app/controllers/posts_controller.rb</span>
|
112
|
+
<span class='class class kw'>class</span> <span class='PostsController constant id'>PostsController</span> <span class='lt op'><</span> <span class='ApplicationController constant id'>ApplicationController</span>
|
113
|
+
<span class='comment val'># GET posts/xlsx </span>
|
114
|
+
<span class='def def kw'>def</span> <span class='xlsx identifier id'>xlsx</span>
|
115
|
+
<span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Post constant id'>Post</span><span class='dot token'>.</span><span class='to_xlsx identifier id'>to_xlsx</span>
|
116
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>'public/downloads/posts.xlsx'</span><span class='rparen token'>)</span>
|
117
|
+
<span class='send_file identifier id'>send_file</span> <span class='string val'>'public/downloads/posts.xlsx'</span><span class='comma token'>,</span> <span class='symbol val'>:type=</span><span class='gt op'>></span><span class='string val'>"application/xlsx"</span>
|
118
|
+
<span class='end end kw'>end</span>
|
119
|
+
<span class='end end kw'>end</span>
|
120
120
|
</pre>
|
121
121
|
|
122
122
|
<p>Specify columns and methods and i18n chain</p>
|
123
123
|
|
124
|
-
<pre class="code"><span class='id
|
124
|
+
<pre class="code"><span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Post constant id'>Post</span><span class='dot token'>.</span><span class='to_xlsx identifier id'>to_xlsx</span> <span class='symbol val'>:columns</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='symbol val'>:name</span><span class='comma token'>,</span> <span class='symbol val'>:title</span><span class='comma token'>,</span> <span class='symbol val'>:ranking</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:i18n</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>'activerecord.attributes'</span>
|
125
|
+
</pre>
|
126
|
+
|
127
|
+
<p>For examples on how to use axlsx for custom styles, charts, images and more see:</p>
|
128
|
+
|
129
|
+
<pre class="code"> <span class='lbrack token'>[</span><span class='http identifier id'>http</span><span class='symbol val'>:/</span><span class='regexp val'>/rubygems.org/</span><span class='gems identifier id'>gems</span><span class='div op'>/</span><span class='axlsx identifier id'>axlsx</span><span class='rbrack token'>]</span> <span class='lparen token'>(</span><span class='https identifier id'>https</span><span class='symbol val'>:/</span><span class='regexp val'>/rubygems.org/</span><span class='gems identifier id'>gems</span><span class='div op'>/</span><span class='axlsx identifier id'>axlsx</span><span class='rparen token'>)</span>
|
125
130
|
</pre>
|
126
131
|
|
127
132
|
<h3>Documentation</h3>
|
128
133
|
|
129
134
|
<p>This gem is 100% documented with YARD, an exceptional documentation library. To see documentation for this, and all the gems installed on your system use:</p>
|
130
135
|
|
131
|
-
<pre class="code"> <span class='id
|
132
|
-
<span class='id
|
136
|
+
<pre class="code"> <span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='yard identifier id'>yard</span>
|
137
|
+
<span class='yard identifier id'>yard</span> <span class='server identifier id'>server</span> <span class='minus op'>-</span><span class='g identifier id'>g</span>
|
133
138
|
</pre>
|
134
139
|
|
135
140
|
<h3>Specs</h3>
|
@@ -139,7 +144,19 @@
|
|
139
144
|
<h2>Changelog</h2>
|
140
145
|
|
141
146
|
<ul>
|
142
|
-
<li><strong>October.30.11</strong>: 1.0.
|
147
|
+
<li><p><strong>October.30.11</strong>: 1.0.1 release</p>
|
148
|
+
|
149
|
+
<ul>
|
150
|
+
<li>Patch for inclusion error</li>
|
151
|
+
</ul>
|
152
|
+
</li>
|
153
|
+
<li><p><strong>October.30.11</strong>: 1.0.0 release</p>
|
154
|
+
|
155
|
+
<ul>
|
156
|
+
<li>First release</li>
|
157
|
+
</ul>
|
158
|
+
</li>
|
159
|
+
<li><p><strong>October.30.11</strong>: 1.0.0a release</p>
|
143
160
|
|
144
161
|
<ul>
|
145
162
|
<li>First pre release</li>
|
@@ -157,9 +174,9 @@ licensed under the MIT license. Please see the <a href="file.LICENSE.html" title
|
|
157
174
|
</div></div>
|
158
175
|
|
159
176
|
<div id="footer">
|
160
|
-
Generated on Thu Dec 1
|
177
|
+
Generated on Thu Dec 1 01:04:19 2011 by
|
161
178
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
162
|
-
0.7.3 (ruby-1.
|
179
|
+
0.7.3 (ruby-1.8.7).
|
163
180
|
</div>
|
164
181
|
|
165
182
|
</body>
|
data/doc/index.html
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
4
|
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
@@ -63,9 +63,9 @@
|
|
63
63
|
<strong>Author</strong>: Randy Morgan <br/>
|
64
64
|
<strong>Copyright</strong>: 2011 <br/>
|
65
65
|
<strong>License</strong>: MIT License <br/>
|
66
|
-
<strong>Latest Version</strong>: 1.0.
|
66
|
+
<strong>Latest Version</strong>: 1.0.1 <br/>
|
67
67
|
<strong>Ruby Version</strong>: 1.8.7 - 1.9.3<br/>
|
68
|
-
<strong>Release Date</strong>:
|
68
|
+
<strong>Release Date</strong>: December 1st 2011</p>
|
69
69
|
|
70
70
|
<h2>Synopsis</h2>
|
71
71
|
|
@@ -81,7 +81,7 @@
|
|
81
81
|
|
82
82
|
<p>**4. Automates localization of column heading with i18n support</p>
|
83
83
|
|
84
|
-
<p>**5. Lets you specify columns to
|
84
|
+
<p>**5. Lets you specify columns the precise columns and/or methods you want to call to populate your table in one go.</p>
|
85
85
|
|
86
86
|
<p>**6. Gives you access to the axlsx package so you can add styles, charts and pictures to satisfy those flashy sales guys.</p>
|
87
87
|
|
@@ -91,7 +91,7 @@
|
|
91
91
|
|
92
92
|
<p>To install, use the following command:</p>
|
93
93
|
|
94
|
-
<pre class="code">$ gem install acts_as_xlsx
|
94
|
+
<pre class="code">$ <span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='acts_as_xlsx identifier id'>acts_as_xlsx</span>
|
95
95
|
</pre>
|
96
96
|
|
97
97
|
<h2>Usage</h2>
|
@@ -100,36 +100,41 @@
|
|
100
100
|
|
101
101
|
<p>A trivial rails example</p>
|
102
102
|
|
103
|
-
<pre class="code"> <span class='comment'>#Add the gem to your Gemfile and bundle install
|
104
|
-
|
105
|
-
|
106
|
-
<span class='comment'># app/models/post.rb
|
107
|
-
|
108
|
-
<span class='id
|
109
|
-
<span class='kw'>end</span>
|
110
|
-
|
111
|
-
<span class='comment'># app/controllers/posts_controller.rb
|
112
|
-
|
113
|
-
<span class='comment'># GET posts/xlsx
|
114
|
-
|
115
|
-
<span class='id
|
116
|
-
<span class='id
|
117
|
-
<span class='id
|
118
|
-
<span class='kw'>end</span>
|
119
|
-
<span class='kw'>end</span>
|
103
|
+
<pre class="code"> <span class='comment val'>#Add the gem to your Gemfile and bundle install</span>
|
104
|
+
<span class='gem identifier id'>gem</span> <span class='string val'>'acts_as_xlsx'</span>
|
105
|
+
|
106
|
+
<span class='comment val'># app/models/post.rb</span>
|
107
|
+
<span class='class class kw'>class</span> <span class='Post constant id'>Post</span> <span class='lt op'><</span> <span class='ActiveRecord constant id'>ActiveRecord</span><span class='colon2 op'>::</span><span class='Base constant id'>Base</span>
|
108
|
+
<span class='acts_as_xlsx identifier id'>acts_as_xlsx</span>
|
109
|
+
<span class='end end kw'>end</span>
|
110
|
+
|
111
|
+
<span class='comment val'># app/controllers/posts_controller.rb</span>
|
112
|
+
<span class='class class kw'>class</span> <span class='PostsController constant id'>PostsController</span> <span class='lt op'><</span> <span class='ApplicationController constant id'>ApplicationController</span>
|
113
|
+
<span class='comment val'># GET posts/xlsx </span>
|
114
|
+
<span class='def def kw'>def</span> <span class='xlsx identifier id'>xlsx</span>
|
115
|
+
<span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Post constant id'>Post</span><span class='dot token'>.</span><span class='to_xlsx identifier id'>to_xlsx</span>
|
116
|
+
<span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>'public/downloads/posts.xlsx'</span><span class='rparen token'>)</span>
|
117
|
+
<span class='send_file identifier id'>send_file</span> <span class='string val'>'public/downloads/posts.xlsx'</span><span class='comma token'>,</span> <span class='symbol val'>:type=</span><span class='gt op'>></span><span class='string val'>"application/xlsx"</span>
|
118
|
+
<span class='end end kw'>end</span>
|
119
|
+
<span class='end end kw'>end</span>
|
120
120
|
</pre>
|
121
121
|
|
122
122
|
<p>Specify columns and methods and i18n chain</p>
|
123
123
|
|
124
|
-
<pre class="code"><span class='id
|
124
|
+
<pre class="code"><span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Post constant id'>Post</span><span class='dot token'>.</span><span class='to_xlsx identifier id'>to_xlsx</span> <span class='symbol val'>:columns</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='symbol val'>:name</span><span class='comma token'>,</span> <span class='symbol val'>:title</span><span class='comma token'>,</span> <span class='symbol val'>:ranking</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:i18n</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>'activerecord.attributes'</span>
|
125
|
+
</pre>
|
126
|
+
|
127
|
+
<p>For examples on how to use axlsx for custom styles, charts, images and more see:</p>
|
128
|
+
|
129
|
+
<pre class="code"> <span class='lbrack token'>[</span><span class='http identifier id'>http</span><span class='symbol val'>:/</span><span class='regexp val'>/rubygems.org/</span><span class='gems identifier id'>gems</span><span class='div op'>/</span><span class='axlsx identifier id'>axlsx</span><span class='rbrack token'>]</span> <span class='lparen token'>(</span><span class='https identifier id'>https</span><span class='symbol val'>:/</span><span class='regexp val'>/rubygems.org/</span><span class='gems identifier id'>gems</span><span class='div op'>/</span><span class='axlsx identifier id'>axlsx</span><span class='rparen token'>)</span>
|
125
130
|
</pre>
|
126
131
|
|
127
132
|
<h3>Documentation</h3>
|
128
133
|
|
129
134
|
<p>This gem is 100% documented with YARD, an exceptional documentation library. To see documentation for this, and all the gems installed on your system use:</p>
|
130
135
|
|
131
|
-
<pre class="code"> <span class='id
|
132
|
-
<span class='id
|
136
|
+
<pre class="code"> <span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='yard identifier id'>yard</span>
|
137
|
+
<span class='yard identifier id'>yard</span> <span class='server identifier id'>server</span> <span class='minus op'>-</span><span class='g identifier id'>g</span>
|
133
138
|
</pre>
|
134
139
|
|
135
140
|
<h3>Specs</h3>
|
@@ -139,7 +144,19 @@
|
|
139
144
|
<h2>Changelog</h2>
|
140
145
|
|
141
146
|
<ul>
|
142
|
-
<li><strong>October.30.11</strong>: 1.0.
|
147
|
+
<li><p><strong>October.30.11</strong>: 1.0.1 release</p>
|
148
|
+
|
149
|
+
<ul>
|
150
|
+
<li>Patch for inclusion error</li>
|
151
|
+
</ul>
|
152
|
+
</li>
|
153
|
+
<li><p><strong>October.30.11</strong>: 1.0.0 release</p>
|
154
|
+
|
155
|
+
<ul>
|
156
|
+
<li>First release</li>
|
157
|
+
</ul>
|
158
|
+
</li>
|
159
|
+
<li><p><strong>October.30.11</strong>: 1.0.0a release</p>
|
143
160
|
|
144
161
|
<ul>
|
145
162
|
<li>First pre release</li>
|
@@ -157,9 +174,9 @@ licensed under the MIT license. Please see the <a href="file.LICENSE.html" title
|
|
157
174
|
</div></div>
|
158
175
|
|
159
176
|
<div id="footer">
|
160
|
-
Generated on Thu Dec 1
|
177
|
+
Generated on Thu Dec 1 01:04:19 2011 by
|
161
178
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
162
|
-
0.7.3 (ruby-1.
|
179
|
+
0.7.3 (ruby-1.8.7).
|
163
180
|
</div>
|
164
181
|
|
165
182
|
</body>
|
@@ -94,9 +94,9 @@
|
|
94
94
|
</div>
|
95
95
|
|
96
96
|
<div id="footer">
|
97
|
-
Generated on Thu Dec 1
|
97
|
+
Generated on Thu Dec 1 01:04:20 2011 by
|
98
98
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
99
|
-
0.7.3 (ruby-1.
|
99
|
+
0.7.3 (ruby-1.8.7).
|
100
100
|
</div>
|
101
101
|
|
102
102
|
</body>
|
File without changes
|
Binary file
|