startling 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/startling/cli_options.rb +5 -1
- data/lib/startling/command.rb +4 -4
- data/lib/startling/commands/base.rb +17 -11
- data/lib/startling/commands/check_for_local_mods.rb +1 -1
- data/lib/startling/commands/check_wip.rb +1 -1
- data/lib/startling/commands/create_branch.rb +1 -1
- data/lib/startling/commands/create_pull_request.rb +2 -2
- data/lib/startling/version.rb +1 -1
- data/spec/startling_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8ebd457be41e100906ba33b538480973d89730b
|
4
|
+
data.tar.gz: dfba30c257a91102ca69b3b75ec5b4a74aecc234
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26f56b3a79cd2fd4e2ef22bc61266b2cae468248e221a75b982a3bdb57ba7d12e3818eeb8448bad34dd5002efe9aa24613ba2073c6aba45584db1bd6896f32ee
|
7
|
+
data.tar.gz: 2b6378cc90dd4ad98a3af97af04ac3b2317cb831e3dbccb3ebc6ab041ca3fbc3354b2fd08b09c0b182cfc2938f6939509d3c5a38cfe61a4ffd2108c311e5662d
|
@@ -10,7 +10,7 @@ Example:
|
|
10
10
|
$ start 12345 my branch name
|
11
11
|
USE
|
12
12
|
def self.parse
|
13
|
-
options = {story_id: nil, branch_name: nil}
|
13
|
+
options = {story_id: nil, branch_name: nil, verbose: false}
|
14
14
|
parser = OptionParser.new do |opts|
|
15
15
|
opts.banner = USAGE
|
16
16
|
|
@@ -22,6 +22,10 @@ USE
|
|
22
22
|
options[:branch_name] = branch
|
23
23
|
end
|
24
24
|
|
25
|
+
opts.on('-v', '--verbose', 'Verbose logging') do
|
26
|
+
options[:verbose] = true
|
27
|
+
end
|
28
|
+
|
25
29
|
Startling.cli_options.each do |user_opt|
|
26
30
|
options.merge!(user_opt.sym => nil)
|
27
31
|
opts.on(user_opt.abbr_switch, user_opt.long_switch, user_opt.description) do |value|
|
data/lib/startling/command.rb
CHANGED
@@ -11,18 +11,18 @@ module Startling
|
|
11
11
|
RUN = "run"
|
12
12
|
|
13
13
|
def self.run(attrs={})
|
14
|
-
load_configuration
|
15
|
-
|
16
14
|
options = Startling::CliOptions.parse
|
17
15
|
options.merge!(attrs)
|
18
16
|
options.merge({argv: ARGV, args: ARGV})
|
19
17
|
|
20
|
-
load_commands
|
21
|
-
load_handlers
|
22
18
|
super(options)
|
23
19
|
end
|
24
20
|
|
25
21
|
def execute
|
22
|
+
load_configuration
|
23
|
+
load_commands
|
24
|
+
load_handlers
|
25
|
+
|
26
26
|
command_args = cli_options.merge(git: git)
|
27
27
|
|
28
28
|
check_for_local_mods
|
@@ -1,7 +1,9 @@
|
|
1
|
+
require 'logger'
|
2
|
+
|
1
3
|
module Startling
|
2
4
|
module Commands
|
3
5
|
class Base
|
4
|
-
attr_reader :cli_options
|
6
|
+
attr_reader :cli_options, :logger
|
5
7
|
|
6
8
|
def self.run(attrs={})
|
7
9
|
new(attrs).execute
|
@@ -13,32 +15,36 @@ module Startling
|
|
13
15
|
self.class.__send__(:attr_reader, attr)
|
14
16
|
instance_variable_set("@#{attr}", value)
|
15
17
|
end
|
18
|
+
|
19
|
+
@logger = Logger.new(STDOUT)
|
20
|
+
@logger.formatter = -> (severity, datetime, progname, msg) { "#{msg}\n" }
|
21
|
+
@logger.level = (attrs[:verbose]) ? Logger::DEBUG : Logger::INFO
|
16
22
|
end
|
17
23
|
|
18
24
|
def execute
|
19
25
|
raise NotImplementedError
|
20
26
|
end
|
21
27
|
|
22
|
-
def
|
28
|
+
def load_configuration
|
23
29
|
loaded_configuration_path = Startling::Configuration.load_configuration
|
24
30
|
if loaded_configuration_path
|
25
|
-
|
31
|
+
logger.debug "Loading configuration #{loaded_configuration_path}"
|
26
32
|
else
|
27
|
-
|
33
|
+
logger.debug "Using default configuration"
|
28
34
|
end
|
29
35
|
end
|
30
36
|
|
31
|
-
def
|
37
|
+
def load_commands
|
32
38
|
loaded_commands_path = Startling::Configuration.load_commands
|
33
39
|
if loaded_commands_path
|
34
|
-
|
40
|
+
logger.debug "Loading commands #{loaded_commands_path}"
|
35
41
|
end
|
36
42
|
end
|
37
43
|
|
38
|
-
def
|
44
|
+
def load_handlers
|
39
45
|
loaded_handlers_path = Startling::Configuration.load_handlers
|
40
46
|
if loaded_handlers_path
|
41
|
-
|
47
|
+
logger.debug "Loading handlers #{loaded_handlers_path}"
|
42
48
|
end
|
43
49
|
end
|
44
50
|
|
@@ -61,13 +67,13 @@ module Startling
|
|
61
67
|
end
|
62
68
|
|
63
69
|
def print_name_error_message(name, path)
|
64
|
-
|
70
|
+
logger.fatal "Error loading #{to_camel_case(name.to_s)}. Is it defined in #{path}?"
|
65
71
|
end
|
66
72
|
|
67
73
|
def print_args(context)
|
68
|
-
|
74
|
+
logger.debug "== Instance vars from #{context} ==>"
|
69
75
|
instance_variables.each do |var|
|
70
|
-
|
76
|
+
logger.debug "#{var}: #{instance_variable_get(var)}"
|
71
77
|
end
|
72
78
|
end
|
73
79
|
|
@@ -14,7 +14,7 @@ module Startling
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def open_pull_request
|
17
|
-
|
17
|
+
logger.info "Opening pull request..."
|
18
18
|
|
19
19
|
if git.current_branch_has_no_commits?
|
20
20
|
git.create_empty_commit(pull_request_handler.commit_message)
|
@@ -25,7 +25,7 @@ module Startling
|
|
25
25
|
pull_request = repo.open_pull_request title: pull_request_handler.title,
|
26
26
|
body: pull_request_handler.body, branch: @branch_name
|
27
27
|
|
28
|
-
|
28
|
+
logger.info pull_request.url if pull_request
|
29
29
|
|
30
30
|
pull_request
|
31
31
|
end
|
data/lib/startling/version.rb
CHANGED
data/spec/startling_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: startling
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Jensen
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-02-
|
13
|
+
date: 2016-02-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|