extract 0.1.1 → 0.1.3

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: abf6de760409b760733c98953028fc6ff6c86404
4
+ data.tar.gz: 218b742eebffa29a9c6bd0a5fc991f1b1c6e371b
5
+ SHA512:
6
+ metadata.gz: 99feb648cbac9100538d34ada5453a6640261cf14f38c01eb8303c5ed3f3ea4aaf2ba801f9633cd339726e242edbcb809095ce491fcc81ee33e04af2e60e9e60
7
+ data.tar.gz: f7804e9082e2a065cea8099395e2fd8d29bae7df56cdc36bbc2a71a5d449f61e4e7d713567a7183bd5a33e9a89e779392f51ccb811eff0d3ac7ce4353af882ca
data/Gemfile CHANGED
@@ -11,16 +11,20 @@ group :development do
11
11
  gem "bundler", "~> 1.2"
12
12
  gem "jeweler", "~> 1.8.4"
13
13
  #gem "rcov", ">= 0"
14
+
15
+ gem 'guard'
16
+ gem 'guard-rspec'
17
+ gem 'guard-spork'
18
+
19
+ gem 'lre'
14
20
  end
15
21
 
16
- gem 'guard'
17
- gem 'guard-rspec'
18
- gem 'guard-spork'
22
+
19
23
 
20
24
  gem 'mharris_ext'
21
25
  gem 'treetop'
22
26
 
23
- gem 'lre'
27
+
24
28
  gem 'roo'
25
29
 
26
30
  gem 'rb-fsevent', '~> 0.9.1'
@@ -1,71 +1,125 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activemodel (3.2.12)
5
- activesupport (= 3.2.12)
6
- builder (~> 3.0.0)
7
- activesupport (3.2.12)
8
- i18n (~> 0.6)
9
- multi_json (~> 1.0)
10
- builder (3.0.4)
11
- childprocess (0.3.7)
12
- ffi (~> 1.0, >= 1.0.6)
13
- coderay (1.0.8)
4
+ activemodel (4.2.0)
5
+ activesupport (= 4.2.0)
6
+ builder (~> 3.1)
7
+ activesupport (4.2.0)
8
+ i18n (~> 0.7)
9
+ json (~> 1.7, >= 1.7.7)
10
+ minitest (~> 5.1)
11
+ thread_safe (~> 0.3, >= 0.3.4)
12
+ tzinfo (~> 1.1)
13
+ addressable (2.3.6)
14
+ bson (2.3.0)
15
+ builder (3.2.2)
16
+ celluloid (0.16.0)
17
+ timers (~> 4.0.0)
18
+ childprocess (0.5.5)
19
+ ffi (~> 1.0, >= 1.0.11)
20
+ coderay (1.1.0)
21
+ connection_pool (2.1.0)
14
22
  diff-lcs (1.1.3)
15
- facets (2.9.3)
16
- fattr (2.2.1)
17
- ffi (1.3.1)
18
- git (1.2.5)
19
- guard (1.6.2)
20
- listen (>= 0.6.0)
21
- lumberjack (>= 1.0.2)
22
- pry (>= 0.9.10)
23
- terminal-table (>= 1.4.3)
24
- thor (>= 0.14.6)
23
+ facets (3.0.0)
24
+ faraday (0.8.9)
25
+ multipart-post (~> 1.2.0)
26
+ fattr (2.2.2)
27
+ ffi (1.9.6)
28
+ formatador (0.2.5)
29
+ git (1.2.9.1)
30
+ github_api (0.10.1)
31
+ addressable
32
+ faraday (~> 0.8.1)
33
+ hashie (>= 1.2)
34
+ multi_json (~> 1.4)
35
+ nokogiri (~> 1.5.2)
36
+ oauth2
37
+ guard (2.11.1)
38
+ formatador (>= 0.2.4)
39
+ listen (~> 2.7)
40
+ lumberjack (~> 1.0)
41
+ nenv (~> 0.1)
42
+ notiffany (~> 0.0)
43
+ pry (>= 0.9.12)
44
+ shellany (~> 0.0)
45
+ thor (>= 0.18.1)
46
+ guard-compat (1.2.1)
25
47
  guard-rspec (1.2.1)
26
48
  guard (>= 1.1)
27
- guard-spork (1.4.2)
49
+ guard-spork (2.1.0)
28
50
  childprocess (>= 0.2.3)
29
- guard (>= 1.1)
51
+ guard (~> 2.0)
52
+ guard-compat (~> 1.0)
30
53
  spork (>= 0.8.4)
31
- i18n (0.6.1)
32
- jeweler (1.8.4)
54
+ hashie (3.3.2)
55
+ highline (1.6.21)
56
+ hitimes (1.2.2)
57
+ i18n (0.7.0)
58
+ jeweler (1.8.5)
59
+ builder
33
60
  bundler (~> 1.0)
