Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Commit

Permalink
Add library stub
Browse files Browse the repository at this point in the history
  • Loading branch information
dazuma committed Jan 25, 2018
1 parent 2d7c82a commit dcf7470
Show file tree
Hide file tree
Showing 16 changed files with 354 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/.bundle/
/.yardoc
/Gemfile.lock
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/

/docs/_site
/docs/Gemfile.lock
/docs/api/
51 changes: 51 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
AllCops:
Exclude:
- "acceptance/**/*"
- "integration/**/*"
- "opencensus-zipkin.gemspec"
- "Rakefile"
- "support/**/*"
- "test/**/*"
- "docs/**/*"
- "tmp/**/*"

Documentation:
Enabled: false

Style/StringLiterals:
EnforcedStyle: double_quotes
Style/MethodDefParentheses:
EnforcedStyle: require_no_parentheses
Style/NumericLiterals:
Enabled: false
Layout/SpaceAroundOperators:
Enabled: false
Metrics/ClassLength:
Enabled: false
Layout/EmptyLines:
Enabled: false
Style/EmptyElse:
Enabled: false
Metrics/CyclomaticComplexity:
Max: 10
Metrics/PerceivedComplexity:
Max: 10
Metrics/AbcSize:
Max: 25
Metrics/MethodLength:
Max: 20
Metrics/ParameterLists:
Enabled: false
Style/RescueModifier:
Enabled: false
Style/ClassVars:
Enabled: false
Style/TrivialAccessors:
Enabled: false
Style/CaseEquality:
Enabled: false
Style/GuardClause:
Enabled: false
Naming/FileName:
Exclude:
- "lib/opencensus-zipkin.rb"
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Google Inc.
43 changes: 43 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Contributor Code of Conduct

As contributors and maintainers of this project,
and in the interest of fostering an open and welcoming community,
we pledge to respect all people who contribute through reporting issues,
posting feature requests, updating documentation,
submitting pull requests or patches, and other activities.

We are committed to making participation in this project
a harassment-free experience for everyone,
regardless of level of experience, gender, gender identity and expression,
sexual orientation, disability, personal appearance,
body size, race, ethnicity, age, religion, or nationality.

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information,
such as physical or electronic
addresses, without explicit permission
* Other unethical or unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct.
By adopting this Code of Conduct,
project maintainers commit themselves to fairly and consistently
applying these principles to every aspect of managing this project.
Project maintainers who do not follow or enforce the Code of Conduct
may be permanently removed from the project team.

This code of conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.

Instances of abusive, harassing, or otherwise unacceptable behavior
may be reported by opening an issue
or contacting one or more of the project maintainers.

This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0,
available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
34 changes: 34 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# How to become a contributor and submit your own code

## Contributor License Agreements

We'd love to accept your patches! Before we can take them, we
have to jump a couple of legal hurdles.

Please fill out either the individual or corporate Contributor License Agreement
(CLA).

