go_run 0.0.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9988225c09ce3743832a8caf4fdd6aee87159150
4
+ data.tar.gz: b9eff09dc56eeceb496ca0192728fcca5a9a9c10
5
+ SHA512:
6
+ metadata.gz: 153fd74b86a8a62f6ef7a0d111c44b98c837dc1b112541db278aaa3d52d3529f6f9b826fd323c2dca3ff061599558fc5f74c01e5d273771c43559fe0a46b4fab
7
+ data.tar.gz: f3baf4092391b8be45f7bfe3958e542b3e1ff47c1d405b6a3de9e712ad36c6e18d5e067ca71f69b88515931d759ba0f2d6a23c86aac3fbf1a09fa4f6b30ae6e2
data/bin/run ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative "../lib/go_run"
3
+
4
+ GoRun.new(ARGV)
@@ -0,0 +1,115 @@
1
+ require 'yaml'
2
+
3
+ class Parser
4
+ attr_reader :config
5
+
6
+ def initialize(config_file_path)
7
+ @config = {}
8
+ parse(YAML.load_file(config_file_path))
9
+ end
10
+
11
+ def parse(config)
12
+ if config.is_a? Hash
13
+ config.each { |target, lines|
14
+ initialise_target(target)
15
+ if lines.is_a? Array
16
+ lines.each { |line|
17
+ if line.is_a? String
18
+ parse_line(target, line)
19
+ else
20
+ raise "Configuration error: each line of a target should be a string"
21
+ end
22
+ }
23
+ else
24
+ raise "Configuration error: each target should be an array of strings"
25
+ end
26
+ }
27
+ else
28
+ raise "Configuration error: config is not a hash"
29
+ end
30
+ end
31
+
32
+ def parse_line(target, line)
33
+ match = /^(GROUP|SET|REQUIRE|CALL|RUN)(.*)/.match line
34
+ if not match.nil?
35
+ capture = match.captures[1].strip
36
+ case match.captures[0]
37
+ when 'GROUP'
38
+ add_group(target, capture)
39
+ when 'SET'
40
+ add_set(target, capture)
41
+ when 'REQUIRE'
42
+ add_require(target, capture)
43
+ when 'CALL'
44
+ add_call(target, capture)
45
+ when 'RUN'
46
+ add_run(target, capture)
47
+ end
48
+ else
49
+ raise "Configuration error: target lines should match /^(GROUP|SET|REQUIRE|CALL|RUN)/"
50
+ end
51
+ end
52
+
53
+ def add_group(target, groups)
54
+ initialise_action(target, "group")
55
+ @config[target]["group"] += groups.split(' ')
56
+ end
57
+
58
+ def add_set(target, capture)
59
+ initialise_action(target, "set")
60
+ @config[target]["set"] << parse_set(capture)
61
+ end
62
+
63
+ def add_require(target, capture)
64
+ initialise_action(target, "requires")
65
+ @config[target]["requires"] << parse_require(capture)
66
+ end
67
+
68
+ def add_call(target, call)
69
+ initialise_action(target, "call")
70
+ c = {"target" => call}
71
+ @config[target]["call"] << c
72
+ end
73
+
74
+ def add_run(target, command)
75
+ initialise_action(target, "commands")
76
+ @config[target]["commands"] << command
77
+ end
78
+
79
+ def parse_set(set)
80
+ match = /^([a-zA-Z][a-zA-Z0-9_]*) (.*)$/.match set
81
+ if not match.nil?
82
+ s = {"key" => match.captures[0], "value" => match.captures[1]}
83
+ else
84
+ raise "Configuration error: SET syntax is 'SET KEY value'"
85
+ end
86
+ return s
87
+ end
88
+
89
+ def parse_require(requirement)
90
+ match = /^([a-zA-Z][a-zA-Z0-9_]*)$/.match requirement
91
+ if not match.nil?
92
+ r = {"key" => match.captures[0]}
93
+ else
94
+ match = /^([a-zA-Z][a-zA-Z0-9_]*) default (.*)$/.match requirement
95
+ if not match.nil?
96
+ r = {"key" => match.captures[0], "default" => match.captures[1]}
97
+ else
98
+ raise "Configuration error: REQUIRE syntax is 'REQUIRE KEY' or 'REQUIRE KEY default value'"
99
+ end
100
+ end
101
+ return r
102
+ end
103
+
104
+ def initialise_target(target)
105
+ if not @config.has_key? target
106
+ @config[target] = {}
107
+ end
108
+ end
109
+
110
+ def initialise_action(target, action)
111
+ if not @config[target].has_key? action
112
+ @config[target][action] = []
113
+ end
114
+ end
115
+ end
@@ -0,0 +1,80 @@
1
+ class Runner
2
+ attr_reader :commands
3
+
4
+ def initialize(config)
5
+ @config = config
6
+ @commands = []
7
+ @output = ""
8
+ end
9
+
10
+ def run(targets)
11
+ targets.each do |target|
12
+ run_target(target)
13
+ end
14
+ @output
15
+ end
16
+
17
+ def run_target(target)
18
+ raise "Target '#{target}' not found in configuration" if not @config.has_key? target
19
+ if @config[target].has_key? "group"
20
+ @config[target]["group"].each do |group|
21
+ run_target(group)
22
+ end
23
+ end
24
+ if @config[target].has_key? "set"
25
+ @config[target]["set"].each do |env_var|
26
+ ENV[env_var["key"]] = env_var["value"]
27
+ end
28
+ end
29
+ if @config[target].has_key? "requires"
30
+ @config[target]["requires"].each do |requirement|
31
+ if not requirement_fulfilled?(requirement)
32
+ @output << "Failed to fulfill requirements for target '#{target}'\n"
33
+ return
34
+ end
35
+ end
36
+ end
37
+ if @config[target].has_key? "call"
38
+ @config[target]["call"].each do |call|
39
+ run_target(call["target"])
40
+ end
41
+ end
42
+ if @config[target].has_key? "commands"
43
+ @config[target]["commands"].each do |command|
44
+ if run_command(command) != 0
45
+ @output << "Failed to run command '#{command}'\n"
46
+ return
47
+ end
48
+ end
49
+ end
50
+ end
51
+
52
+ def run_command(command)
53
+ system(command)
54
+ @commands << {
55
+ "command" => command,
56
+ "exit_code" => $?.exitstatus
57
+ }
58
+ $?.exitstatus
59
+ end
60
+
61
+ def requirement_fulfilled?(requirement)
62
+ if ENV.has_key? requirement["key"]
63
+ return true
64
+ elsif requirement.has_key? "default"
65
+ ENV[requirement["key"]] = requirement["default"]
66
+ return true
67
+ else
68
+ @output << "Environment variable #{requirement["key"]} not set\n"
69
+ end
70
+ return false
71
+ end
72
+
73
+ def exit_status
74
+ non_zero_exit_status = @commands.find { |c| c["exit_code"] != 0 }
75
+ if non_zero_exit_status.nil?
76
+ return 0
77
+ end
78
+ return non_zero_exit_status["exit_code"]
79
+ end
80
+ end
data/lib/go_run.rb ADDED
@@ -0,0 +1,57 @@
1
+ require_relative "go_run/parser"
2
+ require_relative "go_run/runner"
3
+ require 'optparse'
4
+ require 'ostruct'
5
+
6
+ class GoRun
7
+ def initialize(args)
8
+ @options = parse_args(args)
9
+ validate_runfile
10
+ validate_args
11
+ run
12
+ end
13
+
14
+ def parse_args(args)
15
+ options = OpenStruct.new
16
+ options.runfile = File.expand_path("./Runfile.yml", `pwd`.strip)
17
+ opt_parser = OptionParser.new do |opts|
18
+ opts.on("-r", "--runfile RUNFILE_PATH",
19
+ "Set the location of the Runfile") do |runfile|
20
+ options.runfile = runfile
21
+ end
22
+ end
23
+ opt_parser.parse!(args)
24
+ options
25
+ end
26
+
27
+ def validate_runfile
28
+ if not runfile_exists?
29
+ puts "Runfile not found: #{@options.runfile}"
30
+ exit 1
31
+ end
32
+ end
33
+
34
+ def runfile_exists?
35
+ File.file? @options.runfile
36
+ end
37
+
38
+ def validate_args
39
+ if ARGV.length == 0
40
+ print_usage
41
+ exit 1
42
+ end
43
+ end
44
+
45
+ def print_usage
46
+ puts "You must choose at least one target"
47
+ puts
48
+ puts "Example usage:"
49
+ puts "#{$0} <target> [targets]..."
50
+ end
51
+
52
+ def run
53
+ runner = Runner.new(Parser.new(@options.runfile).config)
54
+ runner.run(ARGV)
55
+ exit runner.exit_status
56
+ end
57
+ end
@@ -0,0 +1,2 @@
1
+ ---
2
+ - RUN ./some-script.sh
@@ -0,0 +1,5 @@
1
+ ---
2
+ some-other-target:
3
+ - RUN ./script.sh
4
+ dev:
5
+ - CALL some-other-target
@@ -0,0 +1,4 @@
1
+ ---
2
+ deploy:
3
+ - RUN echo "deploying..."
4
+ - RUN date
@@ -0,0 +1,4 @@
1
+ ---
2
+ dev:
3
+ - REQUIRE ENVIRONMENT
4
+ - REQUIRE REGION default eu-west-1
@@ -0,0 +1,9 @@
1
+ ---
2
+ dev:
3
+ - REQUIRE ENVIRONMENT
4
+
5
+ deploy:
6
+ - RUN ./deploy.sh
7
+
8
+ dev-deploy:
9
+ - GROUP dev deploy
@@ -0,0 +1,3 @@
1
+ ---
2
+ dev:
3
+ - SET ENVIRONMENT dev
@@ -0,0 +1,3 @@
1
+ ---
2
+ dev:
3
+ - run script.sh
@@ -0,0 +1,3 @@
1
+ ---
2
+ dev:
3
+ - run: ./script.sh
@@ -0,0 +1,2 @@
1
+ ---
2
+ dev: ./run-script.sh
@@ -0,0 +1,6 @@
1
+ ---
2
+ dev:
3
+ - SET AWS_DEFAULT_REGION eu-west-1
4
+
5
+ deploy:
6
+ - RUN echo $AWS_DEFAULT_REGION; exit 1
@@ -0,0 +1,6 @@
1
+ ---
2
+ dev:
3
+ - SET AWS_DEFAULT_REGION eu-west-1
4
+
5
+ deploy:
6
+ - RUN echo $AWS_DEFAULT_REGION
@@ -0,0 +1,44 @@
1
+ require 'go_run'
2
+ require 'open3'
3
+
4
+ describe GoRun do
5
+ before(:each) do
6
+ @binary = File.expand_path("../../bin/run", __FILE__)
7
+
8
+ # Make sure no local Runfiles interfere with tests
9
+ pwd_runfile = File.expand_path("./Runfile.yml", `pwd`.strip)
10
+ expect(File.file? pwd_runfile).to be(false)
11
+ end
12
+
13
+ context "when no Runfile is provided" do
14
+ it "should print an error" do
15
+ stdout, status = Open3.capture2(@binary)
16
+ expect(stdout).to include("Runfile not found")
17
+ end
18
+ end
19
+
20
+ context "when no arguments are provided" do
21
+ it "should print an error" do
22
+ runfile_path = File.expand_path("spec/fixtures/runfiles/Runfile.yml")
23
+ stdout, status = Open3.capture2(@binary, "-r", runfile_path)
24
+ expect(stdout).to include("You must choose at least one target")
25
+ end
26
+ end
27
+
28
+ context "when arguments are provided" do
29
+ it "should run the targets" do
30
+ runfile_path = File.expand_path("spec/fixtures/runfiles/Runfile.yml")
31
+ stdout, status = Open3.capture2(@binary, "-r", runfile_path, "dev", "deploy")
32
+ expect(stdout).to include("eu-west-1")
33
+ end
34
+ end
35
+
36
+ context "when the targeted commands fail" do
37
+ it "should exit with a non-zero code" do
38
+ runfile_path = File.expand_path("spec/fixtures/runfiles/Runfile-with-failures.yml")
39
+ stdout, status = Open3.capture2(@binary, "-r", runfile_path, "dev", "deploy")
40
+ expect(stdout).to include("eu-west-1")
41
+ expect(status.exitstatus).to be(1)
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,73 @@
1
+ require 'go_run/parser'
2
+
3
+ describe Parser do
4
+ it "should raise an error if it is not a hash" do
5
+ file_path = File.expand_path("../../spec/fixtures/parser/array.yml", __FILE__)
6
+ expect{Parser.new(file_path)}.to raise_error(RuntimeError, "Configuration error: config is not a hash")
7
+ end
8
+
9
+ it "should raise an error if a target is not an array" do
10
+ file_path = File.expand_path("../../spec/fixtures/parser/target-not-an-array.yml", __FILE__)
11
+ expect{Parser.new(file_path)}.to raise_error(RuntimeError, "Configuration error: each target should be an array of strings")
12
+ end
13
+
14
+ it "should raise an error if a target is not an array of strings" do
15
+ file_path = File.expand_path("../../spec/fixtures/parser/target-not-an-array-of-strings.yml", __FILE__)
16
+ expect{Parser.new(file_path)}.to raise_error(RuntimeError, "Configuration error: each line of a target should be a string")
17
+ end
18
+
19
+ it "should raise an error if a target line does not start with a keyword" do
20
+ file_path = File.expand_path("../../spec/fixtures/parser/target-line-invalid.yml", __FILE__)
21
+ expect{Parser.new(file_path)}.to raise_error(RuntimeError, "Configuration error: target lines should match /^(GROUP|SET|REQUIRE|CALL|RUN)/")
22
+ end
23
+
24
+ it "should build an array of commands" do
25
+ file_path = File.expand_path("../../spec/fixtures/parser/commands.yml", __FILE__)
26
+ config = Parser.new(file_path).config
27
+ expect(config["deploy"].has_key? "commands").to be(true)
28
+
29
+ commands = config["deploy"]["commands"]
30
+ expect(commands.length).to be(2)
31
+ expect(commands[0]).to eq('echo "deploying..."')
32
+ expect(commands[1]).to eq('date')
33
+ end
34
+
35
+ it "should build an array of required env vars and their defaults" do
36
+ file_path = File.expand_path("../../spec/fixtures/parser/env-vars.yml", __FILE__)
37
+ config = Parser.new(file_path).config
38
+ expect(config["dev"].has_key? "requires").to be(true)
39
+ expect(config["dev"]["requires"].length).to be(2)
40
+ expect(config["dev"]["requires"][0].has_key? "key").to be(true)
41
+ expect(config["dev"]["requires"][1].has_key? "default").to be(true)
42
+ expect(config["dev"]["requires"][1]["default"]).to eq('eu-west-1')
43
+ end
44
+
45
+ it "should build an array of env var key-value pairs to set" do
46
+ file_path = File.expand_path("../../spec/fixtures/parser/set-env-vars.yml", __FILE__)
47
+ config = Parser.new(file_path).config
48
+ expect(config["dev"].has_key? "set").to be(true)
49
+ expect(config["dev"]["set"].length).to be(1)
50
+ expect(config["dev"]["set"][0].has_key? "key").to be(true)
51
+ expect(config["dev"]["set"][0].has_key? "value").to be(true)
52
+ expect(config["dev"]["set"][0]["key"]).to eq('ENVIRONMENT')
53
+ expect(config["dev"]["set"][0]["value"]).to eq('dev')
54
+ end
55
+
56
+ it "should build an array of calls to other targets" do
57
+ file_path = File.expand_path("../../spec/fixtures/parser/calls.yml", __FILE__)
58
+ config = Parser.new(file_path).config
59
+ expect(config["dev"].has_key? "call").to be(true)
60
+ expect(config["dev"]["call"].length).to be(1)
61
+ expect(config["dev"]["call"][0].has_key? "target").to be(true)
62
+ expect(config["dev"]["call"][0]["target"]).to eq('some-other-target')
63
+ end
64
+
65
+ it "should build a group of other targets to call" do
66
+ file_path = File.expand_path("../../spec/fixtures/parser/group.yml", __FILE__)
67
+ config = Parser.new(file_path).config
68
+ expect(config["dev-deploy"].has_key? "group").to be(true)
69
+ expect(config["dev-deploy"]["group"].length).to be(2)
70
+ expect(config["dev-deploy"]["group"][0]).to eq('dev')
71
+ expect(config["dev-deploy"]["group"][1]).to eq('deploy')
72
+ end
73
+ end
@@ -0,0 +1,113 @@
1
+ require 'go_run/runner'
2
+ require 'climate_control'
3
+
4
+ describe Runner do
5
+ it "runs all commands and records their exit code" do
6
+ config = {
7
+ "some_commands" => { "commands" => ["echo 'command 1'", "echo 'command 2'"] }
8
+ }
9
+ @runner = Runner.new(config)
10
+ @runner.run(["some_commands"])
11
+ expect(@runner.commands.length).to be(2)
12
+ expect(@runner.commands[0]["exit_code"]).to be(0)
13
+ expect(@runner.commands[1]["exit_code"]).to be(0)
14
+ end
15
+
16
+ it "stops running commands when a command fails" do
17
+ config = {
18
+ "some_commands" => { "commands" => ["echo 'command 1'", "echo 'command 2'; exit 1", "echo 'command 3'"] }
19
+ }
20
+ @runner = Runner.new(config)
21
+ output = @runner.run(["some_commands"])
22
+ expect(@runner.commands.length).to be(2)
23
+ expect(@runner.commands[0]["exit_code"]).to be(0)
24
+ expect(@runner.commands[1]["exit_code"]).to be(1)
25
+ expect(output).to include("Failed to run command 'echo 'command 2'; exit 1'")
26
+ end
27
+
28
+ it "does not run commands if required environment variables are not set" do
29
+ config = {
30
+ "deploy" => {
31
+ "requires" => [{"key" => "ENVIRONMENT"}],
32
+ "commands" => ['echo "deploying $ENVIRONMENT"']
33
+ }
34
+ }
35
+ @runner = Runner.new(config)
36
+ ClimateControl.modify ENVIRONMENT: nil do
37
+ output = @runner.run(["deploy"])
38
+ expect(@runner.commands.length).to be(0)
39
+ expect(output).to include("Environment variable ENVIRONMENT not set")
40
+ end
41
+ end
42
+
43
+ it "can set environment variables to a default value" do
44
+ config = {
45
+ "deploy" => {
46
+ "requires" => [{"key" => "ENVIRONMENT", "default" => "some value"}],
47
+ "commands" => ['echo "deploying $ENVIRONMENT"']
48
+ }
49
+ }
50
+ @runner = Runner.new(config)
51
+ ClimateControl.modify ENVIRONMENT: nil do
52
+ output = @runner.run(["deploy"])
53
+ expect(@runner.commands.length).to be(1)
54
+ expect(ENV['ENVIRONMENT']).to eq("some value")
55
+ end
56
+ end
57
+
58
+ it "can set environment variables" do
59
+ config = {
60
+ "deploy" => {
61
+ "set" => [{"key" => "ENVIRONMENT", "value" => "dev"}],
62
+ "commands" => ['echo "deploying $ENVIRONMENT"']
63
+ }
64
+ }
65
+ @runner = Runner.new(config)
66
+ ClimateControl.modify ENVIRONMENT: nil do
67
+ output = @runner.run(["deploy"])
68
+ expect(@runner.commands.length).to be(1)
69
+ expect(ENV['ENVIRONMENT']).to eq("dev")
70
+ end
71
+ end
72
+
73
+ it "can call other targets" do
74
+ config = {
75
+ "dev" => {
76
+ "set" => [{"key" => "ENVIRONMENT", "value" => "dev"}]
77
+ },
78
+ "deploy" => {
79
+ "call" => [{"target" => "dev"}],
80
+ "commands" => ['echo "deploying $ENVIRONMENT"']
81
+ }
82
+ }
83
+ @runner = Runner.new(config)
84
+ ClimateControl.modify [ENVIRONMENT: nil] do
85
+ output = @runner.run(["deploy"])
86
+ expect(ENV['ENVIRONMENT']).to eq("dev")
87
+ expect(@runner.commands.length).to be(1)
88
+ expect(@runner.commands[0]["exit_code"]).to be(0)
89
+ end
90
+ end
91
+
92
+ it "can run groups of targets" do
93
+ config = {
94
+ "dev" => {
95
+ "set" => [{"key" => "ENVIRONMENT", "value" => "dev"}]
96
+ },
97
+ "deploy" => {
98
+ "call" => [{"target" => "dev"}],
99
+ "commands" => ['echo "deploying $ENVIRONMENT"']
100
+ },
101
+ "dev-deploy" => {
102
+ "group" => ["dev", "deploy"]
103
+ }
104
+ }
105
+ @runner = Runner.new(config)
106
+ ClimateControl.modify [ENVIRONMENT: nil] do
107
+ output = @runner.run(["dev-deploy"])
108
+ expect(ENV['ENVIRONMENT']).to eq("dev")
109
+ expect(@runner.commands.length).to be(1)
110
+ expect(@runner.commands[0]["exit_code"]).to be(0)
111
+ end
112
+ end
113
+ end
@@ -0,0 +1,103 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
4
+ # this file to always be loaded, without a need to explicitly require it in any
5
+ # files.
6
+ #
7
+ # Given that it is always loaded, you are encouraged to keep this file as
8
+ # light-weight as possible. Requiring heavyweight dependencies from this file
9
+ # will add to the boot time of your test suite on EVERY test run, even for an
10
+ # individual file that may not need all of that loaded. Instead, consider making
11
+ # a separate helper file that requires the additional dependencies and performs
12
+ # the additional setup, and require it from the spec files that actually need
13
+ # it.
14
+ #
15
+ # The `.rspec` file also contains a few flags that are not defaults but that
16
+ # users commonly want.
17
+ #
18
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
19
+ RSpec.configure do |config|
20
+ # rspec-expectations config goes here. You can use an alternate
21
+ # assertion/expectation library such as wrong or the stdlib/minitest
22
+ # assertions if you prefer.
23
+ config.expect_with :rspec do |expectations|
24
+ # This option will default to `true` in RSpec 4. It makes the `description`
25
+ # and `failure_message` of custom matchers include text for helper methods
26
+ # defined using `chain`, e.g.:
27
+ # be_bigger_than(2).and_smaller_than(4).description
28
+ # # => "be bigger than 2 and smaller than 4"
29
+ # ...rather than:
30
+ # # => "be bigger than 2"
31
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
32
+ end
33
+
34
+ # rspec-mocks config goes here. You can use an alternate test double
35
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
36
+ config.mock_with :rspec do |mocks|
37
+ # Prevents you from mocking or stubbing a method that does not exist on
38
+ # a real object. This is generally recommended, and will default to
39
+ # `true` in RSpec 4.
40
+ mocks.verify_partial_doubles = true
41
+ end
42
+
43
+ # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
44
+ # have no way to turn it off -- the option exists only for backwards
45
+ # compatibility in RSpec 3). It causes shared context metadata to be
46
+ # inherited by the metadata hash of host groups and examples, rather than
47
+ # triggering implicit auto-inclusion in groups with matching metadata.
48
+ config.shared_context_metadata_behavior = :apply_to_host_groups
49
+
50
+ # The settings below are suggested to provide a good initial experience
51
+ # with RSpec, but feel free to customize to your heart's content.
52
+ =begin
53
+ # This allows you to limit a spec run to individual examples or groups
54
+ # you care about by tagging them with `:focus` metadata. When nothing
55
+ # is tagged with `:focus`, all examples get run. RSpec also provides
56
+ # aliases for `it`, `describe`, and `context` that include `:focus`
57
+ # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
58
+ config.filter_run_when_matching :focus
59
+
60
+ # Allows RSpec to persist some state between runs in order to support
61
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
62
+ # you configure your source control system to ignore this file.
63
+ config.example_status_persistence_file_path = "spec/examples.txt"
64
+
65
+ # Limits the available syntax to the non-monkey patched syntax that is
66
+ # recommended. For more details, see:
67
+ # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
68
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
69
+ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
70
+ config.disable_monkey_patching!
71
+
72
+ # This setting enables warnings. It's recommended, but in some cases may
73
+ # be too noisy due to issues in dependencies.
74
+ config.warnings = true
75
+
76
+ # Many RSpec users commonly either run the entire suite or an individual
77
+ # file, and it's useful to allow more verbose output when running an
78
+ # individual spec file.
79
+ if config.files_to_run.one?
80
+ # Use the documentation formatter for detailed output,
81
+ # unless a formatter has already been configured
82
+ # (e.g. via a command-line flag).
83
+ config.default_formatter = 'doc'
84
+ end
85
+
86
+ # Print the 10 slowest examples and example groups at the
87
+ # end of the spec run, to help surface which specs are running
88
+ # particularly slow.
89
+ config.profile_examples = 10
90
+
91
+ # Run specs in random order to surface order dependencies. If you find an
92
+ # order dependency and want to debug it, you can fix the order by providing
93
+ # the seed, which is printed after each run.
94
+ # --seed 1234
95
+ config.order = :random
96
+
97
+ # Seed global randomization in this process using the `--seed` CLI option.
98
+ # Setting this allows you to use `--seed` to deterministically reproduce
99
+ # test failures related to randomization by passing the same `--seed` value
100
+ # as the one that triggered the failure.
101
+ Kernel.srand config.seed
102
+ =end
103
+ end
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: go_run
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Henry Knott
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-03-29 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: |
14
+ GoRun aims to provide a way of configuring commands, scripts, and environment
15
+ variables for systems administration. Many people use the C compile tool `make`
16
+ to create hierachical targets which set environment variables and run certain
17
+ scripts, but without actually using it to compile anything. GoRun is designed
18
+ specifically for that purpose, with a flexible way of defining your configuration
19
+ in 'Runfiles', which is analogous to the 'Makefiles' used by `make`.
20
+ email: henrytknott@gmail.com
21
+ executables:
22
+ - run
23
+ extensions: []
24
+ extra_rdoc_files: []
25
+ files:
26
+ - bin/run
27
+ - lib/go_run.rb
28
+ - lib/go_run/parser.rb
29
+ - lib/go_run/runner.rb
30
+ - spec/fixtures/parser/array.yml
31
+ - spec/fixtures/parser/calls.yml
32
+ - spec/fixtures/parser/commands.yml
33
+ - spec/fixtures/parser/env-vars.yml
34
+ - spec/fixtures/parser/group.yml
35
+ - spec/fixtures/parser/set-env-vars.yml
36
+ - spec/fixtures/parser/target-line-invalid.yml
37
+ - spec/fixtures/parser/target-not-an-array-of-strings.yml
38
+ - spec/fixtures/parser/target-not-an-array.yml
39
+ - spec/fixtures/runfiles/Runfile-with-failures.yml
40
+ - spec/fixtures/runfiles/Runfile.yml
41
+ - spec/go_run_spec.rb
42
+ - spec/parser_spec.rb
43
+ - spec/runner_spec.rb
44
+ - spec/spec_helper.rb
45
+ homepage: https://github.com/henrytk/go_run
46
+ licenses:
47
+ - MIT
48
+ metadata: {}
49
+ post_install_message:
50
+ rdoc_options: []
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ requirements: []
64
+ rubyforge_project:
65
+ rubygems_version: 2.5.1
66
+ signing_key:
67
+ specification_version: 4
68
+ summary: A way of not using `make` for running scripts
69
+ test_files: []