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
emsk/bundle_outdated_formatter
https://github.com/emsk/bundle_outdated_formatter
spec/bundle_outdated_formatter/formatter_spec.rb
Ruby
mit
19
main
2,874
RSpec.describe BundleOutdatedFormatter::Formatter do let(:pretty) { false } let(:column) { %w[gem newest installed requested groups] } let(:formatter) { described_class.new(pretty: pretty, column: column) } let(:stdin) do <<-EOS Warning: the running version of Bundler (1.16.1) is older than the version tha...
github
emsk/bundle_outdated_formatter
https://github.com/emsk/bundle_outdated_formatter
spec/bundle_outdated_formatter/cli_spec.rb
Ruby
mit
19
main
47,440
RSpec.describe BundleOutdatedFormatter::CLI do let(:stdin) do <<-EOS Warning: the running version of Bundler (1.16.1) is older than the version that created the lockfile (1.16.2). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. Fetching gem metadata from https://rubygems....
github
emsk/bundle_outdated_formatter
https://github.com/emsk/bundle_outdated_formatter
spec/bundle_outdated_formatter/formatter/json_formatter_spec.rb
Ruby
mit
19
main
4,947
RSpec.describe BundleOutdatedFormatter::JSONFormatter do let(:pretty) { false } let(:style) { 'unicode' } let(:column) { %w[gem newest installed requested groups] } let(:formatter) { described_class.new(pretty: pretty, style: style, column: column) } describe '#convert' do subject { formatter.convert } ...
github
emsk/bundle_outdated_formatter
https://github.com/emsk/bundle_outdated_formatter
spec/bundle_outdated_formatter/formatter/yaml_formatter_spec.rb
Ruby
mit
19
main
3,869
RSpec.describe BundleOutdatedFormatter::YAMLFormatter do let(:pretty) { false } let(:style) { 'unicode' } let(:column) { %w[gem newest installed requested groups] } let(:formatter) { described_class.new(pretty: pretty, style: style, column: column) } describe '#convert' do subject { formatter.convert } ...
github
emsk/bundle_outdated_formatter
https://github.com/emsk/bundle_outdated_formatter
spec/bundle_outdated_formatter/formatter/tsv_formatter_spec.rb
Ruby
mit
19
main
3,749
RSpec.describe BundleOutdatedFormatter::TSVFormatter do let(:pretty) { false } let(:style) { 'unicode' } let(:column) { %w[gem newest installed requested groups] } let(:formatter) { described_class.new(pretty: pretty, style: style, column: column) } describe '#convert' do subject { formatter.convert } ...
github
emsk/bundle_outdated_formatter
https://github.com/emsk/bundle_outdated_formatter
spec/bundle_outdated_formatter/formatter/markdown_formatter_spec.rb
Ruby
mit
19
main
3,913
RSpec.describe BundleOutdatedFormatter::MarkdownFormatter do let(:pretty) { false } let(:style) { 'unicode' } let(:column) { %w[gem newest installed requested groups] } let(:formatter) { described_class.new(pretty: pretty, style: style, column: column) } describe '#convert' do subject { formatter.convert...
github
emsk/bundle_outdated_formatter
https://github.com/emsk/bundle_outdated_formatter
spec/bundle_outdated_formatter/formatter/html_formatter_spec.rb
Ruby
mit
19
main
6,188
RSpec.describe BundleOutdatedFormatter::HTMLFormatter do let(:pretty) { false } let(:style) { 'unicode' } let(:column) { %w[gem newest installed requested groups] } let(:formatter) { described_class.new(pretty: pretty, style: style, column: column) } describe '#convert' do subject { formatter.convert } ...
github
emsk/bundle_outdated_formatter
https://github.com/emsk/bundle_outdated_formatter
spec/bundle_outdated_formatter/formatter/xml_formatter_spec.rb
Ruby
mit
19
main
6,602
RSpec.describe BundleOutdatedFormatter::XMLFormatter do let(:pretty) { false } let(:style) { 'unicode' } let(:column) { %w[gem newest installed requested groups] } let(:formatter) { described_class.new(pretty: pretty, style: style, column: column) } describe '#convert' do subject { formatter.convert } ...
github
emsk/bundle_outdated_formatter
https://github.com/emsk/bundle_outdated_formatter
spec/bundle_outdated_formatter/formatter/terminal_formatter_spec.rb
Ruby
mit
19
main
6,565
RSpec.describe BundleOutdatedFormatter::TerminalFormatter do let(:pretty) { false } let(:style) { 'unicode' } let(:column) { %w[gem newest installed requested groups] } let(:formatter) { described_class.new(pretty: pretty, style: style, column: column) } describe '#convert' do subject { formatter.convert...
github
emsk/bundle_outdated_formatter
https://github.com/emsk/bundle_outdated_formatter
spec/bundle_outdated_formatter/formatter/csv_formatter_spec.rb
Ruby
mit
19
main
3,749
RSpec.describe BundleOutdatedFormatter::CSVFormatter do let(:pretty) { false } let(:style) { 'unicode' } let(:column) { %w[gem newest installed requested groups] } let(:formatter) { described_class.new(pretty: pretty, style: style, column: column) } describe '#convert' do subject { formatter.convert } ...
github
d-ogarkov/jekyll-extlinks
https://github.com/d-ogarkov/jekyll-extlinks
jekyll-extlinks.gemspec
Ruby
mit
19
master
670
Gem::Specification.new do |s| s.name = "jekyll-extlinks" s.version = "0.0.5" s.date = "2019-10-13" s.summary = "Jekyll ExtLinks Plugin" s.description = <<-EOF Adds custom attributes to external links (rel="nofollow", target="_blank", etc.) EOF s.authors = ["Dmitry Ogarkov"] ...
github
d-ogarkov/jekyll-extlinks
https://github.com/d-ogarkov/jekyll-extlinks
lib/jekyll-extlinks.rb
Ruby
mit
19
master
2,492
# Jekyll ExtLinks Plugin # Adds custom attributes to external links (rel="nofollow", target="_blank", etc.) # # Configuration example in _config.yml (notice the indentation matters): # # extlinks: # attributes: {rel: nofollow, target: _blank} # rel_exclude: ['host1.com', 'host2.net'] # # (attributes are required - ...
github
thhermansen/google_static_maps_helper
https://github.com/thhermansen/google_static_maps_helper
google_static_maps_helper.gemspec
Ruby
mit
19
master
1,501
# -*- encoding: utf-8 -*- require_relative "lib/google_static_maps_helper/version" Gem::Specification.new do |spec| spec.name = "google_static_maps_helper" spec.version = GoogleStaticMapsHelper::VERSION spec.authors = ["Thorbjørn Hermansen"] spec.email = ["thhermansen@gmail.com"] ...
github
thhermansen/google_static_maps_helper
https://github.com/thhermansen/google_static_maps_helper
lib/google_static_maps_helper.rb
Ruby
mit
19
master
3,033
# -*- encoding: utf-8 -*- require 'uri' require File.dirname(__FILE__) + '/google_static_maps_helper/map' require File.dirname(__FILE__) + '/google_static_maps_helper/location' require File.dirname(__FILE__) + '/google_static_maps_helper/marker' require File.dirname(__FILE__) + '/google_static_maps_helper/path' require...
github
thhermansen/google_static_maps_helper
https://github.com/thhermansen/google_static_maps_helper
lib/google_static_maps_helper/marker.rb
Ruby
mit
19
master
3,754
# -*- encoding: utf-8 -*- module GoogleStaticMapsHelper # # A marker object is representing a marker with a customizable label, color and size. # class Marker DEFAULT_OPTIONS = { :color => 'red', :size => 'mid', :label => nil, :icon => nil, :shadow => nil } attr_access...
github
thhermansen/google_static_maps_helper
https://github.com/thhermansen/google_static_maps_helper
lib/google_static_maps_helper/map.rb
Ruby
mit
19
master
7,624
# -*- encoding: utf-8 -*- module GoogleStaticMapsHelper # # The Map keeps track of the state of which we want to build a URL for. # It will hold Markers and Paths, and other states like dimensions of the map, # image format, language etc. # class Map include Enumerable MAX_WIDTH = 640 MAX_HEIGH...
github
thhermansen/google_static_maps_helper
https://github.com/thhermansen/google_static_maps_helper
lib/google_static_maps_helper/location.rb
Ruby
mit
19
master
4,190
# -*- encoding: utf-8 -*- module GoogleStaticMapsHelper # # Represents a location with lat and lng values. # # This classed is used internally to back up Markers' location # and Paths' points. # class Location EARTH_RADIUS_KM = 6371 # :nodoc: LAT_LNG_PRECISION = 6 # :nodoc: class NoLngMethod...
github
thhermansen/google_static_maps_helper
https://github.com/thhermansen/google_static_maps_helper
lib/google_static_maps_helper/path.rb
Ruby
mit
19
master
4,382
# -*- encoding: utf-8 -*- module GoogleStaticMapsHelper # # A Path is used to draw things in the map, either lines or Polygons. # It is build up of points and if a fill color is set you'll get a Polygon. # class Path include Enumerable OPTIONAL_OPTIONS = [:weight, :color, :fillcolor] attr_access...
github
thhermansen/google_static_maps_helper
https://github.com/thhermansen/google_static_maps_helper
lib/google_static_maps_helper/gmap_polyline_encoder.rb
Ruby
mit
19
master
12,107
#-- # # Utility for creating Google Maps Encoded GPolylines # # License: You may distribute this code under the same terms as Ruby itself # # Author: Joel Rosenberg # # ( Drawing from the official example pages as well as Mark McClure's work ) # # == Example # # data = [ # [ 37.4419, -122.1419], # [ 37.4519, ...
github
thhermansen/google_static_maps_helper
https://github.com/thhermansen/google_static_maps_helper
spec/marker_spec.rb
Ruby
mit
19
master
6,608
# -*- encoding: utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/spec_helper') describe GoogleStaticMapsHelper::Marker do before :each do @location_hash = {:lat => 10, :lng => 20} @location_object = double(:location, @location_hash) end describe "initialize" do it "should raise Argument...
github
thhermansen/google_static_maps_helper
https://github.com/thhermansen/google_static_maps_helper
spec/map_spec.rb
Ruby
mit
19
master
12,342
# -*- encoding: utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/spec_helper') describe GoogleStaticMapsHelper::Map do reguire_options = { :size => '600x400', :sensor => false } describe "initialize" do before do reguire_options.each_key {|k| GoogleStaticMapsHelper.send("#{k}=", n...
github
thhermansen/google_static_maps_helper
https://github.com/thhermansen/google_static_maps_helper
spec/google_static_maps_helper_spec.rb
Ruby
mit
19
master
1,735
# -*- encoding: utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/spec_helper') describe GoogleStaticMapsHelper do describe "Friendly DSL API" do describe "url_for" do before do GoogleStaticMapsHelper.size = '300x500' GoogleStaticMapsHelper.sensor = false end it "sh...
github
thhermansen/google_static_maps_helper
https://github.com/thhermansen/google_static_maps_helper
spec/path_spec.rb
Ruby
mit
19
master
5,774
# -*- encoding: utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/spec_helper') describe GoogleStaticMapsHelper::Path do options = { :weight => 5, :color => "0x0000ff", :fillcolor => "0x110000ff" } describe "initialize" do options.each_key do |attribute| it "should be able to s...
github
thhermansen/google_static_maps_helper
https://github.com/thhermansen/google_static_maps_helper
spec/location_spec.rb
Ruby
mit
19
master
6,180
# -*- encoding: utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/spec_helper') describe GoogleStaticMapsHelper::Location do before :each do @location_hash = {:lat => 10, :lng => 20} @location_object = double(:location, @location_hash) end describe "initialize" do it "should raise Argume...
github
thhermansen/google_static_maps_helper
https://github.com/thhermansen/google_static_maps_helper
spec/spec_helper.rb
Ruby
mit
19
master
361
# -*- encoding: utf-8 -*- $LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'google_static_maps_helper' require 'rspec' RSpec.configure do |config| config.expect_with :rspec do |c| c.syntax = :should end config.mock_with :rspec do |c...
github
corbanbrook/rcomposite
https://github.com/corbanbrook/rcomposite
rcomposite.gemspec
Ruby
mit
19
master
865
Gem::Specification.new do |s| s.name = 'rcomposite' s.version = '0.3.1' s.date = '2009-08-13' s.summary = "An RMagick abstration layer for easy image compositing" s.description = "Rubyshop is an RMagick abstraction library to easily manipulate and composite images through the use of a canvas, layers, layer m...
github
corbanbrook/rcomposite
https://github.com/corbanbrook/rcomposite
lib/rcomposite.rb
Ruby
mit
19
master
204
require 'RMagick' require 'rcomposite/layerset' require 'rcomposite/layer' require 'rcomposite/canvas' require 'rcomposite/filllayer' require 'rcomposite/adjustmentlayer' require 'rcomposite/layermask'
github
corbanbrook/rcomposite
https://github.com/corbanbrook/rcomposite
lib/rcomposite/filllayer.rb
Ruby
mit
19
master
946
module RComposite # Fill layer types SolidColor = 0 Gradient = 1 Pattern = 2 class FillLayer < Layer attr_accessor :image attr_reader :offset_x, :offset_y def initialize(type, *args, &block) case type when SolidColor color = args[0] fill = Magick::GradientFi...
github
corbanbrook/rcomposite
https://github.com/corbanbrook/rcomposite
lib/rcomposite/canvas.rb
Ruby
mit
19
master
361
module RComposite class Canvas < LayerSet attr_reader :width, :height attr_accessor :image def initialize(width, height, &block) @image = Magick::Image.new width, height @width = width @height = height $RCompositeCanvasWidth = @width $RCompositeCanvasHeight = @height ...
github
corbanbrook/rcomposite
https://github.com/corbanbrook/rcomposite
lib/rcomposite/layermask.rb
Ruby
mit
19
master
610
module RComposite class LayerMask < Layer def apply(layer) # apply layer mask to layer before merging down fill = Magick::GradientFill.new(0,0,0,0, '#000', '#000') mask = Magick::Image.new(layer.width, layer.height, fill) mask.composite!(@image, @offset_x, @offset_y, Magick::OverCompositeO...
github
corbanbrook/rcomposite
https://github.com/corbanbrook/rcomposite
lib/rcomposite/adjustmentlayer.rb
Ruby
mit
19
master
1,004
module RComposite Levels = 1 Curves = 2 ColorBalance = 3 BrightnessContrast = 4 HueSaturation = 5 SelectiveColor = 6 ChannelMixer = 7 GradientMap = 8 PhotoFilter = 9 Invert = 10 # negate Threshold = 11 # threshold Polarize = 12 # Blur = 13 class AdjustmentLayer < Layer attr_reader :typ...
github
corbanbrook/rcomposite
https://github.com/corbanbrook/rcomposite
lib/rcomposite/layerset.rb
Ruby
mit
19
master
5,218
module RComposite class LayerSet attr_accessor :layers attr_reader :min_x, :min_y, :max_x, :max_y, :bounding_width, :bounding_height, :name def initialize(name, &block) @layers = [] bounding_box @name = name self.instance_eval &block if block_given? end def stack(&b...
github
corbanbrook/rcomposite
https://github.com/corbanbrook/rcomposite
lib/rcomposite/layer.rb
Ruby
mit
19
master
3,033
module RComposite # Layer mode constants # some of photoshops layer modes are directly equvilent to RMagick # some are not, and some arent supported at all. Normal = Magick::OverCompositeOp # PS equivilent Dissolve = Magick::DissolveCompositeOp Darken = Magick::DarkenCompositeOp # PS equivilent Mul...
github
relevance/multi_rails
https://github.com/relevance/multi_rails
multi_rails.gemspec
Ruby
mit
19
master
2,656
# -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = %q{multi_rails} s.version = "0.0.8" s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version= s.authors = ["Rob Sanheim, Relevance"] s.date = %q{2009-01-19} s.default_executable = %q{multi_rail...
github
relevance/multi_rails
https://github.com/relevance/multi_rails
.autotest
Ruby
mit
19
master
667
require 'autotest' $LOAD_PATH.unshift "test", "test/autotest" # Make sure autotest groks our directory structure to map tests to files p 'here!' Autotest.add_hook :initialize do |at| at.add_mapping(/^lib\/(.*)\.rb$/) { |filename, m| file = File.basename(filename).gsub("_", "_?").gsub(".rb", "") foo = at.file...
github
relevance/multi_rails
https://github.com/relevance/multi_rails
Rakefile
Ruby
mit
19
master
2,367
begin gem 'technicalpickles-echoe' rescue LoadError => e puts "couldn't find the correct version of echoe - please install from forked version on github: http://github.com/technicalpickles/echoe/" puts "gem sources -a http://gems.github.com" puts "sudo gem install technicalpickles-echoe" end require 'rubygems'...
github
relevance/multi_rails
https://github.com/relevance/multi_rails
test/multi_rails_init_test.rb
Ruby
mit
19
master
744
require File.expand_path(File.join(File.dirname(__FILE__), "multi_rails_test_helper")) describe "Rubygem test helper init" do setup { never_puts } it "should call gem and require rails" do MultiRails.expects(:gem_and_require_rails).once load File.expand_path(File.join(File.dirname(__FILE__), "../lib/mul...
github
relevance/multi_rails
https://github.com/relevance/multi_rails
test/loader_test.rb
Ruby
mit
19
master
4,127
require File.expand_path(File.join(File.dirname(__FILE__), "multi_rails_test_helper")) describe "Loader with no Rails gem installed" do it "should fail fast if we don't have any rails gems installed" do Gem::cache.expects(:find_name).with("rails").returns([]) lambda { MultiRails::Loader.gem_and_require_rail...
github
relevance/multi_rails
https://github.com/relevance/multi_rails
test/multi_rails_test_helper.rb
Ruby
mit
19
master
374
require 'rubygems' require 'test/unit' gem 'test-spec' require 'test/spec' require 'mocha' require 'redgreen' unless Object.const_defined?("TextMate") require File.expand_path(File.join(File.dirname(__FILE__), "../lib/multi_rails")) class Test::Unit::TestCase def never_puts MultiRails::Loader.stubs(:puts) M...
github
relevance/multi_rails
https://github.com/relevance/multi_rails
test/autotest/railsplugin.rb
Ruby
mit
19
master
688
# Discover our lib and tests for autotest'ing Rails Plugins class Autotest::Railsplugin < Autotest def initialize super @exceptions = /\/\./ @test_mappings = { /^lib\/(.*)\.rb$/ => proc { |filename, m| file = File.basename(filename).gsub("_", "_?").gsub(".rb", "") foo = files_matchin...
github
relevance/multi_rails
https://github.com/relevance/multi_rails
lib/multi_rails.rb
Ruby
mit
19
master
378
require 'rubygems' require 'logger' files = %w(core_extensions config loader multi_rails_error rails_app_helper) files.each do |file| require File.expand_path(File.join(File.dirname(__FILE__), "multi_rails/#{file}")) end module MultiRails VERSION = '0.0.8' BAR = "=" * 80 # BEST CONSTANT EVAH def self.gem_an...
github
relevance/multi_rails
https://github.com/relevance/multi_rails
lib/multi_rails/loader.rb
Ruby
mit
19
master
2,161
module MultiRails class Loader attr_reader :version def self.logger @logger ||= Logger.new(STDOUT) end # Require and gem rails # Will use a default version if none is supplied def self.gem_and_require_rails(rails_version = nil) verify_rails_installed rails_version ...
github
botanicus/nake
https://github.com/botanicus/nake
nake.gemspec
Ruby
mit
19
master
1,104
#!/usr/bin/env gem build # encoding: utf-8 # NOTE: we can't use require_relative because when we run gem build, it use eval for executing this file #$:.unshift(File.join(File.dirname(__FILE__), "lib")) #require "nake" require "base64" Gem::Specification.new do |s| s.name = "nake" s.version = "0.1.1" s.authors =...
github
botanicus/nake
https://github.com/botanicus/nake
tasks.rb
Ruby
mit
19
master
1,347
#!./bin/nake # encoding: utf-8 begin require File.expand_path("../.bundle/environment", __FILE__) rescue LoadError require "bundler" Bundler.setup end $LOAD_PATH.unshift(File.expand_path("../lib", __FILE__)) require "nake/tasks/gem" require "nake/tasks/spec" require "nake/tasks/release" begin load "code-cle...
github
botanicus/nake
https://github.com/botanicus/nake
nake.pre.gemspec
Ruby
mit
19
master
290
#!/usr/bin/env gem build # encoding: utf-8 # You might think this is a terrible mess and guess what, you're # right mate! However say thanks to authors of RubyGems, not me. eval(File.read("nake.gemspec")).tap do |specification| specification.version = "#{specification.version}.pre" end
github
botanicus/nake
https://github.com/botanicus/nake
bm/bms.rb
Ruby
mit
19
master
1,315
#!/usr/bin/env ruby $VERBOSE = nil # shut up require "rbench" rake = `which rake`.chomp nake = "./bin/nake" abort "You have to install Rake!" if rake.empty? puts "Using nake from #{nake} and rake from #{rake}\n\n" def run(command) system("#{command} &> /dev/null") || abort("Problem during running #{command}") en...
github
botanicus/nake
https://github.com/botanicus/nake
bm/tasks.rb
Ruby
mit
19
master
377
#!../bin/nake task :simple do puts "Hello World!" end task "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:w:x:y:z" do # do nothing end directory "tmp/www" file "tmp/www/index.html", "tmp/www" do |path| File.open(path, "w") do |file| file.puts("<html>Hello World!</html>") end end #rule ".o" => [".c"] do |...
github
botanicus/nake
https://github.com/botanicus/nake
bm/Rakefile
Ruby
mit
19
master
537
desc "Simple task" task :simple do puts "Hello World!" end desc "Namespaced task" task "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:w:x:y:z" do # do nothing end desc "Task with arguments" task :arguments desc "Task with dependencies" task :dependencies directory "tmp/www" desc "Generate tmp/www/index.html" fil...
github
botanicus/nake
https://github.com/botanicus/nake
features/steps.rb
Ruby
mit
19
master
898
# encoding: utf-8 require "open3" # http://redmine.ruby-lang.org/issues/show/1287 When /^I run "([^\"]*)"$/ do |command| _, @stdout, @stderr, thread = Open3.popen3(command) @status = thread.value.exitstatus end Then /^it should show "([^\"]*)"$/ do |pattern| @stdout.read.should_not match(pattern) end Then /^i...
github
botanicus/nake
https://github.com/botanicus/nake
examples/default_proc.rb
Ruby
mit
19
master
640
#!/usr/bin/env ./bin/nake # Default value returned from Task["not_existing_task"] don't have to be even a task, # it just have to respond to #call, so you can use Hash#default_proc=(proc) as well # Just make sure you are wrap the callable object in lambda, because the callable # object has to be returned as a result f...
github
botanicus/nake
https://github.com/botanicus/nake
examples/task_arguments.rb
Ruby
mit
19
master
761
#!/usr/bin/env ./bin/nake task(:greet) do |user, options| # FIXME: this doesn't work if you don't specify any args puts "Hi #{user}!" end task(:greet) do |user = ENV["USER"], options| puts "Hi #{user}!" end # ./examples/task_arguments.rb greet:options # ./examples/task_arguments.rb greet:options --name=botanicus...
github
botanicus/nake
https://github.com/botanicus/nake
examples/file.rb
Ruby
mit
19
master
622
#!/usr/bin/env ./bin/nake # File tasks doesn't have any options or arguments, # because if you have some setup which may generate # each time different file, than the whole machinery # for recognization if given task should run is useless. # Of course you may want to use task for generating # a file with arguments and...
github
botanicus/nake
https://github.com/botanicus/nake
examples/description.rb
Ruby
mit
19
master
532
desc :release, "Create a new release" task(:release) do # ... end task = task(:release) do # ... end task.description = "Create a new release" task(:release) do # ... end Task[:release].description = "Create a new release" task = task(:release) task.description = "Create a new release" task.define do # ... e...
github
botanicus/nake
https://github.com/botanicus/nake
examples/dependencies.rb
Ruby
mit
19
master
358
#!/usr/bin/env ./bin/nake # You can do the same by adding Task[name].call in the define block, but please, # don't use this approach. Dependencies are readable and if someone wants to, # he can simply remove a dependency from the dependency array. task(:greet1) task(:greet2) task = task(:greet3, :greet1, :greet2) tas...
github
botanicus/nake
https://github.com/botanicus/nake
examples/boot.rb
Ruby
mit
19
master
821
#!/usr/bin/env ./bin/nake # You might want to give more useful description, however you don't have access # to some variables so far ... at least with Rake. Nake provides boot method which # run after everything is loaded, and if you specify optional dependencies for the # boot method, it will run the boot block of sp...
github
botanicus/nake
https://github.com/botanicus/nake
examples/script.rb
Ruby
mit
19
master
500
#!/usr/bin/env ruby --disable-gems # This file shows how to run Nake from API. In most of cases you don't # need this and you might want to use just shebang with env, but this # might come handy if you need to pass some arguments for Ruby. $:.unshift(File.join(File.dirname(__FILE__), "..", "lib")) require "nake" # t...
github
botanicus/nake
https://github.com/botanicus/nake
examples/invoking.rb
Ruby
mit
19
master
254
#!/usr/bin/env ./bin/nake task(:inspect) do |*args, options| puts "Arguments: #{args.inspect}" puts "Options: #{options.inspect}" end task(:foo) do Task[:inspect].call end task(:bar) do |*args, options| Task[:inspect].call(*args, options) end
github
botanicus/nake
https://github.com/botanicus/nake
examples/default.rb
Ruby
mit
19
master
608
#!/usr/bin/env ./bin/nake # When you run rake without arguments, it will try to run task called default. # Since I don't believe in any stupid convention, I don't support anything similar, # because you can do it just using standard Ruby methods like Hash#default=(value) # Of course the task which you are assigning as...
github
botanicus/nake
https://github.com/botanicus/nake
examples/arguments.rb
Ruby
mit
19
master
1,218
#!/usr/bin/env ./bin/nake --debug # This example document how you can change different flags # - specify these flags in shebang # - use API directly # - ./examples/flags --verbose Nake.verbose = false # Arguments might be considered as a light-weight variant to tasks # There are two ways how you can use tasks: # 1) a...
github
botanicus/nake
https://github.com/botanicus/nake
examples/configuration.rb
Ruby
mit
19
master
328
#!/usr/bin/env ./bin/nake # this will be probably in a library Task.new(:build) do |task| task.define do sh "gem build #{task.config[:gemspec]}" end end # and this in your file with tasks Task[:build].config[:gemspec] = "nake.gemspec" # if the task isn't defined yet task(:mytask) Task[:mytask].config[:name] ...
github
botanicus/nake
https://github.com/botanicus/nake
spec/spec_helper.rb
Ruby
mit
19
master
434
# encoding: utf-8 begin require "spec" rescue LoadError abort "You have to install rspec gem!" end require "stringio" def STDOUT.capture(&block) before = self $stdout = StringIO.new block.call $stdout.rewind output = $stdout.read $stdout = before output end def STDERR.capture(&block) before = se...
github
botanicus/nake
https://github.com/botanicus/nake
spec/nake/dsl_spec.rb
Ruby
mit
19
master
960
# encoding: utf-8 require_relative "../spec_helper" require "nake/dsl" describe "Object#task" do before(:each) do Nake::Task.tasks.clear end it "should take name as a first argument" do task(:name).name.should eql(:name) end it "should optinally take other arguments as a dependencies" do task(...
github
botanicus/nake
https://github.com/botanicus/nake
spec/nake/template_spec.rb
Ruby
mit
19
master
2,329
# encoding: utf-8 require_relative "../spec_helper" require "nake/template" describe Nake::Template do describe ".new" do it "should take one argument with path to the file" do -> { Nake::Template.new("spec/stubs/database.yml.tt") }.should_not raise_error end end describe "#render" do before(...
github
botanicus/nake
https://github.com/botanicus/nake
spec/nake/helpers_spec.rb
Ruby
mit
19
master
344
# encoding: utf-8 require_relative "../spec_helper" require "nake/helpers" describe Nake::TaskHelpers do include Nake::TaskHelpers describe "#sh" do it "should be able to execute external commands" it "should show which command runs" it "should show STDOUT of the command" it "should show STDERR of...
github
botanicus/nake
https://github.com/botanicus/nake
spec/nake/rule_spec.rb
Ruby
mit
19
master
1,841
# encoding: utf-8 require_relative "../spec_helper" require "nake/rule" describe Nake::Rule do before(:each) do Nake::Rule.rules.clear end describe "[]" do it "should find rule with given name if the name is a symbol" it "should find rule with given name if the name is a string" it "should find...
github
botanicus/nake
https://github.com/botanicus/nake
spec/nake/argv_spec.rb
Ruby
mit
19
master
1,430
# encoding: utf-8 require_relative "../spec_helper" require "nake/argv" describe Nake::ArgvParsingMixin do def parse(*args) args.extend(Nake::ArgvParsingMixin) args.extract! end describe "#parse!" do it "should returns Hash" do parse.should be_kind_of(Hash) end it "should parse --git...
github
botanicus/nake
https://github.com/botanicus/nake
spec/nake/tasks_spec.rb
Ruby
mit
19
master
991
# encoding: utf-8 require_relative "../spec_helper" load "nake/tasks.rb" @result = STDOUT.capture { Task["-T"].call } describe "Default tasks" do describe "-H" do before(:each) do load "nake/tasks.rb" end it "should be available as a -H or --help" do Task["-H"].should eql(Task["--help"]) ...
github
botanicus/nake
https://github.com/botanicus/nake
spec/nake/task_spec.rb
Ruby
mit
19
master
1,787
# encoding: utf-8 require_relative "../spec_helper" require "nake/task" describe Nake::Task do before(:each) do Nake::Task.tasks.clear end describe "[]" do it "should find task with given name if the name is a symbol" it "should find task with given name if the name is a string" it "should find...
github
botanicus/nake
https://github.com/botanicus/nake
spec/nake/tasks/bundle_spec.rb
Ruby
mit
19
master
831
# encoding: utf-8 require_relative "../../spec_helper" require "nake/tasks/bundle" describe "Task bundle" do before(:each) do @task = Nake::Task[:bundle] @bundler = Object.new.define_singleton_method(:invoke) { |*args| args } @task.define_singleton_method(:bundler) { @bundler } end it "should invok...
github
botanicus/nake
https://github.com/botanicus/nake
lib/nake.rb
Ruby
mit
19
master
2,401
# encoding: utf-8 module Nake # VERSION ||= "0.0.8.1" def self.verbose @@verbose rescue NameError @@verbose = true end def self.verbose=(boolean) @@verbose = boolean end def self.debug @@debug rescue NameError @@debug = true end def self.debug=(boolean) @@debug = boolean ...
github
botanicus/nake
https://github.com/botanicus/nake
lib/nake/helpers.rb
Ruby
mit
19
master
1,371
# encoding: utf-8 require "fileutils" require "nake/colors" module Nake module TaskHelpers include FileUtils def run(*parts) puts parts.join(" ").cyan system(*parts) end # return true if process suceeded, false otherwise # sh "ls -a" # sh "ls", "-a" def sh(*parts) puts...
github
botanicus/nake
https://github.com/botanicus/nake
lib/nake/struct_hash.rb
Ruby
mit
19
master
468
# encoding: utf-8 # options.extend(HashStructMixin) # options.name # options.force? module Nake module HashStructMixin def method_missing(name, *args, &block) if args.empty? && block.nil? # options.name if value = self[name] return value # options.force? elsif name...
github
botanicus/nake
https://github.com/botanicus/nake
lib/nake/argv.rb
Ruby
mit
19
master
1,221
# encoding: utf-8 module Nake module ArgvParser def self.extract!(args) args.dup.inject(Hash.new) do |options, argument| key, value = self.parse(argument) if key options[key] = value args.delete(argument) end options end end def self.extrac...
github
botanicus/nake
https://github.com/botanicus/nake
lib/nake/file_task.rb
Ruby
mit
19
master
2,202
# encoding: utf-8 require "nake/abstract_task" module Nake class FileTask < AbstractTask # TODO: default description na Generate #name alias_method :path, :name # FileTask can depend on tasks, other file tasks or just files. # If a file task depends on a task, this task isn't supposed to change any...
github
botanicus/nake
https://github.com/botanicus/nake
lib/nake/template.rb
Ruby
mit
19
master
1,075
# encoding: utf-8 module Nake module TaskHelpers def template(source, target, context = Hash.new) template = Template.new(source) File.open(target, "w") do |file| file.puts(template.render(context)) end end def erb(source, target, context = Hash.new) template = ErbTemplat...
github
botanicus/nake
https://github.com/botanicus/nake
lib/nake/args.rb
Ruby
mit
19
master
1,791
# encoding: utf-8 require "nake/dsl" argument("-H", "--help") do |task_name = nil| if task_name task = Task[task_name] if task p task # TODO else abort "Task #{task_name} doesn't exist" end else Kernel.abort "Use #{$0} -T for list of all available tasks or -i for interactive sessio...
github
botanicus/nake
https://github.com/botanicus/nake
lib/nake/colors.rb
Ruby
mit
19
master
408
# encoding: utf-8 begin require "term/ansicolor" rescue LoadError raise LoadError, "You have to install term-ansicolor gem!" end String.send(:include, Term::ANSIColor) # just for now, I know it's a mess module Term::ANSIColor def self.coloring? if @coloring.respond_to?(:call) @coloring.call else ...
github
botanicus/nake
https://github.com/botanicus/nake
lib/nake/runner.rb
Ruby
mit
19
master
1,962
require "nake" require "nake/args" require "nake/helpers" module Nake def self.run # parse arguments begin Nake.parse rescue Exception => exception puts "~ Arguments parsed into #{Nake.parse.inspect.green}" puts "Exception occured during parsing arguments" print_exception_with_bac...
github
botanicus/nake
https://github.com/botanicus/nake
lib/nake/rule.rb
Ruby
mit
19
master
692
# encoding: utf-8 require "nake/abstract_task" module Nake class Rule < AbstractTask undef_method :hidden, :hidden= class << self undef_method :tasks end def self.rules @@rules ||= Hash.new end # Rule["test.o"] # # => rule with pattern ".o" def self.[](file) self....
github
botanicus/nake
https://github.com/botanicus/nake
lib/nake/abstract_task.rb
Ruby
mit
19
master
5,319
# encoding: utf-8 require "nake/colors" require "nake/argv" require "nake/helpers" module Nake TaskNotFound ||= Class.new(StandardError) ConfigurationError ||= Class.new(StandardError) class AbstractTask def self.[](name) self.tasks[name.to_s] end def self.[]=(name, task) self.tasks[na...
github
botanicus/nake
https://github.com/botanicus/nake
lib/nake/dsl.rb
Ruby
mit
19
master
1,479
# encoding: utf-8 require "nake" require "nake/task" require "nake/file_task" module Nake module DSL include Nake def argument(*names, &block) Nake.args[*names] = block end # desc :release, "Create a new release" # task(:release) do # # ... # end def desc(task, description) ...
github
botanicus/nake
https://github.com/botanicus/nake
lib/nake/rake.rb
Ruby
mit
19
master
501
# encoding: utf-8 require "filelist" # rake is distributed with Ruby 1.9 anyway module Rake def self.method_missing raise NotImplementedError end def self.const_missing(constant) raise NotImplementedError, "Nake doesn't support Rake::#{constant}, please use normal Rake" end end module Nake module ...
github
botanicus/nake
https://github.com/botanicus/nake
lib/nake/tasks/gem.rb
Ruby
mit
19
master
616
# encoding: utf-8 require "nake/dsl" require "nake/tasks/clean" # register gem files for cleaning Task[:clean].config[:files].push(*Dir["*.gem"]) module Nake::PackageMixin def gem_name "#{Task[:release].config[:name]}-#{Task[:release].config[:version]}.gem" end end # require "nake/tasks/gem" # Task[:build]....
github
botanicus/nake
https://github.com/botanicus/nake
lib/nake/tasks/clean.rb
Ruby
mit
19
master
251
# encoding: utf-8 require "nake/dsl" # require "nake/tasks/clean" # Task[:clean].config[:files] = Dir["*.gem"] Task.new(:clean) do |task| task.config[:files] = Array.new task.define do task.config[:files].each { |file| rm_f file } end end
github
botanicus/nake
https://github.com/botanicus/nake
lib/nake/tasks/release.rb
Ruby
mit
19
master
1,417
# encoding: utf-8 require "nake/tasks/gem" # require "nake/tasks/release" # Task[:release].config[:version] = Nake::VERSION task(:release, "release:tag", "release:gemcutter").tap do |task| task.description = "Release current version version" task.define do puts "Version #{task.config[:version]} was successful...
github
botanicus/nake
https://github.com/botanicus/nake
lib/nake/tasks/rip.rb
Ruby
mit
19
master
808
# encoding: utf-8 begin require "recho" rescue LoadError raise LoadError, "This task require recho gem!" end require "nake/file_task" # FileTask["deps.rip"].config[:versions] = {rack: "1.0.1", media_path: "SHA1"} # register task #Task[:release].dependencies.unshift("deps.rip") # deps.rip.str: ##!/usr/bin/env r...
github
botanicus/nake
https://github.com/botanicus/nake
lib/nake/tasks/bundle.rb
Ruby
mit
19
master
781
# encoding: utf-8 require "nake/task" # NOTE: if you have bundler bundled locally, just # add bundler/lib into $: and this task will work Nake::Task.new(:bundle) do |task| task.description = "Install your gems locally from gems/cache via bundler" # define bundler method, so we can test it task.define_singleton...
github
botanicus/nake
https://github.com/botanicus/nake
lib/nake/tasks/spec.rb
Ruby
mit
19
master
533
# encoding: utf-8 # ./tasks.rb spec/nake/argv_spec.rb spec/nake/task_spec.rb task(:spec) do |*paths, options| paths.push("spec") if paths.empty? sh "spec", *paths end Task.new("spec:stubs") do |task| task.description = "Create stubs of all library files." task.define do Dir.glob("lib/**/*.rb").each do |fi...
github
porras/rakegrowl
https://github.com/porras/rakegrowl
rakegrowl.gemspec
Ruby
mit
19
master
517
# -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = "rakegrowl" s.version = "0.3.1" s.authors = ["Sergio Gil Pérez de la Manga"] s.date = "2011-09-21" s.email = "sgilperez@gmail.com" s.extra_rdoc_files = ["README.md"] s.files = %w(LICENSE README.md) + Dir.glob("{lib/**/*}") s.homepage = "...
github
porras/rakegrowl
https://github.com/porras/rakegrowl
spec/spec_helper.rb
Ruby
mit
19
master
592
require 'rubygems' require 'rake' require 'rakegrowl' load 'sample.rake' def run_tasks(*tasks) Rake.application.instance_variable_set("@top_level_tasks", tasks) silence_stream(STDERR) do Rake.application.top_level end end def clear_tasks Rake.application.tasks.each do |task| task.instance_variable_set...
github
porras/rakegrowl
https://github.com/porras/rakegrowl
spec/rakegrowl_spec.rb
Ruby
mit
19
master
2,272
require 'spec_helper' describe Rakegrowl::Growl do describe "exists?" do it "should return true if growlnotify is installed in the system" do Rakegrowl::Growl.stub!(:`).with("which growlnotify").and_return("/wadus/bin/growlnotify\n") Rakegrowl::Growl.exists?.should be_true end it...
github
porras/rakegrowl
https://github.com/porras/rakegrowl
spec/sample.rake
Ruby
mit
19
master
213
task :pre do "do pre" end task :main => :pre do "do main" end task :main2 => :pre do "do main2" end task :buggy do raise "Wadus" end namespace :wadus do task :wadus do "do wadus wadus" end end
github
porras/rakegrowl
https://github.com/porras/rakegrowl
lib/rakegrowl.rb
Ruby
mit
19
master
894
module Rakegrowl module Growl def self.growlnotify `which growlnotify`.chomp end def self.exists? !growlnotify.empty? end def self.notify(title, message) Kernel.system("#{growlnotify} -t \"#{title}\" -m \"#{message}\"") if exists? end end def self.enhance_tasks ...
github
jamonholmgren/motion-table
https://github.com/jamonholmgren/motion-table
motion-table.gemspec
Ruby
mit
19
master
906
# -*- encoding: utf-8 -*- require File.expand_path('../lib/motion-table/version', __FILE__) Gem::Specification.new do |gem| gem.authors = ["ClearSight Studio"] gem.email = ["contact@clearsightstudio.com"] gem.description = "MotionTable is a RubyMotion gem that makes it easy to handle UITableViews...
github
jamonholmgren/motion-table
https://github.com/jamonholmgren/motion-table
spec/grouped_table_spec.rb
Ruby
mit
19
master
1,021
describe "Test App" do before do @app = UIApplication.sharedApplication end it "has one window" do @app.windows.size.should == 1 end describe "MotionTable::Grouped Table Mixin" do tests TestViewController it "includes MotionTable::GroupedTable as a mixin" do controller.class.included_...
github
jamonholmgren/motion-table
https://github.com/jamonholmgren/motion-table
lib/motion-table.rb
Ruby
mit
19
master
308
unless defined?(Motion::Project::Config) raise "This file must be required within a RubyMotion project Rakefile." end require "motion-table/version" Motion::Project::App.setup do |app| Dir.glob(File.join(File.dirname(__FILE__), "motion-table/*.rb")).each do |file| app.files.unshift(file) end end
github
jamonholmgren/motion-table
https://github.com/jamonholmgren/motion-table
lib/motion-table/plain_table.rb
Ruby
mit
19
master
349
module MotionTable module PlainTable include MotionTable::SectionedTable include MotionTable::SearchableTable def tableView @tableView ||= UITableView.alloc.initWithFrame(self.view.frame, style:UITableViewStylePlain) @tableView.dataSource = self; @tableView.delegate = self; return...
github
jamonholmgren/motion-table
https://github.com/jamonholmgren/motion-table
lib/motion-table/sectioned_table.rb
Ruby
mit
19
master
3,906
module MotionTable module SectionedTable # @param [Array] Array of table data # @returns [UITableView] delegated to self def createTableViewFromData(data) setTableViewData data return tableView end def updateTableViewData(data) setTableViewData data @tableView.reloadData ...
github
jamonholmgren/motion-table
https://github.com/jamonholmgren/motion-table
lib/motion-table/console.rb
Ruby
mit
19
master
756
module MotionTable # @author Silas J Matson # # Provides coloring for displaying messages in console when running in the simulator class Console NAME = "MotionTable::Console" DEFAULT_COLOR = [ '', '' ] RED_COLOR = [ "\e[0;31m", "\e[0m" ] # Must be in double quotes GREEN_COLOR = [ "\e[0;32m", "\...
github
jamonholmgren/motion-table
https://github.com/jamonholmgren/motion-table
lib/motion-table/searchable_table.rb
Ruby
mit
19
master
1,828
module MotionTable module SearchableTable def makeSearchable(params={}) params[:frame] ||= CGRectMake(0, 0, 320, 44) params[:contentController] ||= self params[:delegate] ||= self params[:searchResultsDataSource] ||= self params[:searchResultsDelegate] ||= self searchBar = UIS...