* If you are an individual writing original source code and you're sure you
own the intellectual property, then you'll need to sign an [individual CLA]
(https://developers.google.com/open-source/cla/individual).
* If you work for a company that wants to allow you to contribute your work,
then you'll need to sign a [corporate CLA]
(https://developers.google.com/open-source/cla/corporate).

Follow either of the two links above to access the appropriate CLA and
instructions for how to sign and return it. Once we receive it, we'll be able to
accept your pull requests.

## Contributing A Patch

1. Submit an issue describing your proposed change to the repo in question.
1. The repo owner will respond to your issue promptly.
1. If your proposed change is accepted, and you haven't already done so, sign a
Contributor License Agreement (see details above).
1. Fork the desired repo, develop and test your code changes.
1. Ensure that your code adheres to the existing style in the sample to which
you are contributing. Refer to the
[Google Cloud Platform Samples Style Guide]
(https://github.com/GoogleCloudPlatform/Template/wiki/style.html) for the
recommended coding standards for this organization.
1. Submit a pull request.
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source "https://rubygems.org"

# Specify your gem's dependencies in opencensus.gemspec
gemspec
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Apache License
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

Expand Down
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
# ruby-zipkin-exporter
# Ruby Zipkin Exporter for OpenCensus

This library exports OpenCensus data to Zipkin.

## About the library

### Supported Ruby Versions

This library is supported on Ruby 2.0+.

### Versioning

This library follows [Semantic Versioning](http://semver.org/).

It is currently in major version zero (0.y.z), which means that anything may
change at any time, and the public API should not be considered stable.

## Contributing

Contributions to this library are always welcome and highly encouraged.

See the [Contributing Guide](CONTRIBUTING.md) for more information on how to get
started.

Please note that this project is released with a Contributor Code of Conduct. By
participating in this project you agree to abide by its terms. See
[Code of Conduct](CODE_OF_CONDUCT.md) for more information.

## License

This library is licensed under Apache 2.0. Full license text is available in
[LICENSE](LICENSE).
20 changes: 20 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
require "bundler/gem_tasks"
require "rake/testtask"
require "yard"

require "rubocop/rake_task"
RuboCop::RakeTask.new

Rake::TestTask.new :test do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/*_test.rb"]
end

YARD::Rake::YardocTask.new do |t|
t.files = ['lib/**/*.rb'] # optional
t.options = ['--output-dir', 'docs/api'] # optional
t.stats_options = ['--list-undoc'] # optional
end

task :default => [:test, :rubocop, :yard]
15 changes: 15 additions & 0 deletions lib/opencensus-zipkin.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2018 OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

require "opencensus/zipkin"
24 changes: 24 additions & 0 deletions lib/opencensus/trace/exporters/zipkin.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2018 OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

module OpenCensus
module Trace
module Exporters
## Zipkin exporter for OpenCensus Trace
class Zipkin
# TODO
end
end
end
end
24 changes: 24 additions & 0 deletions lib/opencensus/zipkin.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2018 OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

require "opencensus"

module OpenCensus
## Information about the Zipkin exporter plugin
module Zipkin
end
end

require "opencensus/zipkin/version"
require "opencensus/trace/exporters/zipkin"
20 changes: 20 additions & 0 deletions lib/opencensus/zipkin/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2018 OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

module OpenCensus
module Zipkin
## Current OpenCensus Zipkin plugin version
VERSION = "0.1.0".freeze
end
end
33 changes: 33 additions & 0 deletions opencensus-zipkin.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "opencensus/zipkin/version"

Gem::Specification.new do |spec|
spec.name = "opencensus-zipkin"
spec.version = OpenCensus::Zipkin::VERSION
spec.authors = ["Daniel Azuma"]
spec.email = ["[email protected]"]

spec.summary = "Zipkin exporter for OpenCensus"
spec.description = "Zipkin exporter for OpenCensus"
spec.homepage = "https://github.com/census-instrumentation/ruby-zipkin-exporter"
spec.license = "Apache-2.0"

spec.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
end
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency "opencensus", "~> 0.1.0"

spec.add_development_dependency "bundler", "~> 1.16"
spec.add_development_dependency "faraday", "~> 0.13"
spec.add_development_dependency "minitest", "~> 5.0"
spec.add_development_dependency "rails", "~> 5.1.4"
spec.add_development_dependency "rake", "~> 12.0"
spec.add_development_dependency "rubocop", "~> 0.52"
spec.add_development_dependency "yard", "~> 0.9"
spec.add_development_dependency "yard-doctest", "~> 0.1.6"
end
21 changes: 21 additions & 0 deletions test/library_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2018 OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

require "test_helper"

class LibraryTest < Minitest::Test
def test_that_it_has_a_version_number
refute_nil ::OpenCensus::Zipkin::VERSION
end
end
18 changes: 18 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2018 OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require "opencensus/zipkin"

require "minitest/autorun"

0 comments on commit dcf7470

Please sign in to comment.