-
-
Save xiconet/6eba311c6b7351d5c8ff to your computer and use it in GitHub Desktop.
Revisions
-
xiconet renamed this gist
Oct 27, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
cburnette revised this gist
Mar 30, 2014 . 1 changed file with 6 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,14 @@ require 'ruby-box' #gem install ruby-box require 'term/ansicolor' #gem install term-ansicolor include Term::ANSIColor MODIFIED_AT_CUTOFF = Time.new(2013,7,1) session = RubyBox::Session.new({ client_id: "YOUR_CLIENT_ID", client_secret: "YOUR_CLIENT_SECRET", access_token: "YOUR_DEV_ACCESS_TOKEN" }) @client = RubyBox::Client.new(session) @@ -25,7 +24,9 @@ def load_folder(folder, path_prefix="/") end subFolders = folder.folders subFolders.each do |f| load_folder(f,"#{path}/") end end load_folder @client.root_folder -
cburnette revised this gist
Mar 28, 2014 . 1 changed file with 8 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,15 @@ require 'ruby-box' #gem install ruby-box require 'term/ansicolor' #gem install term-ansicolor require 'parallel' #gem install Parallel include Term::ANSIColor MODIFIED_AT_CUTOFF = Time.new(2013,7,1) session = RubyBox::Session.new({ client_id: "6nbxyrx54ikg9j8rb444l8uf_replace", client_secret: "ugVH49V8OsOnPkORHduBB_replace", access_token: "hNhvDFopBHbm6yOqrDuoD_replace" }) @client = RubyBox::Client.new(session) @@ -20,17 +21,11 @@ def load_folder(folder, path_prefix="/") files = folder.files(nil,1000,0,['name','modified_at']) files.each do |f| output = "--> #{f.name}" puts f.modified_at < MODIFIED_AT_CUTOFF ? red(output) : output end subFolders = folder.folders Parallel.each(subFolders, :in_threads=>1){|f| load_folder f, "#{path}/"} end load_folder @client.root_folder -
cburnette revised this gist
Mar 28, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ require 'ruby-box' require 'term/ansicolor' #gem install term-ansicolor include Term::ANSIColor -
cburnette created this gist
Mar 28, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ require 'ruby-box' require 'term/ansicolor' include Term::ANSIColor MODIFIED_AT_CUTOFF = Time.new(2013,7,1) session = RubyBox::Session.new({ client_id: "6nbxyrx54ikg9j8rb444l8_not_real", client_secret: "ugVH49V8OsOnPkORHduBBql5A_not_real", access_token: "Xb1zHzCZM4jcs96d6Dl4kzNe_not_real" }) @client = RubyBox::Client.new(session) def load_folder(folder, path_prefix="/") path = "#{path_prefix}#{folder.name}" puts path files = folder.files(nil,1000,0,['name','modified_at']) files.each do |f| output = "--> #{f.name}" if f.modified_at < MODIFIED_AT_CUTOFF puts red(output) else puts output end end subFolders = folder.folders subFolders.each do |f| load_folder f, "#{path}/" end end load_folder @client.root_folder