nehm 2.2.1 → 2.2.2

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: 8ef72ee45232c3392418a466fdbb1dc7dc190c65
4
- data.tar.gz: b5158776e4e34d80ef33d00ee778beb51e478d05
3
+ metadata.gz: efed52ef870d01c0b3b12c62769ceaf50a8a10b0
4
+ data.tar.gz: ac34cdf9e5d626619349e47cc12c12e6552855cb
5
5
  SHA512:
6
- metadata.gz: fb586861dc9ed9e2065adfeb3eac510a7793db7590150c0a030ceaade3e1c053737c43fe37d013bfb617d3b0c3213189b1d060a7b88606947fe1cf5e400d80f4
7
- data.tar.gz: 32e2611f1e840d59d7a2c91d80318b05c8c84d8fa335fbf7d81ff57e8e5b9219eab2ff911712eb0cdd5c845855272b568e76822f55a051d820abedfbab3ab2d9
6
+ metadata.gz: 8b5210fbea97babdf7b00eeee3b9ce3b32c30150c615c539442683c907554244cc281c315a913b27448f92c258d4b24d6b3fd03a9536e8e8b8e4bfd2ade16fea
7
+ data.tar.gz: 8e9f0cc264820233d25649089028a3be78ce266b9323dfa878809f07298a44b6015a5244d2324433a3e5bdc0406206dc588bb9153417c79494187c9695d0ebc3
@@ -1,5 +1,8 @@
1
1
  # nehm change log
2
2
 
3
+ ## 2.2.2
4
+ * If you input in `to` option non-existing directory, you can create it from `nehm`
5
+
3
6
  ## 2.2.1
4
7
  * Small improvements
5
8
 
data/Rakefile CHANGED
@@ -13,7 +13,6 @@ file = 'pkg/nehm-' + Nehm::VERSION + '.gem'
13
13
 
14
14
  task :push => :build do
15
15
  `gem push #{file}`
16
- File.delete('./' + file)
17
16
  end
18
17
 
19
18
  ##
@@ -13,8 +13,19 @@ module Nehm
13
13
  # Checks path for validation and returns it if valid
14
14
 
15
15
  def self.get_path(path)
16
- # Check path for existence
17
- UI.term 'Invalid download path. Please enter correct path' unless Dir.exist?(path)
16
+ unless Dir.exist?(path)
17
+ UI.warning "This directory doesn't exist."
18
+ wish = UI.ask('Want to create it? (Y/n):')
19
+ wish = 'y' if wish == ''
20
+
21
+ if wish.downcase =~ /y/
22
+ UI.say "Creating directory: #{path}"
23
+ UI.newline
24
+ Dir.mkdir(File.expand_path(path), 0775)
25
+ else
26
+ UI.term
27
+ end
28
+ end
18
29
 
19
30
  File.expand_path(path)
20
31
  end
@@ -10,13 +10,13 @@ module Nehm
10
10
 
11
11
  SLEEP_PERIOD = 0.7
12
12
 
13
- def self.ask(arg)
13
+ def self.ask(arg = "")
14
14
  say arg
15
15
  $stdin.gets.chomp
16
16
  end
17
17
 
18
18
  def self.error(msg)
19
- puts "#{msg}\n".red
19
+ say "#{msg}\n".red
20
20
  end
21
21
 
22
22
  def self.menu(&block)
@@ -24,10 +24,10 @@ module Nehm
24
24
  end
25
25
 
26
26
  def self.newline
27
- puts
27
+ say
28
28
  end
29
29
 
30
- def self.say(msg)
30
+ def self.say(msg = '')
31
31
  puts msg
32
32
  end
33
33
 
@@ -36,16 +36,16 @@ module Nehm
36
36
  end
37
37
 
38
38
  def self.success(msg)
39
- puts msg.green
39
+ say msg.green
40
40
  end
41
41
 
42
42
  def self.term(msg = nil)
43
- puts msg.red if msg
43
+ say msg.red if msg
44
44
  raise NehmExit
45
45
  end
46
46
 
47
47
  def self.warning(msg)
48
- puts "#{msg}".yellow
48
+ say "#{msg}".yellow
49
49
  end
50
50
 
51
51
  end
@@ -1,3 +1,3 @@
1
1
  module Nehm
2
- VERSION = '2.2.1'.freeze
2
+ VERSION = '2.2.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nehm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Albert Nigmatzianov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-06 00:00:00.000000000 Z
11
+ date: 2015-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: certifi