flash 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- flash (0.0.1)
4
+ flash (0.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -2,4 +2,39 @@
2
2
 
3
3
  Flash helps you run arbitrary or predefined commands on multiple projects all defined in the Runfile.
4
4
 
5
+ # Installation
6
+
7
+ ```bash
8
+ > gem install flash
9
+ ```
10
+
11
+ The command available is run:
12
+
13
+ ```bash
14
+ > run
15
+ Group name is missing.
16
+ Usage: run [options] group
17
+ -c, --command command Commands to run (semicolon separated)
18
+ -d, --debug Debug: print each command result
19
+ -r, --recipe recipe Run registered recipe if present
20
+ -l, --list-recipes List registered recipes
21
+ -h, --help Help documentation
22
+ ```
23
+
24
+ # Example
25
+
26
+ ```bash
27
+ > cd example
28
+ > run -c ls projects
29
+ salsa> ls
30
+ cubana
31
+
32
+ dancing> ls
33
+ bouncing
34
+
35
+ school> ls
36
+ fun
37
+
38
+ ```
39
+
5
40
  TODO: write detailed description
data/bin/run CHANGED
@@ -32,13 +32,13 @@ optparse = OptionParser.new do |opts|
32
32
  opts
33
33
  end
34
34
 
35
+ optparse.parse!
36
+
35
37
  if ARGV.empty?
36
38
  puts "Group name is missing."
37
39
  puts optparse ; exit
38
40
  end
39
41
 
40
- optparse.parse!
41
-
42
42
  group = ARGV[0]
43
43
 
44
44
  Flash::Runner.new(options, group).start
@@ -1,16 +1,18 @@
1
1
  require 'flash'
2
+ require 'yaml'
2
3
 
3
4
  class Flash::Runfile
4
5
 
5
6
  def initialize(filename=nil)
6
7
  load(filename) if filename
8
+ @groups = []
7
9
  end
8
10
 
9
- def [](name)
10
- @groups[name]
11
+ def [](name=nil)
12
+ @groups[name] if name
11
13
  end
12
14
 
13
15
  def load(filename)
14
- @groups = YAML.load_file(filename)
16
+ @groups = YAML.load_file(filename) if File.exists?(filename)
15
17
  end
16
18
  end
@@ -6,6 +6,8 @@ class Flash::Runner
6
6
  attr_accessor :debug, :color, :dir_name, :group
7
7
 
8
8
  def initialize(options = {}, group)
9
+ raise "Missing required group parameter." unless group
10
+
9
11
  @options = options
10
12
  @group = Flash::Runfile.new('Runfile')[group]
11
13
  end
@@ -1,3 +1,3 @@
1
1
  module Flash
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-02 00:00:00.000000000 Z
12
+ date: 2014-01-03 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Flash helps you run commands on multiple projects all defined in the
15
15
  Runfile
@@ -51,7 +51,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
51
51
  version: '0'
52
52
  segments:
53
53
  - 0
54
- hash: 217996443338893832
54
+ hash: 1202582725409049747
55
55
  required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  none: false
57
57
  requirements:
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  version: '0'
61
61
  segments:
62
62
  - 0
63
- hash: 217996443338893832
63
+ hash: 1202582725409049747
64
64
  requirements: []
65
65
  rubyforge_project: flash
66
66
  rubygems_version: 1.8.25