macaddr 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/Rakefile +35 -19
  2. data/lib/macaddr.rb +11 -2
  3. data/macaddr.gemspec +4 -3
  4. metadata +21 -6
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)
@@ -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" if File.file?("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
- ## #{ lib }.gemspec
121
+ ## <%= lib %>.gemspec
113
122
  #
114
123
 
115
124
  Gem::Specification::new do |spec|
116
- spec.name = #{ lib.inspect }
117
- spec.version = #{ version.inspect }
125
+ spec.name = <%= lib.inspect %>
126
+ spec.version = <%= version.inspect %>
118
127
  spec.platform = Gem::Platform::RUBY
119
- spec.summary = #{ lib.inspect }
120
- spec.description = #{ description.inspect }
128
+ spec.summary = <%= lib.inspect %>
129
+ spec.description = <%= description.inspect %>
121
130
 
122
- spec.files =\n#{ files.sort.pretty_inspect }
123
- spec.executables = #{ executables.inspect }
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 = #{ test_files.inspect }
136
+ spec.test_files = <%= test_files.inspect %>
128
137
 
129
- ### spec.add_dependency 'lib', '>= version'
130
- #### spec.add_dependency 'map'
138
+ <% dependencies.each do |lib_version| %>
139
+ spec.add_dependency(*<%= Array(lib_version).flatten.inspect %>)
140
+ <% end %>
131
141
 
132
- spec.extensions.push(*#{ extensions.inspect })
142
+ spec.extensions.push(*<%= extensions.inspect %>)
133
143
 
134
- spec.rubyforge_project = #{ This.rubyforge_project.inspect }
135
- spec.author = #{ This.author.inspect }
136
- spec.email = #{ This.email.inspect }
137
- spec.homepage = #{ This.homepage.inspect }
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/lib/macaddr.rb CHANGED
@@ -23,9 +23,18 @@ end
23
23
  require 'systemu'
24
24
 
25
25
  module Mac
26
- VERSION = '1.2.0'
26
+ VERSION = '1.2.1'
27
+
28
+ def Mac.version
29
+ ::Mac::VERSION
30
+ end
31
+
32
+ def Mac.dependencies
33
+ {
34
+ 'systemu' => [ 'systemu' , '~> 2.2.0' ]
35
+ }
36
+ end
27
37
 
28
- def Mac.version() ::Mac::VERSION end
29
38
 
30
39
  class << self
31
40
 
data/macaddr.gemspec CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification::new do |spec|
5
5
  spec.name = "macaddr"
6
- spec.version = "1.2.0"
6
+ spec.version = "1.2.1"
7
7
  spec.platform = Gem::Platform::RUBY
8
8
  spec.summary = "macaddr"
9
9
  spec.description = "description: macaddr kicks the ass"
@@ -17,8 +17,9 @@ Gem::Specification::new do |spec|
17
17
 
18
18
  spec.test_files = nil
19
19
 
20
- ### spec.add_dependency 'lib', '>= version'
21
- #### spec.add_dependency 'map'
20
+
21
+ spec.add_dependency(*["systemu", "~> 2.2.0"])
22
+
22
23
 
23
24
  spec.extensions.push(*[])
24
25
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: macaddr
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 0
10
- version: 1.2.0
9
+ - 1
10
+ version: 1.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ara T. Howard
@@ -15,10 +15,25 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-10 00:00:00 -08:00
18
+ date: 2011-08-13 00:00:00 -06:00
19
19
  default_executable:
20
- dependencies: []
21
-
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: systemu
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ hash: 7
30
+ segments:
31
+ - 2
32
+ - 2
33
+ - 0
34
+ version: 2.2.0
35
+ type: :runtime
36
+ version_requirements: *id001
22
37
  description: "description: macaddr kicks the ass"
23
38
  email: ara.t.howard@gmail.com
24
39
  executables: []