automux 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/automux.gemspec CHANGED
@@ -1,18 +1,18 @@
1
1
  # -*- encoding: utf-8 -*-
2
-
3
2
  $:.push File.expand_path("../lib", __FILE__)
3
+ require 'automux/version'
4
4
 
5
5
  Gem::Specification.new do |gem|
6
- gem.name = "automux"
7
- gem.version = File.read('VERSION').strip.chomp
6
+ gem.name = 'automux'
7
+ gem.version = Automux::Version::STRING
8
8
  gem.authors = ["Alex Johnson"]
9
9
  gem.email = ["notalexjohnson@gmail.com"]
10
- gem.description = %[Automating Tmux Configuration]
11
- gem.summary = %[Automux can automate tmux sessions by reading configuration from yaml files]
12
- gem.homepage = "https://github.com/notalex/automux"
10
+ gem.description = %[Highly configurable Tmux Automator]
11
+ gem.summary = %[Automate tmux sessions stored in yaml files using custom recipes]
12
+ gem.homepage = %[https://github.com/notalex/automux]
13
13
 
14
- gem.files = `git ls-files`.split($/)
15
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
14
+ gem.files = %x[git ls-files].split($/)
15
+ gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
16
16
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
17
- gem.require_paths = ["lib"]
17
+ gem.require_paths = %w(lib)
18
18
  end
data/bin/automux CHANGED
@@ -11,7 +11,7 @@ case args[0]
11
11
  when 'setup'
12
12
  Automux::Controller::Setup.new.clone_defaults
13
13
  when 'blueprint'
14
- params = { name: args[2], clone_name: args[3] }
14
+ params = { blueprint_name: args[2], clone_name: args[3] }
15
15
  Automux::Controller::Blueprints.new(params).send(args[1])
16
16
  else
17
17
  params = {
@@ -4,5 +4,33 @@ Feature: Handling various errors with relevant messages
4
4
  When I invoke Automux with the blueprint "test_sample"
5
5
  Then the rendered sequence of shell commands should contain
6
6
  """
7
- echo No matching blueprint found
7
+ echo Unable to find blueprint named test_sample.yml
8
+ """
9
+
10
+ Scenario: Trying to use a non existing recipe
11
+ When I invoke Automux with the recipe "unknown" and the blueprint "default"
12
+ Then the rendered sequence of shell commands should contain
13
+ """
14
+ echo Unable to find recipe named unknown.sh.erb
15
+ """
16
+
17
+ Scenario: Trying to edit a non existing blueprint
18
+ When I invoke Automux to "edit" the blueprint "test_sample"
19
+ Then the rendered sequence of shell commands should contain
20
+ """
21
+ echo Unable to find blueprint named test_sample.yml
22
+ """
23
+
24
+ Scenario: Trying to edit a non existing blueprint
25
+ When I invoke Automux to "edit" the blueprint "test_sample"
26
+ Then the rendered sequence of shell commands should contain
27
+ """
28
+ echo Unable to find blueprint named test_sample.yml
29
+ """
30
+
31
+ Scenario: Trying to remove a non existing blueprint
32
+ When I invoke Automux to "rm" the blueprint "test_sample"
33
+ Then the rendered sequence of shell commands should contain
34
+ """
35
+ echo Unable to find blueprint named test_sample.yml
8
36
  """
data/lib/automux.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'automux/version'
1
2
  require 'automux/paths'
2
3
  require 'automux/library'
3
4
  require 'automux/core'
@@ -13,6 +13,10 @@ module Automux
13
13
  def notify_error(message)
14
14
  Automux::Controller::Messages.new(message: message).error
15
15
  end
16
+
17
+ def check_blueprint
18
+ notify_error "Unable to find blueprint named #{ params[:blueprint_name] }.yml" if @blueprint.nil?
19
+ end
16
20
  end
17
21
  end
18
22
  end
@@ -2,6 +2,7 @@ module Automux
2
2
  module Controller
3
3
  class Blueprints < Base
4
4
  before_filter :load_blueprint, only: [:edit, :copy, :cp, :delete, :rm]
5
+ before_filter :check_blueprint, only: [:edit, :copy, :cp, :delete, :rm]
5
6
 
6
7
  # blueprint_name.yml will be searched under $HOME/.automux/blueprints
7
8
  # $ automux blueprint edit blueprint_name
@@ -13,7 +14,7 @@ module Automux
13
14
  # This copies the content from default.yml and opens the new file using $EDITOR
14
15
  # $ automux blueprint create new_blueprint_name
15
16
  def create
16
- blueprint = Automux::Core::Blueprint.build_by_name(params[:name])
17
+ blueprint = Automux::Core::Blueprint.build_by_name(params[:blueprint_name])
17
18
  blueprint.source = Automux::Cache::Blueprint.find_by_name('default')
18
19
  @binding = blueprint.get_binding
19
20
  render 'create'
@@ -38,7 +39,7 @@ module Automux
38
39
  private ###
39
40
 
40
41
  def load_blueprint
41
- @blueprint = Automux::Cache::Blueprint.find_by_name(params[:name])
42
+ @blueprint = Automux::Cache::Blueprint.find_by_name(params[:blueprint_name])
42
43
  end
43
44
  end
44
45
  end
@@ -22,10 +22,6 @@ module Automux
22
22
  @blueprint = Automux::Cache::Blueprint.find_by_name(params[:blueprint_name])
23
23
  end
24
24
 
25
- def check_blueprint
26
- notify_error "Unable to find blueprint named #{ params[:blueprint_name] }.yml" if @blueprint.nil?
27
- end
28
-
29
25
  def check_recipe
30
26
  notify_error "Unable to find recipe named #{ params[:recipe_name] }.sh.erb" if @recipe.nil?
31
27
  end
@@ -1,2 +1,3 @@
1
1
  require 'automux/initializers/custom_hooks'
2
2
  require 'automux/initializers/setup_caches'
3
+ require 'automux/initializers/setup_editor'
@@ -0,0 +1 @@
1
+ ENV['EDITOR'] ||= 'vim'
@@ -0,0 +1,5 @@
1
+ module Automux
2
+ module Version
3
+ STRING = '0.1.0'
4
+ end
5
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: automux
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2013-04-01 00:00:00.000000000 Z
13
13
  dependencies: []
14
- description: Automating Tmux Configuration
14
+ description: Highly configurable Tmux Automator
15
15
  email:
16
16
  - notalexjohnson@gmail.com
17
17
  executables:
@@ -23,7 +23,6 @@ files:
23
23
  - Gemfile
24
24
  - Gemfile.lock
25
25
  - LICENSE.txt
26
- - VERSION
27
26
  - automux.gemspec
28
27
  - bin/automux
29
28
  - data/automux/blueprints/default.yml
@@ -74,11 +73,12 @@ files:
74
73
  - lib/automux/initializers.rb
75
74
  - lib/automux/initializers/custom_hooks.rb
76
75
  - lib/automux/initializers/setup_caches.rb
76
+ - lib/automux/initializers/setup_editor.rb
77
77
  - lib/automux/library.rb
78
78
  - lib/automux/library/mini_erb.rb
79
79
  - lib/automux/library/yaml_parser.rb
80
80
  - lib/automux/paths.rb
81
- - lib/automux/setup.rb
81
+ - lib/automux/version.rb
82
82
  - lib/automux/views/blueprints/copy.sh.erb
83
83
  - lib/automux/views/blueprints/create.sh.erb
84
84
  - lib/automux/views/blueprints/edit.sh.erb
@@ -109,10 +109,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  requirements: []
111
111
  rubyforge_project:
112
- rubygems_version: 1.8.23
112
+ rubygems_version: 1.8.10
113
113
  signing_key:
114
114
  specification_version: 3
115
- summary: Automux can automate tmux sessions by reading configuration from yaml files
115
+ summary: Automate tmux sessions stored in yaml files using custom recipes
116
116
  test_files:
117
117
  - features/custom_recipes.feature
118
118
  - features/error_messages.feature
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.0.1
data/lib/automux/setup.rb DELETED
File without changes