34
61
  git (>= 1.2.5)
62
+ github_api (>= 0.8.1)
63
+ highline (>= 1.6.15)
64
+ nokogiri (= 1.5.10)
35
65
  rake
36
66
  rdoc
37
- json (1.7.7)
38
- listen (0.7.2)
39
- lre (0.3.0)
67
+ json (1.8.2)
68
+ jwt (1.2.0)
69
+ listen (2.8.5)
70
+ celluloid (>= 0.15.2)
71
+ rb-fsevent (>= 0.9.3)
72
+ rb-inotify (>= 0.9)
73
+ lre (0.3.1)
40
74
  fattr
41
75
  mharris_ext
42
76
  watchr
43
- lumberjack (1.0.2)
44
- method_source (0.8.1)
45
- mharris_ext (1.6.0)
77
+ lumberjack (1.0.9)
78
+ method_source (0.8.2)
79
+ mharris_ext (1.7.1)
46
80
  facets
47
81
  fattr
48
- mongoid (3.0.14)
49
- activemodel (~> 3.1)
50
- moped (~> 1.1)
51
- origin (~> 1.0)
52
- tzinfo (~> 0.3.22)
53
- moped (1.3.1)
54
- multi_json (1.6.0)
55
- nokogiri (1.5.6)
56
- origin (1.0.11)
57
- polyglot (0.3.3)
58
- pry (0.9.11.4)
59
- coderay (~> 1.0.5)
60
- method_source (~> 0.8)
82
+ minitest (5.5.1)
83
+ mongoid (4.0.0)
84
+ activemodel (~> 4.0)
85
+ moped (~> 2.0.0)
86
+ origin (~> 2.1)
87
+ tzinfo (>= 0.3.37)
88
+ moped (2.0.3)
89
+ bson (~> 2.2)
90
+ connection_pool (~> 2.0)
91
+ optionable (~> 0.2.0)
92
+ multi_json (1.10.1)
93
+ multi_xml (0.5.5)
94
+ multipart-post (1.2.0)
95
+ nenv (0.1.1)
96
+ nokogiri (1.5.10)
97
+ notiffany (0.0.3)
98
+ nenv (~> 0.1)
99
+ shellany (~> 0.0)
100
+ oauth2 (1.0.0)
101
+ faraday (>= 0.8, < 0.10)
102
+ jwt (~> 1.0)
103
+ multi_json (~> 1.3)
104
+ multi_xml (~> 0.5)
105
+ rack (~> 1.2)
106
+ optionable (0.2.0)
107
+ origin (2.1.1)
108
+ polyglot (0.3.5)
109
+ pry (0.10.1)
110
+ coderay (~> 1.1.0)
111
+ method_source (~> 0.8.1)
61
112
  slop (~> 3.4)
62
- rake (10.0.3)
63
- rb-fsevent (0.9.1)
64
- rdoc (3.12.1)
113
+ rack (1.6.0)
114
+ rake (10.4.2)
115
+ rb-fsevent (0.9.4)
116
+ rb-inotify (0.9.5)
117
+ ffi (>= 0.5.0)
118
+ rdoc (3.12.2)
65
119
  json (~> 1.4)
66
- roo (1.10.2)
67
- nokogiri (>= 1.5.6)
68
- rubyzip (>= 0.9.9)
120
+ roo (1.13.2)
121
+ nokogiri
122
+ rubyzip
69
123
  spreadsheet (> 0.6.4)
70
124
  rspec (2.8.0)
71
125
  rspec-core (~> 2.8.0)
@@ -75,18 +129,21 @@ GEM
75
129
  rspec-expectations (2.8.0)
76
130
  diff-lcs (~> 1.1.2)
77
131
  rspec-mocks (2.8.0)
78
- ruby-ole (1.2.11.6)
79
- rubyzip (0.9.9)
80
- slop (3.4.3)
132
+ ruby-ole (1.2.11.8)
133
+ rubyzip (1.1.6)
134
+ shellany (0.0.1)
135
+ slop (3.6.0)
81
136
  spork (0.9.2)
82
- spreadsheet (0.7.9)
137
+ spreadsheet (1.0.0)
83
138
  ruby-ole (>= 1.0)
84
- terminal-table (1.4.5)
85
- thor (0.17.0)
86
- treetop (1.4.12)
87
- polyglot
88
- polyglot (>= 0.3.1)
89
- tzinfo (0.3.35)
139
+ thor (0.19.1)
140
+ thread_safe (0.3.4)
141
+ timers (4.0.1)
142
+ hitimes
143
+ treetop (1.5.3)
144
+ polyglot (~> 0.3)
145
+ tzinfo (1.2.2)
146
+ thread_safe (~> 0.1)
90
147
  watchr (0.7)
91
148
 
