schema_repo 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ODA4NjcyM2FiYTM3ZWNiYTRjYjRmMTVmMzg0NjljYjE3MjM5MmMxOA==
5
+ data.tar.gz: !binary |-
6
+ YTQxNmUyNDhjZWViZjc2NDk2ZmNiZjg3MTc3MDJkN2Y3MzZlNWZiMg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MDdhM2I0MWI3ZjFhNDkzM2I1YTk3N2E0YjM1ZjNiOTk2NTExZjIzMGE0NGE2
10
+ NGM3NDY1NjU1ZGQxN2Y3NGNkYTk3ZTU0YjI3NDg0YzY0MDBiNzVhNjQ5ZDIz
11
+ NjI2MjYzNDk4ZjQ5NWFmZGQ0MDUwMzU0MzZkZGFiYTMxODljYTU=
12
+ data.tar.gz: !binary |-
13
+ YjZjZjgwNjEwYTFmMmY3ZjEzZTlkNDAzNjY5OTVmODQ5ODkwYTY4ZmMxZGU0
14
+ YjhiYjk0ZDk1ZjM4NjJiNTg1YThjMzg3ZDA3MGU5OWRlZDAzNTIwNTQ3MTUx
15
+ MTJjMGZkZDFmZGU3ODliMWU2MTJjNjgzZWEyZjlhMTFmZWE0NWQ=
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.1.2
5
+ before_install: gem install bundler -v 1.10.3
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ 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, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ 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. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'http://rubygems.org'
2
+
3
+ # Check out schema_repo.gemspec my friend
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 JohnnyT
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # Schema Repo [![Build Status](https://travis-ci.org/johnnyt/schema_repo.png)](https://travis-ci.org/johnnyt/schema_repo)
2
+
3
+
4
+ ## Installation
5
+
6
+ Add this line to your application's Gemfile:
7
+
8
+ ```ruby
9
+ gem "schema_repo”
10
+ ```
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install schema_repo
19
+
20
+ ## Usage
21
+
22
+ TODO: Write usage instructions here
23
+
24
+ ## Development
25
+
26
+ After checking out the repo, run `script/setup` to install dependencies.
27
+ Then, run `rake test` to run the tests.
28
+ You can also run `script/console` for an interactive prompt that will allow you to experiment.
29
+
30
+ To install this gem onto your local machine, run `bundle exec rake install`.
31
+ To release a new version, update the version number in `version.rb`,
32
+ and then run `bundle exec rake release`, which will create a git tag for the version,
33
+ push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
34
+
35
+ ## Contributing
36
+
37
+ Bug reports and pull requests are welcome on GitHub at https://github.com/johnnyt/schema_repo.
38
+ This project is intended to be a safe, welcoming space for collaboration,
39
+ and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org)
40
+ code of conduct.
41
+
42
+ ## License
43
+
44
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList['test/**/*_test.rb']
8
+ end
9
+
10
+ task :default => :test
@@ -0,0 +1,10 @@
1
+ require "rubygems"
2
+ require "schema_repo/version"
3
+
4
+ module SchemaRepo
5
+ # Your code goes here...
6
+ end
7
+
8
+ require_relative "schema_repo/utils/array_utils"
9
+ require_relative "schema_repo/utils/hash_utils"
10
+ require_relative "schema_repo/utils/string_utils"
@@ -0,0 +1,5 @@
1
+ class Array
2
+ def extract_options!
3
+ SchemaRepo::ArrayUtils.extract_options! self
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class Hash
2
+ def symbolize
3
+ SchemaRepo::HashUtils.symbolize self
4
+ end
5
+ end
@@ -0,0 +1,13 @@
1
+ class String
2
+ def constantize
3
+ SchemaRepo::StringUtils.constantize self
4
+ end
5
+
6
+ def demodulize
7
+ SchemaRepo::StringUtils.demodulize self
8
+ end
9
+
10
+ def underscore
11
+ SchemaRepo::StringUtils.underscore self
12
+ end
13
+ end
@@ -0,0 +1,8 @@
1
+ module SchemaRepo
2
+ module ArrayUtils
3
+ def extract_options! array
4
+ array.last.is_a?(Hash) ? array.pop : { }
5
+ end
6
+ module_function :extract_options!
7
+ end
8
+ end
@@ -0,0 +1,16 @@
1
+ module SchemaRepo
2
+ module HashUtils
3
+ def symbolize(hash)
4
+ hash.inject({}) do |memo, pair|
5
+ key, value = pair
6
+
7
+ if value.is_a? Hash
8
+ memo.merge! key.to_sym => symbolize(value)
9
+ else
10
+ memo.merge! key.to_sym => value
11
+ end
12
+ end
13
+ end
14
+ module_function :symbolize
15
+ end
16
+ end
@@ -0,0 +1,50 @@
1
+ module SchemaRepo
2
+ module StringUtils
3
+ def demodulize(path)
4
+ path = path.to_s
5
+ if i = path.rindex('::')
6
+ path[(i+2)..-1]
7
+ else
8
+ path
9
+ end
10
+ end
11
+ module_function :demodulize
12
+
13
+ def underscore(camel_cased_word)
14
+ word = camel_cased_word.to_s.gsub('::', '/')
15
+ word.gsub!(/([A-Z\d]+)([A-Z][a-z])/,'\1_\2')
16
+ word.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
17
+ word.tr!("-", "_")
18
+ word.downcase!
19
+ word
20
+ end
21
+ module_function :underscore
22
+
23
+ def constantize(camel_cased_word)
24
+ names = camel_cased_word.split('::')
25
+ names.shift if names.empty? || names.first.empty?
26
+
27
+ names.inject(Object) do |constant, name|
28
+ if constant == Object
29
+ constant.const_get(name)
30
+ else
31
+ candidate = constant.const_get(name)
32
+ next candidate if constant.const_defined?(name, false)
33
+ next candidate unless Object.const_defined?(name)
34
+
35
+ # Go down the ancestors to check it it's owned
36
+ # directly before we reach Object or the end of ancestors.
37
+ constant = constant.ancestors.inject do |const, ancestor|
38
+ break const if ancestor == Object
39
+ break ancestor if ancestor.const_defined?(name, false)
40
+ const
41
+ end
42
+
43
+ # owner is in Object, so raise
44
+ constant.const_get(name, false)
45
+ end
46
+ end
47
+ end
48
+ module_function :constantize
49
+ end
50
+ end
@@ -0,0 +1,3 @@
1
+ module SchemaRepo
2
+ VERSION = "0.0.0"
3
+ end
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path "../lib", __FILE__
3
+ $LOAD_PATH.unshift lib unless $LOAD_PATH.include? lib
4
+ require "schema_repo/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "schema_repo"
8
+ spec.version = SchemaRepo::VERSION
9
+ spec.authors = ["JohnnyT"]
10
+ spec.email = ["ubergeek3141@gmail.com"]
11
+
12
+ spec.summary = "A REST service to store Avro schemas"
13
+ spec.description = "A REST service to store Avro schemas"
14
+ spec.homepage = "https://github.com/johnnyt/schema_repo"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "bin"
19
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler"
23
+ spec.add_development_dependency "minitest", "= 5.4.2"
24
+ spec.add_development_dependency "minitest-reporters"
25
+ spec.add_development_dependency "rake"
26
+ end
data/script/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "schema_repo"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/script/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
metadata ADDED
@@ -0,0 +1,119 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: schema_repo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - JohnnyT
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-08-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: minitest
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 5.4.2
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 5.4.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest-reporters
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: A REST service to store Avro schemas
70
+ email:
71
+ - ubergeek3141@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - .gitignore
77
+ - .travis.yml
78
+ - CODE_OF_CONDUCT.md
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - lib/schema_repo.rb
84
+ - lib/schema_repo/core_ext/array.rb
85
+ - lib/schema_repo/core_ext/hash.rb
86
+ - lib/schema_repo/core_ext/string.rb
87
+ - lib/schema_repo/utils/array_utils.rb
88
+ - lib/schema_repo/utils/hash_utils.rb
89
+ - lib/schema_repo/utils/string_utils.rb
90
+ - lib/schema_repo/version.rb
91
+ - schema_repo.gemspec
92
+ - script/console
93
+ - script/setup
94
+ homepage: https://github.com/johnnyt/schema_repo
95
+ licenses:
96
+ - MIT
97
+ metadata: {}
98
+ post_install_message:
99
+ rdoc_options: []
100
+ require_paths:
101
+ - lib
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ! '>='
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ! '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ requirements: []
113
+ rubyforge_project:
114
+ rubygems_version: 2.4.5
115
+ signing_key:
116
+ specification_version: 4
117
+ summary: A REST service to store Avro schemas
118
+ test_files: []
119
+ has_rdoc: