Skip to content

Commit

Permalink
Add yard and simplecov for documentation and coverage reports
Browse files Browse the repository at this point in the history
  • Loading branch information
localshred committed Jan 2, 2012
1 parent 48f8daa commit 4e4e076
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ pkg/*
.bundle
.rvmrc
*.log
coverage
doc
.yardoc
5 changes: 5 additions & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--no-private
--hide-void-return

--markup-provider=redcarpet
--markup=markdown
16 changes: 14 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@ PATH
specs:
protobuf (1.0.1)
eventmachine (~> 0.12.10)
json_pure
eventually (~> 0.1.0)
json_pure (~> 1.6.4)

GEM
remote: http://rubygems.org/
specs:
diff-lcs (1.1.3)
eventmachine (0.12.10)
eventmachine (0.12.10-java)
json_pure (1.6.3)
eventually (0.1.0)
json_pure (1.6.4)
multi_json (1.0.4)
rake (0.8.7)
redcarpet (1.17.2)
rspec (2.7.0)
rspec-core (~> 2.7.0)
rspec-expectations (~> 2.7.0)
Expand All @@ -21,6 +25,11 @@ GEM
rspec-expectations (2.7.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.7.0)
simplecov (0.5.4)
multi_json (~> 1.0.3)
simplecov-html (~> 0.5.3)
simplecov-html (0.5.3)
yard (0.7.4)

PLATFORMS
java
Expand All @@ -29,4 +38,7 @@ PLATFORMS
DEPENDENCIES
protobuf!
rake (~> 0.8.7)
redcarpet (~> 1.17.2)
rspec (~> 2.7.0)
simplecov (~> 0.5.4)
yard (~> 0.7.4)
12 changes: 6 additions & 6 deletions lib/protobuf/descriptor/descriptor_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ def self.id2label(label_id)
def self.label2id(label)
require 'protobuf/descriptor/descriptor_proto'
case label
when :required
Google::Protobuf::FieldDescriptorProto::Label::LABEL_REQUIRED then
when :optional
Google::Protobuf::FieldDescriptorProto::Label::LABEL_OPTIONAL then
when :repeated
Google::Protobuf::FieldDescriptorProto::Label::LABEL_REPEATED then
when :required then
Google::Protobuf::FieldDescriptorProto::Label::LABEL_REQUIRED
when :optional then
Google::Protobuf::FieldDescriptorProto::Label::LABEL_OPTIONAL
when :repeated then
Google::Protobuf::FieldDescriptorProto::Label::LABEL_REPEATED
else
raise ArgumentError, "Invalid label: #{label}"
end
Expand Down
6 changes: 5 additions & 1 deletion protobuf.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]

s.add_dependency 'eventmachine', '~> 0.12.10'
s.add_dependency 'json_pure'
s.add_dependency 'eventually', '~> 0.1.0'
s.add_dependency 'json_pure', '~> 1.6.4'

s.add_development_dependency 'rake', '~> 0.8.7'
s.add_development_dependency 'rspec', '~> 2.7.0'
s.add_development_dependency 'yard', '~> 0.7.4'
s.add_development_dependency 'redcarpet', '~> 1.17.2'
s.add_development_dependency 'simplecov', '~> 0.5.4'
end
3 changes: 3 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
require 'simplecov'
SimpleCov.start

require 'rubygems'
require 'bundler'
Bundler.setup :default, :development, :test
Expand Down

0 comments on commit 4e4e076

Please sign in to comment.