svggvs 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,12 +2,12 @@ require 'roo'
2
2
 
3
3
  module SVGGVS
4
4
  class DataSource
5
- def initialize(file)
6
- @file = file
5
+ def initialize(file, options = {})
6
+ @file, @options = [ file, options ].flatten.compact
7
7
  end
8
8
 
9
9
  def doc
10
- @doc ||= Roo::Spreadsheet.open(@file)
10
+ @doc ||= Roo::Spreadsheet.open(@file, @options)
11
11
  end
12
12
 
13
13
  def settings
@@ -24,9 +24,9 @@ module SVGGVS
24
24
  settings
25
25
  end
26
26
 
27
- def each_card
27
+ def each_card(card_sheet_identifier)
28
28
  doc.each_with_pagename do |name, sheet|
29
- if name['Card Data']
29
+ if name[card_sheet_identifier]
30
30
  headers = sheet.row(1)
31
31
 
32
32
  (sheet.first_row + 1).upto(sheet.last_row) do |index|
@@ -3,9 +3,11 @@ module SVGGVS
3
3
  attr_accessor :svg_source, :svg_merged_target, :individual_files_path, :on_card_finished
4
4
  attr_accessor :png_files_path, :png_export_width, :pdf_card_size, :pdf_dpi
5
5
  attr_accessor :pdf_target, :card_back, :card_size, :target, :post_read_data
6
+ attr_accessor :card_sheet_identifier
6
7
 
7
8
  def initialize
8
9
  @index = 0
10
+ @card_sheet_identifier = "Card Data"
9
11
  end
10
12
 
11
13
  def configure
@@ -58,7 +60,7 @@ module SVGGVS
58
60
  settings_from_hash(data_source.settings)
59
61
 
60
62
  @process = proc do
61
- data_source.each_card do |card|
63
+ data_source.each_card(card_sheet_identifier) do |card|
62
64
  if !!@post_read_data
63
65
  @post_read_data.call(card)
64
66
  end
@@ -1,3 +1,3 @@
1
1
  module SVGGVS
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svggvs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-29 00:00:00.000000000 Z
12
+ date: 2014-03-01 00:00:00.000000000 -05:00
13
+ default_executable:
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: nokogiri
16
- requirement: !ruby/object:Gem::Requirement
17
+ requirement: &85515200 !ruby/object:Gem::Requirement
17
18
  none: false
18
19
  requirements:
19
20
  - - ! '>='
@@ -21,15 +22,10 @@ dependencies:
21
22
  version: '0'
22
23
  type: :runtime
23
24
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
25
+ version_requirements: *85515200
30
26
  - !ruby/object:Gem::Dependency
31
27
  name: thor
32
- requirement: !ruby/object:Gem::Requirement
28
+ requirement: &85514990 !ruby/object:Gem::Requirement
33
29
  none: false
34
30
  requirements:
35
31
  - - ! '>='
@@ -37,15 +33,10 @@ dependencies:
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
36
+ version_requirements: *85514990
46
37
  - !ruby/object:Gem::Dependency
47
38
  name: parallel
48
- requirement: !ruby/object:Gem::Requirement
39
+ requirement: &85514780 !ruby/object:Gem::Requirement
49
40
  none: false
50
41
  requirements:
51
42
  - - ! '>='
@@ -53,15 +44,10 @@ dependencies:
53
44
  version: '0'
54
45
  type: :runtime
55
46
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
47
+ version_requirements: *85514780
62
48
  - !ruby/object:Gem::Dependency
63
49
  name: roo
64
- requirement: !ruby/object:Gem::Requirement
50
+ requirement: &85514570 !ruby/object:Gem::Requirement
65
51
  none: false
66
52
  requirements:
67
53
  - - ! '>='
@@ -69,15 +55,10 @@ dependencies:
69
55
  version: '0'
70
56
  type: :runtime
71
57
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
58
+ version_requirements: *85514570
78
59
  - !ruby/object:Gem::Dependency
79
60
  name: activesupport
80
- requirement: !ruby/object:Gem::Requirement
61
+ requirement: &85514360 !ruby/object:Gem::Requirement
81
62
  none: false
82
63
  requirements:
83
64
  - - ! '>='
@@ -85,12 +66,7 @@ dependencies:
85
66
  version: '0'
86
67
  type: :runtime
87
68
  prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ! '>='
92
- - !ruby/object:Gem::Version
93
- version: '0'
69
+ version_requirements: *85514360
94
70
  description: Generate sets of card game cards using Inkscape templates and Ruby
95
71
  email:
96
72
  - john@coswellproductions.com
@@ -119,6 +95,7 @@ files:
119
95
  - skel/images/dog.png.jpg
120
96
  - skel/template.svg
121
97
  - svggvs.gemspec
98
+ has_rdoc: true
122
99
  homepage: ''
123
100
  licenses: []
124
101
  post_install_message:
@@ -139,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
116
  version: '0'
140
117
  requirements: []
141
118
  rubyforge_project:
142
- rubygems_version: 1.8.25
119
+ rubygems_version: 1.6.2
143
120
  signing_key:
144
121
  specification_version: 3
145
122
  summary: Generate sets of card game cards using Inkscape templates and Ruby