Skip to content

Commit

Permalink
Include a mergit-standalone in the .gem
Browse files Browse the repository at this point in the history
It's practically free since it'll compress to nothing (it's
all duplicate text).
  • Loading branch information
docwhat committed Apr 21, 2013
1 parent 363332c commit 06a8eec
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.gem
*.rbc
/bin/mergit-standalone
/.bundle/
.config
.yardoc
Expand Down
21 changes: 19 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require 'yard'

RSpec::Core::RakeTask.new(:spec)
require 'mergit'

task :default => :spec

def merge_file infile, outfile
mergit = Mergit.new(:search_path => ['lib'])
File.open(outfile, 'w', 0755) do |f|
f.write mergit.process_file(infile)
end
end

RSpec::Core::RakeTask.new(:spec)

YARD::Rake::YardocTask.new do |t|
t.files = ['lib/**/*.rb', '**/*.md']
end

desc "Build a standalone version of mergit"
task :standalone => 'bin/mergit-standalone'

file 'bin/mergit-standalone' => ['bin/mergit', 'Rakefile'] + Dir['lib/**/*.rb'] do
merge_file 'bin/mergit', 'bin/mergit-standalone'
end

task :build => :standalone
2 changes: 1 addition & 1 deletion mergit.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
spec.license = "MIT"

spec.files = `git ls-files`.split($/)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } + ['mergit-standalone']
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

Expand Down

0 comments on commit 06a8eec

Please sign in to comment.