dot_grid 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +0 -2
- data/README.md +19 -7
- data/bin/dotgrid +5 -20
- data/dot_grid.gemspec +0 -1
- data/lib/dot_grid/cli.rb +23 -0
- data/lib/dot_grid/version.rb +1 -1
- data/lib/dot_grid.rb +1 -0
- data/spec/lib/dot_grid/cli_spec.rb +28 -0
- metadata +5 -17
- data/base +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5357769bf237ae74776982ba521b37a44442302
|
4
|
+
data.tar.gz: c8072fa7ed15de141c851089cf5518f179c0bbe2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e7885d565a62a20adc9842aca4768294c5808d80f4c762996a44e2fc728fe7bec4f657aa4384810a3a459ea9d0e832a4754da5d9d772550f2bf7628a9c9f19a
|
7
|
+
data.tar.gz: d5250a1bdecfa52f82e504e146708ced242df9dc83a6ef3b8edf884936651c0bbe85c8c0a34c36554a22828643ec4fa3dead31cd02019a456c2300ece1f762bc
|
data/Gemfile.lock
CHANGED
@@ -3,7 +3,6 @@ PATH
|
|
3
3
|
specs:
|
4
4
|
dot_grid (0.0.7)
|
5
5
|
prawn (~> 1.1.0)
|
6
|
-
require_all (~> 1.3.2)
|
7
6
|
trollop (~> 2.0)
|
8
7
|
|
9
8
|
GEM
|
@@ -24,7 +23,6 @@ GEM
|
|
24
23
|
pdf-core (~> 0.2.5)
|
25
24
|
ttfunk (~> 1.2.0)
|
26
25
|
rake (10.3.2)
|
27
|
-
require_all (1.3.2)
|
28
26
|
rest-client (1.6.7)
|
29
27
|
mime-types (>= 1.16)
|
30
28
|
rspec (2.14.1)
|
data/README.md
CHANGED
@@ -13,19 +13,31 @@ A simple ruby file for generating dot grid graph paper.
|
|
13
13
|
|
14
14
|
## CLI
|
15
15
|
|
16
|
-
A basic dot grid page can be generated like this ...
|
16
|
+
### A basic dot grid page can be generated like this ...
|
17
|
+
dotgrid -f dot_grid.pdf --page-types dot-grid --spacing 5 --grid-color CFBAEC --dot-weight 0.5 -m 0.0
|
17
18
|
|
18
|
-
|
19
|
+
### A basic planning page can be generated like this ...
|
20
|
+
dotgrid -f planner_w5_c2dfff.pdf --page-types planner --grid-color CFBAEC --dot-weight 0.5 -m 0.0 --planner-color-1 dddddd --planner-color-2 C2DFFF
|
19
21
|
|
20
|
-
A
|
22
|
+
### A regular grid page
|
23
|
+
dotgrid -f grid_c2dfff.pdf --page-types grid --spacing 5 --grid-color CFBAEC --margin 0.0
|
21
24
|
|
22
|
-
|
25
|
+
### A horizontal rule page
|
26
|
+
dotgrid -f horizontal_rule_c2dfff.pdf --page-types horizontal-rule --spacing 5 --grid-color CFBAEC --margin 0.0
|
23
27
|
|
24
|
-
|
25
|
-
|
28
|
+
### A checkerboard page
|
29
|
+
dotgrid -f checkerboard_c2dfff.pdf --page-types checkerboard --spacing 5 --grid-color CFBAEC --margin 0.0
|
26
30
|
|
31
|
+
### Multiple page types (either with no spaces after commas or in quotes).
|
32
|
+
dotgrid -f page_types.pdf --page-types "planner, checkerboard, grid, dot_grid" --spacing 5 --grid-color CFBAEC --margin 0.0
|
27
33
|
|
28
|
-
|
34
|
+
### All of the pages at once ...
|
35
|
+
dotgrid -f page_types.pdf --page-types "planner, checkerboard, grid, dot_grid, horizontal_rule" --spacing 5 --grid-color CFBAEC -m 0.0
|
36
|
+
|
37
|
+
### To get help on the command and its options ...
|
38
|
+
dotgrid --help
|
39
|
+
|
40
|
+
### The options and their defaults are ...
|
29
41
|
|
30
42
|
<table>
|
31
43
|
<thead>
|
data/bin/dotgrid
CHANGED
@@ -1,24 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
lib = File.expand_path(File.dirname(__FILE__) + '/../lib')
|
4
|
+
$LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
|
5
5
|
|
6
|
-
|
7
|
-
require '
|
8
|
-
require 'trollop'
|
9
|
-
require_all 'lib'
|
6
|
+
require 'dot_grid'
|
7
|
+
require 'dot_grid/cli'
|
10
8
|
|
11
|
-
|
12
|
-
opt :file_name, "File Name", :type => :string, :default => "dotgrid.pdf"
|
13
|
-
opt :orientation, "Orientation of pages (portrait/landscape)", type: :string, default: "portrait"
|
14
|
-
opt :page_types, "Types of pages desired: Types of pages desired: DotGrid, Planner, Grid, HorizontalRule, Checkerboard", type: :string, default: "Planner"
|
15
|
-
opt :dot_weight, "Dot Weight", :type => :float, :default => 1.5
|
16
|
-
opt :margin, "Border", :type => :float, :default => 0.0
|
17
|
-
opt :page_size, "Page Size (LEGAL, LETTER)", :type => :string, :default => "LETTER"
|
18
|
-
opt :grid_color, "Grid Color (RGB)", :type => :string, :default => "B3B3B3"
|
19
|
-
opt :spacing, "Dot Spacing (mm)", :type => :integer, :default => 5
|
20
|
-
opt :planner_color_1, "Planner Left and Footer color", type: :string, default: "CCCCCC"
|
21
|
-
opt :planner_color_2, "Planner Right color", type: :string, default: "0099ff"
|
22
|
-
end
|
23
|
-
|
24
|
-
dot_grid_generator = DotGrid::Generator.new(opts).generate
|
9
|
+
DotGrid::CLI.execute(ARGV)
|
data/dot_grid.gemspec
CHANGED
data/lib/dot_grid/cli.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'trollop'
|
2
|
+
|
3
|
+
module DotGrid
|
4
|
+
class CLI
|
5
|
+
def self.execute(argv)
|
6
|
+
|
7
|
+
opts = Trollop::options argv do
|
8
|
+
opt :file_name, "File Name", :type => :string, :default => "dotgrid.pdf"
|
9
|
+
opt :orientation, "Orientation of pages (portrait/landscape)", type: :string, default: "portrait"
|
10
|
+
opt :page_types, "Types of pages desired: Types of pages desired: DotGrid, Planner, Grid, HorizontalRule, Checkerboard", type: :string, default: "Planner"
|
11
|
+
opt :dot_weight, "Dot Weight", :type => :float, :default => 1.5
|
12
|
+
opt :margin, "Border", :type => :float, :default => 0.0
|
13
|
+
opt :page_size, "Page Size (LEGAL, LETTER)", :type => :string, :default => "LETTER"
|
14
|
+
opt :grid_color, "Grid Color (RGB)", :type => :string, :default => "B3B3B3"
|
15
|
+
opt :spacing, "Dot Spacing (mm)", :type => :integer, :default => 5
|
16
|
+
opt :planner_color_1, "Planner Left and Footer color", type: :string, default: "CCCCCC"
|
17
|
+
opt :planner_color_2, "Planner Right color", type: :string, default: "0099ff"
|
18
|
+
end
|
19
|
+
|
20
|
+
DotGrid::Generator.new(opts).generate
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/dot_grid/version.rb
CHANGED
data/lib/dot_grid.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "DotGrid::CLI" do
|
4
|
+
describe ".execute" do
|
5
|
+
let(:argv) { [] }
|
6
|
+
let(:generator) { double('generator') }
|
7
|
+
|
8
|
+
before do
|
9
|
+
allow(DotGrid::Generator).to receive(:new).and_return(generator)
|
10
|
+
allow(generator).to receive(:generate)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "uses trollop to process the options" do
|
14
|
+
expect(Trollop).to receive(:options).with(argv)
|
15
|
+
DotGrid::CLI.execute(argv)
|
16
|
+
end
|
17
|
+
|
18
|
+
it "creates a new generator" do
|
19
|
+
expect(DotGrid::Generator).to receive(:new).and_return(generator)
|
20
|
+
DotGrid::CLI.execute([])
|
21
|
+
end
|
22
|
+
|
23
|
+
it "calls generate on the generator" do
|
24
|
+
expect(generator).to receive(:generate)
|
25
|
+
DotGrid::CLI.execute([])
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dot_grid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott LaBounty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '2.0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: require_all
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ~>
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 1.3.2
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ~>
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: 1.3.2
|
97
83
|
description: Dot Grid planner PDF generator.
|
98
84
|
email:
|
99
85
|
- slabounty@gmail.com
|
@@ -111,11 +97,11 @@ files:
|
|
111
97
|
- LICENSE
|
112
98
|
- README.md
|
113
99
|
- Rakefile
|
114
|
-
- base
|
115
100
|
- bin/dotgrid
|
116
101
|
- dot_grid.gemspec
|
117
102
|
- lib/dot_grid.rb
|
118
103
|
- lib/dot_grid/bounding_box.rb
|
104
|
+
- lib/dot_grid/cli.rb
|
119
105
|
- lib/dot_grid/document.rb
|
120
106
|
- lib/dot_grid/generator.rb
|
121
107
|
- lib/dot_grid/page/checkerboard.rb
|
@@ -132,6 +118,7 @@ files:
|
|
132
118
|
- lib/dot_grid/pattern/pattern.rb
|
133
119
|
- lib/dot_grid/pattern/square_grid.rb
|
134
120
|
- lib/dot_grid/version.rb
|
121
|
+
- spec/lib/dot_grid/cli_spec.rb
|
135
122
|
- spec/lib/dot_grid/document_spec.rb
|
136
123
|
- spec/lib/dot_grid/generator_spec.rb
|
137
124
|
- spec/lib/dot_grid/page/checkerboard_spec.rb
|
@@ -172,6 +159,7 @@ signing_key:
|
|
172
159
|
specification_version: 4
|
173
160
|
summary: Dot Grid planner PDF generator.
|
174
161
|
test_files:
|
162
|
+
- spec/lib/dot_grid/cli_spec.rb
|
175
163
|
- spec/lib/dot_grid/document_spec.rb
|
176
164
|
- spec/lib/dot_grid/generator_spec.rb
|
177
165
|
- spec/lib/dot_grid/page/checkerboard_spec.rb
|
data/base
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# Base planner
|
2
|
-
bin/dotgrid -f planner_w5_c2dfff.pdf --page-types planner --grid-color CFBAEC --dot-weight 0.5 --margin 0.0 --planner-color-1 dddddd --planner-color-2 C2DFFF
|
3
|
-
bin/dotgrid -f planner_w75_c2dfff.pdf --page-types planner --grid-color CFBAEC --dot-weight 0.75 --margin 0.0 --planner-color-1 dddddd --planner-color-2 C2DFFF
|
4
|
-
|
5
|
-
# Dot grid
|
6
|
-
bin/dotgrid -f dot_grid_c2dfff.pdf --page-types dot_grid --spacing 5 --grid-color CFBAEC --margin 0.0
|
7
|
-
|
8
|
-
# Regular grid
|
9
|
-
bin/dotgrid -f grid_c2dfff.pdf --page-types grid --spacing 5 --grid-color CFBAEC --margin 0.0
|
10
|
-
|
11
|
-
# Horizontal rule
|
12
|
-
bin/dotgrid -f horizontal_rule_c2dfff.pdf --page-types horizontal-rule --spacing 5 --grid-color CFBAEC --margin 0.0
|
13
|
-
|
14
|
-
# Checkerboard
|
15
|
-
bin/dotgrid -f checkerboard_c2dfff.pdf --page-types checkerboard --spacing 5 --grid-color CFBAEC --margin 0.0
|
16
|
-
|
17
|
-
# Page Types (either with no spaces after commas or in quotes).
|
18
|
-
bin/dotgrid -f page_types.pdf --page-types "planner, checkerboard, grid, dot_grid" --spacing 5 --grid-color CFBAEC --margin 0.0
|
19
|
-
|
20
|
-
# Everything all at once ...
|
21
|
-
bin/dotgrid -f page_types.pdf --page-types "planner, checkerboard, grid, dot_grid, horizontal_rule" --spacing 5 --grid-color CFBAEC -m 0.0
|