code
stringlengths
1
1.73M
language
stringclasses
1 value
require 'cgi' require 'rex/ui' require 'uri' require 'webrick' require 'base64' require 'xssf/xssftunnel' require 'xssf/xssfdatabase' require 'xssf/xssfgui' include WEBrick # # This module implements a HTTP Server used for the new XSSF plugin. # module Msf module Xssf XSSF_VERSION = '3.0' ### CONSTANTS ##...
Ruby
# # This class implements proxy for the XSSF Plugin (Tunnel XSSF) # module Msf module Xssf module XssfTunnel # TUNNEL # --------------------------------------------------------- # | id | code | response | headers | # -----------------------------------------------------...
Ruby
# # This class implements a Graphical User Interface for the XSSF Plugin # module Msf module Xssf module XssfGui include Msf::Xssf::XssfDatabase # # Build graphical HTML interface (logs and statistics) # def build_log_page(req, res) case req.query["#{PARAM_GUI_PAGE}"] when /^banner$/ ...
Ruby
#!/usr/bin/env ruby # # This class implements a HTTP Server used for the new XSSF plugin. # module Msf module Xssf module XssfBanner Logos = [ ' ___ ___ ___ ___ |\__\ /\ \ /\ \ /\ \ |:| | /::\ \ /::\ \ /::\ \ ...
Ruby
# Run from your Rails main directory require 'test/test_helper' class TestSafeString < Test::Unit::TestCase def test_safe_string assert_equal "foo", "foo".to_s_xss_protected assert_equal "foo &amp; bar", "foo & bar".to_s_xss_protected assert_equal "foo &amp; bar", "foo & bar".to_s_xss_protected asser...
Ruby
# Run from your Rails main directory require 'test/test_helper' class TestERB < Test::Unit::TestCase def assert_renders_erb(expected, input, shield=true) erb_class = shield ? XSSProtectedERB : ERB actual = eval(erb_class.new(input).src) assert_equal expected, actual end def test_erb_with_shi...
Ruby
# Run from your Rails main directory require 'test/test_helper' class TestHaml < Test::Unit::TestCase def setup @base = ActionView::Base.new end def assert_haml_renders(expected, input) actual = Haml::Engine.new(input).to_html(@base) assert_equal expected, actual end def test_haml_engine as...
Ruby
# Run from your Rails main directory require 'test/test_helper' class TestHelpers < Test::Unit::TestCase def setup @base = ActionView::Base.new end def assert_haml_renders(expected, input) actual = Haml::Engine.new(input).to_html(@base) assert_equal expected, actual end def test_link_to ass...
Ruby
# Run from your Rails main directory require 'test/test_helper' class TestActionViewIntegration < Test::Unit::TestCase def assert_renders(expected, input, extension) base = ActionView::Base.new actual = base.render_template(extension, input, "foo.#{extension}") assert_equal expected, actual end def ...
Ruby
unless ENV['DISABLE_XSS_SHIELD'] puts "Loading XSS Shield" require 'xss_shield' else class ::String def mark_as_xss_protected self end end class ::NilClass def mark_as_xss_protected self end end end
Ruby
require 'xss_shield/safe_string' require 'xss_shield/haml_hacks' require 'xss_shield/erb_hacks' require 'xss_shield/secure_helpers'
Ruby
class SafeString < String def to_s self end def to_s_xss_protected self end end class String def mark_as_xss_protected SafeString.new(self) end end class NilClass def mark_as_xss_protected self end end # ERB::Util.h and (include ERB::Util; h) are different methods module ERB::Util c...
Ruby
class XSSProtectedERB < ERB class Compiler < ::ERB::Compiler def compile(s) out = Buffer.new(self) content = '' scanner = make_scanner(s) scanner.scan do |token| if scanner.stag.nil? case token when PercentLine out.push("#{@put_cmd} #{content.dump}") if content.size > 0...
Ruby
class Module def mark_helpers_as_xss_protected(*ms) ms.each do |m| begin instance_method("#{m}_with_xss_protection") rescue NameError define_method :"#{m}_with_xss_protection" do |*args| send(:"#{m}_without_xss_protection", *args).mark_as_xss_protected end ali...
Ruby
raise "Haml not loaded" unless Haml::Engine.instance_method(:push_script) module Haml class Engine def push_script(text, flattened) unless options[:suppress_eval] push_silent("haml_temp = #{text}", true) push_silent("haml_temp = haml_temp.to_s_xss_protected", true) out = "haml_temp ...
Ruby
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
# Copyright (C) 2008 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
class CreateUsers < ActiveRecord::Migration def up create_table :users do |t| t.string :profile_id t.string :email t.string :refresh_token end add_index :users, :profile_id end def down drop_table :users end 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
source :gemcutter gem 'sinatra', :require => 'sinatra/base' gem 'thin', '~> 1.3' gem 'pg' gem 'sinatra-activerecord' gem 'google-api-client', '>= 0.4.4', :require => 'google/api_client' group :development do gem 'rake' gem 'sqlite3-ruby' end
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 'sinatra/activerecord/rake' require './main'
Ruby
def nested_loops(n) x = 0; a = 0 while a<n b = 0 while b<n c = 0 while c<n d = 0 while d<n e = 0 while e<n f = 0 while f<n x += 1; f += 1 end e += 1 end d += 1 end c += 1 end b += 1 end a += 1 end...
Ruby
def fib(i) if i<2 return 1 end return fib(i-1) + fib(i-2) end puts fib(33)
Ruby
class Foo def bar @inst1 = 0 @inst2 = 0 @inst3 = 0 @inst4 = 0 i = 0 while i<10000000 @inst1 += 1 @inst2 += 2 @inst3 += 3 @inst4 += 4 i += 1 end return @inst1 end end puts Foo.new.bar
Ruby
class Foo def bar i = 0 while i<10000000 i += 1 end return 0 end end puts Foo.new.bar
Ruby
class Foo def bar 10000000.times{ } return 0 end end puts Foo.new.bar
Ruby
ary = [] i = 0 while i<3000000 ary.push(i) i += 1 end ret = 0; ary.each{ |it| ret = it } puts ret
Ruby
class Vec2D def initialize(x, y) @x = x @y = y end attr_accessor :x attr_accessor :y def +(v) Vec2D.new(@x+v.x, @y+v.y) end def add_assign(v) @x += v.x @y += v.y return self end def to_s "Vec2D.new(x=#{@x}, y=#{@y})" end end def foo() v = Vec2D.new(0, 0) ...
Ruby
#!/usr/bin/env ruby if not ARGV[0] or not ARGV[1] then printf("Please provide two 'scaling-test' static binaries in the command line.\n\n") printf("The first should be linked with the correct reference pixman library.\n") printf("The second binrary should be linked with the pixman library to be tested.\n")...
Ruby
#!/usr/bin/env ruby if not ARGV[0] or not ARGV[1] then printf("Please provide two 'blitters-test' static binaries in the command line.\n\n") printf("The first should be linked with a correct reference pixman library.\n") printf("The second binary should be linked with a pixman library which needs to be tes...
Ruby
#!/usr/bin/env ruby if not ARGV[0] or not ARGV[1] then printf("Please provide two 'scaling-test' static binaries in the command line.\n\n") printf("The first should be linked with the correct reference pixman library.\n") printf("The second binrary should be linked with the pixman library to be tested.\n")...
Ruby
#!/usr/bin/env ruby if not ARGV[0] or not ARGV[1] then printf("Please provide two 'blitters-test' static binaries in the command line.\n\n") printf("The first should be linked with a correct reference pixman library.\n") printf("The second binary should be linked with a pixman library which needs to be tes...
Ruby
# -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = "google-api-client" s.version = "0.4.5" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Bob Aman"] s.date = "2012-07-31" s.description = "The Google API Ruby Client makes ...
Ruby
lib_dir = File.expand_path(File.join(File.dirname(__FILE__), '../../../lib')) $LOAD_PATH.unshift(lib_dir) $LOAD_PATH.uniq! require 'yard-google-code' def init tags = Tags::Library.visible_tags - [:abstract, :deprecated, :note, :todo] create_tag_methods(tags - [:example, :option, :overload, :see]) sections :index...
Ruby
lib_dir = File.expand_path(File.join(File.dirname(__FILE__), '../../../lib')) $LOAD_PATH.unshift(lib_dir) $LOAD_PATH.uniq! require 'yard-google-code' def init sections :header, [T('method_details')] end
Ruby
lib_dir = File.expand_path(File.join(File.dirname(__FILE__), '../../../lib')) $LOAD_PATH.unshift(lib_dir) $LOAD_PATH.uniq! require 'yard-google-code' include T('default/module') def init super sections.place(:subclasses).before(:children) sections.place(:constructor_details, [T('method_details')]).before(:metho...
Ruby
lib_dir = File.expand_path(File.join(File.dirname(__FILE__), '../../../lib')) $LOAD_PATH.unshift(lib_dir) $LOAD_PATH.uniq! require 'yard-google-code' def init return if object.docstring.blank? && !object.has_tag?(:api) sections :index, [:private, :deprecated, :abstract, :todo, :note, :returns_void, :text], T('tags...
Ruby
lib_dir = File.expand_path(File.join(File.dirname(__FILE__), '../../../lib')) $LOAD_PATH.unshift(lib_dir) $LOAD_PATH.uniq! require 'yard-google-code' include Helpers::ModuleHelper def init sections :header, :box_info, :pre_docstring, T('docstring'), :children, :constant_summary, [T('docstring')], :inherited_con...
Ruby
lib_dir = File.expand_path(File.join(File.dirname(__FILE__), '../../../lib')) $LOAD_PATH.unshift(lib_dir) $LOAD_PATH.uniq! require 'yard-google-code' def init sections :header, [:method_signature, T('docstring')] end
Ruby
# encoding: utf-8 require 'yard/serializers/file_system_serializer' module YARD module Serializers ## # Subclass required to get correct filename for the top level namespace. # :-( class WikiSerializer < FileSystemSerializer # Post-process the data before serializing. # Strip unnecessary...
Ruby
require 'cgi' require 'rdiscount' module YARD module Templates::Helpers # The helper module for HTML templates. module WikiHelper include MarkupHelper # @return [String] escapes text def h(text) out = "" text = text.split(/\n/) text.each_with_index do |line, i| ...
Ruby
require 'rake' require 'rake/tasklib' require 'yard/rake/yardoc_task' require 'yard/cli/wiki' module YARD module Rake # The rake task to run {CLI::Yardoc} and generate documentation. class WikidocTask < YardocTask protected # Defines the rake task # @return [void] def define ...
Ruby
require 'yard' require 'yard/serializers/wiki_serializer' require 'yard/cli/yardoc' module YARD module CLI class Wiki < Yardoc # Creates a new instance of the commandline utility def initialize super @options = SymbolHash.new(false) @options.update( :format => :html,...
Ruby
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__))) $LOAD_PATH.uniq! YARD::Templates::Engine.register_template_path File.dirname(__FILE__) + '/../templates' require 'yard/templates/template' require 'yard/templates/helpers/wiki_helper' ::YARD::Templates::Template.extra_includes |= [ YARD::Templates::Helper...
Ruby
lib_dir = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib_dir) $LOAD_PATH.uniq! require 'rubygems' require 'rake' require File.join(File.dirname(__FILE__), 'lib/google/api_client', 'version') PKG_DISPLAY_NAME = 'Google API Client' PKG_NAME = PKG_DISPLAY_NAME.downcase.gsub(/\s/, '-') PKG_VERSI...
Ruby
require 'rubygems/package_task' require 'rake/clean' CLOBBER.include('pkg') namespace :gem do GEM_SPEC = Gem::Specification.new do |s| unless s.respond_to?(:add_development_dependency) puts 'The gem spec requires a newer version of RubyGems.' exit(1) end s.name = PKG_NAME s.version = PK...
Ruby
require 'rake/clean' require 'rspec/core/rake_task' CLOBBER.include('coverage', 'specdoc') namespace :spec do RSpec::Core::RakeTask.new(:all) do |t| t.pattern = FileList['spec/**/*_spec.rb'] t.rspec_opts = ['--color', '--format', 'documentation'] t.rcov = false end desc 'Generate HTML Specdocs for ...
Ruby
require 'rake' require 'rake/clean' CLOBBER.include('doc', '.yardoc') CLOBBER.uniq! begin require 'yard' require 'yard/rake/yardoc_task' namespace :doc do desc 'Generate Yardoc documentation' YARD::Rake::YardocTask.new do |yardoc| yardoc.name = 'yard' yardoc.options = ['--verbose', '--marku...
Ruby
namespace :metrics do task :lines do lines, codelines, total_lines, total_codelines = 0, 0, 0, 0 for file_name in FileList['lib/**/*.rb'] f = File.open(file_name) while line = f.gets lines += 1 next if line =~ /^\s*$/ next if line =~ /^\s*#/ codelines += 1 end...
Ruby
require 'rake' require 'rake/clean' CLOBBER.include('wiki') CACHE_PREFIX = "http://www.gmodules.com/gadgets/proxy/container=default&debug=0&nocache=0/" namespace :wiki do desc 'Autogenerate wiki pages' task :supported_apis do output = <<-WIKI #summary The list of supported APIs The Google API Client for R...
Ruby
namespace :git do namespace :tag do desc 'List tags from the Git repository' task :list do tags = `git tag -l` tags.gsub!("\r", '') tags = tags.split("\n").sort {|a, b| b <=> a } puts tags.join("\n") end desc 'Create a new tag in the Git repository' task :create do c...
Ruby
source :rubygems gemspec gem 'signet', '>= 0.4.1' gem 'addressable', '>= 2.3.2' gem 'uuidtools', '>= 2.1.0' gem 'autoparse', '>= 0.3.2' gem 'faraday', '~> 0.8.1' gem 'multi_json', '>= 1.0.0' gem 'extlib', '>= 0.9.15' gem 'jruby-openssl', :platforms => :jruby group :development do gem 'launchy', '>= 2.1.1' gem 'y...
Ruby
$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__)) $LOAD_PATH.uniq! require 'rspec' RSpec.configure do |config| end
Ruby
# Copyright 2010 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 writing,...
Ruby
# Copyright 2010 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 writing,...
Ruby
# Copyright 2010 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 writing,...
Ruby
# Copyright 2010 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 writing,...
Ruby
# Copyright 2010 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 writing,...
Ruby
# Copyright 2010 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 writing,...
Ruby
# Copyright 2010 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 writing,...
Ruby
# Copyright 2010 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 writing,...
Ruby