Skip to content

Commit

Permalink
Use Bundler to parse out a basic list of gems, versions, and authors
Browse files Browse the repository at this point in the history
  • Loading branch information
copyhacker committed Apr 17, 2014
1 parent 367b0b4 commit 48495b2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Guardfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
guard 'rspec' do
guard 'rspec', all_on_start: true do
watch(%r{^lib/(.+).rb$}) do |m|
"spec/#{m[1]}_spec.rb"
end
Expand Down
11 changes: 7 additions & 4 deletions diligent.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ Gem::Specification.new do |s|
'https://github.com/copyhacker/diligent'
s.license = 'MIT'

s.add_runtime_dependency 'thor', '~> 0'
s.add_development_dependency 'rspec'
s.add_development_dependency 'guard'
s.add_development_dependency 'guard-rspec'
s.add_runtime_dependency 'bundler', '~> 1.0'
s.add_runtime_dependency 'thor', '~> 0.19'
s.add_development_dependency 'rspec', '~> 3.0.beta'
s.add_development_dependency 'guard', '~> 2.6'
s.add_development_dependency 'guard-rspec', '~> 4.2'
s.add_development_dependency 'pry', '~> 0.9'
s.add_development_dependency 'awesome_print', '~> 1.2'
end
5 changes: 5 additions & 0 deletions lib/diligent.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
require 'bundler'
require 'diligent/version'

module Diligent
class Info
def self.legalese
"New versions of the executable. If distribution of the alternative licenses, if any, in source and free culture, all users contributing to Wikimedia projects To grow the commons of free software, and (2) offer you this license is required to exercise the rights granted hereunder will terminate: (a) automatically without notice from Apple which Apple may grant in its Contribution, if any, must include the Program or Derived Programs thereof. Article 4 (Termination of Agreement) 1. The Recipient may not occur to you when allowing others to access the modified work as a relevant directory file) where a user would be entitled to make sure that they, too, receive or can get it if you want it to your programs, too."
end

def self.list
Bundler.load.specs.map { |s| [ s.name, s.version.to_s, s.author, s.description ] }
end
end
end
8 changes: 7 additions & 1 deletion spec/diligent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
describe Diligent::Info do
context '.legalese' do
it 'should be present' do
Diligent::Info.legalese.should_not be_nil
expect(Diligent::Info.legalese).not_to be_nil
end
end

context '.list' do
it 'should be a list of gems used' do
expect(Diligent::Info.list.first.first).to eq('awesome_print')
end
end
end

0 comments on commit 48495b2

Please sign in to comment.