Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Reorganize files

  • Loading branch information...
commit c32cd0525eb991b56a3dfd0b5f7f304c6bf063aa 1 parent 8c30b67
Tim Morgan authored
View
42 lib/rscribd.rb
@@ -1,38 +1,14 @@
#!/usr/bin/env ruby
-module Scribd # :nodoc:
-end
-
-class Symbol
- def to_proc
- Proc.new { |*args| args.shift.__send__(self, *args) }
- end unless method_defined?(:to_proc)
-end
-
-class Hash #:nodoc:
- # Taken from Rails, with appreciation to DHH
- def stringify_keys
- inject({}) do |options, (key, value)|
- options[key.to_s] = value
- options
- end
- end unless method_defined?(:stringify_keys)
-end
+# Container module for all classes in the RScribd gem.
-class Array #:nodoc:
- def to_hsh
- h = Hash.new
- each { |k, v| h[k] = v }
- h
- end
+module Scribd
end
-# The reason these files have such terrible names is so they don't conflict with
-# files in Rails's app/models directory; Rails seems to prefer loading those
-# when require is called.
-require 'scribdmultiparthack'
-require 'scribderrors'
-require 'scribdapi'
-require 'scribdresource'
-require 'scribddoc'
-require 'scribduser'
+require 'support/extensions'
+require 'support/multipart_hack'
+require 'scribd/errors'
+require 'scribd/api'
+require 'scribd/resource'
+require 'scribd/document'
+require 'scribd/user'
View
0  lib/scribdapi.rb → lib/scribd/api.rb
File renamed without changes
View
0  lib/scribddoc.rb → lib/scribd/document.rb
File renamed without changes
View
0  lib/scribderrors.rb → lib/scribd/errors.rb
File renamed without changes
View
0  lib/scribdresource.rb → lib/scribd/resource.rb
File renamed without changes
View
0  lib/scribduser.rb → lib/scribd/user.rb
File renamed without changes
View
23 lib/support/extensions.rb
@@ -0,0 +1,23 @@
+class Symbol
+ def to_proc
+ Proc.new { |*args| args.shift.__send__(self, *args) }
+ end unless method_defined?(:to_proc)
+end
+
+class Hash #:nodoc:
+ # Taken from Rails, with appreciation to DHH
+ def stringify_keys
+ inject({}) do |options, (key, value)|
+ options[key.to_s] = value
+ options
+ end
+ end unless method_defined?(:stringify_keys)
+end
+
+class Array #:nodoc:
+ def to_hsh
+ h = Hash.new
+ each { |k, v| h[k] = v }
+ h
+ end
+end
View
0  lib/scribdmultiparthack.rb → lib/support/multipart_hack.rb
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.