ekuseru 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  **.swp
2
2
  pkg
3
+ .bundle
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source :gemcutter
2
+ gem 'rails', '<3.0'
3
+ gem 'spreadsheet'
@@ -1,14 +1,11 @@
1
1
  = Ekuseru
2
2
 
3
- Ekuseru is a gem to generate Microsoft Excel documents with Rails. This gem
4
- provides templating abilities to create excel documents using Spreadsheet gem.
5
-
6
- Having a template is very convenient, because we can define how our file looks
7
- like in the views, and we can access all helper methods defined in rails.
3
+ Ekuseru is a gem to generate Microsoft Excel documents with Rails.
4
+ This gem provides templating abilities to create excel documents.
8
5
 
9
6
  == Installation
10
7
 
11
- === Spreadsheet gem
8
+ === Rails 3
12
9
 
13
10
  * Edit your Gemfile, add:
14
11
 
@@ -18,11 +15,20 @@ like in the views, and we can access all helper methods defined in rails.
18
15
 
19
16
  bundle install
20
17
 
18
+ === Rails 2
19
+
20
+ Ekuseru master branch now support rails 3 and is NOT backward compatible.
21
+ To use ekuseru in rails 2, install it as plugin :
22
+
23
+ * cd vendor/plugins
24
+ * git clone git://github.com/xinuc/ekuseru.git
25
+ * git checkout remotes/origin/rails2 -b rails2
26
+
21
27
  == Usage
22
28
 
23
29
  === Controller
24
30
 
25
- To generate xls document, add <code>format.xls</code> in your controller.
31
+ To generate xls document, add <code>respond_to :xls</code> to your controller.
26
32
 
27
33
  Example:
28
34
 
@@ -43,6 +49,7 @@ Example:
43
49
  Ekuseru will use .eku files as the template. So, with the example above,
44
50
  we will need to create 'index.xls.eku' in app/views/products/.
45
51
  Basically it's just an ordinary ruby file.
52
+
46
53
  In the template, we will get a <code>xls</code> variable which is a
47
54
  Spreadsheet::Workbook object ready to be modified like whatever we want.
48
55
 
@@ -90,7 +97,7 @@ In the template :
90
97
 
91
98
  That's it. Then you can create a link to the xls file if you want, like:
92
99
 
93
- <%= link_to 'Excel', products_path(:format => :xls) %>
100
+ <%= link_to 'Download as Excel', products_path(:format => :xls) %>
94
101
 
95
102
  == Credits
96
103
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.7
1
+ 0.3.8
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ekuseru}
8
- s.version = "0.3.7"
8
+ s.version = "0.3.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nugroho Herucahyono", "Jacob Rothstein"]
12
- s.date = %q{2010-03-22}
12
+ s.date = %q{2010-07-08}
13
13
  s.description = %q{Ekuseru is a gem to generate Microsoft Excel documents with Rails. This plugin provides templating abilities to create excel documents using Spreadsheet gem.}
14
14
  s.email = %q{xinuc@xinuc.org}
15
15
  s.extra_rdoc_files = [
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
17
17
  ]
18
18
  s.files = [
19
19
  ".gitignore",
20
+ "Gemfile",
20
21
  "MIT-LICENSE",
21
22
  "README.rdoc",
22
23
  "Rakefile",
@@ -34,7 +35,7 @@ Gem::Specification.new do |s|
34
35
  s.homepage = %q{http://github.com/xinuc/ekuseru}
35
36
  s.rdoc_options = ["--charset=UTF-8"]
36
37
  s.require_paths = ["lib"]
37
- s.rubygems_version = %q{1.3.6}
38
+ s.rubygems_version = %q{1.3.7}
38
39
  s.summary = %q{Export excel documents from Rails}
39
40
  s.test_files = [
40
41
  "test/test_helper.rb",
@@ -45,7 +46,7 @@ Gem::Specification.new do |s|
45
46
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
46
47
  s.specification_version = 3
47
48
 
48
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
49
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
49
50
  s.add_runtime_dependency(%q<spreadsheet>, [">= 0.6"])
50
51
  else
51
52
  s.add_dependency(%q<spreadsheet>, [">= 0.6"])
@@ -14,7 +14,9 @@ module Ekuseru
14
14
  io = StringIO.new
15
15
  xls.write(io)
16
16
  io.rewind
17
- io.read
17
+ string = io.read
18
+ string.respond_to?(:force_encoding) ?
19
+ string.force_encoding(Encoding::ASCII_8BIT) : string
18
20
  }
19
21
  end
20
22
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ekuseru
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 3
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 3
8
- - 7
9
- version: 0.3.7
9
+ - 8
10
+ version: 0.3.8
10
11
  platform: ruby
11
12
  authors:
12
13
  - Nugroho Herucahyono
@@ -15,16 +16,18 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2010-03-22 00:00:00 +07:00
19
+ date: 2010-07-08 00:00:00 +07:00
19
20
  default_executable:
20
21
  dependencies:
21
22
  - !ruby/object:Gem::Dependency
22
23
  name: spreadsheet
23
24
  prerelease: false
24
25
  requirement: &id001 !ruby/object:Gem::Requirement
26
+ none: false
25
27
  requirements:
26
28
  - - ">="
27
29
  - !ruby/object:Gem::Version
30
+ hash: 7
28
31
  segments:
29
32
  - 0
30
33
  - 6
@@ -41,6 +44,7 @@ extra_rdoc_files:
41
44
  - README.rdoc
42
45
  files:
43
46
  - .gitignore
47
+ - Gemfile
44
48
  - MIT-LICENSE
45
49
  - README.rdoc
46
50
  - Rakefile
@@ -64,23 +68,27 @@ rdoc_options:
64
68
  require_paths:
65
69
  - lib
66
70
  required_ruby_version: !ruby/object:Gem::Requirement
71
+ none: false
67
72
  requirements:
68
73
  - - ">="
69
74
  - !ruby/object:Gem::Version
75
+ hash: 3
70
76
  segments:
71
77
  - 0
72
78
  version: "0"
73
79
  required_rubygems_version: !ruby/object:Gem::Requirement
80
+ none: false
74
81
  requirements:
75
82
  - - ">="
76
83
  - !ruby/object:Gem::Version
84
+ hash: 3
77
85
  segments:
78
86
  - 0
79
87
  version: "0"
80
88
  requirements: []
81
89
 
82
90
  rubyforge_project:
83
- rubygems_version: 1.3.6
91
+ rubygems_version: 1.3.7
84
92
  signing_key:
85
93
  specification_version: 3
86
94
  summary: Export excel documents from Rails