live_set 0.2.0 → 0.2.1

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
  SHA256:
3
- metadata.gz: 383208bd53c5b54e254945faa8d79ae100b78a1dd34fa3820abdaec8dc1b2854
4
- data.tar.gz: b6d6ae70303f7ff3a2c43039a27ca2424c8296dcf6cf36d3ff9a572d4d285b97
3
+ metadata.gz: 9caef58c0bed30ead696f9d64848c74038aa520d83a2c47796cb0081c0ad6b14
4
+ data.tar.gz: 85906715baa37c0ed5a2fd4f0a101e37d5c5728a4385f0754d120514b18d7b89
5
5
  SHA512:
6
- metadata.gz: 1e2078593ba88bb503c9a2a712bc85362f05b31ceec83a3276785a3b01961d8c85b6c6cc3bf7822670e1e4bb4372dfb214225ab1cbe927f9e6ffab541539560a
7
- data.tar.gz: 408994bfca9f20dec4df040cee40268da9339549963ee10da80725f2dc4f619ec01db53d1df4e0c02389aeee6224f8c7ecf1bb21044ce24878a56fb5177a2039
6
+ metadata.gz: 88404bf0b8d04663da0d7a334a8affd9d930df965af1b3fed1b3a2b9286881380ecba7882badbf71d0612674a3f77775a436a6e5a505a4bb9b25801522ad5ab6
7
+ data.tar.gz: d633040d514b77e4984e936c4676fd5f124ee30da405b6c612f916edbd33625cbacb0a1d35812aaae393f03436cab2054144e54a75db1214ba64196c92511cf4
data/CHANGELOG.md CHANGED
@@ -1,9 +1,15 @@
1
1
  # Change Log
2
2
 
3
+
4
+ ## 0.2.1
5
+
6
+ * Corrected missing help method for the `live_set` command.
7
+ * Prompts user if they want the extra directory renamed to `Ableton Project Info-`.
8
+
9
+
3
10
  ## 0.2.0
4
11
 
5
12
  * Checks `Ableton Project Info` validity all up the directory tree.
6
- * Prompts user if they want the extra directory renamed to `Ableton Project Info-`.
7
13
  * Reports the clips in the set, and their sizes.
8
14
  * Generates a warning if the total size of the clips might cause freezing to fail.
9
15
 
@@ -1,5 +1,7 @@
1
1
  require 'date'
2
2
  require 'fileutils'
3
+ require 'highline'
4
+ require 'shellwords'
3
5
  require_relative '../common/run'
4
6
 
5
7
  class AlsDelta
@@ -26,6 +28,7 @@ class AlsDelta
26
28
 
27
29
  def backup_set
28
30
  @backup_name = backup_name
31
+ puts "Backing up Live set to '#{@backup_name}'"
29
32
  FileUtils.cp @set_name, @backup_name
30
33
  end
31
34
 
@@ -33,16 +36,25 @@ class AlsDelta
33
36
  return if @options[:keep] || !@backup_name
34
37
  return unless File.exist? @backup_name
35
38
 
36
- puts "Deleting #{@backup_name}"
39
+ puts "Deleting '#{@backup_name}'"
37
40
  File.delete @backup_name
38
41
  end
39
42
 
40
43
  def show
41
- output = run_capture_stdout "zdiff '#{@backup_name}' '#{@set_name}'"
42
- if output.empty?
43
- puts 'There were no changes to the saved live set.'
44
- else
45
- puts output.join("\n")
44
+ backup_set
45
+ loop do
46
+ puts 'Press any key to display the changes to the Live set XML file, or press Esc to exit.'
47
+ character = $stdin.getch
48
+ exit if character.ord == 27
49
+ output = run_capture_stdout "GZIP=--no-name zdiff #{@set_name.shellescape} #{@backup_name.shellescape}"
50
+ if output.empty?
51
+ puts 'There were no changes to the saved live set.'
52
+ else
53
+ puts output.join("\n")
54
+ backup_set
55
+ end
56
+ rescue StandardError => e
57
+ puts e
46
58
  end
