bendiken-rakefile 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README CHANGED
@@ -1,4 +1,4 @@
1
- == Rakefile
1
+ = Rakefile
2
2
 
3
3
  This is a KISS (Keep It Simple, Stupid) approach to Rakefiles for my Ruby
4
4
  projects. It may or may not be of use to you.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -3,3 +3,4 @@ require 'rakefile/version'
3
3
  require 'rakefile/gemspec'
4
4
  require 'rakefile/testunit'
5
5
  require 'rakefile/yard'
6
+ require 'rakefile/rubyforge'
@@ -1,25 +1,34 @@
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)
1
+ GEMSPEC_FILE = Dir.glob('*.gemspec').first
2
+
3
+ unless GEMSPEC_FILE
4
+ desc "Creates the gemspec file"
5
+ task :gemspec do
6
+ # TODO
7
+ end
8
+ else
9
+ load GEMSPEC_FILE
10
+
11
+ desc "Updates the gemspec file"
12
+ task :gemspec => GEMSPEC_FILE do
13
+ gemspec = File.read(GEMSPEC_FILE)
6
14
 
7
15
  puts "Updating gemspec version..."
8
16
  version = File.read('VERSION').chomp
9
- gemspec.gsub!(/(gem\.version\s*=\s*')[^']+(')/, "\\1#{version}\\2")
17
+ gemspec.gsub!(/(gem\.version\s*=\s*')[^']*(')/, "\\1#{version}\\2")
10
18
 
11
19
  puts "Updating gemspec date..."
12
20
  date = File.mtime('VERSION').strftime('%Y-%m-%d')
13
- gemspec.gsub!(/(gem\.date\s*=\s*')[^']+(')/, "\\1#{date}\\2")
21
+ gemspec.gsub!(/(gem\.date\s*=\s*')[^']*(')/, "\\1#{date}\\2")
14
22
 
15
23
  puts "Updating gemspec file list..."
16
- files = FileList['[A-Z]*', '[A-Z]*.*', 'bin/*', 'doc/**/*', 'lib/**/*.rb', 'test/**/*', 'spec/**/*']
24
+ files = FileList['[A-Z]*', 'bin/*', 'doc/**/*', 'lib/**/*.rb', 'test/**/*', 'spec/**/*']
25
+ files -= FileList['doc/rdoc', 'doc/rdoc/**/*', 'doc/yard', 'doc/yard/**/*'] # FIXME: use doc/.gitignore
17
26
  gemspec.gsub!(/(gem\.files\s*=\s*%w\()[^\)]*(\))/, "\\1#{files.to_a.sort.join(' ')}\\2")
18
27
 
19
28
  puts "Updating gemspec test file list..."
20
29
  files = FileList['test/**/*', 'spec/**/*']
21
30
  gemspec.gsub!(/(gem\.test_files\s*=\s*%w\()[^\)]*(\))/, "\\1#{files.to_a.sort.join(' ')}\\2")
22
31
 
23
- open(gemspec_file, "wb") { |f| f.puts gemspec }
32
+ open(GEMSPEC_FILE, "wb") { |f| f.puts gemspec }
24
33
  end
25
34
  end
@@ -0,0 +1,12 @@
1
+ require 'yaml'
2
+ if File.exists?(RUBYFORGE_CONFIG_FILE = File.expand_path('~/.rubyforge/config.yml'))
3
+ if (RUBYFORGE_CONFIG = YAML.load(File.read(RUBYFORGE_CONFIG_FILE))) && (RUBYFORGE_PROJECT = GEMSPEC.rubyforge_project)
4
+
5
+ namespace :rubyforge do
6
+ desc "Publish the YARD documentation to RubyForge"
7
+ task :docs => :yardoc do
8
+ sh "rsync -avz doc/yard/ #{RUBYFORGE_CONFIG['username']}@rubyforge.org:/var/www/gforge-projects/#{RUBYFORGE_PROJECT}/"
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,4 +1,8 @@
1
- desc "Displays the current version"
2
- task :version => 'VERSION' do
3
- puts File.read('VERSION').chomp
1
+ unless File.exists?('VERSION')
2
+ File.open('VERSION') { |f| f.puts "0.0.0" }
4
3
  end
4
+
5
+ PROJECT_VERSION = File.read('VERSION').chomp
6
+
7
+ desc "Displays the current version"
8
+ task :version => 'VERSION' do puts PROJECT_VERSION 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.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arto Bendiken
@@ -22,6 +22,26 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: "0"
24
24
  version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: rubyforge
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: yard
37
+ type: :runtime
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: "0"
44
+ version:
25
45
  description: This is a KISS (Keep It Simple, Stupid) approach to Rakefiles for Ruby gems.
26
46
  email: arto.bendiken@gmail.com
27
47
  executables: []
@@ -37,6 +57,7 @@ files:
37
57
  - VERSION
38
58
  - lib/rakefile.rb
39
59
  - lib/rakefile/gemspec.rb
60
+ - lib/rakefile/rubyforge.rb
40
61
  - lib/rakefile/testunit.rb
41
62
  - lib/rakefile/version.rb
42
63
  - lib/rakefile/yard.rb