92
149
  PLATFORMS
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.3
@@ -2,14 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: extract 0.1.3 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "extract"
8
- s.version = "0.1.1"
9
+ s.version = "0.1.3"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
11
13
  s.authors = ["Mike Harris"]
12
- s.date = "2013-02-21"
14
+ s.date = "2015-01-15"
13
15
  s.description = "extract"
14
16
  s.email = "mharris717@gmail.com"
15
17
  s.extra_rdoc_files = [
@@ -29,8 +31,12 @@ Gem::Specification.new do |s|
29
31
  "VERSION",
30
32
  "extract.gemspec",
31
33
  "lib/extract.rb",
34
+ "lib/extract/cell.rb",
32
35
  "lib/extract/excel_formulas.rb",
36
+ "lib/extract/export/ddl.rb",
37
+ "lib/extract/export/table.rb",
33
38
  "lib/extract/formula.treetop",
39
+ "lib/extract/inline_def.rb",
34
40
  "lib/extract/math.treetop",
35
41
  "lib/extract/math_calc.rb",
36
42
  "lib/extract/parser.rb",
@@ -38,6 +44,8 @@ Gem::Specification.new do |s|
38
44
  "lib/extract/sheet.rb",
39
45
  "lib/extract/sheet_comp.rb",
40
46
  "lib/extract/sheet_definition.rb",
47
+ "lib/extract/table.rb",
48
+ "lib/extract/tables.rb",
41
49
  "lib/extract/tree/base.rb",
42
50
  "lib/extract/tree/cell.rb",
43
51
  "lib/extract/tree/cond_exp.rb",
@@ -50,15 +58,20 @@ Gem::Specification.new do |s|
50
58
  "lib/extract/tree/string.rb",
51
59
  "samples/baseball.xlsx",
52
60
  "samples/div.xlsx",
61
+ "samples/salescalls.xlsx",
62
+ "spec/cell_spec.rb",
53
63
  "spec/config/mongoid.yml",
54
64
  "spec/deps_spec.rb",
65
+ "spec/export/table_spec.rb",
55
66
  "spec/extract_spec.rb",
67
+ "spec/inline_def_spec.rb",
56
68
  "spec/math_spec.rb",
57
69
  "spec/parser_spec.rb",
58
70
  "spec/persist_spec.rb",
59
71
  "spec/sheet_definition_spec.rb",
60
72
  "spec/sheet_spec.rb",
61
73
  "spec/spec_helper.rb",
74
+ "spec/table_spec.rb",
62
75
  "vol/excel_test.rb",
63
76
  "vol/parse_test.rb",
64
77
  "vol/scratch.rb",
@@ -73,20 +86,15 @@ Gem::Specification.new do |s|
73
86
  ]
74
87
  s.homepage = "http://github.com/mharris717/extract"
75
88
  s.licenses = ["MIT"]
76
- s.require_paths = ["lib"]
77
- s.rubygems_version = "1.8.23"
89
+ s.rubygems_version = "2.2.2"
78
90
  s.summary = "extract"
79
91
 
80
92
  if s.respond_to? :specification_version then
81
- s.specification_version = 3
93
+ s.specification_version = 4
82
94
 
83
95
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
84
- s.add_runtime_dependency(%q<guard>, [">= 0"])
85
- s.add_runtime_dependency(%q<guard-rspec>, [">= 0"])
86
- s.add_runtime_dependency(%q<guard-spork>, [">= 0"])
87
96
  s.add_runtime_dependency(%q<mharris_ext>, [">= 0"])
88
97
  s.add_runtime_dependency(%q<treetop>, [">= 0"])
89
- s.add_runtime_dependency(%q<lre>, [">= 0"])
90
98
  s.add_runtime_dependency(%q<roo>, [">= 0"])
91
99
  s.add_runtime_dependency(%q<rb-fsevent>, ["~> 0.9.1"])
92
100
  s.add_runtime_dependency(%q<mongoid>, [">= 0"])
@@ -94,13 +102,13 @@ Gem::Specification.new do |s|
94
102
  s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
95
103
  s.add_development_dependency(%q<bundler>, ["~> 1.2"])
96
104
  s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
105
+ s.add_development_dependency(%q<guard>, [">= 0"])
106
+ s.add_development_dependency(%q<guard-rspec>, [">= 0"])
107
+ s.add_development_dependency(%q<guard-spork>, [">= 0"])
108
+ s.add_development_dependency(%q<lre>, [">= 0"])
97
109
  else
98
- s.add_dependency(%q<guard>, [">= 0"])
99
- s.add_dependency(%q<guard-rspec>, [">= 0"])
100
- s.add_dependency(%q<guard-spork>, [">= 0"])
101
110
  s.add_dependency(%q<mharris_ext>, [">= 0"])
102
111
  s.add_dependency(%q<treetop>, [">= 0"])
