lib/rmega.rb in rmega-0.1.7 vs lib/rmega.rb in rmega-0.2.0
- old
+ new
@@ -1,11 +1,43 @@
+require 'thread'
+require 'ostruct'
+require 'logger'
+require 'uri'
+require 'net/http'
+require 'base64'
+require 'openssl'
+require 'digest/md5'
+
require 'active_support/json'
+require 'active_support/concern'
require 'active_support/core_ext/module/delegation'
-require 'active_support/core_ext/string/inflections'
-require 'httpclient'
-require 'execjs'
+
require 'rmega/version'
+require 'rmega/loggable'
require 'rmega/options'
+require 'rmega/not_inspectable'
+require 'rmega/errors'
+require 'rmega/api_response'
+require 'rmega/utils'
+require 'rmega/net'
+require 'rmega/pool'
+require 'rmega/progress'
+require 'rmega/crypto'
require 'rmega/session'
+require 'rmega/storage'
+require 'rmega/nodes/factory'
+# Used only in specs
+require 'yaml'
+require 'tmpdir'
+require 'fileutils'
+
module Rmega
+ def self.login(email, password)
+ Session.new.login(email, password).storage
+ end
+
+ def self.download(public_url, path = Dir.pwd)
+ node = Nodes::Factory.build_from_url(public_url)
+ return node.download(path)
+ end
end