rumination 0.12.3 → 0.12.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f8178e945a55fcb344075d230b102816b7855a6
4
- data.tar.gz: 07eaad7b1747be338160bb08f3d93db8f3571ad4
3
+ metadata.gz: dfeda62c09cc79572cd193649d9b6a3f1c68233d
4
+ data.tar.gz: c83640f8c9d28ded629397bddb002e4e8e2d2999
5
5
  SHA512:
6
- metadata.gz: 4485a798b32a436014ff570f6485bd226b3de13b329889311bd762249e45d48fe29256988b913b67bdc9412c970224a898dac83cdb3411893473559467b432dd
7
- data.tar.gz: e85f974f52cb29150f8f650ed4f20885fea60bca8d78981409e679a746171cbbbaa2e02941d38c300814d5d13e7335ce8b31cd7b008102aba862b0da15dfa494
6
+ metadata.gz: bf3d5fbdc1c6f5c90fd684cff4df829099c221e90e8b53a4c93a4b62a5d9c44d335d1c4ab075b81f91791323c2e5b14f1ddffa99f25f952528f4888f1ecff767
7
+ data.tar.gz: c2fb22058c3d540830015254b71f92a6da9fb66d09c55e38797f019693d498e2959c3a0b326cc727e282a2d548bc38abf7671aeeed8135d5c62e27b8bb07d21d
data/Rakefile CHANGED
@@ -1,6 +1,37 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
+ require "highline/import"
4
+ require "active_support/core_ext/object/blank"
3
5
 
4
6
  RSpec::Core::RakeTask.new(:spec)
5
7
 
6
8
  task :default => :spec
9
+
10
+ task :choose_version do
11
+ current_version = Rumination::VERSION
12
+ released = `git tag -l v#{current_version}`.present?
13
+ if released
14
+ major, minor, build = current_version.split(".")
15
+ major, minor, build = [major, minor, build].map(&:to_i)
16
+ next_build = [major, minor, build+1].join(".")
17
+ next_minor = [major, minor + 1].join(".")
18
+ next_major = [major + 1, 0].join(".")
19
+ next_version = nil
20
+ choose do |menu|
21
+ menu.prompt = "Choose new version"
22
+ menu.choice(next_build) { next_version = next_build }
23
+ menu.choice(next_minor) { next_version = next_minor }
24
+ menu.choice(next_major) { next_version = next_major }
25
+ menu.default = next_build
26
+ end
27
+ version_src = "lib/rumination/version.rb"
28
+ version_tmp = "tmp/next_version.rb"
29
+ mkdir_p "tmp"
30
+ sh %Q[cat #{version_src} | sed s:#{current_version}:#{next_version}: > #{version_tmp}]
31
+ cp version_tmp, version_src
32
+ sh %Q[git add #{version_src}]
33
+ sh %Q[git commit -m "version bump to #{next_version}"]
34
+ end
35
+ end
36
+
37
+ task release: :choose_version
@@ -18,6 +18,13 @@ module Rumination
18
18
  env
19
19
  end
20
20
 
21
+ def load_target_config target_name
22
+ load "./config/deploy/targets/#{target_name}.rb"
23
+ self.target = target_name
24
+ rescue LoadError => e
25
+ raise UnknownTarget, e.message
26
+ end
27
+
21
28
  def bootstrap target:
22
29
  deploy_class.new(target).call do |deploy|
23
30
  deploy.bootstrap
@@ -1,9 +1,11 @@
1
1
  require "active_support/configurable"
2
+ require "active_support/core_ext/module"
2
3
  require_relative "deploy/class_methods"
3
4
  require "dotenv/parser"
4
5
 
5
6
  module Rumination
6
7
  module Deploy
8
+ mattr_accessor :target
7
9
  include ActiveSupport::Configurable
8
10
  extend Deploy::ClassMethods
9
11
  DeployError = Class.new(RuntimeError)
@@ -14,18 +14,14 @@ namespace :deploy do
14
14
  end
15
15
 
16
16
  task :setup_docker_env, [:target] => :load_target_config do |t, args|
17
- puts "Setting up '#{args.target}' target docker environment"
17
+ puts "Setting up '#{Rumination::Deploy.target}' target docker environment"
18
18
  ENV.update Rumination::Deploy.docker_env
19
19
  end
20
20
 
21
21
  task :load_target_config, [:target] do |t, args|
22
22
  args.with_defaults target: :development
23
23
  puts "Loading '#{args.target}' target config"
24
- begin
25
- load "./config/deploy/targets/#{args.target}.rb"
26
- rescue LoadError => e
27
- raise RuntimeError, e.message
28
- end
24
+ Rumination::Deploy.load_target_config args.target
29
25
  end
30
26
 
31
27
  namespace :bootstrap do
@@ -1,3 +1,3 @@
1
1
  module Rumination
2
- VERSION = "0.12.3"
2
+ VERSION = "0.12.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rumination
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.3
4
+ version: 0.12.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Baguinski
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-24 00:00:00.000000000 Z
11
+ date: 2017-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler