public
Description: Bricklayer. RESTful API client builder for Ruby developers on the go.
Homepage: http://heypanda.com/posts/48-Writing-a-Ruby-Client-for-a-RESTful-Web-Service-using-Bricklayer
Clone URL: git://github.com/heypanda/bricklayer.git
bricklayer / Rakefile
100644 77 lines (59 sloc) 2.175 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Bwaha... stole much of this from the Merb Rakefile
 
require "rake"
require "rake/clean"
require "rake/gempackagetask"
require "rake/rdoctask"
require "rake/testtask"
require "spec/rake/spectask"
require "fileutils"
 
def __DIR__
  File.dirname(__FILE__)
end
include FileUtils
 
NAME = "bricklayer"
 
 require "lib/bricklayer/version"
 
 require "lib/bricklayer/test/run_specs"
 
##############################################################################
# Packaging & Installation
##############################################################################
CLEAN.include ["**/.*.sw?", "pkg", "lib/*.bundle", "*.gem", "doc/rdoc", ".config", "coverage", "cache"]
 
windows = (PLATFORM =~ /win32|cygwin/) rescue nil
 
SUDO = windows ? "" : "sudo"
 
task :bricklayer => [:clean, :rdoc, :package]
 
spec = Gem::Specification.new do |s|
  s.name = NAME
  s.version = Bricklayer::VERSION
  s.platform = Gem::Platform::RUBY
  s.author = "Mason Browne"
  s.email = "mason.browne@gmail.com"
  s.homepage = "http://heypanda.com"
  s.summary = "Bricklayer. RESTful API client builder for Ruby developers on the go."
  s.bindir = "bin"
  s.description = s.summary
  s.executables = []
  s.require_path = "lib"
  s.files = %w( LICENSE README Rakefile ) + Dir["{docs,bin,spec,lib,examples,script}/**/*"]
 
  # rdoc
  s.has_rdoc = true
  s.extra_rdoc_files = %w( README LICENSE )
  #s.rdoc_options += RDOC_OPTS + ["--exclude", "^(app|uploads)"]
 
  # Dependencies
  
  # Requirements
  #s.requirements << "install the json gem to get faster json parsing"
  s.required_ruby_version = ">= 1.8.4"
end
 
Rake::GemPackageTask.new(spec) do |package|
  package.gem_spec = spec
end
 
desc "Run :package and install the resulting .gem"
task :install => :package do
  sh %{#{SUDO} gem install --local pkg/#{NAME}-#{Bricklayer::VERSION}.gem --no-rdoc --no-ri}
end
 
def setup_specs(name, spec_cmd='spec', run_opts = "-c -f s")
  desc "Run all specs (#{name})"
  task "specs:#{name}" do
    run_specs("spec/**/*_spec.rb", spec_cmd, ENV['RSPEC_OPTS'] || run_opts)
  end
end
 
setup_specs("mri", "spec")
 
task :default => "specs:mri"