Skip to content

Commit

Permalink
Added releasy for packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeguerin committed Apr 6, 2014
1 parent adb3cec commit 1d47afe
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.bundle/
log/*.log
pkg/
.idea/
.idea/
coverage/
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ rvm:
- '1.9.3'
- '2.0.0'
- '2.1.0'
- jruby-18mode
- jruby-19mode
- rbx
- ruby-head
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ gem 'minitest'

gem 'minitest-reporters'

gem 'releasy', :github => 'timcolonel/releasy'

gem 'coveralls'
16 changes: 15 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
GIT
remote: git://github.com/timcolonel/releasy.git
revision: 64447bc1f8c207b4945c03958707cbfe51b27625
specs:
releasy (0.2.3)
bundler (>= 1.2.1)
cri (~> 2.1.0)
ocra (~> 1.3.0)
rake (>= 0.9.2.2)
thor (>= 0.14.6)

GEM
remote: https://rubygems.org/
specs:
Expand All @@ -16,6 +27,7 @@ GEM
simplecov (>= 0.7)
term-ansicolor
thor
cri (2.1.0)
docile (1.1.3)
hashie (2.0.5)
i18n (0.6.9)
Expand All @@ -27,10 +39,11 @@ GEM
minitest (>= 2.12, < 5.0)
powerbar
multi_json (1.9.2)
ocra (1.3.1)
powerbar (1.0.11)
ansi (~> 1.4.0)
hashie (>= 1.1.0)
rake (10.2.1)
rake (10.2.2)
rest-client (1.6.7)
mime-types (>= 1.16)
simplecov (0.8.2)
Expand All @@ -55,3 +68,4 @@ DEPENDENCIES
minitest
minitest-reporters
rake
releasy!
24 changes: 24 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
require 'rake/testtask'
require 'bundler/setup'
Bundler.setup
require 'releasy'

task :default => [:test]

Expand All @@ -9,4 +12,25 @@ Rake::TestTask.new do |t|
t.test_files = FileList['test/**/*_test.rb']
end

Releasy::Project.new do
name 'Bump'
version '1.0.0'
executable 'bin/bump'
verbose
files ['lib/**/*.rb', 'data/**/*.yml', 'template/**/*.*', 'bin/**/*.*']
exposed_files 'README.md'
add_link 'http://github.com/timcolonel/bump', 'Homepage'
exclude_encoding

add_build :source do
add_package :'7z'
end

add_build :windows_folder do
executable_type :windows # Assuming you don't want it to run with a console window.
add_package :exe # Windows self-extracting archive.
end

add_deploy :local
end

5 changes: 5 additions & 0 deletions bin/bump
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env ruby

require_relative '../lib/bump'

Bump.run
11 changes: 5 additions & 6 deletions lib/bump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
module Bump
class << self
def run
Bump::Config.load_config
begin
Bump::Config.load_config
rescue Bump::Error => e
puts e
end
action = ARGV[0]
unless action.nil?
case action
Expand Down Expand Up @@ -44,9 +48,4 @@ def update_version(new_version)
end
end
end
end


if __FILE__ == $0
Bump.run
end
2 changes: 1 addition & 1 deletion lib/bump/version/format.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def map
def bump(action_name, operation = 1)
action = @actions[action_name]
if action.nil?
raise Error, "Error unknown action #{element_name}"
raise Error, "Error unknown action #{action_name}"
end
format_array = @format['format'].split(DELIMITER_REGEXP)
format_array[format_array.index(action_name)+1..-1].each do |following_action_name|
Expand Down

0 comments on commit 1d47afe

Please sign in to comment.