fattr 2.2.1 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/Rakefile +38 -26
- data/lib/fattr.rb +6 -2
- metadata +11 -12
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YWU4MGI5MmUxYWE3OWIzNTgwYmE0YWQ0MjY0MzRkNjY1MDk5MmI3NQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ODcwMDUwNDYxYjAwYTBhYWFjM2Q2MzRmODlmMzNiYWM3ZTBmZWIzYQ==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NmE5NWY1NGEzYzNmZGRjNDFkMmUwMThhNWUzYTFlZTI3YTBjZTkxMDhjMGU3
|
10
|
+
NDNlMDY5YzY3NDIyZjAxZWYyMGNiNzFiOTYxNGE1ZDFiMWE4MTRmMTk3OTRm
|
11
|
+
ODNmNDU5NDhmM2M3ZWQ3NTRiZWYzYzM4ZmJhYmNkMzYwZGZiNTc=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MDJlODcxNDZmMDY4YTBlMWI3NGUxNWJjMzZkOWY5MzQ1MDhiN2MxYzY3Yzdk
|
14
|
+
YTg2NWQxYTQxMTExNjgxNGRlNTVmZTU0Yzg2YTY2MTVhNWUyNGJjZjhhZTZj
|
15
|
+
OWQxNTExODQ5YmMzMjk4MDQwNmU2ODU3MDE4ODI4Zjk5Njc2YzQ=
|
data/Rakefile
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
This.rubyforge_project = 'codeforpeople'
|
2
2
|
This.author = "Ara T. Howard"
|
3
3
|
This.email = "ara.t.howard@gmail.com"
|
4
|
-
This.homepage = "
|
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
|
6
9
|
|
7
10
|
task :default do
|
8
11
|
puts((Rake::Task.tasks.map{|task| task.name.gsub(/::/,':')} - ['default']).sort)
|
@@ -26,11 +29,10 @@ def run_tests!(which = nil)
|
|
26
29
|
|
27
30
|
div = ('=' * 119)
|
28
31
|
line = ('-' * 119)
|
29
|
-
helper = "-r ./test/helper.rb" if test(?e, "./test/helper.rb")
|
30
32
|
|
31
33
|
test_rbs.each_with_index do |test_rb, index|
|
32
34
|
testno = index + 1
|
33
|
-
command = "#{ This.ruby } -I ./lib -I ./test/lib #{
|
35
|
+
command = "#{ This.ruby } -w -I ./lib -I ./test/lib #{ test_rb }"
|
34
36
|
|
35
37
|
puts
|
36
38
|
say(div, :color => :cyan, :bold => true)
|
@@ -59,9 +61,9 @@ end
|
|
59
61
|
|
60
62
|
|
61
63
|
task :gemspec do
|
62
|
-
ignore_extensions = 'git', 'svn', 'tmp', /sw./, 'bak', 'gem'
|
63
|
-
ignore_directories =
|
64
|
-
ignore_files =
|
64
|
+
ignore_extensions = ['git', 'svn', 'tmp', /sw./, 'bak', 'gem']
|
65
|
+
ignore_directories = ['pkg']
|
66
|
+
ignore_files = ['test/log']
|
65
67
|
|
66
68
|
shiteless =
|
67
69
|
lambda do |list|
|
@@ -87,10 +89,11 @@ task :gemspec do
|
|
87
89
|
version = This.version
|
88
90
|
files = shiteless[Dir::glob("**/**")]
|
89
91
|
executables = shiteless[Dir::glob("bin/*")].map{|exe| File.basename(exe)}
|
90
|
-
has_rdoc = true #File.exist?('doc')
|
92
|
+
#has_rdoc = true #File.exist?('doc')
|
91
93
|
test_files = "test/#{ lib }.rb" if File.file?("test/#{ lib }.rb")
|
92
94
|
summary = object.respond_to?(:summary) ? object.summary : "summary: #{ lib } kicks the ass"
|
93
95
|
description = object.respond_to?(:description) ? object.description : "description: #{ lib } kicks the ass"
|
96
|
+
license = object.respond_to?(:license) ? object.license : "same as ruby's"
|
94
97
|
|
95
98
|
if This.extensions.nil?
|
96
99
|
This.extensions = []
|
@@ -116,16 +119,17 @@ task :gemspec do
|
|
116
119
|
spec.platform = Gem::Platform::RUBY
|
117
120
|
spec.summary = #{ lib.inspect }
|
118
121
|
spec.description = #{ description.inspect }
|
122
|
+
spec.license = #{ license.inspect }
|
119
123
|
|
120
|
-
spec.files
|
124
|
+
spec.files =\n#{ files.sort.pretty_inspect }
|
121
125
|
spec.executables = #{ executables.inspect }
|
122
126
|
|
123
127
|
spec.require_path = "lib"
|
124
128
|
|
125
|
-
spec.has_rdoc = #{ has_rdoc.inspect }
|
126
129
|
spec.test_files = #{ test_files.inspect }
|
127
130
|
|
128
|
-
|
131
|
+
### spec.add_dependency 'lib', '>= version'
|
132
|
+
#### spec.add_dependency 'map'
|
129
133
|
|
130
134
|
spec.extensions.push(*#{ extensions.inspect })
|
131
135
|
|
@@ -139,8 +143,9 @@ task :gemspec do
|
|
139
143
|
end
|
140
144
|
|
141
145
|
Fu.mkdir_p(This.pkgdir)
|
142
|
-
|
143
|
-
open(
|
146
|
+
gemspec = "#{ lib }.gemspec"
|
147
|
+
open(gemspec, "w"){|fd| fd.puts(template)}
|
148
|
+
This.gemspec = gemspec
|
144
149
|
end
|
145
150
|
|
146
151
|
task :gem => [:clean, :gemspec] do
|
@@ -150,8 +155,8 @@ task :gem => [:clean, :gemspec] do
|
|
150
155
|
`#{ cmd }`
|
151
156
|
after = Dir['*.gem']
|
152
157
|
gem = ((after - before).first || after.first) or abort('no gem!')
|
153
|
-
Fu.mv
|
154
|
-
This.gem = File.basename(gem)
|
158
|
+
Fu.mv(gem, This.pkgdir)
|
159
|
+
This.gem = File.join(This.pkgdir, File.basename(gem))
|
155
160
|
end
|
156
161
|
|
157
162
|
task :readme do
|
@@ -175,8 +180,8 @@ task :readme do
|
|
175
180
|
end
|
176
181
|
|
177
182
|
template =
|
178
|
-
if test(?e, '
|
179
|
-
Template{ IO.read('
|
183
|
+
if test(?e, 'README.erb')
|
184
|
+
Template{ IO.read('README.erb') }
|
180
185
|
else
|
181
186
|
Template {
|
182
187
|
<<-__
|
@@ -207,12 +212,18 @@ task :release => [:clean, :gemspec, :gem] do
|
|
207
212
|
gems = Dir[File.join(This.pkgdir, '*.gem')].flatten
|
208
213
|
raise "which one? : #{ gems.inspect }" if gems.size > 1
|
209
214
|
raise "no gems?" if gems.size < 1
|
210
|
-
|
215
|
+
|
216
|
+
cmd = "gem push #{ This.gem }"
|
211
217
|
puts cmd
|
212
|
-
|
213
|
-
cmd
|
218
|
+
puts
|
219
|
+
system(cmd)
|
220
|
+
abort("cmd(#{ cmd }) failed with (#{ $?.inspect })") unless $?.exitstatus.zero?
|
221
|
+
|
222
|
+
cmd = "rubyforge login && rubyforge add_release #{ This.rubyforge_project } #{ This.lib } #{ This.version } #{ This.gem }"
|
214
223
|
puts cmd
|
215
|
-
|
224
|
+
puts
|
225
|
+
system(cmd)
|
226
|
+
abort("cmd(#{ cmd }) failed with (#{ $?.inspect })") unless $?.exitstatus.zero?
|
216
227
|
end
|
217
228
|
|
218
229
|
|
@@ -228,6 +239,7 @@ BEGIN {
|
|
228
239
|
require 'erb'
|
229
240
|
require 'fileutils'
|
230
241
|
require 'rbconfig'
|
242
|
+
require 'pp'
|
231
243
|
|
232
244
|
# fu shortcut
|
233
245
|
#
|
@@ -286,11 +298,11 @@ BEGIN {
|
|
286
298
|
def unindent(s)
|
287
299
|
indent = nil
|
288
300
|
s.each_line do |line|
|
289
|
-
|
290
|
-
|
291
|
-
end
|
292
|
-
indent ? s.gsub(%r/^#{ indent }/, "") : s
|
301
|
+
next if line =~ %r/^\s*$/
|
302
|
+
indent = line[%r/^\s*/] and break
|
293
303
|
end
|
304
|
+
indent ? s.gsub(%r/^#{ indent }/, "") : s
|
305
|
+
end
|
294
306
|
extend self
|
295
307
|
end
|
296
308
|
|
@@ -298,11 +310,11 @@ BEGIN {
|
|
298
310
|
#
|
299
311
|
class Template
|
300
312
|
def initialize(&block)
|
301
|
-
@block = block
|
313
|
+
@block = block
|
302
314
|
@template = block.call.to_s
|
303
315
|
end
|
304
316
|
def expand(b=nil)
|
305
|
-
ERB.new(Util.unindent(@template)).result(b||@block)
|
317
|
+
ERB.new(Util.unindent(@template)).result((b||@block).binding)
|
306
318
|
end
|
307
319
|
alias_method 'to_s', 'expand'
|
308
320
|
end
|
data/lib/fattr.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
module Fattr
|
2
|
-
Fattr::Version = '2.2.
|
3
|
-
def
|
2
|
+
Fattr::Version = '2.2.2' unless Fattr.const_defined?(:Version)
|
3
|
+
def Fattr.version() Fattr::Version end
|
4
|
+
|
5
|
+
def Fattr.description
|
6
|
+
'a "fatter attr" for ruby'
|
7
|
+
end
|
4
8
|
|
5
9
|
class List < ::Array
|
6
10
|
def << element
|
metadata
CHANGED
@@ -1,27 +1,26 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fattr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
5
|
-
prerelease:
|
4
|
+
version: 2.2.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Ara T. Howard
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-02-15 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
|
-
description:
|
13
|
+
description: a "fatter attr" for ruby
|
15
14
|
email: ara.t.howard@gmail.com
|
16
15
|
executables: []
|
17
16
|
extensions: []
|
18
17
|
extra_rdoc_files: []
|
19
18
|
files:
|
20
|
-
- lib/fattr.rb
|
21
19
|
- LICENSE
|
22
|
-
- Rakefile
|
23
20
|
- README
|
24
21
|
- README.erb
|
22
|
+
- Rakefile
|
23
|
+
- lib/fattr.rb
|
25
24
|
- samples/a.rb
|
26
25
|
- samples/b.rb
|
27
26
|
- samples/c.rb
|
@@ -31,28 +30,28 @@ files:
|
|
31
30
|
- samples/g.rb
|
32
31
|
- samples/h.rb
|
33
32
|
- test/fattr_test.rb
|
34
|
-
homepage:
|
35
|
-
licenses:
|
33
|
+
homepage: https://github.com/ahoward/fattr
|
34
|
+
licenses:
|
35
|
+
- same as ruby's
|
36
|
+
metadata: {}
|
36
37
|
post_install_message:
|
37
38
|
rdoc_options: []
|
38
39
|
require_paths:
|
39
40
|
- lib
|
40
41
|
required_ruby_version: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
42
|
requirements:
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
46
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
47
|
-
none: false
|
48
47
|
requirements:
|
49
48
|
- - ! '>='
|
50
49
|
- !ruby/object:Gem::Version
|
51
50
|
version: '0'
|
52
51
|
requirements: []
|
53
52
|
rubyforge_project: codeforpeople
|
54
|
-
rubygems_version:
|
53
|
+
rubygems_version: 2.0.3
|
55
54
|
signing_key:
|
56
|
-
specification_version:
|
55
|
+
specification_version: 4
|
57
56
|
summary: fattr
|
58
57
|
test_files: []
|