activeadmin-axlsx 1.0.0a

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ spec/rails
File without changes
File without changes
data/Gemfile ADDED
@@ -0,0 +1,30 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+ gem 'activeadmin'
5
+ group :development, :test do
6
+ gem 'sqlite3'
7
+
8
+ gem 'rake', '~> 0.9.2.2', :require => false
9
+ gem 'haml', '~> 3.1.1', :require => false
10
+ gem 'yard'
11
+ gem 'rdiscount' # For yard
12
+ gem "sprockets"
13
+ gem 'rails-i18n' # Gives us default i18n for many languages
14
+ end
15
+
16
+ group :test do
17
+ gem 'inherited_resources'
18
+ gem 'sass-rails'
19
+ gem 'rspec-rails', '~> 2.9.0'
20
+ gem 'cucumber-rails', '1.2.1', :require => false
21
+ gem 'capybara', '1.1.2'
22
+ gem 'database_cleaner'
23
+ gem 'shoulda-matchers', '1.0.0'
24
+ gem 'launchy'
25
+ gem 'jslint_on_rails', '~> 1.0.6'
26
+ gem 'guard-rspec'
27
+ gem "guard-coffeescript"
28
+ gem 'jasmine'
29
+ gem 'debugger'
30
+ end
@@ -0,0 +1,267 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ activeadmin-axlsx (1.0.0a)
5
+ activeadmin (>= 0.5.0)
6
+ axlsx
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionmailer (3.2.8)
12
+ actionpack (= 3.2.8)
13
+ mail (~> 2.4.4)
14
+ actionpack (3.2.8)
15
+ activemodel (= 3.2.8)
16
+ activesupport (= 3.2.8)
17
+ builder (~> 3.0.0)
18
+ erubis (~> 2.7.0)
19
+ journey (~> 1.0.4)
20
+ rack (~> 1.4.0)
21
+ rack-cache (~> 1.2)
22
+ rack-test (~> 0.6.1)
23
+ sprockets (~> 2.1.3)
24
+ activeadmin (0.5.0)
25
+ arbre (>= 1.0.1)
26
+ bourbon (>= 1.0.0)
27
+ devise (>= 1.1.2)
28
+ fastercsv
29
+ formtastic (>= 2.0.0)
30
+ inherited_resources (>= 1.3.1)
31
+ jquery-rails (>= 1.0.0)
32
+ kaminari (>= 0.13.0)
33
+ meta_search (>= 0.9.2)
34
+ rails (>= 3.0.0)
35
+ sass (>= 3.1.0)
36
+ activemodel (3.2.8)
37
+ activesupport (= 3.2.8)
38
+ builder (~> 3.0.0)
39
+ activerecord (3.2.8)
40
+ activemodel (= 3.2.8)
41
+ activesupport (= 3.2.8)
42
+ arel (~> 3.0.2)
43
+ tzinfo (~> 0.3.29)
44
+ activeresource (3.2.8)
45
+ activemodel (= 3.2.8)
46
+ activesupport (= 3.2.8)
47
+ activesupport (3.2.8)
48
+ i18n (~> 0.6)
49
+ multi_json (~> 1.0)
50
+ addressable (2.3.2)
51
+ arbre (1.0.1)
52
+ activesupport (>= 3.0.0)
53
+ arel (3.0.2)
54
+ axlsx (1.3.1)
55
+ htmlentities (~> 4.3.1)
56
+ nokogiri (>= 1.4.1)
57
+ rubyzip (>= 0.9.5)
58
+ bcrypt-ruby (3.0.1)
59
+ bourbon (2.1.1)
60
+ sass (>= 3.1)
61
+ builder (3.0.4)
62
+ capybara (1.1.2)
63
+ mime-types (>= 1.16)
64
+ nokogiri (>= 1.3.3)
65
+ rack (>= 1.0.0)
66
+ rack-test (>= 0.5.4)
67
+ selenium-webdriver (~> 2.0)
68
+ xpath (~> 0.1.4)
69
+ childprocess (0.3.6)
70
+ ffi (~> 1.0, >= 1.0.6)
71
+ coderay (1.0.8)
72
+ coffee-script (2.2.0)
73
+ coffee-script-source
74
+ execjs
75
+ coffee-script-source (1.4.0)
76
+ columnize (0.3.6)
77
+ cucumber (1.2.1)
78
+ builder (>= 2.1.2)
79
+ diff-lcs (>= 1.1.3)
80
+ gherkin (~> 2.11.0)
81
+ json (>= 1.4.6)
82
+ cucumber-rails (1.2.1)
83
+ capybara (>= 1.1.2)
84
+ cucumber (>= 1.1.3)
85
+ nokogiri (>= 1.5.0)
86
+ database_cleaner (0.9.1)
87
+ debugger (1.2.1)
88
+ columnize (>= 0.3.1)
89
+ debugger-linecache (~> 1.1.1)
90
+ debugger-ruby_core_source (~> 1.1.4)
91
+ debugger-linecache (1.1.2)
92
+ debugger-ruby_core_source (>= 1.1.1)
93
+ debugger-ruby_core_source (1.1.4)
94
+ devise (2.1.2)
95
+ bcrypt-ruby (~> 3.0)
96
+ orm_adapter (~> 0.1)
97
+ railties (~> 3.1)
98
+ warden (~> 1.2.1)
99
+ diff-lcs (1.1.3)
100
+ erubis (2.7.0)
101
+ execjs (1.4.0)
102
+ multi_json (~> 1.0)
103
+ fastercsv (1.5.5)
104
+ ffi (1.1.5)
105
+ formtastic (2.2.1)
106
+ actionpack (>= 3.0)
107
+ gherkin (2.11.5)
108
+ json (>= 1.4.6)
109
+ guard (1.5.1)
110
+ listen (>= 0.4.2)
111
+ lumberjack (>= 1.0.2)
112
+ pry (>= 0.9.10)
113
+ thor (>= 0.14.6)
114
+ guard-coffeescript (1.2.0)
115
+ coffee-script (>= 2.2.0)
116
+ guard (>= 1.1.0)
117
+ guard-rspec (1.2.1)
118
+ guard (>= 1.1)
119
+ haml (3.1.7)
120
+ has_scope (0.5.1)
121
+ hike (1.2.1)
122
+ htmlentities (4.3.1)
123
+ i18n (0.6.1)
124
+ inherited_resources (1.3.1)
125
+ has_scope (~> 0.5.0)
126
+ responders (~> 0.6)
127
+ jasmine (1.2.1)
128
+ jasmine-core (>= 1.2.0)
129
+ rack (~> 1.0)
130
+ rspec (>= 1.3.1)
131
+ selenium-webdriver (>= 0.1.3)
132
+ jasmine-core (1.2.0)
133
+ journey (1.0.4)
134
+ jquery-rails (2.1.3)
135
+ railties (>= 3.1.0, < 5.0)
136
+ thor (~> 0.14)
137
+ jslint_on_rails (1.0.7)
138
+ json (1.7.5)
139
+ kaminari (0.14.1)
140
+ actionpack (>= 3.0.0)
141
+ activesupport (>= 3.0.0)
142
+ launchy (2.1.2)
143
+ addressable (~> 2.3)
144
+ libwebsocket (0.1.5)
145
+ addressable
146
+ listen (0.5.3)
147
+ lumberjack (1.0.2)
148
+ mail (2.4.4)
149
+ i18n (>= 0.4.0)
150
+ mime-types (~> 1.16)
151
+ treetop (~> 1.4.8)
152
+ meta_search (1.1.3)
153
+ actionpack (~> 3.1)
154
+ activerecord (~> 3.1)
155
+ activesupport (~> 3.1)
156
+ polyamorous (~> 0.5.0)
157
+ method_source (0.8.1)
158
+ mime-types (1.19)
159
+ multi_json (1.3.6)
160
+ nokogiri (1.5.5)
161
+ orm_adapter (0.4.0)
162
+ polyamorous (0.5.0)
163
+ activerecord (~> 3.0)
164
+ polyglot (0.3.3)
165
+ pry (0.9.10)
166
+ coderay (~> 1.0.5)
167
+ method_source (~> 0.8)
168
+ slop (~> 3.3.1)
169
+ rack (1.4.1)
170
+ rack-cache (1.2)
171
+ rack (>= 0.4)
172
+ rack-ssl (1.3.2)
173
+ rack
174
+ rack-test (0.6.2)
175
+ rack (>= 1.0)
176
+ rails (3.2.8)
177
+ actionmailer (= 3.2.8)
178
+ actionpack (= 3.2.8)
179
+ activerecord (= 3.2.8)
180
+ activeresource (= 3.2.8)
181
+ activesupport (= 3.2.8)
182
+ bundler (~> 1.0)
183
+ railties (= 3.2.8)
184
+ rails-i18n (0.7.0)
185
+ i18n (~> 0.5)
186
+ railties (3.2.8)
187
+ actionpack (= 3.2.8)
188
+ activesupport (= 3.2.8)
189
+ rack-ssl (~> 1.3.2)
190
+ rake (>= 0.8.7)
191
+ rdoc (~> 3.4)
192
+ thor (>= 0.14.6, < 2.0)
193
+ rake (0.9.2.2)
194
+ rdiscount (1.6.8)
195
+ rdoc (3.12)
196
+ json (~> 1.4)
197
+ responders (0.9.3)
198
+ railties (~> 3.1)
199
+ rspec (2.9.0)
200
+ rspec-core (~> 2.9.0)
201
+ rspec-expectations (~> 2.9.0)
202
+ rspec-mocks (~> 2.9.0)
203
+ rspec-core (2.9.0)
204
+ rspec-expectations (2.9.1)
205
+ diff-lcs (~> 1.1.3)
206
+ rspec-mocks (2.9.0)
207
+ rspec-rails (2.9.0)
208
+ actionpack (>= 3.0)
209
+ activesupport (>= 3.0)
210
+ railties (>= 3.0)
211
+ rspec (~> 2.9.0)
212
+ rubyzip (0.9.9)
213
+ sass (3.2.1)
214
+ sass-rails (3.2.5)
215
+ railties (~> 3.2.0)
216
+ sass (>= 3.1.10)
217
+ tilt (~> 1.3)
218
+ selenium-webdriver (2.25.0)
219
+ childprocess (>= 0.2.5)
220
+ libwebsocket (~> 0.1.3)
221
+ multi_json (~> 1.0)
222
+ rubyzip
223
+ shoulda-matchers (1.0.0)
224
+ slop (3.3.3)
225
+ sprockets (2.1.3)
226
+ hike (~> 1.2)
227
+ rack (~> 1.0)
228
+ tilt (~> 1.1, != 1.3.0)
229
+ sqlite3 (1.3.6)
230
+ thor (0.16.0)
231
+ tilt (1.3.3)
232
+ treetop (1.4.11)
233
+ polyglot
234
+ polyglot (>= 0.3.1)
235
+ tzinfo (0.3.34)
236
+ warden (1.2.1)
237
+ rack (>= 1.0)
238
+ xpath (0.1.4)
239
+ nokogiri (~> 1.3)
240
+ yard (0.8.3)
241
+
242
+ PLATFORMS
243
+ ruby
244
+
245
+ DEPENDENCIES
246
+ activeadmin
247
+ activeadmin-axlsx!
248
+ capybara (= 1.1.2)
249
+ cucumber-rails (= 1.2.1)
250
+ database_cleaner
251
+ debugger
252
+ guard-coffeescript
253
+ guard-rspec
254
+ haml (~> 3.1.1)
255
+ inherited_resources
256
+ jasmine
257
+ jslint_on_rails (~> 1.0.6)
258
+ launchy
259
+ rails-i18n
260
+ rake (~> 0.9.2.2)
261
+ rdiscount
262
+ rspec-rails (~> 2.9.0)
263
+ sass-rails
264
+ shoulda-matchers (= 1.0.0)
265
+ sprockets
266
+ sqlite3
267
+ yard
data/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ Copyright (c) 2012 Randy Morgan
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
@@ -0,0 +1,110 @@
1
+ Active Admin Axlsx: Office Open XML Spreadsheet Export for Active Admin
2
+ ====================================
3
+
4
+ If you are using this for comercial purposes, or just want to show your
5
+ appreciation for the gem, please don't hesitate to make a donation.
6
+
7
+ [![Click here to lend your support to: axlsx and make a donation at www.pledgie.com !](http://www.pledgie.com/campaigns/17814.png?skin_name=chrome)](http://www.pledgie.com/campaigns/17814)
8
+
9
+ **IRC**:[irc.freenode.net / #axlsx](irc://irc.freenode.net/axlsx)
10
+
11
+ **Git**:[http://github.com/randym/activeadmin-axlsx](http://github.com/randym/activeadmin-axlsx)
12
+
13
+ **Twitter**: [https://twitter.com/#!/morgan_randy](https://twitter.com/#!/morgan_randy)
14
+
15
+ **Google Group**: [https://groups.google.com/forum/?fromgroups#!forum/axlsx](https://groups.google.com/forum/?fromgroups#!forum/axlsx)
16
+
17
+ **Author**: Randy Morgan
18
+
19
+ **Copyright**: 2012
20
+
21
+ **License**: MIT License
22
+
23
+ **Latest Version**: 1.0.0
24
+
25
+ **Ruby Version**: 1.9.2, 1.9.3
26
+
27
+ **JRuby Version**: 1.9 mode
28
+
29
+ **Rubinius Version**: rubinius 2.0.0dev * lower versions may run, this gem always tests against head.
30
+
31
+ **Release Date**: TBA
32
+
33
+ Synopsis
34
+ --------
35
+
36
+ This gem provides automatic OOXML (xlsx) downloads for Active Admin
37
+ resources. It lets you harness the full power of Axlsx when you want to
38
+ but for the most part just stays out of your way and adds a link next to
39
+ the csv download for xlsx (Excel/numbers/Libre Office/Google Docs)
40
+
41
+ git ls-files -- {test,spec,features}/*
42
+
43
+ ![Screen 1](https://github.com/randym/activeadmin-axlsx/raw/master/screen_capture.png)
44
+
45
+ Usage example:
46
+ Simple add the following to your gemfile and you are good to go.
47
+ All resource index views will now include a link for download directly
48
+ to xlsx.
49
+
50
+ ```
51
+ gem 'activeadmin-axlsx'
52
+ ```
53
+
54
+ Cool Toys
55
+ ---------
56
+
57
+ Here are a few quick examples of things you can easily tweak.
58
+ Axlsx supports A LOT of the specification so if you are looking to do
59
+ something adventurous please ping me on irc. (freenode#axlsx)
60
+
61
+ ##localize column headers
62
+
63
+ ```ruby
64
+ #app/admin/posts.rb
65
+ ActiveAdmin.register Posts do
66
+ config.xlsx_builder.i18n_scope [:active_record, :models, :posts]
67
+ end
68
+ ```
69
+
70
+ ##Use blocks for adding computed fields
71
+
72
+ ```ruby
73
+ #app/admin/posts.rb
74
+ ActiveAdmin.register Posts do
75
+ config.xlsx_builder.column('author_name') do |resource|
76
+ resource.author.name
77
+ end
78
+ end
79
+ ```
80
+
81
+ ##Change the column header style
82
+
83
+ ```ruby
84
+ #app/admin/posts.rb
85
+ ActiveAdmin.register Posts do
86
+ config.xlsx_builder.header_style = { :bg_color => 'FF0000',
87
+ :fg_color => 'FF' }
88
+ end
89
+ ```
90
+
91
+ #Specs
92
+ ------
93
+ Running specs for this gem requires that you construct a rails application.
94
+ To execute the specs, navigate to the gem directory,
95
+ run bundle install and run these to rake tasks:
96
+
97
+ ```
98
+ bundle exec rake setup
99
+ ```
100
+
101
+ ```
102
+ bundle exec rake
103
+ ```
104
+
105
+ #Copyright and License
106
+ ----------
107
+
108
+ activeadmin-axlsx &copy; 2012 by [Randy Morgan](mailto:digial.ipseity@gmail.com).
109
+
110
+ activeadmin-axlsx is licensed under the MIT license. Please see the LICENSE document for more information.
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env rake
2
+ require "activeadmin"
3
+ require "rspec/core/rake_task"
4
+
5
+ desc "Creates a test rails app for the specs to run against"
6
+ task :setup do
7
+ require 'rails/version'
8
+ system("mkdir spec/rails") unless File.exists?("spec/rails")
9
+ system "bundle exec rails new spec/rails/rails-#{Rails::VERSION::STRING} -m spec/support/rails_template_with_data.rb"
10
+ end
11
+
12
+ RSpec::Core::RakeTask.new
13
+ task :default => :spec
14
+ task :test => :spec
15
+
16
+ desc "build the gem"
17
+ task :build do
18
+ system "gem build activeadmin-axlsx.gemspec"
19
+ end
20
+ desc "build and release the gem"
21
+ task :release => :build do
22
+ system "gem push activeadmin-axlsx-#{ActiveAdmin::Axlsx::VERSION}.gem"
23
+ end
24
+