faceapp 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6b57f4675e25c6bcd9a57789bd6059f52cd36fe
4
- data.tar.gz: 5f2249a23cdafc983f95417b01623b9ccb697f8a
3
+ metadata.gz: 94cafef7cf1811a03ee29bb0cd6d8f1b40e66914
4
+ data.tar.gz: fc50cf763eb1fa92ab2380b3a103c63a8a2b2eca
5
5
  SHA512:
6
- metadata.gz: 5dc081794102567ce12a3634dd2699c80af525a442f8cf66c1c9aad0917a57a89be29a3d6500b39e9924db532a6ec2125744cbd3375d7d125dd8b3dfe98bd427
7
- data.tar.gz: 7c617965779af62386f0c3a915a5cf3cb48556b0423656ee60279f0ce8466ac5791abc5fabc936f1cdf9887161e18b1c2988cee9846722268a1d939bd69b562f
6
+ metadata.gz: a169ada01c68949e0bc3f40829a354707e91222cf6bb9c1c86fa4c5d872abc53fe3784db199f69565c36ce8227450d5452b4254cc9664f344d7cf3ba658e9869
7
+ data.tar.gz: 22934aed65b8698ddf75a5efaace5ce26afd94c9e65db865980c022f56fcb4fc133e71af5693e83596eae080a69453adbac84ede1a9a4740ff2176f5fafdd793
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ *.gem
data/README.md CHANGED
@@ -2,26 +2,12 @@
2
2
 
3
3
  Faceapp is neural-network face manipulation application for smartphones.
4
4
 
5
- https://play.google.com/store/apps/details?id=io.faceapp&hl=ru
6
- https://itunes.apple.com/us/app/faceapp-free-neural-face-transformations/id1180884341
7
-
8
5
  This gem provides command-line utility and Ruby library to utilize Faceapp API without using smartphone application.
9
6
 
10
- ## Installation
7
+ Faceapp Application is available on Google Play and Apple App Store:
11
8
 
12
- Add this line to your application's Gemfile:
13
-
14
- ```ruby
15
- gem 'faceapp'
16
- ```
17
-
18
- And then execute:
19
-
20
- $ bundle
21
-
22
- Or install it yourself as:
23
-
24
- $ gem install faceapp
9
+ * https://play.google.com/store/apps/details?id=io.faceapp
10
+ * https://itunes.apple.com/us/app/faceapp-free-neural-face-transformations/id1180884341
25
11
 
26
12
  ## Usage
27
13
 
@@ -53,6 +39,7 @@ faceapp [options] <filter> <input> [ouput]
53
39
 
54
40
  ```bash
55
41
  $ faceapp female hitler.jpg adolfina.jpg
42
+ $ faceapp female - < hitler.jpg > adolfina.jpg
56
43
  ```
57
44
 
58
45
  ### Ruby library
@@ -90,6 +77,24 @@ end
90
77
 
91
78
  ```
92
79
 
80
+
81
+ ## Installation
82
+
83
+ Add this line to your application's Gemfile:
84
+
85
+ ```ruby
86
+ gem 'faceapp'
87
+ ```
88
+
89
+ And then execute:
90
+
91
+ $ bundle
92
+
93
+ Or install it yourself as:
94
+
95
+ $ gem install faceapp
96
+
97
+
93
98
  ## License
94
99
 
95
100
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'faceapp'
7
- spec.version = '0.1.0'
7
+ spec.version = '0.1.1'
8
8
  spec.authors = ['Igor Yamolov']
9
9
  spec.email = ['clouster@yandex.ru']
10
10
 
@@ -34,6 +34,9 @@ module Faceapp
34
34
  info 'Done.'
35
35
  rescue => e
36
36
  info "Error: #{e.message}"
37
+
38
+ debug { e.backtrace.join("\n") }
39
+
37
40
  exit(-1)
38
41
  ensure
39
42
  input.close if input.is_a?(File)
@@ -71,7 +74,7 @@ TEXT
71
74
  def parse_input(input)
72
75
  case input
73
76
  when '-'
74
- STDIN
77
+ StringIO.new(STDIN.read)
75
78
  when nil
76
79
  print_usage
77
80
  else
@@ -124,12 +127,18 @@ TEXT
124
127
  end
125
128
  end
126
129
 
127
- def debug(text)
128
- STDERR.puts(text) if debug?
130
+ def debug(text = nil)
131
+ return unless debug?
132
+
133
+ STDERR.puts(text) if text
134
+ STDERR.puts(yield) if block_given?
129
135
  end
130
136
 
131
- def info(text)
132
- STDERR.puts(text) unless silent?
137
+ def info(text = nil)
138
+ return if silent?
139
+
140
+ STDERR.puts(text) if text
141
+ STDERR.puts(yield) if block_given?
133
142
  end
134
143
 
135
144
  def debug?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faceapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Yamolov