source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
Shopify/git-chain
https://github.com/Shopify/git-chain
lib/git_chain/commands/setup.rb
Ruby
mit
245
main
3,535
# frozen_string_literal: true require "optparse" module GitChain module Commands class Setup < Command include Options::ChainName def post_process_options!(options) raise(ArgError, "Expects at least 2 arguments") unless options[:args].size >= 2 super options[:chain_name] = ...
github
Shopify/git-chain
https://github.com/Shopify/git-chain
lib/git_chain/commands/rebase.rb
Ruby
mit
245
main
2,349
# frozen_string_literal: true require "optparse" module GitChain module Commands class Rebase < Command include Options::ChainName def description "Rebase all branches of the chain" end def run(options) if Git.rebase_in_progress? raise(Abort, "A rebase is in pr...
github
Shopify/git-chain
https://github.com/Shopify/git-chain
lib/git_chain/commands/teardown.rb
Ruby
mit
245
main
843
# frozen_string_literal: true require "optparse" module GitChain module Commands class Teardown < Command include Options::ChainName def description "Teardown chain" end def run(options) if Git.rebase_in_progress? raise(Abort, "A rebase is in progress. Please f...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
load_tutorials.rb
Ruby
mit
246
main
1,623
# Copyright 2016 Trimble Inc # Licensed under the MIT license module Examples # Finds and returns the filename for each of the root .rb files in the # examples folder. # # @yield [String] filename # # @return [Array<String>] files def self.rb_files(include_subfolders = false) examples_path = File.jo...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
tutorials/02_custom_tool/tut_custom_tool.rb
Ruby
mit
246
main
692
# Copyright 2016 Trimble Inc # Licensed under the MIT license # This demonstrate how to create a custom Ruby tool that lets the user pick # points in the model to create a cube. require 'sketchup.rb' require 'extensions.rb' module Examples module CustomTool unless file_loaded?(__FILE__) ex = SketchupExt...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
tutorials/02_custom_tool/tut_custom_tool/main.rb
Ruby
mit
246
main
7,701
# Copyright 2016 Trimble Inc # Licensed under the MIT license require 'sketchup.rb' module Examples module CustomTool # Custom tools create a class which responds to various callback methods # from SketchUp. class LineTool # The `actvate` method is called whenever the tool is activated. This is ...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
tutorials/01_hello_cube/tut_hello_cube.rb
Ruby
mit
246
main
3,448
# Copyright 2016 Trimble Inc # Licensed under the MIT license # This demonstrate the required pattern for Extensions to be accepted to the # Extension Warehouse. # # Key requirements: # # * Register a SketchupExtension instance in the root .rb file. # # * Do not load anything else in the root .rb file - it should _onl...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
tutorials/01_hello_cube/tut_hello_cube/main.rb
Ruby
mit
246
main
4,200
# Copyright 2016 Trimble Inc # Licensed under the MIT license require 'sketchup.rb' module Examples module HelloCube # This method creates a simple cube inside of a group in the model. def self.create_cube # We need a reference to the currently active model. The SketchUp API # currently only le...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/04_vcb_tool/ex_vcb_tool.rb
Ruby
mit
246
main
653
# Copyright 2021 Trimble Inc # Licensed under the MIT license # This demonstrate how to improve a custom Ruby tool to allow precise text input # in the measurement bar (aka VCB). require 'sketchup.rb' require 'extensions.rb' module Examples module VCBTool unless file_loaded?(__FILE__) ex = SketchupExten...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/04_vcb_tool/ex_vcb_tool/main.rb
Ruby
mit
246
main
5,763
# Copyright 2021 Trimble Inc # Licensed under the MIT license require 'sketchup.rb' module Examples module VCBTool class LineTool # Threshold in logical screen pixels for when the mouse is considered to # be dragged. DRAG_THRESHOLD = 10 def activate @mouse_ip = Sketchup::Input...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/99_license/ex_hello_license.rb
Ruby
mit
246
main
573
# Copyright 2018 Trimble Inc # Licensed under the MIT license require 'sketchup.rb' require 'extensions.rb' module Examples module HelloLicense unless file_loaded?(__FILE__) ex = SketchupExtension.new('Hello License', 'ex_hello_license/main') ex.description = 'SketchUp Ruby API example using the Li...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/99_license/ex_hello_license/main.rb
Ruby
mit
246
main
1,935
# Copyright 2018 Trimble Inc # Licensed under the MIT license require 'sketchup.rb' module Examples module HelloLicense def self.create_cube # Performing a license check before executing the extension's commands. # The extension id is kept as a local variable as constants and # class/instance...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/99_hello_donut/ex_hello_donut.rb
Ruby
mit
246
main
562
# Copyright 2018 Trimble Inc # Licensed under the MIT license require 'sketchup.rb' require 'extensions.rb' module Examples module HelloSphere unless file_loaded?(__FILE__) ex = SketchupExtension.new('Hello Donut', 'ex_hello_donut/main') ex.description = 'SketchUp Ruby API example creating a donut....
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/99_hello_donut/ex_hello_donut/main.rb
Ruby
mit
246
main
1,269
# Copyright 2018 Trimble Inc # Licensed under the MIT license require 'sketchup.rb' module Examples module HelloDonut def self.create_donut model = Sketchup.active_model model.start_operation('Create Donut', true) group = model.active_entities.add_group # Create a filled circle which la...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/02_custom_tool/ex_custom_tool.rb
Ruby
mit
246
main
688
# Copyright 2016 Trimble Inc # Licensed under the MIT license # This demonstrate how to create a custom Ruby tool that lets the user pick # points in the model to draw edges. require 'sketchup.rb' require 'extensions.rb' module Examples module CustomTool unless file_loaded?(__FILE__) ex = SketchupExtens...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/02_custom_tool/ex_custom_tool/main.rb
Ruby
mit
246
main
3,728
# Copyright 2016 Trimble Inc # Licensed under the MIT license require 'sketchup.rb' module Examples module CustomTool class LineTool def activate @mouse_ip = Sketchup::InputPoint.new @picked_first_ip = Sketchup::InputPoint.new update_ui end def deactivate(view) ...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/99_hello_sphere/ex_hello_sphere.rb
Ruby
mit
246
main
565
# Copyright 2018 Trimble Inc # Licensed under the MIT license require 'sketchup.rb' require 'extensions.rb' module Examples module HelloSphere unless file_loaded?(__FILE__) ex = SketchupExtension.new('Hello Sphere', 'ex_hello_sphere/main') ex.description = 'SketchUp Ruby API example creating a sphe...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/99_hello_sphere/ex_hello_sphere/main.rb
Ruby
mit
246
main
1,170
# Copyright 2018 Trimble Inc # Licensed under the MIT license require 'sketchup.rb' module Examples module HelloSphere def self.create_sphere model = Sketchup.active_model model.start_operation('Create Sphere', true) group = model.active_entities.add_group # Create a filled circle which...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/05_tool_inference_lock/ex_tool_inference_lock.rb
Ruby
mit
246
main
611
# Copyright 2021 Trimble Inc # Licensed under the MIT license # This demonstrate how to add inference locking to a tool. require 'sketchup.rb' require 'extensions.rb' module Examples module ToolInferenceLock unless file_loaded?(__FILE__) ex = SketchupExtension.new('Tool Inference Lock', 'ex_tool_inferen...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/05_tool_inference_lock/ex_tool_inference_lock/inference_lock_helper.rb
Ruby
mit
246
main
3,854
module Examples module ToolInferenceLock # Helper object to lock tool inference using Shift or arrow keys. class InferenceLockHelper # Create InferenceLockHelper object. def initialize @axis_lock = nil @mouse_x = nil @mouse_y = nil end # Call this method from +...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/05_tool_inference_lock/ex_tool_inference_lock/main.rb
Ruby
mit
246
main
7,095
# Copyright 2021 Trimble Inc # Licensed under the MIT license require 'sketchup.rb' require 'ex_tool_inference_lock/inference_lock_helper' module Examples module ToolInferenceLock class LineTool # Threshold in logical screen pixels for when the mouse is considered to # be dragged. DRAG_THRES...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/03_press_drag_release_tool/ex_press_drag_release_tool.rb
Ruby
mit
246
main
684
# Copyright 2021 Trimble Inc # Licensed under the MIT license # This demonstrate how to improve a custom Ruby tool to allow optional # press+drag+release drawing style. require 'sketchup.rb' require 'extensions.rb' module Examples module PressDragReleaseTool unless file_loaded?(__FILE__) ex = SketchupEx...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/03_press_drag_release_tool/ex_press_drag_release_tool/main.rb
Ruby
mit
246
main
4,961
# Copyright 2021 Trimble Inc # Licensed under the MIT license require 'sketchup.rb' module Examples module PressDragReleaseTool class LineTool # Threshold in logical screen pixels for when the mouse is considered to # be dragged. DRAG_THRESHOLD = 10 def activate @mouse_ip = Sk...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/01_hello_cube/ex_hello_cube.rb
Ruby
mit
246
main
563
# Copyright 2016 Trimble Inc # Licensed under the MIT license require 'sketchup.rb' require 'extensions.rb' module Examples module HelloCube unless file_loaded?(__FILE__) ex = SketchupExtension.new('Hello Cube', 'ex_hello_cube/main') ex.description = 'SketchUp Ruby API example creating a cube.' ...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/01_hello_cube/ex_hello_cube/main.rb
Ruby
mit
246
main
828
# Copyright 2016 Trimble Inc # Licensed under the MIT license require 'sketchup.rb' module Examples module HelloCube def self.create_cube model = Sketchup.active_model model.start_operation('Create Cube', true) group = model.active_entities.add_group entities = group.entities poin...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/99_in_tool_selection/ex_in_tool_selection.rb
Ruby
mit
246
main
599
# Copyright 2021 Trimble Inc # Licensed under the MIT license # This demonstrate an optional select stage in a tool. require 'sketchup.rb' require 'extensions.rb' module Examples module InToolSelection unless file_loaded?(__FILE__) ex = SketchupExtension.new('In Tool Selection', 'ex_in_tool_selection/ma...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/99_in_tool_selection/ex_in_tool_selection/main.rb
Ruby
mit
246
main
13,026
# Copyright 2021 Trimble Inc # Licensed under the MIT license require 'ex_in_tool_selection/inference_lock_helper' module Examples module InToolSelection class ComponentMoveTool # Threshold in logical screen pixels for when the mouse is considered to # be dragged. DRAG_THRESHOLD = 10 ...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/99_in_tool_selection/ex_in_tool_selection/inference_lock_helper.rb
Ruby
mit
246
main
3,852
module Examples module InToolSelection # Helper object to lock tool inference using Shift or arrow keys. class InferenceLockHelper # Create InferenceLockHelper object. def initialize @axis_lock = nil @mouse_x = nil @mouse_y = nil end # Call this method from +on...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/99_sphere_tool/ex_sphere_tool.rb
Ruby
mit
246
main
583
# Copyright 2018 Trimble Inc # Licensed under the MIT license require 'sketchup.rb' require 'extensions.rb' module Examples module SphereToolExample unless file_loaded?(__FILE__) ex = SketchupExtension.new('Sphere Tool Example', 'ex_sphere_tool/main') ex.description = 'SketchUp Ruby API example cre...
github
SketchUp/sketchup-ruby-api-tutorials
https://github.com/SketchUp/sketchup-ruby-api-tutorials
examples/99_sphere_tool/ex_sphere_tool/main.rb
Ruby
mit
246
main
8,880
# Copyright 2018 Trimble Inc # Licensed under the MIT license require 'sketchup.rb' module Examples module SphereToolExample class SphereTool def activate @num_segments = 24 @mouse_ip = Sketchup::InputPoint.new @picked_first_ip = Sketchup::InputPoint.new update_ui e...
github
morshedalam/rename
https://github.com/morshedalam/rename
rename.gemspec
Ruby
mit
245
master
782
# -*- encoding: utf-8 -*- require File.expand_path('../lib/rename/version', __FILE__) Gem::Specification.new do |gem| gem.name = 'rename' gem.version = Rename::VERSION gem.license = 'MIT' gem.authors = ['Morshed Alam'] gem.email = %w(morshed201@gmail.com) gem.homepage = 'https://github.com/morshe...
github
morshedalam/rename
https://github.com/morshedalam/rename
lib/generators/rename/app_to/app_to_generator.rb
Ruby
mit
245
master
333
require File.expand_path('../shared/common_methods', File.dirname(__FILE__)) module Rename module Generators class AppToGenerator < Rails::Generators::Base include CommonMethods def app_to warn '[DEPRECATION] `app_to` is deprecated. Please use `into` instead.' perform end ...
github
morshedalam/rename
https://github.com/morshedalam/rename
lib/generators/rename/shared/common_methods.rb
Ruby
mit
245
master
4,284
require 'active_support/concern' module CommonMethods extend ActiveSupport::Concern included do desc 'Rename your Rails application' argument :new_name, :type => :string, :default => '' end protected def perform prepare_app_vars validate_name_and_path? apply_new_module_name remove...
github
morshedalam/rename
https://github.com/morshedalam/rename
lib/generators/rename/into/into_generator.rb
Ruby
mit
245
master
250
require File.expand_path('../shared/common_methods', File.dirname(__FILE__)) module Rename module Generators class IntoGenerator < Rails::Generators::Base include CommonMethods def into perform end end end end
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
make_resourceful.gemspec
Ruby
mit
245
main
666
require 'rubygems' HAML_GEMSPEC = Gem::Specification.new do |spec| spec.name = 'make_resourceful' spec.summary = "An elegant, structured way to build ActionPack Controllers" spec.version = File.read(File.dirname(__FILE__) + '/VERSION').strip spec.authors = ['Hampton Catlin'] spec.email = 'hcatlin@gmail.com' ...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
Rakefile
Ruby
mit
245
main
814
require 'rake' require 'rdoc/task' require 'rspec/core/rake_task' desc 'Default: run specs.' task :default => :spec spec_files = Rake::FileList["spec/**/*_spec.rb"] desc "Run specs" RSpec::Core::RakeTask.new(:spec) do |t| t.pattern = "spec/**/*_spec.rb" t.rspec_opts = ["-c"] end desc "Generate code coverage" RS...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
lib/make_resourceful.rb
Ruby
mit
245
main
233
class MakeResourcefulTie < Rails::Railtie initializer "my_railtie.configure_rails_initialization" do require File.join(File.dirname(__FILE__), 'resourceful/maker') ActionController::Base.extend Resourceful::Maker end end
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
lib/resourceful/builder.rb
Ruby
mit
245
main
14,667
require 'resourceful/response' require 'resourceful/serialize' require 'resourceful/default/actions' module Resourceful # The Maker#make_resourceful block is evaluated in the context # of an instance of this class. # It provides various methods for customizing the behavior of the actions # built by make_resour...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
lib/resourceful/serialize.rb
Ruby
mit
245
main
6,545
require 'resourceful/builder' module Resourceful # This module contains mixin modules # used to implement the object serialization # used for the Builder#publish method. # They can also be used to get serialized representations of objects # in other contexts. # # Serialization makes use of duck typing. ...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
lib/resourceful/maker.rb
Ruby
mit
245
main
3,171
require 'resourceful/builder' require 'resourceful/base' module Resourceful # This module is extended by the ActionController::Base class object. # It provides the actual +make_resourceful+ method # and sets up the controller so that everything will work. module Maker # Called automatically on ActionContro...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
lib/resourceful/response.rb
Ruby
mit
245
main
1,051
module Resourceful # This is the class of the object passed to the Builder#response_for method. # It shouldn't be used by users. # # The Response collects format procs # and returns them with the format method, # in the order they were given. # For example: # # response.html { redirect_to '/' } # ...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
lib/resourceful/base.rb
Ruby
mit
245
main
2,133
# The module containing all the code for make_resourceful. # # For methods available in the +make_resourceful+ block, # see Resourceful::Builder. # # For helper methods and methods you can override # to customize the behavior of your actions, # see Resourceful::Default::Accessors # and Resourceful::Default::URLs. modul...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
lib/resourceful/generators/resourceful_scaffold/resourceful_scaffold_generator.rb
Ruby
mit
245
main
3,557
class ResourcefulScaffoldGenerator < Rails::Generators::Base attr_reader :controller_class_path, :controller_file_path, :controller_class_nesting, :controller_class_nesting_depth, :controller_class_name, :controller_underscore_name, ...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
lib/resourceful/generators/resourceful_scaffold/templates/functional_test.rb
Ruby
mit
245
main
1,400
require File.dirname(__FILE__) + '<%= '/..' * controller_class_nesting_depth %>/../test_helper' require '<%= controller_file_path %>_controller' # Re-raise errors caught by the controller. class <%= controller_class_name %>Controller; def rescue_action(e) raise e end; end class <%= controller_class_name %>ControllerT...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
lib/resourceful/default/responses.rb
Ruby
mit
245
main
4,463
module Resourceful module Default module Responses # Sets the default flash message. # This message can be overridden by passing in # an HTTP parameter of the form "_flash[type]" via POST or GET. # # You can use this to easily have multiple forms # post to the same create/edit/...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
lib/resourceful/default/callbacks.rb
Ruby
mit
245
main
1,709
require 'resourceful/builder' module Resourceful module Default # This module is mostly meant to be used by the make_resourceful default actions. # It provides various methods that declare where callbacks set in the +make_resourceful+ block, # like Builder#before and Builder#response_for, # should be...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
lib/resourceful/default/accessors.rb
Ruby
mit
245
main
17,173
module Resourceful # This module contains various methods # that are available from actions and callbacks. # Default::Accessors and Default::URLs are the most useful to users; # the rest are mostly used internally. # # However, if you want to poke around the internals a little, # check out Default::Action...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
lib/resourceful/default/actions.rb
Ruby
mit
245
main
2,402
module Resourceful module Default # Contains the definitions of the default resourceful actions. # These are made available with the Builder#actions method. # # These methods are very compact, # so the best way to understand them is just to look at their source. # Check out Resourceful::Access...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
lib/resourceful/default/urls.rb
Ruby
mit
245
main
6,096
module Resourceful module Default # This file contains various methods to make URL helpers less painful. # They provide methods analogous to the standard foo_url and foo_path helpers. # However, they use make_resourceful's knowledge of the structure of the controller # to allow you to avoid figuring o...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
spec/accessors_spec.rb
Ruby
mit
245
main
14,771
require File.dirname(__FILE__) + '/spec_helper' describe Resourceful::Default::Accessors, "#current_objects" do include ControllerMocks before :each do mock_controller Resourceful::Default::Accessors @objects = stub_list 5, 'object' @model = stub @controller.stubs(:current_model).returns(@model) ...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
spec/urls_spec.rb
Ruby
mit
245
main
9,934
require File.dirname(__FILE__) + '/spec_helper' describe Resourceful::Default::URLs, " for a controller with no parents or namespaces" do include ControllerMocks before :each do mock_controller Resourceful::Default::URLs @object = stub_model('Thing') @controller.stubs(:current_object).returns(@object) ...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
spec/maker_spec.rb
Ruby
mit
245
main
2,942
require File.dirname(__FILE__) + '/spec_helper' describe Resourceful::Maker, "when extended" do include ControllerMocks before(:each) { mock_kontroller } it "should create an empty, inheritable callbacks hash" do @kontroller.resourceful_callbacks.should == {} end it "should create an empty, inheritable...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
spec/responses_spec.rb
Ruby
mit
245
main
10,852
require File.dirname(__FILE__) + '/spec_helper' describe 'Resourceful::Default::Responses', " with a _flash parameter for :error" do include ControllerMocks before :each do mock_controller Resourceful::Default::Responses @flash = {} @controller.stubs(:flash).returns(@flash) @params = {:_flash => {:...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
spec/integration_spec.rb
Ruby
mit
245
main
13,047
require File.dirname(__FILE__) + '/spec_helper' describe "ThingsController", "with all the resourceful actions" do before :each do mock_resourceful do actions :all end @objects = stub_list(5, 'Thing') do |t| [:destroy, :save, :update_attributes].each { |m| t.stubs(m).returns(true) } ...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
spec/base_spec.rb
Ruby
mit
245
main
555
require File.dirname(__FILE__) + '/spec_helper' describe Resourceful::Base, ".made_resourceful" do before(:all) { @original_blocks = Resourceful::Base.made_resourceful.dup } before(:each) { Resourceful::Base.made_resourceful.replace [] } after(:all) { Resourceful::Base.made_resourceful.replace @original_block...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
spec/builder_spec.rb
Ruby
mit
245
main
10,555
require File.dirname(__FILE__) + '/spec_helper' describe Resourceful::Builder, " applied without any modification" do include ControllerMocks before :each do mock_kontroller create_builder end it "should remove all resourceful actions" do @kontroller.expects(:send).with do |name, action_module| ...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
spec/spec_helper.rb
Ruby
mit
245
main
7,173
$: << File.dirname(__FILE__) + '/../lib' require 'rubygems' require 'rack' require "rails/all" require 'rack/test' require 'rails/test_help' require 'rspec/rails' require 'active_model' require 'support/helper_methods' require 'support/integration_helpers' require_relative '../lib/make_resourceful' require_relative ...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
spec/actions_spec.rb
Ruby
mit
245
main
8,879
require File.dirname(__FILE__) + '/spec_helper' describe Resourceful::Default::Actions, " index action" do include ControllerMocks before :each do mock_controller Resourceful::Default::Actions [:load_objects, :before, :response_for].each(&@controller.method(:stubs)) end after(:each) { @controller.inde...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
spec/serialize_spec.rb
Ruby
mit
245
main
5,782
require_relative './spec_helper' describe Resourceful::Serialize, ".normalize_attributes" do def expect_normalize(object) expect(Resourceful::Serialize.normalize_attributes(object)) end it "should return nil if given nil" do expect_normalize(nil).to be_nil end it "should return a basic hash if give...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
spec/callbacks_spec.rb
Ruby
mit
245
main
2,418
require File.dirname(__FILE__) + '/spec_helper' describe Resourceful::Default::Callbacks, " with a few callbacks" do include ControllerMocks before :each do mock_controller Resourceful::Default::Callbacks end it "should fire the :before callback with the given name when #before is called" do callba...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
spec/response_spec.rb
Ruby
mit
245
main
1,205
require File.dirname(__FILE__) + '/spec_helper' describe Resourceful::Response, "when first created" do before(:each) { @response = Resourceful::Response.new } it "should have an empty formats array" do @response.formats.should == [] end end describe Resourceful::Response, "with a few formats" do before ...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
spec/support/helper_methods.rb
Ruby
mit
245
main
1,185
module HelperMethods def should_render_html(action) it "should render HTML by default for #{action_string(action)}" do action_method(action)[action, action_params(action)] response.body.should include("as HTML") response.content_type.should == 'text/html' end end def should_render_js(ac...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
spec/support/integration_helpers.rb
Ruby
mit
245
main
303
module IntegrationHelpers # Need this helper, because we made current_objects private def current_objects controller.instance_eval("current_objects") end # Need this helper, because we made current_object private def current_object controller.instance_eval("current_object") end end
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
spec/rspec-rails/render_template.rb
Ruby
mit
245
main
2,896
module Spec module Rails module Matchers class RenderTemplate #:nodoc: def initialize(expected, controller) @controller = controller @expected = expected end def matches?(response) if response.respond_to?(:rendered_file) ...
github
HamptonMakes/make_resourceful
https://github.com/HamptonMakes/make_resourceful
spec/rspec-rails/redirect_to.rb
Ruby
mit
245
main
3,518
module Spec module Rails module Matchers class RedirectTo #:nodoc: def initialize(request, expected) @expected = expected @request = request end def matches?(response) @redirected = response.redirect? @actual = response.redirect_url ...
github
archan937/ruby-mass
https://github.com/archan937/ruby-mass
Gemfile
Ruby
mit
245
master
259
source "http://rubygems.org" gemspec group :gem_default do gem "ruby-mass", :path => "." end group :gem_development do gem "horo" gem "pry" end group :gem_test do gem "minitest" gem "mocha", :require => "mocha/setup" gem "pry" gem "rake" end
github
archan937/ruby-mass
https://github.com/archan937/ruby-mass
ruby-mass.gemspec
Ruby
mit
245
master
868
# -*- encoding: utf-8 -*- Gem::Specification.new do |gem| gem.authors = ["Paul Engel"] gem.email = ["paul.engel@holder.nl"] gem.description = %q{Introspect the Ruby Heap by indexing, counting, locating references to and detaching (in order to release) objects - optionally narrowing by namespace} ...
github
archan937/ruby-mass
https://github.com/archan937/ruby-mass
Rakefile
Ruby
mit
245
master
301
#!/usr/bin/env rake require "bundler/gem_tasks" require "rake/testtask" task :default => :test Rake::TestTask.new do |test| test.pattern = "test/**/test_*.rb" end desc "Generate documentation for RubyMass" task :rdoc do system "rdoc -f horo -t 'RubyMass documentation' -a README.rdoc lib/*" end
github
archan937/ruby-mass
https://github.com/archan937/ruby-mass
test/unit/test_mass.rb
Ruby
mit
245
master
7,390
require File.expand_path("../../test_helper", __FILE__) module Unit class TestMass < MiniTest::Unit::TestCase describe Mass do before do class Foo attr_accessor :foo class Bar attr_accessor :fool end end class Thing attr_accessor ...
github
archan937/ruby-mass
https://github.com/archan937/ruby-mass
lib/mass.rb
Ruby
mit
245
master
7,152
# == Mass # # This module offers the following either within the whole Ruby Heap or narrowed by namespace: # # - indexing objects grouped by class # - counting objects grouped by class # - printing objects grouped by class # - locating references to a specified object # - detaching references to a specified object (in ...
github
archan937/ruby-mass
https://github.com/archan937/ruby-mass
lib/core_ext/object.rb
Ruby
mit
245
master
1,054
class Object # A convenience method for detaching all class instances with detach # def self.detach_all Mass.index(self.class)[self.class.name].each{|object_id| Mass[object_id].detach} end # A convenience method for detaching all class instances with detach! # def self.detach_all! Mass.index(sel...
github
mryan43/magic_encoding
https://github.com/mryan43/magic_encoding
magic_encoding.gemspec
Ruby
mit
245
master
676
# -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = %q{magic_encoding} s.version = "0.0.2" s.required_rubygems_version = Gem::Requirement.new(">= 1.3.6") if s.respond_to? :required_rubygems_version= s.authors = ["Manuel Ryan"] s.date = %q{2010-08-03} s.default_executable = %q{magic_encoding} ...
github
mryan43/magic_encoding
https://github.com/mryan43/magic_encoding
lib/magic_encoding.rb
Ruby
mit
245
master
1,366
# -*- encoding : utf-8 -*- # A simple library to prepend magic comments for encoding to multiple ".rb" files module AddMagicComment # Options : # 1 : Encoding # 2 : Path # TODO : check that the encoding specified is a valid encoding # TODO : allow use of only one option, so the encoding would be guessed (ma...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
Vagrantfile
Ruby
mit
245
master
332
# -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure('2') do |config| config.vm.provider 'virtualbox' do |vb| vb.memory = 8192 end config.vm.box = "ubuntu/focal64" config.vm.network "forwarded_port", guest: 80, host: 8080 config.vm.provision "shell", path: "dev/provisioning/main.sh", privileged...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
samples/02_multimachine/Vagrantfile
Ruby
mit
245
master
992
# -*- mode: ruby -*- # vi: set ft=ruby : # # Basic multi-machine example # Vagrant.configure('2') do |config| config.vm.provider :openstack do |os, ov| os.openstack_auth_url = ENV['OS_AUTH_URL'] os.tenant_name = ENV['OS_TENANT_NAME'] os.username = ENV['OS_USERNAME'] os.pass...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
samples/09_with_http_proxy/Vagrantfile
Ruby
mit
245
master
968
# -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure('2') do |config| config.ssh.username = ENV['OS_SSH_USERNAME'] config.vm.provider :openstack do |os, ov| os.http.proxy = 'http://openstack:3128' os.server_name = '09_with_http_proxy' os.openstack_auth_url = ...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
samples/01_simple/Vagrantfile
Ruby
mit
245
master
1,242
# -*- mode: ruby -*- # vi: set ft=ruby : # # This is quite the minimal configuration necessary # to start an OpenStack instance using Vagrant. # # This example assumes a floating IP is needed to # reach the machine, although you might remove the # floating_ip_pool parameter if you are able to join # the instance using...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
samples/04_heat_stack/Vagrantfile
Ruby
mit
245
master
890
# -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure('2') do |config| config.vm.provider :openstack do |os, ov| os.openstack_auth_url = ENV['OS_AUTH_URL'] os.tenant_name = ENV['OS_TENANT_NAME'] os.username = ENV['OS_USERNAME'] os.password = ENV['OS_PASSWO...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
samples/03_multimachine_loop/Vagrantfile
Ruby
mit
245
master
859
# -*- mode: ruby -*- # vi: set ft=ruby : # # Programmatic loop multi-machine example # Vagrant.configure('2') do |config| config.vm.provider :openstack do |os, ov| os.openstack_auth_url = ENV['OS_AUTH_URL'] os.tenant_name = ENV['OS_TENANT_NAME'] os.username = ENV['OS_USERNAME']...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
samples/07_insert_key_false/Vagrantfile
Ruby
mit
245
master
1,557
# -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure('2') do |config| config.ssh.username = ENV['OS_SSH_USERNAME'] config.ssh.insert_key = false config.ssh.private_key_path = './ssh_key' config.vm.provider :openstack do |os, ov| os.server_name = '06_insert_key_false' os.ope...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
samples/06_keystone_v3/Vagrantfile
Ruby
mit
245
master
1,245
# -*- mode: ruby -*- # vi: set ft=ruby : # # This is quite the minimal configuration necessary # to start an OpenStack instance using Vagrant on # an OpenStack with Keystone v3 API # Vagrant.configure('2') do |config| config.ssh.username = ENV['OS_SSH_USERNAME'] config.vm.provider :openstack do |os, ov| os.s...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
dev/test/Vagrantfile
Ruby
mit
245
master
1,003
require 'vagrant-openstack-provider' Vagrant.configure('2') do |config| config.ssh.username = 'ubuntu' config.vm.boot_timeout = 500 config.vm.provider :openstack do |os, ov| os.server_name = 'vagrant' os.identity_api_version = '3' os.domain_name ...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
source/Vagrantfile
Ruby
mit
245
master
625
require 'vagrant-openstack-provider' Vagrant.configure('2') do |config| config.vm.box = 'openstack' config.ssh.username = ENV['OS_SSH_USERNAME'] config.vm.provider :openstack do |os| os.openstack_auth_url = ENV['OS_AUTH_URL'] os.tenant_name = ENV['OS_TENANT_NAME'] os.username ...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
source/vagrant-openstack-provider.gemspec
Ruby
mit
245
master
1,637
lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'vagrant-openstack-provider/version' Gem::Specification.new do |gem| gem.name = 'vagrant-openstack-provider' gem.version = VagrantPlugins::Openstack::VERSION gem.authors = ['Guillaume G...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
source/Gemfile
Ruby
mit
245
master
303
source 'https://rubygems.org' gemspec group :development do gem 'vagrant', git: 'https://github.com/mitchellh/vagrant.git', tag: 'v2.3.3' gem 'appraisal', '1.0.0' gem 'rubocop', '0.29.0', require: false gem 'coveralls', require: false gem 'rspec-its' end group :debug do gem 'byebug' end
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
source/Rakefile
Ruby
mit
245
master
634
require 'rubygems' require 'bundler/setup' require 'rspec/core/rake_task' require 'rubocop/rake_task' # Immediately sync all stdout so that tools like buildbot can # immediately load in the output. $stdout.sync = true $stderr.sync = true # Change to the directory of this file. Dir.chdir(File.expand_path('../', __FILE...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
source/spec/vagrant-openstack-provider/spec_helper.rb
Ruby
mit
245
master
1,148
if ENV['COVERAGE'] != 'false' require 'simplecov' require 'coveralls' SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter ] SimpleCov.start do add_filter 'spec' end end Dir[ 'lib/vagrant-openstack-provider/versio...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
source/spec/vagrant-openstack-provider/config_resolver_spec.rb
Ruby
mit
245
master
34,825
require 'vagrant-openstack-provider/spec_helper' describe VagrantPlugins::Openstack::ConfigResolver do let(:config) do double('config').tap do |config| config.stub(:tenant_name) { 'testTenant' } config.stub(:server_name) { 'testName' } config.stub(:floating_ip) { nil } config.stub(:floati...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
source/spec/vagrant-openstack-provider/config_spec.rb
Ruby
mit
245
master
13,257
require 'vagrant-openstack-provider/spec_helper' describe VagrantPlugins::Openstack::Config do describe 'defaults' do let(:vagrant_public_key) { Vagrant.source_root.join('keys/vagrant.pub') } subject do super().tap(&:finalize!) end its(:password) { should be_nil } its(:openstack_compute_...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
source/spec/vagrant-openstack-provider/version_checker_spec.rb
Ruby
mit
245
master
1,495
require 'vagrant-openstack-provider/spec_helper' describe VagrantPlugins::Openstack::VersionChecker do let(:version) do double('version') end before :each do @checker = VersionChecker.instance @checker.status = nil Gem.should_receive(:latest_spec_for) .with('vagrant-openstack-provider') ...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
source/spec/vagrant-openstack-provider/provider_spec.rb
Ruby
mit
245
master
324
require 'vagrant-openstack-provider/spec_helper' describe VagrantPlugins::Openstack::Provider do before :each do @provider = VagrantPlugins::Openstack::Provider.new :machine end describe 'to string' do it 'should give the provider name' do @provider.to_s.should eq('Openstack Cloud') end end ...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
source/spec/vagrant-openstack-provider/utils_spec.rb
Ruby
mit
245
master
3,993
require 'vagrant-openstack-provider/spec_helper' describe VagrantPlugins::Openstack::Utils do let(:config) do double('config').tap do |config| config.stub(:tenant_name) { 'testTenant' } config.stub(:server_name) { 'testName' } config.stub(:floating_ip) { nil } end end let(:nova) do ...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
source/spec/vagrant-openstack-provider/action_spec.rb
Ruby
mit
245
master
4,130
require 'vagrant-openstack-provider/spec_helper' describe VagrantPlugins::Openstack::Action do let(:builder) do double('builder').tap do |builder| builder.stub(:use) end end before :each do Action.stub(:new_builder) { builder } end describe 'action_destroy' do it 'add others middlewar...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
source/spec/vagrant-openstack-provider/command/flavor_list_spec.rb
Ruby
mit
245
master
1,259
require 'vagrant-openstack-provider/spec_helper' describe VagrantPlugins::Openstack::Command::FlavorList do describe 'cmd' do let(:nova) do double('nova').tap do |nova| nova.stub(:get_all_flavors) do [ Flavor.new('001', 'small', '1', '1024', '10'), Flavor.new('002'...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
source/spec/vagrant-openstack-provider/command/subnet_list_spec.rb
Ruby
mit
245
master
1,554
require 'vagrant-openstack-provider/spec_helper' describe VagrantPlugins::Openstack::Command::SubnetList do describe 'cmd' do let(:neutron) do double('neutron').tap do |neutron| neutron.stub(:get_subnets) do [ Subnet.new('subnet-01', 'Subnet 1', '192.168.1.0/24', true, 'net-01...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
source/spec/vagrant-openstack-provider/command/volume_list_spec.rb
Ruby
mit
245
master
1,462
require 'vagrant-openstack-provider/spec_helper' describe VagrantPlugins::Openstack::Command::VolumeList do describe 'cmd' do let(:cinder) do double('cinder').tap do |cinder| cinder.stub(:get_all_volumes) do [Volume.new('987', 'vol-01', '2', 'available', 'true', nil, nil), Volu...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
source/spec/vagrant-openstack-provider/command/reset_spec.rb
Ruby
mit
245
master
724
require 'vagrant-openstack-provider/spec_helper' describe VagrantPlugins::Openstack::Command::Reset do describe 'cmd' do let(:env) do {}.tap do |env| env[:ui] = double('ui') env[:ui].stub(:info).with(anything) env[:machine] = double('machine') env[:machine].stub(:data_dir) {...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
source/spec/vagrant-openstack-provider/command/floatingip_list_spec.rb
Ruby
mit
245
master
1,980
require 'vagrant-openstack-provider/spec_helper' describe VagrantPlugins::Openstack::Command::FloatingIpList do describe 'cmd' do let(:nova) do double('nova').tap do |nova| nova.stub(:get_floating_ip_pools) do [ { 'name' => 'pool1' }, { ...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
source/spec/vagrant-openstack-provider/command/network_list_spec.rb
Ruby
mit
245
master
1,679
require 'vagrant-openstack-provider/spec_helper' describe VagrantPlugins::Openstack::Command::NetworkList do describe 'cmd' do let(:neutron) do double('neutron').tap do |neutron| neutron.stub(:get_private_networks) do [ Item.new('net-01', 'internal'), Item.new('net...
github
ggiamarchi/vagrant-openstack-provider
https://github.com/ggiamarchi/vagrant-openstack-provider
source/spec/vagrant-openstack-provider/command/image_list_spec.rb
Ruby
mit
245
master
2,907
require 'vagrant-openstack-provider/spec_helper' describe VagrantPlugins::Openstack::Command::ImageList do let(:nova) do double('nova').tap do |nova| nova.stub(:get_all_images) do [ Image.new('0001', 'ubuntu'), Image.new('0002', 'centos'), Image.new('0003', 'debian') ...