├── .gitignore ├── README.rdoc ├── Rakefile ├── lib └── guard │ ├── live-set.rb │ └── live-set │ ├── templates │ └── Guardfile │ └── version.rb └── spec ├── live-set_spec.rb ├── spec Project ├── Ableton Project Info │ └── Project8_1.cfg ├── Icon └── spec.als └── spec_helper.rb /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | .bundle 3 | Gemfile.lock 4 | pkg/* 5 | 6 | .DS_Store 7 | -------------------------------------------------------------------------------- /README.rdoc: -------------------------------------------------------------------------------- 1 | Converts Ableton Live .als files to XML as their saved. The point of this is so that you can use git with your .als files. Git is a lot more useful with line based text files than binary files. 2 | 3 | == Usage 4 | 5 | gem install guard 6 | gem install guard-live-set 7 | cd ~/Path/To/Root/Of/Ableton/LiveSets 8 | guard init live-set 9 | guard 10 | 11 | You'll probably want to add the rb-fsevent gem and "require 'rb-fsevent' to the top of the Guardfile generated by "guard init live-set" if you're on a Mac. If you're not on a make read the guard docs for your OS. 12 | 13 | To get Live to read a .xml you download: 14 | 15 | gzip Foobar.als.xml 16 | mv Foobar.als.xml.gz Foobar.als 17 | open Foobar.als 18 | 19 | == Author 20 | 21 | {Michael Garriss}[http://github.com/mgarriss] 22 | 23 | == License 24 | 25 | Apache 2.0, See the file LICENSE 26 | 27 | Copyright (c) 2012 Michael Garriss 28 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | $:.unshift File.join( File.dirname( __FILE__ )) 2 | $:.unshift File.join( File.dirname( __FILE__ ), 'lib') 3 | 4 | require 'rake' 5 | require 'rake/testtask' 6 | require 'guard/live-set/version' 7 | 8 | Rake::TestTask.new(:test) do |t| 9 | t.libs << "spec" 10 | t.test_files = FileList["spec/**/*_spec.rb"] 11 | t.verbose = true 12 | end 13 | 14 | task :build do 15 | system "gem build ../gemspecs/guard-live-set.gemspec" 16 | system "mv guard-live-set-#{Guard::LiveSet::VERSION}.gem ../gems" 17 | end 18 | 19 | task :local => :build do 20 | system "gem install ../gems/guard-live-set-#{Guard::LiveSet::VERSION}.gem" 21 | end 22 | 23 | task :release => :build do 24 | system "gem push ../gems/guard-live-set-#{Guard::LiveSet::VERSION}.gem" 25 | end 26 | 27 | task :default => [:test] 28 | -------------------------------------------------------------------------------- /lib/guard/live-set.rb: -------------------------------------------------------------------------------- 1 | require 'guard' 2 | require 'guard/guard' 3 | 4 | require 'zlib' 5 | 6 | module Guard 7 | class LiveSet < Guard 8 | 9 | # Initialize a Guard. 10 | # @param [Array] watchers the Guard file watchers 11 | # @param [Hash] options the custom Guard options 12 | def initialize(watchers = [], options = {}) 13 | super 14 | end 15 | 16 | # Call once when Guard starts. Please override initialize method to init stuff. 17 | # @raise [:task_has_failed] when start has failed 18 | def start 19 | end 20 | 21 | # Called when `stop|quit|exit|s|q|e + enter` is pressed (when Guard quits). 22 | # @raise [:task_has_failed] when stop has failed 23 | def stop 24 | end 25 | 26 | # Called when `reload|r|z + enter` is pressed. 27 | # This method should be mainly used for "reload" (really!) actions like reloading passenger/spork/bundler/... 28 | # @raise [:task_has_failed] when reload has failed 29 | def reload 30 | end 31 | 32 | # Called when just `enter` is pressed 33 | # This method should be principally used for long action like running all specs/tests/... 34 | # @raise [:task_has_failed] when run_all has failed 35 | def run_all 36 | end 37 | 38 | # Called on file(s) modifications that the Guard watches. 39 | # @param [Array] paths the changes files or paths 40 | # @raise [:task_has_failed] when run_on_change has failed 41 | def run_on_change(paths) 42 | paths.each do |path| 43 | Zlib::GzipReader.open(path) do |gz| 44 | File.open(path + '.xml', 'w') do |file| 45 | file << gz.read 46 | end 47 | end 48 | end 49 | end 50 | 51 | # Called on file(s) deletions that the Guard watches. 52 | # @param [Array] paths the deleted files or paths 53 | # @raise [:task_has_failed] when run_on_change has failed 54 | def run_on_deletion(paths) 55 | end 56 | 57 | end 58 | end 59 | -------------------------------------------------------------------------------- /lib/guard/live-set/templates/Guardfile: -------------------------------------------------------------------------------- 1 | # require 'rb-fsevent' 2 | 3 | guard 'live-set' do 4 | watch(/(.*).als/) 5 | end 6 | -------------------------------------------------------------------------------- /lib/guard/live-set/version.rb: -------------------------------------------------------------------------------- 1 | module Guard 2 | module LiveSet 3 | VERSION = "0.1.1" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /spec/live-set_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | require 'fileutils' 4 | require 'guard' 5 | require 'guard/live-set' 6 | 7 | 8 | describe Guard::LiveSet do 9 | describe '#run_on_change(paths)' do 10 | it 'un-gzips all .als files and file.xml' do 11 | begin 12 | skip "someone finish writing this. plz." 13 | File.exists?('./spec.als').must_equal true 14 | File.exists?('./spec.xml').must_equal false 15 | Guard.setup 16 | Guard::Dsl.evaluate_guardfile(:guardfile => '../lib/guard/live-set/templates/Guardfile') 17 | Guard.start 18 | # TODO modify .als here 19 | File.exists?('./spec.als').must_equal true 20 | File.exists?('./spec.xml').must_equal true 21 | ensure 22 | FileUtils.rm('./spec.xml') rescue nil 23 | end 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /spec/spec Project/Ableton Project Info/Project8_1.cfg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mgarriss/guard-live-set/711601b65e8b4ae63486c215c65f3d9447f16cac/spec/spec Project/Ableton Project Info/Project8_1.cfg -------------------------------------------------------------------------------- /spec/spec Project/Icon : -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mgarriss/guard-live-set/711601b65e8b4ae63486c215c65f3d9447f16cac/spec/spec Project/Icon -------------------------------------------------------------------------------- /spec/spec Project/spec.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mgarriss/guard-live-set/711601b65e8b4ae63486c215c65f3d9447f16cac/spec/spec Project/spec.als -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | dir = File.dirname(File.expand_path(__FILE__)) 2 | $LOAD_PATH.unshift dir + '/../lib' 3 | 4 | require 'minitest/autorun' 5 | 6 | 7 | 8 | --------------------------------------------------------------------------------