cheapredwine 0.3.1 → 0.4.0
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.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/.travis.yml +0 -6
- data/README.md +18 -23
- data/cheapredwine.gemspec +3 -3
- data/lib/cheapredwine.rb +21 -42
- data/lib/cheapredwine/command.rb +2 -0
- data/lib/cheapredwine/command/builder.rb +69 -0
- data/lib/cheapredwine/command/node.rb +19 -0
- data/lib/cheapredwine/command/nodes.rb +29 -0
- data/lib/cheapredwine/command/runner.rb +29 -0
- data/lib/cheapredwine/{info.rb → parser.rb} +4 -4
- data/lib/cheapredwine/version.rb +2 -2
- data/spec/cheapredwine/command/builder_spec.rb +39 -0
- data/spec/cheapredwine/command/runner_spec.rb +36 -0
- data/spec/{info_spec.rb → cheapredwine/parser_spec.rb} +3 -3
- data/spec/cheapredwine_spec.rb +21 -11
- data/spec/spec_helper.rb +1 -0
- metadata +21 -30
- data/lib/cheapredwine/image.rb +0 -2
- data/lib/cheapredwine/image/params.rb +0 -16
- data/lib/cheapredwine/image/writer.rb +0 -44
- data/spec/fixtures/extractor/hobo.otf +0 -0
- data/spec/fixtures/lato-regular.ttf +0 -0
- data/spec/fixtures/parser/features.ttx +0 -129
- data/spec/fixtures/parser/hobo.ttx +0 -8195
- data/spec/fixtures/parser/lato-regular.ttx +0 -43112
- data/spec/fixtures/test.png +0 -0
- data/spec/image/params_spec.rb +0 -22
- data/spec/image/writer_spec.rb +0 -20
data/spec/fixtures/test.png
DELETED
Binary file
|
data/spec/image/params_spec.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'cheapredwine/image/params'
|
2
|
-
|
3
|
-
describe CheapRedWine::Image::Params do
|
4
|
-
it "takes a bunch of options" do
|
5
|
-
font = double
|
6
|
-
features = ['kern', 'aalt', 'onum', 'liga']
|
7
|
-
|
8
|
-
params = CheapRedWine::Image::Params.new(
|
9
|
-
font: font,
|
10
|
-
color: 'black',
|
11
|
-
features: features,
|
12
|
-
text: 'Lorem ipsum',
|
13
|
-
size: 26
|
14
|
-
)
|
15
|
-
|
16
|
-
params.font.should eq font
|
17
|
-
params.color.should eq 'black'
|
18
|
-
params.features.should eq features
|
19
|
-
params.text.should eq 'Lorem ipsum'
|
20
|
-
params.size.should eq 26
|
21
|
-
end
|
22
|
-
end
|
data/spec/image/writer_spec.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'cheapredwine/image/writer'
|
2
|
-
require 'cheapredwine/image/params'
|
3
|
-
|
4
|
-
describe CheapRedWine::Image::Writer do
|
5
|
-
let(:font) { double("font", path: "spec/fixtures/lato-regular.ttf") }
|
6
|
-
let(:image) { CheapRedWine::Image::Params.new(font: font, text: "Lorem ipsum") }
|
7
|
-
|
8
|
-
it "builds a command from a Params object" do
|
9
|
-
writer = CheapRedWine::Image::Writer.new(image)
|
10
|
-
writer.args[0].should eq "--font-file=spec/fixtures/lato-regular.ttf"
|
11
|
-
end
|
12
|
-
|
13
|
-
it "generates a image of given text" do
|
14
|
-
file = File.new('spec/fixtures/test.png')
|
15
|
-
|
16
|
-
writer = CheapRedWine::Image::Writer.new(image)
|
17
|
-
tempfile = writer.exec
|
18
|
-
FileUtils.compare_file(tempfile, file)
|
19
|
-
end
|
20
|
-
end
|