nehm 1.2.2 → 1.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: fa02f86ca11d320cfcafe87503b8b5410b976d07
4
- data.tar.gz: a6eade14a40a20d7d395190299b8ca3ceb9de858
3
+ metadata.gz: 3f0c4e15904c1a52655fc3847970d6ab417fcedb
4
+ data.tar.gz: 1e0969f09138e26b6788c695b323079951155a80
5
5
  SHA512:
6
- metadata.gz: aa6aa113affb78d4d02189714e0b03825bed1f62a9ab25e32127641b1f938f9a67d91dd65662e92f93458562284e25538f27489c3c5f53c2d42aa7ea386b5f67
7
- data.tar.gz: ceb5e211de5fd23567fdff33c541416ae0eab037227673c388895fd2fb99da4f07fecd752cab2b668e1efe779728924c42e631c84fca3a386d8bf8eb5138cc92
6
+ metadata.gz: 2dae199bc056dc4d431f61f12d5fdafc92442bff56ea60eb994c19ef14b81f1a355dbc36744f4dd3529f27127966330a63511c8bc3d031a8cf864d00f61dfc44
7
+ data.tar.gz: ed3a74038f90cf65ce9629396a661d9f2c97847f1b723e8b433440115e0931b08bdc8eb489b9a74eb58a2483d3964ae36714bfd9fd1bfa5d37dc133e7df6b2e4
@@ -1,5 +1,13 @@
1
1
  # nehm change log
2
2
 
3
+ ## 1.3
4
+
5
+ * Now you can type short paths to download and iTunes paths while configuring nehm (e.g. ~/Music)
6
+
7
+ * Configure menu doesn't automatically exit after choose
8
+
9
+ * nehm doesn't ask for iTunes path by first run
10
+
3
11
  ## 1.2.2
4
12
 
5
13
  * Tracks has got now year tag
data/README.md CHANGED
@@ -16,9 +16,9 @@ or
16
16
 
17
17
  **Linux:**
18
18
 
19
- Debian/Ubuntu: ` sudo apt-get install libtag1-dev`
19
+ Debian/Ubuntu: `sudo apt-get install libtag1-dev`
20
20
 
21
- Fedora/RHEL: ` sudo yum install taglib-devel`
21
+ Fedora/RHEL: `sudo yum install taglib-devel`
22
22
 
23
23
  **2. Then you can install `nehm` gem:**
24
24
 
@@ -36,7 +36,7 @@ nehm should answer like this:
36
36
  ```
37
37
  Hello!
38
38
  Before using the nehm, you should set it up:
39
- Enter a FULL path to desirable download directory (press enter to set it to ...
39
+ Enter path to desirable download directory (press enter to set it to ...
40
40
  ```
41
41
 
42
42
  **Now you can use nehm!**
@@ -43,10 +43,7 @@ module App
43
43
  PathControl.set_dl_path
44
44
  puts "\n"
45
45
 
46
- unless OS.linux?
47
- PathControl.set_itunes_path
48
- puts "\n"
49
- end
46
+ PathControl.set_itunes_path_to_default
50
47
 
51
48
  UserControl.log_in
52
49
 
@@ -6,13 +6,17 @@ module Configure
6
6
  puts 'Permalink: ' + Paint[Config[:permalink], :cyan] if Config[:permalink]
7
7
  puts "\n"
8
8
 
9
- HighLine.new.choose do |menu|
10
- menu.prompt = Paint['Choose setting', :yellow]
9
+ loop do
10
+ HighLine.new.choose do |menu|
11
+ menu.prompt = Paint['Choose setting', :yellow]
11
12
 
12
- menu.choice('Edit download path') { PathControl.set_dl_path }
13
- menu.choice('Edit itunes path') { PathControl.set_itunes_path } unless OS.linux?
14
- menu.choice('Edit permalink') { UserControl.log_in }
15
- menu.choice('Exit') { exit }
13
+ menu.choice('Edit download path') { PathControl.set_dl_path }
14
+ menu.choice('Edit itunes path') { PathControl.set_itunes_path } unless OS.linux?
15
+ menu.choice('Edit permalink') { UserControl.log_in }
16
+ menu.choice('Exit') { exit }
17
+ end
18
+ sleep(1)
19
+ puts "\n"
16
20
  end
