ruby_lepton 0.1.3 → 0.1.4
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/Gemfile.lock +1 -1
- data/README.md +26 -23
- data/lib/ruby_lepton.rb +2 -0
- data/lib/ruby_lepton/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 514a4fb11aefa759aa0224b4d5b2c2dc336c2f0c64da583641fd3f8ac5ef4237
|
|
4
|
+
data.tar.gz: f0bddd69dcc704a86bb55b6a44dfec5d57675fb4b1d4f9f44a13d1240868257b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1b099219e2d41ecff7ac3ff919ff24dd27ba65b7d267e29397839dd1b61b6b6a01b284b8c336d61f6ef827ad85d329952cae5bb85f75df12441061240b87460b
|
|
7
|
+
data.tar.gz: 37255326aa0f1d8984a9ea5aef85c1111bb2c0ae7323e28f974b87356ca1045ea36e7558a9e0e14de3a1a3a6e959def7bff181fc06d3fbc952a1e8c2ae85e164
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
2
|
# Ruby Lepton
|
|
3
|
+
[](https://badge.fury.io/rb/ruby_lepton)
|
|
4
4
|
|
|
5
|
+
## Description
|
|
5
6
|
A Ruby wrapper library for Dropbox JPEG Lepton compression tool.
|
|
6
7
|
|
|
7
8
|
## Getting started
|
|
@@ -20,13 +21,11 @@ sudo apt install lepton
|
|
|
20
21
|
|
|
21
22
|
## Installation
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
```
|
|
24
|
+
```ruby
|
|
26
25
|
gem install ruby_lepton
|
|
27
26
|
```
|
|
28
27
|
or include inside Gemfile
|
|
29
|
-
```
|
|
28
|
+
```ruby
|
|
30
29
|
gem "ruby_lepton"
|
|
31
30
|
```
|
|
32
31
|
Install ruby lepton:
|
|
@@ -35,14 +34,18 @@ Install ruby lepton:
|
|
|
35
34
|
|
|
36
35
|
## Usage
|
|
37
36
|
|
|
38
|
-
Compress method
|
|
39
|
-
```
|
|
37
|
+
**Compress method**
|
|
38
|
+
```ruby
|
|
40
39
|
RubyLepton::Base.compress(path_to_source_file, options)
|
|
41
40
|
```
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
returns output file path: `"output/filename.lep"`
|
|
42
|
+
|
|
43
|
+
**Decompress method**
|
|
44
|
+
```ruby
|
|
44
45
|
RubyLepton::Base.decompress(path_to_source_file, options)
|
|
45
46
|
```
|
|
47
|
+
returns output file path: `"output/filename.jpeg"`
|
|
48
|
+
|
|
46
49
|
`options` can be passed as hash `{binary: true}`
|
|
47
50
|
|
|
48
51
|
Supported options:
|
|
@@ -57,34 +60,34 @@ Generate binstubs for CLI commands:
|
|
|
57
60
|
`ruby_lepton` executable will be generated under `bin/` folder
|
|
58
61
|
|
|
59
62
|
|
|
60
|
-
|
|
63
|
+
**Compress a image:**
|
|
61
64
|
```
|
|
62
65
|
$ bundle exec ruby_lepton compress [PATH] [OPTIONS]
|
|
63
66
|
```
|
|
64
|
-
|
|
67
|
+
**Decompress a file:**
|
|
65
68
|
```
|
|
66
69
|
$ bundle exec ruby_lepton decompress [PATH] [OPTIONS]
|
|
67
70
|
```
|
|
68
71
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
$ bundle exec ruby_lepton decompress path_to_file --no-verbose --no-binary
|
|
73
|
-
```
|
|
74
|
-
or you can pass alias for binary
|
|
72
|
+
File is generated after compression and decompression under `output/` folder
|
|
73
|
+
|
|
74
|
+
**Options**
|
|
75
75
|
```
|
|
76
|
-
$ bundle exec ruby_lepton compress path_to_file
|
|
77
|
-
$ bundle exec ruby_lepton decompress path_to_file -
|
|
76
|
+
$ bundle exec ruby_lepton compress path_to_file --verbose
|
|
77
|
+
$ bundle exec ruby_lepton decompress path_to_file --no-verbose
|
|
78
78
|
```
|
|
79
79
|
## Output
|
|
80
80
|
|
|
81
81
|
#### File generation
|
|
82
|
-
By default, file is generated
|
|
82
|
+
By default, file is generated after compression and decompression under `output/` folder
|
|
83
|
+
```ruby
|
|
84
|
+
RubyLepton::Base.decompress(path_to_source_file)
|
|
85
|
+
```
|
|
83
86
|
|
|
84
87
|
#### Binary data
|
|
85
|
-
Binary data will be returned instead of file by passing
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
+
Binary data will be returned instead of file by passing `{binary: true}` option
|
|
89
|
+
```ruby
|
|
90
|
+
RubyLepton::Base.decompress(path_to_source_file, {binary: true})
|
|
88
91
|
```
|
|
89
92
|
|
|
90
93
|
File is not generated when `--binary` option is passed
|
data/lib/ruby_lepton.rb
CHANGED
|
@@ -15,6 +15,7 @@ module RubyLepton
|
|
|
15
15
|
return output.read
|
|
16
16
|
else
|
|
17
17
|
puts "Compressed file saved to: " + generated_file
|
|
18
|
+
return generated_file
|
|
18
19
|
end
|
|
19
20
|
else
|
|
20
21
|
puts "Error in compression"
|
|
@@ -31,6 +32,7 @@ module RubyLepton
|
|
|
31
32
|
return output.read
|
|
32
33
|
else
|
|
33
34
|
puts "Decompressed file saved to: " + generated_file
|
|
35
|
+
return generated_file
|
|
34
36
|
end
|
|
35
37
|
else
|
|
36
38
|
puts "Error in decompression"
|
data/lib/ruby_lepton/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby_lepton
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Karan
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-10-
|
|
11
|
+
date: 2020-10-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|