molflow 0.3.2 → 0.3.3
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 +1 -0
- data/README.md +3 -0
- data/lib/molflow/cli.rb +3 -0
- data/lib/molflow/command_options.rb +26 -0
- data/lib/molflow/commands/open.rb +50 -0
- data/lib/molflow/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 024824229e47e4e91fc550d35c4efa2775793c51
|
4
|
+
data.tar.gz: daf165eb1d5651c462875131fea58269186fe6eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f293fecb8687a18023f5e8d846e3544b26ba33d11a8fad4056754579461e3362fa34bdc5bfa11542d6d586ada4ff03a954a32bd587591a430e0f0287724de90
|
7
|
+
data.tar.gz: dd35c9cc641b5d85f2ab26b171b83c31e83c68b511ed7d193f171316e621c6b6d52a1caed19dbf112f225f058b25143cc0a39abd96d5755201e40a2a70d4c109
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -27,6 +27,9 @@
|
|
27
27
|
mf jira i ISSUE_KEY # show issue
|
28
28
|
mf jira is # list issues
|
29
29
|
mf jira ps # list projects
|
30
|
+
mf open i ISSUE_KEY # open issue in browser; Checked before open browser
|
31
|
+
mf open pr PROJECT # open project in browser; Checked before open browser
|
32
|
+
mf open j JIRA_KEY # open jira site. skip check api request
|
30
33
|
|
31
34
|
## Планы
|
32
35
|
|
data/lib/molflow/cli.rb
CHANGED
@@ -2,11 +2,13 @@ require 'thor'
|
|
2
2
|
require 'pry'
|
3
3
|
require 'molflow/command_options'
|
4
4
|
require 'molflow/commands/jira'
|
5
|
+
require 'molflow/commands/open'
|
5
6
|
|
6
7
|
module Molflow
|
7
8
|
class CLI < Thor
|
8
9
|
extend CommandOptions
|
9
10
|
register(Commands::Jira, 'jira', 'jira <resource>', 'show info jira resource')
|
11
|
+
register(Commands::Open, 'open', 'open <resource>', 'open resource in browser')
|
10
12
|
|
11
13
|
# molflow install
|
12
14
|
method_option 'path', install_options('path')
|
@@ -15,5 +17,6 @@ module Molflow
|
|
15
17
|
require 'molflow/commands/install'
|
16
18
|
Commands::Install.start
|
17
19
|
end
|
20
|
+
|
18
21
|
end
|
19
22
|
end
|
@@ -51,5 +51,31 @@ module Molflow
|
|
51
51
|
}
|
52
52
|
end
|
53
53
|
end
|
54
|
+
|
55
|
+
def open_options(key)
|
56
|
+
case key
|
57
|
+
when 'issue_key'
|
58
|
+
{
|
59
|
+
type: :string,
|
60
|
+
aliases: [''],
|
61
|
+
default: '',
|
62
|
+
desc: 'order issues'
|
63
|
+
}
|
64
|
+
when 'project_key'
|
65
|
+
{
|
66
|
+
type: :string,
|
67
|
+
aliases: [''],
|
68
|
+
default: '',
|
69
|
+
desc: 'order issues'
|
70
|
+
}
|
71
|
+
when 'jira_key'
|
72
|
+
{
|
73
|
+
type: :string,
|
74
|
+
aliases: [''],
|
75
|
+
default: '',
|
76
|
+
desc: 'order issues'
|
77
|
+
}
|
78
|
+
end
|
79
|
+
end
|
54
80
|
end
|
55
81
|
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'molflow/error'
|
2
|
+
require 'molflow/commands/jira/client'
|
3
|
+
require 'molflow/command_options'
|
4
|
+
require 'launchy'
|
5
|
+
require 'thor'
|
6
|
+
|
7
|
+
module Molflow
|
8
|
+
module Commands
|
9
|
+
class Open < Thor
|
10
|
+
include Thor::Actions
|
11
|
+
extend Jira::Client
|
12
|
+
extend CommandOptions
|
13
|
+
|
14
|
+
desc 'open p PROJECT_KEY', 'open project in browser'
|
15
|
+
def pr(project_key)
|
16
|
+
options.merge! project_key: project_key
|
17
|
+
|
18
|
+
client = Jira.client
|
19
|
+
project = client.Project.find(options[:project_key])
|
20
|
+
|
21
|
+
Launchy.open URI("#{client.options[:site]}/browse/#{project.key}").to_s
|
22
|
+
rescue
|
23
|
+
puts 'Not found'
|
24
|
+
end
|
25
|
+
|
26
|
+
desc 'open i ISSUE_KEY', 'open issue in browser'
|
27
|
+
def i(issue_key)
|
28
|
+
options.merge! issue_key: issue_key
|
29
|
+
|
30
|
+
client = Jira.client
|
31
|
+
issue = client.Issue.find(options[:issue_key])
|
32
|
+
|
33
|
+
Launchy.open URI("#{client.options[:site]}/browse/#{issue.key}").to_s
|
34
|
+
rescue
|
35
|
+
puts 'Not found'
|
36
|
+
end
|
37
|
+
|
38
|
+
desc 'open any JIRA element. skip api request', 'open browse page in jira'
|
39
|
+
def j(jira_key)
|
40
|
+
options.merge! jira_key: jira_key
|
41
|
+
|
42
|
+
client = Jira.client
|
43
|
+
Launchy.open URI("#{client.options[:site]}/browse/#{options[:jira_key]}").to_s
|
44
|
+
rescue
|
45
|
+
puts 'ERROR!'
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
data/lib/molflow/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: molflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Silaev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- lib/molflow/commands/jira/issue.rb
|
97
97
|
- lib/molflow/commands/jira/issues.rb
|
98
98
|
- lib/molflow/commands/jira/projects.rb
|
99
|
+
- lib/molflow/commands/open.rb
|
99
100
|
- lib/molflow/commands/task.rb
|
100
101
|
- lib/molflow/error.rb
|
101
102
|
- lib/molflow/version.rb
|