changi 0.2.2 → 0.2.3

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: cca32b966703139ad94bf778717d6710bfb80aac
4
- data.tar.gz: 607d733dce85ede99d73368ba03e9ecb4284d26d
3
+ metadata.gz: ecceeb469bc5bca00ec69bebcc62ac19c0eec9b3
4
+ data.tar.gz: 12f723b2e1b538b4319fb7fa4f0efafcc5c4289c
5
5
  SHA512:
6
- metadata.gz: b6a866ca18edb40ed3f9911a8f02ea13cb732f213e6b37718048733bd5bf072a8585584e383a25b065dee8d169261a6fa6f6a37e4a838c91251f083438424de9
7
- data.tar.gz: 653b5e814348386f29cf17725a88da47c6efe35f60777cf0054b79a97798dde907de05b2483f6ed6a86cb12de86baffe922c0b6be77a67c7e9673889a50a837e
6
+ metadata.gz: f242e80970535b5ad62e6d9364d44c5a07cb060b5047134ba24a9be24e583b6166045a253d4e81b1f839b69f88055c738a497462e3a8ac38b3d5f1b5e717e737
7
+ data.tar.gz: 37c0b2fd37dcfa054b69a4a59bb5b19a5d07905259632f506a4757c8ba5e0bf5be82dfc9494cb2b85ef51109e01e7bbf0c1f73d6d35c26ef860c388aecbf75f9
@@ -8,8 +8,14 @@ module Changi
8
8
 
9
9
  intro tmpfile, attribute
10
10
 
11
- unless system "#{editor} '#{tmpfile.path.strip}'"
11
+ rc = system "#{editor} '#{tmpfile.path.strip}'"
12
+ if rc == false
12
13
  abort 'editor returned with non-zero exit status, abort'
14
+ elsif rc.nil?
15
+ puts "editor '#{editor}' not found, trying nano..."
16
+ unless system "name '#{tmpfile.path.strip}'"
17
+ abort 'nano not found or non-zero exit status, abort'
18
+ end
13
19
  end
14
20
 
15
21
  read_and_strip(tmpfile).tap do |data|
@@ -48,6 +54,7 @@ module Changi
48
54
 
49
55
  def editor_tests
50
56
  [
57
+ -> { ENV['CHANGI_EDITOR'] },
51
58
  -> { ENV['EDITOR'] },
52
59
  -> { `git config core.editor`.strip },
53
60
  -> { editor_exists?('nano') && 'nano' },
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: changi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mobisol GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-17 00:00:00.000000000 Z
11
+ date: 2016-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake