Skip to content

Commit

Permalink
gem desc
Browse files Browse the repository at this point in the history
  • Loading branch information
ahoward committed Feb 15, 2014
1 parent 21d5c39 commit a0ae1a7
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 44 deletions.
62 changes: 24 additions & 38 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ This.author = "Ara T. Howard"
This.email = "ara.t.howard@gmail.com"
This.homepage = "https://github.com/ahoward/#{ This.lib }"

task :license do
open('LICENSE', 'w'){|fd| fd.puts "same as ruby's"}
end

task :default do
puts((Rake::Task.tasks.map{|task| task.name.gsub(/::/,':')} - ['default']).sort)
Expand All @@ -29,7 +32,7 @@ def run_tests!(which = nil)

test_rbs.each_with_index do |test_rb, index|
testno = index + 1
command = "#{ This.ruby } -I ./lib -I ./test/lib #{ test_rb }"
command = "#{ This.ruby } -w -I ./lib -I ./test/lib #{ test_rb }"

puts
say(div, :color => :cyan, :bold => true)
Expand Down Expand Up @@ -87,9 +90,10 @@ task :gemspec do
files = shiteless[Dir::glob("**/**")]
executables = shiteless[Dir::glob("bin/*")].map{|exe| File.basename(exe)}
#has_rdoc = true #File.exist?('doc')
test_files = test(?e, "test/#{ lib }.rb") ? "test/#{ lib }.rb" : nil
test_files = "test/#{ lib }.rb" if File.file?("test/#{ lib }.rb")
summary = object.respond_to?(:summary) ? object.summary : "summary: #{ lib } kicks the ass"
description = object.respond_to?(:description) ? object.description : "description: #{ lib } kicks the ass"
license = object.respond_to?(:license) ? object.license : "same as ruby's"

if This.extensions.nil?
This.extensions = []
Expand All @@ -100,51 +104,39 @@ task :gemspec do
end
extensions = [extensions].flatten.compact

# TODO
if This.dependencies.nil?
dependencies = []
else
case This.dependencies
when Hash
dependencies = This.dependencies.values
when Array
dependencies = This.dependencies
end
end

template =
if test(?e, 'gemspec.erb')
Template{ IO.read('gemspec.erb') }
else
Template {
<<-__
## <%= lib %>.gemspec
## #{ lib }.gemspec
#
Gem::Specification::new do |spec|
spec.name = <%= lib.inspect %>
spec.version = <%= version.inspect %>
spec.name = #{ lib.inspect }
spec.version = #{ version.inspect }
spec.platform = Gem::Platform::RUBY
spec.summary = <%= lib.inspect %>
spec.description = <%= description.inspect %>
spec.summary = #{ lib.inspect }
spec.description = #{ description.inspect }
spec.license = #{ license.inspect }
spec.files =\n<%= files.sort.pretty_inspect %>
spec.executables = <%= executables.inspect %>
spec.files =\n#{ files.sort.pretty_inspect }
spec.executables = #{ executables.inspect }
spec.require_path = "lib"
spec.test_files = <%= test_files.inspect %>
spec.test_files = #{ test_files.inspect }
<% dependencies.each do |lib_version| %>
spec.add_dependency(*<%= Array(lib_version).flatten.inspect %>)

This comment has been minimized.

Copy link
@yaauie

yaauie Feb 18, 2014

It looks like this is the culprit.

<% end %>
### spec.add_dependency 'lib', '>= version'
#### spec.add_dependency 'map'
spec.extensions.push(*<%= extensions.inspect %>)
spec.extensions.push(*#{ extensions.inspect })
spec.rubyforge_project = <%= This.rubyforge_project.inspect %>
spec.author = <%= This.author.inspect %>
spec.email = <%= This.email.inspect %>
spec.homepage = <%= This.homepage.inspect %>
spec.rubyforge_project = #{ This.rubyforge_project.inspect }
spec.author = #{ This.author.inspect }
spec.email = #{ This.email.inspect }
spec.homepage = #{ This.homepage.inspect }
end
__
}
Expand Down Expand Up @@ -188,8 +180,8 @@ task :readme do
end

template =
if test(?e, 'readme.erb')
Template{ IO.read('readme.erb') }
if test(?e, 'README.erb')
Template{ IO.read('README.erb') }
else
Template {
<<-__
Expand Down Expand Up @@ -280,12 +272,6 @@ BEGIN {
end
This.version = version

# see if dependencies are export by the module
#
if This.object.respond_to?(:dependencies)
This.dependencies = This.object.dependencies
end

# we need to know the name of the lib an it's version
#
abort('no lib') unless This.lib
Expand Down
6 changes: 5 additions & 1 deletion lib/macaddr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
require 'systemu'

module Mac
VERSION = '1.6.1'
VERSION = '1.6.2'

def Mac.version
::Mac::VERSION
Expand All @@ -35,6 +35,10 @@ def Mac.dependencies
}
end

def Mac.description
'cross platform mac address determination for ruby'
end


class << self

Expand Down
10 changes: 5 additions & 5 deletions macaddr.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

Gem::Specification::new do |spec|
spec.name = "macaddr"
spec.version = "1.6.1"
spec.version = "1.6.2"
spec.platform = Gem::Platform::RUBY
spec.summary = "macaddr"
spec.description = "description: macaddr kicks the ass"
spec.description = "cross platform mac address determination for ruby"
spec.license = "same as ruby's"

spec.files =
["Gemfile",
Expand All @@ -30,9 +31,8 @@ Gem::Specification::new do |spec|

spec.test_files = nil


spec.add_dependency(*["systemu", "~> 2.5.0"])

This comment has been minimized.

Copy link
@Strech

Strech Feb 15, 2014

@ahoward That was a mistake #18

This comment has been minimized.

Copy link
@mathiasuhl

mathiasuhl Feb 15, 2014

i put that line back in but it didn't work ...

This comment has been minimized.

Copy link
@Strech

Strech Feb 16, 2014

First of all lets do it like this
spec.add_runtime_dependency "systemu", "~> 2.5.0"

Then you need to specify gem from github repo, or push new gem with new gemspec to rubygems

This comment has been minimized.

Copy link
@yaauie

yaauie Feb 18, 2014

👍 this one bit me as well.

This comment has been minimized.

Copy link
@reydi

reydi Feb 18, 2014

@Strech specify gem in GemFile, like gem 'systemu'?

This comment has been minimized.

Copy link
@yaauie

yaauie Feb 18, 2014

In this project, the gemspec is generated. The culprit is in the Rakefile. I can submit a patch tonight if no one else beats me, but busy in the meantime.

This comment has been minimized.

Copy link
@bobbytables

bobbytables Feb 19, 2014

Yeah this is biting me too.


### spec.add_dependency 'lib', '>= version'
#### spec.add_dependency 'map'

spec.extensions.push(*[])

Expand Down
Binary file added pkg/macaddr-1.6.2.gem
Binary file not shown.

3 comments on commit a0ae1a7

@todd-richmond
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change in dependency management breaks bundle. "Bundle update" will attempt to use the 2.6 version of systemu which causes a runtime load failure for 2.5 which won't exist. The dependency should be >= 2.5 instead of -> 2.5

@yaauie
Copy link

@yaauie yaauie commented on a0ae1a7 Feb 21, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@todd-richmond I'm confused as to what you mean here; ~> 2.5 is equivalent to the combination of >= 2.5 && < 3.0.

@todd-richmond
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to turn into a require of 2.5 because if my gemset only includes systemu 2.6, then the gem fails to load on the inability to load systemu at all (file not found). Downgrading to macaddr 1.6.1 allows the loading chain to work again. I think ~> means 2.5.x, or at least that is how it is working in macaddr 1.6.2 now

Please sign in to comment.