diff --git a/.gitignore b/.gitignore index d688e03..fc5b55f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ **/*/*.sqlite3 **/*/public/assets *.swp +Gemfile.lock diff --git a/.travis.yml b/.travis.yml index 1e052a7..9e326fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,64 @@ -nguage: ruby +language: ruby + rvm: - 2.2.5 + env: - - "RAILS_VERSION=3.2.22" - - "RAILS_VERSION=4.2.0" - - "RAILS_VERSION=5.0.0" - - "RAILS_VERSION=5.1.1" -cache: bundler -install: bundle update + - RAILS_VERSION=5.1.2 + - RAILS_VERSION=4.2.0 + - RAILS_VERSION=3.2.22 + +cache: + directories: + - /home/travis/.rvm/gems/ruby-2.2.5 + +install: bundle install + before_script: - - "export DISPLAY=:99.0" - - "sh -e /etc/init.d/xvfb start" - - sleep 3 # give xvfb some time to start + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + - sleep 3 + script: ./ci/test.sh + +jobs: + include: + - stage: publish components + script: 'cd rswag-api' + deploy: + gemspec: rswag-api.gemspec + provider: rubygems + api_key: $RUBYGEMS_API_KEY + on: + branch: master + tags: true + + - stage: publish components + script: 'cd rswag-specs' + deploy: + gemspec: rswag-specs.gemspec + provider: rubygems + api_key: $RUBYGEMS_API_KEY + on: + branch: master + tags: true + + - stage: publish components + script: 'cd rswag-ui' + deploy: + gemspec: rswag-ui.gemspec + provider: rubygems + api_key: $RUBYGEMS_API_KEY + on: + branch: master + tags: true + + - stage: publish rswag + script: 'cd rswag' + deploy: + gemspec: rswag.gemspec + provider: rubygems + api_key: $RUBYGEMS_API_KEY + on: + branch: master + tags: true diff --git a/Gemfile b/Gemfile index ab4d32b..82f014e 100644 --- a/Gemfile +++ b/Gemfile @@ -29,8 +29,8 @@ group :test do gem 'capybara' gem 'capybara-webkit' end -# -#group :assets do -# gem 'uglifier' -# gem 'therubyracer' -#end + +group :assets do + gem 'uglifier' + gem 'therubyracer' +end diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 23039f2..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,187 +0,0 @@ -PATH - remote: rswag-api - specs: - rswag-api (1.3.0) - railties (>= 3.1) - -PATH - remote: rswag-specs - specs: - rswag-specs (1.3.0) - activesupport (>= 3.1) - json-schema (~> 2.2) - railties (>= 3.1) - -PATH - remote: rswag-ui - specs: - rswag-ui (1.3.0) - actionpack (>= 3.1) - railties (>= 3.1) - -GEM - remote: https://rubygems.org/ - specs: - actioncable (5.1.2) - actionpack (= 5.1.2) - nio4r (~> 2.0) - websocket-driver (~> 0.6.1) - actionmailer (5.1.2) - actionpack (= 5.1.2) - actionview (= 5.1.2) - activejob (= 5.1.2) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (5.1.2) - actionview (= 5.1.2) - activesupport (= 5.1.2) - rack (~> 2.0) - rack-test (~> 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.1.2) - activesupport (= 5.1.2) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.1.2) - activesupport (= 5.1.2) - globalid (>= 0.3.6) - activemodel (5.1.2) - activesupport (= 5.1.2) - activerecord (5.1.2) - activemodel (= 5.1.2) - activesupport (= 5.1.2) - arel (~> 8.0) - activesupport (5.1.2) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (~> 0.7) - minitest (~> 5.1) - tzinfo (~> 1.1) - addressable (2.5.1) - public_suffix (~> 2.0, >= 2.0.2) - arel (8.0.0) - builder (3.2.3) - capybara (2.13.0) - addressable - mime-types (>= 1.16) - nokogiri (>= 1.3.3) - rack (>= 1.0.0) - rack-test (>= 0.5.4) - xpath (~> 2.0) - capybara-webkit (1.14.0) - capybara (>= 2.3.0, < 2.14.0) - json - concurrent-ruby (1.0.5) - diff-lcs (1.3) - erubi (1.6.1) - generator_spec (0.9.4) - activesupport (>= 3.0.0) - railties (>= 3.0.0) - globalid (0.4.0) - activesupport (>= 4.2.0) - i18n (0.8.4) - json (2.1.0) - json-schema (2.8.0) - addressable (>= 2.4) - loofah (2.0.3) - nokogiri (>= 1.5.9) - mail (2.6.6) - mime-types (>= 1.16, < 4) - method_source (0.8.2) - mime-types (3.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2016.0521) - mini_portile2 (2.2.0) - minitest (5.10.2) - nio4r (2.1.0) - nokogiri (1.8.0) - mini_portile2 (~> 2.2.0) - power_assert (1.0.2) - public_suffix (2.0.5) - rack (2.0.3) - rack-test (0.6.3) - rack (>= 1.0) - rails (5.1.2) - actioncable (= 5.1.2) - actionmailer (= 5.1.2) - actionpack (= 5.1.2) - actionview (= 5.1.2) - activejob (= 5.1.2) - activemodel (= 5.1.2) - activerecord (= 5.1.2) - activesupport (= 5.1.2) - bundler (>= 1.3.0, < 2.0) - railties (= 5.1.2) - sprockets-rails (>= 2.0.0) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) - nokogiri (>= 1.6) - rails-html-sanitizer (1.0.3) - loofah (~> 2.0) - railties (5.1.2) - actionpack (= 5.1.2) - activesupport (= 5.1.2) - method_source - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (12.0.0) - responders (2.4.0) - actionpack (>= 4.2.0, < 5.3) - railties (>= 4.2.0, < 5.3) - rspec-core (3.6.0) - rspec-support (~> 3.6.0) - rspec-expectations (3.6.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.6.0) - rspec-mocks (3.6.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.6.0) - rspec-rails (3.6.0) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 3.6.0) - rspec-expectations (~> 3.6.0) - rspec-mocks (~> 3.6.0) - rspec-support (~> 3.6.0) - rspec-support (3.6.0) - sprockets (3.7.1) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.2.0) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (>= 3.0.0) - sqlite3 (1.3.13) - test-unit (3.2.5) - power_assert - thor (0.19.4) - thread_safe (0.3.6) - tzinfo (1.2.3) - thread_safe (~> 0.1) - websocket-driver (0.6.5) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.2) - xpath (2.1.0) - nokogiri (~> 1.3) - -PLATFORMS - ruby - -DEPENDENCIES - capybara - capybara-webkit - generator_spec - rails (= 5.1.2) - responders - rspec-rails - rswag-api! - rswag-specs! - rswag-ui! - sqlite3 - test-unit - -BUNDLED WITH - 1.14.6 diff --git a/ci/deploy.sh b/ci/deploy.sh deleted file mode 100755 index 5832789..0000000 --- a/ci/deploy.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env bash - -ROOT_PATH=$PWD -set -e # abort if anything fails - -bundle check || bundle - -echo '####################' -echo 'Build Gems' -echo '####################' -echo '' - -echo '##### rswag-api #####' -cd $ROOT_PATH/rswag-api -gem build rswag-api.gemspec - -echo '##### rswag-specs #####' -cd $ROOT_PATH/rswag-specs -gem build rswag-specs.gemspec - -echo '##### rswag-ui #####' -cd $ROOT_PATH/rswag-ui -gem build rswag-ui.gemspec - -echo '##### rswag #####' -cd $ROOT_PATH/rswag -gem build rswag.gemspec - -echo '####################' -echo 'Push to RubyGems' -echo '####################' -echo '' - -echo 'Type the version no, followed by [ENTER]:' -read version - -echo '##### rswag-api #####' -cd $ROOT_PATH/rswag-api -gem push rswag-api-$version.gem - -echo '##### rswag-specs #####' -cd $ROOT_PATH/rswag-specs -gem push rswag-specs-$version.gem - -echo '##### rswag-ui #####' -cd $ROOT_PATH/rswag-ui -gem push rswag-ui-$version.gem - -echo '##### rswag #####' -cd $ROOT_PATH/rswag -gem push rswag-$version.gem - -# Cleanup -cd $ROOT_PATH - -# Create git tag -git tag v$version -git push origin v$version diff --git a/rswag-api/lib/rswag/api.rb b/rswag-api/lib/rswag/api.rb index 553cb15..894072b 100644 --- a/rswag-api/lib/rswag/api.rb +++ b/rswag-api/lib/rswag/api.rb @@ -1,4 +1,3 @@ -require 'rswag/api/version' require 'rswag/api/configuration' require 'rswag/api/engine' diff --git a/rswag-api/lib/rswag/api/version.rb b/rswag-api/lib/rswag/api/version.rb deleted file mode 100644 index 5dc9577..0000000 --- a/rswag-api/lib/rswag/api/version.rb +++ /dev/null @@ -1,5 +0,0 @@ -module Rswag - module Api - VERSION = '1.3.0' - end -end diff --git a/rswag-api/rswag-api.gemspec b/rswag-api/rswag-api.gemspec index 80ec270..299172d 100644 --- a/rswag-api/rswag-api.gemspec +++ b/rswag-api/rswag-api.gemspec @@ -1,12 +1,9 @@ $:.push File.expand_path("../lib", __FILE__) -# Maintain your gem's version: -require 'rswag/api/version' - # Describe your gem and declare its dependencies: Gem::Specification.new do |s| s.name = "rswag-api" - s.version = Rswag::Api::VERSION + s.version = ENV['TRAVIS_TAG'] || '0.0.0' s.authors = ["Richie Morris"] s.email = ["domaindrivendev@gmail.com"] s.homepage = "https://github.com/domaindrivendev/rswag" @@ -16,5 +13,5 @@ Gem::Specification.new do |s| s.files = Dir["{lib}/**/*"] + ["MIT-LICENSE", "Rakefile"] - s.add_dependency 'railties', '>= 3.1' + s.add_dependency 'railties', '>= 3.1', '< 6.0' end diff --git a/rswag-specs/lib/rswag/specs.rb b/rswag-specs/lib/rswag/specs.rb index 8aeb768..de29ce9 100644 --- a/rswag-specs/lib/rswag/specs.rb +++ b/rswag-specs/lib/rswag/specs.rb @@ -1,5 +1,4 @@ require 'rspec/core' -require 'rswag/specs/version' require 'rswag/specs/example_group_helpers' require 'rswag/specs/example_helpers' require 'rswag/specs/configuration' diff --git a/rswag-specs/lib/rswag/specs/version.rb b/rswag-specs/lib/rswag/specs/version.rb deleted file mode 100644 index 2f136b2..0000000 --- a/rswag-specs/lib/rswag/specs/version.rb +++ /dev/null @@ -1,5 +0,0 @@ -module Rswag - module Specs - VERSION = '1.3.0' - end -end diff --git a/rswag-specs/rswag-specs.gemspec b/rswag-specs/rswag-specs.gemspec index 7c21c7f..0e4686e 100644 --- a/rswag-specs/rswag-specs.gemspec +++ b/rswag-specs/rswag-specs.gemspec @@ -1,12 +1,9 @@ $:.push File.expand_path("../lib", __FILE__) -# Maintain your gem's version: -require 'rswag/specs/version' - # Describe your gem and declare its dependencies: Gem::Specification.new do |s| s.name = "rswag-specs" - s.version = Rswag::Specs::VERSION + s.version = ENV['TRAVIS_TAG'] || '0.0.0' s.authors = ["Richie Morris"] s.email = ["domaindrivendev@gmail.com"] s.homepage = "https://github.com/domaindrivendev/rswag" @@ -16,7 +13,7 @@ Gem::Specification.new do |s| s.files = Dir["{lib}/**/*"] + ["MIT-LICENSE", "Rakefile" ] - s.add_dependency 'activesupport', '>= 3.1' - s.add_dependency 'railties', '>= 3.1' + s.add_dependency 'activesupport', '>= 3.1', '< 6.0' + s.add_dependency 'railties', '>= 3.1', '< 6.0' s.add_dependency 'json-schema', '~> 2.2' end diff --git a/rswag-ui/lib/rswag/ui.rb b/rswag-ui/lib/rswag/ui.rb index bdbcf25..bf5c810 100644 --- a/rswag-ui/lib/rswag/ui.rb +++ b/rswag-ui/lib/rswag/ui.rb @@ -1,4 +1,3 @@ -require 'rswag/ui/version' require 'rswag/ui/configuration' require 'rswag/ui/engine' diff --git a/rswag-ui/lib/rswag/ui/version.rb b/rswag-ui/lib/rswag/ui/version.rb deleted file mode 100644 index 1966406..0000000 --- a/rswag-ui/lib/rswag/ui/version.rb +++ /dev/null @@ -1,5 +0,0 @@ -module Rswag - module Ui - VERSION = '1.3.0' - end -end diff --git a/rswag-ui/rswag-ui.gemspec b/rswag-ui/rswag-ui.gemspec index 95f9bc2..6c44410 100644 --- a/rswag-ui/rswag-ui.gemspec +++ b/rswag-ui/rswag-ui.gemspec @@ -1,12 +1,9 @@ $:.push File.expand_path("../lib", __FILE__) -# Maintain your gem's version: -require 'rswag/ui/version' - # Describe your gem and declare its dependencies: Gem::Specification.new do |s| s.name = "rswag-ui" - s.version = Rswag::Ui::VERSION + s.version = ENV['TRAVIS_TAG'] || '0.0.0' s.authors = ["Richie Morris"] s.email = ["domaindrivendev@gmail.com"] s.homepage = "https://github.com/domaindrivendev/rswag" @@ -16,6 +13,6 @@ Gem::Specification.new do |s| s.files = Dir["{app,config,lib,vendor}/**/*"] + ["MIT-LICENSE", "Rakefile" ] - s.add_dependency 'actionpack', '>=3.1' - s.add_dependency 'railties', '>= 3.1' + s.add_dependency 'actionpack', '>=3.1', '< 6.0' + s.add_dependency 'railties', '>= 3.1', '< 6.0' end diff --git a/rswag/lib/rswag.rb b/rswag/lib/rswag.rb index e368f94..04b67d1 100644 --- a/rswag/lib/rswag.rb +++ b/rswag/lib/rswag.rb @@ -1,4 +1,3 @@ -require 'rswag/version' require 'rswag/specs' require 'rswag/api' require 'rswag/ui' diff --git a/rswag/lib/rswag/version.rb b/rswag/lib/rswag/version.rb deleted file mode 100644 index d903ac6..0000000 --- a/rswag/lib/rswag/version.rb +++ /dev/null @@ -1,3 +0,0 @@ -module Rswag - VERSION = '1.3.0' -end diff --git a/rswag/rswag.gemspec b/rswag/rswag.gemspec index 5ebcb7a..a2ed250 100644 --- a/rswag/rswag.gemspec +++ b/rswag/rswag.gemspec @@ -1,12 +1,9 @@ $:.push File.expand_path("../lib", __FILE__) -# Maintain your gem's version: -require 'rswag/version' - # Describe your gem and declare its dependencies: Gem::Specification.new do |s| s.name = "rswag" - s.version = Rswag::VERSION + s.version = ENV['TRAVIS_TAG'] || '0.0.0' s.authors = ["Richie Morris"] s.email = ["domaindrivendev@gmail.com"] s.homepage = "https://github.com/domaindrivendev/rswag" @@ -16,7 +13,7 @@ Gem::Specification.new do |s| s.files = Dir["{lib}/**/*"] + [ "MIT-LICENSE" ] - s.add_dependency 'rswag-specs', Rswag::VERSION - s.add_dependency 'rswag-api', Rswag::VERSION - s.add_dependency 'rswag-ui', Rswag::VERSION + s.add_dependency 'rswag-specs', ENV['TRAVIS_TAG'] || '0.0.0' + s.add_dependency 'rswag-api', ENV['TRAVIS_TAG'] || '0.0.0' + s.add_dependency 'rswag-ui', ENV['TRAVIS_TAG'] || '0.0.0' end diff --git a/test-app/db/schema.rb b/test-app/db/schema.rb index cea4d93..4e72efd 100644 --- a/test-app/db/schema.rb +++ b/test-app/db/schema.rb @@ -13,10 +13,10 @@ ActiveRecord::Schema.define(version: 20160218212104) do create_table "blogs", force: :cascade do |t| - t.string "title", limit: 255 + t.string "title" t.text "content" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at" + t.datetime "updated_at" end end