blertr 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/bin/blertr +16 -0
  2. data/lib/blertr/version.rb +1 -1
  3. data/scripts/blertr +22 -3
  4. metadata +12 -12
data/bin/blertr CHANGED
@@ -25,6 +25,8 @@ Commands:
25
25
 
26
26
  uninstall Remove symlinks and other setup process
27
27
  Effectively uninstalling Blertr
28
+
29
+ upgrade Updates current copy of blertr to latest version
28
30
 
29
31
  info Pass in a notifier name to get the
30
32
  information it is using to send notifications
@@ -74,6 +76,20 @@ def take_action action, parameters
74
76
  else
75
77
  puts "ERROR: it doesn't look like Blertr is installed"
76
78
  end
79
+ when "upgrade"
80
+ commands = ["gem install blertr", "blertr uninstall", "blertr install"]
81
+ puts "Right now the upgrade process is very basic. Blertr will run:"
82
+ commands.each {|c| puts "$ #{c}"}
83
+ puts "This assumes that blertr is installed using rvm and doesn't require"
84
+ puts " sudo access."
85
+ puts "That ok? (y/n)"
86
+ response = gets
87
+ if ["y","Y","yes","Yes","YES"].include?(response.chomp)
88
+ puts "Ok, running commands now."
89
+ commands.each {|c| system(c)}
90
+ else
91
+ puts "You're the boss, exiting now."
92
+ end
77
93
  when "info"
78
94
  raw_name = parameters.shift
79
95
  if Blertr::Control::is_notifier? raw_name
@@ -1,3 +1,3 @@
1
1
  module Blertr
2
- VERSION = "0.1.5".freeze
2
+ VERSION = "0.1.6".freeze
3
3
  end
data/scripts/blertr CHANGED
@@ -1,5 +1,21 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
+ # Quick notes to remember for bash scripting:
4
+ # Found Here: http://www.gnu.org/s/bash/manual/bash.txt
5
+ #
6
+ # -z STRING
7
+ # True if the length of STRING is zero
8
+ #
9
+ # -f FILE
10
+ # True if FILE exists and is a regular file
11
+ #
12
+ # ${PARAMETER:-WORD}
13
+ # If PARAMETER is unset or null, the expansion of WORD is substituted.
14
+ # Otherwise, the value of PARAMETER is substituted.
15
+ # So ${blertr_path:-} is substituting an empty WORD if the PARAMETER
16
+ # blertr_path is not found.
17
+ #
18
+
3
19
  export HOME="${HOME%%+(\/)}" # Remove trailing slashes if they exist on HOME
4
20
 
5
21
  if [[ -z "${blertr_path:-}" ]]
@@ -25,12 +41,17 @@ then
25
41
  blertr_path="${blertr_prefix}/blertr"
26
42
  fi
27
43
  fi
44
+
45
+ # this is where the blert_now.rb file lives
46
+ blertr_bin_path="${blertr_path}/scripts_bin"
28
47
 
48
+ # export so that we have access to them from
49
+ # the scripts/cli file
29
50
  export blertr_path="${blertr_path%%+(\/)}"
30
- true ${blertr_bin_path="$blertr_path/scripts_bin"}
31
51
  export blertr_bin_path="${blertr_bin_path%%+(\/)}"
32
52
  fi
33
53
 
54
+ # load the bash files that add hooks for executing commands
34
55
  if [[ -n "${blertr_path}" && -d "$blertr_path" ]]
35
56
  then
36
57
  true ${blertr_scripts_path:="$blertr_path/scripts"}
@@ -48,5 +69,3 @@ then
48
69
  done
49
70
  fi
50
71
 
51
-
52
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blertr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-07-22 00:00:00.000000000Z
12
+ date: 2011-07-26 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
- requirement: &2788470 !ruby/object:Gem::Requirement
16
+ requirement: &2735430 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *2788470
24
+ version_requirements: *2735430
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rdoc
27
- requirement: &2788200 !ruby/object:Gem::Requirement
27
+ requirement: &2735110 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '2.5'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2788200
35
+ version_requirements: *2735110
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &2787950 !ruby/object:Gem::Requirement
38
+ requirement: &2734800 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '2.3'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2787950
46
+ version_requirements: *2734800
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: simplecov
49
- requirement: &2787710 !ruby/object:Gem::Requirement
49
+ requirement: &2734520 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0.4'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2787710
57
+ version_requirements: *2734520
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: twitter
60
- requirement: &2787450 !ruby/object:Gem::Requirement
60
+ requirement: &2734230 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: 1.6.0
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *2787450
68
+ version_requirements: *2734230
69
69
  description: Automatic alerts for when bash scripts and commands complete
70
70
  email: vvv@gmail.com
71
71
  executables: