piet-binary 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +4 -0
- data/README.md +65 -0
- data/Rakefile +2 -0
- data/bin/linux/x64/jpegoptim +0 -0
- data/bin/linux/x64/optipng +0 -0
- data/bin/linux/x64/pngquant +0 -0
- data/bin/linux/x86/optipng +0 -0
- data/bin/osx/optipng +0 -0
- data/bin/win32/libjpeg-62.dll +0 -0
- data/bin/win32/optipng.exe +0 -0
- data/bin/win64/jpegoptim.exe +0 -0
- data/bin/win64/libjpeg-62.dll +0 -0
- data/lib/piet-binary.rb +41 -0
- data/lib/piet-binary/version.rb +3 -0
- data/piet-binary.gemspec +25 -0
- data/spec/integration/piet_binary_spec.rb +1 -0
- data/spec/spec_helper.rb +1 -0
- metadata +131 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 518eb1598d0c447757beb3c13b12f0e33c333154
|
4
|
+
data.tar.gz: 27097d39e288a0bcf3adb4e01819f432956a93b6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: adeb78b1b10844bd67796f7e677826d2936915a453ade993472916936bd8f4f5e3af45604f7d113a06507c83bcb82c2df254ce971985afefaf11de3ccaa5123e
|
7
|
+
data.tar.gz: 51181e6064096773d114822de406923690b06af253c5c937c2d9aa7abbb2e682492df017df363437af58d95b7103b500af5d133fccf2dc3e884c303d2bce00f2
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
Piet-Binary
|
2
|
+
===========
|
3
|
+
|
4
|
+
Description
|
5
|
+
-----------
|
6
|
+
|
7
|
+
Piet-Binary is a gem which contains binaries for use with the [Piet](https://github.com/albertbellonch/piet) gem.
|
8
|
+
This is harmless gem - you can add to your Gemfile without collateral effects. It only will be activated if you use the Piet gem and you don't have jpegoptim/optipng binaries (and any other used by the Piet gem) in your system.
|
9
|
+
This gem doesn't have the pretention to be an all-case solution to the problem of lack of binaries required by Piet in the system. But will resolve the problem in the mosts cases. If you use this gem and Piet still accuse a not found error for the binaries tools (jpegoptim/optipng), you have to manually install the tools in the system. In this case you can help to improve this gem and add the missing binaries (see the "Helping this gem" section).
|
10
|
+
|
11
|
+
|
12
|
+
Why?
|
13
|
+
----
|
14
|
+
|
15
|
+
To Piet gem work without manually install jpegoptim/optipng in the system. This is necessary to Piet work, for example, with Heroku.
|
16
|
+
|
17
|
+
|
18
|
+
Installation
|
19
|
+
------------
|
20
|
+
|
21
|
+
```bash
|
22
|
+
gem install piet-binary
|
23
|
+
```
|
24
|
+
|
25
|
+
or, if you are using in Rails just add to your Gemfile (and, of course, install with "bundle install"):
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
gem 'piet-binary'
|
29
|
+
```
|
30
|
+
|
31
|
+
This gem automatically calls the piet gem, so it's not necessary to call the piet gem. So, you can just replace this:
|
32
|
+
```ruby
|
33
|
+
gem 'piet'
|
34
|
+
```
|
35
|
+
to this:
|
36
|
+
```ruby
|
37
|
+
gem 'piet-binary'
|
38
|
+
```
|
39
|
+
|
40
|
+
|
41
|
+
Usage
|
42
|
+
-----
|
43
|
+
|
44
|
+
You simply require the gem
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
require 'piet-binary'
|
48
|
+
```
|
49
|
+
|
50
|
+
|
51
|
+
Helping this gem
|
52
|
+
----------------
|
53
|
+
|
54
|
+
You can help this gem in 2 ways:
|
55
|
+
* keeping this gem with the latest version of the binaries
|
56
|
+
* adding platforms: today it only have a linux/64 bits binaries
|
57
|
+
|
58
|
+
To compile the jpegoptim, clone the last version of https://github.com/tjko/jpegoptim and execute the config with the "-static" CFLAG (it's necessary to create a non-dependable standalone exec file):
|
59
|
+
|
60
|
+
```bash
|
61
|
+
git clone https://github.com/tjko/jpegoptim.git
|
62
|
+
cd jpegoptim
|
63
|
+
CFLAGS="-static" ./configure
|
64
|
+
```
|
65
|
+
after this, copy the jpegoptim executable to the correct folder of this gem and submit a pull request.
|
data/Rakefile
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/bin/osx/optipng
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/piet-binary.rb
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'piet'
|
2
|
+
require 'os'
|
3
|
+
|
4
|
+
module Piet
|
5
|
+
class << self
|
6
|
+
|
7
|
+
private
|
8
|
+
|
9
|
+
def which(cmd)
|
10
|
+
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
|
11
|
+
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
|
12
|
+
exts.each do |ext|
|
13
|
+
exe = File.join(path, "#{cmd}#{ext}")
|
14
|
+
return exe if File.executable? exe
|
15
|
+
end
|
16
|
+
end
|
17
|
+
return nil
|
18
|
+
end
|
19
|
+
|
20
|
+
def command_path(command)
|
21
|
+
path = which(command)
|
22
|
+
|
23
|
+
if path.blank?
|
24
|
+
|
25
|
+
folder = if OS.osx?
|
26
|
+
'osx'
|
27
|
+
elsif OS.linux?
|
28
|
+
File.join('linux', OS.bits.eql?(64) ? 'x64' : 'x86')
|
29
|
+
elsif OS.windows?
|
30
|
+
OS.bits.eql?(64) ? 'win64' : 'win32'
|
31
|
+
end
|
32
|
+
|
33
|
+
root = Gem::Specification.find_by_name('piet-binary').gem_dir
|
34
|
+
path = File.join(root, 'bin', folder, command)
|
35
|
+
end
|
36
|
+
|
37
|
+
return path
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
data/piet-binary.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "piet-binary/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "piet-binary"
|
7
|
+
s.version = PietBinary::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Daniel Loureiro"]
|
10
|
+
s.email = ["loureirorg@gmail.com"]
|
11
|
+
s.homepage = "https://github.com/loureirorg/piet-binary"
|
12
|
+
s.summary = %q{Fallback binaries for Piet gem}
|
13
|
+
s.description = %q{-}
|
14
|
+
|
15
|
+
s.rubyforge_project = "piet-binary"
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
s.add_dependency "png_quantizator"
|
21
|
+
s.add_dependency "piet", ['~> 0.1.4']
|
22
|
+
s.add_development_dependency "rspec"
|
23
|
+
s.add_development_dependency "ZenTest"
|
24
|
+
s.add_runtime_dependency 'os', ['~> 0.9.6']
|
25
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'spec_helper'
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'piet-binary'
|
metadata
ADDED
@@ -0,0 +1,131 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: piet-binary
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Daniel Loureiro
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-12-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: png_quantizator
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: piet
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.1.4
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.1.4
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: ZenTest
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: os
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.9.6
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.9.6
|
83
|
+
description: "-"
|
84
|
+
email:
|
85
|
+
- loureirorg@gmail.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- Gemfile
|
91
|
+
- README.md
|
92
|
+
- Rakefile
|
93
|
+
- bin/linux/x64/jpegoptim
|
94
|
+
- bin/linux/x64/optipng
|
95
|
+
- bin/linux/x64/pngquant
|
96
|
+
- bin/linux/x86/optipng
|
97
|
+
- bin/osx/optipng
|
98
|
+
- bin/win32/libjpeg-62.dll
|
99
|
+
- bin/win32/optipng.exe
|
100
|
+
- bin/win64/jpegoptim.exe
|
101
|
+
- bin/win64/libjpeg-62.dll
|
102
|
+
- lib/piet-binary.rb
|
103
|
+
- lib/piet-binary/version.rb
|
104
|
+
- piet-binary.gemspec
|
105
|
+
- spec/integration/piet_binary_spec.rb
|
106
|
+
- spec/spec_helper.rb
|
107
|
+
homepage: https://github.com/loureirorg/piet-binary
|
108
|
+
licenses: []
|
109
|
+
metadata: {}
|
110
|
+
post_install_message:
|
111
|
+
rdoc_options: []
|
112
|
+
require_paths:
|
113
|
+
- lib
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
requirements: []
|
125
|
+
rubyforge_project: piet-binary
|
126
|
+
rubygems_version: 2.2.0
|
127
|
+
signing_key:
|
128
|
+
specification_version: 4
|
129
|
+
summary: Fallback binaries for Piet gem
|
130
|
+
test_files: []
|
131
|
+
has_rdoc:
|