47
59
  end
48
60
  end
@@ -1,7 +1,7 @@
1
1
  require 'colorator'
2
2
  require 'optparse'
3
3
 
4
- VERBOSITY = %w[trace debug verbose info warning error fatal panic quiet].freeze
4
+ VERBOSITY = %w[trace debug verbose info warning error fatal panic quiet].freeze unless defined? VERBOSITY
5
5
 
6
6
  def common(command)
7
7
  @options = parse_options command
@@ -1,3 +1,6 @@
1
+ require 'colorator'
2
+ require 'highline'
3
+
1
4
  class LiveSet
2
5
  private
3
6
 
@@ -9,12 +12,18 @@ class LiveSet
9
12
 
10
13
  cur_dir = Pathname.new(set_directory).parent
11
14
  while cur_dir
12
- if File.exist? File.join(cur_dir, 'Ableton Project Info')
13
- puts "Warning: 'Ableton Project Info' exists in parent directory '#{cur_dir.to_path}'".red
14
- end
15
+ project_info_path = File.join(cur_dir, 'Ableton Project Info')
16
+ add_dash_suffix(project_info_path) if File.exist? project_info_path
15
17
  break if cur_dir.to_path == '/'
16
18
 
17
19
  cur_dir = cur_dir.parent
18
20
  end
19
21
  end
22
+
23
+ def add_dash_suffix(cur_dir, path)
24
+ puts "Warning: 'Ableton Project Info' exists in parent directory '#{cur_dir.to_path}'".red
25
+ return unless HighLine.agree("\nDo you want the directory to be disabled by suffixing a dash to its name? ", character = true)
26
+
27
+ File.rename path, "#{path}-"
28
+ end
20
29
  end
@@ -1,9 +1,9 @@
1
1
  require 'colorator'
2
2
  require 'optparse'
3
3
 
4
- VERBOSITY = %w[trace debug verbose info warning error fatal panic quiet].freeze
4
+ VERBOSITY = %w[trace debug verbose info warning error fatal panic quiet].freeze unless defined? VERBOSITY
5
5
 
6
- def live_set(msg = nil)
6
+ def help_live_set(msg = nil)
7
7
  printf "Error: #{msg}\n\n".yellow unless msg.nil?
8
8
  msg = <<~END_HELP
9
9
  Live_sete displays information about an Ableton Live set or converts a Live 12 set to Live 11 format.
@@ -1,3 +1,3 @@
1
1
  module LiveSetVersion
2
- VERSION = '0.2.0'.freeze unless defined? VERSION
2
+ VERSION = '0.2.1'.freeze unless defined? VERSION
3
3
  end
data/lib/live_set.rb CHANGED
@@ -22,7 +22,6 @@ def als_delta
22
22
 
23
23
  als_delta = AlsDelta.new set_name, **@options
24
24
  catch :ctrl_c do
25
- als_delta.backup_set
26
25
  als_delta.show
27
26
  als_delta.cleanup
28
27
  rescue Exception # rubocop:disable Lint/RescueException
data/live_set.gemspec CHANGED
@@ -33,5 +33,6 @@ Gem::Specification.new do |spec|
33
33
 
34
34
  spec.add_dependency 'bytesize'
35
35
  spec.add_dependency 'colorator'
36
+ spec.add_dependency 'highline'
36
37
  spec.add_dependency 'nokogiri'
37
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: live_set
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Slinn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-20 00:00:00.000000000 Z
11
+ date: 2024-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bytesize
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: highline
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: nokogiri
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -71,7 +85,7 @@ files:
71
85
  - als_notes.md
72
86
  - exe/als_delta
73
87
  - exe/live_set
74
- - lib/als_delta/ als_delta_class.rb
88
+ - lib/als_delta/als_delta_class.rb
75
89
  - lib/als_delta/als_delta_options.rb
76
90
  - lib/common/common.rb
77
91
  - lib/common/run.rb