lazyatom-gem-this 0.1.5 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +6 -4
- data/Rakefile.erb +3 -3
- data/Readme.markdown +4 -0
- data/bin/gem-this +14 -0
- data/lib/rubygems_plugin.rb +14 -0
- metadata +7 -5
data/Rakefile
CHANGED
@@ -15,7 +15,7 @@ spec = Gem::Specification.new do |s|
|
|
15
15
|
|
16
16
|
# Change these as appropriate
|
17
17
|
s.name = "gem-this"
|
18
|
-
s.version = "0.
|
18
|
+
s.version = "0.2.0"
|
19
19
|
s.summary = "Make existing code into a gem, without any fuss."
|
20
20
|
s.author = "James Adam"
|
21
21
|
s.email = "james@lazyatom.com"
|
@@ -26,9 +26,9 @@ spec = Gem::Specification.new do |s|
|
|
26
26
|
# s.rdoc_options = %w(--main Readme.markdown)
|
27
27
|
|
28
28
|
# Add any extra files to include in the gem
|
29
|
-
s.files = %w(Rakefile Readme.markdown Rakefile.erb) + Dir.glob("{bin}/**/*")
|
29
|
+
s.files = %w(Rakefile Readme.markdown Rakefile.erb) + Dir.glob("{bin,lib}/**/*")
|
30
30
|
s.executables = FileList["bin/**"].map { |f| File.basename(f) }
|
31
|
-
s.require_paths = ["bin"]
|
31
|
+
s.require_paths = ["bin", "lib"]
|
32
32
|
|
33
33
|
# If you want to depend on other gems, add them here, along with any
|
34
34
|
# relevant versions
|
@@ -40,6 +40,8 @@ spec = Gem::Specification.new do |s|
|
|
40
40
|
# If you want to publish automatically to rubyforge, you'll may need
|
41
41
|
# to tweak this, and the publishing task below too.
|
42
42
|
s.rubyforge_project = "gem-this"
|
43
|
+
|
44
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.3")
|
43
45
|
end
|
44
46
|
|
45
47
|
# This task actually builds the gem. We also regenerate a static
|
@@ -107,4 +109,4 @@ begin
|
|
107
109
|
end
|
108
110
|
rescue LoadError
|
109
111
|
puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
|
110
|
-
end
|
112
|
+
end
|
data/Rakefile.erb
CHANGED
@@ -37,9 +37,9 @@ spec = Gem::Specification.new do |s|
|
|
37
37
|
s.name = "<%= gem_name %>"
|
38
38
|
s.version = "0.1.0"
|
39
39
|
s.summary = "What this thing does"
|
40
|
-
s.author = "
|
41
|
-
s.email = "
|
42
|
-
s.homepage = "
|
40
|
+
s.author = "<%= author_name %>"
|
41
|
+
s.email = "<%= author_email %>"
|
42
|
+
s.homepage = "<%= author_url %>"
|
43
43
|
|
44
44
|
s.has_rdoc = true
|
45
45
|
<% if readme %>
|
data/Readme.markdown
CHANGED
@@ -24,6 +24,10 @@ The `gem-this` command expects to be run in the directory of your existing code:
|
|
24
24
|
$ mate lib/sweet_code.rb
|
25
25
|
... hacking ...
|
26
26
|
$ gem-this
|
27
|
+
|
28
|
+
New in 0.2.0: we also register a gem command, so you can just type:
|
29
|
+
|
30
|
+
$ gem this
|
27
31
|
|
28
32
|
When you run `gem-this`, it will create a new `Rakefile` in your project directory. If you already had a `Rakefile`, it will append to the end of it, so your existing tasks are safe.
|
29
33
|
|
data/bin/gem-this
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'etc'
|
4
|
+
|
3
5
|
args = ARGV.dup
|
4
6
|
|
5
7
|
if args.first =~ /-?-h/
|
@@ -15,6 +17,18 @@ debug = args.delete("-d")
|
|
15
17
|
|
16
18
|
gem_name = args.first || File.basename(Dir.pwd)
|
17
19
|
|
20
|
+
def author_name
|
21
|
+
Etc.getpwnam(ENV['USER']).gecos rescue ENV['USER'] # for Windows
|
22
|
+
end
|
23
|
+
|
24
|
+
def author_email
|
25
|
+
"youremail@example.com"
|
26
|
+
end
|
27
|
+
|
28
|
+
def author_url
|
29
|
+
"http://yoursite.example.com"
|
30
|
+
end
|
31
|
+
|
18
32
|
def using_rspec?
|
19
33
|
File.directory?('spec')
|
20
34
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'rubygems/command_manager'
|
2
|
+
require 'rubygems/command'
|
3
|
+
|
4
|
+
class Gem::Commands::ThisCommand < Gem::Command
|
5
|
+
def initialize
|
6
|
+
super 'this', "Creates a Rakefile suitable for turning the current project into a gem."
|
7
|
+
end
|
8
|
+
|
9
|
+
def execute
|
10
|
+
`gem-this`
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
Gem::CommandManager.instance.register_command :this
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lazyatom-gem-this
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Adam
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-07-23 00:00:00 -07:00
|
13
13
|
default_executable: gem-this
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -26,13 +26,15 @@ files:
|
|
26
26
|
- Readme.markdown
|
27
27
|
- Rakefile.erb
|
28
28
|
- bin/gem-this
|
29
|
-
|
29
|
+
- lib/rubygems_plugin.rb
|
30
|
+
has_rdoc: false
|
30
31
|
homepage: http://github.com/lazyatom/gem-this
|
31
32
|
post_install_message:
|
32
33
|
rdoc_options: []
|
33
34
|
|
34
35
|
require_paths:
|
35
36
|
- bin
|
37
|
+
- lib
|
36
38
|
required_ruby_version: !ruby/object:Gem::Requirement
|
37
39
|
requirements:
|
38
40
|
- - ">="
|
@@ -43,14 +45,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
45
|
requirements:
|
44
46
|
- - ">="
|
45
47
|
- !ruby/object:Gem::Version
|
46
|
-
version: "
|
48
|
+
version: "1.3"
|
47
49
|
version:
|
48
50
|
requirements: []
|
49
51
|
|
50
52
|
rubyforge_project: gem-this
|
51
53
|
rubygems_version: 1.2.0
|
52
54
|
signing_key:
|
53
|
-
specification_version:
|
55
|
+
specification_version: 3
|
54
56
|
summary: Make existing code into a gem, without any fuss.
|
55
57
|
test_files: []
|
56
58
|
|