ritual 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/bin/ritual +67 -0
- data/lib/ritual.rb +3 -1
- data/lib/ritual/version.rb +1 -1
- data/templates/CHANGELOG +3 -0
- data/templates/Gemfile +2 -0
- data/templates/LICENSE +20 -0
- data/templates/README.markdown +1 -0
- data/templates/Rakefile +1 -0
- data/templates/gemspec.rb +19 -0
- data/templates/lib.rb +3 -0
- data/templates/version.rb +11 -0
- metadata +33 -12
data/CHANGELOG
CHANGED
data/bin/ritual
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'thor'
|
4
|
+
require 'ritual/version'
|
5
|
+
ROOT = File.expand_path('..', File.dirname(__FILE__))
|
6
|
+
|
7
|
+
module Ritual
|
8
|
+
class CLI < Thor
|
9
|
+
include Thor::Actions
|
10
|
+
|
11
|
+
desc "new GEMNAME", "Create a new gem in a subdirectory."
|
12
|
+
def new(name)
|
13
|
+
File.exist?(name) and
|
14
|
+
abort "file exists: #{name}"
|
15
|
+
empty_directory name
|
16
|
+
self.destination_root = name
|
17
|
+
Dir.chdir name do
|
18
|
+
apply
|
19
|
+
system 'git', 'init'
|
20
|
+
system 'git', 'add', '.'
|
21
|
+
system 'git', 'commit', '-m', 'New gem.'
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
desc "apply", "Ritualize the gem in the current directory."
|
26
|
+
def apply
|
27
|
+
template "#{ROOT}/templates/Gemfile", "Gemfile"
|
28
|
+
template "#{ROOT}/templates/Rakefile", "Rakefile"
|
29
|
+
template "#{ROOT}/templates/CHANGELOG", "CHANGELOG"
|
30
|
+
template "#{ROOT}/templates/README.markdown", "README.markdown"
|
31
|
+
template "#{ROOT}/templates/LICENSE", "LICENSE"
|
32
|
+
template "#{ROOT}/templates/lib.rb", "lib/#{gem_name}.rb"
|
33
|
+
template "#{ROOT}/templates/version.rb", "lib/#{gem_name}/version.rb"
|
34
|
+
template "#{ROOT}/templates/gemspec.rb", "#{gem_name}.gemspec"
|
35
|
+
end
|
36
|
+
|
37
|
+
source_root "#{ROOT}/templates"
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def gem_name
|
42
|
+
@gem_name ||= File.basename(Dir.pwd)
|
43
|
+
end
|
44
|
+
|
45
|
+
def namespace
|
46
|
+
@namespace ||= gem_name.gsub(/(?:\A|(.)_)(.)/) {$1.to_s + $2.upcase}
|
47
|
+
end
|
48
|
+
|
49
|
+
def human_name
|
50
|
+
@human_name ||= gem_name.gsub(/(?:\A|(.)_)(.)/) {"#$1 " + $2.upcase}.lstrip
|
51
|
+
end
|
52
|
+
|
53
|
+
def author
|
54
|
+
@author ||= ENV['RITUAL_AUTHOR'] || `git config user.name`.strip
|
55
|
+
end
|
56
|
+
|
57
|
+
def email
|
58
|
+
@email ||= ENV['RITUAL_EMAIL'] || `git config user.email`.strip
|
59
|
+
end
|
60
|
+
|
61
|
+
def ritual_version
|
62
|
+
@ritual_version ||= ENV['RITUAL_VERSION'] || Ritual::VERSION
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
Ritual::CLI.start(ARGV)
|
data/lib/ritual.rb
CHANGED
@@ -79,12 +79,14 @@ end
|
|
79
79
|
|
80
80
|
def spec_task(*args, &block)
|
81
81
|
require 'rspec/core/rake_task'
|
82
|
-
RSpec::Core::RakeTask.new(&block)
|
82
|
+
RSpec::Core::RakeTask.new(*args, &block)
|
83
83
|
rescue LoadError
|
84
84
|
begin
|
85
85
|
require 'rspec/rake/spectask'
|
86
86
|
Spec::Rake::SpecTask.new(*args, &block)
|
87
87
|
rescue LoadError
|
88
|
+
require 'spec/rake/spectask'
|
89
|
+
Spec::Rake::SpecTask.new(*args, &block)
|
88
90
|
end
|
89
91
|
end
|
90
92
|
|
data/lib/ritual/version.rb
CHANGED
data/templates/CHANGELOG
ADDED
data/templates/Gemfile
ADDED
data/templates/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) <%= author %>
|
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.
|
@@ -0,0 +1 @@
|
|
1
|
+
## <%= human_name %>
|
data/templates/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'ritual'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.unshift File.expand_path('lib', File.dirname(__FILE__))
|
3
|
+
require '<%= gem_name %>/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gem.name = '<%= gem_name %>'
|
7
|
+
gem.version = <%= namespace %>::VERSION
|
8
|
+
gem.authors = ['<%= author %>']
|
9
|
+
gem.email = ['<%= email %>']
|
10
|
+
gem.description = "TODO: Write a gem description"
|
11
|
+
gem.summary = "TODO: Write a gem summary"
|
12
|
+
gem.homepage = ''
|
13
|
+
|
14
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
15
|
+
gem.files = `git ls-files`.split("\n")
|
16
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
|
+
|
18
|
+
gem.add_development_dependency 'ritual', '~> <%= ritual_version %>'
|
19
|
+
end
|
data/templates/lib.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ritual
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-01-07 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement: &
|
16
|
+
requirement: &70309457910760 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,21 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70309457910760
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: thor
|
27
|
+
requirement: &70309457910260 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70309457910260
|
25
36
|
- !ruby/object:Gem::Dependency
|
26
37
|
name: rspec
|
27
|
-
requirement: &
|
38
|
+
requirement: &70309457909660 !ruby/object:Gem::Requirement
|
28
39
|
none: false
|
29
40
|
requirements:
|
30
41
|
- - ~>
|
@@ -32,10 +43,10 @@ dependencies:
|
|
32
43
|
version: '2.0'
|
33
44
|
type: :development
|
34
45
|
prerelease: false
|
35
|
-
version_requirements: *
|
46
|
+
version_requirements: *70309457909660
|
36
47
|
- !ruby/object:Gem::Dependency
|
37
48
|
name: cucumber
|
38
|
-
requirement: &
|
49
|
+
requirement: &70309457909180 !ruby/object:Gem::Requirement
|
39
50
|
none: false
|
40
51
|
requirements:
|
41
52
|
- - ! '>='
|
@@ -43,10 +54,10 @@ dependencies:
|
|
43
54
|
version: '0'
|
44
55
|
type: :development
|
45
56
|
prerelease: false
|
46
|
-
version_requirements: *
|
57
|
+
version_requirements: *70309457909180
|
47
58
|
- !ruby/object:Gem::Dependency
|
48
59
|
name: ruby-debug19
|
49
|
-
requirement: &
|
60
|
+
requirement: &70309457908600 !ruby/object:Gem::Requirement
|
50
61
|
none: false
|
51
62
|
requirements:
|
52
63
|
- - ! '>='
|
@@ -54,7 +65,7 @@ dependencies:
|
|
54
65
|
version: '0'
|
55
66
|
type: :development
|
56
67
|
prerelease: false
|
57
|
-
version_requirements: *
|
68
|
+
version_requirements: *70309457908600
|
58
69
|
description: ! 'Adds tasks and helpers to your Rakefile to manage releases in a
|
59
70
|
|
60
71
|
lightweight manner.
|
@@ -62,7 +73,8 @@ description: ! 'Adds tasks and helpers to your Rakefile to manage releases in a
|
|
62
73
|
'
|
63
74
|
email:
|
64
75
|
- george.ogata@gmail.com
|
65
|
-
executables:
|
76
|
+
executables:
|
77
|
+
- ritual
|
66
78
|
extensions: []
|
67
79
|
extra_rdoc_files: []
|
68
80
|
files:
|
@@ -75,10 +87,19 @@ files:
|
|
75
87
|
- lib/ritual/version.rb
|
76
88
|
- lib/ritual/version_file.rb
|
77
89
|
- lib/ritual.rb
|
90
|
+
- templates/CHANGELOG
|
91
|
+
- templates/Gemfile
|
92
|
+
- templates/gemspec.rb
|
93
|
+
- templates/lib.rb
|
94
|
+
- templates/LICENSE
|
95
|
+
- templates/Rakefile
|
96
|
+
- templates/README.markdown
|
97
|
+
- templates/version.rb
|
78
98
|
- LICENSE
|
79
99
|
- README.markdown
|
80
100
|
- Rakefile
|
81
101
|
- CHANGELOG
|
102
|
+
- bin/ritual
|
82
103
|
homepage: http://github.com/oggy/ritual
|
83
104
|
licenses: []
|
84
105
|
post_install_message:
|
@@ -99,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
120
|
version: 1.3.6
|
100
121
|
requirements: []
|
101
122
|
rubyforge_project:
|
102
|
-
rubygems_version: 1.8.
|
123
|
+
rubygems_version: 1.8.10
|
103
124
|
signing_key:
|
104
125
|
specification_version: 3
|
105
126
|
summary: Rakefile release tasks and helpers.
|