wrkflo 0.0.3 → 0.0.4a

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: 1c9902676f57eb67e87861f6cb79acbc4a1f7472
4
- data.tar.gz: f4c48b3d64d32b15256e1ae78f482ac4c9bffdf0
3
+ metadata.gz: 20780e9f020e5d2e3e67af27c189a988301867ee
4
+ data.tar.gz: ce5506056ec52d1eb433b01f0ff5fc2ef6d2adf8
5
5
  SHA512:
6
- metadata.gz: 11ad90a2ac574ca8e9cebc40436b52802ccc7fdb43b66dbe9ae38cd5aff50742717f05ad5efb9c4c0d31c4da7edc3bed044ab414e7fe6942786a23822d7a7793
7
- data.tar.gz: 014f69b04bdc6e01e240639c94de6397420f5eb21e2aef7b4023c0f1d88cfcbe579a74b9c5844a60a926dbddcb47dd8016d79bf09f0016c8b4b5154e995db6c5
6
+ metadata.gz: 2c09fbdcf4a484b091ac652062dca6569f2c8819d8a195688b31b125de10e10ee823c19df343e7bb48144978acae1d6317d674db5e1ad946f2a2c45c9059718e
7
+ data.tar.gz: de161a3b81f127d7e3ba4e341ad886e714f3c7075858d40bf22a6ebdc805e495767faccd91d5ce41a50f5f170190ad6be91c96340a2359d3693a7eb8b7fe8a95
data/bin/wrkflo CHANGED
@@ -1,4 +1,4 @@
1
- #! /usr/bin/env ruby
1
+ #!/usr/bin/env ruby
2
2
 
3
3
  require 'optparse'
4
4
  require 'pp'
@@ -6,13 +6,22 @@ require 'yaml'
6
6
 
7
7
  require 'wrkflo/wrkflo'
8
8
 
9
+
10
+ # Abort execution with the given message, exiting with the given status code.
11
+ def error_out message, status: 1
12
+ $stderr.puts message
13
+ $stderr.puts "run `wrkflo --help` for usage information"
14
+ exit status
15
+ end
16
+
17
+
9
18
  options = {
10
19
  backward: false,
11
20
  profile: ENV['HOME'] + '/.wrkflorc',
12
21
  project: nil
13
22
  }
14
23
  OptionParser.new do |opts|
15
- opts.banner = "Usage: workon [options] <project>"
24
+ opts.banner = "Usage: wrkflo [options] <project>"
16
25
  opts.separator "Start working on things faster with predefined workflows"
17
26
  opts.version = "0.0.2"
18
27
 
@@ -33,25 +42,26 @@ OptionParser.new do |opts|
33
42
  # Without this rescue, Ruby would print the stack trace
34
43
  # of the error. Instead, we want to show the error message,
35
44
  # suggest -h or --help, and exit 1.
36
- $stderr.puts error
37
- $stderr.puts "(-h or --help will show valid options)"
38
- exit 1
45
+ error_out(error)
39
46
  end
40
47
  end
41
48
 
42
- # An object representation of the entire workon profile, merged with
49
+
50
+ project_name = ARGV[0]
51
+ error_out('No project specified.') if project_name.nil?
52
+
53
+ # An object representation of the entire wrkflo profile, merged with
43
54
  # the options given for this run.
44
- workon = WorkOn.new options
55
+ wrkflo = WrkFlo.new(options)
45
56
  # The project workflow to execute on this run.
46
- project = workon[ARGV[0]]
57
+ project = wrkflo[project_name]
47
58
  # If no project was specified, notify and exit
48
59
  if project == nil
49
- puts "No project specified. Nothing to do."
50
- exit 1
60
+ error_out("Project '#{project_name}' does not exist in '#{wrkflo.profile_source}'.")
51
61
  end
52
62
 
53
63
  # Run the project workflow in the direction given from the terminal
54
- case workon.direction
64
+ case wrkflo.direction
55
65
  when :forward
56
66
  project.run
57
67
  when :backward
@@ -50,7 +50,7 @@ class Project
50
50
 
51
51
  # Post a message to the terminal with some identifying information
52
52
  def log message
53
- puts "> Step ##{@current_step_num} (#{@current_step.name}): #{message}"
53
+ puts " - Step ##{@current_step_num} (#{@current_step.name}): #{message}"
54
54
  end
55
55
 
56
56
 
@@ -58,6 +58,6 @@ class Project
58
58
  # Write a log message with a different prefix marker to visually
59
59
  # indicate a meta-type message
60
60
  def meta_log message
61
- puts "- #{message}"
61
+ puts ">> #{message}"
62
62
  end
63
63
  end
data/lib/wrkflo/wrkflo.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'wrkflo/project'
2
2
 
3
- class WorkOn
3
+ class WrkFlo
4
4
  attr_accessor :direction, :profile, :profile_source
5
5
 
6
6
  def initialize options
@@ -12,6 +12,8 @@ class WorkOn
12
12
  # Get a specific project out of the profile. If the profile does not define
13
13
  # the given project, return nil.
14
14
  def [] project
15
- Project.new(project, @profile[project])
15
+ if @profile.has_key?(project)
16
+ Project.new(project, @profile[project])
17
+ end
16
18
  end
17
19
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wrkflo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4a
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Egeland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-16 00:00:00.000000000 Z
11
+ date: 2017-02-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
- email: audiobahn404@gmail.com
14
+ email: jonegeland@gmail.com
15
15
  executables:
16
16
  - wrkflo
17
17
  extensions: []
@@ -24,7 +24,7 @@ files:
24
24
  - lib/wrkflo/steps/sshfs.rb
25
25
  - lib/wrkflo/steps/sublime.rb
26
26
  - lib/wrkflo/wrkflo.rb
27
- homepage: http://github.com/audiobahn404/wrkflo
27
+ homepage: http://github.com/faultyserver/wrkflo
28
28
  licenses:
29
29
  - MIT
30
30
  metadata: {}
@@ -39,12 +39,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
39
39
  version: 2.2.0
40
40
  required_rubygems_version: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - ">="
42
+ - - ">"
43
43
  - !ruby/object:Gem::Version
44
- version: '0'
44
+ version: 1.3.1
45
45
  requirements: []
46
46
  rubyforge_project:
47
- rubygems_version: 2.4.7
47
+ rubygems_version: 2.5.1
48
48
  signing_key:
49
49
  specification_version: 4
50
50
  summary: Get working on things faster with predefined wrkflos.