ritual 0.3.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG +17 -0
- data/README.markdown +12 -2
- data/Rakefile +10 -0
- data/bin/ritual +68 -0
- data/lib/ritual/changelog.rb +1 -1
- data/lib/ritual/extension/base.rb +4 -1
- data/lib/ritual/extension/jruby.rb +2 -2
- data/lib/ritual/version.rb +1 -1
- data/lib/ritual.rb +3 -1
- data/templates/CHANGELOG +3 -0
- data/templates/Gemfile +4 -0
- data/templates/LICENSE +20 -0
- data/templates/README.markdown +1 -0
- data/templates/Rakefile +1 -0
- data/templates/gemspec.rb +17 -0
- data/templates/gitignore +1 -0
- data/templates/lib.rb +3 -0
- data/templates/version.rb +11 -0
- metadata +63 -44
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0f075e96ccdbd2dd4038bb5f7f9a669e94eabb41fa8ba36cb9c03ca245f1a541
|
4
|
+
data.tar.gz: f37f135df91b02f903fa3b7f6321daa4a5f7caa6178e49010db81a7d2ec68890
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e69674445fb0dbfcd811098ad4c8c8304b232fd502292d9548b655fcfd09f91cc0bbb01903a381fc55a79f5db7cb0ca1d82bbbeadab8045be2602ed54e2383ca
|
7
|
+
data.tar.gz: edef2756a5fa60d17f965a5dbd80edf4ce19ba57f13cd9349ceeacf14748fc95c8c1f5a1aa0f1dc5be9c4c971564e88924aa2ac897fa3310f61e0b880d0203af
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
== 0.5.0 2022-04-22
|
2
|
+
|
3
|
+
* Support whitespace before LATEST title.
|
4
|
+
* Require date library in generated gemspecs.
|
5
|
+
* Gitignore gem lock in new projects.
|
6
|
+
|
7
|
+
== 0.4.1 2012-05-20
|
8
|
+
|
9
|
+
* Fix building JRuby extensions in 1.9 mode.
|
10
|
+
* Silence Rake warnings when using extensions.
|
11
|
+
* Fix create_makefile call for unnamed extensions in README.
|
12
|
+
|
13
|
+
== 0.4.0 2012-01-07
|
14
|
+
|
15
|
+
* 'ritual' command for creating new gems.
|
16
|
+
* Fix spec_task.
|
17
|
+
|
1
18
|
== 0.3.1 2011-09-01
|
2
19
|
|
3
20
|
* Better error message when version file is invalid.
|
data/README.markdown
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Ritual
|
1
|
+
# Ritual [![Build Status](https://travis-ci.org/oggy/ritual.png?branch=master)](https://travis-ci.org/oggy/ritual) [![Gem Version](https://badge.fury.io/rb/ritual.svg)](http://badge.fury.io/rb/ritual)
|
2
2
|
|
3
3
|
Sweet, simple Rakefiles for your gem.
|
4
4
|
|
@@ -38,6 +38,16 @@ For example:
|
|
38
38
|
|
39
39
|
"Release early, release often" has never been so easy!
|
40
40
|
|
41
|
+
## Getting Started
|
42
|
+
|
43
|
+
Got an existing project?
|
44
|
+
|
45
|
+
ritual apply
|
46
|
+
|
47
|
+
Starting a new one?
|
48
|
+
|
49
|
+
ritual new GEM-NAME
|
50
|
+
|
41
51
|
## Gemspec
|
42
52
|
|
43
53
|
You [maintain the gemspec directly][using-gemspecs-as-intended], rather than via
|
@@ -89,7 +99,7 @@ So if the gem is `my_gem`, then Ritual configures your extension with
|
|
89
99
|
`lib/my_gem/my_gem.DLEXT`. (`DLEXT` is the shared library extension,
|
90
100
|
which varies from system to system.) `extconf.rb` should contain:
|
91
101
|
|
92
|
-
create_makefile "my_gem"
|
102
|
+
create_makefile "my_gem/my_gem"
|
93
103
|
|
94
104
|
And the extension entry point is `Init_my_gem`.
|
95
105
|
|
data/Rakefile
CHANGED
@@ -1,2 +1,12 @@
|
|
1
1
|
$:.unshift File.expand_path('lib', File.dirname(__FILE__))
|
2
2
|
require 'ritual'
|
3
|
+
|
4
|
+
task :ci do
|
5
|
+
sh 'bundle exec rspec -I. spec'
|
6
|
+
|
7
|
+
if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
|
8
|
+
sh "bundle exec cucumber --tags='not @ext'"
|
9
|
+
else
|
10
|
+
sh "bundle exec cucumber --tags='not @jruby'"
|
11
|
+
end
|
12
|
+
end
|
data/bin/ritual
ADDED
@@ -0,0 +1,68 @@
|
|
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/gitignore", ".gitignore"
|
28
|
+
template "#{ROOT}/templates/Gemfile", "Gemfile"
|
29
|
+
template "#{ROOT}/templates/Rakefile", "Rakefile"
|
30
|
+
template "#{ROOT}/templates/CHANGELOG", "CHANGELOG"
|
31
|
+
template "#{ROOT}/templates/README.markdown", "README.markdown"
|
32
|
+
template "#{ROOT}/templates/LICENSE", "LICENSE"
|
33
|
+
template "#{ROOT}/templates/lib.rb", "lib/#{gem_name}.rb"
|
34
|
+
template "#{ROOT}/templates/version.rb", "lib/#{gem_name}/version.rb"
|
35
|
+
template "#{ROOT}/templates/gemspec.rb", "#{gem_name}.gemspec"
|
36
|
+
end
|
37
|
+
|
38
|
+
source_root "#{ROOT}/templates"
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def gem_name
|
43
|
+
@gem_name ||= File.basename(Dir.pwd)
|
44
|
+
end
|
45
|
+
|
46
|
+
def namespace
|
47
|
+
@namespace ||= gem_name.gsub(/(?:\A|(.)_)(.)/) {$1.to_s + $2.upcase}
|
48
|
+
end
|
49
|
+
|
50
|
+
def human_name
|
51
|
+
@human_name ||= gem_name.gsub(/(?:\A|(.)_)(.)/) {"#$1 " + $2.upcase}.lstrip
|
52
|
+
end
|
53
|
+
|
54
|
+
def author
|
55
|
+
@author ||= ENV['RITUAL_AUTHOR'] || `git config user.name`.strip
|
56
|
+
end
|
57
|
+
|
58
|
+
def email
|
59
|
+
@email ||= ENV['RITUAL_EMAIL'] || `git config user.email`.strip
|
60
|
+
end
|
61
|
+
|
62
|
+
def ritual_version
|
63
|
+
@ritual_version ||= ENV['RITUAL_VERSION'] || Ritual::VERSION
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
Ritual::CLI.start(ARGV)
|
data/lib/ritual/changelog.rb
CHANGED
@@ -13,7 +13,7 @@ module Ritual
|
|
13
13
|
raise Error, "Don't release without a CHANGELOG!"
|
14
14
|
text = File.read(path)
|
15
15
|
heading = "#{version} #{Date.today.strftime('%Y-%m-%d')}"
|
16
|
-
text.sub!(/^(
|
16
|
+
text.sub!(/^(\s*== )LATEST$/i, "\\1#{heading}") or
|
17
17
|
raise Error, "No LATEST entry in CHANGELOG - did you forget to update it?"
|
18
18
|
open(path, 'w'){|f| f.print text}
|
19
19
|
end
|
@@ -1,7 +1,10 @@
|
|
1
1
|
module Ritual
|
2
2
|
module Extension
|
3
3
|
class Base
|
4
|
-
|
4
|
+
RbConfig = defined?(RbConfig) ? RbConfig : Config
|
5
|
+
DLEXT = RbConfig::CONFIG['DLEXT']
|
6
|
+
|
7
|
+
include Rake::DSL
|
5
8
|
|
6
9
|
def initialize(name, params={})
|
7
10
|
@name = name ? name.to_sym : nil
|
@@ -7,12 +7,12 @@ module Ritual
|
|
7
7
|
task task_name do
|
8
8
|
relative_install_path = relative_path(install_path)
|
9
9
|
relative_compiled_paths = compiled_paths.map { |p| relative_path(p) }
|
10
|
-
class_path = "#{
|
10
|
+
class_path = "#{RbConfig::CONFIG['prefix']}/lib/jruby.jar"
|
11
11
|
|
12
12
|
sh 'javac', '-g', '-classpath', class_path, *source_paths
|
13
13
|
Dir.chdir path do
|
14
14
|
mkdir_p File.dirname(relative_install_path)
|
15
|
-
sh 'jar', 'cf', relative_install_path, *relative_compiled_paths
|
15
|
+
sh 'jar', 'cf', relative_install_path.to_s, *relative_compiled_paths.map(&:to_s)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
data/lib/ritual/version.rb
CHANGED
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/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,17 @@
|
|
1
|
+
$:.unshift File.expand_path('lib', File.dirname(__FILE__))
|
2
|
+
require '<%= gem_name %>/version'
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.name = '<%= gem_name %>'
|
6
|
+
gem.version = <%= namespace %>::VERSION
|
7
|
+
gem.authors = ['<%= author %>']
|
8
|
+
gem.email = ['<%= email %>']
|
9
|
+
gem.license = 'MIT'
|
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
|
+
end
|
data/templates/gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
/Gemfile.lock
|
data/templates/lib.rb
ADDED
metadata
CHANGED
@@ -1,106 +1,125 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ritual
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.5.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- George Ogata
|
9
|
-
autorequire:
|
8
|
+
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2022-04-22 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rake
|
16
|
-
requirement:
|
17
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: thor
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
25
41
|
- !ruby/object:Gem::Dependency
|
26
42
|
name: rspec
|
27
|
-
requirement:
|
28
|
-
none: false
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
29
44
|
requirements:
|
30
|
-
- - ~>
|
45
|
+
- - "~>"
|
31
46
|
- !ruby/object:Gem::Version
|
32
47
|
version: '2.0'
|
33
48
|
type: :development
|
34
49
|
prerelease: false
|
35
|
-
version_requirements:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.0'
|
36
55
|
- !ruby/object:Gem::Dependency
|
37
56
|
name: cucumber
|
38
|
-
requirement:
|
39
|
-
none: false
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
40
58
|
requirements:
|
41
|
-
- -
|
59
|
+
- - ">="
|
42
60
|
- !ruby/object:Gem::Version
|
43
61
|
version: '0'
|
44
62
|
type: :development
|
45
63
|
prerelease: false
|
46
|
-
version_requirements:
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: ruby-debug19
|
49
|
-
requirement: &70216021488220 !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- -
|
66
|
+
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '0'
|
55
|
-
|
56
|
-
|
57
|
-
version_requirements: *70216021488220
|
58
|
-
description: ! 'Adds tasks and helpers to your Rakefile to manage releases in a
|
59
|
-
|
69
|
+
description: |
|
70
|
+
Adds tasks and helpers to your Rakefile to manage releases in a
|
60
71
|
lightweight manner.
|
61
|
-
|
62
|
-
'
|
63
72
|
email:
|
64
73
|
- george.ogata@gmail.com
|
65
|
-
executables:
|
74
|
+
executables:
|
75
|
+
- ritual
|
66
76
|
extensions: []
|
67
77
|
extra_rdoc_files: []
|
68
78
|
files:
|
79
|
+
- CHANGELOG
|
80
|
+
- LICENSE
|
81
|
+
- README.markdown
|
82
|
+
- Rakefile
|
83
|
+
- bin/ritual
|
84
|
+
- lib/ritual.rb
|
69
85
|
- lib/ritual/changelog.rb
|
86
|
+
- lib/ritual/extension.rb
|
70
87
|
- lib/ritual/extension/base.rb
|
71
88
|
- lib/ritual/extension/jruby.rb
|
72
89
|
- lib/ritual/extension/standard.rb
|
73
|
-
- lib/ritual/extension.rb
|
74
90
|
- lib/ritual/lib.rb
|
75
91
|
- lib/ritual/version.rb
|
76
92
|
- lib/ritual/version_file.rb
|
77
|
-
-
|
78
|
-
-
|
79
|
-
-
|
80
|
-
-
|
81
|
-
-
|
93
|
+
- templates/CHANGELOG
|
94
|
+
- templates/Gemfile
|
95
|
+
- templates/LICENSE
|
96
|
+
- templates/README.markdown
|
97
|
+
- templates/Rakefile
|
98
|
+
- templates/gemspec.rb
|
99
|
+
- templates/gitignore
|
100
|
+
- templates/lib.rb
|
101
|
+
- templates/version.rb
|
82
102
|
homepage: http://github.com/oggy/ritual
|
83
|
-
licenses:
|
84
|
-
|
103
|
+
licenses:
|
104
|
+
- MIT
|
105
|
+
metadata: {}
|
106
|
+
post_install_message:
|
85
107
|
rdoc_options: []
|
86
108
|
require_paths:
|
87
109
|
- lib
|
88
110
|
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
111
|
requirements:
|
91
|
-
- -
|
112
|
+
- - ">="
|
92
113
|
- !ruby/object:Gem::Version
|
93
114
|
version: '0'
|
94
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
-
none: false
|
96
116
|
requirements:
|
97
|
-
- -
|
117
|
+
- - ">="
|
98
118
|
- !ruby/object:Gem::Version
|
99
119
|
version: 1.3.6
|
100
120
|
requirements: []
|
101
|
-
|
102
|
-
|
103
|
-
signing_key:
|
121
|
+
rubygems_version: 3.3.6
|
122
|
+
signing_key:
|
104
123
|
specification_version: 3
|
105
124
|
summary: Rakefile release tasks and helpers.
|
106
125
|
test_files: []
|