Module: Mosquito

Defined in:
lib/mosquito.rb

Defined Under Namespace

Modules: Dusty, Proboscis Classes: MockRequest, MockUpload, NonLocalRequest, SageAdvice

Constant Summary collapse

VERSION =
'0.1.4'

Class Method Summary collapse

Class Method Details

.esc(t) ⇒ Object

URL escape on both Camping versions



27
# File 'lib/mosquito.rb', line 27

def self.esc(t); Camping.escape(t.to_s) rescue Rack::Utils.escape(t.to_s); end

.garbage(amount) ⇒ Object

For various methods that need to generate random text



17
18
19
20
21
22
23
24
# File 'lib/mosquito.rb', line 17

def self.garbage(amount) #:nodoc:
  fills = ("a".."z").to_a
  str = (0...amount).map do
    v = fills[rand(fills.length)]
    (rand(2).zero? ? v.upcase : v)
  end
  str.join
end

.stash(something) ⇒ Object

:nodoc:



37
38
39
# File 'lib/mosquito.rb', line 37

def self.stash(something) #:nodoc:
  @stashed = something
end

.unstashObject

:nodoc:



41
42
43
# File 'lib/mosquito.rb', line 41

def self.unstash #:nodoc:
  (x, @stashed = @stashed, nil).shift
end