coerce 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +36 -20
- data/coerce.gemspec +4 -3
- data/lib/coerce.rb +1 -1
- metadata +20 -5
data/Rakefile
CHANGED
@@ -3,9 +3,6 @@ This.author = "Ara T. Howard"
|
|
3
3
|
This.email = "ara.t.howard@gmail.com"
|
4
4
|
This.homepage = "https://github.com/ahoward/#{ This.lib }"
|
5
5
|
|
6
|
-
task :license do
|
7
|
-
open('LICENSE', 'w'){|fd| fd.puts "same as ruby's"}
|
8
|
-
end
|
9
6
|
|
10
7
|
task :default do
|
11
8
|
puts((Rake::Task.tasks.map{|task| task.name.gsub(/::/,':')} - ['default']).sort)
|
@@ -63,7 +60,7 @@ end
|
|
63
60
|
task :gemspec do
|
64
61
|
ignore_extensions = ['git', 'svn', 'tmp', /sw./, 'bak', 'gem']
|
65
62
|
ignore_directories = ['pkg']
|
66
|
-
ignore_files = ['test/log', 'a.rb']
|
63
|
+
ignore_files = ['test/log', 'a.rb'] + Dir['db/*'] + %w'db'
|
67
64
|
|
68
65
|
shiteless =
|
69
66
|
lambda do |list|
|
@@ -90,7 +87,7 @@ task :gemspec do
|
|
90
87
|
files = shiteless[Dir::glob("**/**")]
|
91
88
|
executables = shiteless[Dir::glob("bin/*")].map{|exe| File.basename(exe)}
|
92
89
|
#has_rdoc = true #File.exist?('doc')
|
93
|
-
test_files = "test/#{ lib }.rb"
|
90
|
+
test_files = test(?e, "test/#{ lib }.rb") ? "test/#{ lib }.rb" : nil
|
94
91
|
summary = object.respond_to?(:summary) ? object.summary : "summary: #{ lib } kicks the ass"
|
95
92
|
description = object.respond_to?(:description) ? object.description : "description: #{ lib } kicks the ass"
|
96
93
|
|
@@ -103,38 +100,51 @@ task :gemspec do
|
|
103
100
|
end
|
104
101
|
extensions = [extensions].flatten.compact
|
105
102
|
|
103
|
+
# TODO
|
104
|
+
if This.dependencies.nil?
|
105
|
+
dependencies = []
|
106
|
+
else
|
107
|
+
case This.dependencies
|
108
|
+
when Hash
|
109
|
+
dependencies = This.dependencies.values
|
110
|
+
when Array
|
111
|
+
dependencies = This.dependencies
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
106
115
|
template =
|
107
116
|
if test(?e, 'gemspec.erb')
|
108
117
|
Template{ IO.read('gemspec.erb') }
|
109
118
|
else
|
110
119
|
Template {
|
111
120
|
<<-__
|
112
|
-
##
|
121
|
+
## <%= lib %>.gemspec
|
113
122
|
#
|
114
123
|
|
115
124
|
Gem::Specification::new do |spec|
|
116
|
-
spec.name =
|
117
|
-
spec.version =
|
125
|
+
spec.name = <%= lib.inspect %>
|
126
|
+
spec.version = <%= version.inspect %>
|
118
127
|
spec.platform = Gem::Platform::RUBY
|
119
|
-
spec.summary =
|
120
|
-
spec.description =
|
128
|
+
spec.summary = <%= lib.inspect %>
|
129
|
+
spec.description = <%= description.inspect %>
|
121
130
|
|
122
|
-
spec.files =\n
|
123
|
-
spec.executables =
|
131
|
+
spec.files =\n<%= files.sort.pretty_inspect %>
|
132
|
+
spec.executables = <%= executables.inspect %>
|
124
133
|
|
125
134
|
spec.require_path = "lib"
|
126
135
|
|
127
|
-
spec.test_files =
|
136
|
+
spec.test_files = <%= test_files.inspect %>
|
128
137
|
|
129
|
-
|
130
|
-
|
138
|
+
<% dependencies.each do |lib_version| %>
|
139
|
+
spec.add_dependency(*<%= Array(lib_version).flatten.inspect %>)
|
140
|
+
<% end %>
|
131
141
|
|
132
|
-
spec.extensions.push(
|
142
|
+
spec.extensions.push(*<%= extensions.inspect %>)
|
133
143
|
|
134
|
-
spec.rubyforge_project =
|
135
|
-
spec.author =
|
136
|
-
spec.email =
|
137
|
-
spec.homepage =
|
144
|
+
spec.rubyforge_project = <%= This.rubyforge_project.inspect %>
|
145
|
+
spec.author = <%= This.author.inspect %>
|
146
|
+
spec.email = <%= This.email.inspect %>
|
147
|
+
spec.homepage = <%= This.homepage.inspect %>
|
138
148
|
end
|
139
149
|
__
|
140
150
|
}
|
@@ -270,6 +280,12 @@ BEGIN {
|
|
270
280
|
end
|
271
281
|
This.version = version
|
272
282
|
|
283
|
+
# see if dependencies are export by the module
|
284
|
+
#
|
285
|
+
if This.object.respond_to?(:dependencies)
|
286
|
+
This.dependencies = This.object.dependencies
|
287
|
+
end
|
288
|
+
|
273
289
|
# we need to know the name of the lib an it's version
|
274
290
|
#
|
275
291
|
abort('no lib') unless This.lib
|
data/coerce.gemspec
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
Gem::Specification::new do |spec|
|
5
5
|
spec.name = "coerce"
|
6
|
-
spec.version = "0.0.
|
6
|
+
spec.version = "0.0.2"
|
7
7
|
spec.platform = Gem::Platform::RUBY
|
8
8
|
spec.summary = "coerce"
|
9
9
|
spec.description = "description: coerce kicks the ass"
|
@@ -17,8 +17,9 @@ Gem::Specification::new do |spec|
|
|
17
17
|
|
18
18
|
spec.test_files = nil
|
19
19
|
|
20
|
-
|
21
|
-
|
20
|
+
|
21
|
+
spec.add_dependency(*["chronic", "~> 0.6.2"])
|
22
|
+
|
22
23
|
|
23
24
|
spec.extensions.push(*[])
|
24
25
|
|
data/lib/coerce.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coerce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ara T. Howard
|
@@ -17,8 +17,23 @@ cert_chain: []
|
|
17
17
|
|
18
18
|
date: 2011-08-25 00:00:00 -06:00
|
19
19
|
default_executable:
|
20
|
-
dependencies:
|
21
|
-
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: chronic
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 6
|
33
|
+
- 2
|
34
|
+
version: 0.6.2
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
22
37
|
description: "description: coerce kicks the ass"
|
23
38
|
email: ara.t.howard@gmail.com
|
24
39
|
executables: []
|