Skip to content

Commit

Permalink
* Rakefile created
Browse files Browse the repository at this point in the history
* Makefile created
  • Loading branch information
EBIRIM authored and EBIRIM committed Mar 10, 2017
1 parent 54b1234 commit 04107fd
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Makefile
@@ -0,0 +1,3 @@

deploy:
bundle exec rake
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -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'

Expand Down Expand Up @@ -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
Expand Down
32 changes: 31 additions & 1 deletion 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

2 changes: 1 addition & 1 deletion lib/parliament/version.rb
@@ -1,3 +1,3 @@
module Parliament
VERSION = '0.5.13'.freeze
VERSION = '0.5.16'.freeze
end

0 comments on commit 04107fd

Please sign in to comment.