Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 143 lines (122 sloc) 4.313 kb
1177924 @ELLIOTTCABLE Preparing for release - added a rakefile, so I can generate releases and...
authored
1 ($:.unshift File.expand_path(File.join( File.dirname(__FILE__), 'lib' ))).uniq!
2 require 'jello'
3
4 require 'fileutils'
5
6 # =======================
7 # = Gem packaging tasks =
8 # =======================
9 begin
10 require 'echoe'
11
cae49aa @ELLIOTTCABLE Added install task shortcut, fixed package task shortcut
authored
12 task :package => :'package:package'
13 task :install => :'package:install'
1177924 @ELLIOTTCABLE Preparing for release - added a rakefile, so I can generate releases and...
authored
14 task :manifest => :'package:manifest'
15 namespace :package do
3f22c9f @ELLIOTTCABLE Rubyforge naming fix. Appearantly we can't take a capitalized name anywh...
authored
16 Echoe.new('jello', Jello::Version) do |g|
1177924 @ELLIOTTCABLE Preparing for release - added a rakefile, so I can generate releases and...
authored
17 g.project = 'jello'
18 g.author = ['elliottcable']
19 g.email = ['Jello@elliottcable.com']
20 g.summary = 'A library to watch the OS X pasteboard, and process/modify incoming pastes.'
21 g.url = 'http://github.com/elliottcable/jello'
45a2684 @ELLIOTTCABLE Echoe pulled in my changes as of 3.0.2
authored
22 g.development_dependencies = ['echoe >= 3.0.2', 'rspec', 'rcov', 'yard', 'stringray']
1177924 @ELLIOTTCABLE Preparing for release - added a rakefile, so I can generate releases and...
authored
23 g.manifest_name = '.manifest'
5c79e54 @ELLIOTTCABLE Updated to use echoe 3.0.2
authored
24 g.retain_gemspec = true
25 g.rakefile_name = 'Rakefile.rb'
1177924 @ELLIOTTCABLE Preparing for release - added a rakefile, so I can generate releases and...
authored
26 g.ignore_pattern = /^\.git\/|^meta\/|\.gemspec/
27 end
28
29 desc 'tests packaged files to ensure they are all present'
30 task :verify => :package do
31 # An error message will be displayed if files are missing
48d8e68 @ELLIOTTCABLE Typo in the Rakefile
authored
32 if system %(ruby -e "require 'rubygems'; require 'pkg/jello-#{Jello::Version}/lib/jello'")
1177924 @ELLIOTTCABLE Preparing for release - added a rakefile, so I can generate releases and...
authored
33 puts "\nThe library files are present"
34 end
35 end
36 end
37
38 rescue LoadError
45a2684 @ELLIOTTCABLE Echoe pulled in my changes as of 3.0.2
authored
39 desc 'You need the `echoe` gem to package Jello'
1177924 @ELLIOTTCABLE Preparing for release - added a rakefile, so I can generate releases and...
authored
40 task :package
41 end
42
15bb819 @ELLIOTTCABLE Added a launchd plist creator, courtesy of LaunchDoctor
authored
43 begin
068582d @ELLIOTTCABLE Merge branch 'master' of git@github.com:elliottcable/jello
authored
44 require 'launchdr/task'
15bb819 @ELLIOTTCABLE Added a launchd plist creator, courtesy of LaunchDoctor
authored
45
c7b5f8f @ELLIOTTCABLE Reversed the order of the moulds in the launchd task (oops!)
authored
46 LaunchDr::Task.new :launchd, :bin => 'jello', :arguments => ['grabup', 'shortener']
15bb819 @ELLIOTTCABLE Added a launchd plist creator, courtesy of LaunchDoctor
authored
47 rescue LoadError
48 desc 'You need the `elliottcable-launchdr` gem to generate a launchd property list'
49 task :launchd
50 end
51
1177924 @ELLIOTTCABLE Preparing for release - added a rakefile, so I can generate releases and...
authored
52 # =======================
53 # = Spec/Coverage tasks =
54 # =======================
55 begin
56 require 'spec'
57 require 'rcov'
58 require 'spec/rake/spectask'
59
60 task :default => :'coverage:run'
61 task :coverage => :'coverage:run'
62 namespace :coverage do
63 Spec::Rake::SpecTask.new(:run) do |t|
64 t.spec_opts = ["--format", "specdoc"]
65 t.spec_opts << "--colour" unless ENV['CI']
66 t.spec_files = Dir['spec/**/*_spec.rb'].sort
67 t.libs = ['lib']
68 t.rcov = true
69 t.rcov_opts = [ '--include-file', '"^lib"', '--exclude-only', '".*"']
70 t.rcov_dir = File.join('meta', 'coverage')
71 end
72
73 begin
74 require 'spec/rake/verify_rcov'
75 # For the moment, this is the only way I know of to fix RCov. I may
76 # release the fix as it's own gem at some point in the near future.
77 require 'stringray/core_ext/spec/rake/verify_rcov'
78 RCov::VerifyTask.new(:verify) do |t|
758db48 @ELLIOTTCABLE * Added error toleration for moulds, now a broken mould won't crash Jell...
authored
79 t.threshold = 50.0
1177924 @ELLIOTTCABLE Preparing for release - added a rakefile, so I can generate releases and...
authored
80 t.index_html = File.join('meta', 'coverage', 'index.html')
81 t.require_exact_threshold = false
82 end
83 rescue LoadError
84 desc 'You need the `stringray` gem to verify coverage'
85 task :verify
86 end
87
88 task :open do
89 system 'open ' + File.join('meta', 'coverage', 'index.html') if PLATFORM['darwin']
90 end
91 end
92
93 rescue LoadError
94 desc 'You need the `rcov` and `rspec` gems to run specs/coverage'
95 task :coverage
96 end
97
98 # =======================
99 # = Documentation tasks =
100 # =======================
101 begin
102 require 'yard'
103 require 'yard/rake/yardoc_task'
104
105 task :documentation => :'documentation:generate'
106 namespace :documentation do
107 YARD::Rake::YardocTask.new :generate do |t|
108 t.files = ['lib/**/*.rb']
109 t.options = ['--output-dir', File.join('meta', 'documentation'),
110 '--readme', 'README.markdown']
111 end
112
113 YARD::Rake::YardocTask.new :dotyardoc do |t|
114 t.files = ['lib/**/*.rb']
115 t.options = ['--no-output',
116 '--readme', 'README.markdown']
117 end
118
119 task :open do
120 system 'open ' + File.join('meta', 'documentation', 'index.html') if PLATFORM['darwin']
121 end
122 end
123
124 rescue LoadError
125 desc 'You need the `yard` gem to generate documentation'
126 task :documentation
127 end
128
129 # =========
130 # = Other =
131 # =========
132 desc 'Removes all meta producs'
133 task :clobber do
134 `rm -rf #{File.expand_path(File.join( File.dirname(__FILE__), 'meta' ))}`
135 end
136
137 desc 'Check everything over before commiting'
138 task :aok => [:'documentation:generate', :'documentation:open',
5c79e54 @ELLIOTTCABLE Updated to use echoe 3.0.2
authored
139 :'package:manifest', :'package:package',
1177924 @ELLIOTTCABLE Preparing for release - added a rakefile, so I can generate releases and...
authored
140 :'coverage:run', :'coverage:verify', :'coverage:open']
141
13a684f @ELLIOTTCABLE Fixed some stylistic concerns regarding whitespace (arg all files should...
authored
142 task :ci => [:'documentation:generate', :'coverage:run', :'coverage:verify']
Something went wrong with that request. Please try again.