From 04107fdd46884dad49e0a6c90c640a1b76ff9f72 Mon Sep 17 00:00:00 2001 From: EBIRIM Date: Fri, 10 Mar 2017 17:45:53 +0000 Subject: [PATCH] * Rakefile created * Makefile created --- Makefile | 3 +++ README.md | 4 ++-- Rakefile | 32 +++++++++++++++++++++++++++++++- lib/parliament/version.rb | 2 +- 4 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c3aa48e --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ + +deploy: + bundle exec rake diff --git a/README.md b/README.md index bfa8674..aec54c5 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Parliament::Request.new.base_url #=> 'http://test.com' Parliament::Request.new(base_url: 'http://example.com').base_url #=> 'http://example.com' ``` -Alternatively, you can set the environment variable `PARLIAMENT_BASE_URL` on your machine and we will automatically use that. +Alternatively, you can set the environment variable `PARLIAMENT_BASE_URL` on your machine and we will automatically use that....... ```ruby ENV['PARLIAMENT_BASE_URL'] #=> 'http://example.com' @@ -119,7 +119,7 @@ If you wish to submit a bug fix or feature, you can create a pull request and it ## License -[parliament-ruby][parliament-ruby] is licensed under the [Open Parliament Licence][info-license]. +[parliament-ruby][parliament-ruby] is licensed under the [Open Parliament Licence][info-license].. [ruby]: https://www.ruby-lang.org/en/ [bundler]: http://bundler.io diff --git a/Rakefile b/Rakefile index 4c774a2..d290d1e 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,36 @@ require 'bundler/gem_tasks' require 'rspec/core/rake_task' +require_relative 'lib/parliament/version' +require 'open3' RSpec::Core::RakeTask.new(:spec) -task default: :spec +GEM_VERSION = Parliament::VERSION + +def run_command(cmd) + Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr| + exit_status = wait_thr.value + unless exit_status.success? + abort "#{cmd} FAILED !!" + end + end +end + +task :build do + run_command("gem build parliament-ruby.gemspec") +end + +task :push do + run_command("gem push parliament-ruby-#{GEM_VERSION}.gem") +end + +task :clean do + run_command("rm parliament-ruby-#{GEM_VERSION}.gem") +end + +#task default: :build +task :spec => :build +task :push => :spec +task :clean => :push +task default: :clean + diff --git a/lib/parliament/version.rb b/lib/parliament/version.rb index de135a8..e33dd5c 100644 --- a/lib/parliament/version.rb +++ b/lib/parliament/version.rb @@ -1,3 +1,3 @@ module Parliament - VERSION = '0.5.13'.freeze + VERSION = '0.5.16'.freeze end