ore-tasks 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/.yardopts +1 -0
- data/ChangeLog.md +4 -0
- data/LICENSE.txt +20 -0
- data/README.md +44 -0
- data/Rakefile +21 -0
- data/gemspec.yml +15 -0
- data/lib/ore/tasks.rb +108 -0
- data/ore-tasks.gemspec +10 -0
- data/spec/spec_helper.rb +5 -0
- metadata +120 -0
data/.document
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--colour --format documentation
|
data/.yardopts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--markup markdown --title "Ore::Tasks Documentation" --protected
|
data/ChangeLog.md
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 Hal Brodigan
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# ore-tasks
|
2
|
+
|
3
|
+
* [Source](http://github.com/postmodern/ore-tasks)
|
4
|
+
* [Issues](http://github.com/postmodern/ore-tasks/issues)
|
5
|
+
* IRC: irc.freenode.net #ruby-ore
|
6
|
+
* Postmodern (postmodern.mod3 at gmail.com)
|
7
|
+
|
8
|
+
## Description
|
9
|
+
|
10
|
+
Ore Tasks provides simple Rake tasks for managing and releasing a RubyGem
|
11
|
+
project.
|
12
|
+
|
13
|
+
## Features
|
14
|
+
|
15
|
+
* Provides tasks to build, install and push Gems to
|
16
|
+
[rubygems.org](http://rubygems.org/).
|
17
|
+
* Provides optional Git tasks.
|
18
|
+
* Provides the `console` task for digging right into your code.
|
19
|
+
* **Does not** automatically make changes or add commits to the repository.
|
20
|
+
|
21
|
+
## Examples
|
22
|
+
|
23
|
+
require 'ore/tasks'
|
24
|
+
Ore::Tasks.new
|
25
|
+
|
26
|
+
## Install
|
27
|
+
|
28
|
+
$ gem install ore-tasks
|
29
|
+
|
30
|
+
## Synopsis
|
31
|
+
|
32
|
+
rake build # Only builds a Gem
|
33
|
+
rake console[script] # Start IRB with all runtime dependencies loaded
|
34
|
+
rake gem # Alias to the 'build' task
|
35
|
+
rake install # Builds and installs a Gem
|
36
|
+
rake push # Builds and pushes a Gem
|
37
|
+
rake release # Builds and Pushes a new Gem / Build, Tags and Pushe...
|
38
|
+
rake tag # Tags a release and pushes the tag
|
39
|
+
|
40
|
+
## Copyright
|
41
|
+
|
42
|
+
Copyright (c) 2010 Hal Brodigan
|
43
|
+
|
44
|
+
See {file:LICENSE.txt} for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
lib_dir = File.expand_path('lib',File.dirname(__FILE__))
|
5
|
+
$LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
|
6
|
+
|
7
|
+
require 'ore/tasks'
|
8
|
+
Ore::Tasks.new
|
9
|
+
|
10
|
+
require 'rspec/core/rake_task'
|
11
|
+
RSpec::Core::RakeTask.new
|
12
|
+
task :default => :spec
|
13
|
+
|
14
|
+
begin
|
15
|
+
require 'yard'
|
16
|
+
YARD::Rake::YardocTask.new
|
17
|
+
rescue LoadError => e
|
18
|
+
task :yard do
|
19
|
+
abort 'Please run `gem install yard` to install YARD.'
|
20
|
+
end
|
21
|
+
end
|
data/gemspec.yml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
name: ore-tasks
|
2
|
+
version: 0.1.0
|
3
|
+
summary: Rake tasks for managing and releasing RubyGems using Ore.
|
4
|
+
description:
|
5
|
+
Simple Rake tasks for managing and releasing a RubyGem project generated
|
6
|
+
with Ore.
|
7
|
+
authors: Postmodern
|
8
|
+
email: postmodern.mod3@gmail.com
|
9
|
+
homepage: http://github.com/postmodern/ore-tasks
|
10
|
+
has_yard: true
|
11
|
+
|
12
|
+
development_dependencies:
|
13
|
+
ore: ~> 0.1.0
|
14
|
+
rspec: ~> 2.0.0
|
15
|
+
yard: ~> 0.6.0
|
data/lib/ore/tasks.rb
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
require 'ore/project'
|
2
|
+
|
3
|
+
require 'rake/tasklib'
|
4
|
+
|
5
|
+
module Ore
|
6
|
+
class Tasks < Rake::TaskLib
|
7
|
+
|
8
|
+
def initialize(root=Dir.pwd)
|
9
|
+
@project = Project.find(root)
|
10
|
+
|
11
|
+
define
|
12
|
+
end
|
13
|
+
|
14
|
+
def define_core_tasks
|
15
|
+
desc "Only builds a Gem"
|
16
|
+
task :build do
|
17
|
+
@project.build!
|
18
|
+
end
|
19
|
+
|
20
|
+
desc "Alias to the 'build' task"
|
21
|
+
task :gem => :build
|
22
|
+
|
23
|
+
desc "Builds and installs a Gem"
|
24
|
+
task :install => :build do
|
25
|
+
pkg = @project.pkg_file
|
26
|
+
|
27
|
+
if File.file?(pkg)
|
28
|
+
run "gem install #{pkg}"
|
29
|
+
else
|
30
|
+
abort "Could not find #{pkg}!"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
desc "Builds and pushes a Gem"
|
35
|
+
task :push => :build do
|
36
|
+
pkg = @project.pkg_file
|
37
|
+
|
38
|
+
if File.file?(pkg)
|
39
|
+
run "gem push #{pkg}"
|
40
|
+
else
|
41
|
+
abort "Could not find #{pkg}!"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
desc "Builds and Pushes a new Gem"
|
46
|
+
task :release => [:build, :push]
|
47
|
+
|
48
|
+
desc "Start IRB with all runtime dependencies loaded"
|
49
|
+
task :console, [:script] do |t,args|
|
50
|
+
original_load_path = $LOAD_PATH
|
51
|
+
|
52
|
+
if @project.bundler?
|
53
|
+
require 'bundler'
|
54
|
+
Bundler.setup(:default)
|
55
|
+
end
|
56
|
+
|
57
|
+
# add the project code directories
|
58
|
+
$LOAD_PATH.unshift(*@project.require_paths)
|
59
|
+
|
60
|
+
# clear ARGV so IRB is not confused
|
61
|
+
ARGV.clear
|
62
|
+
|
63
|
+
require 'irb'
|
64
|
+
|
65
|
+
# set the optional script to run
|
66
|
+
IRB.conf[:SCRIPT] = args.script
|
67
|
+
IRB.start
|
68
|
+
|
69
|
+
# return the $LOAD_PATH to it's original state
|
70
|
+
$LOAD_PATH.reject! do |path|
|
71
|
+
!(original_load_path.include?(path))
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def define_git_tasks
|
77
|
+
desc 'Tags a release and pushes the tag'
|
78
|
+
task :tag => :build do
|
79
|
+
run "git push"
|
80
|
+
run "git tag v#{@project.version}"
|
81
|
+
run "git push --tags"
|
82
|
+
end
|
83
|
+
|
84
|
+
desc "Build, Tags and Pushes a new Gem"
|
85
|
+
task :release => [:build, :tag, :push]
|
86
|
+
end
|
87
|
+
|
88
|
+
def define
|
89
|
+
define_core_tasks
|
90
|
+
|
91
|
+
case @project.scm
|
92
|
+
when :git
|
93
|
+
define_git_tasks
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def run(program,*arguments)
|
98
|
+
show_command = ([program] + arguments).join(' ')
|
99
|
+
|
100
|
+
unless rake_system(program,*arguments)
|
101
|
+
abort "Command failed: #{show_command}"
|
102
|
+
end
|
103
|
+
|
104
|
+
return true
|
105
|
+
end
|
106
|
+
|
107
|
+
end
|
108
|
+
end
|
data/ore-tasks.gemspec
ADDED
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ore-tasks
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
version: 0.1.0
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Postmodern
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-10-25 00:00:00 -07:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: ore
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
- 1
|
31
|
+
- 0
|
32
|
+
version: 0.1.0
|
33
|
+
type: :development
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: rspec
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
segments:
|
44
|
+
- 2
|
45
|
+
- 0
|
46
|
+
- 0
|
47
|
+
version: 2.0.0
|
48
|
+
type: :development
|
49
|
+
version_requirements: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: yard
|
52
|
+
prerelease: false
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ~>
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
- 6
|
61
|
+
- 0
|
62
|
+
version: 0.6.0
|
63
|
+
type: :development
|
64
|
+
version_requirements: *id003
|
65
|
+
description: Simple Rake tasks for managing and releasing a RubyGem project generated with Ore.
|
66
|
+
email: postmodern.mod3@gmail.com
|
67
|
+
executables: []
|
68
|
+
|
69
|
+
extensions: []
|
70
|
+
|
71
|
+
extra_rdoc_files:
|
72
|
+
- README.md
|
73
|
+
- ChangeLog.md
|
74
|
+
- LICENSE.txt
|
75
|
+
files:
|
76
|
+
- .document
|
77
|
+
- .rspec
|
78
|
+
- .yardopts
|
79
|
+
- ChangeLog.md
|
80
|
+
- LICENSE.txt
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- gemspec.yml
|
84
|
+
- lib/ore/tasks.rb
|
85
|
+
- ore-tasks.gemspec
|
86
|
+
- spec/spec_helper.rb
|
87
|
+
has_rdoc: yard
|
88
|
+
homepage: http://github.com/postmodern/ore-tasks
|
89
|
+
licenses: []
|
90
|
+
|
91
|
+
post_install_message:
|
92
|
+
rdoc_options: []
|
93
|
+
|
94
|
+
require_paths:
|
95
|
+
- lib
|
96
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
segments:
|
102
|
+
- 0
|
103
|
+
version: "0"
|
104
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
segments:
|
110
|
+
- 0
|
111
|
+
version: "0"
|
112
|
+
requirements: []
|
113
|
+
|
114
|
+
rubyforge_project:
|
115
|
+
rubygems_version: 1.3.7
|
116
|
+
signing_key:
|
117
|
+
specification_version: 3
|
118
|
+
summary: Rake tasks for managing and releasing RubyGems using Ore.
|
119
|
+
test_files: []
|
120
|
+
|