bendiken-rakefile 0.0.0.2 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +3 -2
- data/VERSION +1 -1
- data/lib/rakefile.rb +4 -0
- data/lib/rakefile/gemspec.rb +25 -0
- data/lib/rakefile/testunit.rb +6 -0
- data/lib/rakefile/version.rb +4 -0
- data/lib/rakefile/yard.rb +5 -0
- metadata +5 -1
data/README
CHANGED
@@ -15,9 +15,10 @@ Rakefile that consists of these two lines, and you're done:
|
|
15
15
|
If you like this approach, but not necessarily the specific Rake tasks I've
|
16
16
|
defined, the naming conventions I've used, or any other little thing, don't
|
17
17
|
despair - wanting to do things my own way is exactly why I created this
|
18
|
-
project, and there's no reason why you can't have your
|
18
|
+
project in the first place, and there's no reason why you can't have your
|
19
|
+
cake and eat it, too.
|
19
20
|
|
20
|
-
To
|
21
|
+
To apply your own customizations, just fork the project on GitHub, and then
|
21
22
|
add one single extra line to your Rakefile to explicitly specify the gem to
|
22
23
|
be used; for example, this is how I would ensure my own Rakefile gem is
|
23
24
|
loaded:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.1
|
data/lib/rakefile.rb
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
desc "Updates the gemspec file"
|
2
|
+
task :gemspec do
|
3
|
+
if gemspec_file = Dir.glob('*.gemspec').first
|
4
|
+
load gemspec_file
|
5
|
+
gemspec = File.read(gemspec_file)
|
6
|
+
|
7
|
+
puts "Updating gemspec version..."
|
8
|
+
version = File.read('VERSION').chomp
|
9
|
+
gemspec.gsub!(/(gem\.version\s*=\s*')[^']+(')/, "\\1#{version}\\2")
|
10
|
+
|
11
|
+
puts "Updating gemspec date..."
|
12
|
+
date = File.mtime('VERSION').strftime('%Y-%m-%d')
|
13
|
+
gemspec.gsub!(/(gem\.date\s*=\s*')[^']+(')/, "\\1#{date}\\2")
|
14
|
+
|
15
|
+
puts "Updating gemspec file list..."
|
16
|
+
files = FileList['[A-Z]*', '[A-Z]*.*', 'bin/*', 'doc/**/*', 'lib/**/*.rb', 'test/**/*', 'spec/**/*']
|
17
|
+
gemspec.gsub!(/(gem\.files\s*=\s*%w\()[^\)]*(\))/, "\\1#{files.to_a.sort.join(' ')}\\2")
|
18
|
+
|
19
|
+
puts "Updating gemspec test file list..."
|
20
|
+
files = FileList['test/**/*', 'spec/**/*']
|
21
|
+
gemspec.gsub!(/(gem\.test_files\s*=\s*%w\()[^\)]*(\))/, "\\1#{files.to_a.sort.join(' ')}\\2")
|
22
|
+
|
23
|
+
open(gemspec_file, "wb") { |f| f.puts gemspec }
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bendiken-rakefile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arto Bendiken
|
@@ -36,6 +36,10 @@ files:
|
|
36
36
|
- Rakefile
|
37
37
|
- VERSION
|
38
38
|
- lib/rakefile.rb
|
39
|
+
- lib/rakefile/gemspec.rb
|
40
|
+
- lib/rakefile/testunit.rb
|
41
|
+
- lib/rakefile/version.rb
|
42
|
+
- lib/rakefile/yard.rb
|
39
43
|
has_rdoc: false
|
40
44
|
homepage: http://github.com/bendiken/rakefile
|
41
45
|
post_install_message:
|