letter_avatar 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a23085c33db8856b2c47db111f78212c2026b24a
4
- data.tar.gz: 5dc1880d4338652bc95b9c660a7b21eef98e22f0
3
+ metadata.gz: 91cab30f2c39951229dd104c9f0b109a8c4370ff
4
+ data.tar.gz: 4d4e7095dfe310a486bbb454a692666406e72eb3
5
5
  SHA512:
6
- metadata.gz: da069e4393094434e4d5a899e56547bb2384f297b643df2ad7c244406986806c8f263d549206f67460cd010b8939552775f6baa360de084c158701343366728b
7
- data.tar.gz: c40982c022892c56b00bbc8c93c8f6e83eeb4529a6607c72c2e8e4b8b0d5fd7c89bdbf643ff10d2dd6c4da4ed4bc641e6d598e4758efd0925dbcb47b89a32c57
6
+ metadata.gz: 9175fff72b9223e4afed6f37d1c436c58a3be3117e9ac58cd3df6766742ed2b711167475c556d203dea76baba9b764bff96c4ca92fb6871a0dfa0ee09a01eabc
7
+ data.tar.gz: 145ea83f81b4e0294ca021de7d25c58f3c18a7076c733ef004c4ce8eeac1a6681320411f01d942a0dac75d2f7118f5c2ca2e14345f9548fd7158d3c17745dced
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
+ 0.1.11
2
+ ------
3
+
4
+ - Windows support
5
+
1
6
  0.1.10
2
- -----
7
+ ------
3
8
 
4
9
  - `LetterAvatar::AvatarHelper` module tweaks
5
10
  - `letter_avatar_url` method, returning avatar proper url
@@ -1,4 +1,3 @@
1
- require 'posix/spawn'
2
1
  require "letter_avatar/colors"
3
2
 
4
3
  module LetterAvatar
@@ -1,3 +1,3 @@
1
1
  module LetterAvatar
2
- VERSION = "0.1.10"
2
+ VERSION = "0.1.11"
3
3
  end
data/lib/letter_avatar.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'posix/spawn'
2
+
1
3
  require "letter_avatar/version"
2
4
  require "letter_avatar/configuration"
3
5
  require "letter_avatar/avatar"
@@ -41,9 +43,14 @@ module LetterAvatar
41
43
 
42
44
  def self.execute(cmd)
43
45
  cmd = cmd.join(' ') if cmd.is_a?(Array)
44
- pid, stdin, stdout, stderr = POSIX::Spawn.popen4(cmd)
45
- Process.waitpid(pid)
46
- err = stderr.read
46
+ if Gem.win_platform?
47
+ require "open3"
48
+ _stdout_str, err = Open3.capture3(cmd.tr("'", '"'))
49
+ else
50
+ pid, _stdin, _stdout, stderr = POSIX::Spawn.popen4(cmd)
51
+ Process.waitpid(pid)
52
+ err = stderr.read
53
+ end
47
54
  if err != nil && err.length > 0
48
55
  raise ExecutionError.new("letter_avatar execution error (when calling '#{cmd}'): '#{err.strip}'")
49
56
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: letter_avatar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - discourse developers
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-02-17 00:00:00.000000000 Z
14
+ date: 2016-02-29 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: posix-spawn