simonmenke-gm 0.1.7 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/rubygems_plugin.rb +81 -0
- metadata +11 -145
- data/LICENSE.txt +0 -22
- data/README.textile +0 -13
- data/bin/gem-make +0 -6
- data/bin/gm +0 -6
- data/gm_behaviors/author_behavior.rb +0 -29
- data/gm_behaviors/bin_files_behavior.rb +0 -10
- data/gm_behaviors/dependencies_behavior.rb +0 -22
- data/gm_behaviors/executables_behavior.rb +0 -13
- data/gm_behaviors/general_behavior.rb +0 -41
- data/gm_behaviors/github_behavior.rb +0 -14
- data/gm_behaviors/gm_files_behavior.rb +0 -13
- data/gm_behaviors/lib_files_behavior.rb +0 -10
- data/gm_behaviors/rails_behavior.rb +0 -11
- data/gm_behaviors/rdoc_behavior.rb +0 -34
- data/gm_behaviors/rspec_behavior.rb +0 -10
- data/gm_behaviors/rubigen_behavior.rb +0 -13
- data/gm_behaviors/rubyforge_behavior.rb +0 -12
- data/gm_behaviors/test_behavior.rb +0 -10
- data/gm_behaviors/text_files_behavior.rb +0 -10
- data/gm_commands/build_command.rb +0 -25
- data/gm_commands/build_gemspec_command.rb +0 -34
- data/gm_commands/clean_command.rb +0 -14
- data/gm_commands/config_command.rb +0 -42
- data/gm_commands/create_command.rb +0 -10
- data/gm_commands/gen_command.rb +0 -31
- data/gm_commands/help_command.rb +0 -246
- data/gm_commands/install_command.rb +0 -17
- data/gm_commands/publish_command.rb +0 -34
- data/gm_commands/spec_command.rb +0 -14
- data/gm_generators/bin/bin_generator.rb +0 -22
- data/gm_generators/bin/templates/bin/bin.rb +0 -3
- data/gm_generators/gem/gem_generator.rb +0 -38
- data/gm_generators/gem/templates/Gmfile +0 -4
- data/gm_generators/gem/templates/README.textile +0 -0
- data/gm_generators/gem/templates/lib/module.rb +0 -4
- data/gm_generators/mit_license/mit_license_generator.rb +0 -17
- data/gm_generators/mit_license/templates/LICENSE.txt +0 -22
- data/gm_generators/rails/rails_generator.rb +0 -18
- data/gm_generators/rails/templates/rails/init.rb +0 -1
- data/gm_generators/test/templates/test_case.rb.erb +0 -5
- data/gm_generators/test/templates/test_helper.rb.erb +0 -7
- data/gm_generators/test/test_generator.rb +0 -26
- data/gm_networks/github_network.rb +0 -72
- data/gm_networks/rubyforge_network.rb +0 -90
- data/lib/autotest/discover.rb +0 -3
- data/lib/autotest/gm.rb +0 -37
- data/lib/extentions/gem.rb +0 -27
- data/lib/gm.rb +0 -30
- data/lib/gm/app.rb +0 -111
- data/lib/gm/behavior.rb +0 -25
- data/lib/gm/command.rb +0 -66
- data/lib/gm/configuration.rb +0 -20
- data/lib/gm/documentation.rb +0 -38
- data/lib/gm/helpers.rb +0 -24
- data/lib/gm/loader.rb +0 -84
- data/lib/gm/network.rb +0 -29
- data/lib/gm/system.rb +0 -16
- data/test/command_test.rb +0 -106
- data/test/gem_extentions_test.rb +0 -31
- data/test/system_test.rb +0 -17
- data/test/test_helper.rb +0 -12
data/rubygems_plugin.rb
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'rubygems/command_manager'
|
2
|
+
|
3
|
+
class Gem::Commands::SpecifyCommand < Gem::Command
|
4
|
+
|
5
|
+
def initialize
|
6
|
+
super 'specify', 'Generate a spec file'
|
7
|
+
end
|
8
|
+
|
9
|
+
def execute
|
10
|
+
code = IO.read('Gmfile')
|
11
|
+
eval(code, binding, 'Gmfile')
|
12
|
+
complete_configuration
|
13
|
+
if spec.validate
|
14
|
+
File.open("#{spec.name}.gemspec", 'w+') { |f| f.write spec.to_ruby }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def specify(&block)
|
21
|
+
@spec ||= begin
|
22
|
+
spec = Gem::Specification.new
|
23
|
+
block.call(Proxy.new(spec))
|
24
|
+
spec
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def spec
|
29
|
+
@spec
|
30
|
+
end
|
31
|
+
|
32
|
+
def complete_configuration
|
33
|
+
find_files
|
34
|
+
end
|
35
|
+
|
36
|
+
def find_files
|
37
|
+
if spec.files.empty?
|
38
|
+
spec.files = Dir.glob('{test,lib,spec,rails,app,vendor,db}/**/*.{rb,erb,rake}')
|
39
|
+
spec.files += Dir.glob('rubygems_plugin.rb')
|
40
|
+
end
|
41
|
+
if spec.test_files.empty?
|
42
|
+
spec.test_files = Dir.glob('{test,spec}/**/*.{rb}')
|
43
|
+
end
|
44
|
+
if spec.summary and !spec.description
|
45
|
+
spec.description = spec.summary
|
46
|
+
end
|
47
|
+
if spec.description and !spec.summary
|
48
|
+
spec.summary = spec.description
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
class Proxy
|
53
|
+
def initialize(target)
|
54
|
+
@target = target
|
55
|
+
end
|
56
|
+
def method_missing(m,*args,&block)
|
57
|
+
m = m.to_s
|
58
|
+
if args.size == 1 && m[-1,1] != '=' && @target.respond_to?("#{m}=")
|
59
|
+
m = "#{m}="
|
60
|
+
end
|
61
|
+
@target.send(m,*args,&block)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
class Gem::Commands::MakeCommand < Gem::Command
|
67
|
+
|
68
|
+
def initialize
|
69
|
+
super 'make', 'Generate a spec file and build the gem'
|
70
|
+
end
|
71
|
+
|
72
|
+
|
73
|
+
def execute
|
74
|
+
Gem::CommandManager.instance.run('specify')
|
75
|
+
Gem::CommandManager.instance.run("build #{Dir.glob("*.gemspec")}")
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
Gem::CommandManager.instance.register_command :specify
|
81
|
+
Gem::CommandManager.instance.register_command :make
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simonmenke-gm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Menke
|
@@ -9,147 +9,20 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-05-13 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
16
|
-
|
17
|
-
version_requirement:
|
18
|
-
version_requirements: !ruby/object:Gem::Requirement
|
19
|
-
requirements:
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 0.0.4
|
23
|
-
version:
|
24
|
-
- !ruby/object:Gem::Dependency
|
25
|
-
name: clip
|
26
|
-
version_requirement:
|
27
|
-
version_requirements: !ruby/object:Gem::Requirement
|
28
|
-
requirements:
|
29
|
-
- - ">="
|
30
|
-
- !ruby/object:Gem::Version
|
31
|
-
version: 1.0.0
|
32
|
-
version:
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: rubigen
|
35
|
-
version_requirement:
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 1.5.1
|
41
|
-
version:
|
42
|
-
- !ruby/object:Gem::Dependency
|
43
|
-
name: simonmenke-ec
|
44
|
-
version_requirement:
|
45
|
-
version_requirements: !ruby/object:Gem::Requirement
|
46
|
-
requirements:
|
47
|
-
- - ">="
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: 0.0.4
|
50
|
-
version:
|
51
|
-
- !ruby/object:Gem::Dependency
|
52
|
-
name: clip
|
53
|
-
version_requirement:
|
54
|
-
version_requirements: !ruby/object:Gem::Requirement
|
55
|
-
requirements:
|
56
|
-
- - ">="
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
version: 1.0.0
|
59
|
-
version:
|
60
|
-
- !ruby/object:Gem::Dependency
|
61
|
-
name: rubigen
|
62
|
-
version_requirement:
|
63
|
-
version_requirements: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - ">="
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: 1.5.1
|
68
|
-
version:
|
69
|
-
description:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: ""
|
70
17
|
email: simon.menke@gmail.com
|
71
|
-
executables:
|
72
|
-
|
73
|
-
- gm
|
18
|
+
executables: []
|
19
|
+
|
74
20
|
extensions: []
|
75
21
|
|
76
22
|
extra_rdoc_files: []
|
77
23
|
|
78
24
|
files:
|
79
|
-
-
|
80
|
-
- test/gem_extentions_test.rb
|
81
|
-
- test/system_test.rb
|
82
|
-
- test/test_helper.rb
|
83
|
-
- bin/gem-make
|
84
|
-
- bin/gm
|
85
|
-
- lib/autotest/discover.rb
|
86
|
-
- lib/autotest/gm.rb
|
87
|
-
- lib/extentions/gem.rb
|
88
|
-
- lib/gm/app.rb
|
89
|
-
- lib/gm/behavior.rb
|
90
|
-
- lib/gm/command.rb
|
91
|
-
- lib/gm/configuration.rb
|
92
|
-
- lib/gm/documentation.rb
|
93
|
-
- lib/gm/helpers.rb
|
94
|
-
- lib/gm/loader.rb
|
95
|
-
- lib/gm/network.rb
|
96
|
-
- lib/gm/system.rb
|
97
|
-
- lib/gm.rb
|
98
|
-
- LICENSE.txt
|
99
|
-
- README.textile
|
100
|
-
- gm_generators/bin/bin_generator.rb
|
101
|
-
- gm_generators/bin/templates/bin/bin.rb
|
102
|
-
- gm_generators/gem/gem_generator.rb
|
103
|
-
- gm_generators/gem/templates/Gmfile
|
104
|
-
- gm_generators/gem/templates/lib/module.rb
|
105
|
-
- gm_generators/gem/templates/README.textile
|
106
|
-
- gm_generators/mit_license/mit_license_generator.rb
|
107
|
-
- gm_generators/mit_license/templates/LICENSE.txt
|
108
|
-
- gm_generators/rails/rails_generator.rb
|
109
|
-
- gm_generators/rails/templates/rails/init.rb
|
110
|
-
- gm_generators/test/templates/test_case.rb.erb
|
111
|
-
- gm_generators/test/templates/test_helper.rb.erb
|
112
|
-
- gm_generators/test/test_generator.rb
|
113
|
-
- gm_commands/build_command.rb
|
114
|
-
- gm_commands/build_gemspec_command.rb
|
115
|
-
- gm_commands/clean_command.rb
|
116
|
-
- gm_commands/config_command.rb
|
117
|
-
- gm_commands/create_command.rb
|
118
|
-
- gm_commands/gen_command.rb
|
119
|
-
- gm_commands/help_command.rb
|
120
|
-
- gm_commands/install_command.rb
|
121
|
-
- gm_commands/publish_command.rb
|
122
|
-
- gm_commands/spec_command.rb
|
123
|
-
- gm_behaviors/author_behavior.rb
|
124
|
-
- gm_behaviors/bin_files_behavior.rb
|
125
|
-
- gm_behaviors/dependencies_behavior.rb
|
126
|
-
- gm_behaviors/executables_behavior.rb
|
127
|
-
- gm_behaviors/general_behavior.rb
|
128
|
-
- gm_behaviors/github_behavior.rb
|
129
|
-
- gm_behaviors/gm_files_behavior.rb
|
130
|
-
- gm_behaviors/lib_files_behavior.rb
|
131
|
-
- gm_behaviors/rails_behavior.rb
|
132
|
-
- gm_behaviors/rdoc_behavior.rb
|
133
|
-
- gm_behaviors/rspec_behavior.rb
|
134
|
-
- gm_behaviors/rubigen_behavior.rb
|
135
|
-
- gm_behaviors/rubyforge_behavior.rb
|
136
|
-
- gm_behaviors/test_behavior.rb
|
137
|
-
- gm_behaviors/text_files_behavior.rb
|
138
|
-
- gm_networks/github_network.rb
|
139
|
-
- gm_networks/rubyforge_network.rb
|
140
|
-
- gm_generators/bin
|
141
|
-
- gm_generators/bin/templates
|
142
|
-
- gm_generators/bin/templates/bin
|
143
|
-
- gm_generators/gem
|
144
|
-
- gm_generators/gem/templates
|
145
|
-
- gm_generators/gem/templates/lib
|
146
|
-
- gm_generators/mit_license
|
147
|
-
- gm_generators/mit_license/templates
|
148
|
-
- gm_generators/rails
|
149
|
-
- gm_generators/rails/templates
|
150
|
-
- gm_generators/rails/templates/rails
|
151
|
-
- gm_generators/test
|
152
|
-
- gm_generators/test/templates
|
25
|
+
- rubygems_plugin.rb
|
153
26
|
has_rdoc: false
|
154
27
|
homepage: http://github.com/simonmenke/gm
|
155
28
|
post_install_message:
|
@@ -174,14 +47,7 @@ requirements: []
|
|
174
47
|
rubyforge_project: gem-make
|
175
48
|
rubygems_version: 1.2.0
|
176
49
|
signing_key:
|
177
|
-
specification_version:
|
50
|
+
specification_version: 3
|
178
51
|
summary: Building gems the clean way.
|
179
|
-
test_files:
|
180
|
-
|
181
|
-
- test/gem_extentions_test.rb
|
182
|
-
- test/system_test.rb
|
183
|
-
- test/test_helper.rb
|
184
|
-
- test/command_test.rb
|
185
|
-
- test/gem_extentions_test.rb
|
186
|
-
- test/system_test.rb
|
187
|
-
- test/test_helper.rb
|
52
|
+
test_files: []
|
53
|
+
|
data/LICENSE.txt
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2009 Simon Menke
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person
|
4
|
-
obtaining a copy of this software and associated documentation
|
5
|
-
files (the "Software"), to deal in the Software without
|
6
|
-
restriction, including without limitation the rights to use,
|
7
|
-
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
-
copies of the Software, and to permit persons to whom the
|
9
|
-
Software is furnished to do so, subject to the following
|
10
|
-
conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be
|
13
|
-
included in all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
17
|
-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
19
|
-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
20
|
-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
21
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
-
OTHER DEALINGS IN THE SOFTWARE.
|
data/README.textile
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
h1. GM (GemMake)
|
2
|
-
|
3
|
-
GM is a gem and gemspec builder for use with github.
|
4
|
-
|
5
|
-
For the documentation go to "http://simonmenke.github.com/gm":http://simonmenke.github.com/gm
|
6
|
-
|
7
|
-
For bug reports and feature requests go to "http://menke.lighthouseapp.com/projects/23688-gm":http://menke.lighthouseapp.com/projects/23688-gm
|
8
|
-
|
9
|
-
h2. Todo
|
10
|
-
|
11
|
-
* Document extendability
|
12
|
-
* Document architecture
|
13
|
-
* Implement CDN interfaces (rubyforge, github, your site, ...)
|
data/bin/gem-make
DELETED
data/bin/gm
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
|
2
|
-
class AuthorBehavior < GM::Behavior
|
3
|
-
|
4
|
-
specify_conf do |root|
|
5
|
-
|
6
|
-
root.map :author do |author|
|
7
|
-
author.should_be_present
|
8
|
-
|
9
|
-
author.conf(:name) do |name|
|
10
|
-
name.should_be_present
|
11
|
-
name.should_be_a String
|
12
|
-
name.should_not_be_empty
|
13
|
-
end
|
14
|
-
|
15
|
-
author.conf(:email) do |email|
|
16
|
-
email.should_be_present
|
17
|
-
email.should_be_a String
|
18
|
-
email.should_not_be_empty
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
def run
|
25
|
-
spec.author = config[:author][:name]
|
26
|
-
spec.email = config[:author][:email]
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
|
2
|
-
class DependenciesBehavior < GM::Behavior
|
3
|
-
|
4
|
-
specify_conf do |root|
|
5
|
-
|
6
|
-
# root.list :dependencies do |dependency|
|
7
|
-
# dependency.conf do |c|
|
8
|
-
# c.should_be_a String
|
9
|
-
# c.should_not_be_empty
|
10
|
-
# end
|
11
|
-
# end
|
12
|
-
|
13
|
-
end
|
14
|
-
|
15
|
-
def run
|
16
|
-
(config[:dependencies] || []).each do |dependency|
|
17
|
-
gem, requirement = dependency.strip.split(/\s+/, 2)
|
18
|
-
spec.add_dependency gem.strip, requirement.strip
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
|
2
|
-
class GeneralBehavior < GM::Behavior
|
3
|
-
|
4
|
-
specify_conf do |root|
|
5
|
-
|
6
|
-
root.map :general do |general|
|
7
|
-
general.should_be_present
|
8
|
-
|
9
|
-
general.conf(:name) do |s|
|
10
|
-
s.should_be_present
|
11
|
-
s.should_be_a String
|
12
|
-
s.should_not_be_empty
|
13
|
-
end
|
14
|
-
|
15
|
-
general.conf(:version) do |s|
|
16
|
-
s.should_be_present
|
17
|
-
s.should_be_a String
|
18
|
-
s.should_not_be_empty
|
19
|
-
end
|
20
|
-
|
21
|
-
general.conf(:summary) do |s|
|
22
|
-
s.should_be_a String
|
23
|
-
s.should_not_be_empty
|
24
|
-
end
|
25
|
-
|
26
|
-
general.conf(:homepage) do |s|
|
27
|
-
s.should_be_a String
|
28
|
-
s.should_not_be_empty
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
33
|
-
|
34
|
-
def run
|
35
|
-
spec.name ||= config[:general][:name]
|
36
|
-
spec.version = config[:general][:version]
|
37
|
-
spec.summary = config[:general][:summary]
|
38
|
-
spec.homepage = config[:general][:homepage]
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
|
2
|
-
class GithubBehavior < GM::Behavior
|
3
|
-
|
4
|
-
def run
|
5
|
-
emulate = !command.options.no_emulation?
|
6
|
-
emulate &= (config[:github] != nil) && (config[:github][:emulate] == true)
|
7
|
-
|
8
|
-
if emulate
|
9
|
-
name = config[:github][:project] || config[:general][:name]
|
10
|
-
spec.name = "#{config[:github][:username]}-#{name}"
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|