17
21
  end
18
22
  end
@@ -22,7 +22,7 @@ module Get
22
22
  index = args.index('to')
23
23
  path = args[index + 1]
24
24
 
25
- path = File.join(ENV['HOME'], path[1..-1]) if path[0] == '~'
25
+ path = PathControl.tilde_to_home(path) if PathControl.tilde_at_top?(path)
26
26
 
27
27
  PathControl.temp_dl_path = path
28
28
 
@@ -6,7 +6,7 @@ class PathControl
6
6
  def self.set_dl_path
7
7
  loop do
8
8
  default_path = File.join(ENV['HOME'], '/Music')
9
- path_ask = 'Enter a FULL path to default download directory'
9
+ path_ask = 'Enter path to desirable download directory'
10
10
 
11
11
  if Dir.exist?(default_path)
12
12
  path_ask << " (press enter to set it to #{Paint[default_path, :magenta]})"
@@ -17,9 +17,11 @@ class PathControl
17
17
  path = HighLine.new.ask(path_ask + ':')
18
18
  path = default_path if path == '' && default_path
19
19
 
20
+ path = PathControl.tilde_to_home(path) if PathControl.tilde_at_top?(path)
21
+
20
22
  if Dir.exist?(path)
21
23
  Config[:dl_path] = path
22
- puts Paint['Download directory set up!', :green]
24
+ puts Paint["Download directory set up to #{Paint[path, :magenta]}", :green]
23
25
  break
24
26
  else
25
27
  puts Paint["This directory doesn't exist. Please enter path again", :red]
@@ -48,7 +50,7 @@ class PathControl
48
50
  def self.set_itunes_path
49
51
  loop do
50
52
  default_path = File.join(ENV['HOME'], '/Music/iTunes')
51
- path_ask = 'Enter a FULL path to iTunes directory'
53
+ path_ask = 'Enter path to iTunes directory'
52
54
 
53
55
  if Dir.exist?(default_path)
54
56
  path_ask << " (press enter to set it to #{Paint[default_path, :magenta]})"
@@ -59,15 +61,29 @@ class PathControl
59
61
  path = HighLine.new.ask(path_ask + ':')
60
62
  path = default_path if path == '' && default_path
61
63
 
64
+ path = PathControl.tilde_to_home(path) if PathControl.tilde_at_top?(path)
65
+
62
66
  path = File.join(path, "iTunes\ Media/Automatically\ Add\ to\ iTunes.localized")
63
67
 
64
68
  if Dir.exist?(path)
65
69
  Config[:itunes_path] = path
66
- puts Paint['iTunes directory set up!', :green]
70
+ puts Paint["iTunes directory set up to #{Paint[path, :magenta]}", :green]
67
71
  break
68
72
  else
69
73
  puts Paint["This directory doesn't exist. Please enter path again", :red]
70
74
  end
71
75
  end
72
76
  end
77
+
78
+ def self.set_itunes_path_to_default
79
+ Config[:itunes_path] = File.join(ENV['HOME'], "/Music/iTunes/iTunes\ Media/Automatically\ Add\ to\ iTunes.localized")
80
+ end
81
+
82
+ def self.tilde_to_home(path)
83
+ File.join(ENV['HOME'], path[1..-1])
84
+ end
85
+
86
+ def self.tilde_at_top?(path)
87
+ path[0] == '~' ? true : false
88
+ end
73
89
  end
@@ -1,3 +1,3 @@
1
1
  module Nehm
2
- VERSION = '1.2.2'
2
+ VERSION = '1.3'
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: 1.2.2
4
+ version: '1.3'
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-07-25 00:00:00.000000000 Z
11
+ date: 2015-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler