spreadsheet 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,12 @@
1
+ === 0.7.1 / 08.05.2012
2
+
3
+ * Author: Artem Ignatiev <zazubrik@gmail.com>
4
+ * remove require and rake altogether
5
+ * gem build and rake gem both work fine without those requires,
6
+ * and requiring 'rake' broke bundler
7
+ * add rake as development dependency
8
+ * Somehow it broken rake on my other project
9
+
1
10
  === 0.7.0 / 07.05.2012
2
11
 
3
12
  * Author: Artem Ignatiev <zazubrik@gmail.com>
data/Manifest.txt CHANGED
@@ -20,6 +20,7 @@ lib/spreadsheet/excel/internals.rb
20
20
  lib/spreadsheet/excel/internals/biff5.rb
21
21
  lib/spreadsheet/excel/internals/biff8.rb
22
22
  lib/spreadsheet/excel/offset.rb
23
+ lib/spreadsheet/excel/password_hash.rb
23
24
  lib/spreadsheet/excel/reader.rb
24
25
  lib/spreadsheet/excel/reader/biff5.rb
25
26
  lib/spreadsheet/excel/reader/biff8.rb
@@ -50,6 +51,7 @@ test/data/test_empty.xls
50
51
  test/data/test_formula.xls
51
52
  test/data/test_long_sst_record.xls
52
53
  test/data/test_merged_cells.xls
54
+ test/data/test_merged_and_protected.xls
53
55
  test/data/test_missing_row.xls
54
56
  test/data/test_version_excel5.xls
55
57
  test/data/test_version_excel95.xls
@@ -64,3 +66,4 @@ test/row.rb
64
66
  test/suite.rb
65
67
  test/workbook.rb
66
68
  test/worksheet.rb
69
+ test/workbook_protection.rb
data/README.txt CHANGED
@@ -1,4 +1,4 @@
1
- Last Update: 08.12.2011 - Zeno R.R. Davatz
1
+ Last Update: 07.05.2011 - Zeno R.R. Davatz
2
2
 
3
3
  = Spreadsheet
4
4
 
@@ -47,15 +47,15 @@ Floats returned for any number.
47
47
  * Improved handling of String Encodings
48
48
 
49
49
 
50
- == Roadmap
50
+ == On the Roadmap
51
51
 
52
- 0.7.0:: Improved Format support/Styles
53
- 0.7.1:: Document Modification: Formats/Styles
54
- 0.8.0:: Formula Support
55
- 0.8.1:: Document Modification: Formulas
56
- 0.9.0:: Write-Support: BIFF5
57
- 1.0.0:: Ruby 1.9 Support;
58
- Remove backward compatibility code
52
+ * Improved Format support/Styles
53
+ * Document Modification: Formats/Styles
54
+ * Formula Support
55
+ * Document Modification: Formulas
56
+ * Write-Support: BIFF5
57
+ * Ruby 1.9 Support;
58
+ * Remove backward compatibility code
59
59
 
60
60
  Note: Spreadsheet supports Ruby 1.8.6, 1.8.7, 1.9.2, 1.9.3
61
61
 
data/lib/spreadsheet.rb CHANGED
@@ -42,7 +42,7 @@ module Spreadsheet
42
42
 
43
43
  ##
44
44
  # The version of Spreadsheet you are using.
45
- VERSION = '0.7.0'
45
+ VERSION = '0.7.1'
46
46
 
47
47
  ##
48
48
  # Default client Encoding. Change this value if your application uses a
@@ -0,0 +1,24 @@
1
+ module Spreadsheet
2
+ module Excel
3
+ module Password
4
+ class <<self
5
+ ##
6
+ # Makes an excel-compatible hash
7
+ def password_hash(password)
8
+ hash = 0
9
+ password.chars.reverse_each { |chr| hash = rol15(hash ^ chr[0].ord) }
10
+ hash ^ password.size ^ 0xCE4B
11
+ end
12
+
13
+ private
14
+ ##
15
+ # rotates hash 1 bit left, using lower 15 bits
16
+ def rol15(hash)
17
+ new_hash = hash << 1
18
+ (new_hash & 0x7FFF) | (new_hash >> 15)
19
+ end
20
+ end
21
+
22
+ end
23
+ end
24
+ end
data/spreadsheet.gemspec CHANGED
@@ -1,6 +1,3 @@
1
- require "rubygems"
2
- require "rake"
3
-
4
1
  spec = Gem::Specification.new do |s|
5
2
  s.name = "spreadsheet"
6
3
  s.version = "0.7.0"
@@ -16,9 +13,3 @@ spec = Gem::Specification.new do |s|
16
13
  s.homepage = "http://scm.ywesee.com/?p=spreadsheet/.git;a=summary"
17
14
  end
18
15
 
19
- if $0 == __FILE__
20
- Gem.manage_gems
21
- Gem::Builder.new(spec).build
22
- else
23
- spec
24
- end
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $: << File.expand_path('../lib', File.dirname(__FILE__))
4
+
5
+ require 'test/unit'
6
+ require 'spreadsheet'
7
+
8
+ module Spreadsheet
9
+ module Excel
10
+ class TestWorkbook < Test::Unit::TestCase
11
+ def test_password_hashing
12
+ hashing_module = Spreadsheet::Excel::Password
13
+ # Some examples found on the web
14
+ assert_equal(0xFEF1, hashing_module.password_hash('abcdefghij'))
15
+ assert_equal(hashing_module.password_hash('test'), hashing_module.password_hash('zzyw'))
16
+ end
17
+ end
18
+ end
19
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spreadsheet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-07 00:00:00.000000000 Z
12
+ date: 2012-05-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby-ole
16
- requirement: &11528100 !ruby/object:Gem::Requirement
16
+ requirement: &18163460 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *11528100
24
+ version_requirements: *18163460
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rdoc
27
- requirement: &11525080 !ruby/object:Gem::Requirement
27
+ requirement: &18162320 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3.10'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *11525080
35
+ version_requirements: *18162320
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: hoe
38
- requirement: &11523960 !ruby/object:Gem::Requirement
38
+ requirement: &18161240 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '2.13'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *11523960
46
+ version_requirements: *18161240
47
47
  description: ! 'The Spreadsheet Library is designed to read and write Spreadsheet
48
48
  Documents.
49
49
 
@@ -88,6 +88,7 @@ files:
88
88
  - lib/spreadsheet/excel/internals/biff5.rb
89
89
  - lib/spreadsheet/excel/internals/biff8.rb
90
90
  - lib/spreadsheet/excel/offset.rb
91
+ - lib/spreadsheet/excel/password_hash.rb
91
92
  - lib/spreadsheet/excel/reader.rb
92
93
  - lib/spreadsheet/excel/reader/biff5.rb
93
94
  - lib/spreadsheet/excel/reader/biff8.rb
@@ -118,6 +119,7 @@ files:
118
119
  - test/data/test_formula.xls
119
120
  - test/data/test_long_sst_record.xls
120
121
  - test/data/test_merged_cells.xls
122
+ - test/data/test_merged_and_protected.xls
121
123
  - test/data/test_missing_row.xls
122
124
  - test/data/test_version_excel5.xls
123
125
  - test/data/test_version_excel95.xls
@@ -132,6 +134,7 @@ files:
132
134
  - test/suite.rb
133
135
  - test/workbook.rb
134
136
  - test/worksheet.rb
137
+ - test/workbook_protection.rb
135
138
  - .gemtest
136
139
  homepage: http://spreadsheet.rubyforge.org
137
140
  licenses: []