diff --git a/.codeclimate.yml b/.codeclimate.yml index 74e8931b..c652722d 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -1,20 +1,4 @@ -# This is a sample .codeclimate.yml configured for Engine analysis on Code -# Climate Platform. For an overview of the Code Climate Platform, see here: -# http://docs.codeclimate.com/article/300-the-codeclimate-platform - -# Under the engines key, you can configure which engines will analyze your repo. -# Each key is an engine name. For each value, you need to specify enabled: true -# to enable the engine as well as any other engines-specific configuration. - -# For more details, see here: -# http://docs.codeclimate.com/article/289-configuring-your-repository-via-codeclimate-yml#platform - -# For a list of all available engines, see here: -# http://docs.codeclimate.com/article/296-engines-available-engines - engines: -# to turn on an engine, add it here and set enabled to `true` -# to turn off an engine, set enabled to `false` or remove it rubocop: enabled: true golint: @@ -26,23 +10,11 @@ engines: csslint: enabled: false -# Engines can analyze files and report issues on them, but you can separately -# decide which files will receive ratings based on those issues. This is -# specified by path patterns under the ratings key. - -# For more details see here: -# http://docs.codeclimate.com/article/289-configuring-your-repository-via-codeclimate-yml#platform - -# ratings: -# paths: -# - app/** -# - lib/** -# - "**.rb" -# - "**.go" - -# You can globally exclude files from being analyzed by any engine using the -# exclude_paths key. +ratings: + paths: + - lib/** + - "**.rb" -#exclude_paths: -#- spec/**/* -#- vendor/**/* +exclude_paths: + - spec/**/* + - vendor/**/* diff --git a/.travis.yml b/.travis.yml index 70c71e6d..59d1bb61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ rvm: - 2.0.0 - 2.1.0 - 2.2.0 -script: "bundle exec rake test" +script: "bundle exec rspec" addons: code_climate: repo_token: e87b175db123ab42ca2ca4420abaa13c0dc2085608402b9a25f08a83ca3ba202 diff --git a/Gemfile b/Gemfile index e29b17ac..73d38bc2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,20 +1,4 @@ # encoding: utf-8 source 'https://rubygems.org' -gem 'json', '>= 1.2.4' -gem 'multi_json', '~> 1.0', platforms: :ruby_18 -gem 'jruby-openssl', platforms: :jruby - -gem 'rubysl', '~> 2.0', platforms: :rbx - -group :development do - gem 'echoe', '>= 4.6.3' -end - -group :test, :development do - gem 'rake' - gem 'rspec', '~> 3' - gem 'simplecov' - gem 'simplecov-json' - gem 'codeclimate-test-reporter', require: nil -end +gemspec diff --git a/Rakefile b/Rakefile index ee848d14..c702cfcc 100644 --- a/Rakefile +++ b/Rakefile @@ -1,18 +1 @@ -# encoding: utf-8 -require 'rubygems' -require 'rake' -require 'echoe' - -Echoe.new('jwt', '1.5.2') do |p| - p.description = 'JSON Web Token implementation in Ruby' - p.url = 'http://github.com/progrium/ruby-jwt' - p.author = 'Jeff Lindsay' - p.email = 'progrium@gmail.com' - p.ignore_pattern = ['tmp/*'] - p.development_dependencies = ['echoe >=4.6.3'] - p.licenses = 'MIT' -end - -task :test do - sh 'rspec spec/jwt_spec.rb' -end +require 'bundler/gem_tasks' diff --git a/lib/jwt.rb b/lib/jwt.rb index d0ae953f..c5810091 100644 --- a/lib/jwt.rb +++ b/lib/jwt.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - require 'base64' require 'openssl' require 'jwt/json' diff --git a/lib/jwt/json.rb b/lib/jwt/json.rb index a1cc8a54..5d496569 100644 --- a/lib/jwt/json.rb +++ b/lib/jwt/json.rb @@ -1,4 +1,3 @@ -# encoding: utf-8 module JWT # JSON fallback implementation or ruby 1.8.x module Json diff --git a/lib/jwt/version.rb b/lib/jwt/version.rb new file mode 100644 index 00000000..94722f60 --- /dev/null +++ b/lib/jwt/version.rb @@ -0,0 +1,23 @@ +# encoding: utf-8 + +# Moments version builder module +module JWT + def self.gem_version + Gem::Version.new VERSION::STRING + end + + # Moments version builder module + module VERSION + # major version + MAJOR = 1 + # minor version + MINOR = 5 + # tiny version + TINY = 3 + # alpha, beta, etc. tag + PRE = 'dev' + + # Build version string + STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.') + end +end diff --git a/ruby-jwt.gemspec b/ruby-jwt.gemspec new file mode 100644 index 00000000..031a10a0 --- /dev/null +++ b/ruby-jwt.gemspec @@ -0,0 +1,29 @@ +lib = File.expand_path('../lib/', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'jwt/version' + +Gem::Specification.new do |spec| + spec.name = 'jwt' + spec.version = JWT.gem_version + spec.authors = [ + 'Jeff Lindsay', + 'Tim Rudat' + ] + spec.email = 'timrudat@gmail.com' + spec.summary = 'JSON Web Token implementation in Ruby' + spec.description = 'A pure ruby implementation of the RFC 7519 OAuth JSON Web Token (JWT) standard.' + spec.homepage = 'http://github.com/jwt/ruby-jwt' + spec.license = 'MIT' + + spec.files = `git ls-files -z`.split("\x0") + spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } + spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) + spec.require_paths = %w(lib) + + spec.add_development_dependency 'bundler' + spec.add_development_dependency 'rake' + spec.add_development_dependency 'rspec' + spec.add_development_dependency 'simplecov' + spec.add_development_dependency 'simplecov-json' + spec.add_development_dependency 'codeclimate-test-reporter' +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4deef7d9..2faf1928 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,3 @@ -# encoding: utf-8 require 'rspec' require 'simplecov' require 'simplecov-json'