[IC:SymbolHash{n:Reflection::Supporto:$YARD::CodeObjects::ModuleObject:@class_mixinsIC:&YARD::CodeObjects::CodeObjectList[: @owner@:@current_file_has_commentsF: @files[["lib/reflection/support.rbi[""lib/reflection/support/log.rbi["#lib/reflection/support/home.rbi: @name: Support:@childrenIC; [o:$YARD::CodeObjects::MethodObject:@parameters[[" message0; F: @scope: class; [[@ i ; :exit_with_error:@signature"Odef self.exit_with_error(message) puts message exit(1) end:@namespace@:@visibility: public: @linei : @tags[:@explicitT: @source"Cdef self.exit_with_error(message) puts message exit(1) end:@docstringIC:YARD::Docstring" :@line_range0:@ref_tags[: @object@:@tag_factoryo:YARD::Tags::Library: @factoryo:YARD::Tags::DefaultFactory;[: @all"o:#YARD::CodeObjects::ClassObject;IC; [; @ ; F; [[@ i:@superclasso:YARD::CodeObjects::Proxy: @obj0; : Object;@; :Log;IC; [o;;[[" message0; F;: instance; [[@ i ; : debug;"\def debug(message) puts "** #{message}" if message && !message.empty? end;@ ;;;i ;[;T;"Pdef debug(message) puts "** #{message}" if message && !message.empty? end;IC;" ;0; [;!@&;"o;#;$@;[;&"o;;[[" message0; F;;-; [[@ i; : info;"[def info(message) puts "** #{message}" if message && !message.empty? end;@ ;;;i;[;T;"Odef info(message) puts "** #{message}" if message && !message.empty? end;IC;" ;0; [;!@4;"o;#;$@;[;&"o;;[[" message0; F;;-; [[@ i; : error;"\def error(message) puts "!! #{message}" if message && !message.empty? end;@ ;;;i;[;T;"Pdef error(message) puts "!! #{message}" if message && !message.empty? end;IC;" ;0; [;!@B;"o;#;$@;[;&"; @ :@attributesIC;{;-IC;{:@symbolize_valueT;IC;{;2T;2T;@: @aliases{;[:@instance_mixinsIC; [; @ ;IC;" ;0; [;!@ ;"o;#;$@;[;&"o;';IC; [; @[; F; [[@i;(o;);*0; ;+;@; : Home;IC; [o;;[; F;;-; [[@i ; : path;"adef path @path ||= File.expand_path(File.join(ENV['HOME'], '.reflection')) end;@[;;;i ;[;T;"Udef path @path ||= File.expand_path(File.join(ENV['HOME'], '.reflection')) end;IC;" ;0; [;!@a;"o;#;$@;[;&"o;;[; F;;-; [[@i; : create;"jdef create unless File.exist?(self.path) Dir.mkdir(self.path) end end;@[;;;i;[;T;"Rdef create unless File.exist?(self.path) Dir.mkdir(self.path) end end;IC;" ;0; [;!@m;"o;#;$@;[;&"; @[;1IC;{;-IC;{;2T;IC;{;2T;2T;@;3{;[;4IC; [; @[;IC;" ;0; [;!@[;"o;#;$@;[;&"; @;1IC;{;-IC;{;2T;IC;{;2T;2T;o;;IC; [; @; F; [["lib/reflection.rbi["lib/reflection/cli.rbi["lib/reflection/rails.rbi["lib/reflection/config.rbi [@ i["lib/reflection/command.rbi[" lib/reflection/directory.rbi["!lib/reflection/repository.rbi [@ i[""lib/reflection/validations.rbi[@i["#lib/reflection/command/base.rbi["$lib/reflection/command/apply.rbi["$lib/reflection/command/stash.rbi["%lib/reflection/directory/base.rbi["&lib/reflection/directory/stash.rbi; :Reflection;IC; [o;;[; F;;; [[@i; : home=;"def home=(value);@;;;[;")def home=(value) @home = value end;IC;"Sets the attribute +home+ ;0; [;!@;"o;#;$@;[o:YARD::Tags::Tag : @types0;!@; " value: @text".the value to set the attribute +home+ to.:@tag_name" param;&"USets the attribute +home+ @param value the value to set the attribute +home+ to.o;;[; F;;; [[@i; : home;" def home;@;;;[;"def home @home end;IC;"*Returns the value of attribute +home+ ;0; [;!@;"o;#;$@;[;&"*Returns the value of attribute +home+o;;[; F;;; [[@i; : log=;"def log=(value);@;;;[;"'def log=(value) @log = value end;IC;"Sets the attribute +log+ ;0; [;!@;"o;#;$@;[o;: ;;0;!@; " value;<"-the value to set the attribute +log+ to.;=" param;&"SSets the attribute +log+ @param value the value to set the attribute +log+ to.o;;[; F;;; [[@i; :log;" def log;@;;;[;"def log @log end;IC;")Returns the value of attribute +log+ ;0; [;!@;"o;#;$@;[;&")Returns the value of attribute +log+o;;[[" args0; F;;; [[@i; : boot!;"def boot!(args) @log = Reflection::Support::Log.new @home = Reflection::Support::Home.new @home.create Reflection::CLI.run!(args) end;@;;;i;[;T;"def boot!(args) @log = Reflection::Support::Log.new @home = Reflection::Support::Home.new @home.create Reflection::CLI.run!(args) end;IC;" ;0; [;!@;"o;#;$@;[;&"o;;IC; [; @; F; [[@i; :CLI;IC; [o;;[[" args"nil; F;;; [[@i ; : run!;"idef run!(args = nil) config = Reflection::Config.parse(args) if verify_config(config) == false Reflection::Support.exit_with_error("Ahh ja, missing arguments. Please read 'reflection --help' to get a feeling of how it works.") else case config.command when :apply Reflection::Command::Apply.run!(config) when :stash Reflection::Command::Stash.run!(config) else Reflection::Support.exit_with_error("Couldn't identify command. Please run 'reflection --help'.") end end end;@;;;i ;[;T;"def run!(args = nil) config = Reflection::Config.parse(args) if verify_config(config) == false Reflection::Support.exit_with_error("Ahh ja, missing arguments. Please read 'reflection --help' to get a feeling of how it works.") else case config.command when :apply Reflection::Command::Apply.run!(config) when :stash Reflection::Command::Stash.run!(config) else Reflection::Support.exit_with_error("Couldn't identify command. Please run 'reflection --help'.") end end end;IC;" ;0; [;!@;"o;#;$@;[;&"o;;[[" config0; F;;; [[@i; :verify_config;"def verify_config(config) return ([:stash, :apply].include?(config.command) && !config.repository.nil? && !config.directory.nil?) ? config : false end;@;: private;i;[;T;"def verify_config(config) return ([:stash, :apply].include?(config.command) && !config.repository.nil? && !config.directory.nil?) ? config : false end;IC;" ;0; [;!@;"o;#;$@;[;&"; @;1IC;{;-IC;{;2T;IC;{;2T;2T;@;3{;[;4IC; [; @;IC;" ;0; [;!@;"o;#;$@;[;&"o;;IC; [; @; F; [[@i; : Rails;IC; [ o;;[[" config0; F;;; [[@i ; :validate_environment;"Rdef validate_environment(config) env_file_path = File.join(config.rails_root, 'config/environments', "#{config.rails_environment}.rb") unless File.exist?(env_file_path) Reflection::Support.exit_with_error("Rails environment '#{config.rails_environment}' doesn't exist in #{env_file_path}.") end end;@;;;i ;[;T;"4def validate_environment(config) env_file_path = File.join(config.rails_root, 'config/environments', "#{config.rails_environment}.rb") unless File.exist?(env_file_path) Reflection::Support.exit_with_error("Rails environment '#{config.rails_environment}' doesn't exist in #{env_file_path}.") end end;IC;" ;0; [;!@;"o;#;$@;[;&"o;;[["target_directory0; F;;; [[@i; :clean_target;"def clean_target(target_directory) target_file_path = File.join(target_directory.path, '_rails_database_dump.sql') if File.exist?(target_file_path) %x(rm #{target_file_path}) end end;@;;;i;[;T;"def clean_target(target_directory) target_file_path = File.join(target_directory.path, '_rails_database_dump.sql') if File.exist?(target_file_path) %x(rm #{target_file_path}) end end;IC;" ;0; [;!@);"o;#;$@;[;&"o;;[["database_config0; F;;; [[@i; :"database_command_line_options;"def database_command_line_options(database_config) options = [] options << "-h #{database_config['host']}" options << "-u #{database_config['username']}" options << "-p #{database_config['password']}" if database_config['password'] && !database_config['password'].empty? options << "#{database_config['database']}" options.join(' ') end;@;;;i;[;T;"`def database_command_line_options(database_config) options = [] options << "-h #{database_config['host']}" options << "-u #{database_config['username']}" options << "-p #{database_config['password']}" if database_config['password'] && !database_config['password'].empty? options << "#{database_config['database']}" options.join(' ') end;IC;" ;0; [;!@7;"o;#;$@;[;&"o;;[[" config0; F;;; [[@i!; : read_database_configuration;"Hdef read_database_configuration(config) begin database_path = File.join(config.rails_root, "config/database.yml") if db_config = YAML.load_file(database_path)[config.rails_environment] return db_config else Reflection.log.error("Rails database configuration for '#{config.rails_environment}' isn't available in #{database_path}") return false end rescue => e Reflection.log.error("Error while parsing Rails database configuration: #{e}") return false end end;@;;;i!;[;T;"def read_database_configuration(config) begin database_path = File.join(config.rails_root, "config/database.yml") if db_config = YAML.load_file(database_path)[config.rails_environment] return db_config else Reflection.log.error("Rails database configuration for '#{config.rails_environment}' isn't available in #{database_path}") return false end rescue => e Reflection.log.error("Error while parsing Rails database configuration: #{e}") return false end end;IC;" ;0; [;!@E;"o;#;$@;[;&"o;;[[" config0["target_directory0; F;;; [[@i0; : stash;"def stash(config, target_directory) Reflection.log.debug "Stashing database dump.." return unless database_config = read_database_configuration(config) options = database_command_line_options(database_config) target_file_path = File.join(target_directory.path, '_rails_database_dump.sql') %x(mysqldump #{options} --add-drop-table > #{target_file_path}) end;@;;;i0;[;T;"ndef stash(config, target_directory) Reflection.log.debug "Stashing database dump.." return unless database_config = read_database_configuration(config) options = database_command_line_options(database_config) target_file_path = File.join(target_directory.path, '_rails_database_dump.sql') %x(mysqldump #{options} --add-drop-table > #{target_file_path}) end;IC;" ;0; [;!@S;"o;#;$@;[;&"o;;[[" config0["target_directory0; F;;; [[@i8; : apply;"def apply(config, target_directory) Reflection.log.debug "Applying database dump.." return unless database_config = read_database_configuration(config) options = database_command_line_options(database_config) target_file_path = File.join(target_directory.path, '_rails_database_dump.sql') %x(mysql #{options} < #{target_file_path}) clean_target(target_directory) end;@;;;i8;[;T;"def apply(config, target_directory) Reflection.log.debug "Applying database dump.." return unless database_config = read_database_configuration(config) options = database_command_line_options(database_config) target_file_path = File.join(target_directory.path, '_rails_database_dump.sql') %x(mysql #{options} < #{target_file_path}) clean_target(target_directory) end;IC;" ;0; [;!@c;"o;#;$@;[;&"; @;1IC;{;-IC;{;2T;IC;{;2T;2T;@;3{;[;4IC; [; @;IC;" ;0; [;!@;"o;#;$@;[;&"o;';IC; [; @~; F; [[@i ;(o;);*0; :StandardError;@; :ConfigArgumentError;IC; [; @~;1IC;{;-IC;{;2T;IC;{;2T;2T;@;3{;[;4IC; [; @~;IC;" ;0; [;!@~;"o;#;$@;[;&"o;';IC; [; @; F; [[@i;(o;);*0; ;+;@; : Config;IC; [o;;[; F;;-; [[@i; : command=;"def command=(value);@;;;[;"/def command=(value) @command = value end;IC;"!Sets the attribute +command+ ;0; [;!@;"o;#;$@;[o;: ;;0;!@; " value;<"1the value to set the attribute +command+ to.;=" param;&"[Sets the attribute +command+ @param value the value to set the attribute +command+ to.o;;[; F;;-; [[@i; : command;"def command;@;;;[;"def command @command end;IC;"-Returns the value of attribute +command+ ;0; [;!@;"o;#;$@;[;&"-Returns the value of attribute +command+o;;[; F;;-; [[@i; :directory=;"def directory=(value);@;;;[;"3def directory=(value) @directory = value end;IC;"#Sets the attribute +directory+ ;0; [;!@;"o;#;$@;[o;: ;;0;!@; " value;<"3the value to set the attribute +directory+ to.;=" param;&"_Sets the attribute +directory+ @param value the value to set the attribute +directory+ to.o;;[; F;;-; [[@i; :directory;"def directory;@;;;[;"#def directory @directory end;IC;"/Returns the value of attribute +directory+ ;0; [;!@;"o;#;$@;[;&"/Returns the value of attribute +directory+o;;[; F;;-; [[@i; :repository=;"def repository=(value);@;;;[;"5def repository=(value) @repository = value end;IC;"$Sets the attribute +repository+ ;0; [;!@;"o;#;$@;[o;: ;;0;!@; " value;<"4the value to set the attribute +repository+ to.;=" param;&"aSets the attribute +repository+ @param value the value to set the attribute +repository+ to.o;;[; F;;-; [[@i; :repository;"def repository;@;;;[;"%def repository @repository end;IC;"0Returns the value of attribute +repository+ ;0; [;!@;"o;#;$@;[;&"0Returns the value of attribute +repository+o;;[; F;;-; [[@i; :rails_root=;"def rails_root=(value);@;;;[;"5def rails_root=(value) @rails_root = value end;IC;"$Sets the attribute +rails_root+ ;0; [;!@;"o;#;$@;[o;: ;;0;!@; " value;<"4the value to set the attribute +rails_root+ to.;=" param;&"aSets the attribute +rails_root+ @param value the value to set the attribute +rails_root+ to.o;;[; F;;-; [[@i; :rails_root;"def rails_root;@;;;[;"%def rails_root @rails_root end;IC;"0Returns the value of attribute +rails_root+ ;0; [;!@;"o;#;$@;[;&"0Returns the value of attribute +rails_root+o;;[; F;;-; [[@i; :rails_environment=;""def rails_environment=(value);@;;;[;"Cdef rails_environment=(value) @rails_environment = value end;IC;"+Sets the attribute +rails_environment+ ;0; [;!@;"o;#;$@;[o;: ;;0;!@; " value;<";the value to set the attribute +rails_environment+ to.;=" param;&"oSets the attribute +rails_environment+ @param value the value to set the attribute +rails_environment+ to.o;;[; F;;-; [[@i; :rails_environment;"def rails_environment;@;;;[;"3def rails_environment @rails_environment end;IC;"7Returns the value of attribute +rails_environment+ ;0; [;!@;"o;#;$@;[;&"7Returns the value of attribute +rails_environment+o;;[; F;;-; [[@i; :store_configuration_path=;")def store_configuration_path=(value);@;;;[;"Qdef store_configuration_path=(value) @store_configuration_path = value end;IC;"2Sets the attribute +store_configuration_path+ ;0; [;!@!;"o;#;$@;[o;: ;;0;!@!; " value;<"Bthe value to set the attribute +store_configuration_path+ to.;=" param;&"}Sets the attribute +store_configuration_path+ @param value the value to set the attribute +store_configuration_path+ to.o;;[; F;;-; [[@i; :store_configuration_path;"!def store_configuration_path;@;;;[;"Adef store_configuration_path @store_configuration_path end;IC;">Returns the value of attribute +store_configuration_path+ ;0; [;!@1;"o;#;$@;[;&">Returns the value of attribute +store_configuration_path+o;;[[" args"[]; F;;; [[@i; : parse;"def self.parse(args = []) config = Config.new case when !args.empty? && File.exists?(args.first) config.read!(args.first) when !args.empty? config.parse_command_line_options(args) config.write(config.store_configuration_path) if config.store_configuration_path else config.read!(File.join(Dir.pwd, 'reflection.yml')) end config end;@;;;i;[;T;"wdef self.parse(args = []) config = Config.new case when !args.empty? && File.exists?(args.first) config.read!(args.first) when !args.empty? config.parse_command_line_options(args) config.write(config.store_configuration_path) if config.store_configuration_path else config.read!(File.join(Dir.pwd, 'reflection.yml')) end config end;IC;" ;0; [;!@=;"o;#;$@;[;&"o;;[; F;;-; [[@i%; : to_hash;"def to_hash { :command => self.command, :repository => self.repository, :directory => self.directory, :rails_root => self.rails_root, :rails_environment => self.rails_environment } end;@;;;i%;[;T;"def to_hash { :command => self.command, :repository => self.repository, :directory => self.directory, :rails_root => self.rails_root, :rails_environment => self.rails_environment } end;IC;" ;0; [;!@L;"o;#;$@;[;&"o;;[[" hash0; F;;-; [[@i/; :from_hash;"def from_hash(hash) self.command = hash[:command] self.directory = hash[:directory] self.repository = hash[:repository] self.rails_root = hash[:rails_root] self.rails_environment = hash[:rails_environment] end;@;;;i/;[;T;"def from_hash(hash) self.command = hash[:command] self.directory = hash[:directory] self.repository = hash[:repository] self.rails_root = hash[:rails_root] self.rails_environment = hash[:rails_environment] end;IC;" ;0; [;!@X;"o;#;$@;[;&"o;;[[" path0; F;;-; [[@i7; : write;"def write(path) begin io = File.open(path, 'w') YAML.dump(self.to_hash, io) io.close rescue => e Reflection::Support.exit_with_error("Writing of config file to '#{path}' failed: #{e.message}") end end;@;;;i7;[;T;"def write(path) begin io = File.open(path, 'w') YAML.dump(self.to_hash, io) io.close rescue => e Reflection::Support.exit_with_error("Writing of config file to '#{path}' failed: #{e.message}") end end;IC;" ;0; [;!@f;"o;#;$@;[;&"o;;[[" path0; F;;-; [[@iA; : read!;"def read!(path) begin if File.exist?(path) options = YAML.load_file(path) raise(Reflection::ConfigArgumentError, "Config file is invalid.") unless options.is_a?(Hash) self.from_hash(options) end rescue => e Reflection::Support.exit_with_error("Parsing of config file '#{path}' failed: #{e.message}") end end;@;;;iA;[;T;"Wdef read!(path) begin if File.exist?(path) options = YAML.load_file(path) raise(Reflection::ConfigArgumentError, "Config file is invalid.") unless options.is_a?(Hash) self.from_hash(options) end rescue => e Reflection::Support.exit_with_error("Parsing of config file '#{path}' failed: #{e.message}") end end;IC;" ;0; [;!@t;"o;#;$@;[;&"o;;[[" args0; F;;-; [[@iM; :parse_command_line_options;"def parse_command_line_options(args) opt_parser = OptionParser.new do |opts| opts.banner = "Usage: reflection --COMMAND --repository=GIT_REPO --directory=PATH\n" opts.banner << " -or-\n" opts.banner << "Usage: reflection /path/to/reflection-config-file.yml" opts.separator " " opts.separator "On the server side:" opts.on("-s", "--stash", "Store your assets and/or a database dump in a git-repository.") do |stash| self.command = :stash end opts.separator "On the client side:" opts.on("-a", "--apply", "Apply assets and/or a database dump loaded from a git-repository.") do |apply| self.command = :apply end opts.separator " " opts.separator "Required options for both:" opts.on("-r", "--repository GIT_URL", "A Git repository(url) to be used as storage") do |repository| self.repository = repository end opts.on("-d", "--directory PATH", "Path to your asset directory") do |directory| self.directory = directory end opts.separator " " opts.separator "Additional options for both:" opts.on("--rails [RAILS_ROOT]", "Enable dumping/applying of a Rails managed MySQL database") do |path| self.rails_root = path || nil end opts.on("--rails-env [ENV]", "Rails environment to instrument") do |environment| self.rails_environment = environment || nil end opts.on("--write [FILE]", "Create a configuration FILE from the current commandline options") do |config_file_path| self.store_configuration_path = config_file_path if config_file_path end end opt_parser.parse!(args) end;@;;;iM;[;T;"sdef parse_command_line_options(args) opt_parser = OptionParser.new do |opts| opts.banner = "Usage: reflection --COMMAND --repository=GIT_REPO --directory=PATH\n" opts.banner << " -or-\n" opts.banner << "Usage: reflection /path/to/reflection-config-file.yml" opts.separator " " opts.separator "On the server side:" opts.on("-s", "--stash", "Store your assets and/or a database dump in a git-repository.") do |stash| self.command = :stash end opts.separator "On the client side:" opts.on("-a", "--apply", "Apply assets and/or a database dump loaded from a git-repository.") do |apply| self.command = :apply end opts.separator " " opts.separator "Required options for both:" opts.on("-r", "--repository GIT_URL", "A Git repository(url) to be used as storage") do |repository| self.repository = repository end opts.on("-d", "--directory PATH", "Path to your asset directory") do |directory| self.directory = directory end opts.separator " " opts.separator "Additional options for both:" opts.on("--rails [RAILS_ROOT]", "Enable dumping/applying of a Rails managed MySQL database") do |path| self.rails_root = path || nil end opts.on("--rails-env [ENV]", "Rails environment to instrument") do |environment| self.rails_environment = environment || nil end opts.on("--write [FILE]", "Create a configuration FILE from the current commandline options") do |config_file_path| self.store_configuration_path = config_file_path if config_file_path end end opt_parser.parse!(args) end;IC;" ;0; [;!@;"o;#;$@;[;&"; @;1IC;{;-IC;{ ;WIC;{;_@: read@;2T;SIC;{;_@;b@;2T;YIC;{;_@;b@;2T;QIC;{;_@;b@;2T;UIC;{;_@;b@;2T;[IC;{;_@!;b@1;2T;2T;IC;{;2T;2T;@;3{;[;4IC; [; @;IC;" ;0; [;!@;"o;#;$@;[;&"@o;;IC; [; @; F; [ [@i[@i[@i [@i ; : Command;IC; [o;';IC; [; @; F; [[@i;(o;);*0; ;+;@; : Base;IC; [ o;;[; F;;-; [[@i ; : config=;"def config=(value);@;;;[;"-def config=(value) @config = value end;IC;" Sets the attribute +config+ ;0; [;!@;"o;#;$@;[o;: ;;0;!@; " value;<"0the value to set the attribute +config+ to.;=" param;&"YSets the attribute +config+ @param value the value to set the attribute +config+ to.o;;[; F;;-; [[@i ; : config;"def config;@;;;[;"def config @config end;IC;",Returns the value of attribute +config+ ;0; [;!@;"o;#;$@;[;&",Returns the value of attribute +config+o;;[[" config0; F;;; [[@i ; ;C;"def self.run!(config) command = self.new(config) command.validate! if command.respond_to?(:validate!) command.run! end;@;;;i ;[;T;"|def self.run!(config) command = self.new(config) command.validate! if command.respond_to?(:validate!) command.run! end;IC;" ;0; [;!@;"o;#;$@;[;&"o;;[["new_config0; F;;-; [[@i; :initialize;"Pdef initialize(new_config) self.config = new_config end ;@;;;i;[;T;">def initialize(new_config) self.config = new_config end;IC;" ;0; [;!@;"o;#;$@;[o;: ;;[" Base;!@; 0;<"a new instance of +Base+;=" return;&"o;;[; F;;-; [[@i; : validate;";def validate Reflection::Validations end;@;;;i;[;T;"/def validate Reflection::Validations end;IC;" ;0; [;!@;"o;#;$@;[;&"o;;[["target_directory0; F;;-; [[@i; :+verify_that_target_is_not_a_repository;"5def verify_that_target_is_not_a_repository(target_directory) if Repository.exists?(target_directory.path) Support.exit_with_error "The specified --directory is a repository. Reflection is afraid of breaking something, so it won't touch it. Pleace specify another one.." end end;@;;;i;[;T;"def verify_that_target_is_not_a_repository(target_directory) if Repository.exists?(target_directory.path) Support.exit_with_error "The specified --directory is a repository. Reflection is afraid of breaking something, so it won't touch it. Pleace specify another one.." end end;IC;" ;0; [;!@;"o;#;$@;[;&"; @;1IC;{;-IC;{;fIC;{;_@;b@;2T;2T;IC;{;2T;2T;@;3{;[;4IC; [; @;IC;" ;0; [;!@;"o;#;$@;[;&"o;';IC; [; @; F; [[@i ;(o;) ;*@:@origname"Reflection::Command::Base; ;d;@:@orignamespace@; : Apply;IC; [ o;;[; F;;-; [[@i ; :validate!;"def validate! validate.existence_of config.directory if config.rails_root validate.existence_of config.rails_root Reflection::Rails.validate_environment(config) end end;@;;;i ;[;T;"def validate! validate.existence_of config.directory if config.rails_root validate.existence_of config.rails_root Reflection::Rails.validate_environment(config) end end;IC;" ;0; [;!@;"o;#;$@;[;&"o;;[; F;;-; [[@i; ;C;"def run! stash_directory = Directory::Stash.new(Reflection::Repository.new(config.repository), 'apply') target_directory = Directory::Base.new(config.directory) get_user_approval_for_cleaning_target(target_directory) get_user_approval_for_apply_database_dump if config.rails_root verify_that_target_is_not_a_repository(target_directory) Reflection.log.info "Applying '#{config.repository}' >> '#{config.directory}'.." target_directory.clean! if stash_directory.exists? stash_directory.validate_repository stash_directory.copy_git_index_to(target_directory.path) repo = Repository.new_from_path(target_directory.path) repo.reset! repo.pull stash_directory.get_git_index_from(target_directory.path) else stash_directory.clone_repository stash_directory.move_content_to(target_directory.path) stash_directory.get_git_index_from(target_directory.path) end Reflection::Rails.apply(config, target_directory) Reflection.log.info "Apply Command done." end;@;;;i;[;T;"def run! stash_directory = Directory::Stash.new(Reflection::Repository.new(config.repository), 'apply') target_directory = Directory::Base.new(config.directory) get_user_approval_for_cleaning_target(target_directory) get_user_approval_for_apply_database_dump if config.rails_root verify_that_target_is_not_a_repository(target_directory) Reflection.log.info "Applying '#{config.repository}' >> '#{config.directory}'.." target_directory.clean! if stash_directory.exists? stash_directory.validate_repository stash_directory.copy_git_index_to(target_directory.path) repo = Repository.new_from_path(target_directory.path) repo.reset! repo.pull stash_directory.get_git_index_from(target_directory.path) else stash_directory.clone_repository stash_directory.move_content_to(target_directory.path) stash_directory.get_git_index_from(target_directory.path) end Reflection::Rails.apply(config, target_directory) Reflection.log.info "Apply Command done." end;IC;" ;0; [;!@%;"o;#;$@;[;&"o;;[["target_directory0; F;;-; [[@i5; :*get_user_approval_for_cleaning_target;"vdef get_user_approval_for_cleaning_target(target_directory) puts "\nIn order to get a fresh copy of your files, Reflection will have to remove all files under '#{target_directory.path}'." puts "If you are sure, hit to proceed.." unless STDIN.getc == 10 puts "Aborting.." exit end end;@;;E;i5;[;T;"6def get_user_approval_for_cleaning_target(target_directory) puts "\nIn order to get a fresh copy of your files, Reflection will have to remove all files under '#{target_directory.path}'." puts "If you are sure, hit to proceed.." unless STDIN.getc == 10 puts "Aborting.." exit end end;IC;" ;0; [;!@1;"o;#;$@;[;&"o;;[; F;;-; [[@i?; :.get_user_approval_for_apply_database_dump;"ydef get_user_approval_for_apply_database_dump puts "\nCaution: You've enabled Rails database dumping/applying." puts "In order to apply a fresh dump, Reflection will override your database." puts "If you are sure, hit to proceed.." unless STDIN.getc == 10 puts "Aborting.." exit end end;@;;E;i?;[;T;"9def get_user_approval_for_apply_database_dump puts "\nCaution: You've enabled Rails database dumping/applying." puts "In order to apply a fresh dump, Reflection will override your database." puts "If you are sure, hit to proceed.." unless STDIN.getc == 10 puts "Aborting.." exit end end;IC;" ;0; [;!@?;"o;#;$@;[;&"; @;1IC;{;-IC;{;2T;IC;{;2T;2T;@;3{;[;4IC; [; @;IC;" ;0; [;!@;"o;#;$@;[;&"o;';IC; [; @V; F; [[@i ;(o;) ;*@;j"Reflection::Command::Base; ;d;@;k@; : Stash;IC; [ o;;[; F;;-; [[@i ; ;m;"def validate! validate.existence_of config.directory if config.rails_root validate.existence_of config.rails_root Reflection::Rails.validate_environment(config) end end;@V;;;i ;[;T;"def validate! validate.existence_of config.directory if config.rails_root validate.existence_of config.rails_root Reflection::Rails.validate_environment(config) end end;IC;" ;0; [;!@];"o;#;$@;[;&"o;;[; F;;-; [[@i; ;C;"def run! Reflection.log.info "Stashing '#{config.directory}'.." stash_directory = Directory::Stash.new(Reflection::Repository.new(config.repository), 'stash') target_directory = Directory::Base.new(config.directory) verify_that_target_is_not_a_repository(target_directory) prepare_stash_repository(stash_directory) stash_directory_into_repository(stash_directory, target_directory) Reflection.log.info "Stash Command done." end;@V;;;i;[;T;"def run! Reflection.log.info "Stashing '#{config.directory}'.." stash_directory = Directory::Stash.new(Reflection::Repository.new(config.repository), 'stash') target_directory = Directory::Base.new(config.directory) verify_that_target_is_not_a_repository(target_directory) prepare_stash_repository(stash_directory) stash_directory_into_repository(stash_directory, target_directory) Reflection.log.info "Stash Command done." end;IC;" ;0; [;!@i;"o;#;$@;[;&"o;;[["stash_directory0; F;;-; [[@i"; :prepare_stash_repository;" def prepare_stash_repository(stash_directory) Reflection.log.debug "Preparing stash repository.." if stash_directory.exists? stash_directory.validate_repository else stash_directory.clone_repository end end;@V;;;i";[;T;"def prepare_stash_repository(stash_directory) Reflection.log.debug "Preparing stash repository.." if stash_directory.exists? stash_directory.validate_repository else stash_directory.clone_repository end end;IC;" ;0; [;!@u;"o;#;$@;[;&"o;;[["stash_directory0["target_directory0; F;;-; [[@i,; :$stash_directory_into_repository;"def stash_directory_into_repository(stash_directory, target_directory) copy_stash_repository_git_index_to_target(stash_directory.git_index, target_directory.path) Reflection::Rails.stash(config, target_directory) if config.rails_root commit_and_push_files(target_directory.path, target_directory.name) move_stash_repository_git_index_back(target_directory.git_index, stash_directory.path) Reflection::Rails.clean_target(target_directory) if config.rails_root end;@V;;;i,;[;T;"def stash_directory_into_repository(stash_directory, target_directory) copy_stash_repository_git_index_to_target(stash_directory.git_index, target_directory.path) Reflection::Rails.stash(config, target_directory) if config.rails_root commit_and_push_files(target_directory.path, target_directory.name) move_stash_repository_git_index_back(target_directory.git_index, stash_directory.path) Reflection::Rails.clean_target(target_directory) if config.rails_root end;IC;" ;0; [;!@;"o;#;$@;[;&"o;;[[" source0[" target0; F;;-; [[@i7; :.copy_stash_repository_git_index_to_target;"wdef copy_stash_repository_git_index_to_target(source, target) FileUtils.cp_r(source, target) end;@V;;E;i7;[;T;"gdef copy_stash_repository_git_index_to_target(source, target) FileUtils.cp_r(source, target) end;IC;" ;0; [;!@;"o;#;$@;[;&"o;;[["repository_path0[" target0; F;;-; [[@i;; :commit_and_push_files;"def commit_and_push_files(repository_path, target) repository = Repository.new_from_path(repository_path) repository.commit_all_new_files repository.push end;@V;;E;i;;[;T;"def commit_and_push_files(repository_path, target) repository = Repository.new_from_path(repository_path) repository.commit_all_new_files repository.push end;IC;" ;0; [;!@;"o;#;$@;[;&"o;;[[" source0[" target0; F;;-; [[@iA; :)move_stash_repository_git_index_back;"def move_stash_repository_git_index_back(source, target) FileUtils.rm_r(File.join(target, "/.git")) FileUtils.mv(source, target) end;@V;;E;iA;[;T;"def move_stash_repository_git_index_back(source, target) FileUtils.rm_r(File.join(target, "/.git")) FileUtils.mv(source, target) end;IC;" ;0; [;!@;"o;#;$@;[;&"; @V;1IC;{;-IC;{;2T;IC;{;2T;2T;@;3{;[;4IC; [; @V;IC;" ;0; [;!@V;"o;#;$@;[;&"; @;1IC;{;-IC;{;2T;IC;{;2T;2T;@;3{;[;4IC; [; @;IC;" ;0; [;!@;"o;#;$@;[;&"o;;IC; [; @; F; [[@i[@i [@i; :Directory;IC; [o;';IC; [; @; F; [[@i ;(o;);*0; ;+;@; ;d;IC; [o;;[; F;;-; [[@i ; : path=;"def path=(value);@;;;[;")def path=(value) @path = value end;IC;"Sets the attribute +path+ ;0; [;!@;"o;#;$@;[o;: ;;0;!@; " value;<".the value to set the attribute +path+ to.;=" param;&"USets the attribute +path+ @param value the value to set the attribute +path+ to.o;;[; F;;-; [[@i ; ;6;" def path;@;;;[;"def path @path end;IC;"*Returns the value of attribute +path+ ;0; [;!@;"o;#;$@;[;&"*Returns the value of attribute +path+o;;[[" new_path0; F;;-; [[@i; ;g;"Ddef initialize(new_path) self.path = new_path end;@;;;i;[;T;"8def initialize(new_path) self.path = new_path end;IC;" ;0; [;!@;"o;#;$@;[o;: ;;[" Base;!@; 0;<"a new instance of +Base+;=" return;&"o;;[; F;;-; [[@i; : to_s;")def to_s self.path end;@;;;i;[;T;"def to_s self.path end;IC;" ;0; [;!@;"o;#;$@;[;&"o;;[; F;;-; [[@i; : exists?;"9def exists? File.exist?(self.path) end;@;;;i;[;T;"-def exists? File.exist?(self.path) end;IC;" ;0; [;!@!;"o;#;$@;[;&"o;;[; F;;-; [[@i; : clean!;"rdef clean! Reflection.log.debug "Cleaning #{self.path}/.." %x(rm -r #{self.path}/*) end;@;;;i;[;T;"`def clean! Reflection.log.debug "Cleaning #{self.path}/.." %x(rm -r #{self.path}/*) end;IC;" ;0; [;!@-;"o;#;$@;[;&"o;;[; F;;-; [[@i; : parent;"cdef parent Base.new(File.expand_path(self.path.split('/')[0..-2].join('/'))) end;@;;;i;[;T;"Wdef parent Base.new(File.expand_path(self.path.split('/')[0..-2].join('/'))) end;IC;" ;0; [;!@9;"o;#;$@;[;&"o;;[; F;;-; [[@i#; : name;"9def name self.path.split('/').last end;@;;;i#;[;T;"-def name self.path.split('/').last end;IC;" ;0; [;!@E;"o;#;$@;[;&"o;;[; F;;-; [[@i'; :git_index;"Sdef git_index File.expand_path(File.join(self.path, '.git')) end;@;;;i';[;T;"Gdef git_index File.expand_path(File.join(self.path, '.git')) end;IC;" ;0; [;!@Q;"o;#;$@;[;&"o;;[["target_path0; F;;-; [[@i+; :copy_git_index_to;"def copy_git_index_to(target_path) Reflection.log.debug "Copying git-index '#{self.git_index}' to #{target_path}" FileUtils.cp_r(self.git_index, target_path) end;@;;;i+;[;T;"def copy_git_index_to(target_path) Reflection.log.debug "Copying git-index '#{self.git_index}' to #{target_path}" FileUtils.cp_r(self.git_index, target_path) end;IC;" ;0; [;!@];"o;#;$@;[;&"o;;[["target_path0; F;;-; [[@i0; :get_git_index_from;"4def get_git_index_from(target_path) Reflection.log.debug "Getting git-index from #{target_path}" %x(rm -rf #{self.git_index}) if File.exists?(self.git_index) %x(mkdir -p #{self.path}) %x(mv -f #{File.join(target_path, '/.git')} #{File.join(self.path, "/")}) end;@;;;i0;[;T;"def get_git_index_from(target_path) Reflection.log.debug "Getting git-index from #{target_path}" %x(rm -rf #{self.git_index}) if File.exists?(self.git_index) %x(mkdir -p #{self.path}) %x(mv -f #{File.join(target_path, '/.git')} #{File.join(self.path, "/")}) end;IC;" ;0; [;!@k;"o;#;$@;[;&"o;;[["target_path0; F;;-; [[@i8; :move_content_to;"def move_content_to(target_path) Reflection.log.debug "Moving content to '#{target_path}'.." FileUtils.cp_r(File.join(self.path, '/.'), target_path) FileUtils.rm_r(File.join(self.path, '/')) end;@;;;i8;[;T;"def move_content_to(target_path) Reflection.log.debug "Moving content to '#{target_path}'.." FileUtils.cp_r(File.join(self.path, '/.'), target_path) FileUtils.rm_r(File.join(self.path, '/')) end;IC;" ;0; [;!@y;"o;#;$@;[;&"; @;1IC;{;-IC;{;6IC;{;_@;b@;2T;2T;IC;{;2T;2T;@;3{;[;4IC; [; @;IC;" ;0; [;!@;"o;#;$@;[;&"o;';IC; [; @; F; [[@i;(o;) ;*@;j"Directory::Base; ;d;@;k@; ;p;IC; [ o;;[; F;;-; [[@i ; ;T;"def repository=(value);@;;;[;"5def repository=(value) @repository = value end;IC;"$Sets the attribute +repository+ ;0; [;!@;"o;#;$@;[o;: ;;0;!@; " value;<"4the value to set the attribute +repository+ to.;=" param;&"aSets the attribute +repository+ @param value the value to set the attribute +repository+ to.o;;[; F;;-; [[@i ; ;U;"def repository;@;;;[;"%def repository @repository end;IC;"0Returns the value of attribute +repository+ ;0; [;!@;"o;#;$@;[;&"0Returns the value of attribute +repository+o;;[["repository0["identifier_prefix0; F;;-; [[@i ; ;g;"def initialize(repository, identifier_prefix) @repository = repository @identifier_prefix = identifier_prefix end;@;;;i ;[;T;"zdef initialize(repository, identifier_prefix) @repository = repository @identifier_prefix = identifier_prefix end;IC;" ;0; [;!@;"o;#;$@;[o;: ;;[" Stash;!@; 0;<"a new instance of +Stash+;=" return;&"o;;[; F;;-; [[@i; ;6;"rdef path @path = File.join(Reflection.home.path, @identifier_prefix, repository.identifier) end;@;;;i;[;T;"fdef path @path = File.join(Reflection.home.path, @identifier_prefix, repository.identifier) end;IC;" ;0; [;!@;"o;#;$@;[;&"o;;[; F;;-; [[@i; :validate_repository;"kdef validate_repository if Reflection::Repository.exists?(self.path) && !@repository.same_in_path?(self.path) Reflection::Support.exit_with_error "The stash directory '#{self.path}' is a repository, but not the one you specified (--repository)." else Reflection.log.debug "Directory '#{self.path}' valid." end end;@;;;i;[;T;"Gdef validate_repository if Reflection::Repository.exists?(self.path) && !@repository.same_in_path?(self.path) Reflection::Support.exit_with_error "The stash directory '#{self.path}' is a repository, but not the one you specified (--repository)." else Reflection.log.debug "Directory '#{self.path}' valid." end end;IC;" ;0; [;!@;"o;#;$@;[;&"o;;[; F;;-; [[@i; :clone_repository;"def clone_repository Reflection.log.debug "Cloning repository '#{self.repository.url}' to '#{self.path}'" @repository.clone(self.path) end;@;;;i;[;T;"def clone_repository Reflection.log.debug "Cloning repository '#{self.repository.url}' to '#{self.path}'" @repository.clone(self.path) end;IC;" ;0; [;!@;"o;#;$@;[;&"; @;1IC;{;-IC;{;UIC;{;_@;b@;2T;2T;IC;{;2T;2T;@;3{;[;4IC; [; @;IC;" ;0; [;!@;"o;#;$@;[;&"; @;1IC;{;-IC;{;2T;IC;{;2T;2T;@;3{;[;4IC; [; @;IC;" ;0; [;!@;"o;#;$@;[;&"o;';IC; [; @; F; [[@i ;(o;);*0; ;+;@; :Repository;IC; [o;;[; F;;-; [[@i ; : url=;"def url=(value);@;;;[;"'def url=(value) @url = value end;IC;"Sets the attribute +url+ ;0; [;!@ ;"o;#;$@;[o;: ;;0;!@ ; " value;<"-the value to set the attribute +url+ to.;=" param;&"SSets the attribute +url+ @param value the value to set the attribute +url+ to.o;;[; F;;-; [[@i ; :url;" def url;@;;;[;"def url @url end;IC;")Returns the value of attribute +url+ ;0; [;!@;"o;#;$@;[;&")Returns the value of attribute +url+o;;[; F;;-; [[@i ; ;w;"def path=(value);@;;;[;")def path=(value) @path = value end;IC;"Sets the attribute +path+ ;0; [;!@(;"o;#;$@;[o;: ;;0;!@(; " value;<".the value to set the attribute +path+ to.;=" param;&"USets the attribute +path+ @param value the value to set the attribute +path+ to.o;;[; F;;-; [[@i ; ;6;" def path;@;;;[;"def path @path end;IC;"*Returns the value of attribute +path+ ;0; [;!@8;"o;#;$@;[;&"*Returns the value of attribute +path+o;;[[" path0; F;;; [[@i; :new_from_path;"def self.new_from_path(path) unless self.exists?(path) raise "'#{path}' is not a valid Git repository" end repo = Git.open(path) self.new(repo.remote.url, path) end;@;;;i;[;T;"def self.new_from_path(path) unless self.exists?(path) raise "'#{path}' is not a valid Git repository" end repo = Git.open(path) self.new(repo.remote.url, path) end;IC;" ;0; [;!@D;"o;#;$@;[;&"o;;[[" path0; F;;; [[@i; ;y;"def self.exists?(path) begin Git.open(path) rescue ArgumentError return false end end;@;;;i;[;T;"ndef self.exists?(path) begin Git.open(path) rescue ArgumentError return false end end;IC;" ;0; [;!@R;"o;#;$@;[;&"o;;[[" new_url0[" path"nil; F;;-; [[@i ; ;g;"`def initialize(new_url, path = nil) self.url = new_url self.path = path end;@;;;i ;[;T;"Tdef initialize(new_url, path = nil) self.url = new_url self.path = path end;IC;" ;0; [;!@`;"o;#;$@;[o;: ;;["Repository;!@`; 0;<"#a new instance of +Repository+;=" return;&"o;;[; F;;-; [[@i%; :identifier;"Adef identifier Digest::MD5.hexdigest(self.url) end;@;;;i%;[;T;"9def identifier Digest::MD5.hexdigest(self.url) end;IC;" ;0; [;!@v;"o;#;$@;[;&"o;;[[" path0; F;;-; [[@i); :same_in_path?;"def same_in_path?(path) git_repo = Git.open(path) (git_repo.remote && git_repo.remote.url == self.url) || false end;@;;;i);[;T;"|def same_in_path?(path) git_repo = Git.open(path) (git_repo.remote && git_repo.remote.url == self.url) || false end;IC;" ;0; [;!@;"o;#;$@;[;&"o;;[; F;;-; [[@i.; : reset!;"def reset! Reflection.log.debug "Resetting target to HEAD" repo = Git.open(self.path) repo.reset_hard end;@;;;i.;[;T;"tdef reset! Reflection.log.debug "Resetting target to HEAD" repo = Git.open(self.path) repo.reset_hard end;IC;" ;0; [;!@;"o;#;$@;[;&"o;;[[" path0; F;;-; [[@i4; : clone;"IC;{;_@;b@;2T;@IC;{;_@;b@;2T;2T;2T;o:"YARD::CodeObjects::RootObject;IC; [; @; F; [; : root;IC; [@; @;1IC;{;-IC;{;2T;IC;{;2T;2T;0;3{;[;4IC; [; @;IC;" ; [;!@;"o;#;$@;[;&";3{;[;4IC; [; @;IC;" ;0; [;!@;"o;#;$@;[;&";3{;[;4IC; [; @;IC;" ;0; [;!@;"o;#;$@;[;&":!Reflection::Config#directory@:!Reflection::Repository#clone@: Reflection::Config#command=@:*Reflection::Directory::Base#git_index@Q:?Reflection::Command::Stash#stash_directory_into_repository@:Reflection::Command::Apply@:4Reflection::Rails.database_command_line_options@7:Reflection::Validations@:Reflection.log@:&Reflection::Repository#identifier@v:5Reflection::Directory::Stash#validate_repository@:)Reflection::Command::Stash#validate!@]:)Reflection::Command::Base#initialize@:&Reflection::Command::Base#config=@:Reflection::Config.parse@=: Reflection::Repository#path@8:EReflection::Command::Apply#get_user_approval_for_cleaning_target@1:#Reflection::Config#repository=@:Reflection::Command::Base@:"Reflection::CLI.verify_config@:"Reflection::Config#rails_root@:3Reflection::Directory::Base#get_git_index_from@k:5Reflection::Command::Stash#commit_and_push_files@:Reflection::Rails.stash@S:)Reflection::Validations.existence_of@:"Reflection::Repository#reset!@:Reflection::Config#write@f:Reflection.home@:&Reflection::Repository#initialize@`:(Reflection::Directory::Base#exists?@!:Reflection::Command::Stash@V:#Reflection::Command::Base.run!@:0Reflection::Config#store_configuration_path@1:*Reflection::Config#rails_environment=@:Reflection::Repository#url@;8@: Reflection::Repository#push@:Reflection::Command@:%Reflection::Support::Home#create@m:Reflection::Config#command@:2Reflection::Config#parse_command_line_options@:Reflection::CLI@:%Reflection::Directory::Base#name@E:8Reflection::Command::Stash#prepare_stash_repository@u:EReflection::Command::Base#verify_that_target_is_not_a_repository@:#Reflection::Repository.exists?@R:#Reflection::Rails.clean_target@):!Reflection::Config#from_hash@X:#Reflection::Support::Log#error@B:&Reflection::Directory::Stash#path@:-Reflection::Directory::Stash#repository=@:%Reflection::Directory::Base#to_s@:&Reflection::Directory::Base#path=@:%Reflection::Command::Base#config@:Reflection::Support::Log@ :$Reflection::ConfigArgumentError@~:Reflection::Repository@:!Reflection::Directory::Stash@: Reflection::Directory::Base@:$Reflection::Command::Apply#run!@%:Reflection::CLI.run!@:"Reflection::Config#repository@:0Reflection::Repository#commit_all_new_files@:"Reflection::Config#directory=@:(Reflection::Support.exit_with_error@:#Reflection::Support::Home#path@a:2Reflection::Directory::Base#copy_git_index_to@]:IReflection::Command::Stash#copy_stash_repository_git_index_to_target@:Reflection.boot!@:Reflection::Config@:Reflection.log=@:)Reflection::Repository#same_in_path?@:2Reflection::Rails.read_database_configuration@E:2Reflection::Directory::Stash#clone_repository@:'Reflection::Directory::Base#parent@9:)Reflection::Repository.new_from_path@D:!Reflection::Repository#path=@(:"Reflection::Support::Log#info@4:,Reflection::Directory::Stash#initialize@:+Reflection::Directory::Base#initialize@:IReflection::Command::Apply#get_user_approval_for_apply_database_dump@?:Reflection::Rails@:)Reflection::Config#rails_environment@:#Reflection::Config#rails_root=@:0Reflection::Directory::Base#move_content_to@y:DReflection::Command::Stash#move_stash_repository_git_index_back@:)Reflection::Command::Apply#validate!@:Reflection::Support::Home@[:Reflection::Rails.apply@c:Reflection.home=@:Reflection::Config#read!@t:'Reflection::Directory::Base#clean!@-:$Reflection::Command::Stash#run!@i:'Reflection::Command::Base#validate@:1Reflection::Config#store_configuration_path=@!;@: Reflection::Repository#url=@ :+Reflection::Rails.validate_environment@:Reflection::Config#to_hash@L:#Reflection::Support::Log#debug@&:,Reflection::Directory::Stash#repository@:%Reflection::Directory::Base#path@:Reflection::Directory@: Reflection::Repository#pull@;2T{" Object;"StandardError;