103
- s.add_dependency(%q<lre>, [">= 0"])
104
112
  s.add_dependency(%q<roo>, [">= 0"])
105
113
  s.add_dependency(%q<rb-fsevent>, ["~> 0.9.1"])
106
114
  s.add_dependency(%q<mongoid>, [">= 0"])
@@ -108,14 +116,14 @@ Gem::Specification.new do |s|
108
116
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
109
117
  s.add_dependency(%q<bundler>, ["~> 1.2"])
110
118
  s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
119
+ s.add_dependency(%q<guard>, [">= 0"])
120
+ s.add_dependency(%q<guard-rspec>, [">= 0"])
121
+ s.add_dependency(%q<guard-spork>, [">= 0"])
122
+ s.add_dependency(%q<lre>, [">= 0"])
111
123
  end
112
124
  else
113
- s.add_dependency(%q<guard>, [">= 0"])
114
- s.add_dependency(%q<guard-rspec>, [">= 0"])
115
- s.add_dependency(%q<guard-spork>, [">= 0"])
116
125
  s.add_dependency(%q<mharris_ext>, [">= 0"])
117
126
  s.add_dependency(%q<treetop>, [">= 0"])
118
- s.add_dependency(%q<lre>, [">= 0"])
119
127
  s.add_dependency(%q<roo>, [">= 0"])
120
128
  s.add_dependency(%q<rb-fsevent>, ["~> 0.9.1"])
121
129
  s.add_dependency(%q<mongoid>, [">= 0"])
@@ -123,6 +131,10 @@ Gem::Specification.new do |s|
123
131
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
124
132
  s.add_dependency(%q<bundler>, ["~> 1.2"])
125
133
  s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
134
+ s.add_dependency(%q<guard>, [">= 0"])
135
+ s.add_dependency(%q<guard-rspec>, [">= 0"])
136
+ s.add_dependency(%q<guard-spork>, [">= 0"])
137
+ s.add_dependency(%q<lre>, [">= 0"])
126
138
  end
127
139
  end
128
140
 
@@ -26,14 +26,40 @@ class Numeric
26
26
  end
27
27
  end
28
28
 
29
- %w(parser sheet excel_formulas math_calc sheet_definition).each do |f|
30
- load File.expand_path(File.dirname(__FILE__)) + "/extract/#{f}.rb"
31
- end
29
+ module Extract
30
+ class << self
31
+ def load!
32
+ %w(parser sheet excel_formulas math_calc sheet_definition cell inline_def table tables).each do |f|
33
+ load File.expand_path(File.dirname(__FILE__)) + "/extract/#{f}.rb"
34
+ end
35
+
36
+ %w(base range cond_exp formula formula_args math num cell operator string).each do |f|
37
+ load File.expand_path(File.dirname(__FILE__)) + "/extract/tree/#{f}.rb"
38
+ end
39
+
40
+ %w(sheet).each do |f|
41
+ load File.expand_path(File.dirname(__FILE__)) + "/extract/persist/#{f}.rb"
42
+ end
32
43
 
33
- %w(base range cond_exp formula formula_args math num cell operator string).each do |f|
34
- load File.expand_path(File.dirname(__FILE__)) + "/extract/tree/#{f}.rb"
44
+ %w(ddl table).each do |f|
45
+ load File.expand_path(File.dirname(__FILE__)) + "/extract/export/#{f}.rb"
46
+ end
47
+ end
48
+ end
35
49
  end
36
50
 
37
- %w(sheet).each do |f|
38
- load File.expand_path(File.dirname(__FILE__)) + "/extract/persist/#{f}.rb"
51
+ Extract.load!
52
+
53
+ module Extract
54
+ class << self
55
+ def expand_cells(*arr)
56
+ arr.flatten.map do |c|
57
+ if c =~ /:/
58
+ Extract::Tree::Range.cells_in_range(c)
59
+ else
60
+ c
61
+ end
62
+ end.flatten
63
+ end
64
+ end
39
65
  end
@@ -0,0 +1,34 @@
1
+ module Extract
2
+ class Cell
3
+ include FromHash
4
+ attr_accessor :sheet_def, :cell
5
+
6
+ def value
7
+ raise "no sheet def" unless sheet_def
8
+ sheet_def[cell]
9
+ end
10
+
11
+ def deps
12
+ sheet_def.deps(cell)
13
+ end
14
+
15
+ def raw_value
16
+ sheet_def.raw_value(cell)
17
+ end
18
+
19
+ def name
20
+ sheet_def.cell_names[cell]
21
+ end
22
+
23
+ def rc
24
+ raise "foo" unless cell =~ /^([A-Z]+)([0-9]+)$/
25
+ [$1,$2]
26
+ end
27
+ def row
28
+ rc[1].to_i
29
+ end
30
+ def col
31
+ rc[0]
32
+ end
33
+ end
34
+ end