longbow 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -1
- data/lib/longbow/commands/shoot.rb +3 -2
- data/lib/longbow/json.rb +8 -0
- data/lib/longbow/version.rb +4 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58aff1ce7424750e94d76afd27407b47356aeeb2
|
4
|
+
data.tar.gz: 52af22408ae8b062d6baa1c75c92f45b6bbe5041
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac0a527a220e308dae41195ffa5cea3dd4deb9cd470f8af12371bd0b3ce22ef96f53386bcd0e2c0413cb0d5f724fe1a411e15b768bd731039432040fb68149ab
|
7
|
+
data.tar.gz: 806fda97413aaedefe1e3ee88065bfc1e7022006e7e7bd46b380c14ce69fce3d5c4468b8fce4611c9d8fe021028c17a3d3ea860bf6cc3a1a38424e225960e9c6
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -105,8 +105,9 @@ If you leave off the `-n` option, it will run for all targets in the `longbow.js
|
|
105
105
|
**Other Options**
|
106
106
|
|
107
107
|
* `-d, --directory` - if not in the current directory, specify a new path
|
108
|
+
* `-u, --url` - the url of a longbow formatted JSON file
|
108
109
|
|
109
|
-
`longbow shoot -n NameOfTarget -d ~/Path/To/App`
|
110
|
+
`longbow shoot -n NameOfTarget -d ~/Path/To/App -u http://someurl.com/longbow.json`
|
110
111
|
|
111
112
|
## Global Options
|
112
113
|
|
@@ -32,11 +32,12 @@ command :shoot do |c|
|
|
32
32
|
end
|
33
33
|
|
34
34
|
# Break if Bad
|
35
|
-
unless obj
|
36
|
-
Longbow::red "\n
|
35
|
+
unless obj || Longbow::lint_json_object(obj)
|
36
|
+
Longbow::red "\n Invalid JSON. Please lint the file, and try again.\n"
|
37
37
|
next
|
38
38
|
end
|
39
39
|
|
40
|
+
|
40
41
|
# Check for Target Name
|
41
42
|
if @target_name
|
42
43
|
obj['targets'].each do |t|
|
data/lib/longbow/json.rb
CHANGED
@@ -29,6 +29,7 @@ module Longbow
|
|
29
29
|
return json_object_from_string contents
|
30
30
|
end
|
31
31
|
|
32
|
+
|
32
33
|
def self.json_object_from_string contents
|
33
34
|
begin
|
34
35
|
!!JSON.parse(contents)
|
@@ -39,4 +40,11 @@ module Longbow
|
|
39
40
|
return JSON.parse(contents)
|
40
41
|
end
|
41
42
|
|
43
|
+
|
44
|
+
def self.lint_json_object obj
|
45
|
+
return false unless obj
|
46
|
+
return false unless obj['targets']
|
47
|
+
return true
|
48
|
+
end
|
49
|
+
|
42
50
|
end
|
data/lib/longbow/version.rb
CHANGED
@@ -2,13 +2,12 @@ $:.push File.expand_path('../', __FILE__)
|
|
2
2
|
require 'colors'
|
3
3
|
|
4
4
|
module Longbow
|
5
|
-
VERSION = '0.1.
|
5
|
+
VERSION = '0.1.2'
|
6
6
|
|
7
7
|
def self.check_for_newer_version
|
8
|
-
|
9
|
-
|
10
|
-
Longbow::purple " A newer version of longbow is available. Run 'gem update longbow'."
|
11
|
-
puts
|
8
|
+
v = Gem.latest_version_for 'longbow'
|
9
|
+
unless v == VERSION
|
10
|
+
Longbow::purple "\n A newer version of longbow is available. Run '[sudo] gem update longbow'."
|
12
11
|
end
|
13
12
|
end
|
14
13
|
end
|